-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an integration test for Alpine Linux
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
trap 'quit' EXIT ERR | ||
|
||
quit() { | ||
set +o errexit | ||
sudo umount $mount | ||
rm -rf $mount | ||
sudo losetup -d $lodev | ||
} | ||
|
||
truncate --size 200M $OUTPUT | ||
mkfs.ext4 $OUTPUT | ||
lodev=$(sudo losetup -f --show $OUTPUT) | ||
mount=$(mktemp -d) | ||
sudo mount $lodev $mount | ||
|
||
sudo mkdir -p $mount/etc/apk/ | ||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" | sudo tee -a $mount/etc/apk/repositories | ||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" | sudo tee -a $mount/etc/apk/repositories | ||
sudo apk --root $mount --initdb --update-cache --allow-untrusted add alpine-base util-linux-misc | ||
|
||
sudo chroot $mount /bin/sh -eu <<EOT | ||
cd /etc/init.d | ||
/bin/ln -s agetty agetty.ttyS0 | ||
/sbin/rc-update add agetty.ttyS0 default | ||
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters