#!/bin/bash build() { for dir in proc sys dev run /usr/{bin,sbin}; do add_dir "/$dir" done add_binary /lib/initcpio/busybox /bin/busybox add_binary /sbin/modprobe add_binary /sbin/blkid add_file "/lib/initcpio/init_functions" "/init_functions" add_file "/lib/initcpio/init" "/init" add_file "/etc/modprobe.d/usb-load-ehci-first.conf" # write a new config file. re-source the config as we can't guarantee the # environment hasn't been modified, but subshell it so it doesn't disturb # anyone else. ( . "$CONFIG" # sanitize of any extra whitespace read -r -a modules <<< "$MODULES" read -r -a hooks <<< "$HOOKS" { (( ${#modules[*]} )) && printf 'MODULES="%s"\n' "${modules[*]}" (( ${#hooks[*]} )) && printf 'HOOKS="%s"\n' "${hooks[*]}" } >"$BUILDROOT/config" ) } help() { cat <