aboutsummaryrefslogtreecommitdiffstats
path: root/main/grub/grub.post-upgrade
blob: 59614d035e800f9683f6bc03135e2f3bea9104d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

if [ -f /etc/default/grub ]; then
	. /etc/default/grub
fi

if [ -z "$GRUB_CMDLINE_LINUX_DEFAULT" ]; then
	set -- $(cat /proc/cmdline)
	bootopts=
	for opt; do
		case "$opt" in
		initrd=*|BOOT_IMAGE=*|root=*|rootflags=*) ;;
		*) bootopts="$bootopts $opt";;
		esac
	done
	mkdir -p /etc/default
	echo "GRUB_CMDLINE_LINUX_DEFAULT=\"$bootopts\"" >> /etc/default/grub
fi