|
|
@@ -5,11 +5,24 @@ |
|
|
|
ETC=./template-etc |
|
|
|
SKEL=./template-skel |
|
|
|
|
|
|
|
rm -rf ./target-userland |
|
|
|
mkdir ./target-userland |
|
|
|
mbind() { |
|
|
|
for d in dev proc sys |
|
|
|
do |
|
|
|
mount /$d target-userland/$d -o bind || echo "Bind-mounting /$d failed" |
|
|
|
done |
|
|
|
} |
|
|
|
|
|
|
|
munbind() { |
|
|
|
for d in dev proc sys |
|
|
|
do |
|
|
|
umount -f target-userland/$d || echo "Umounting $d failed" |
|
|
|
done |
|
|
|
} |
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
[[ -e target-userland ]] && echo "WARNING: Target userland already exist" && munbind |
|
|
|
|
|
|
|
# create debian userland |
|
|
|
/usr/sbin/multistrap -d target-userland -f multistrap.conf |
|
|
|
|
|
|
@@ -62,12 +75,14 @@ cp $ETC/eth.network target-userland/etc/systemd/network/ |
|
|
|
mkdir -p target-userland/var/lib/alsa |
|
|
|
cp $ETC/asound.state target-userland/var/lib/alsa/ |
|
|
|
|
|
|
|
mknod target-userland/dev/random c 1 8 |
|
|
|
mknod target-userland/dev/urandom c 1 9 |
|
|
|
|
|
|
|
chown root:root -R target-userland/* |
|
|
|
chown root:root -R target-userland |
|
|
|
chown root:shadow target-userland/etc/shadow |
|
|
|
|
|
|
|
mbind |
|
|
|
|
|
|
|
#mknod target-userland/dev/random c 1 8 |
|
|
|
#mknod target-userland/dev/urandom c 1 9 |
|
|
|
|
|
|
|
chroot target-userland /bin/bash <<EOF |
|
|
|
export DEBIAN_FRONTEND=noninteractive |
|
|
|
export DEBCONF_NONINTERACTIVE_SEEN=true |
|
|
@@ -90,3 +105,5 @@ EOF |
|
|
|
mkdir -p target-userland/etc/pulseaudio |
|
|
|
cp $ETC/daemon.conf target-userland/etc/pulse/ |
|
|
|
|
|
|
|
munbind |
|
|
|
|