device: add genimage config files
Signed-off-by: carbon <carbon@milkv.io>
This commit is contained in:
44
device/gen_burn_image_sd.sh
Executable file
44
device/gen_burn_image_sd.sh
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# milkv sd image generator
|
||||||
|
|
||||||
|
# usage
|
||||||
|
if [ "$#" -ne "1" ]; then
|
||||||
|
echo "usage: ${0} OUTPUT_DIR"
|
||||||
|
echo ""
|
||||||
|
echo " The script is used to create a sdcard image with two partitions, "
|
||||||
|
echo " one is fat32 with 128MB, the other is ext4 with 256MB."
|
||||||
|
echo " You can modify the capacities in genimage cfg as you wish!"
|
||||||
|
echo " genimage cfg: milkv/genimage-milkv-duo.cfg"
|
||||||
|
echo ""
|
||||||
|
echo "Note: Please backup you sdcard files before using this image!"
|
||||||
|
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "BR_DIR: $BR_DIR"
|
||||||
|
echo "BR_BOARD: $BR_BOARD"
|
||||||
|
|
||||||
|
# genimage command in buildroot host bin
|
||||||
|
BR_HOST_BIN="${BR_DIR}/output/${BR_BOARD}/host/bin"
|
||||||
|
if [ ! -d ${BR_HOST_BIN} ]; then
|
||||||
|
echo "host/bin not found, check buildroot output dir!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH=${BR_HOST_BIN}:${PATH}
|
||||||
|
|
||||||
|
output_dir=$1
|
||||||
|
echo ${output_dir}
|
||||||
|
pushd ${output_dir}
|
||||||
|
|
||||||
|
[ -d tmp ] && rm -rf tmp
|
||||||
|
|
||||||
|
genimage --config ${TOP_DIR}/device/${MV_BOARD}/genimage.cfg --rootpath fs/ --inputpath ${PWD} --outputpath ${PWD}
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "gnimage for ${MV_BOARD} success!"
|
||||||
|
else
|
||||||
|
echo "gnimage for ${MV_BOARD} failed!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd
|
||||||
33
device/milkv-duo256m-musl-riscv64-sd/genimage.cfg
Normal file
33
device/milkv-duo256m-musl-riscv64-sd/genimage.cfg
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
image boot.vfat {
|
||||||
|
vfat {
|
||||||
|
label = "boot"
|
||||||
|
files = {
|
||||||
|
"fip.bin",
|
||||||
|
"rawimages/boot.sd",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size = 128M
|
||||||
|
}
|
||||||
|
|
||||||
|
image rootfs.ext4 {
|
||||||
|
ext4 {
|
||||||
|
label = "rootfs"
|
||||||
|
}
|
||||||
|
size = 768M
|
||||||
|
}
|
||||||
|
|
||||||
|
image milkv-duo256m-musl-riscv64-sd.img {
|
||||||
|
hdimage {
|
||||||
|
}
|
||||||
|
|
||||||
|
partition boot {
|
||||||
|
partition-type = 0xC
|
||||||
|
bootable = "true"
|
||||||
|
image = "boot.vfat"
|
||||||
|
}
|
||||||
|
|
||||||
|
partition rootfs {
|
||||||
|
partition-type = 0x83
|
||||||
|
image = "rootfs.ext4"
|
||||||
|
}
|
||||||
|
}
|
||||||
33
device/milkv-duos-musl-riscv64-sd/genimage.cfg
Normal file
33
device/milkv-duos-musl-riscv64-sd/genimage.cfg
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
image boot.vfat {
|
||||||
|
vfat {
|
||||||
|
label = "boot"
|
||||||
|
files = {
|
||||||
|
"fip.bin",
|
||||||
|
"rawimages/boot.sd",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
size = 128M
|
||||||
|
}
|
||||||
|
|
||||||
|
image rootfs.ext4 {
|
||||||
|
ext4 {
|
||||||
|
label = "rootfs"
|
||||||
|
}
|
||||||
|
size = 768M
|
||||||
|
}
|
||||||
|
|
||||||
|
image milkv-duos-musl-riscv64-sd.img {
|
||||||
|
hdimage {
|
||||||
|
}
|
||||||
|
|
||||||
|
partition boot {
|
||||||
|
partition-type = 0xC
|
||||||
|
bootable = "true"
|
||||||
|
image = "boot.vfat"
|
||||||
|
}
|
||||||
|
|
||||||
|
partition rootfs {
|
||||||
|
partition-type = 0x83
|
||||||
|
image = "rootfs.ext4"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user