ossobv / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
0 stars 0 forks source link

build: (minor) Improve overlay SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR #51

Open wdoekes opened 10 hours ago

wdoekes commented 10 hours ago

Description

The following would be nice and safe. Could be something for PR upstream, although not absolutely necessary:

--- a/rules/functions
+++ b/rules/functions
@@ -171,9 +171,9 @@ define SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR
 upperdir=$$(mktemp -d -p $(DPKG_ADMINDIR_PATH))
 workdir=$$(mktemp -d -p $(DPKG_ADMINDIR_PATH))
 mergedir=$$(mktemp -d -p $(DPKG_ADMINDIR_PATH))
-sudo mount -t overlay -o ro overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
+sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir
 export SONIC_DPKG_ADMINDIR=$$mergedir
-trap "sudo umount $$mergedir; rm --one-file-system -vrf $$mergedir $$upperdir $$workdir" EXIT
+trap "sudo umount $$mergedir && rm -rf $$mergedir $$upperdir $$workdir" EXIT
 endef

Which build are we running (if any)

master + 202405

Upstream issues/PRs