Skip to content
Merged
Show file tree
Hide file tree
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
73 changes: 51 additions & 22 deletions live/config-cdroot/fix_bootconfig.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e

dst="$1"

if [ ! -d "$dst" ] ; then
if [ ! -d "$dst" ]; then
echo "fix_bootconfig.aarch64: image dir \"$dst\" not found"
exit 1
fi
Expand All @@ -19,7 +19,7 @@ fi
# but that's not the case.
test -f $dst/.profile && . $dst/.profile

arch=`uname -m`
arch=$(uname -m)
profile=$(echo "$kiwi_profiles" | tr "_" " ")
label="$profile ($arch)"

Expand All @@ -34,14 +34,12 @@ fi
#
cat >$dst/boot/grub2/grub.cfg <<XXX
# Agama generated grub2 config file
insmod serial
insmod read

set btrfs_relative_path="y"
export btrfs_relative_path
set default=0
if [ -n "\$extra_cmdline" ]; then
submenu "Bootable snapshot \$snapshot_num" {
menuentry "If OK, run snapper rollback and reboot." { true; }
}
fi
if [ -n "\${iso_path}" ]; then
isoboot="iso-scan/filename=\${iso_path}"
fi
Expand Down Expand Up @@ -74,19 +72,30 @@ fi
if [ -f (\$root)/boot/grub2/themes/$theme/theme.txt ];then
set theme=(\$root)/boot/grub2/themes/$theme/theme.txt
fi
terminal_input console
terminal_output gfxterm

# if the first serial port is successfully configured allow input/output to it as well
if serial --unit=0 --speed=9600; then
terminal_input console serial
terminal_output gfxterm serial
set extra_output=serial
# this detects that a serial port is present but that does not mean a serial
# console is attached there so we cannot for example disable plymouth
else
terminal_input console
terminal_output gfxterm
fi

menuentry "Install $label" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} splash=silent
linux (\$root)/boot/aarch64/loader/linux \${isoboot} splash=silent \${plymouth}
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
menuentry "Failsafe -- Install $label" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} ide=nodma apm=off noresume edd=off nomodeset 3
linux (\$root)/boot/aarch64/loader/linux \${isoboot} ide=nodma apm=off noresume edd=off nomodeset 3
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
Expand All @@ -100,28 +109,48 @@ menuentry "Check Installation Medium" --class os --unrestricted {
menuentry "Rescue System" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS
linux (\$root)/boot/aarch64/loader/linux \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS
echo Loading initrd...
initrd (\$root)/boot/aarch64/loader/initrd
}
if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
source "/.snapshots/grub-snapshot.cfg"
fi

hiddenentry "Text mode" --hotkey "t" {
set textmode=true
set plymouth="plymouth.enable=0"
terminal_output console \${extra_output}
}

hiddenentry "Set Live system password" --hotkey "p" {
echo "Enter root password for the installer live system:"
read -s live_password
echo "Confirm password:"
read -s live_password_confirmed

if [ "\${live_password}" != "\${live_password_confirmed}" ]; then
echo "ERROR: The passwords do not match!"
echo "Press Enter to return ..."
read -s
else
if [ -z "\${live_password}" ]; then
echo "ERROR: The password cannot be empty!"
echo "Press Enter to return ..."
read -s
else
set live_options="live.password=\${live_password}"
fi
fi
}

if [ "\${grub_platform}" = "efi" ]; then
hiddenentry "Text mode" --hotkey "t" {
set textmode=true
terminal_output console
}
menuentry "UEFI Firmware Settings" {
fwsetup --is-supported
if [ "\$?" = 0 ]; then
fwsetup
else
echo "Your firmware doesn't support setup menu entry from a boot loader"
echo "Press any key to return ..."
read
echo "Press Enter to return ..."
read -s
fi
}
fi
XXX

94 changes: 69 additions & 25 deletions live/config-cdroot/fix_bootconfig.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e

dst="$1"

if [ ! -d "$dst" ] ; then
if [ ! -d "$dst" ]; then
echo "fix_bootconfig.x86_64: image dir \"$dst\" not found"
exit 1
fi
Expand All @@ -19,7 +19,7 @@ fi
# but that's not the case.
test -f $dst/.profile && . $dst/.profile

arch=`uname -m`
arch=$(uname -m)
profile=$(echo "$kiwi_profiles" | tr "_" " ")
label="$profile ($arch)"

Expand All @@ -34,14 +34,12 @@ fi
#
cat >$dst/boot/grub2/grub.cfg <<XXX
# Agama generated grub2 config file
insmod serial
insmod read

set btrfs_relative_path="y"
export btrfs_relative_path
set default=0
if [ -n "\$extra_cmdline" ]; then
submenu "Bootable snapshot \$snapshot_num" {
menuentry "If OK, run snapper rollback and reboot." { true; }
}
fi
if [ -n "\${iso_path}" ]; then
isoboot="iso-scan/filename=\${iso_path}"
fi
Expand Down Expand Up @@ -74,58 +72,104 @@ fi
if [ -f (\$root)/boot/grub2/themes/$theme/theme.txt ];then
set theme=(\$root)/boot/grub2/themes/$theme/theme.txt
fi
terminal_input console
terminal_output gfxterm

# if serial port is successfully configured allow input/output to it as well
if serial --unit=0 --speed=9600; then
terminal_input console serial
terminal_output gfxterm serial
set extra_output=serial
# this detects that a serial port is present but that does not mean a serial
# console is attached there so we cannot for example disable plymouth
else
terminal_input console
terminal_output gfxterm
fi

if [ "\${grub_platform}" != "efi" ]; then
menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os {
exit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange that for me it works. Do you have disk as boot device in BIOS? if so, then exit should continue to boot with another device in boot order ( at least it works for me when I am testing it in qemu )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... Yes, the boot order is set to "Optical" then "Harddisk". Without any medium it boots the system from disk (SLES 16.0). But when booting from DVD and using "Boot from Hard Disk" grub option I get just a black screen. When using exit from command line it gets stuck as well.

However, with the chainloader it works fine.

agama-bios-boot-exit

}
# classic BIOS boot, try booting from MBR from the first disk
menuentry "Boot from Hard Disk" --class os --unrestricted {
insmod file

# check if the first disk contains a valid boot sector
if file --is-x86-bios-bootsector (hd0)+1; then
chainloader (hd0)+1
else
echo "The first disk does not seem to be bootable."
echo ""
echo "If you are sure the system can boot from hard disk"
echo "then remove the installation medium and reboot the machine."
echo ""
echo "Press Enter to return ..."
read -s
fi
}
fi

menuentry "Install $label" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} splash=silent
linux (\$root)/boot/x86_64/loader/linux \${isoboot} splash=silent \${plymouth} \${live_options}
echo Loading initrd...
initrd (\$root)/boot/x86_64/loader/initrd
}
menuentry "Failsafe -- Install $label" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} ide=nodma apm=off noresume edd=off nomodeset 3
linux (\$root)/boot/x86_64/loader/linux \${isoboot} ide=nodma apm=off noresume edd=off nomodeset 3 \${live_options}
echo Loading initrd...
initrd (\$root)/boot/x86_64/loader/initrd
}
menuentry "Check Installation Medium" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/x86_64/loader/linux mediacheck=1 plymouth.enable=0 \${isoboot}
linux (\$root)/boot/x86_64/loader/linux mediacheck=1 plymouth.enable=0 \${isoboot} \${live_options}
echo Loading initrd...
initrd (\$root)/boot/x86_64/loader/initrd
}
menuentry "Rescue System" --class os --unrestricted {
set gfxpayload=keep
echo Loading kernel...
linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS
linux (\$root)/boot/x86_64/loader/linux \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS
echo Loading initrd...
initrd (\$root)/boot/x86_64/loader/initrd
}

if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
source "/.snapshots/grub-snapshot.cfg"
fi
hiddenentry "Text mode" --hotkey "t" {
set textmode=true
set plymouth="plymouth.enable=0"
terminal_output console \${extra_output}
}

hiddenentry "Set Live system password" --hotkey "p" {
echo "Enter the new root password for the installer live system:"
read -s live_password
echo "Retype the password again:"
read -s live_password_confirmed

if [ "\${live_password}" != "\${live_password_confirmed}" ]; then
echo "ERROR: The passwords do not match!"
echo "Press Enter to return ..."
read -s
else
if [ -z "\${live_password}" ]; then
echo "ERROR: The password cannot be empty!"
echo "Press Enter to return ..."
read -s
else
set live_options="live.password=\${live_password}"
fi
fi
}

if [ "\${grub_platform}" = "efi" ]; then
hiddenentry "Text mode" --hotkey "t" {
set textmode=true
terminal_output console
}
menuentry "UEFI Firmware Settings" {
fwsetup --is-supported
if [ "\$?" = 0 ]; then
fwsetup
else
echo "Your firmware doesn't support setup menu entry from a boot loader"
echo "Press any key to return ..."
read
echo "Press Enter to return ..."
read -s
fi
}
fi
Expand Down
16 changes: 16 additions & 0 deletions live/src/agama-installer.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Feb 19 12:55:14 UTC 2026 - Ladislav Slezák <lslezak@suse.com>

- Fixes and improvements in the boot menu for x86_64 and aarch64:
- Fixed boot from hard disk in the legacy BIOS mode (x86_64 only)
- Added "p" keyboard shortcut to interactively configure the root
password for the installer live system
- Added support for serial console
- Disable plymouth graphical boot when the grub boot menu is
switched to text mode with the "t" keyboard shortcut

- Fixed failed image build because of missing configuration options
for the "image-janitor" tool

(gh#agama-project/agama#3192)

-------------------------------------------------------------------
Wed Feb 18 20:32:37 UTC 2026 - Josef Reidinger <jreidinger@suse.com>

Expand Down
4 changes: 2 additions & 2 deletions live/src/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ rpm -e --nodeps alsa alsa-utils alsa-ucm-conf || true
# make sense on a server.
du -h -s /lib/modules /lib/firmware

# remove the multimedia drivers
image-janitor -v driver-cleanup --delete
# remove the multimedia drivers, use the default configuration files
image-janitor -v driver-cleanup --delete --config-files /usr/share/image-janitor/module.list,/usr/share/image-janitor/module.list.extra

# remove the unused firmware(not referenced by kernel drivers)
image-janitor -v fw-cleanup --delete
Expand Down