2017-05-26 20:26:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-04-11 09:47:41 +00:00
|
|
|
outfile=""
|
|
|
|
outfile_extra=""
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
. /usr/share/postmarketos-mkinitfs/mkinitfs_functions.sh
|
2017-10-22 21:00:39 +00:00
|
|
|
|
2017-05-26 20:26:25 +00:00
|
|
|
# initialize
|
|
|
|
source_deviceinfo
|
2017-07-28 18:51:21 +00:00
|
|
|
parse_commandline "$1" "$2" "$3"
|
2018-03-26 18:12:58 +00:00
|
|
|
check_hook_files
|
2020-02-05 19:32:16 +00:00
|
|
|
|
2017-05-26 20:26:25 +00:00
|
|
|
echo "==> initramfs: creating $outfile"
|
|
|
|
tmpdir=$(mktemp -d /tmp/mkinitfs.XXXXXX)
|
|
|
|
|
|
|
|
# set up initfs in temp folder
|
|
|
|
create_folders
|
2017-07-28 18:51:21 +00:00
|
|
|
copy_files "$(get_modules)" "$tmpdir"
|
|
|
|
copy_files "$(get_binaries)" "$tmpdir"
|
2017-09-20 18:36:22 +00:00
|
|
|
copy_files "/etc/deviceinfo" "$tmpdir"
|
2017-07-28 18:51:21 +00:00
|
|
|
copy_files "/etc/postmarketos-mkinitfs/hooks/*.sh" "$tmpdir"
|
2020-01-20 15:30:01 +00:00
|
|
|
cp /usr/share/postmarketos-splashes/*.ppm.gz "$tmpdir"
|
2017-05-26 20:26:25 +00:00
|
|
|
ln -s "/bin/busybox" "$tmpdir/bin/sh"
|
|
|
|
install -Dm755 "/usr/share/postmarketos-mkinitfs/init.sh.in" \
|
|
|
|
"$tmpdir/init"
|
|
|
|
install -Dm755 "/usr/share/postmarketos-mkinitfs/init_functions.sh" \
|
|
|
|
"$tmpdir/init_functions.sh"
|
|
|
|
|
|
|
|
# finish up
|
|
|
|
replace_init_variables
|
2017-07-28 18:51:21 +00:00
|
|
|
create_cpio_image "$tmpdir" "$outfile"
|
2019-05-27 15:28:40 +00:00
|
|
|
append_or_copy_dtb
|
2020-08-05 17:10:49 +00:00
|
|
|
add_mtk_header
|
2017-07-25 20:08:35 +00:00
|
|
|
create_uboot_files
|
2017-06-29 17:51:17 +00:00
|
|
|
create_bootimg
|
2021-06-03 00:31:22 +00:00
|
|
|
flash_updated_boot_parts
|
2017-06-09 23:41:01 +00:00
|
|
|
|
2017-05-26 20:26:25 +00:00
|
|
|
rm -rf "$tmpdir"
|
2017-07-28 18:51:21 +00:00
|
|
|
|
2020-02-24 10:53:59 +00:00
|
|
|
generate_initramfs_extra "$outfile_extra"
|
|
|
|
|
2021-04-11 16:49:36 +00:00
|
|
|
sync
|
2017-05-26 20:26:25 +00:00
|
|
|
exit 0
|