-
Notifications
You must be signed in to change notification settings - Fork 66
Preliminary support for systemd-boot bootloader. #23
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
base: master
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -8,12 +8,36 @@ set_bootloader() { | |
| grub2) | ||
| set_bootloader_grub2 | ||
| ;; | ||
| systemd-boot) | ||
| set_bootloader_systemd | ||
| ;; | ||
| *) | ||
| print_warning "Bootloader ${BOOTLOADER} is not currently supported" | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| set_bootloader_systemd() { | ||
|
|
||
|
Contributor
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. Empty line. |
||
| if [[ ! -x `which kernel-install` ]]; then | ||
| gen_die "Unable to locate kernel-install, is systemd installed?" | ||
| fi | ||
|
|
||
| # Clear out the mistakenly installed copies, since kernel-install copies its own versions over | ||
| # We do this first, to prevent people thinking they have enough free space but needing twice the amount | ||
|
Contributor
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. compile_kernel() in gen_compile.sh should be modified: @@ -416,19 +416,24 @@ compile_kernel() {
if isTrue "${CMD_INSTALL}"
then
- copy_image_with_preserve "kernel" \
- "${tmp_kernel_binary}" \
- "kernel-${KNAME}-${ARCH}-${KV}"
+ if [ -n "${BOOTLOADER}" -a "${BOOTLOADER}" = "systemd" ]
+ then
+ print_info 1 "$(getIndent 1)Not installing kernel; systemd's kernel-install will handle installation for us!"
+ else
+ copy_image_with_preserve "kernel" \
+ "${tmp_kernel_binary}" \
+ "kernel-${KNAME}-${ARCH}-${KV}"
- copy_image_with_preserve "System.map" \
- "${systemmap}" \
- "System.map-${KNAME}-${ARCH}-${KV}"
+ copy_image_with_preserve "System.map" \
+ "${systemmap}" \
+ "System.map-${KNAME}-${ARCH}-${KV}"
- if isTrue "${GENZIMAGE}"
- then
- copy_image_with_preserve "kernelz" \
- "${tmp_kernel_binary2}" \
- "kernelz-${KV}"
+ if isTrue "${GENZIMAGE}"
+ then
+ copy_image_with_preserve "kernelz" \
+ "${tmp_kernel_binary2}" \
+ "kernelz-${KV}"
+ fi
fi
else
cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
Author
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 feels like it's moving bootloader logic into the compile_kernel logic. I'm happy to do that, I just figured you'd want it all stand-alone in its own little area, so that the it doesn't set a precedent for the next bootloader that comes along to start tinkering with the internals too?
Contributor
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. You are right. The suggestion was based on genkernel-3, before I decided to touch so much code and create genkernel-4. Now I think we can do it correctly: But before we are able to do that we need to tackle https://bugs.gentoo.org/505810 - i.e. I'll remove install logic from You get my idea? tl;dr
Author
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. Yeah, I think I follow. Just give me a prod on here when it's ready for some reworking. I'm happy to pitch in, but don't want to step on your plans... 5:) |
||
| KERNEL_IMAGE=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}}) | ||
| rm "${BOOTDIR}/kernel-${KNAME}-${ARCH}-${KV}" | ||
| INITRD_FILE="" | ||
| if [[ -f "${BOOTDIR}/initramfs-${KNAME}-${ARCH}-${KV}" ]]; then | ||
| rm "${BOOTDIR}/initramfs-${KNAME}-${ARCH}-${KV}" | ||
| INITRD_FILE="${TMPDIR}/initramfs-${KV}" | ||
| fi | ||
|
|
||
| # Do the call | ||
| echo "Executing: kernel-install add $KV \"${KERNEL_IMAGE}\" \"${INITRD_FILE}\"" | ||
|
Contributor
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. Use print_info 2 "COMMAND: ${NICEOPTS}${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1like command to show command.. |
||
| kernel-install add $KV "${KERNEL_IMAGE}" "${INITRD_FILE}" | ||
|
Contributor
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. Add error check, |
||
| } | ||
|
|
||
| set_bootloader_read_fstab() { | ||
| local ROOTFS=$(awk 'BEGIN{RS="((#[^\n]*)?\n)"}( $2 == "/" ) { print $1; exit }' /etc/fstab) | ||
| local BOOTFS=$(awk 'BEGIN{RS="((#[^\n]*)?\n)"}( $2 == "'${BOOTDIR}'") { print $1; exit }' /etc/fstab) | ||
|
|
||
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.
Can't we just name it "systemd"?