Skip to main content

Netboot: Booting postmarketOS from the Internet

分類 Smartphone Linux Phone
標籤 PostmarketOS
Table of Contents

中文版

Booting postmarketOS from Internet.

Netboot works like “Live-USB” that users could try postmarketOS without flashing the OS. Of course, the bootloader must be unlcoked in the first place.

  • Device: Xiaomi Redmi 5 Pro (whyred)

Run pmbootstrap and choose xiaomi/whyred. Then we have to modify kernel configs.

1. Check netboot compatbility of Linux kernel
#

  1. Check if the kernel supports Netboot
pmbootstrap kconfig check --netboot linux-xiaomi-whyred
  1. If the kernel does not support Netboot, this message should pop up:
WARNING: linux-xiaomi-whyred/config-xiaomi-whyred.aarch64: CONFIG_BLK_DEV_NBD should be set.
ERROR: kconfig check failed!
  1. Edit kernel configs
pmbootstrap kconfig edit
  1. Enable CONFIG_BLK_DEV_NBD:
Symbol: BLK_DEV_NBD [=n]
Type  : tristate
Prompt: Network block device support
Location:
 -> Device Drivers
     -> Block devices (BLK_DEV [=y])
        -> Network block device support
  1. Compile Linux kernel
pmbootstrap build linux-xiaomi-whyred

2. Netbooting
#

  1. Create rootfs
pmbootstrap --extra-space 3000 install --no-sparse
  1. Reboot the phone into fastboot mode. Connect it to PC. Then postmarketOS logo will show up and wait for rootfs
pmbootstrap initfs hook_add netboot
pmbootstrap flasher boot
  1. Open 9999 port of firewall on the PC. Then start Netboot server:
pmbootstrap netboot serve
  1. Now the phone should boot. We could ssh into it:
ssh user@172.16.42.1
  1. Now we can try out postmarketOS on the phone. Everthything works like real installation. And postmarketOS will stop working if the phone is unplugged from PC.

The data of Netboot postmarketOS is located at ~/.local/var/pmbootstrap/images_netboot/.

References

Related


此處提供二種留言板。點選按鈕,選擇您覺得方便的留言板。

(留言板載入中)這是Giscus留言板,需要Github帳號才能留言。支援Markdown語法,若要上傳圖片請善用外部圖床。您的留言會在Github Discussions向所有人公開。

Click here to edit your comments.

(留言板載入中)這是Disqus留言板,您可能會看到Disqus強制投放的廣告。為防止垃圾內容,有時留言可能會被系統判定需審核,導致延遲顯示,請見諒。若要上傳圖片請善用外部圖床網站。