Skip to content

Commit

Permalink
virtme-init: Enable lvm usage
Browse files Browse the repository at this point in the history
Current /etc/lvm/ directories are restricted to root only (700), so just
create an empty directory and bind mount over. This is enough to make
commands like pvcreate to succeed.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
  • Loading branch information
marcosps committed Oct 18, 2024
1 parent 5f50149 commit 1107900
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions virtme/guest/virtme-init
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ fi
sed -e 's/^\([^:]\+\).*/\1:!:::::::/' < /etc/passwd > /run/tmp/shadow
mount --bind /run/tmp/shadow /etc/shadow &

# The /etc/lvm is usually only read/write by root. In order to allow commands like pvcreate to be
# run on rootless users just create a dummy directory and bind mount it in the same place.
mkdir /run/tmp/lvm
mount --bind /run/tmp/lvm /etc/lvm

# Find udevd
if [[ -x /usr/lib/systemd/systemd-udevd ]]; then
udevd=/usr/lib/systemd/systemd-udevd
Expand Down
2 changes: 1 addition & 1 deletion virtme_ng_init
Submodule virtme_ng_init updated 1 files
+9 −0 src/main.rs

0 comments on commit 1107900

Please sign in to comment.