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:
19
scripts/update-kern
Executable file
19
scripts/update-kern
Executable 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
|
||||
Reference in New Issue
Block a user