scripts: add a script to write a kernel into a root disk

Provide a symbol script to mount the second partition on root.img as an
ext4 filesystem and write a kernel file into it.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-02-24 04:48:03 -07:00
parent 6c3888e32a
commit e8db8747b8

19
scripts/update-kern Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0+
# Write a kernel into root.img
kern=$1
mnt=/mnt/x
loop=$(sudo losetup --show -f -P root.img)
echo LOOP $loop
sudo mount ${loop}p2 $mnt
sudo cp -v $kern $mnt/boot
# uncomment to edit extlinux.conf
#sudo gedit $mnt/boot/extlinux/extlinux.conf
sudo umount $mnt
sudo losetup -d $loop