aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/ci/gcp_freebsd_repartition.sh26
-rwxr-xr-xsrc/tools/ci/gcp_ram_disk.sh22
2 files changed, 22 insertions, 26 deletions
diff --git a/src/tools/ci/gcp_freebsd_repartition.sh b/src/tools/ci/gcp_freebsd_repartition.sh
deleted file mode 100755
index 3adb8fb88ec..00000000000
--- a/src/tools/ci/gcp_freebsd_repartition.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-set -e
-set -x
-
-# fix backup partition table after resize
-gpart recover da0
-gpart show da0
-
-# delete and re-add swap partition with expanded size
-swapoff -a
-gpart delete -i 3 da0
-gpart add -t freebsd-swap -l swapfs -a 4096 da0
-gpart show da0
-swapon -a
-
-# create a file system on a memory disk backed by swap, to minimize I/O
-mdconfig -a -t swap -s20g -u md1
-newfs -b 8192 -U /dev/md1
-
-# migrate working directory
-du -hs $CIRRUS_WORKING_DIR
-mv $CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR.orig
-mkdir $CIRRUS_WORKING_DIR
-mount -o noatime /dev/md1 $CIRRUS_WORKING_DIR
-cp -a $CIRRUS_WORKING_DIR.orig/ $CIRRUS_WORKING_DIR/
diff --git a/src/tools/ci/gcp_ram_disk.sh b/src/tools/ci/gcp_ram_disk.sh
new file mode 100755
index 00000000000..d48634512ac
--- /dev/null
+++ b/src/tools/ci/gcp_ram_disk.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Move working directory into a RAM disk for better performance.
+
+set -e
+set -x
+
+mv $CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR.orig
+mkdir $CIRRUS_WORKING_DIR
+
+case "`uname`" in
+ FreeBSD|NetBSD)
+ mount -t tmpfs tmpfs $CIRRUS_WORKING_DIR
+ ;;
+ OpenBSD)
+ umount /dev/sd0j # unused /usr/obj partition
+ printf "m j\n\n\nswap\nw\nq\n" | disklabel -E sd0
+ swapon /dev/sd0j
+ mount -t mfs -o rw,noatime,nodev,-s=8000000 swap $CIRRUS_WORKING_DIR
+ ;;
+esac
+
+cp -a $CIRRUS_WORKING_DIR.orig/. $CIRRUS_WORKING_DIR/