diff options
author | Simon Spöhel <simon@spoehel.ch> | 2023-08-24 14:35:18 +0000 |
---|---|---|
committer | Simon Spöhel <simon@spoehel.ch> | 2023-08-24 14:41:06 +0000 |
commit | 7c674a11ca49df28f78f49a876660891ad7b4355 (patch) | |
tree | 6e0663b70509c15ec97f15ba24137117d30a9acb /share/build-scripts/debconf.d | |
parent | Adding todo file (FIXME). (diff) | |
download | compute-tools-7c674a11ca49df28f78f49a876660891ad7b4355.tar.xz compute-tools-7c674a11ca49df28f78f49a876660891ad7b4355.zip |
basic cnt build for vms (debconf only)
Diffstat (limited to 'share/build-scripts/debconf.d')
-rwxr-xr-x | share/build-scripts/debconf.d/0003-debconf | 209 | ||||
-rw-r--r-- | share/build-scripts/debconf.d/0003-debconf.templates | 82 |
2 files changed, 291 insertions, 0 deletions
diff --git a/share/build-scripts/debconf.d/0003-debconf b/share/build-scripts/debconf.d/0003-debconf index e12e25e..76da4c2 100755 --- a/share/build-scripts/debconf.d/0003-debconf +++ b/share/build-scripts/debconf.d/0003-debconf @@ -1340,6 +1340,195 @@ Internal_options () echo "CNT_OVERLAY_OPTIONS=\"${CNT_OVERLAY_OPTIONS}\"" >> "${DEBCONF_TMPDIR}/debconf.default" } +Cpu () +{ + db_get container/cpu + CPU="${RET}" # select + + if [ -z "${CPU}" ] + then + CPU="${RET}" # string (w/o empty) + + case "${CPU}" in + debconf) + CPU="host" + ;; + esac + fi + + echo "CPU=\"${CPU}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export CPU +} + +Memory () +{ + db_get container/memory + MEMORY="${RET}" # select + + if [ -z "${MEMORY}" ] + then + MEMORY="${RET}" # string (w/o empty) + + case "${MEMORY}" in + debconf) + MEMORY="2G" + ;; + esac + fi + + echo "MEMORY=\"${MEMORY}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export MEMORY +} + +Display () +{ + db_get container/display + DISPLAY="${RET}" # select + + if [ -z "${DISPLAY}" ] + then + DISPLAY="${RET}" # string (w/o empty) + + case "${DISPLAY}" in + debconf) + DISPLAY="2G" + ;; + esac + fi + + echo "DISPLAY=\"${DISPLAY}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export DISPLAY +} + +Serial () +{ + db_get container/serial + SERIAL="${RET}" # select + + if [ -z "${SERIAL}" ] + then + SERIAL="${RET}" # string (w/o empty) + + case "${SERIAL}" in + debconf) + SERIAL="host" + ;; + esac + fi + + echo "SERIAL=\"${SERIAL}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export SERIAL +} + +Monitor () +{ + db_get container/monitor + MONITOR="${RET}" # select + + if [ -z "${MONITOR}" ] + then + MONITOR="${RET}" # string (w/o empty) + + case "${MONITOR}" in + debconf) + MONITOR="host" + ;; + esac + fi + + echo "MONITOR=\"${MONITOR}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export MONITOR +} + +Firmware () +{ + db_get container/firmware + FIRMWARE="${RET}" # select + + if [ -z "${FIRMWARE}" ] + then + FIRMWARE="${RET}" # string (w/o empty) + + case "${FIRMWARE}" in + debconf) + FIRMWARE="host" + ;; + esac + fi + + echo "FIRMWARE=\"${FIRMWARE}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export FIRMWARE +} + +Drive () +{ + db_get container/drive + DRIVE="${RET}" # select + + if [ -z "${DRIVE}" ] + then + DRIVE="${RET}" # string (w/o empty) + + case "${DRIVE}" in + debconf) + DRIVE="host" + ;; + esac + fi + + echo "DRIVE=\"${DRIVE}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export DRIVE +} + +Netdev () +{ + db_get container/netdev + NETDEV="${RET}" # string (w/ empty) + + echo "NETDEV=\"${NETDEV}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export NETDEV +} + +Qemu_raw () +{ + db_get container/qemu-raw + QEMU_RAW="${RET}" # select + + if [ -z "${QEMU_RAW}" ] + then + QEMU_RAW="${RET}" # string (w/o empty) + + case "${QEMU_RAW}" in + debconf) + QEMU_RAW="host" + ;; + esac + fi + + echo "QEMU_RAW=\"${QEMU_RAW}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export QEMU_RAW +} + +Boot_method () +{ + db_get container/boot-method + BOOT_METHOD="${RET}" # select + + if [ -z "${BOOT_METHOD}" ] + then + BOOT_METHOD="${RET}" # string (w/o empty) + + case "${BOOT_METHOD}" in + debconf) + BOOT_METHOD="systemd-nspawn" + ;; + esac + fi + + echo "BOOT_METHOD=\"${BOOT_METHOD}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + export BOOT_METHOD +} + Mode Images @@ -1368,4 +1557,24 @@ Root_password Internal_options +Cpu + +Memory + +Display + +Serial + +Monitor + +Firmware + +Drive + +Netdev + +Qemu_raw + +Boot_method + db_stop diff --git a/share/build-scripts/debconf.d/0003-debconf.templates b/share/build-scripts/debconf.d/0003-debconf.templates index 551033a..5d83df3 100644 --- a/share/build-scripts/debconf.d/0003-debconf.templates +++ b/share/build-scripts/debconf.d/0003-debconf.templates @@ -274,3 +274,85 @@ Description: Nameserver Resolver Options? See resolv.conf(5) for more information about the 'options' option. . This defaults to empty. + +Template: container/cpu +Type: string +Default: +Description: Cpu + VM CPU should be emulated. + . + Use 'host' for kvm. + . + This defaults to empty. + +Template: container/memory +Type: string +Default: +Description: Memory + Memory options for the VM. + . + This defaults to empty. + +Template: container/display +Type: string +Default: +Description: Display + Display options for the VM. + . + This defaults to empty. + +Template: container/serial +Type: string +Default: +Description: Serial + Serial options for the VM. + . + This defaults to empty. + +Template: container/monitor +Type: string +Default: +Description: Monitor + Monitor options for the VM. + . + This defaults to empty. + +Template: container/firmware +Type: string +Default: +Description: Firmware + Firmware options for the VM. + . + This defaults to empty. + +Template: container/drive +Type: string +Default: +Description: Drive + Drive options for the VM. + . + This defaults to empty. + +Template: container/netdev +Type: string +Default: +Description: Netdev + Netdev options for the VM. + . + This defaults to empty. + +Template: container/qemu-raw +Type: string +Default: +Description: Qemu-raw + Raw options for the VM. + . + This defaults to empty. + +Template: container/boot-method +Type: string +Default: +Description: Boot-method + Either 'efi' or 'legacy'. + . + This defaults to empty. |