Commit aa12c024 authored by Anton Midyukov's avatar Anton Midyukov

grub: Use variable $linux_suffix

Needed for use one grub.cfg config for all grub platforms.
parent 83109b6b
...@@ -4,4 +4,8 @@ insmod minicmd ...@@ -4,4 +4,8 @@ insmod minicmd
insmod normal insmod normal
insmod test insmod test
set timeout=@timeout@ set timeout=@timeout@
if [ "$grub_platform" = "efi" -a "$grub_cpu" = "x86_64" ]; then
set linux_suffix='efi'
fi
if [ "$grub_platform" = "pc" ]; then set linux_suffix='16'; fi
if [ ! "$lang" ]; then lang=@LOCALE@; fi if [ ! "$lang" ]; then lang=@LOCALE@; fi
...@@ -3,7 +3,7 @@ default='linux' ...@@ -3,7 +3,7 @@ default='linux'
menuentry $"Install "'@distro@' --hotkey 'i' --id 'linux' { menuentry $"Install "'@distro@' --hotkey 'i' --id 'linux' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"VNC install "'@distro@'$" (edit to set server IP address)" --id 'vncconnect' { menuentry $"VNC install "'@distro@'$" (edit to set server IP address)" --id 'vncconnect' {
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ @efi_bootargs@ headless no_alt_virt_keyboard vncconnect=IP lang=$lang linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ @efi_bootargs@ headless no_alt_virt_keyboard vncconnect=IP lang=$lang
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"VNC install "'@distro@'$" (edit to set password and connect here)" --id 'vncpasswd' { menuentry $"VNC install "'@distro@'$" (edit to set password and connect here)" --id 'vncpasswd' {
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ @efi_bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD lang=$lang linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ @efi_bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD lang=$lang
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"LiveCD (no hard disk needed)" --id 'live' { menuentry $"LiveCD (no hard disk needed)" --id 'live' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"LiveCD with sessions support" --id 'session' { menuentry $"LiveCD with sessions support" --id 'session' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@ @efi_bootargs@ lang=$lang
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"Rescue LiveCD" --id 'rescue' { menuentry $"Rescue LiveCD" --id 'rescue' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ @efi_bootargs@ linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ @efi_bootargs@
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"Rescue with sessions support" --id 'rescue_session' { menuentry $"Rescue with sessions support" --id 'rescue_session' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ @efi_bootargs@ live_rw linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ @efi_bootargs@ live_rw
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"Forensic mode (leave disks alone)" --id 'rescue_forensic' { menuentry $"Forensic mode (leave disks alone)" --id 'rescue_forensic' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..." echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux@linux_suffix@ @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ @efi_bootargs@ max_loop=16 forensic hash=@rescue_hash@ linux$linux_suffix @boot_path@/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ @efi_bootargs@ max_loop=16 forensic hash=@rescue_hash@
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full.cz initrd$linux_suffix @boot_path@/full.cz
} }
menuentry $"Rescue with remote SSH access (DHCP)" --id 'rescue_remote' { menuentry $"Rescue with remote SSH access (DHCP)" --id 'rescue_remote' {
linux@linux_suffix@ @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ @efi_bootargs@ max_loop=16 ip=dhcp port=22 rootpw=AUTO hash=@rescue_hash@ linux$linux_suffix @boot_path@/vmlinuz$KFLAVOUR changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ @efi_bootargs@ max_loop=16 ip=dhcp port=22 rootpw=AUTO hash=@rescue_hash@
echo $"Loading initial ramdisk ..." echo $"Loading initial ramdisk ..."
initrd@linux_suffix@ @boot_path@/full$KFLAVOUR.cz initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
} }
menuentry $"Check this media for defects" --id 'mediachk' { menuentry $"Check this media for defects" --id 'mediachk' {
linux@linux_suffix@ @boot_path@/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@ @efi_bootargs@ linux$linux_suffix @boot_path@/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@ @efi_bootargs@
initrd@linux_suffix@ @boot_path@/full.cz initrd$linux_suffix @boot_path@/full.cz
} }
...@@ -83,18 +83,6 @@ if [ -f "$CFG_EFI" ]; then ...@@ -83,18 +83,6 @@ if [ -f "$CFG_EFI" ]; then
sed -i "s, @efi_bootargs@,,g" "$CFG_EFI" sed -i "s, @efi_bootargs@,,g" "$CFG_EFI"
fi fi
# change @linux_suffix@
case "$GLOBAL_ARCH" in
i586|x86_64)
[ ! -f "$CFG" ] || sed -i 's/@linux_suffix@/16/g' "$CFG"
[ ! -f "$CFG_EFI" ] || sed -i 's/@linux_suffix@/efi/g' "$CFG_EFI"
;;
*)
[ ! -f "$CFG" ] || sed -i 's/@linux_suffix@//g' "$CFG"
[ ! -f "$CFG_EFI" ] || sed -i 's/@linux_suffix@//g' "$CFG_EFI"
;;
esac
# snippets are not going into the actual image # snippets are not going into the actual image
if [ "$DEBUG" != 2 ]; then if [ "$DEBUG" != 2 ]; then
rm -r .in/ rm -r .in/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment