summaryrefslogtreecommitdiff
path: root/config/binary_local-hooks/grub2-configs
blob: 88ee2a7e32849c9d19acc97af7e0a42ec50a4d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# Copying local grub2 configuration files

case "$LB_BOOTLOADER" in
grub2|burg)
	;;
*)
	exit 0
	;;
esac

if [ -f config/binary_grub/grub.cfg ]
then
	mkdir -p binary/boot/grub
        cp config/binary_grub/grub*.cfg binary/boot/grub/
        cp config/binary_grub/loopback.cfg binary/boot/grub/
fi

. config/chroot

if echo "$LB_PACKAGE_LISTS" | grep -qw extra_cz; then
	cp -f config/binary_grub/grub.cfg.cz binary/boot/grub/grub.cfg
fi

if echo "$LB_PACKAGE_LISTS" | grep -qw gfxdetect; then
	# keep gfxdetect entries in grub.cfg (for gfxdetect-builds)
	echo "grub2-configs: keeping gfxdetect entries"
else
	# remove gfxdetect entries from grub.cfg (for non-gfxdetect-builds)
	sed -i '/gfxdetect/,/^}/{d}' binary/boot/grub/grub.cfg
fi