aboutsummaryrefslogtreecommitdiff
path: root/scripts/setup-ami.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setup-ami.sh')
-rwxr-xr-xscripts/setup-ami.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/setup-ami.sh b/scripts/setup-ami.sh
index 72157a5..2c0a1a6 100755
--- a/scripts/setup-ami.sh
+++ b/scripts/setup-ami.sh
@@ -72,10 +72,15 @@ setup_partitions() {
72 *) echo "$start,$line"; start= ;; 72 *) echo "$start,$line"; start= ;;
73 esac 73 esac
74 done 74 done
75 ) | sfdisk --quiet --label $DISKLABEL $diskdev 75 ) | sfdisk --quiet --label dos $diskdev
76 76
77 # create device nodes if not exist 77 # we assume that the build host will create the new devices within 5s
78 mdev -s 78 local tries=5
79 while [ ! -e "${diskdev}1" ]; do
80 [ $tries -eq 0 ] && break || sleep 1
81 tries=$(( $tries - 1 ))
82 done
83 [ -e "${diskdev}1" ] || die "Expected new device ${diskdev}1 not created"
79} 84}
80 85
81make_filesystem() { 86make_filesystem() {
@@ -227,7 +232,7 @@ install_grub_efi() {
227 #mkdir -p "$target"/boot/efi 232 #mkdir -p "$target"/boot/efi
228 233
229 # disable nvram so grub doesn't call efibootmgr 234 # disable nvram so grub doesn't call efibootmgr
230 chroot "$target" /sbin/grub-install --target=$grub_target --efi-directory=/boot/efi \ 235 chroot "$target" /usr/sbin/grub-install --target=$grub_target --efi-directory=/boot/efi \
231 --bootloader-id=alpine --boot-directory=/boot --no-nvram 236 --bootloader-id=alpine --boot-directory=/boot --no-nvram
232 237
233 # fallback mode 238 # fallback mode
@@ -325,6 +330,8 @@ cleanup() {
325 "$target"/root/.ash_history \ 330 "$target"/root/.ash_history \
326 "$target"/etc/*- 331 "$target"/etc/*-
327 332
333 [ "$BOOTLOADER" = 'grub-efi' ] && umount "$target"/boot/efi
334
328 umount \ 335 umount \
329 "$target"/dev \ 336 "$target"/dev \
330 "$target"/proc \ 337 "$target"/proc \