11#! /bin/bash
22# Based from https://willhaley.com/blog/custom-debian-live-environment/
3+ set -e
34
5+ echo " 🔧 修复 buster 的源..."
6+
7+ cat > /etc/apt/sources.list << EOF
8+ deb http://archive.debian.org/debian buster main contrib non-free
9+ deb http://archive.debian.org/debian-security buster/updates main
10+ EOF
11+
12+ echo ' Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until
13+
14+ apt-get update
15+
16+ echo " 🚀 开始执行 build.sh ..."
417echo Install required tools
518apt-get update
619apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
@@ -9,8 +22,7 @@ echo Create directory where we will make the image
922mkdir -p $HOME /LIVE_BOOT
1023
1124echo Install Debian
12- debootstrap --arch=amd64 --variant=minbase buster $HOME /LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13-
25+ debootstrap --arch=amd64 --variant=minbase buster $HOME /LIVE_BOOT/chroot http://archive.debian.org/debian/
1426echo Copy supporting documents into the chroot
1527cp -v /supportFiles/installChroot.sh $HOME /LIVE_BOOT/chroot/installChroot.sh
1628cp -v /supportFiles/ddd $HOME /LIVE_BOOT/chroot/usr/bin/ddd
@@ -47,7 +59,6 @@ echo Create directories that will contain files for our live environment files a
4759mkdir -p $HOME /LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
4860
4961echo Compress the chroot environment into a Squash filesystem.
50- sgdisk --move-second-header " /mnt/armbian.img"
5162cp /mnt/armbian.img ${HOME} /LIVE_BOOT/chroot/mnt/
5263ls ${HOME} /LIVE_BOOT/chroot/mnt/
5364mksquashfs $HOME /LIVE_BOOT/chroot $HOME /LIVE_BOOT/staging/live/filesystem.squashfs -e boot
0 commit comments