Skip to contentSkip to conversation

overlayfs: Allow not used mount points

PATCH Vyacheslav Yurkov 2 participants 3 messages Oct 11, 2022 – Oct 31, 2022 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Just checking if something is missing to include this fix to kirkstone.

Thanks,
Vyacheslav

Quoted 56 lines · Vyacheslav Yurkov via lists.openembedded.org

From: Vyacheslav Yurkov <[email protected]>

When machine configuration defines a mount point, which is not used in any recipe, allow to fall through and only report a note in the logs. This can be expected behavior, when a mount point is defined for several machines, but not used in all of them

---
  meta/classes/overlayfs.bbclass | 6 +++++-
  meta/lib/oe/overlayfs.py       | 6 +++++-
  2 files changed, 10 insertions(+), 2 deletions(-)
meta/classes/overlayfs.bbclass +5 -1
index f7069edd41..c3564b6ec1 100644
@@ -96,7 +96,11 @@ python do_create_overlayfs_units() {
      overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
      for mountPoint in overlayMountPoints:
          bb.debug(1, "Process variable flag %s" % mountPoint)
-        for lower in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        lowerList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not lowerList:
+            bb.note("No mount points defined for %s flag, skipping" % (mountPoint))
+            continue
+        for lower in lowerList.split():
              bb.debug(1, "Prepare mount unit for %s with data mount point %s" %
                       (lower, d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)))
              prepareUnits(d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint), lower)
meta/lib/oe/overlayfs.py +5 -2
index b5d5e88e80..590c0de58a 100644
@@ -38,7 +38,11 @@ def unitFileList(d):
              bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
 
      for mountPoint in overlayMountPoints:
-        for path in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        mountPointList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not mountPointList:
+            bb.debug(1, "No mount points defined for %s flag, don't add to file list", mountPoint)
+            continue
+        for path in mountPointList.split():
              fileList.append(mountUnitName(path))
              fileList.append(helperUnitName(path))
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#171457): https://lists.openembedded.org/g/openembedded-core/message/171457
Mute This Topic: https://lists.openembedded.org/mt/94132926/4455192
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 2 lines · Vyacheslav Yurkov

Just checking if something is missing to include this fix to kirkstone.

Yes, it needs to make it into the master branch first :-) I will then cherry-pick for langdale and kirstone.

Richard is on holiday until 24 Oct, so it will occur shortly thereafter. It is already queued for the master branch, so there is nothing else you need to do!

Steve

Quoted 58 lines · Vyacheslav Yurkov via lists.openembedded.org
Quoted 56 lines

From: Vyacheslav Yurkov <[email protected]>

When machine configuration defines a mount point, which is not used in any recipe, allow to fall through and only report a note in the logs. This can be expected behavior, when a mount point is defined for several machines, but not used in all of them

---
  meta/classes/overlayfs.bbclass | 6 +++++-
  meta/lib/oe/overlayfs.py       | 6 +++++-
  2 files changed, 10 insertions(+), 2 deletions(-)
meta/classes/overlayfs.bbclass +5 -1
index f7069edd41..c3564b6ec1 100644
@@ -96,7 +96,11 @@ python do_create_overlayfs_units() {
      overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
      for mountPoint in overlayMountPoints:
          bb.debug(1, "Process variable flag %s" % mountPoint)
-        for lower in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        lowerList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not lowerList:
+            bb.note("No mount points defined for %s flag, skipping" % (mountPoint))
+            continue
+        for lower in lowerList.split():
              bb.debug(1, "Prepare mount unit for %s with data mount point %s" %
                       (lower, d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)))
              prepareUnits(d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint), lower)
meta/lib/oe/overlayfs.py +5 -2
index b5d5e88e80..590c0de58a 100644
@@ -38,7 +38,11 @@ def unitFileList(d):
              bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
 
      for mountPoint in overlayMountPoints:
-        for path in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        mountPointList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not mountPointList:
+            bb.debug(1, "No mount points defined for %s flag, don't add to file list", mountPoint)
+            continue
+        for path in mountPointList.split():
              fileList.append(mountUnitName(path))
              fileList.append(helperUnitName(path))
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#171457): https://lists.openembedded.org/g/openembedded-core/message/171457
Mute This Topic: https://lists.openembedded.org/mt/94132926/4455192
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

The patch is now in master. Just a reminder to queue it to kirkstone as well.

Thanks,
Vyacheslav

Quoted 68 lines · Steve Sakoman
Quoted 1 line · Vyacheslav Yurkov

Just checking if something is missing to include this fix to kirkstone.

Yes, it needs to make it into the master branch first :-) I will then cherry-pick for langdale and kirstone.

Richard is on holiday until 24 Oct, so it will occur shortly thereafter. It is already queued for the master branch, so there is nothing else you need to do!

Steve

Quoted 57 lines · Vyacheslav Yurkov via lists.openembedded.org
Quoted 56 lines

From: Vyacheslav Yurkov <[email protected]>

When machine configuration defines a mount point, which is not used in any recipe, allow to fall through and only report a note in the logs. This can be expected behavior, when a mount point is defined for several machines, but not used in all of them

---
   meta/classes/overlayfs.bbclass | 6 +++++-
   meta/lib/oe/overlayfs.py       | 6 +++++-
   2 files changed, 10 insertions(+), 2 deletions(-)
meta/classes/overlayfs.bbclass +5 -1
index f7069edd41..c3564b6ec1 100644
@@ -96,7 +96,11 @@ python do_create_overlayfs_units() {
       overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
       for mountPoint in overlayMountPoints:
           bb.debug(1, "Process variable flag %s" % mountPoint)
-        for lower in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        lowerList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not lowerList:
+            bb.note("No mount points defined for %s flag, skipping" % (mountPoint))
+            continue
+        for lower in lowerList.split():
               bb.debug(1, "Prepare mount unit for %s with data mount point %s" %
                        (lower, d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)))
               prepareUnits(d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint), lower)
meta/lib/oe/overlayfs.py +5 -2
index b5d5e88e80..590c0de58a 100644
@@ -38,7 +38,11 @@ def unitFileList(d):
               bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
 
       for mountPoint in overlayMountPoints:
-        for path in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split():
+        mountPointList = d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint)
+        if not mountPointList:
+            bb.debug(1, "No mount points defined for %s flag, don't add to file list", mountPoint)
+            continue
+        for path in mountPointList.split():
               fileList.append(mountUnitName(path))
               fileList.append(helperUnitName(path))
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#171457): https://lists.openembedded.org/g/openembedded-core/message/171457
Mute This Topic: https://lists.openembedded.org/mt/94132926/4455192
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-