hostprep: make xen actually work master
Michael D Labriola [Sat, 22 Jun 2019 06:26:24 +0000 (20:26 -1000)]
utils/bootstrap-early/go
utils/ruckus-builder.env.in

index 8019a8a..d49631b 100755 (executable)
@@ -264,13 +264,14 @@ build()
                 INITD_DIR=$PREFIX_HOSTPREP/etc/rc.d/init.d \
                 SYSCONFIG_DIR=$PREFIX_HOSTPREP/etc/sysconfig \
                 XEN_CONFIG_DIR=$PREFIX_HOSTPREP/etc/xen \
-                XEN_SCRIPT_DIR=$PREFIX_HOSTPREP/etc/xen \
+                XEN_SCRIPT_DIR=$PREFIX_HOSTPREP/etc/xen/scripts \
                 XEN_DUMP_DIR=$PREFIX_HOSTPREP/var/lib/xen/dump \
                 XEN_LOG_DIR=$PREFIX_HOSTPREP/var/log/xen \
                 XEN_RUN_DIR=$PREFIX_HOSTPREP/var/run/xen \
                 XEN_RUN_STORED=$PREFIX_HOSTPREP/var/run/xenstored \
                 XEN_LIB_DIR=$PREFIX_HOSTPREP/var/lib/xen \
                 XEN_LIB_STORED=$PREFIX_HOSTPREP/var/lib/xenstored \
+                XEN_LOCK_DIR=$PREFIX_HOSTPREP/var/lock \
                 BASH_COMPLETION_DIR=$PREFIX_HOSTPREP/etc/bash_completion.d \
                 XEN_PAGING_DIR=$PREFIX_HOSTPREP/var/lib/xen/xenpaging \
                -j$JOBCOUNT dist &&
@@ -281,17 +282,24 @@ build()
                 INITD_DIR=$PREFIX_HOSTPREP/etc/rc.d/init.d \
                 SYSCONFIG_DIR=$PREFIX_HOSTPREP/etc/sysconfig \
                 XEN_CONFIG_DIR=$PREFIX_HOSTPREP/etc/xen \
-                XEN_SCRIPT_DIR=$PREFIX_HOSTPREP/etc/xen \
+                XEN_SCRIPT_DIR=$PREFIX_HOSTPREP/etc/xen/scripts \
                 XEN_DUMP_DIR=$PREFIX_HOSTPREP/var/lib/xen/dump \
                 XEN_LOG_DIR=$PREFIX_HOSTPREP/var/log/xen \
                 XEN_RUN_DIR=$PREFIX_HOSTPREP/var/run/xen \
                 XEN_RUN_STORED=$PREFIX_HOSTPREP/var/run/xenstored \
                 XEN_LIB_DIR=$PREFIX_HOSTPREP/var/lib/xen \
                 XEN_LIB_STORED=$PREFIX_HOSTPREP/var/lib/xenstored \
+                XEN_LOCK_DIR=$PREFIX_HOSTPREP/var/lock \
                 BASH_COMPLETION_DIR=$PREFIX_HOSTPREP/etc/bash_completion.d \
                 XEN_PAGING_DIR=$PREFIX_HOSTPREP/var/lib/xen/xenpaging \
                 install &&
            popd || exit 1
+            # FIXME: looks like 4.11 doesn't consistently use SCRIPT_DIR,
+            #        VAR_DIR... basically all /etc/xen and /var stuff installed
+            #        in HOSTPREP/etc/xen and HOSTPREP/etc/rc.d/init.d
+            #
+            find $PREFIX_HOSTPREP/etc/{xen,rc.d/init.d}/* -type f -exec sed -i "s|/etc/xen|$PREFIX_HOSTPREP/etc/xen|g" {} \;
+            find $PREFIX_HOSTPREP/etc/{xen,rc.d/init.d}/* -type f -exec sed -i "s|/var|$PREFIX_HOSTPREP/var|g" {} \;
            ;;
         flex)
             # NOTE: flex cannot be built out-of-tree because the rule for
index 843cc67..0c1036e 100644 (file)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+if [ -n "$BASH" ]; then
+    shopt nullglob
+elif [ -n "$ZSH_NAME" ]; then
+    setopt nullglob
+fi
+
 PREFIX_HOSTPREP=@PREFIX_HOSTPREP@
 export PATH=$PREFIX_HOSTPREP/bin:$PREFIX_HOSTPREP/sbin:$PATH
 export MANPATH=$PREFIX_HOSTPREP/man:$PREFIX_HOSTPREP/share/man:$MANPATH
@@ -43,7 +49,6 @@ echo ""
 #    echo ""
 #fi
 
-if (ls $PREFIX_HOSTPREP/etc/xen/ruckus-builder*.cfg >/dev/null 2>&1); then
     echo "Sart the ruckus-builder virtual machine(s) like this:"
     echo ""
     for x in $PREFIX_HOSTPREP/etc/xen/ruckus-builder*.cfg; do
@@ -60,4 +65,3 @@ if (ls $PREFIX_HOSTPREP/etc/xen/ruckus-builder*.cfg >/dev/null 2>&1); then
     echo ""
     echo "To exit the virtual machine, either issue a 'poweroff' command or"
     echo "press Ctrl-] to break out of the console, then 'xl shutdown NAME'"
-fi