Skip to content

image-boot: Don't make dual boot loop device world-readable #412

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions dracut/image-boot/eos-image-boot-setup
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ fi
# Setup a stable /dev/disk/endless-image symlink for our image device and
# partitions.
#
# This is used by eos-installer, which doesn't have the knowledge how
# to find the image inside a squashfs, so it uses this path. This also
# requires the device node to have appropriate permissions.
# This path is also used by the rest of the initramfs which is hardcoded
# This path is used by the rest of the initramfs which is hardcoded
# to find the rootfs at /dev/disk/endless-image3.
#
# On live systems, this is also used by eos-installer, which doesn't know how
# to find the image inside a squashfs, so it uses this path. In this case the
# device node must be world-readable, since eos-installer runs as an
# unprivileged user.
image_device_name="${image_device##*/}"
mkdir -p /run/udev/rules.d
cat <<EOF > /run/udev/rules.d/70-endless-image.rules
SUBSYSTEM=="block", KERNEL=="${image_device_name}", MODE="0664", SYMLINK+="disk/endless-image"
SUBSYSTEM=="block", KERNEL=="${image_device_name}p?", MODE="0664", SYMLINK+="disk/endless-image%n"
SUBSYSTEM=="block", KERNEL=="${image_device_name}", ${roflag:+MODE="0664",} SYMLINK+="disk/endless-image"
SUBSYSTEM=="block", KERNEL=="${image_device_name}p?", ${roflag:+MODE="0664",} SYMLINK+="disk/endless-image%n"
EOF

udevadm control --reload-rules
Expand Down