`mke2fs` has a `-d` option that allows to populate the newly created filesystem without needing to temporarily mount it. That allows to use `parted` and `mkfs.ext3` on regular files without needing root access.
Before the simplify refactor, the convention was to name the first
or default build script "<package name>.sh". The refactor changed
this default to "pass1.sh", with "pass2.sh" and so on used for
subsequent passes. This wasn't an issue when building usig scripts
generated by script-generator (which explicitly declares the build
script to use), but broke running "build <package name>" without
an explicit script name from the post-bootstrap bash prompt.
By deriving the script name from the current revision/pass number,
this commit restores that functionality.
An unfortunate blemish is that we number build scripts from 1, but
repo tarballs from 0 - it would be nice to standardize on a single
indexing convention.
This ends the reliance on the precompiled stage1 image in ootstrap-seeds,
and the locally committed copy of the stage2 hex0 code. Instead, both
stages are taken from the new builder-hex0 submodule, with stage1 compiled
by generator.py on the fly. The local copy of stage2 is dropped.
This way, updating to a newer builder-hex0 becomes much easier: just update
the submodule.
The Linux kernel won't autocreate /dev/shm inside devtmpfs.
Without it, semaphores won't work properly in Python.
Previously, /dev/shm was set up in populate_device_nodes, but we
no longer run that after booting into Linux.
The sysrq shutdown trigger takes some time to fully shut down the system,
during which init is expected to continue running. Since after.sh is the
last step in our init, if it quits before shutdown is complete, Linux will
panic with "Attempted to kill init".
Add an infinite loop after shutdown is issued via sysrq to prevent this.
This was removed as part of the simplify refactor, severely slowing
down qemu and bare-metal builds. Restoring it brings us back to the
same build times that we saw before the refactor.
Perform variable substitution at runtime, rather than at generation
time. This way, if bootstrap.cfg changes after update_env, the new
values there take effect immediately.