Commit 5fd76345 authored by Anton Midyukov's avatar Anton Midyukov

grub, syslinux: initrd setup arguments support

parent 27e167b2
......@@ -3,7 +3,7 @@ default='linux'
menuentry $"Install "'@distro@' --hotkey 'i' --id 'linux' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/vmlinuz$KFLAVOUR changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@ $EFI_BOOTARGS lang=$lang
linux$linux_suffix /boot/vmlinuz$KFLAVOUR fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@ $EFI_BOOTARGS lang=$lang
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"VNC install "'@distro@'$" (edit to set server IP address)" --id 'vncconnect' {
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ $EFI_BOOTARGS headless no_alt_virt_keyboard vncconnect=IP lang=$lang
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"VNC install "'@distro@'$" (edit to set password and connect here)" --id 'vncpasswd' {
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ $EFI_BOOTARGS headless no_alt_virt_keyboard vncpassword=VNCPWD lang=$lang
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"LiveCD (no hard disk needed)" --id 'live' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR fastboot live @initrd_bootargs@ @stagename@=live ramdisk_size=@live_size@ showopts lowmem vga=@bootvga@ @bootargs@ $EFI_BOOTARGS lang=$lang
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
......
menuentry $"LiveCD with sessions support" --id 'session' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR fastboot live @initrd_bootargs@ @stagename@=live ramdisk_size=@live_size@ showopts live_rw vga=@bootvga@ @bootargs@ $EFI_BOOTARGS lang=$lang
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"Rescue LiveCD" --id 'rescue' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR changedisk fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ $EFI_BOOTARGS
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"Rescue with sessions support" --id 'rescue_session' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR changedisk fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ $EFI_BOOTARGS live_rw
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"Forensic mode (leave disks alone)" --id 'rescue_forensic' {
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux$linux_suffix /boot/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/vmlinuz fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ $EFI_BOOTARGS max_loop=16 forensic hash=@rescue_hash@
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/full.cz
}
menuentry $"Rescue with remote SSH access (DHCP)" --id 'rescue_remote' {
linux$linux_suffix /boot/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/vmlinuz$KFLAVOUR fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ $EFI_BOOTARGS max_loop=16 ip=dhcp port=22 rootpw=AUTO hash=@rescue_hash@
echo $"Loading initial ramdisk ..."
initrd$linux_suffix /boot/@initrd@$KFLAVOUR.@initrd_ext@
}
menuentry $"Check this media for defects" --id 'mediachk' {
linux$linux_suffix /boot/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@ $EFI_BOOTARGS
linux$linux_suffix /boot/vmlinuz live @initrd_bootargs@ @stagename@=mediacheck quiet lowmem mediacheck=1 showopts @bootargs@ $EFI_BOOTARGS
initrd$linux_suffix /boot/full.cz
}
......@@ -31,6 +31,11 @@ ifneq ($(words $(KFLAVOURS)),1)
GRUB_CFG := $(GRUB_CFG) kernel
endif
ifeq (initrd-propagator,$(STAGE1_INITRD))
STAGE1_INITRD_BOOTARGS := changedisk automatic=method:cdrom
STAGE1_INITRD_STAGE2_OPTION := stagename
endif
DSTDIR := $(BUILDDIR)/stage1/files/boot/grub/.in
DSTCFGS := $(DSTDIR)/*.cfg
......@@ -109,6 +114,8 @@ bootargs: clean
sed -i "s,@initrd@,initrd," $(DSTCFGS); \
sed -i "s,@initrd_ext@,img," $(DSTCFGS); \
fi
@sed -i "s|@initrd_bootargs@|$(STAGE1_INITRD_BOOTARGS)|g" $(DSTCFGS)
@sed -i "s,@stagename@,$(STAGE1_INITRD_STAGE2_OPTION),g" $(DSTCFGS)
clean: copy
@if [ "$(GRUB_UI)" = gfxboot ]; then \
......
......@@ -3,5 +3,5 @@ default linux
label linux
menu label ^Install @relname@
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts vga=@bootvga@ @bootargs@
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts vga=@bootvga@ @bootargs@
label vncconnect
menu label VNC client (edit to set server IP address)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
label vncpasswd
menu label Install @relname@ (headless with DHCP+VNC) (password VNCPWD)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
label vncconnect
menu label ^VNC install (edit to set server IP address)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
label vncpasswd
menu label VNC install (<Tab>, set pass^word and connect here)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=altinst ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
label live
menu label ^LiveCD (no hard disk needed)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=live ramdisk_size=@live_size@ showopts lowmem vga=@bootvga@ @bootargs@
label session
menu label LiveCD with ^sessions support
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=live ramdisk_size=@live_size@ showopts live_rw vga=@bootvga@ @bootargs@
label rescue
menu label ^Rescue LiveCD
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@
label rescue_session
menu label Rescue with sess^ions support
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ live_rw
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ live_rw
label rescue_forensic
menu label ^Forensic mode (leave disks alone)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ max_loop=16 forensic hash=@rescue_hash@
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ max_loop=16 forensic hash=@rescue_hash@
label rescue_remote
menu label Rescue with remote SSH ^access (DHCP)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ quiet ip=dhcp port=22 rootpw=AUTO
append initrd=/boot/@initrd@ fastboot live @initrd_bootargs@ @stagename@=rescue ramdisk_size=@rescue_size@ splash=0 showopts @rescue_bootargs@ quiet ip=dhcp port=22 rootpw=AUTO
......@@ -31,6 +31,11 @@ endif
DSTDIR := $(BUILDDIR)/stage1/files/syslinux/.in
DSTCFGS := $(DSTDIR)/*.cfg
ifeq (initrd-propagator,$(STAGE1_INITRD))
STAGE1_INITRD_BOOTARGS := changedisk automatic=method:cdrom
STAGE1_INITRD_STAGE2_OPTION := stagename
endif
# we can do SYSLINUX_{CFG,MODULES,FILES}
# CFG have only cfg snippet
# FILES have only filenames (absolute or relative to /usr/lib/syslinux/)
......@@ -95,6 +100,8 @@ bootargs: clean
else \
sed -i "s,@initrd@,initrd.img," $(DSTCFGS); \
fi
@sed -i "s|@initrd_bootargs@|$(STAGE1_INITRD_BOOTARGS)|g" $(DSTCFGS)
@sed -i "s,@stagename@,$(STAGE1_INITRD_STAGE2_OPTION),g" $(DSTCFGS)
clean: copy
@if [ "$(SYSLINUX_UI)" = gfxboot ]; then \
......
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