Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postmarketOS port and documentation #39

Open
5 of 6 tasks
hansemro opened this issue May 19, 2021 · 3 comments
Open
5 of 6 tasks

Add postmarketOS port and documentation #39

hansemro opened this issue May 19, 2021 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@hansemro
Copy link
Owner

hansemro commented May 19, 2021

postmarketOS merge request: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2202
postmarketOS device wiki page: https://wiki.postmarketos.org/wiki/Amazon_Kindle_Fire_(amazon-otter)

Tasks/Status:

  • Finish rootfs install documentation
  • Build postmarketOS with mainline kernel (and patches)
  • Make pmbootstrap flasher work with Kindle
  • Working postmarketOS initramfs
  • Working postmarketOS boot image (Booting handled by u-boot script)
  • Settle on partition layout (stock layout works fine)
@hansemro hansemro added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels May 19, 2021
@hansemro hansemro self-assigned this May 19, 2021
@hansemro
Copy link
Owner Author

I am going to take a page out of the port for Nokia N900 and use a u-boot script to handle booting.

Nokia N900 pmaport
Relevant u-boot commit: hansemro/kf_u-boot@71d3531

So we can have a bootscript (uboot-script.cmd) like this:

setenv mmcnum 1
setenv mmcpart 9
setenv mmctype ext4
setenv dtbootargs init=/init.sh rw console=tty0 console=tty02 PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE
echo Loading initramfs
load mmc ${mmcnum}:${mmcpart} 0x81000000 /boot/initramfs-amazon-otter
echo Loading kernel
load mmc ${mmcnum}:${mmcpart} 0x80008000 /boot/zImage-amazon-otter
echo Loading fdt
load mmc ${mmcnum}:${mmcpart} 0x82000000 /boot/omap4-kc1.dtb
echo Booting kernel
bootz 0x80008000 0x81000000 0x82000000

and generate boot.scr with the following command:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n postmarketos -d "$srcdir"/uboot-script.cmd "$srcdir"/boot.scr

However, I will need to make some adjustments to support split-off boot partition from root since postmarketOS insists on it to support full disk encryption.

Since I am not using an initramfs, I am using a version of the boot script without loading initramfs. So far, it works pretty well.

@hansemro
Copy link
Owner Author

hansemro commented May 25, 2021

With this and upcoming changes to linux/device package scripts, I can load the pmbootstrap-built kernel and initramfs.

uboot-script.cmd

setenv dtbootargs init=/init.sh rw root=/dev/mmcblk0p9 console=tty0 console=tty02 PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE
echo Loading initramfs
load mmc 1:9 0x82000000 /boot/uInitrd-amazon-otter
echo Loading kernel
load mmc 1:9 0x80008000 /boot/vmlinuz-5.12.0
echo Loading fdt
load mmc 1:9 0x84000000 /boot/omap4-kc1.dtb
echo Booting kernel
bootz 0x80008000 0x82000000 0x84000000
#!/usr/bin/env sh
mkimage -n 'Ramdisk Image'  -A arm -O linux -T ramdisk -C gzip -d /boot/initramfs-amazon-otter /boot/uInitrd-amazon-otter
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n postmarketos -d /boot/uboot-script.cmd /boot/boot.scr

Initramfs does get stuck because I am not following postmarketOS partitioning guidelines. I will edit the initramfs and try again later.

image

image

@hansemro
Copy link
Owner Author

I made some progress with postmarketOS and created a pmaports merge request (https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2202).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant