From: Antti Kantee Date: Tue, 9 Feb 2016 13:24:37 +0000 (+0000) Subject: rumprun-bake: move to a block-based config format X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5db02337a1a351707b7dcc52306ce4a99df126b0;p=osstest%2Frumprun.git rumprun-bake: move to a block-based config format --- diff --git a/app-tools/rumprun-bake.conf b/app-tools/rumprun-bake.conf index ed4149a..733a4c8 100644 --- a/app-tools/rumprun-bake.conf +++ b/app-tools/rumprun-bake.conf @@ -2,14 +2,14 @@ # rumpbake default configuration file # -version 20150930 +version 20160209 # # First, define internal convenience sets. # -create _foundation "basic components for the Rumprun unikernel" - add _foundation \ - -lrumpvfs \ +conf _foundation + create "basic components for the Rumprun unikernel" + add -lrumpvfs \ -lrumpkern_bmktc \ -lrumpkern_mman \ -lrumpdev \ @@ -20,112 +20,126 @@ create _foundation "basic components for the Rumprun unikernel" -lrumpdev_vnd \ -lrumpdev_rnd \ -lrumprunfs_base +fnoc -create _virtio "virtio drivers" - add _virtio \ - -lrumpdev_virtio_if_vioif \ +conf _virtio + create "virtio drivers" + add -lrumpdev_virtio_if_vioif \ -lrumpdev_virtio_ld \ -lrumpdev_virtio_viornd \ -lrumpdev_pci_virtio \ -lrumpdev_pci +fnoc -create _audio "audio subsystem and some PCI audio device drivers" - add _audio \ - -lrumpdev_audio \ +conf _audio + create "audio subsystem and some PCI audio device drivers" + add -lrumpdev_audio \ -lrumpdev_audio_ac97 \ -lrumpdev_pci_auich \ -lrumpdev_pci_eap \ -lrumpdev_pci_hdaudio \ -lrumpdev_hdaudio_hdafg +fnoc -create _netinet "TCP/IP (v4)" - add _netinet \ - -lrumpnet_netinet \ +conf _netinet + create "TCP/IP (v4)" + add -lrumpnet_netinet \ -lrumpnet_net \ -lrumpnet +fnoc -create _netinet6 "TCP/IP (v6)" - add _netinet6 \ - -lrumpnet_netinet6 \ +conf _netinet6 + create "TCP/IP (v6)" + add -lrumpnet_netinet6 \ -lrumpnet_net \ -lrumpnet +fnoc -create _netunix "local domain sockets" - add _netunix \ - -lrumpnet_local \ +conf _netunix + create "local domain sockets" + add -lrumpnet_local \ -lrumpnet +fnoc -create _stdfs "selection of file system drivers" - add _stdfs \ - -lrumpfs_ffs \ +conf _stdfs + create "selection of file system drivers" + add -lrumpfs_ffs \ -lrumpfs_cd9660 \ -lrumpfs_ext2fs \ -lrumpdev_disk \ - -lrumpvfs + -lrumpvfs +fnoc -create _pciether "PCI Ethernet NIC drivers" - add _pciether \ - -lrumpdev_pci_if_wm \ +conf _pciether + create "PCI Ethernet NIC drivers" + add -lrumpdev_pci_if_wm \ -lrumpdev_miiphy \ -lrumpdev_pci +fnoc -create _usb "USB stack incl. PCI USB host controllers" - add _usb \ - -lrumpdev_pci_usbhc \ +conf _usb + create "USB stack incl. PCI USB host controllers" + add -lrumpdev_pci_usbhc \ -lrumpdev_usb \ -lrumpdev_umass \ -lrumpdev_scsipi \ -lrumpdev_pci +fnoc # this is a config so that it can be assimilated -create _sysproxy "system call proxy support" - add _sysproxy \ - -lrumpkern_sysproxy - -create _miconf "general useful MI/pseudo driver set" - assimilate _miconf \ - _foundation \ - _netinet \ - _netinet6 \ - _netunix \ - _stdfs \ - _sysproxy +conf _sysproxy + create "system call proxy support" + add -lrumpkern_sysproxy +fnoc + +conf _miconf + create "general useful MI/pseudo driver set" + assimilate _foundation \ + _netinet \ + _netinet6 \ + _netunix \ + _stdfs \ + _sysproxy +fnoc # # then, define some end-user configs # -create xen_pv "Xen with paravirtualized I/O drivers" - assimilate xen_pv \ - _miconf - add xen_pv \ - -lrumpfs_kernfs \ - -lrumpnet_xenif \ - -lrumpxen_xendev - -create xen_pci "Xen with paravirtualized and PCI I/O drivers" - assimilate xen_pci \ - xen_pv \ - _pciether - -create hw_virtio "virtio targets (e.g. QEMU/KVM)" - assimilate hw_virtio \ - _miconf \ - _virtio - -create hw_virtio_scsi "virtio targets with SCSI (e.g. QEMU/KVM)" - assimilate hw_virtio_scsi \ - _miconf \ - _virtio - add hw_virtio_scsi \ - -lrumpdev_virtio_vioscsi\ - -lrumpdev_scsipi - -create hw_generic "generic targets, includes (almost) all drivers" - assimilate hw_generic \ - _miconf \ - _virtio \ - _audio \ - _pciether \ - _usb +conf xen_pv + create "Xen with paravirtualized I/O drivers" + assimilate _miconf + add -lrumpfs_kernfs \ + -lrumpnet_xenif \ + -lrumpxen_xendev +fnoc + +conf xen_pci + create "Xen with paravirtualized and PCI I/O drivers" + assimilate xen_pv \ + _pciether +fnoc + +conf hw_virtio + create "virtio targets (e.g. QEMU/KVM)" + assimilate _miconf \ + _virtio +fnoc + +conf hw_virtio_scsi + create "virtio targets with SCSI (e.g. QEMU/KVM)" + assimilate _miconf \ + _virtio + add -lrumpdev_virtio_vioscsi\ + -lrumpdev_scsipi +fnoc + +conf hw_generic + create "generic targets, includes (almost) all drivers" + assimilate _miconf \ + _virtio \ + _audio \ + _pciether \ + _usb +fnoc diff --git a/app-tools/rumprun-bake.in b/app-tools/rumprun-bake.in index 47a1ea4..30bd5b2 100644 --- a/app-tools/rumprun-bake.in +++ b/app-tools/rumprun-bake.in @@ -25,13 +25,15 @@ # SUCH DAMAGE. # -_RUMPBAKE_VERSION=20150930 +_RUMPBAKE_VERSION=20160209 # # rumprun-bake: script for final stage linking ("baking") of a unikernel image # unset runcmd +unset CONF +unset CFGFILE if [ "$(basename $0)" = "rumpbake" ]; then echo '>>' @@ -81,7 +83,7 @@ _haveconf () for x in ${ALLCONFIGS}; do [ "${x}" != "${1}" ] || return done - _die "config ${1} not found (${CURCONF})" + _die "config \"${1}\" not found (${CFGFILE})" } _nothaveconf () @@ -89,7 +91,7 @@ _nothaveconf () for x in ${ALLCONFIGS}; do [ "${x}" != "${1}" ] \ - || _die "config ${1} already exists (${CURCONF})" + || _die "config ${1} already exists (${CFGFILE})" done } @@ -119,71 +121,70 @@ version () { [ "${1}" = "${_RUMPBAKE_VERSION}" ] \ - || _die ${CURCONF} mismatch: expect ${_RUMPBAKE_VERSION}, got \"$1\" + || _die ${CFGFILE} mismatch: expect ${_RUMPBAKE_VERSION}, got \"$1\" _VERSOK=true } -create () +conf () { - local confname descr - - confname=$1 - shift || _die "create: not enough arguments (${CURCONF})" - [ -n "$*" ] || _die "create: need description (${CURCONF})" - if ! echo ${confname} | egrep -q '^(xen|hw)?_'; then - _die "create: invalid conf \"$confname\" (${CURCONF})" + if ! echo ${1} | egrep -q '^(xen|hw)?_'; then + _die "conf: invalid \"$1\" (${CFGFILE})" fi + CONF=$1 +} + +fnoc () +{ + + unset CONF +} - _nothaveconf ${confname} +create () +{ + + [ -n "$*" ] || _die "create: need description (${CFGFILE})" + + _nothaveconf ${CONF} - ALLCONFIGS="${ALLCONFIGS} ${confname}" - eval CONFDESCR_${confname}=\"${*}\" + ALLCONFIGS="${ALLCONFIGS} ${CONF}" + eval CONFDESCR_${CONF}=\"${*}\" } assimilate () { - local to from + local from - to=$1 - shift || _die not enough arguments to assimilate - _haveconf ${to} + _haveconf ${CONF} for from; do _haveconf ${from} - eval CONFIG_${to}=\"\${CONFIG_${to}} \${CONFIG_${from}}\" + eval CONFIG_${CONF}=\"\${CONFIG_${CONF}} \${CONFIG_${from}}\" done } nuke () { - [ $# -eq 1 ] || _die "nuke: wrong number of args (${CURCONF})" - _haveconf ${1} - _filter ${1} ALLCONFIGS + [ $# -eq 0 ] || _die "nuke: wrong number of args (${CFGFILE})" + _haveconf ${CONF} + _filter ${CONF} ALLCONFIGS } add () { - local confname - confname=$1 - shift || _die "not enough args to add (${CURCONF})" - - _haveconf ${confname} - eval CONFIG_${confname}=\"\${CONFIG_${confname}} $@\" + _haveconf ${CONF} + eval CONFIG_${CONF}=\"\${CONFIG_${CONF}} $@\" } remove () { - local confname compvar - - confname=$1 - shift || _die "not enough args to remove (${CURCONF})" + local compvar - _haveconf ${confname} + _haveconf ${CONF} - compvar=CONFIG_${confname} + compvar=CONFIG_${CONF} for x; do _filter ${x} ${compvar} done @@ -192,15 +193,11 @@ remove () # debug routine debugdump () { - local confname - - confname=$1 - shift || _die "not enough args to debugdump (${CURCONF})" - _haveconf ${confname} + _haveconf ${CONF} - _uniq CONFIG_${confname} - eval echo \${CONFIG_${confname}} + _uniq CONFIG_${CONF} + eval echo \${CONFIG_${CONF}} } _usage () @@ -236,27 +233,27 @@ _readconfig () { local x - CURCONF="$1" - if [ ! -f "${CURCONF}" ]; then - echo "rumprun-bake: error: Configuration file ${CURCONF} not found" + CFGFILE="$1" + if [ ! -f "${CFGFILE}" ]; then + echo "rumprun-bake: error: Configuration file ${CFGFILE} not found" exit 1 fi _VERSOK=false # ". foo" doesn't work everywhere/always, so do a dance here. - # Note: CURCONF needs to remain as what the user gave. + # Note: CFGFILE needs to remain as what the user gave. case "$1" in /*) - . "${CURCONF}" + . "${CFGFILE}" ;; *) - . "$(pwd)/${CURCONF}" + . "$(pwd)/${CFGFILE}" ;; esac - ${_VERSOK} || _die "config version not specified (${CURCONF})" + ${_VERSOK} || _die "config version not specified (${CFGFILE})" - unset CURCONF + unset CFGFILE # Publish configs which are not private for x in ${ALLCONFIGS}; do @@ -326,7 +323,8 @@ list) ;; describe) [ $# -eq 2 ] || _die \"describe\" needs exactly one config. - debugdump $2 + CONF=$2 + debugdump exit 0 ;; esac