Netboot
WARNING: Netboot support is not yet merged into pmbootstrap & pmaports |
Netboot describes the means of booting a device when the rootfs is not on the device but accessed via network, in this implementation via USB networking.
Preparations
Make sure your kernel has the necessary kernel config options for netboot.
$ pmbootstrap kconfig check --netboot $kernel-package-name
If not you need to adjust your kernel config otherwise netboot won't work.
Usage
First prepare a rootfs for your device. It is advisable to use the --extra-space
argument to increase the size of your rootfs (in the example you will get 1000MB of extra space) as no image resize will happen at runtime.
$ pmbootstrap --extra-space 1000 install
Then prepare your boot.img and flash it to the device:
$ pmbootstrap initfs hook_add netboot
$ pmbootstrap flasher flash_kernel # or however you flash/boot the kernel
After booting the device a network interface should appear over USB networking.
Finally you need to start the netboot server on your computer with the following command:
$ pmbootstrap netboot serve
If you've never used netboot for the current device, then the image from the previous pmbootstrap install
will get copied to $pmbootstrap_work/images_netboot/
and will persist normal pmbootstrap zap
calls as you will probably have data in your rootfs.
Replacing persisted rootfs
You can replace the persisted rootfs image with a fresh image from pmbootstrap install
:
$ pmbootstrap netboot serve --replace
Deleting all netboot images
You can delete all persisted rootfs images:
$ pmbootstrap zap --netboot