Skip to content

A user-ready linux image/rootfs for the Pine64 Pinenote based on Debian bookworm and GNOME

License

Notifications You must be signed in to change notification settings

hrdl-github/pinenote-debian-recipes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pinenote-debian-recipes

Creates a Debian rootfs for the PineNote eink tablet. It uses debos to build a set of recipes organized as a build pipeline. The end result, a tar.gz file can be extracted onto an existing partition on the PineNote.

Currently, in order to install a Linux distribution on the PineNote, someone would follow installation guides like the ones written by Martyn[1] or Dorian[2]. This project addresses the later steps in the guides where someone needs to put a rootfs on the prepared Linux partition. You should be familiar with the content of those guides, as this project doesn't provide an easy way to install Debian on the PineNote, but merely a simple rootfs. This project allows creation of such a rootfs for the Debian distribution (bookworm by default). The existing debos recipes would debootstrap, add the provided (by you) kernel and components, install some basic programs and do some setup including creating the initrd using dracut. Booting it on the PineNote would get you to the console. No graphical environments are installed.

[1]: https://musings.martyn.berlin/dual-booting-the-pinenote-with-android-and-debian

[2]: https://github.com/DorianRudolph/pinenotes

Build

You need to install debos, to clone this repo, to provide the kernel components in the right places, and then call ./build.sh as a normal user.

For example, to install debos on a Debian bullseye (like me):

# apt install debos

Feeding the kernel and firmwares to the project

This is the expected content of the overlays directory after the kernel and firmwares has been provided:

pinenote-debian-recipes/overlays/
├── boot
│   ├── extlinux.conf
│   ├── Image
│   ├── rk3566-pinenote.dtb
│   └── sysbootcmd
├── dracut
│   └── dracut.conf.d
│       └── pinenote.conf
├── firmware
│   ├── original-firmware.tar.gz
│   └── waveform.bin
└── modules
    └── kernel-modules.tar.gz

Symbolic links doesn't work(!) so either use hard links or simply copy the files in the right place.

Some details (check also the recipes to see how they are used):

  • original-firmware.tar.gz contains the firmware/ directory which is found on the PineNote in /vendor/etc/.
  • kernel-modules.tar.gz contains the /lib/modules/.. directory (entire hierarchy including starting with /lib)

Build preparations

Run prep_00_get_kernel_files.sh and prep_03_custom_debs.sh first, to prepare the external packages to use in the later build steps.

Build the recipes

Run inside the pinenote-debian-recipes directory:

./build.sh

(depending on your system configuration, you might need to run this command with superuser rights)

That would build a Debian bookworm rootfs, with a hostname pinenote, a user user with password 1234 and sudo capabilities. Also, it hardcodes the target PineNote partition to /dev/mmcblk0p17 (TODO: try to make that an option instead). To do that, ./build.sh would call debos on each recipe in the default pipeline -- the file recipes-pipeline. Here is its content:

# calls debootstrap
rootminfs.yaml

# installs base programs like network-manager, sudo, parted ...
baseprograms.yaml

# add kernel, kernel modules, firmware files
addkernel.yaml

# setup hostname, first user, initrd (using dracut)
finalsetup.yaml

The work done by each recipe is saved as a .tar.gz file. So you would take the last archive, finalsetup.tar.gz, to extract on the PineNote. Currently, the archive's size is about 240MB and extracted into the partition would occupy almost 700MB.

Install the rootfs on the PineNote

Take the *.tag.gz file after the latest step and extract it to the prepared partition. You need to follow Martyn's and Dorian's guides to get to this point.

For example, let finalsetup.tar.gz be the resulting archive. Then, to install the rootfs using my laptop connected to the PineNote booted in Android, I do:

$ adb push finalsetup.tar.gz /sdcard/Download
$ adb shell
$ su
# mkdir /sdcard/target
# mount /dev/block/mmcblk0p17 /sdcard/target
# cd /sdcard/Download
# busybox tar xzf finalsetup.tar.gz -C /sdcard/target
# umount /sdcard/target
# exit
$ exit

Then I insert the UART dongle (and start minicom -D /dev/ttyUSB0 -b 1500000 on my laptop), restart the tablet, hold CTRL-C to interrupt u-boot. And then, paste the sysboot command that I also made available inside pinenote-debian-recipes/overlays/boot/sysbootcmd:

Interrupt => sysboot ${devtype} ${devnum}:11 any ${scriptaddr} /boot/extlinux.conf

And that would boot our system on partition 17 (11 in base 16).

Alternatively, use the following set of commands:

load mmc 0:11 ${kernel_addr_r} /extlinux/Image
load mmc 0:11 ${fdt_addr_r} /extlinux/rk3566-pinenote-v1.2.dtb
load mmc 0:11 ${ramdisk_addr_r} /extlinux/uInitrd.img
setenv bootargs ignore_loglevel root=/dev/mmcblk0p17 rw rootwait earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off init=/sbin/init
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Misc

  • Ignore any ssh issues when testing the rootfs:

    ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@pinenote

License

This software is licensed under the terms of the GNU General Public License, version 3.

Inspiration and some code parts are from mobian-recipes project.

About

A user-ready linux image/rootfs for the Pine64 Pinenote based on Debian bookworm and GNOME

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 37.2%
  • Python 34.9%
  • Shell 18.1%
  • HTML 9.8%