3 sudo apt-get -y install gawk wget git diffstat unzip texinfo \
4 build-essential chrpath socat ncurses-dev lzop \
5 gcc debootstrap bc rsync bison flex libelf-dev
7 git submodule update --init
8 cp defconfig linux/arch/x86/configs/x86_64_defconfig
11 test -e .config || make x86_64_defconfig
18 sudo rm -rf output/rootfs/
19 sudo rm output/sdcard.img
21 mkdir -p output/rootfs
22 dd if=/dev/zero of=output/sdcard.img bs=1M count=2000
23 cat <<EOT | sudo fdisk -u output/sdcard.img
37 _loop=$(sudo losetup -f)
38 sudo losetup -P $_loop output/sdcard.img
39 sudo mkfs.vfat ${_loop}p1
40 sudo mkfs.ext4 ${_loop}p2
42 sudo mount ${_loop}p2 output/rootfs
44 sudo debootstrap --variant=minbase --components=main,non-free --include=systemd-sysv,console-setup buster output/rootfs http://deb.debian.org/debian/
45 sudo cp *.deb output/rootfs/
46 sudo mount ${_loop}p1 output/rootfs/boot
47 sudo mkdir output/rootfs/boot/EFI
48 sudo mkdir output/rootfs/boot/EFI/boot
50 sudo chroot output/rootfs/ /bin/bash <<EOT
51 mount -t devtmpfs dev /dev
52 mount -t devpts dev/pts /dev/pts
53 mount -t proc proc /proc
54 mount -t sysfs sysfs /sys
55 mount -t tmpfs tmpfs /tmp
56 apt install -y dialog makedev nano tasksel htop neofetch
57 echo "0.0 0 0.0 0 LOCAL" > /etc/adjtime export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen en_US.UTF-8
58 apt install -y locales
59 apt install -y iputils-ping iproute2
60 #tasksel install standard # this is extra
62 echo -e "password\npassword" | passwd
69 sudo cp linux/arch/x86_64/boot/bzImage output/rootfs/boot/EFI/boot/bootx64.efi
70 sudo cp linux/arch/x86_64/boot/bzImage output/rootfs/boot/EFI/boot/mmx64.efi
71 rm -rf linux-* linux.orig linux/debian
73 echo "test" | sudo tee output/rootfs/etc/hostname
76 cat <<EOT | sudo tee output/rootfs/etc/fstab
77 /dev/sda2 / ext4 errors=remount-ro 0 1
78 #/dev/sda1 /boot vfat defaults 0 2
79 proc /proc proc defaults 0 0
80 sysfs /sys sysfs defaults 0 0
81 tmpfs /tmp tmpfs defaults 0 0
82 devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
83 devpts /dev/pts devpts gid=5,mode=620 0 0
86 sudo umount output/rootfs/boot
87 sudo umount -l output/rootfs
88 sudo losetup -d $_loop