-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script to boot new kernel once when developing on target device
- Loading branch information
1 parent
448c323
commit b961be2
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# partlabels boiiiiiiiiii | ||
export KERNA=/dev/disk/by-partlabel/MMCKernelA | ||
export KERNB=/dev/disk/by-partlabel/MMCKernelB | ||
|
||
export CADMIUMROOT=$1 | ||
|
||
source $CADMIUMROOT/config | ||
|
||
cd $CADMIUMROOT/tmp/linux-$TARGET/ | ||
|
||
# if anything fails, bail out | ||
set -e | ||
|
||
# repack kernel | ||
[ -f 'vmlinux.uimg' ] && rm vmlinux.uimg | ||
mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg || true | ||
dd if=/dev/zero of=bootloader.bin bs=512 count=1 | ||
vbutil_kernel --pack vmlinux.kpart \ | ||
--version 1 \ | ||
--vmlinuz vmlinux.uimg \ | ||
--arch aarch64 \ | ||
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \ | ||
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \ | ||
--config cmdline \ | ||
--bootloader bootloader.bin | ||
rm vmlinux.uimg | ||
|
||
# set tries to one | ||
cgpt add -i 2 -t kernel -b 73728 -s 65536 -l MMCKernelB -S 0 -T 1 -P 15 /dev/mmcblk? | ||
|
||
make modules_install | ||
|
||
# write new kernel | ||
|
||
dd if=./vmlinux.kpart of=$KERNB | ||
|
||
echo "Save all data and reboot" |