summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-install.sh')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh31
1 files changed, 25 insertions, 6 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 5e6b81c9d3..fb6cea8d31 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -1,6 +1,6 @@
1#!/bin/sh -e 1#!/bin/sh -e
2# 2#
3# Copyright (C) 2008 Intel 3# Copyright (C) 2008-2011 Intel
4# 4#
5# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode] 5# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
6# 6#
@@ -126,6 +126,7 @@ mkswap $swap
126 126
127mkdir /ssd 127mkdir /ssd
128mkdir /rootmnt 128mkdir /rootmnt
129mkdir /bootmnt
129 130
130mount $rootfs /ssd 131mount $rootfs /ssd
131mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt 132mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
@@ -142,6 +143,16 @@ if [ -d /ssd/etc/ ] ; then
142 fi 143 fi
143fi 144fi
144 145
146if [ -f /ssd/etc/grub.d/40_custom ] ; then
147 echo "Preparing custom grub2 menu..."
148 sed -i "s@__ROOTFS__@$rootfs@g" /ssd/etc/grub.d/40_custom
149 sed -i "s/__VIDEO_MODE__/$3/g" /ssd/etc/grub.d/40_custom
150 sed -i "s/__VGA_MODE__/$4/g" /ssd/etc/grub.d/40_custom
151 mount $bootfs /bootmnt
152 cp /ssd/etc/grub.d/40_custom /bootmnt/40_custom
153 umount /bootmnt
154fi
155
145umount /ssd 156umount /ssd
146umount /rootmnt 157umount /rootmnt
147 158
@@ -151,11 +162,19 @@ grub-install --root-directory=/ssd /dev/${device}
151 162
152echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map 163echo "(hd0) /dev/${device}" > /ssd/boot/grub/device.map
153 164
154echo "default 0" > /ssd/boot/grub/menu.lst 165if [ -f /ssd/40_custom ] ; then
155echo "timeout 30" >> /ssd/boot/grub/menu.lst 166 mv /ssd/40_custom /ssd/boot/grub/grub.cfg
156echo "title Live Boot/Install-Image" >> /ssd/boot/grub/menu.lst 167 sed -i "/#/d" /ssd/boot/grub/grub.cfg
157echo "root (hd0,0)" >> /ssd/boot/grub/menu.lst 168 sed -i "/exec tail/d" /ssd/boot/grub/grub.cfg
158echo "kernel /boot/vmlinuz root=$rootfs rw $3 $4 quiet" >> /ssd/boot/grub/menu.lst 169 chmod 0444 /ssd/boot/grub/grub.cfg
170else
171 echo "Preparing custom grub menu..."
172 echo "default 0" > /ssd/boot/grub/menu.lst
173 echo "timeout 30" >> /ssd/boot/grub/menu.lst
174 echo "title Live Boot/Install-Image" >> /ssd/boot/grub/menu.lst
175 echo "root (hd0,0)" >> /ssd/boot/grub/menu.lst
176 echo "kernel /boot/vmlinuz root=$rootfs rw $3 $4 quiet" >> /ssd/boot/grub/menu.lst
177fi
159 178
160cp /media/$1/vmlinuz /ssd/boot/ 179cp /media/$1/vmlinuz /ssd/boot/
161 180