Initial commit
This commit is contained in:
commit
df5befa9d1
45 changed files with 2030 additions and 0 deletions
42
scripts/debian.sh
Executable file
42
scripts/debian.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/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
|
19
scripts/linux-dtbs.sh
Executable file
19
scripts/linux-dtbs.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p ../build
|
||||
cd ../build
|
||||
|
||||
[[ -d wallaby-linux ]] || git clone https://github.com/F-WuTS/wallaby-linux.git --depth=1
|
||||
|
||||
mkdir -p linux/boot
|
||||
|
||||
cd wallaby-linux
|
||||
|
||||
# Remove .git folder to prevent dirty kernel names
|
||||
[[ -d build ]] || rm -rf .git
|
||||
|
||||
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs -j8
|
||||
|
||||
cp -r arch/arm/boot/dts/am335x-pepper*.dt* ../linux/boot
|
64
scripts/make-sd-card.sh
Executable file
64
scripts/make-sd-card.sh
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
mkdir -p ../build
|
||||
cd ../build
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
if lsblk | grep -q "loop0"; then
|
||||
echo "loop0 found, trying to unmount automatically"
|
||||
kpartx -d /dev/loop0
|
||||
losetup -d /dev/loop0
|
||||
fi
|
||||
|
||||
echo "Creating empty image"
|
||||
dd if=/dev/zero of=0s.img bs=1M count=7500
|
||||
|
||||
sync
|
||||
|
||||
sleep 1
|
||||
|
||||
echo "Mouting empty image"
|
||||
losetup /dev/loop0 0s.img
|
||||
|
||||
# echo "Zeroing empty image (no real reason to do so, still...)"
|
||||
# dd if=/dev/zero of=/dev/loop0 bs=1024 count=1024
|
||||
|
||||
echo "Creating partitions"
|
||||
|
||||
# sfdisk was "upgraded" -> tons of flags removed
|
||||
|
||||
SIZE=`fdisk -l /dev/loop0 | grep Disk | awk '{print $5}'`
|
||||
CYLINDERS=`echo $SIZE/255/63/512 | bc`
|
||||
|
||||
../hacks/sfdisk --force -D -uS -H 255 -S 63 -C $CYLINDERS /dev/loop0 << EOF
|
||||
128,130944,0x0C,*
|
||||
131072,,,-
|
||||
EOF
|
||||
|
||||
# sfdisk --force -u S /dev/loop0 << EOF
|
||||
# 128,130944,0x0C,*
|
||||
# 131072,,,-
|
||||
# EOF
|
||||
|
||||
losetup -d /dev/loop0
|
||||
sync
|
||||
|
||||
kpartx -a 0s.img
|
||||
|
||||
# Resources don't become avaliable immediately
|
||||
sleep 1
|
||||
|
||||
echo "Creating fs"
|
||||
mkfs.vfat -F 32 -n "boot" /dev/mapper/loop0p1
|
||||
mkfs.ext3 -F -L "rootfs" /dev/mapper/loop0p2
|
||||
|
||||
# Creating partitions is apperantly async
|
||||
sleep 1
|
||||
|
||||
kpartx -d /dev/loop0
|
||||
losetup -d /dev/loop0
|
19
scripts/setup-host.sh
Executable file
19
scripts/setup-host.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install curl -y
|
||||
|
||||
# git-lfs
|
||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
|
||||
dpkg --add-architecture armhf
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get install crossbuild-essential-armhf bc git dosfstools kpartx \
|
||||
debootstrap qemu-user-static git-lfs -y
|
23
scripts/setup-root-fs.sh
Executable file
23
scripts/setup-root-fs.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
cd ..
|
||||
|
||||
mkdir -p root-fs/var/0s/source
|
||||
|
||||
cd root-fs/var/0s/source
|
||||
|
||||
if [ ! -d c0re ]; then
|
||||
git clone https://github.com/F-WuTS/c0re.git --recursive --depth=1
|
||||
else
|
||||
git -C c0re fetch --all
|
||||
git -C c0re reset --hard origin/master
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -d harrogate ]; then
|
||||
git clone https://github.com/F-WuTS/harrogate.git --depth=1
|
||||
else
|
||||
git -C harrogate fetch --all
|
||||
git -C harrogate reset --hard origin/master
|
||||
|
||||
fi
|
||||
|
||||
|
Reference in a new issue