-
Notifications
You must be signed in to change notification settings - Fork 397
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
01bootetc: introduce module for updating dracut etc #792
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Update initramfs etc | ||
Before=iscsi.service iscsid.service lvm2-activation-early.service | ||
Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target | ||
After=systemd-udev-trigger.service systemd-udev-settle.service | ||
Before=local-fs-pre.target dracut-initqueue.service | ||
|
||
DefaultDependencies=no | ||
Conflicts=shutdown.target | ||
|
||
ConditionKernelCommandLine=bootetc | ||
ConditionPathExists=!/run/bootetc.done | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/sbin/boot-etc | ||
ExecStart=/usr/bin/touch /run/bootetc.done | ||
|
||
[Install] | ||
WantedBy=sysinit.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
. /lib/dracut-lib.sh | ||
|
||
bootetc=$(getarg bootetc=) | ||
if [ "${bootetc}x" == "x" ]; then | ||
exit 0 | ||
fi | ||
|
||
mount_boot bootetc | ||
if [ -d /boot/initrd-etc ] && [ ! -f /run/bootetc.done ]; then | ||
info "bootetc: Updating initramfs etc from ${bootetc}/initrd-etc" | ||
copytree /boot/initrd-etc /etc | ||
touch /run/bootetc.done | ||
|
||
if [ -z "$DRACUT_SYSTEMD" ]; then | ||
systemctl try-restart dracut-cmdline.service | ||
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. This part is probably the most unfortunate. I don't know all of what's going on in Can't we have this bit run 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. Nope, I looked at the boot-path. |
||
systemctl try-restart systemd-udev-trigger.service | ||
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. Hm, why does udev need to be retriggered? 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. probably so the device that contains the boot partition can be found? 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. oh 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. Udev rules :) |
||
fi | ||
fi | ||
|
||
umount /boot >/dev/null 2>&1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# called by dracut | ||
check() { | ||
return 0 | ||
} | ||
|
||
# called by dracut | ||
depends() { | ||
return 0 | ||
} | ||
|
||
# called by dracut | ||
install() { | ||
inst_simple "$moddir/boot-etc.sh" "/sbin/boot-etc" | ||
|
||
if dracut_module_included "systemd"; then | ||
inst_simple "${moddir}/boot-etc.service" "${systemdsystemunitdir}/boot-etc.service" | ||
systemctl -q --root "$initdir" enable boot-etc.service | ||
else | ||
inst_hook pre-trigger 01 "$moddir/boot-etc.sh" | ||
fi | ||
|
||
} |
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.
OK, so we require an explicit opt-in karg like
bootetc=1
; and you see us changing FCOS to pass that by default? Or it only gets injected when e.g. dm-multipath is in use?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.
It's more like
bootetc=LABEL=....
. I envision this being an opt-in. We could use it for FCOS, but I'm particularly keen on not making that decision today.