diff options
author | Aaron Ball <nullspoon@oper.io> | 2023-03-05 10:50:42 -0700 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2023-03-05 10:50:42 -0700 |
commit | 9dddbfed944f9afaa3ebba37e65d20b5a0ad85bf (patch) | |
tree | 568ad6c4e5ae300067c740ea1e9f68c04a67a482 /init | |
parent | 641531cb671f9a172cb60cd2b47a23a3f1a37f83 (diff) | |
download | mkinitramfs-9dddbfed944f9afaa3ebba37e65d20b5a0ad85bf.tar.gz mkinitramfs-9dddbfed944f9afaa3ebba37e65d20b5a0ad85bf.tar.xz |
Remove clear and cat from output init ram fs
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.
Diffstat (limited to 'init')
-rwxr-xr-x | init | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -23,10 +23,10 @@ export MOUNTOPTS=() screen_init() { # Clear screen - [ "${QUIET}" -eq 1 ] && clear + [ "${QUIET}" -eq 1 ] && printf '\033c' # Output message file if it exists - [ -f /etc/msg ] && cat /etc/msg + [ -f /etc/msg ] && printf '%s\n' "$(</etc/msg)" } @@ -58,10 +58,11 @@ log() { # # Resolves the path to the root device from the cmdline root= syntax. -# Currently handles UUID syntax and /dev/sdx syntax +# Currently handles UUID syntax and /dev/sdx syntax, btrfs subvols, debugging, +# and quiet options. # parse_cmdline() { - local cmdline=${1} + local cmdline="$(<${1:?})" for i in ${cmdline[@]}; do case "${i}" in @@ -159,7 +160,7 @@ main() { log INFO "Fake root location ${fakeroot} does not exist. Cannot boot." fi - parse_cmdline "$(cat /proc/cmdline)" + parse_cmdline /proc/cmdline # display fanciful boot image screen_init |