mklive/scripts/bootstrap.sh

58 lines
1.4 KiB
Bash
Raw Normal View History

2018-05-21 12:41:52 +00:00
#!/bin/bash
source ${WORKDIR}/mklive.conf
source $(dirname $0)/functions.sh
echo "Build live"
CHROOT=${WORKDIR}/chroot
startstage bootstrap
#bootstrap basic system
[ -d $CHROOT ] || debootstrap --components=main,restricted,universe,multiverse --variant=$DIST_VARIANT --arch=$ARCH $DIST_RELEASE $CHROOT $DIST_MIRROR
#prepair chroot
mount -t proc proc $CHROOT/proc/
mount -t sysfs sys $CHROOT/sys/
mount -o bind /dev $CHROOT/dev/
#install locales
if [ ! -e $STAGEDIR/_locales ]; then
chroot $CHROOT apt -y install locales
echo "de_DE.UTF-8 UTF-8" >> $CHROOT/etc/locale.gen
echo "en_US.UTF-8 UTF-8" >> $CHROOT/etc/locale.gen
chroot $CHROOT locale-gen
echo "done" > $STAGEDIR/_locales
fi
#install systemd
chroot $CHROOT apt -y install systemd
#install live-boot
chroot $CHROOT apt-get -y install live-boot
#install additional packages
if [ -n "${PACKAGES}" ]; then
chroot $CHROOT apt-get -y install ${PACKAGES}
fi
#set the rootpw
chpasswd -R $(readlink -f $CHROOT) <<< "root:${LIVE_ROOTPW}"
#change to a full busybox - for tftp support
sed -i -r 's/=.+(\/bin\/busybox)/=\1/' chroot/usr/share/initramfs-tools/hooks/zz-busybox-initramfs
#install kernel
chroot $CHROOT apt -y -o "APT::Install-Recommends=false" install ${KERNEL_PACKAGE}
#clean chroot
chroot $CHROOT apt-get clean
umount $CHROOT/proc/
umount $CHROOT/sys/
umount $CHROOT/dev/
#final changes
echo "${LIVE_HOSTNAME}" > $CHROOT/etc/hostname
endstage bootstrap