summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorDrew Moseley <drew_moseley@mentor.com>2014-07-02 18:09:29 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-10 17:38:33 +0100
commitae724e46f477a389096da077167114ea54affa7a (patch)
tree74aaa42c743914bacff572f3c71773da0167f3e3 /meta/recipes-core/initrdscripts
parent90362a4de5cbed6815fb84be950030ebde5bc3fe (diff)
downloadpoky-ae724e46f477a389096da077167114ea54affa7a.tar.gz
init-install-efi.sh: fix to handle the boot partition correctly
(This patch was originally done against init-install.sh in OE-Core rev aa67b1333b4774e1845f562085f7048df65a644f) Previously, the boot partition was created for the target hard drive but there was no corresponding entry for it in /etc/fstab. Besides, even if the boot partition was mounted, it would just result in odd directory hierarchy like /boot/boot/grub. However, what we really need is /boot/grub. This patch fixes this problem. Besides, for future maintance work, this patch also renames some of the intermediate directories. It uses more descriptive names like /tgt_root and /src_root. The name of /ssd is dropped. (From OE-Core rev: 3b1bae7ad8d36930aae840175c6a3433c1469772) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh47
1 files changed, 25 insertions, 22 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 8bd70251cd..34c2ae3066 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -123,34 +123,32 @@ mkfs.ext3 $rootfs
123echo "Formatting swap partition...($swap)" 123echo "Formatting swap partition...($swap)"
124mkswap $swap 124mkswap $swap
125 125
126mkdir /ssd 126mkdir /tgt_root
127mkdir /rootmnt 127mkdir /src_root
128mkdir /bootmnt 128mkdir -p /boot
129
130mount $rootfs /ssd
131mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
132 129
130# Handling of the target root partition
131mount $rootfs /tgt_root
132mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
133echo "Copying rootfs files..." 133echo "Copying rootfs files..."
134cp -a /rootmnt/* /ssd 134cp -a /src_root/* /tgt_root
135 135if [ -d /tgt_root/etc/ ] ; then
136if [ -d /ssd/etc/ ] ; then 136 echo "$swap swap swap defaults 0 0" >> /tgt_root/etc/fstab
137 echo "$swap swap swap defaults 0 0" >> /ssd/etc/fstab 137 echo "$bootfs /boot vfat defaults 1 2" >> /tgt_root/etc/fstab
138
139 # We dont want udev to mount our root device while we're booting... 138 # We dont want udev to mount our root device while we're booting...
140 if [ -d /ssd/etc/udev/ ] ; then 139 if [ -d /tgt_root/etc/udev/ ] ; then
141 echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist 140 echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
142 fi 141 fi
143fi 142fi
144 143
145umount /ssd 144umount /src_root
146umount /rootmnt
147 145
146# Handling of the target boot partition
147mount $bootfs /boot
148echo "Preparing boot partition..." 148echo "Preparing boot partition..."
149mount $bootfs /ssd
150 149
151EFIDIR="/ssd/EFI/BOOT" 150EFIDIR="/boot/EFI/BOOT"
152mkdir -p $EFIDIR 151mkdir -p $EFIDIR
153cp /run/media/$1/vmlinuz /ssd
154# Copy the efi loader 152# Copy the efi loader
155cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR 153cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
156 154
@@ -171,11 +169,11 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
171fi 169fi
172 170
173if [ -d /run/media/$1/loader ]; then 171if [ -d /run/media/$1/loader ]; then
174 GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" 172 GUMMIBOOT_CFGS="/tgt_root/loader/entries/*.conf"
175 # copy config files for gummiboot 173 # copy config files for gummiboot
176 cp -dr /run/media/$1/loader /ssd 174 cp -dr /run/media/$1/loader /tgt_root
177 # delete the install entry 175 # delete the install entry
178 rm -f /ssd/loader/entries/install.conf 176 rm -f /tgt_root/loader/entries/install.conf
179 # delete the initrd lines 177 # delete the initrd lines
180 sed -i "/initrd /d" $GUMMIBOOT_CFGS 178 sed -i "/initrd /d" $GUMMIBOOT_CFGS
181 # delete any LABEL= strings 179 # delete any LABEL= strings
@@ -186,7 +184,12 @@ if [ -d /run/media/$1/loader ]; then
186 sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS 184 sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS
187fi 185fi
188 186
189umount /ssd 187umount /tgt_root
188
189cp /run/media/$1/vmlinuz /boot
190
191umount /boot
192
190sync 193sync
191 194
192echo "Remove your installation media, and press ENTER" 195echo "Remove your installation media, and press ENTER"