Adjust the boot code to boot from either a root with a /boot, or directly
commit79dc5fc68b82cbd37e951d5ef3f85d92c32e70ae
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 2 Sep 2008 17:21:18 +0000 (2 17:21 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 2 Sep 2008 17:21:18 +0000 (2 17:21 +0000)
treefef0ed4b8e9ca1e7938bf06bcb0126585a3c2d4c
parent9116be8e26f72cff73948f67bce445efee48e48c
Adjust the boot code to boot from either a root with a /boot, or directly
from a /boot partition (which will look like '/' to the loader).

These changes allow you to make your 'a' partition a /boot only partition.
Your /boot/loader.conf would then have a directive to tell the kernel where
the root partition is, e.g.:

    vfs.root.mountfrom="hammer:${disk}s1d"

* Add a chdir() hack and rel_open() that uses the chdir base.

* chdir("/boot")... if it exists.

* Change all config and most other paths to be relative

* boot2 does not have access to the chdir() hack.  Adjust boot2 to look
  for the loader as both "/loader" and "/boot/loader".
20 files changed:
sys/boot/common/Makefile.inc
sys/boot/common/bootstrap.h
sys/boot/common/commands.c
sys/boot/common/interp.c
sys/boot/common/interp_forth.c
sys/boot/common/load.c
sys/boot/common/load_elf.c
sys/boot/common/ls.c
sys/boot/common/module.c
sys/boot/common/pnp.c
sys/boot/common/rel_open.c [new file with mode: 0644]
sys/boot/ficl/loader.c
sys/boot/forth/beastie.4th
sys/boot/forth/loader-bootp.conf
sys/boot/forth/loader.4th
sys/boot/forth/loader.conf
sys/boot/forth/loader.rc
sys/boot/pc32/Makefile
sys/boot/pc32/boot2/boot2.c
sys/boot/pc32/loader/loader.rc