diff options
Diffstat (limited to 'meta/recipes-core/initrdscripts/files')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install.sh | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index c1f8cba5d3..2c4486a149 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh | |||
@@ -151,14 +151,19 @@ if [ -d /ssd/etc/ ] ; then | |||
151 | fi | 151 | fi |
152 | fi | 152 | fi |
153 | 153 | ||
154 | if [ -f /ssd/etc/grub.d/40_custom ] ; then | 154 | if [ -f /etc/grub.d/40_custom ] ; then |
155 | echo "Preparing custom grub2 menu..." | 155 | echo "Preparing custom grub2 menu..." |
156 | sed -i "s@__ROOTFS__@$rootfs $rootwait@g" /ssd/etc/grub.d/40_custom | 156 | GRUBCFG="/bootmnt/boot/grub/grub.cfg" |
157 | sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom | ||
158 | sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom | ||
159 | sed -i "s/__CONSOLE__/$5/g" /ssd/etc/grub.d/40_custom | ||
160 | mount $bootfs /bootmnt | 157 | mount $bootfs /bootmnt |
161 | cp /ssd/etc/grub.d/40_custom /bootmnt/40_custom | 158 | mkdir -p $(dirname $GRUBCFG) |
159 | cp /etc/grub.d/40_custom $GRUBCFG | ||
160 | sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG | ||
161 | sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG | ||
162 | sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG | ||
163 | sed -i "s/__CONSOLE__/$5/g" $GRUBCFG | ||
164 | sed -i "/#/d" $GRUBCFG | ||
165 | sed -i "/exec tail/d" $GRUBCFG | ||
166 | chmod 0444 $GRUBCFG | ||
162 | umount /bootmnt | 167 | umount /bootmnt |
163 | fi | 168 | fi |
164 | 169 | ||
@@ -171,12 +176,8 @@ grub-install --root-directory=/ssd /dev/${device} | |||
171 | 176 | ||
172 | echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map | 177 | echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map |
173 | 178 | ||
174 | if [ -f /ssd/40_custom ] ; then | 179 | # If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst |
175 | mv /ssd/40_custom /ssd/boot/grub/grub.cfg | 180 | if [ ! -f /ssd/boot/grub/grub.cfg ] ; then |
176 | sed -i "/#/d" /ssd/boot/grub/grub.cfg | ||
177 | sed -i "/exec tail/d" /ssd/boot/grub/grub.cfg | ||
178 | chmod 0444 /ssd/boot/grub/grub.cfg | ||
179 | else | ||
180 | echo "Preparing custom grub menu..." | 181 | echo "Preparing custom grub menu..." |
181 | echo "default 0" > /ssd/boot/grub/menu.lst | 182 | echo "default 0" > /ssd/boot/grub/menu.lst |
182 | echo "timeout 30" >> /ssd/boot/grub/menu.lst | 183 | echo "timeout 30" >> /ssd/boot/grub/menu.lst |