dotfiles

Alpine Linux dotfiles

git clone git://git.lin.moe/dotfiles.git

 1#!/usr/bin/env sh
 2
 3set -e
 4
 5DOAS=${DOAS:-"doas"}
 6
 7if [[ "$#" == "1" ]];  then
 8	_chroot="$1"
 9elif [ -z "$CHROOT" ] ; then
10	>&2 echo '$CHROOT unset'
11	exit 1
12fi
13
14if [ ! -d "$_chroot" ] ; then
15	>&2 echo "Directory $_chroot not exists"
16	exit 1
17fi
18
19
20$DOAS mount -t proc proc $_chroot/proc/
21$DOAS mount -t sysfs sys $_chroot/sys/
22$DOAS mount -o bind /dev/ $_chroot/dev/
23$DOAS mount -o bind /dev/pts/ $_chroot/dev/pts/
24$DOAS mount -o bind /run $_chroot/run/