Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: (minor) Improve overlay SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR #51

Open
wdoekes opened this issue Nov 22, 2024 · 0 comments
Open

build: (minor) Improve overlay SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR #51

wdoekes opened this issue Nov 22, 2024 · 0 comments
Labels
has-fix Has a fix needs-upstream Has possible fixes but needs tickets/PRs upstream

Comments

@wdoekes
Copy link
Member

wdoekes commented Nov 22, 2024

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

@wdoekes wdoekes added needs-upstream Has possible fixes but needs tickets/PRs upstream has-fix Has a fix labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-fix Has a fix needs-upstream Has possible fixes but needs tickets/PRs upstream
Projects
None yet
Development

No branches or pull requests

1 participant