From caa6c95cc852a10cee60880a778151c94f2589d8 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Tue, 24 Oct 2017 23:03:49 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ install-and-chroot.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .gitignore create mode 100755 install-and-chroot.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b3d78d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +alpine-chroot-install +alpine/* diff --git a/install-and-chroot.sh b/install-and-chroot.sh new file mode 100755 index 0000000..cd47fbe --- /dev/null +++ b/install-and-chroot.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +alpine_install='alpine-chroot-install' +alpine_directory='alpine' + +# DL alpine install script +if ! test -f "$alpine_install"; then + wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.6.0/alpine-chroot-install -O "$alpine_install" \ + && echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c \ + || exit 1 + chmod +x "$alpine_install" +fi + +# Install Alpine +if ! test -d "./alpine"; then + sh ./$alpine_install +fi + +# Set rc_sys="prefix" to not disturb systemd on current system +sudo sed -e 's/#rc_sys=""/rc_sys="prefix"/g' -i "$alpine_directory/etc/rc.conf" + +# Launch chroot +sh ./$alpine_directory/enter-chroot