Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anton Palgunov
mkimage-profiles
Commits
dfa67141
Commit
dfa67141
authored
Feb 13, 2021
by
Anton Midyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grub: Use common grub.cfg for grub-pc and grub-efi
parent
aa12c024
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
39 additions
and
66 deletions
+39
-66
00defaults.cfg
features.in/grub/cfg.in/00defaults.cfg
+1
-0
20install2.cfg
features.in/grub/cfg.in/20install2.cfg
+1
-1
25install-vnc-connect.cfg
features.in/grub/cfg.in/25install-vnc-connect.cfg
+1
-1
25install-vnc-listen.cfg
features.in/grub/cfg.in/25install-vnc-listen.cfg
+1
-1
30live.cfg
features.in/grub/cfg.in/30live.cfg
+1
-1
32live_rw.cfg
features.in/grub/cfg.in/32live_rw.cfg
+1
-1
80rescue.cfg
features.in/grub/cfg.in/80rescue.cfg
+1
-1
82rescue_rw.cfg
features.in/grub/cfg.in/82rescue_rw.cfg
+1
-1
83rescue_fm.cfg
features.in/grub/cfg.in/83rescue_fm.cfg
+1
-1
84rescue_remote.cfg
features.in/grub/cfg.in/84rescue_remote.cfg
+1
-1
85mediacheck.cfg
features.in/grub/cfg.in/85mediacheck.cfg
+1
-1
91shell_efi.cfg
features.in/grub/cfg.in/91shell_efi.cfg
+5
-0
config.mk
features.in/grub/config.mk
+1
-0
generate.mk
features.in/grub/generate.mk
+4
-4
20-propagator-ramdisk-grub
features.in/grub/scripts.d/20-propagator-ramdisk-grub
+4
-7
20-propagator-rescue-hash-grub
features.in/grub/scripts.d/20-propagator-rescue-hash-grub
+4
-7
01-grub
features.in/grub/stage1/scripts.d/01-grub
+10
-38
No files found.
features.in/grub/cfg.in/00defaults.cfg
View file @
dfa67141
...
...
@@ -4,6 +4,7 @@ insmod minicmd
insmod normal
insmod test
set timeout=@timeout@
if [ "$grub_platform" = "efi" ]; then set EFI_BOOTARGS='@efi_bootargs@'; fi
if [ "$grub_platform" = "efi" -a "$grub_cpu" = "x86_64" ]; then
set linux_suffix='efi'
fi
...
...
features.in/grub/cfg.in/20install2.cfg
View file @
dfa67141
...
...
@@ -3,7 +3,7 @@ default='linux'
menuentry $"Install "'@distro@' --hotkey 'i' --id 'linux' {
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
features.in/grub/cfg.in/25install-vnc-connect.cfg
View file @
dfa67141
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
}
features.in/grub/cfg.in/25install-vnc-listen.cfg
View file @
dfa67141
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
}
features.in/grub/cfg.in/30live.cfg
View file @
dfa67141
menuentry $"LiveCD (no hard disk needed)" --id 'live' {
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
...
...
features.in/grub/cfg.in/32live_rw.cfg
View file @
dfa67141
menuentry $"LiveCD with sessions support" --id 'session' {
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
features.in/grub/cfg.in/80rescue.cfg
View file @
dfa67141
menuentry $"Rescue LiveCD" --id 'rescue' {
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
features.in/grub/cfg.in/82rescue_rw.cfg
View file @
dfa67141
menuentry $"Rescue with sessions support" --id 'rescue_session' {
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
features.in/grub/cfg.in/83rescue_fm.cfg
View file @
dfa67141
menuentry $"Forensic mode (leave disks alone)" --id 'rescue_forensic' {
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 ..."
initrd$linux_suffix @boot_path@/full.cz
}
features.in/grub/cfg.in/84rescue_remote.cfg
View file @
dfa67141
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 ..."
initrd$linux_suffix @boot_path@/full$KFLAVOUR.cz
}
features.in/grub/cfg.in/85mediacheck.cfg
View file @
dfa67141
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
}
features.in/grub/cfg.in/91shell_efi.cfg
0 → 100644
View file @
dfa67141
if [ "$grub_platform" = "efi" ]; then
menuentry $"Memory Test" --id 'memtest' {
chainloader /EFI/tools/efi-shell.efi
}
fi
features.in/grub/config.mk
View file @
dfa67141
...
...
@@ -16,6 +16,7 @@ use/grub/ui/%: use/grub
@$(call set,GRUB_UI,$*)
@if [ "$*" == gfxboot ]; then \
$(call add,STAGE1_BRANDING,bootloader); \
$(call add,STAGE1_PACKAGES,grub-common); \
fi
use/grub/%.cfg: use/grub
...
...
features.in/grub/generate.mk
View file @
dfa67141
...
...
@@ -73,12 +73,12 @@ distro: bootargs
# pass over additional parameters, if any
bootargs: clean
@if [ -n "$(EFI_BOOTARGS)" ]; then \
echo "$(EFI_BOOTARGS)" > $(DSTDIR)/EFI_BOOTARGS; \
fi
sed -i "s,@efi_bootargs@,$(EFI_BOOTARGS)," $(DSTCFGS); \
fi; \
sed -i "s,@efi_bootargs@,," $(DSTCFGS)
@if [ -n "$(STAGE2_BOOTARGS)" ]; then \
sed -i "s,$(STAGE2_BOOTARGS),," $(DSTCFGS); \
sed -i "s,@bootargs@,$(STAGE2_BOOTARGS)," $(DSTCFGS); \
[ -f $(DSTDIR)/EFI_BOOTARGS ] && \
sed -i "s/$(STAGE2_BOOTARGS)//" $(DSTDIR)/EFI_BOOTARGS; \
fi; \
sed -i "s,@bootargs@,," $(DSTCFGS)
@if [ -n "$(RESCUE_BOOTARGS)" ]; then \
...
...
features.in/grub/scripts.d/20-propagator-ramdisk-grub
View file @
dfa67141
#!/bin/sh
# postprocess
isolinux
configuration
# postprocess
grub
configuration
# when the image sizes are finally known
# NB: install2_size, live_size, rescue_size get defined here
cd
"
$WORKDIR
"
cfg
=
'boot/grub/grub.cfg'
[
-f
boot/grub/grub.cfg
-o
-f
EFI/BOOT/grub.cfg
]
||
exit
0
cfgs
=
[
!
-f
boot/grub/grub.cfg
]
||
cfgs+
=
'boot/grub/grub.cfg '
[
!
-f
EFI/BOOT/grub.cfg
]
||
cfgs+
=
'EFI/BOOT/grub.cfg'
[
-f
"
$cfg
"
]
||
exit
0
# apply size census while looking for potential squashfs images
find
-maxdepth
1
-type
f
-size
+1M
\
|
sed
's,^\./,,'
\
|
while
read
image
;
do
size
=
"
$[
$(
stat
-c
%s
"
$image
"
)
/ 1024 + 1 ]"
sed
-i
"s,@
${
image
}
_size@,
$size
,"
$cfg
s
sed
-i
"s,@
${
image
}
_size@,
$size
,"
$cfg
done
features.in/grub/scripts.d/20-propagator-rescue-hash-grub
View file @
dfa67141
#!/bin/sh
# postprocess
isolinux
configuration
# postprocess
grub
configuration
# to add rescue image hash, if any
# (for propagator in forensic mode)
cd
"
$WORKDIR
"
cfg
=
'boot/grub/grub.cfg'
[
-f
boot/grub/grub.cfg
-o
-f
EFI/BOOT/grub.cfg
]
||
exit
0
cfgs
=
[
!
-f
boot/grub/grub.cfg
]
||
cfgs+
=
'boot/grub/grub.cfg '
[
!
-f
EFI/BOOT/grub.cfg
]
||
cfgs+
=
'EFI/BOOT/grub.cfg'
[
-f
"
$cfg
"
]
||
exit
0
find
-maxdepth
1
-type
f
-name
rescue
\
|
while
read
image
;
do
rescue_hash
=
"
$(
sha256sum
-b
"
$image
"
|
cut
-f1
-d
' '
)
"
sed
-i
"s,@rescue_hash@,
$rescue_hash
,"
$cfg
s
sed
-i
"s,@rescue_hash@,
$rescue_hash
,"
$cfg
done
features.in/grub/stage1/scripts.d/01-grub
View file @
dfa67141
...
...
@@ -3,16 +3,8 @@
# copy modules; see also this feature's generate.mk
CFG
=
"
$WORKDIR
/boot/grub/grub.cfg"
CFG_EFI
=
"
$WORKDIR
/EFI/BOOT/grub.cfg"
if
[
-n
"
$GLOBAL_EFI_BOOTLOADER
"
-a
!
"
$GLOBAL_EFI_BOOTLOADER
"
=
"grub-efi"
]
;
then
rm
-fr
"
$WORKDIR
/boot"
exit
0
fi
if
[
-z
"
$GLOBAL_EFI_BOOTLOADER
"
]
;
then
if
[
"
$GLOBAL_EFI_BOOTLOADER
"
!=
'grub-efi'
]
;
then
case
"
$GLOBAL_BOOTLOADER
"
in
ieee1275boot|grubpcboot
)
;;
*
)
rm
-fr
"
$WORKDIR
/boot"
...
...
@@ -29,17 +21,7 @@ if [ -n "${GRUB_FILES% }" ]; then
fi
# number ordering sponsored by shell's pathname expansion
case
"
$GLOBAL_BOOTLOADER
"
in
ieee1275boot
)
grep
-hv
'^#'
$(
find .in/
*
.cfg
-not
-name
*
_efi.cfg
-not
-name
*
_bios.cfg
)
>
"
$CFG
"
;;
grubpcboot
)
grep
-hv
'^#'
$(
find .in/
*
.cfg
-not
-name
*
_efi.cfg
)
>
"
$CFG
"
;;
esac
if
[
"
$GLOBAL_EFI_BOOTLOADER
"
=
"grub-efi"
]
;
then
mkdir
-p
"
$WORKDIR
/EFI/BOOT"
grep
-hv
'^#'
$(
find .in/
*
.cfg
-not
-name
*
_bios.cfg
)
>
"
$CFG_EFI
"
fi
grep
-hv
'^#'
$(
find .in/
*
.cfg
)
>
"
$CFG
"
# there should be DEFAULT directive there (at least for alterator-netinst)
default_change
()
{
...
...
@@ -65,30 +47,20 @@ if ! grep -i '^default' "$CFG"; then
fi
}
if
[
-f
"
$CFG
"
]
;
then
default_change
"
$CFG
"
sed
-i
's,@boot_path@,/boot,g'
"
$CFG
"
sed
-i
's,@efi_bootargs@,,g'
"
$CFG
"
fi
default_change
"
$CFG
"
if
[
-f
.in/EFI_BOOTARGS
]
;
then
EFI_BOOTARGS
=
$(
cat
.in/EFI_BOOTARGS
)
fi
case
"
$GLOBAL_BOOTLOADER
"
in
ieee1275boot|grubpcboot
)
BOOT_PATH
=
/boot
;;
*
)
BOOT_PATH
=
/EFI/BOOT
;;
esac
if
[
-f
"
$CFG_EFI
"
]
;
then
default_change
"
$CFG_EFI
"
sed
-i
's,@boot_path@,/EFI/BOOT,g'
"
$CFG_EFI
"
[
-n
"
$EFI_BOOTARGS
"
]
&&
sed
-i
"s,@efi_bootargs@,
$EFI_BOOTARGS
,g"
"
$CFG_EFI
"
sed
-i
"s, @efi_bootargs@,,g"
"
$CFG_EFI
"
fi
sed
-i
"s,@boot_path@,
$BOOT_PATH
,g"
"
$CFG
"
# snippets are not going into the actual image
if
[
"
$DEBUG
"
!=
2
]
;
then
rm
-r
.in/
cd
$WORKDIR
[
-f
"
$CFG
"
]
||
rm
-r
boot/grub
[
!
$(
ls
-A
boot/ |
wc
-l
)
-eq
0
]
||
rm
-r
boot/
fi
# NB: there will be final macro expansion based on actual image sizes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment