wmirescue/buster-amd64/bin/basefs_init

45 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/sh
TARGET=$1
DEBIAN_CODENAME=$2
LANG=C
2021-11-10 22:01:20 +01:00
APT_PARAM=''
STDOUT='/dev/stdout'
if [ !$MKRESCUE_VERBOSE ]; then
APT_PARAM='-qq -o=Dpkg::Use-Pty=0';
STDOUT='/dev/null';
fi
mkdir ${TARGET}
2021-11-10 22:01:20 +01:00
debootstrap --arch=amd64 --variant=minbase ${DEBIAN_CODENAME} ${TARGET} http://httpredir.debian.org/debian > $STDOUT
cat << EOF > ${TARGET}/etc/apt/sources.list
deb http://httpredir.debian.org/debian ${DEBIAN_CODENAME} main contrib non-free
deb http://security.debian.org/ ${DEBIAN_CODENAME}/updates main contrib non-free
2021-07-29 12:42:53 +02:00
deb http://deb.debian.org/debian ${DEBIAN_CODENAME}-backports main contrib non-free
EOF
cat << EOF > ${TARGET}/etc/apt/apt.conf.d/80small
APT::Install-Recommends '0';
APT::Install-Suggests '0';
EOF
2021-11-10 22:01:20 +01:00
cat << EOF > ${TARGET}/etc/apt/preferences.d/backports
Package: *
Pin: release n=buster-backports
Pin-Priority: 500
EOF
echo wmirescue > ${TARGET}/etc/hostname
echo 'root:wmi' | chroot ${TARGET} chpasswd
2021-11-10 22:01:20 +01:00
chroot ${TARGET} mount -t devpts devpts /dev/pts
chroot ${TARGET} apt-get $APT_PARAM update > $STDOUT
chroot ${TARGET} apt-get $APT_PARAM --yes install apt-utils > $STDOUT
chroot ${TARGET} apt-get $APT_PARAM upgrade --yes > $STDOUT
chroot ${TARGET} apt-get $APT_PARAM clean > $STDOUT
chroot ${TARGET} umount /dev/pts