Skip to content

Commit

Permalink
add script to boot new kernel once when developing on target device
Browse files Browse the repository at this point in the history
  • Loading branch information
Maccraft123 committed Jan 1, 2021
1 parent 448c323 commit b961be2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions kernel/test-kernel
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"

0 comments on commit b961be2

Please sign in to comment.