pmaports/main/postmarketos-initramfs/init.sh
Caleb Connolly 9fb29079cd
main/postmarketos-initramfs: get to splash faster (MR 4204)
With full-fat mdev supporting by-partlabel lookups, there is a small
delay during startup. As mdev and dynamic partitions aren't actually
needed for the framebuffer device, move show_splash earlier.

Furthermore, slightly rework setup_framebuffer to not dump the verbose
message about waiting for the framebuffer unless the framebuffer isn't
found.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2023-09-07 20:33:56 +01:00

62 lines
1.6 KiB
Bash

#!/bin/sh
# shellcheck disable=SC1091
[ -e /hooks/10-verbose-initfs.sh ] && set -x
[ -e /etc/unudhcpd.conf ] && . /etc/unudhcpd.conf
. ./init_functions.sh
. /usr/share/misc/source_deviceinfo
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
/bin/busybox --install -s
/bin/busybox-extras --install -s
# Mount everything, set up logging, modules, mdev
mount_proc_sys_dev
setup_log
setup_firmware_path
# shellcheck disable=SC2154
load_modules /lib/modules/initramfs.load "usb_f_rndis"
setup_framebuffer
show_splash "Loading..."
setup_mdev
setup_dynamic_partitions "${deviceinfo_super_partitions:=}"
mount_subpartitions
run_hooks /hooks
# Always run dhcp daemon/usb networking for now (later this should only
# be enabled, when having the debug-shell hook installed for debugging,
# or get activated after the initramfs is done with an OpenRC service).
setup_usb_network
start_unudhcpd
mount_boot_partition /boot
extract_initramfs_extra /boot/initramfs-extra
setup_udev
run_hooks /hooks-extra
wait_root_partition
delete_old_install_partition
resize_root_partition
unlock_root_partition
resize_root_filesystem
mount_root_partition
# Mount boot partition into sysroot, so OpenRC doesn't need to do it (#664)
umount /boot
mount_boot_partition /sysroot/boot "rw"
init="/sbin/init"
setup_bootchart2
# Switch root
killall telnetd mdev udevd msm-fb-refresher 2>/dev/null
# shellcheck disable=SC2093
exec switch_root /sysroot "$init"
echo "ERROR: switch_root failed!"
echo "Looping forever. Install and use the debug-shell hook to debug this."
echo "For more information, see <https://postmarketos.org/debug-shell>"
loop_forever