Age | Commit message (Collapse) | Author |
|
This does many little things. First, this changes the `function <name>`
syntax to `<name>()`. This also moves referencse from `echo` to
`printf`. It also switches out the bash `[[ ]]` conditional blocks to
more ubiquitous `[ ]`. This also simplifies the `get_first_path`
function (which will later be replaced as it is pretty bad).
Finally, this rewrites the `check_crypto_support` function. Rather than
copy in all of the kernel modules, then removing unneeded ones, it has
become easier to only copy what is needed, which further reduces the
initramfs size.
|
|
This reduces the terminfo directory, which is currently over 40 MB
uncompressed, to just copy in the `l` directory, as the bootup tty is a
`linux` terminal, so we only need terminfo for that.
This also adds additional removals from the kernel device drivers
directory for modules that are not required during the boot process.
|
|
Both the clear and cat commands are not technically required, as they
have bash builtin equivelants. This will shave off tens of kilobytes
(very little unfortunately).
This also changes the syntax of the parse_cmdline function to something
more reasonable, also no longer using cat but using a bash builtin.
|
|
With the `/dev/disk` directory tree now filled out, we no longer need
blkid and cut to determine device paths based on aliases such as
partlabel or uuid. This also simplifies the code, using bash-native
parameter expansion to cut substrings.
|
|
Previously block device aliases did not load correctly, so the direct
`/dev/nvme*` path for example was required as `/dev/disk/by-*` was not
available at all for mounting by partlabel or uuid.
This adds the udevadm and udevd binaries so the /dev/disk directory tree
can be populated during init, allowing for block device aliases. This
also does some cleanup and organization to improve the over code
quality.
|
|
Previously dm-crypt had to be statically compiled into the kernel, which
is cumbersome, not well documented, and makes the kernel larger.
This supports dm-crypt being an external module, adding rmmod and
modprobe to the initramfs, and copying in the relevant kernel modules
directory, stripping out graphics device support, bluetooth, sound,
virtualization, and networking support modules.
This also updates the copyright year.
|
|
This makes the process a bit more transparent and easier to troubleshoot
when things break.
|
|
The new version 2 of cryptsetup requires libgcc_s.so to be installed at
decrypt time, or the following error message will occur:
libgcc_s.so.1 must be installed for pthread_cancel to work
Note that this only affects luks containers using the new version 2
spec. Version 1 containers use a different process that does not require
libgcc_s.
|
|
|
|
This checks the init script for any syntax errors, which could prevent
producing an unbootable initramfs archive, should the end user make
manual changes to the init script that contain syntax errors.
|
|
Previously, terminals could execute various commands (namely `clear`)
because the terminals database could not be found in the initramfs. This
ensures that the terminals database is present on boot so certain
commands run without error or warning.
|
|
Moved expected path for msg to /etc/msg, rather than res_path/msg.
Quoted paths on install commands.
|
|
Previously, it was assumed that the encrypted device contained a single
filesystem. Now we run a partprobe on decrypt to detect an existing
partition table inside the container. Behavior with devices that just
contain a single filesystem is unaffected.
This adds the partprobe binary to the initramfs.
|
|
|
|
Install supports -D and -m switches to create leading paths if they
don't exist yet, and set destination permissions on copy. These make the
script more reliable and shorter.
Updated cache directory setup function to create fewer directories since
the install command handles much of that now.
Cleaned up some parent directory determination logic as a result of this
new functionalty as well.
Also added reboot command to binaries to be installed.
|
|
Drops the boot sequence into an interractive bash shell, just prior to
mounting the new root fs (the first step where real issues may occur).
This is mostly useful for debugging to see what the environment looks
like, manually mount partitions, etc.
|
|
Removed unused get_bin_deps function
Added function comments for all functions in mkinitramfs.
Added GPLv3 LICENSE file
Added GPLv3 licence header to mkinitramfs
Miscellaneous other code comments.
Added execute switch to mkinitramfs and init scripts
|
|
The old way hardcoded paths to binaries that were needed for the
initramfs to do its thing. The problem with that is that this script
may be run on different linux distros, which don't always store things
in the same place (notably anything in /bin/ or /sbin/).
This commit adds the resolve_bins function which takes an array of
binary names. It then searches PATH for each binary, updating the global
fqbins variable with the found absolute path. If a binary cannot be
found, the script errors, and exits status code 1. This will make the
script much more flexible.
|
|
Implemented encryption support checking
Implemented multi-version support
Removed copy operations for /dev/ devices
Improved info and error messages
|
|
Before this commit, the script was expecting init to be located in the
same directory mkinitramfs was being executed from. However, if the
script was installed on a system, it will be called from
/usr/bin/mkinitramfs, or something like that. This would cause it to be
unable to find the init script.
Implemented the res_path variable so absolute paths to resources can be
specified that mkinitramfs will use.
|
|
Also added checking for a kernel supporting dm-crypt in mkinitramfs.
Warns if module is not statically compmiled in.
|
|
Fixed initrd file output
Added copy of various useful /dev devices
Wrote cache_dir_setup function. This handles setup of the temporary
working directory where binaries are copied to
Added a few binaries necessary for this initrd to work (mount,
sleep, umount, which, cat, echo, ls, cryptsetup)
Fixed xz command (uses crc32 instead of crc64, since 64 isn't
supported yet by the kernel in initrd)
|
|
Mostly functioning, but missing a few binaries and libraries
required to boot a system's kernel.
|