b786a5a157
* pmbootstrap init: Generate new port device- and linux-package * adds `pmbootstrap aportgen device-*` and `pmbootstrap aportgen linux-*` * ask for confirmation when selecting a non-existing device * generate the packages directly from init * refactor aportgen code * fixed some easy things in the linux- APKBUILD (more to come in follow-up PRs!) Testing: * Test all questions to the user from pmb.config.init and pmb.aportgen.device (except for the timezone question, because we would need to monkeypatch the os.path.exists() function, which messes up pytest, so we'd need to refactor the timezone function to be more testsuite friendly first) * Run the device wizard in a testcase a few times and check the output, that pmbootstrap.aportgen.device and pmbootstrap.aportgen.linux create by parsing the resulting APKBUILDs and deviceinfo and checking its contents. * Build the generated device package once in the same testcase Thanks a lot to @drebrez for all the help with this one: <https://github.com/postmarketOS/pmbootstrap/pull/821> See also the updated porting guide: <https://wiki.postmarketos.org/wiki/Porting_to_a_new_device>
41 lines
1.1 KiB
Bash
Executable file
41 lines
1.1 KiB
Bash
Executable file
#!/bin/ash
|
|
# shellcheck shell=dash
|
|
set -e
|
|
|
|
case $1 in
|
|
--help|-h|'')
|
|
echo "Usage: pmos-update-kernel [flavor]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# shellcheck disable=SC1091
|
|
. /etc/deviceinfo
|
|
|
|
FLAVOR=$1
|
|
METHOD=${deviceinfo_flash_methods:?}
|
|
case $METHOD in
|
|
fastboot|heimdall-bootimg)
|
|
BOOT_PARTITION=$(findfs PARTLABEL="boot")
|
|
echo "Flashing boot.img..."
|
|
dd if=/boot/boot.img-"$FLAVOR" of="$BOOT_PARTITION" bs=1M
|
|
;;
|
|
heimdall-isorec)
|
|
KERNEL_PARTITION=$(findfs PARTLABEL="${deviceinfo_flash_heimdall_partition_kernel:?}")
|
|
INITFS_PARTITION=$(findfs PARTLABEL="${deviceinfo_flash_heimdall_partition_initfs:?}")
|
|
echo "Flashing kernel..."
|
|
dd if=/boot/vmlinuz-"$FLAVOR" of="$KERNEL_PARTITION" bs=1M
|
|
echo "Flashing initramfs..."
|
|
gunzip -c /boot/initramfs-"$FLAVOR" | lzop | dd of="$INITFS_PARTITION" bs=1M
|
|
;;
|
|
0xffff)
|
|
echo -n "No need to use this utility, since uboot loads the kernel directly from"
|
|
echo " the boot partition. Your kernel should be updated already."
|
|
exit 1
|
|
;;
|
|
*)
|
|
echo "Devices with flash method: $METHOD are not supported."
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "Done."
|