Install Standard Debian (upstream)
#1
Greetings everybody,

Today on my quest to enable the rock64 for my purposes I had just one goal:
Install upstream debian testing (buster) without any customizations.

Sadly I did not achieve this goal fully; However I believe I got extremely close. See below for the one bugreport I opened to have the last piece upstreamed.

So here are the steps from an existing debian system running on the board (mostly in pseudo-code because the difficulty level isn't novice):

0. Install U-Boot to SPI Flash
- https://github.com/ayufan-rock64/linux-u-boot/releases

1. Partition (e)MMC
 - 100MiB EFI partition (fat)
 - 1GiB boot partition (ext4)
 - 57GiB rootfs partition (f2fs)

2. mount filesystems
 - rootfs: /mnt
 - boot: /mnt/boot
 - efi: /mnt/boot/efi

3. bootstrap debian
 - debootstrap --arch=arm64 --variant=minbase buster /mnt http://deb/debian.org/debian

4. mount additional filesystems
 - mount -vt sysfs sysfs /mnt/sys
 - mount -vt proc proc /mnt/proc
 - mount --bind /dev /mnt/dev
 - mount --bind /dev/pts /mnt/dev/pts
 - mount --make-rslave /mnt/dev
 - mount --make-rslave /mnt/dev/pts

5. install additional software
- tasksel ssh-server (this is a little messy in a chroot)
- apt install linux-image-arm64 grub-efi-arm64
- apt install ifupdown locales

6. configure system
 - /etc/initramfs-tools/modules: f2fs
 - /etc/default/grub: GRUB_CMDLINE_LINUX="earlycon=uart8250,mmio32,0xff130000 console=ttyS2,1500000"
 - /etc/default/grub: if [ -z "$GRUB_DEVICE_UUID" ] && [ -n "$GRUB_DEVICE" ]; then GRUB_DEVICE_UUID=`blkid -s UUID -o value "$GRUB_DEVICE"`; fi
 - dpkg-reconfigure locales
 - dpkg-reconfigure tzdata
 - /etc/network/interfaces: auto eth0
 - /etc/network/interfaces: iface eth0 inet dhcp
 - /etc/network/interfaces: iface eth0 inet6 auto

7. make it bootable
 - update-initramfs -u
 - grub-install --target=arm64-efi --removable
 - update-grub
 - copy /usr/lib/linux-image-4.17.0-1-arm64/rockchip/rk3328-rock64.dtb to /boot/efi/rockchip/rk3328-rock64.dtb

At this point the system could be rebooted and should automagically start up through grub.However one piece is still missing:
When the DTB gets updated with a new debian kernel, the copy on the EFI partition has to be updated as well.
For this we use the debian specific flash-kernel application by adding the following entry to /etc/flash-kernel/db:
Code:
Machine: Pine64 Rock64
Boot-DTB-Path: /boot/efi/rockchip/rk3328-rock64.dtb
DTB-Id: rockchip/rk3328-rock64.dtb

This bit of magic makes sure that on every kernel update the rk3328-rock64.dtb gets copied to the EFI partition where U-Boot can load it *before* executing grub.
This is necessary because grub-mkconfig can not guess where the devicetree is and how it is called.
I have opened a bugreport against debian to have this piece included upstream: https://bugs.debian.org/cgi-bin/bugrepor...bug=906696

I strongly believe that debian-installer could be used from a usb drive to install debian. It would be much easier than the instructions above, especially when a preseed file is used for automation.
  Reply
#2
(08-19-2018, 02:26 PM)Catbot Wrote: Greetings everybody,

Today on my quest to enable the rock64 for my purposes I had just one goal:
Install upstream debian testing (buster) without any customizations.

Sadly I did not achieve this goal fully; However I believe I got extremely close. See below for the one bugreport I opened to have the last piece upstreamed.

So here are the steps from an existing debian system running on the board (mostly in pseudo-code because the difficulty level isn't novice):

0. Install U-Boot to SPI Flash
- https://github.com/ayufan-rock64/linux-u-boot/releases

1. Partition (e)MMC
 - 100MiB EFI partition (fat)
 - 1GiB boot partition (ext4)
 - 57GiB rootfs partition (f2fs)

2. mount filesystems
 - rootfs: /mnt
 - boot: /mnt/boot
 - efi: /mnt/boot/efi

3. bootstrap debian
 - debootstrap --arch=arm64 --variant=minbase buster /mnt http://deb/debian.org/debian

4. mount additional filesystems
 - mount -vt sysfs sysfs /mnt/sys
 - mount -vt proc proc /mnt/proc
 - mount --bind /dev /mnt/dev
 - mount --bind /dev/pts /mnt/dev/pts
 - mount --make-rslave /mnt/dev
 - mount --make-rslave /mnt/dev/pts

5. install additional software
- tasksel ssh-server (this is a little messy in a chroot)
- apt install linux-image-arm64 grub-efi-arm64
- apt install ifupdown locales

6. configure system
 - /etc/initramfs-tools/modules: f2fs
 - /etc/default/grub: GRUB_CMDLINE_LINUX="earlycon=uart8250,mmio32,0xff130000 console=ttyS2,1500000"
 - /etc/default/grub: if [ -z "$GRUB_DEVICE_UUID" ] && [ -n "$GRUB_DEVICE" ]; then GRUB_DEVICE_UUID=`blkid -s UUID -o value "$GRUB_DEVICE"`; fi
 - dpkg-reconfigure locales
 - dpkg-reconfigure tzdata
 - /etc/network/interfaces: auto eth0
 - /etc/network/interfaces: iface eth0 inet dhcp
 - /etc/network/interfaces: iface eth0 inet6 auto

7. make it bootable
 - update-initramfs -u
 - grub-install --target=arm64-efi --removable
 - update-grub
 - copy /usr/lib/linux-image-4.17.0-1-arm64/rockchip/rk3328-rock64.dtb to /boot/efi/rockchip/rk3328-rock64.dtb

At this point the system could be rebooted and should automagically start up through grub.However one piece is still missing:
When the DTB gets updated with a new debian kernel, the copy on the EFI partition has to be updated as well.
For this we use the debian specific flash-kernel application by adding the following entry to /etc/flash-kernel/db:
Code:
Machine: Pine64 Rock64
Boot-DTB-Path: /boot/efi/rockchip/rk3328-rock64.dtb
DTB-Id: rockchip/rk3328-rock64.dtb

This bit of magic makes sure that on every kernel update the rk3328-rock64.dtb gets copied to the EFI partition where U-Boot can load it *before* executing grub.
This is necessary because grub-mkconfig can not guess where the devicetree is and how it is called.
I have opened a bugreport against debian to have this piece included upstream: https://bugs.debian.org/cgi-bin/bugrepor...bug=906696

I strongly believe that debian-installer could be used from a usb drive to install debian. It would be much easier than the instructions above, especially when a preseed file is used for automation.

Thanks, we have same goal that eventually should able to use standard distribution build from Debian, Ubuntu, Opensuse and others.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Star Debian Stretch Minimal complete install LXDE Rafal 0 384 03-15-2019, 07:59 AM
Last Post: Rafal
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 6,060 05-05-2018, 06:08 AM
Last Post: S3phi40T

Forum Jump:


Users browsing this thread: 1 Guest(s)