Installation de l'environnement de développement de YunoRock
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
889 B

#!/usr/bin/env sh
SCRIPT=${SCRIPTNAME:-'alpine-chroot-install'}
DIR=${DIRPATH:-'/alpine'}
# Tests
if ! [[ $DIR == /* ]]; then
echo "DIRPATH is not an absolute URL. It should start with a '/'" && exit 1
fi
# DL alpine install script
if ! test -f "$SCRIPT"; then
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.9.0/alpine-chroot-install -O "$SCRIPT" \
&& echo "e5dfbbdc0c4b3363b99334510976c86bfa6cb251 ${SCRIPT}" | sha1sum -c \
|| exit 1
chmod +x "$SCRIPT"
fi
# Install Alpine
if ! test -d "$DIR"; then
sudo sh ./$SCRIPT -d $DIR -p build-base -p git -p zsh -p lua-filesystem -p luarocks5.1 -p lua-toml -p moonscript -p abuild -p lua-argparse || exit 1
fi
# Set rc_sys="prefix" to not disturb systemd on current system
sudo sed -e 's/#rc_sys=""/rc_sys="prefix"/g' -i "$DIR/etc/rc.conf"
# Launch chroot
sh $DIR/enter-chroot ./build
exit 0