-
Notifications
You must be signed in to change notification settings - Fork 159
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
coreos-boot-edit: relabel rdcore files #3155
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ karg() { | |
|
||
# Mount /boot. Note that we mount /boot but we don't unmount it because we | ||
# are run in a systemd unit with MountFlags=slave so it is unmounted for us. | ||
bootmnt=/mnt/boot_partition | ||
mkdir -p ${bootmnt} | ||
bootmnt=/sysroot/boot | ||
bootdev=/dev/disk/by-label/boot | ||
mount -o rw ${bootdev} ${bootmnt} | ||
|
||
|
@@ -44,3 +43,9 @@ fi | |
# 4. it adds GRUB bootuuid.cfg dropins so that GRUB selects the boot filesystem | ||
# by UUID | ||
rdcore bind-boot /sysroot ${bootmnt} | ||
|
||
# relabel files rdcore created; ideally in the future rdcore does this itself | ||
coreos-relabel /boot/.root_uuid | ||
if [ -e /sysroot/boot/grub2/bootuuid.cfg ]; then | ||
coreos-relabel /boot/grub2/bootuuid.cfg | ||
fi | ||
Comment on lines
+47
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the files that rdcore created are pretty static and we know the context the files should have I wonder if we should just hardcode it in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, in general I don't think it's a good idea to hardcode specific labels. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would typically agree, just wondering if in this specific instance (a few files in a known location) if it would be advantageous (i.e. to avoid the layering violations and also the complexity of an alternative more comprehensive solution in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one other option here could be to have the package that delivers this assumes that there aren't selinux denials that happen between when this is run and tmpfiles that would invalidate this as an option (maybe it does). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this running before the policy is loaded and that's why the created files don't have labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.