Commit Graph

6 Commits (2ebb26529a1453dec48a16bb9d4949fd0db481fe)

Author SHA1 Message Date
Dustin 5f62193247 Use Portage config directly from src dir
Instead of copying the Portage configuration files to `/etc/portage` and
`/usr/${target}/etc/portage`, the build scripts now use the
configuration directories from the source directory.  This avoids issues
with changes (especially removal of files) getting propagated to the
actual configuration paths.
2023-03-12 12:47:36 -05:00
Dustin 4900085a1c Support external build directory
When running inside a QEMU microvm with the source directory shared
via 9pfs, the kernel build process fails

> Error: Could not mmap file: vmlinux

Thus, we need to run the build in a path on a local filesystem.  To
support this, the Makefile now supports an `O` option, and all the build
scripts have been adjusted to make use of it as needed.

Since building in a local filesystem would ultimately discard the final
artifacts when the VM terminates, we need yet a different location for
the files we want to keep.  The `IMAGESDIR` option can be used to
specify this path.  This path can be on a shared filesystem, thus
saving the artifacts outside the microvm.
2023-03-03 12:36:15 -06:00
Dustin e0d873bbf0 Makefile: Fix recipe dependencies 2023-02-14 00:31:26 -06:00
Dustin 5a1b007fd7 build-kernel: Avoid creating /lib directory
In a "merged-usr" system, `/lib` is a symlink to `/usr/lib`.  When
installing *sys-apps/systemd*, Portage checks to ensure this is the
case.  If this happens after `make modules_install` is run, `/lib` is
a directory, which causes the installation to fail.  To avoid this, we
need to explicitly install the modules into `/usr/lib` so that the
symlink can be created later.
2023-02-13 23:24:36 -06:00
Dustin 1687e615b4 Add top-level Makefile
Building the OS is now as simple as running `make` on a Gentoo system.

Interestingly, when `make` is executed as a (grand)child process of
another `make` process, it always prints an `Entering directory ...`
message.  This breaks the `make kernelversion` command, by adding
extraneous text to the output.
2023-02-13 23:24:36 -06:00
Dustin 025b7c6115 Initial commit 2023-02-13 23:24:36 -06:00