image-lvm-stub: Base image for use with 'make run'

This commit is contained in:
Tobias Waldekranz
2026-03-08 21:54:35 +00:00
parent e7fabfc37d
commit f81de1d3ec
4 changed files with 50 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/board/common/image/image-itb-dl-release/Config.
comment "General"
source "$BR2_EXTERNAL_INFIX_PATH/board/common/image/image-barebox-esp/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/common/image/image-lvm-stub/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/common/image/image-readme/Config.in"
endmenu
@@ -0,0 +1,8 @@
config IMAGE_LVM_STUB
bool "LVM2 stub image"
default y if IMAGE_DDI
help
An empty LVM2 physical volume attached to the internal
volume group. This is useful as a base image for persistent
storage in QEMU emulation scenarios where the OS is supplied
in a separate image.
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
set -e
mkdir -p "${WORKDIR}"/root
rm -rf "${WORKDIR}"/tmp
mkdir -p "${WORKDIR}"/tmp
"${BR2_EXTERNAL_INFIX_PATH}"/utils/lvm-mkinternal >"${WORKDIR}"/stub.lvm
cat <<EOF >"${WORKDIR}"/genimage.cfg
image lvm-stub.disk {
hdimage {
partition-table-type = "gpt"
}
partition internal {
growfs = "true"
image = "stub.lvm"
partition-type-uuid = "lvm"
}
}
# Silence genimage warnings
config {}
EOF
genimage \
--tmppath "${WORKDIR}"/tmp \
--rootpath "${WORKDIR}"/root \
--inputpath "${WORKDIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${WORKDIR}"/genimage.cfg
@@ -0,0 +1,7 @@
################################################################################
#
# image-lvm-stub
#
################################################################################
$(eval $(ix-image))