Repository navigation
Misc GRUB + boot related changes #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0355525
GRUB boot: set default timeout of 20 seconds
mika 39d4902
Switch BIOS PXE boot default from pxelinux to GRUB
mika 3109638
Drop pxelinux support, use GRUB exclusively for BIOS PXE boot
mika d4beb69
GRUB: support custom themes + bring configuration closer to grml-live…
mika d58cabc
GRUB: add support for 32-bit firmware on 64-bit CPU hardware
mika File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # the following variables are available in the template: | ||
| # | ||
| # $INTERFACE_ (interface for the terminalserver) | ||
| # $IP_ (ip for the terminalserver to bind) | ||
| # $NETMASK_ (network mask) | ||
| # $GW_ (gateway) | ||
| # $NAMESERVERS_ (nameservers for the nodes) | ||
| # $IPRANGE_FROM_ (user configured iprange, first ip) | ||
| # $IPRANGE_TO_ (user configured iprange, last ip) | ||
| # $NETWORK_ (first ip in this subnet) | ||
| # $OPTIONS_ (options for grml-terminalserver) | ||
| # $BOOT_ARGS_ (boot arguments for the nodes) | ||
| # | ||
| # NOTE: | ||
| # templates are shellscript fragments and will be sourced from the | ||
| # terminalserver | ||
| # | ||
| # GLOBAL_README_END | ||
|
|
||
| if [ -e "$MOUNT_POINT_" ]; then | ||
| default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \ | ||
| noprompt noeject" | ||
| else | ||
| default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \ | ||
| init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \ | ||
| apm=power-off nomce" | ||
| fi | ||
|
|
||
| if ! [ -d /run/live/medium ] ; then | ||
| echo "Error: couldn't access /run/live/medium for executing grml2usb with it." >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| DEST_DIR=$(mktemp -d) | ||
| grml2usb --bootloader-only \ | ||
| --bootoptions="$default_boot_args_ $BOOT_ARGS_" \ | ||
| --remove-bootoption=nodhcp \ | ||
| /run/live/medium "$DEST_DIR" | ||
|
|
||
| mv "$DEST_DIR"/boot/ "$TFTPD_DATA_DIR_" | ||
|
|
||
| if [ -d "$DEST_DIR"/grub ] ; then | ||
| mkdir -p "$TFTPD_DATA_DIR_"/grub | ||
| cp -r "$DEST_DIR"/grub/. "$TFTPD_DATA_DIR_"/grub/ | ||
| fi | ||
|
|
||
| # Copy initrd.img and vmlinuz from all directories which name begins | ||
| # with grml, e.g. grml-full and grml-small | ||
| # This way we can boot multiple ISOs. | ||
| # Try MULTIBOOT_PATH_ first; if that yields nothing also search the standard | ||
| # /run/live/medium/boot/ location directly (MULTIBOOT_PATH_ may fall back to | ||
| # MOUNT_POINT_ when the grml2usb release/ layout is absent on newer ISOs). | ||
| for filename in "${MULTIBOOT_PATH_}"/grml* "${MOUNT_POINT_}/boot"/grml* ; do | ||
| [ -d "$filename" ] || continue | ||
| dest_="${TFTPD_DATA_DIR_}/boot/$(basename "${filename}")" | ||
| [ -d "$dest_" ] && continue | ||
| cp -r "${filename}" "${TFTPD_DATA_DIR_}/boot/" | ||
| done | ||
|
|
||
| # remove grub entries | ||
| rm -f "$TFTPD_DATA_DIR_/"addon_*grub*.cfg | ||
|
|
||
| rm -rf "$DEST_DIR" | ||
|
|
||
| # BIOS/Legacy GRUB netboot setup | ||
| if [ -d /usr/lib/grub/i386-pc ] ; then | ||
| if ! command -v grub-mknetdir >/dev/null 2>&1 ; then | ||
| echo "WARN: grub-pc-bin not found, cannot set up GRUB BIOS boot." | ||
| let ret_=$ret_+1 | ||
| else | ||
| if [ -r "${TFTPD_DATA_DIR_}/grub/i386-pc/core.0" ] ; then | ||
| echo "${TFTPD_DATA_DIR_}/grub/i386-pc/core.0 exists already, nothing to do." | ||
| else | ||
| echo "Generating GRUB i386-pc netboot image for BIOS PXE boot" | ||
| grub-mknetdir --net-directory="${TFTPD_DATA_DIR_}" --subdir=grub | ||
| fi | ||
| fi | ||
| fi | ||
|
|
||
| let ret_=$ret_+$? | ||
| return $ret_ | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we do this (Additionally for now i guess) also do this in grml-live and pack the relevant files into the iso? (not squashfs)
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.
yeah maybe, didn't look into this yet (and I guess I could use some second pair of eyes + another brain to make sure we don't add too much duplicated code and all of it still makes sense, so far I tried to get it working with what we have, also want to avoid having a too strict version dependency between Grml ISOs and grml-terminalserver)
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.
As discussed on 2026-09-03 at the Grml release sprint with @zeha, moved this to a separate issue: #28
And we'll submit this as-is for the time being.