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.
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.
* Enable additional hardware drivers in Linux for better bare metal
display, network & input device compatibility
* Disable ATA-over-Ethernet support, because it spams the network
with unnecessary packets, is basically useless for bootstrapping,
and may even be a security risk
* Increase Fiwix initrd size to 1280MB to fit a larger Linux build
* Make the Fiwix kexec size configurable the same way as initrd
(and reduce from 280MB to 256MB which is sufficient in my testing)
* Use a more conservative memory map for Fiwix & Linux
* Boot Linux with consoleblank=0 on bare metal, so the build won't
go blind after 5 minutes
* Support kexec-fiwix with interrupts disabled (will be useful later
when builder-hex0 is updated)
* Use -S32 -H64 --force to trick sfdisk into allowing MiB-aligned
partitions on a drive that reports a CHS geometry
* Explicitly create partition at sector 2097152 (=1GiB)
* Force mkfs.ext4 to overwrite any existing filesystem it might find
* Wait up to 2 minutes for the disk to become readable (especially
USB drives often show up with a delay)
With this, finalize_fhs.sh can be rerun as needed, e.g. when rebooting.
Also, the preferred nameserver will persist after DHCP.
Thanks to devtmpfs, we no longer need to manage /dev once Linux is up.