diff options
author | Zoltan Tombol <zoltan.tombol@gmail.com> | 2014-07-09 17:38:13 +0200 |
---|---|---|
committer | Zoltan Tombol <zoltan.tombol@gmail.com> | 2014-07-10 02:09:50 +0200 |
commit | e72f8161b91e3cdb8a9bc4369ff5f9673a549e2c (patch) | |
tree | c1186f67a13a47ffd89eb3e7e6aa60b9f6aa3bf1 /contrib/mkimage-arch.sh | |
parent | de5f3020d92f14e7ff544d92440c5bf9e012d460 (diff) | |
download | docker-e72f8161b91e3cdb8a9bc4369ff5f9673a549e2c.tar.gz |
Fix expect script in mkimage-arch
Docker-DCO-1.1-Signed-off-by: Zoltan Tombol <zoltan.tombol@gmail.com> (github: ztombol)
Diffstat (limited to 'contrib/mkimage-arch.sh')
-rwxr-xr-x | contrib/mkimage-arch.sh | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/contrib/mkimage-arch.sh b/contrib/mkimage-arch.sh index 27c6ac6a3e..e83b2b6731 100755 --- a/contrib/mkimage-arch.sh +++ b/contrib/mkimage-arch.sh @@ -5,13 +5,13 @@ set -e hash pacstrap &>/dev/null || { - echo "Could not find pacstrap. Run pacman -S arch-install-scripts" - exit 1 + echo "Could not find pacstrap. Run pacman -S arch-install-scripts" + exit 1 } hash expect &>/dev/null || { - echo "Could not find expect. Run pacman -S expect" - exit 1 + echo "Could not find expect. Run pacman -S expect" + exit 1 } ROOTFS=$(mktemp -d ${TMPDIR:-/var/tmp}/rootfs-archlinux-XXXXXXXXXX) @@ -21,18 +21,19 @@ chmod 755 $ROOTFS PKGIGNORE=linux,jfsutils,lvm2,cryptsetup,groff,man-db,man-pages,mdadm,pciutils,pcmciautils,reiserfsprogs,s-nail,xfsprogs expect <<EOF - set timeout 60 - set send_slow {1 1} - spawn pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE - expect { - "Install anyway?" { send n\r; exp_continue } - "(default=all)" { send \r; exp_continue } - "Proceed with installation?" { send "\r"; exp_continue } - "skip the above package" {send "y\r"; exp_continue } - "checking" { exp_continue } - "loading" { exp_continue } - "installing" { exp_continue } - } + set send_slow {1 .1} + proc send {ignore arg} { + sleep .1 + exp_send -s -- \$arg + } + set timeout 60 + + spawn pacstrap -C ./mkimage-arch-pacman.conf -c -d -G -i $ROOTFS base haveged --ignore $PKGIGNORE + expect { + -exact "anyway? \[Y/n\] " { send -- "n\r"; exp_continue } + -exact "(default=all): " { send -- "\r"; exp_continue } + -exact "installation? \[Y/n\]" { send -- "y\r"; exp_continue } + } EOF arch-chroot $ROOTFS /bin/sh -c "haveged -w 1024; pacman-key --init; pkill haveged; pacman -Rs --noconfirm haveged; pacman-key --populate archlinux" |