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
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Ximper Linux
mkimage-profiles
Commits
300ee8a8
Commit
300ee8a8
authored
Oct 30, 2019
by
Alexey Shabalin
Committed by
Anton Midyukov
Jan 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add grub feature
parent
adecafb3
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
280 additions
and
0 deletions
+280
-0
00defaults.cfg
features.in/grub/cfg.in/00defaults.cfg
+17
-0
20install2.cfg
features.in/grub/cfg.in/20install2.cfg
+6
-0
25install-vnc-connect.cfg
features.in/grub/cfg.in/25install-vnc-connect.cfg
+5
-0
25install-vnc-listen.cfg
features.in/grub/cfg.in/25install-vnc-listen.cfg
+6
-0
30live.cfg
features.in/grub/cfg.in/30live.cfg
+6
-0
32live_rw.cfg
features.in/grub/cfg.in/32live_rw.cfg
+4
-0
80rescue.cfg
features.in/grub/cfg.in/80rescue.cfg
+4
-0
82rescue_rw.cfg
features.in/grub/cfg.in/82rescue_rw.cfg
+4
-0
83rescue_fm.cfg
features.in/grub/cfg.in/83rescue_fm.cfg
+4
-0
85mediacheck.cfg
features.in/grub/cfg.in/85mediacheck.cfg
+4
-0
90memtest.cfg
features.in/grub/cfg.in/90memtest.cfg
+3
-0
95fwsetup.cfg
features.in/grub/cfg.in/95fwsetup.cfg
+3
-0
config.mk
features.in/grub/config.mk
+39
-0
generate.mk
features.in/grub/generate.mk
+100
-0
20-propagator-ramdisk
features.in/grub/scripts.d/20-propagator-ramdisk
+20
-0
20-propagator-rescue-hash
features.in/grub/scripts.d/20-propagator-rescue-hash
+14
-0
01-grub
features.in/grub/stage1/scripts.d/01-grub
+41
-0
No files found.
features.in/grub/cfg.in/00defaults.cfg
0 → 100644
View file @
300ee8a8
insmod echo
insmod gzio
insmod minicmd
insmod normal
insmod test
set timeout=@timeout@
if [ $grub_cpu = x86_64 -o $grub_cpu = i386 ]; then
if [ $grub_platform = efi ]; then
linux_suffix=efi
elif [ $grub_platform = pc ]; then
linux_suffix=16
else
linux_suffix=
else
linux_suffix=
fi
features.in/grub/cfg.in/20install2.cfg
0 → 100644
View file @
300ee8a8
default='linux'
menuentry 'Install ALT @relname@' --hotkey 'i' --id 'linux' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ vga=@bootvga@ @bootargs@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/25install-vnc-connect.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Install ALT @relname@ (headless with DHCP+VNC client) (edit to set server IP address)' --id 'vncconnect' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncconnect=IP
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/25install-vnc-listen.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Install ALT @relname@ (headless with DHCP+VNC) (password VNCPWD)' --id 'vncpasswd' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot automatic=method:cdrom ramdisk_size=@altinst_size@ showopts @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/30live.cfg
0 → 100644
View file @
300ee8a8
menuentry 'LiveCD (no hard disk needed)' --id 'live' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts lowmem vga=@bootvga@ @bootargs@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/32live_rw.cfg
0 → 100644
View file @
300ee8a8
menuentry 'LiveCD with sessions support' --id 'session' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@live_size@ stagename=live showopts live_rw vga=@bootvga@ @bootargs@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/80rescue.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Rescue LiveCD' --id 'rescue' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/82rescue_rw.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Rescue with sessions support' --id 'rescue_session' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot live automatic=method:cdrom,label:ALT* ramdisk_size=@rescue_size@ stagename=rescue splash=0 showopts @rescue_bootargs@ live_rw
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/83rescue_fm.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Forensic mode (leave disks alone)' --id 'rescue_forensic' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk fastboot live automatic=method:cdrom ramdisk_size=@rescue_size@ splash=0 showopts stagename=rescue @rescue_bootargs@ max_loop=16 forensic hash=@rescue_hash@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/85mediacheck.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Check this media for defects' --id 'mediachk' {
linux$linux_suffix /EFI/BOOT/vmlinuz changedisk live quiet lowmem automatic=method:cdrom mediacheck=1 stagename=mediacheck showopts @bootargs@
initrd$linux_suffix /EFI/BOOT/full.cz
}
features.in/grub/cfg.in/90memtest.cfg
0 → 100644
View file @
300ee8a8
menuentry 'Memory Test' --id 'memtest' {
linux$linux_suffix /EFI/BOOT/memtest86.efi
}
features.in/grub/cfg.in/95fwsetup.cfg
0 → 100644
View file @
300ee8a8
menuentry 'System setup' --id 'uefi-firmware' {
fwsetup
}
features.in/grub/config.mk
0 → 100644
View file @
300ee8a8
# default is plain text prompt
# NB: might be usbflash-ready hybrid iso
# on ppc64le syslinux feature is used only to generate config
#ifeq (,$(filter-out i586 x86_64 ppc64le aarch64,$(ARCH)))
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
use/grub: sub/stage1 $(ISOHYBRID:%=use/isohybrid)
@$(call add_feature)
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
@$(call add,STAGE1_PACKAGES,grub-efi shim-signed)
@$(call try,BOOTVGA,normal)
endif
@$(call set,RELNAME,ALT ($(IMAGE_NAME)))
@$(call set,IMAGE_PACKTYPE,boot)
else
use/grub: ; @:
endif
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
# UI is overwritten
use/grub/ui/%: use/grub
@$(call set,GRUB_UI,$*)
@if [ "$*" == gfxboot ]; then \
$(call add,STAGE1_PACKAGES,gfxboot); \
$(call add,STAGE1_BRANDING,bootloader); \
fi
else
use/grub/ui/%: use/grub; @:
endif
use/grub/%.cfg: use/grub
@$(call add,GRUB_CFG,$*)
use/grub/timeout/%: use/grub
@$(call set,GRUB_TIMEOUT,$*)
features.in/grub/generate.mk
0 → 100644
View file @
300ee8a8
ifdef BUILDDIR
# in deciseconds
DEFAULT_TIMEOUT = 90
# prepare data for grub installation;
# see also stage1/scripts.d/01-grub
include $(BUILDDIR)/distcfg.mk
ifndef BOOTLOADER
$(error grub feature enabled but BOOTLOADER undefined)
endif
ifndef GRUB_DIRECT
# SUBPROFILES are considered GRUB_CFG too
# (note these can appear like stage2@live);
# 01defaults.cfg is included indefinitely
GRUB_CFG := $(GRUB_CFG) $(SUBPROFILE_DIRS) defaults
endif
DSTDIR := $(BUILDDIR)/stage1/files/EFI/BOOT/.in
DSTCFGS := $(DSTDIR)/*.cfg
# we can do GRUB_{CFG,MODULES,FILES}
# CFG have only cfg snippet
cfg = $(wildcard cfg.in/??$(1).cfg)
# NB: list position determined by file numbering (*.cfg sorting)
#
# config snippets are copied into generated profile where they can
# be also tested against grub modules (some can be unavailable);
# we can't do tests right now since that implies host grub being
# identical to build system one which might be not the case...
#
# have to piggyback parameters as we're running in host system yet,
# and files involved will appear inside instrumental chroot
#
# arguments get evaluated before recipe body execution thus prep
all: debug timeout
@### proper text branding should be implemented
@echo $(GRUB_FILES) > $(DSTDIR)/grub.list
@sed -i \
-e 's,@mkimage-profiles@,$(IMAGE_NAME),' \
-e 's,@relname@,$(RELNAME),' \
$(DSTCFGS)
# integerity check
timeout: distro
@if [ "$(GRUB_TIMEOUT)" -ge 0 ] 2>/dev/null; then \
TIMEOUT="$(GRUB_TIMEOUT)"; \
else \
TIMEOUT="$(DEFAULT_TIMEOUT)"; \
fi; \
sed -i "s,@timeout@,$$TIMEOUT," $(DSTCFGS)
distro: bootargs
@if [ -n "$(META_VOL_SET)" ]; then \
DISTRO="$(META_VOL_SET)"; \
else \
DISTRO="ALT"; \
fi; \
sed -i "s,@distro@,$$DISTRO," $(DSTCFGS)
# pass over additional parameters, if any
bootargs: clean
@if [ -n "$(STAGE2_BOOTARGS)" ]; then \
sed -i "s,@bootargs@,$(STAGE2_BOOTARGS)," $(DSTCFGS); \
fi; \
sed -i "s,@bootargs@,," $(DSTCFGS)
@if [ -n "$(RESCUE_BOOTARGS)" ]; then \
sed -i "s,@rescue_bootargs@,$(RESCUE_BOOTARGS)," $(DSTCFGS); \
fi; \
sed -i "s,@rescue_bootargs@,," $(DSTCFGS)
@if [ -n "$(BOOTVGA)" ]; then \
sed -i "s,@bootvga@,$(BOOTVGA)," $(DSTCFGS); \
fi; \
sed -i "s,@bootvga@,,;s,vga= ,," $(DSTCFGS)
clean: copy
@if [ "$(GRUB_UI)" = gfxboot ]; then \
sed -i "s/\^//;/menu label /d" $(DSTCFGS); \
fi
copy: prep
@cp -pLt $(DSTDIR) -- $(sort \
$(foreach C,$(GRUB_CFG),$(call cfg,$(C))))
prep:
@mkdir -p $(DSTDIR)
debug:
@if [ -n "$(DEBUG)" ]; then \
echo "** BOOTLOADER: $(BOOTLOADER)"; \
echo "** GRUB_CFG: $(GRUB_CFG)"; \
echo "** GRUB_FILES: $(GRUB_FILES)"; \
fi
endif
features.in/grub/scripts.d/20-propagator-ramdisk
0 → 100755
View file @
300ee8a8
#!/bin/sh
# postprocess isolinux configuration
# when the image sizes are finally known
# NB: install2_size, live_size, rescue_size get defined here
cd
"
$WORKDIR
"
cfgs
=
"
$(
find EFI/BOOT
-name
'*.cfg'
)
"
[
-n
"
$cfgs
"
]
||
{
echo
"
${
0
##*/
}
: did not find any config under EFI/BOOT "
>
&2
exit
1
}
# 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
,"
$cfgs
done
features.in/grub/scripts.d/20-propagator-rescue-hash
0 → 100755
View file @
300ee8a8
#!/bin/sh
# postprocess isolinux configuration
# to add rescue image hash, if any
# (for propagator in forensic mode)
cd
"
$WORKDIR
"
grep
-qs
"@rescue_hash@"
EFI/BOOT/
*
.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
,"
EFI/BOOT/
*
.cfg
done
features.in/grub/stage1/scripts.d/01-grub
0 → 100755
View file @
300ee8a8
#!/bin/sh
# gather syslinux configuration from snippets;
# copy modules; see also this feature's generate.mk
CFG
=
"grub.cfg"
mkdir
-p
"
$WORKDIR
/EFI/BOOT"
cd
"
$WORKDIR
/EFI/BOOT"
# validate just in case (see also stage1 Makefile)
case
"
$GLOBAL_BOOTLOADER
"
in
isolinux|syslinux|ieee1275boot|grubaa64boot|grubx86boot
)
;;
*
)
echo
"error: weird GLOBAL_BOOTLOADER:
\`
$GLOBAL_BOOTLOADER
'"
>
&2
;
exit
1
;;
esac
# copy extra files, if any
GRUB_FILES
=
"
$(
cat
.in/grub.list
)
"
if
[
-n
"
${
GRUB_FILES
%
}
"
]
;
then
cp
-a
$GRUB_FILES
.
fi
# number ordering sponsored by shell's pathname expansion
grep
-hv
'^#'
.in/[0-9][0-9]
*
.cfg
>
"
$CFG
"
# there should be DEFAULT directive there (at least for alterator-netinst)
if
!
grep
-i
'^default'
"
$CFG
"
;
then
DEFAULT
=
"
$(
grep
-i
'^label '
"
$CFG
"
|
head
-1
|
cut
-f2
-d
' '
)
"
if
[
-n
"
$DEFAULT
"
]
;
then
echo
"default
$DEFAULT
"
>>
"
$CFG
"
else
echo
"error: no DEFAULT or UI directive and cannot guess"
>
&2
exit
1
fi
fi
# snippets are not going into the actual image
if
[
"
$DEBUG
"
!=
2
]
;
then
rm
-r
.in/
;
fi
# NB: there will be final macro expansion based on actual image sizes
# done by features.in/syslinux/scripts.d/20-propagator-ramdisk
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