From 831fbfcfcc37da8b5a7629d6b4d1d91a65670210 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Tue, 14 Mar 2017 15:27:08 +0100 Subject: [PATCH] upgrade to debian stretch * add required packages not installed by default (systemd udev) * disable predictable network interfaces name through net.ifnames=0 * execute dpkg config on first boot instead of a cross-arch chroot * add google's dns server for debugging purposes (eg. systemd fails) --- README.md | 4 ++- boot/cmdline.txt | 2 +- build.sh | 67 +++++++++++++++++++++++------------------------- multistrap.conf | 4 +-- 4 files changed, 38 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index fec58a1..eb6a5fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pi64 -pi64 is an experimental 64-bit OS for the Raspberry Pi 3. It is based on Debian Jessie and backed by a 4.9 Linux kernel. +pi64 is an experimental 64-bit OS for the Raspberry Pi 3. It is based on Debian Stretch and backed by a 4.9 Linux kernel. ## Installation @@ -8,6 +8,8 @@ The latest image is always available in the [releases](https://github.com/bamarn Once downloaded, you can follow the [official instructions](https://www.raspberrypi.org/documentation/installation/installing-images/README.md) for writing it to your SD card. +During first boot the installation process will continue for a few minutes, then the Raspberry Pi will reboot and you'll be ready to go. + ## Getting started The default user is `pi` and its password `raspberry`, it has passwordless root privileges escalation through `sudo`. diff --git a/boot/cmdline.txt b/boot/cmdline.txt index a1b71d6..f43aede 100755 --- a/boot/cmdline.txt +++ b/boot/cmdline.txt @@ -1 +1 @@ -dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/root/init_setup.sh +dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait net.ifnames=0 init=/root/init_setup.sh diff --git a/build.sh b/build.sh index 71712fc..09c0ca1 100644 --- a/build.sh +++ b/build.sh @@ -60,7 +60,7 @@ root_length=$(echo "$parted_out" | grep -e '^ 2'| xargs echo -n | cut -d" " -f 4 boot_dev=$(losetup --show -f -o ${boot_offset} --sizelimit ${boot_length} pi64.img) root_dev=$(losetup --show -f -o ${root_offset} --sizelimit ${root_length} pi64.img) -mkdosfs -n boot -F 32 -v $boot_dev +mkdosfs -n boot -F 32 $boot_dev mkfs.ext4 -O ^huge_file $root_dev @@ -68,59 +68,62 @@ mkfs.ext4 -O ^huge_file $root_dev # build rootfs mkdir -p mnt -mount -v $root_dev mnt -t ext4 - -mkdir -p mnt/dev -mount -o bind /dev mnt/dev +mount $root_dev mnt -t ext4 multistrap -a arm64 -d $PWD/mnt -f ../multistrap.conf cp /usr/bin/qemu-aarch64-static mnt/usr/bin/qemu-aarch64-static -cat << EOF | chroot mnt -export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true -export LC_ALL=C LANGUAGE=C LANG=C +chroot mnt apt-get clean + +rm -rf mnt/var/lib/apt/lists/* -cat > /etc/fstab < mnt/etc/fstab < mnt/usr/sbin/policy-rc.d -echo exit 101 > /usr/sbin/policy-rc.d -chmod +x /usr/sbin/policy-rc.d +chmod +x mnt/usr/sbin/policy-rc.d -/var/lib/dpkg/info/dash.preinst install -dpkg --configure -a - -rm /usr/sbin/policy-rc.d +echo raspberrypi > mnt/etc/hostname -echo raspberrypi > /etc/hostname +echo 127.0.1.1 raspberrypi >> mnt/etc/hosts -echo 127.0.1.1 raspberrypi >> /etc/hosts +echo nameserver 8.8.8.8 > mnt/etc/resolv.conf -cat >> /etc/network/interfaces <> mnt/etc/network/interfaces < /etc/sudoers.d/010_pi-nopasswd - -cat > /root/init_setup.sh < mnt/root/init_setup.sh < /etc/sudoers.d/010_pi-nopasswd + sed -i 's| init=/root/init_setup.sh||' /boot/cmdline.txt sync @@ -129,20 +132,14 @@ rm /root/init_setup.sh echo b > /proc/sysrq-trigger EOL -chmod +x /root/init_setup.sh - -apt-get clean -rm -rf /var/lib/apt/lists/* -EOF - -rm mnt/usr/bin/qemu-aarch64-static +chmod +x mnt/root/init_setup.sh # install boot stuff mkdir -p mnt/boot -mount -v $boot_dev mnt/boot -t vfat +mount $boot_dev mnt/boot -t vfat cp -r ../boot/* mnt/boot @@ -156,5 +153,5 @@ cd .. # compress image -umount mnt/boot mnt/dev mnt/proc mnt/sys mnt -zip pi64.img.zip pi64.img +umount mnt/boot mnt +zip pi64.zip pi64.img diff --git a/multistrap.conf b/multistrap.conf index c87fc41..821693c 100644 --- a/multistrap.conf +++ b/multistrap.conf @@ -5,7 +5,7 @@ debootstrap=Debian aptsources=Debian [Debian] -packages=apt kmod dialog netbase net-tools ethtool iproute iputils-ping ifupdown isc-dhcp-client sudo ssh avahi-daemon vim parted ntp +packages=systemd systemd-sysv udev apt kmod dialog netbase net-tools ethtool iproute iputils-ping ifupdown isc-dhcp-client sudo ssh avahi-daemon vim parted ntp source=http://deb.debian.org/debian/ keyring=debian-archive-keyring -suite=jessie +suite=stretch