This repository has been archived on 2025-06-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Os/scripts/debian.sh
2018-04-07 23:26:16 +02:00

42 lines
822 B
Bash
Executable file

#!/bin/bash
set -e
mkdir -p ../build
cd ../build
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
echo "Delete debian-fresh if you interrupted the initial download."
if [ ! -d debian-fresh ]; then
echo "Initial download, this will take a while."
debootstrap --foreign --verbose --arch=armhf stretch ./debian-fresh
mkdir -p debian-fresh/usr/bin
cp /usr/bin/qemu-arm-static debian-fresh/usr/bin
# Stage 1
cp ../chroot/stage-1.sh debian-fresh
chroot debian-fresh/ ./stage-1.sh
rm debian-fresh/stage-1.sh
fi
rm -rf debian
cp -r debian-fresh debian
cp -r ../chroot debian
# Stage 2
echo "Installing dependencies."
chroot debian/ ./chroot/stage-2.sh
echo "Applying overlay fs"
cp -r ../root-fs/* debian
# Stage 3
echo "Running fs prepare"
chroot debian/ ./chroot/stage-3.sh
rm -rf debian/chroot