diff options
author | Drew Moseley <drew_moseley@mentor.com> | 2014-07-02 18:09:29 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-10 17:38:33 +0100 |
commit | ae724e46f477a389096da077167114ea54affa7a (patch) | |
tree | 74aaa42c743914bacff572f3c71773da0167f3e3 /meta | |
parent | 90362a4de5cbed6815fb84be950030ebde5bc3fe (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install-efi.sh | 47 |
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 | |||
123 | echo "Formatting swap partition...($swap)" | 123 | echo "Formatting swap partition...($swap)" |
124 | mkswap $swap | 124 | mkswap $swap |
125 | 125 | ||
126 | mkdir /ssd | 126 | mkdir /tgt_root |
127 | mkdir /rootmnt | 127 | mkdir /src_root |
128 | mkdir /bootmnt | 128 | mkdir -p /boot |
129 | |||
130 | mount $rootfs /ssd | ||
131 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt | ||
132 | 129 | ||
130 | # Handling of the target root partition | ||
131 | mount $rootfs /tgt_root | ||
132 | mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root | ||
133 | echo "Copying rootfs files..." | 133 | echo "Copying rootfs files..." |
134 | cp -a /rootmnt/* /ssd | 134 | cp -a /src_root/* /tgt_root |
135 | 135 | if [ -d /tgt_root/etc/ ] ; then | |
136 | if [ -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 |
143 | fi | 142 | fi |
144 | 143 | ||
145 | umount /ssd | 144 | umount /src_root |
146 | umount /rootmnt | ||
147 | 145 | ||
146 | # Handling of the target boot partition | ||
147 | mount $bootfs /boot | ||
148 | echo "Preparing boot partition..." | 148 | echo "Preparing boot partition..." |
149 | mount $bootfs /ssd | ||
150 | 149 | ||
151 | EFIDIR="/ssd/EFI/BOOT" | 150 | EFIDIR="/boot/EFI/BOOT" |
152 | mkdir -p $EFIDIR | 151 | mkdir -p $EFIDIR |
153 | cp /run/media/$1/vmlinuz /ssd | ||
154 | # Copy the efi loader | 152 | # Copy the efi loader |
155 | cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR | 153 | cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR |
156 | 154 | ||
@@ -171,11 +169,11 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then | |||
171 | fi | 169 | fi |
172 | 170 | ||
173 | if [ -d /run/media/$1/loader ]; then | 171 | if [ -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 |
187 | fi | 185 | fi |
188 | 186 | ||
189 | umount /ssd | 187 | umount /tgt_root |
188 | |||
189 | cp /run/media/$1/vmlinuz /boot | ||
190 | |||
191 | umount /boot | ||
192 | |||
190 | sync | 193 | sync |
191 | 194 | ||
192 | echo "Remove your installation media, and press ENTER" | 195 | echo "Remove your installation media, and press ENTER" |