pmOS - build on Debian

Building pmOS on Debian.

back to main pmOS page.

Local links

vm4,

History

2021-10-17: I re-created this page on my self-hosted web server.

2017-08-01: vm4 - pmOS - export links

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py flasher export ../pm_export
[01:30:00] (rootfs_nokia-rx51) mkinitfs postmarketos
[01:30:22] Export symlinks to: ../pm_export
[01:30:22]  * uInitrd-postmarketos (Initramfs, legacy u-boot image format)
[01:30:22]  * initramfs-postmarketos (Initramfs)
[01:30:22]  * vmlinuz-postmarketos (Linux kernel)
[01:30:22]  * uImage-postmarketos (Kernel, legacy u-boot image format)
[01:30:22]  * nokia-rx51.img (System partition)
[01:30:22] Done

and check them

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ll ../pm_export
total 28
drwxr-xr-x 2 tingo tingo 4096 Aug  1 01:30 ./
drwxr-xr-x 5 tingo tingo 4096 Aug  1 01:29 ../
lrwxrwxrwx 1 tingo tingo   87 Aug  1 01:30 initramfs-postmarketos -> /home/tingo/work/nokia_n900/pmwork/chroot_rootfs_nokia-rx51/boot/initramfs-postmarketos
lrwxrwxrwx 1 tingo tingo   80 Aug  1 01:30 nokia-rx51.img -> /home/tingo/work/nokia_n900/pmwork/chroot_native/home/user/rootfs/nokia-rx51.img
lrwxrwxrwx 1 tingo tingo   84 Aug  1 01:30 uImage-postmarketos -> /home/tingo/work/nokia_n900/pmwork/chroot_rootfs_nokia-rx51/boot/uImage-postmarketos
lrwxrwxrwx 1 tingo tingo   85 Aug  1 01:30 uInitrd-postmarketos -> /home/tingo/work/nokia_n900/pmwork/chroot_rootfs_nokia-rx51/boot/uInitrd-postmarketos
lrwxrwxrwx 1 tingo tingo   85 Aug  1 01:30 vmlinuz-postmarketos -> /home/tingo/work/nokia_n900/pmwork/chroot_rootfs_nokia-rx51/boot/vmlinuz-postmarketos

looks ok.

2017-07-31: vm4 - pmOS - try install again

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py install
[23:24:11] *** (1/5) PREPARE NATIVE CHROOT ***
[23:24:11] *** (2/5) CREATE DEVICE ROOTFS (nokia-rx51) ***
[23:24:17] (native) build x86_64/postmarketos-ui-weston-1-r2.apk
[23:24:17] (native) index armhf repository
[23:24:18] (native) index aarch64 repository
[23:24:18] (native) build x86_64/postmarketos-mkinitfs-0.2.0-r1.apk
[23:24:18] (native) index armhf repository
[23:24:19] (native) index aarch64 repository
[23:24:19] (native) install perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
[23:24:21] (native) build x86_64/musl-armhf-1.1.16-r15.apk
[23:24:23] (native) install gettext libtool autoconf automake bison
[23:24:24] (native) build x86_64/binutils-armhf-2.28-r2.apk
[23:27:59] (native) install paxmark bison flex texinfo gawk zip mpfr-dev mpc1-dev zlib-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf
[23:28:01] (native) build x86_64/gcc-armhf-6.4.0-r4.apk
[00:26:15] (native) build x86_64/ccache-cross-symlinks-1-r2.apk
[sudo] password for tingo:
[00:48:50] (native) index armhf repository
[00:48:50] (native) index aarch64 repository
[00:48:50] (native) install gcc-armhf g++-armhf ccache-cross-symlinks
[00:48:53] (native) build armhf/linux-postmarketos-4.12.4-r3.apk
[sudo] password for tingo:
[01:11:35] (buildroot_armhf) install alpine-base
[01:11:40] (buildroot_armhf) install abuild build-base ccache
[01:11:52] (buildroot_armhf) install wayland-protocols libxkbcommon-dev xkeyboard-config libinput-dev libunwind-dev mtdev-dev libxcursor-dev glu-dev pango-dev colord-dev freerdp-dev libwebp-dev libva-dev dbus-dev
[01:12:19] (buildroot_armhf) install distcc
[01:12:21] (native) build x86_64/gcc-cross-wrappers-1-r1.apk
[01:12:23] (native) index armhf repository
[01:12:24] (native) index aarch64 repository
[01:12:24] (native) install distcc gcc-cross-wrappers
[01:12:24] (native) start distccd (armhf) on 127.0.0.1:33632
[01:12:24] (buildroot_armhf) build armhf/weston-9999-r2.apk
[01:18:26] (buildroot_armhf) install gtk+3.0-dev
[01:18:42] (buildroot_armhf) build armhf/postmarketos-demos-4-r3.apk
[01:18:52] (native) build x86_64/postmarketos-splash-1-r2.apk
[01:18:52] (native) index armhf repository
[01:18:52] (native) index aarch64 repository
[01:18:52] (rootfs_nokia-rx51) install postmarketos-base ttf-droid device-nokia-rx51 postmarketos-ui-weston
[01:20:45] (rootfs_nokia-rx51) mkinitfs postmarketos
[01:21:06]  *** SET LOGIN PASSWORD FOR: 'user' ***
Changing password for user
New password:
Bad password: too weak
Retype password:
passwd: password for user changed by root
[01:23:18] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***
[01:23:18] (native) stop distccd (armhf)
[01:23:18] (native) create nokia-rx51.img (835M)
[01:23:18] WARNING: Make sure, that your target device's partition table has allocated at least 835M as system partition!
[01:23:18] Continue? (y/n) [n]: y
[01:24:23] (native) mount /dev/install (nokia-rx51.img)
[01:24:24] (native) partition /dev/install (boot: 100M, root: the rest)
[01:24:24] (native) format /dev/installp2 (root, luks), mount to /dev/mapper/pm_crypt
[01:24:24]  *** TYPE IN THE FULL DISK ENCRYPTION PASSWORD (TWICE!) ***
Enter passphrase:
Enter passphrase for /dev/installp2:
[01:25:03] (native) format /dev/mapper/pm_crypt (ext4), mount to /mnt/install
[01:25:03] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot
[01:25:03] *** (4/5) FILL INSTALL BLOCKDEVICE ***
[01:25:03] (native) copy rootfs_nokia-rx51 to /mnt/install/
[01:25:09] *** (5/5) FLASHING TO DEVICE ***
[01:25:09] Run the following to flash your installation to the target device:
[01:25:09] * pmbootstrap flasher flash_kernel
[01:25:09]   Flashes the kernel + initramfs to your device:
[01:25:09]   /home/tingo/work/nokia_n900/pmwork/chroot_rootfs_nokia-rx51/boot
[01:25:09] * pmbootstrap flasher flash_system
[01:25:09]   Flashes the system image, that has been generated to your device:
[01:25:09]   /home/tingo/work/nokia_n900/pmwork/chroot_native/home/user/rootfs/nokia-rx51.img
[01:25:09]   (NOTE: This file has a partition table, which contains a boot- and root subpartition.)
[01:25:09] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap flasher export [export_folder]' and flash outside of pmbootstrap.
[01:25:09] Done

cool.

2017-07-31: vm4 - pmOS - try a build again

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py build device-nokia-rx51
[23:23:24] (native) build x86_64/device-nokia-rx51-1-r11.apk
[23:23:24] (native) index armhf repository
[23:23:24] (native) index aarch64 repository
[23:23:24] Done

nicely.

2017-07-31: vm4 - pmOS - fix the checksum

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py checksum device-nokia-rx51
[sudo] password for tingo:
[23:21:58] (native) generate checksums for device-nokia-rx51
[23:21:59] Done

ok.

2017-07-31: vm4 - pmOS - install also fails

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py install
[23:03:47] *** (1/5) PREPARE NATIVE CHROOT ***
[23:03:47] (native) install cryptsetup util-linux e2fsprogs parted
[23:03:49] *** (2/5) CREATE DEVICE ROOTFS (nokia-rx51) ***
[23:03:50] (native) install xz
[23:03:50] (native) build x86_64/qemu-user-static-repack-2.8-r6.apk
[23:04:01] (native) install qemu-user-static-repack qemu-user-static-repack-binfmt
[23:04:03] Register qemu binfmt (arm)
[23:04:03] (rootfs_nokia-rx51) install alpine-base
[23:04:08] (native) build x86_64/postmarketos-base-2-r3.apk
[23:04:08] (native) index armhf repository
[23:04:09] (native) index aarch64 repository
[23:04:09] (native) build x86_64/device-nokia-rx51-1-r11.apk
[23:04:09] NOTE: The failed command's output is above the ^^^ line in the logfile: /home/tingo/work/nokia_n900/pmwork/log.txt
[23:04:09] ERROR: Command failed: (native) % cd /home/user/build && su user -c 'CARCH=x86_64 abuild -d'
[23:04:09] Run 'pmbootstrap log' for details.
[23:04:09] See also: <https://postmarketos.org/troubleshooting>

of course it is the same problem - wrong checksum.

2017-07-31: vm4 - pmOS - build

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py build device-nokia-rx51
[22:37:46] Download https://nl.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
[22:37:47] Download https://nl.alpinelinux.org/alpine/edge/main/x86_64/apk-tools-static-2.7.2-r0.apk
[22:37:47] (native) install alpine-base
[22:37:51] (native) install abuild build-base ccache
[22:37:59] (native) generate abuild keys
[22:38:00] (native) install uboot-tools
[22:38:00] (native) build x86_64/device-nokia-rx51-1-r11.apk
[22:38:00] NOTE: The failed command's output is above the ^^^ line in the logfile: /home/tingo/work/nokia_n900/pmwork/log.txt
[22:38:00] ERROR: Command failed: (native) % cd /home/user/build && su user -c 'CARCH=x86_64 abuild -d'
[22:38:00] Run 'pmbootstrap log' for details.
[22:38:00] See also: <https://postmarketos.org/troubleshooting>

which failed. Checking logfile log.txt in work directory

(009688) [22:49:56] (native) % cd /home/user/build && su user -c 'CARCH=x86_64 abuild -d'
>>> device-nokia-rx51: Checking sanity of /home/user/build/APKBUILD...
>>> WARNING: device-nokia-rx51: You should not have $install in source
>>> WARNING: device-nokia-rx51: No maintainer
>>> device-nokia-rx51: Cleaning temporary build dirs...
>>> device-nokia-rx51: Checking sha512sums...
deviceinfo: OK
uboot-script.cmd: OK
backlight-enable.sh: OK
90-touchscreen-dev.rules: OK
acpi_handler.sh: OK
acpi.map: OK
device-nokia-rx51.post-install: FAILED
sha512sum: WARNING: 1 of 1 computed checksums did NOT match
>>> ERROR: device-nokia-rx51: all failed
(009688) [22:49:56] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

aha, wrong checksum.

2017-07-31: vm4 - pmOS - init build

tingo@kg-vm4:~/work/nokia_n900$ cd pmbootstrap/
tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ l
./   aports/          .git/      keys/    pmb/            README.md  .travis.yml
../  CONTRIBUTING.md  .gitignore  LICENSE  pmbootstrap.py*  test/

tingo@kg-vm4:~/work/nokia_n900/pmbootstrap$ ./pmbootstrap.py init
[22:35:23] Target device (either an existing one, or a new one for porting).
[22:35:23] Available (15): asus-grouper, htc-ace, htc-bravo, lg-d855, lg-hammerhead, lg-mako, motorola-titan, nokia-rx51, qemu-amd64, qemu-vexpress, samsung-i9070, samsung-i9100, samsung-maguro, samsung-n7100, sony-amami
[22:35:23] Device [samsung-i9100]: nokia-rx51
[22:35:32] Available user interfaces (1): weston, none
[22:35:32] User interface [weston]:
[22:35:36] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.
[22:35:36] Work path [/home/tingo/.local/var/pmbootstrap]: ~/work/nokia_n900/pmwork
[22:36:06] How many jobs should run parallel on this machine, when compiling?
[22:36:06] Jobs [5]:
[22:36:09] Rebuild packages, when the last modified timestamp changed, even if the version did not change? This makes pmbootstrap behave more like 'make'.
[22:36:09] Timestamp based rebuilds (y/n) [y]:
[22:36:11] WARNING: The applications in the chroots do not get updated automatically.
[22:36:11] Run 'pmbootstrap zap' to delete all chroots once a day before working with pmbootstrap!
[22:36:11] It only takes a few seconds, and all packages are cached.
[22:36:11] Done!

ok.

2017-07-31: vm4 - pmOS - get the source a place for it

tingo@kg-vm4:~$ cd ~/work/nokia_n900
tingo@kg-vm4:~/work/nokia_n900$

clone it

tingo@kg-vm4:~/work/nokia_n900$ git clone https://github.com/postmarketOS/pmbootstrap.git
Cloning into 'pmbootstrap'...
remote: Counting objects: 3256, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 3256 (delta 45), reused 68 (delta 25), pack-reused 3150
Receiving objects: 100% (3256/3256), 4.91 MiB | 4.57 MiB/s, done.
Resolving deltas: 100% (1962/1962), done.

set up a work directory

tingo@kg-vm4:~/work/nokia_n900$ mkdir pmwork

ok

2017-07-31: vm4 - pmOS requirements Python3

tingo@kg-vm4:~$ python3 --version
Python 3.5.3

OpenSSL

tingo@kg-vm4:~$ openssl version
OpenSSL 1.1.0f  25 May 2017

looks good.

2017-07-31: vm4 - using my Debian machine as a build machine.

tingo@kg-vm4:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 9.1 (stretch)
Release:    9.1
Codename:    stretch
tingo@kg-vm4:~$ cat /etc/debian_version
9.1
tingo@kg-vm4:~$ uname -a
Linux kg-vm4 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux

ok.