diff options
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" |