Commit Graph

20 Commits (238c3aff05f6d301b16ce65c61b888ae3c86dac9)

Author SHA1 Message Date
Dustin d117207bd2 Make more project config files optional
`build.packages`, `installonly.packages`, and `busybox.symlinks` are now
optional in the `$CONFIGDIR`.  If they do exist, they are combined with
the same files in the Aimee OS source.
2024-12-05 22:38:49 -06:00
Dustin 26b422ed74 Drop ebuild patches
None of these are necessary anymore.  They do not apply cleanly to
current versions of ebuilds in Gentoo's repository, causing builds to
fail.

Going forward, I think it will be better to maintain patched ebuilds in
the Aimee OS repository, rather than patching them at build time.
2024-12-05 20:04:31 -06:00
Dustin 70771c8067 Use host tools from build container
Instead of building host tools along with the target packages, we now
rely on the build container to contain everything we need to build Aimee
OS.  The _aimee-os.org/build/build-{target}_ image (tentative name)
includes a cross-compilation toolchain and all of the tools that were
originally listed in `host-tools.packages`.
2024-12-05 17:56:34 -06:00
Dustin 80077a7934 make: Add build phony target
Now you can run `make build` to (re-)build binary packages.
2023-03-30 09:31:12 -05:00
Dustin 02c3a12c08 Support semanage.mods
Aimee OS variants can now supply a `semange.mods` file in their
configuration directories.  This file contains SELinux customizations,
in the format produced by `semanage export`.  Variants can use this
mechanism to set SELinux booleans, change user/login mappings, and other
SELinux policy customization.  At build time, the base `selinux.mods`
file in the source directory is combined with the variant's file, if it
exists, and the resultant customizations are applied in a single
transaction.
2023-03-30 09:23:44 -05:00
Dustin 38b0081012 make: Rebuild sdcard.img when rootfs built 2023-03-30 09:03:45 -05:00
Dustin 111c5967fd build-squashfs: Allow defining pseudo files
The `mksquashfs` command accepts a `-pf` argument, which specifies a
file that defines "pseudo files."  Each line in the file defines some
file path and an operation to perform on that path *in the generated
filesystem image*.  This allows, e.g. creating files, changing their
permissions, etc. that cannot be done in the source directory for
whatever reason.

Aimee OS now allows a variant to provide a pseudo file definition file
for `mksquashfs` by creating a `squashfs.pseudo` file in its
configuration directory.
2023-03-30 09:03:45 -05:00
Dustin 0bc861ced1 Split out base squashfs.exclude
Variants no longer need to specify the full contents of the
`squashfs.exclude` file.  The "base" file in the source directory gets
combined with the one from the config directory (if it exists).
2023-03-29 18:44:45 -05:00
Dustin 6b262ca0fb Separate base packages from customizations
The `build.packages` and `install.packages` files in the CONFIGDIR now
only need to include *additional* packages to install.  The packages
*required* for Aimee OS are always installed, listed in the
corresponding files in the source directory.
2023-03-21 19:39:33 -05:00
Dustin 31d8a98f64 build: Implement CONFIGDIR setting
In effort to support different builds of Aimee OS using the same
scripts, without necessarily having to fork this repository, the build
system now supports a `CONFIGDIR` setting.  When this variable is set,
files defining the target environment, such as the lists of packages to
install, the kernel configuration, the Portage configuration, etc. are
found in the path it specifes.

The reference build, for the Home Assistant Yellow board, is configured
in the `yellow` directory.  To build it, run:

```sh
CONFIGDIR=yellow ./vm-build.sh
```
2023-03-15 21:12:04 -05:00
Dustin a5a642cb9a build: Rebuild when Portage config changes
The `host-tools` and `build` targets will now be rebuilt automatically
when the respective Portage configuration changes.
2023-03-12 12:53:16 -05:00
Dustin 9bdf0fbfd0 build: Trigger rebuild on overlay changes
If any file in the `overlay` directory changes, the `build-rootfs.sh`
script needs to be re-run in order to copy the changes into the
destination root and regenerate the SquashFS image.
2023-03-12 12:47:36 -05:00
Dustin 189f1f656e wip: build u-boot with Portage 2023-03-12 12:47:36 -05:00
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 3ca750f495 build: Rebuild when busybox.symlinks changes 2023-03-12 12:47:36 -05:00
Dustin dbc02a99a1 Simplify specifying packages to build/install
The Portage packages that need to be built and/or installed are now
specified in the `build.packages` and `install.packages` files,
respectively.  Similarly, packages to be installed on the host system
are specified in `host-tools.packages`.  Finally, the
`installonly.packages` file contains a list of packages that are
installed in the destination root, but not built in the sysroot
beforehand.

This allows `make` to better track when the package sets change.  It
will also make it easier to maintain different sets for different
variants in the future.
2023-03-08 11:12:00 -06: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 c91bff6f6d Makefile: Allow rebuilding just the squashfs image
This way we can rebuild the image even if nothing changed in the root
filesystem, but the excluded path list did.
2023-02-14 21:08:27 -06:00
Dustin e0d873bbf0 Makefile: Fix recipe dependencies 2023-02-14 00:31:26 -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