This reverts commit 962e1186f9a0a43344e19dcf70bac159f0eafb4e.
Conflicts:
contrib/mkimage-arch.sh
Docker-DCO-1.1-Signed-off-by: Zoltan Tombol <zoltan.tombol@gmail.com> (github: ztombol)
| ... | ... |
@@ -9,13 +9,31 @@ hash pacstrap &>/dev/null || {
|
| 9 | 9 |
exit 1 |
| 10 | 10 |
} |
| 11 | 11 |
|
| 12 |
+hash expect &>/dev/null || {
|
|
| 13 |
+ echo "Could not find expect. Run pacman -S expect" |
|
| 14 |
+ exit 1 |
|
| 15 |
+} |
|
| 16 |
+ |
|
| 12 | 17 |
ROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-archlinux-XXXXXXXXXX)
|
| 13 | 18 |
chmod 755 $ROOTFS |
| 14 | 19 |
|
| 15 | 20 |
# packages to ignore for space savings |
| 16 | 21 |
PKGIGNORE=linux,jfsutils,lvm2,cryptsetup,groff,man-db,man-pages,mdadm,pciutils,pcmciautils,reiserfsprogs,s-nail,xfsprogs |
| 17 | 22 |
|
| 18 |
-pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE |
|
| 23 |
+expect <<EOF |
|
| 24 |
+ set timeout 60 |
|
| 25 |
+ set send_slow {1 1}
|
|
| 26 |
+ spawn pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE |
|
| 27 |
+ expect {
|
|
| 28 |
+ "Install anyway?" { send n\r; exp_continue }
|
|
| 29 |
+ "(default=all)" { send \r; exp_continue }
|
|
| 30 |
+ "Proceed with installation?" { send "\r"; exp_continue }
|
|
| 31 |
+ "skip the above package" {send "y\r"; exp_continue }
|
|
| 32 |
+ "checking" { exp_continue }
|
|
| 33 |
+ "loading" { exp_continue }
|
|
| 34 |
+ "installing" { exp_continue }
|
|
| 35 |
+ } |
|
| 36 |
+EOF |
|
| 19 | 37 |
|
| 20 | 38 |
arch-chroot $ROOTFS /bin/sh -c "haveged -w 1024; pacman-key --init; pkill haveged; pacman -Rs --noconfirm haveged; pacman-key --populate archlinux" |
| 21 | 39 |
arch-chroot $ROOTFS /bin/sh -c "ln -s /usr/share/zoneinfo/UTC /etc/localtime" |