[haiku-development] Re: Haiku network booting and packagefs

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 30 Mar 2016 09:00:17 +0200

On 03/29/2016 10:43 PM, Adrien Destugues wrote:

I'm doing some driver development and the turnaround times with
rebooting my workstation aren't acceptable. I'm trying to get the
network booting to work again as described in
https://www.haiku-os.org/guides/booting/over_local_network ;.

After some updates to the netboot image I now have the kernel loading
and the root filesystem mounted. When using this boot method, the kernel
is loaded spearately which means there is no need for the packagefs for
early boot, and I think the bootloader will not need any changes.

However, once the root filesystem is mounted, the boot fails because the
launch_daemon is not found. The root filesystem is a standard
haiku.image. It seems packagefs is not used when booting this way so
obviously the launch daemon and other parts of Haiku won't be found.

I would appreciate some hints as to where I should plug things for
packagefs to be used on the root filesystem. I can add the packagefs
itself to the boot archive (which is loaded through tftp during early
boot) so I can get the packagefs itself loaded and probing for
partitions. However this is not enough to get it to see the package
mountpoints in the rootfs.

The packagefs volumes are mounted in vfs_mount_boot_file_system() depending on the flag BOOT_VOLUME_PACKAGED [1] which is set by the boot loader [2] depending on whether the boot volume it found is packaged [3]. In this case the boot volume is a MemoryDisk created from the transferred and extracted haiku-netboot.tgz [4].

So, if you only want a quick solution for yourself, you could locally hack [1] or [2], hard-coding packaged operation.

A clean solution would e.g. be to check directly before [1], if the boot method is BOOT_METHOD_NET and in this case determine whether the just-mounted boot volume looks packaged (the boot loader only checks for the existence of /system/packages, so that should be good enough).

An alternative approach to investigate would be the commented out code in platform_add_boot_device() [5], i.e. directly booting off the remote disk instead of using a haiku-netboot.tgz. In this case it is important to make sure the network kernel modules and drivers are marked as boot modules (cf. [6] vs. [7]), since those must be loaded by the boot loader.

CU, Ingo

[1] http://cgit.haiku-os.org/haiku/tree/src/system/kernel/fs/vfs_boot.cpp?h=hrev50173#n525
[2] http://cgit.haiku-os.org/haiku/tree/src/system/boot/loader/vfs.cpp?h=hrev50173#n621
[3] http://cgit.haiku-os.org/haiku/tree/src/system/boot/loader/vfs.cpp?h=hrev50173#n503
[4] http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/pxe_ia32/devices.cpp?h=hrev50173#n38
[5] http://cgit.haiku-os.org/haiku/tree/src/system/boot/platform/pxe_ia32/devices.cpp?h=hrev50173#n104


[6] http://cgit.haiku-os.org/haiku/tree/build/jam/images/NetBootArchive?h=hrev50173#n87
[7] http://cgit.haiku-os.org/haiku/tree/build/jam/packages/Haiku?h=hrev50173#n197


Other related posts: