PinePhone e PineTab kernel

Questo documento descrive come costruire e installare il kernel PinePhone o PineTab. Prima si spiega il sistema di recupero. Poi l’attuale costruzione e l’installazione. In fondo ci sono alcuni riferimenti.

Recupero (recovery)

The Ubuntu Touch image contains a recovery boot mode based on «jumpdrive». To get into the recovery press and hold the power and volume-up buttons until the led turns on.

The recovery presents the PinePhone as a network device over USB and runs a telnet server. When you connect the PinePhone to your desktop via USB, you will see the rndis device show up in your desktop’s dmesg:

usb 1-7.2: Product: PinePhone
usb 1-7.2: Manufacturer: Pine64
usb 1-7.2: SerialNumber: Jumpdrive
rndis_host 1-7.2:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-7.2, RNDIS device

È possibile accedere al sistema di recupero con telnet 172.16.42.1.

The recovery also exposes the eMMC and the microSD card over USB. Assuming you have already installed Ubuntu Touch on your microSD card you will see something like this in your desktop’s dmesg:

usb-storage 1-7.2:1.2: USB Mass Storage device detected
scsi host3: usb-storage 1-7.2:1.2
scsi 2:0:0:0: Direct-Access     JumpDriv e eMMC                PQ: 0 ANSI: 2
scsi 2:0:0:1: Direct-Access     JumpDriv e microSD             PQ: 0 ANSI: 2
sd 2:0:0:0: Attached scsi generic sg1 type 0
scsi 2:0:0:1: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sdb] 30785536 512-byte logical blocks: (15.8 GB/14.7 GiB)
sd 2:0:0:1: [sdc] 124735488 512-byte logical blocks: (63.9 GB/59.5 GiB)
  sdb: sdb1 sdb2
sd 2:0:0:0: [sdb] Attached SCSI removable disk
  sdc: sdc1 sdc2 sdc3 sdc4 sdc5 sdc6 sdc7 sdc8 sdc9 sdc10

L’eMMC con jumpdrive contiene due partizioni: pmOS_boot e pmOS_root.

La scheda microSD con Ubuntu Touch contiene 10 partizioni: loader, scr, persist, boot_a, boot_b, recovery_a, recovery_b, cache, sistema e userdata. Per aggiornare il kernel si desidera montare boot_a. Controllare quale dispositivo è la scheda SD nel sistema operativo e montare boot_a. Nell’esempio sopra questo è sdc4. All’interno di quella partizione vedrai il kernel vmlinuz e i relativi file:config-5.6.0-pine64 dtb initrd.img modules/ System.map-5.6.0-pine64 vmlinuz.

Costruire il kernel

To install dependencies, get the source code, configure and build the kernel, run the following:

sudo apt install build-essential flex bison gcc-aarch64-linux-gnu libssl-dev
git clone -b pine64-kernel-ubports https://gitlab.com/pine64-org/linux.git
cd linux
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KBUILD_VERSION=arm64 LOCALVERSION=-pine64 make pine64_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- KBUILD_VERSION=arm64 LOCALVERSION=-pine64 make -j18 bindeb-pkg

Installare il kernel

Boot into recovery and mount boot_a. Make a backup if needed. Then copy over your newly built kernel and if needed modules:

cp -v linux/debian/linux-image/boot/vmlinuz-5.6.0-pine64 [MOUNT POINT BOOT_A]/vmlinuz
cp -v linux/debian/linux-image/boot/config-5.6.0-pine64 [MOUNT POINT BOOT_A]
cp -v linux/debian/linux-image/boot/System.map-5.6.0-pine64  [MOUNT POINT BOOT_A]
sudo rm -rf [MOUNT POINT BOOT_A]/modules
sudo cp -rv linux/debian/linux-image/lib/modules [MOUNT POINT BOOT_A]

Successivamente essere sicuri di smontare la partizione così è scritta in modo pulito. Ora puoi riavviare il PinePhone. Una volta avviato, è possibile verificare che il kernel sia stato aggiornato correttamente controllando la data di compilazione con uname -a sul dispositivo.

References

  • Pine64 wiki has general HW info, pointers to other PinePhone OS projects, HW revisions, serial UART over headphone jack (also in their store), spec sheets, known HW issues, etc

  • Main UBports repository ha istruzioni per come installare immagini UT sul PinePhone

  • UBPorts tracciatore problemi(issue tracker)

  • PinePhone forum da Pine64 è dove molte altre comunità si riuniscono che lavorano con il PinePhone

  • comunità sunxi è dove gran parte dello sforzo principale <https:// linux-sunxi.org/Linux_mainlining_effort>`_ per i dispositivi Allwinner compreso il PinePhone ha luogo. Notare le istruzioni build.

  • Crust firmware implements a deep sleep state and runs on a dedicated System Control Processor outside the main CPU and DRAM.