aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-07-25 00:08:42 -0400
committerTheodore Ts'o <tytso@mit.edu>2023-07-25 00:08:42 -0400
commit0c3db8f1a626fcfad2d0ece363a4f23283e35f6b (patch)
tree67c2bcd3fa9eb678409c48d33bf523a44206e01c
parent8aaca0f156b881bc9d978c55bee548f0de7a34a1 (diff)
downloadxfstests-bld-0c3db8f1a626fcfad2d0ece363a4f23283e35f6b.tar.gz
New release scripts used to create files ready to be uploaded to kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--release/.gitignore1
-rw-r--r--release/README.in29
-rw-r--r--release/README.md20
-rwxr-xr-xrelease/gen-README58
-rwxr-xr-xrelease/snapshot-release87
-rwxr-xr-xrelease/upload-to-korg102
6 files changed, 297 insertions, 0 deletions
diff --git a/release/.gitignore b/release/.gitignore
new file mode 100644
index 00000000..4e879984
--- /dev/null
+++ b/release/.gitignore
@@ -0,0 +1 @@
+/out_dir
diff --git a/release/README.in b/release/README.in
new file mode 100644
index 00000000..f3b57e6a
--- /dev/null
+++ b/release/README.in
@@ -0,0 +1,29 @@
+These KVM test appliance images are designed to be used with the
+kvm-xfstests system which can be found here:
+
+ git://git.kernel.org/pub/scm/fs/ext2/xfstests-bld.git
+
+If you are testing a 32-bit x86 kernel you must use the
+root_fs.img.i386. If you are using a 64-bit x86 kernel, you may use
+either the i386 or x86_64 root_fs.img file.
+
+Information on how to use these images can be found at the Quick Start
+guide, located at:
+
+ https://github.com/tytso/xfstests-bld/blob/master/Documentation/kvm-quickstart.md
+
+The "corresponding source" of the GPL binaries found in these KVM
+images can be found in the source packages from this snapshot of
+Debian distribution's "@DISTRO@" release:
+
+ @MIRROR@
+
+... as well as the following git repositories:
+
+@VERFILE@
+
+The gen-image script found in the test-appliance directory of the
+xfstests-bld git repository, plus Debian @DISTRO@'s debootstrap,
+constitutes the scripts used to control the creation of these KVM
+images.
+
diff --git a/release/README.md b/release/README.md
new file mode 100644
index 00000000..a0146ce3
--- /dev/null
+++ b/release/README.md
@@ -0,0 +1,20 @@
+# Release automation scripts for xfstests-bld
+
+This directory contains the helper scripts used by the maintainer to
+do kvm-xfstests release. The procedure for doing a release is:
+
+1. From the top-level directory run: `./selftests/appliance`. (This
+ assumes that you have already run `./selftests/build-kernel` as
+ described in the README.md file in the selftests directory.)
+ Running ./selftests/appliance will build the test appliance for
+ the arm64, i386, and amd64 platforms, and run basic validation tests.
+
+2. Then run `./release/snapshot-release` to copy the built artifacts
+ into ./release/out_dir. This script will warn if there are any
+ missing files, or if the git-versions file is older than the other
+ built-artifacts; this is a sign that running
+ `./selftests/appliance` may have been skipped. Check the README
+ file in the out_dir file to make sure it looks valid.
+
+3. After verifying that the files in the out_dir directory are
+ correct, then run the script `./release/upload-to-korg`.
diff --git a/release/gen-README b/release/gen-README
new file mode 100755
index 00000000..98a86d9e
--- /dev/null
+++ b/release/gen-README
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+
+d=$(dirname "$0")
+if test $d = "." ; then
+ DIR=$(dirname $(pwd))
+else
+ DIR=$(realpath $(dirname $(dirname "$0")))
+fi
+
+BUILD_DIR="$DIR/fstests-bld"
+REL_DIR="$DIR/release"
+OUT_DIR="$DIR/release/out_dir"
+APPLIANCE_DIR="$DIR/test-appliance"
+
+MIRROR=http://mirrors.kernel.org/debian
+if test -f "$APPLIANCE_DIR/config.custom"
+then
+ . "$APPLIANCE_DIR/config.custom"
+fi
+
+distro=buster
+if test -f "$BUILD_DIR/xfstests/build-distro" ; then
+ distro=$(cat "$BUILD_DIR/xfstests/build-distro")
+fi
+
+xfstests_rel=$(cd $BUILD_DIR/xfstests-dev ; git tag --points-at HEAD | grep ^release)
+blktests_rel=$(cd $BUILD_DIR/blktests ; git tag --points-at HEAD | grep ^release)
+
+mkdir -p "$OUT_DIR"
+
+sed -e "
+s;@MIRROR@;$MIRROR;
+s/@DISTRO@/$distro/
+/@VERFILE@/{r $OUT_DIR/git-versions.amd64
+ d}" \
+ < "$REL_DIR/README.in" > "$OUT_DIR/README"
+
+if test -n "$xfstests_rel"
+then
+ cat >> "$OUT_DIR/README" <<EOF
+Local changes to xfstests can be found at:
+
+ https://github.com/tytso/xfstests $xfstests_rel
+
+EOF
+fi
+
+if test -n "$blktests_rel"
+then
+ cat >> "$OUT_DIR/README" <<EOF
+Local changes to blktests can be found at:
+
+ https://github.com/tytso/blktests $blktests_rel
+
+EOF
+fi
+
diff --git a/release/snapshot-release b/release/snapshot-release
new file mode 100755
index 00000000..3159eeb8
--- /dev/null
+++ b/release/snapshot-release
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+d=$(dirname "$0")
+if test $d = "." ; then
+ DIR=$(dirname $(pwd))
+else
+ DIR=$(realpath $(dirname $(dirname "$0")))
+fi
+
+BUILD_DIR="$DIR/fstests-bld"
+REL_DIR="$DIR/release"
+OUT_DIR="$DIR/release/out_dir"
+APPLIANCE_DIR="$DIR/test-appliance"
+TEST_DIR="$DIR/selftests"
+
+ARCHES="arm64 i386 amd64"
+first_version=
+
+function check_file_exists ()
+{
+ local f="$1"
+
+ if ! test -f "$f"
+ then
+ echo "$f missing!"
+ echo "Aborting!"
+ exit 1
+ fi
+}
+
+function check_file_out_of_date ()
+{
+ local f="$1"
+
+ if test "$f" -nt "$verfile"
+ then
+ echo "$(basename $f) newer than $(basename $verfile)"
+ echo "Aborting!"
+ exit 1
+ fi
+}
+
+mkdir -p "$OUT_DIR"
+
+for i in $ARCHES
+do
+ verfile="$TEST_DIR/git-versions.$i"
+ tarfile="$BUILD_DIR/xfstests-$i.tar.gz"
+ root_img_file="$APPLIANCE_DIR/root_fs.img.$i"
+ root_tar_file="$APPLIANCE_DIR/root_fs.$i.tar.gz"
+
+ check_file_exists "$verfile"
+ check_file_exists "$tarfile"
+ check_file_exists "$root_img_file"
+ check_file_exists "$root_tar_file"
+
+ check_file_out_of_date "$tarfile"
+ check_file_out_of_date "$root_img_file"
+ check_file_out_of_date "$root_tar_file"
+
+ if test -z "$first_version"
+ then
+ first_version="$verfile"
+ else
+ if ! cmp "$first_version" "$verfile"
+ then
+ a="$(basename $first_version)"
+ b="$(basename $f)"
+ echo "$a and $b" are different!
+ exit 1
+ fi
+ fi
+done
+
+
+for i in $ARCHES
+do
+ echo "Copying files for $i"
+ verfile="$TEST_DIR/git-versions.$i"
+ tarfile="$BUILD_DIR/xfstests-$i.tar.gz"
+ root_img_file="$APPLIANCE_DIR/root_fs.img.$i"
+ root_tar_file="$APPLIANCE_DIR/root_fs.$i.tar.gz"
+
+ cp -p "$verfile" "$tarfile" "$root_img_file" "$root_tar_file" $OUT_DIR
+done
+
+$REL_DIR/gen-README
diff --git a/release/upload-to-korg b/release/upload-to-korg
new file mode 100755
index 00000000..800513bc
--- /dev/null
+++ b/release/upload-to-korg
@@ -0,0 +1,102 @@
+#!/bin/bash
+
+d=$(dirname "$0")
+if test $d = "." ; then
+ DIR=$(dirname $(pwd))
+else
+ DIR=$(realpath $(dirname $(dirname "$0")))
+fi
+
+cd "$DIR/release"
+
+DEST=/pub/linux/kernel/people/tytso/kvm-xfstests
+FILES=( README \
+ root_fs.img.amd64 \
+ root_fs.img.i386 \
+ root_fs.img.arm64 \
+ root_fs.amd64.tar.gz \
+ root_fs.i386.tar.gz \
+ root_fs.arm64.tar.gz \
+ xfstests-amd64.tar.gz \
+ xfstests-i386.tar.gz \
+ xfstests-arm64.tar.gz )
+
+function usage()
+{
+ echo "Usage: upload-to-korg: [--testing]"
+ exit 1
+}
+
+while [ "$1" != "" ]; do
+ case $1 in
+ --testing)
+ DEST=/pub/linux/kernel/people/tytso/kvm-xfstests/testing
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+ls -sl out_dir
+printf "\n"
+
+for i in "${FILES[@]}" ; do
+ if test ! -f "out_dir/$i" ; then
+ echo "Missing file $i"
+ echo "Aborting!"
+ exit 1
+ fi
+done
+
+printf "Pausing to verify..."
+sleep 1
+printf "\n"
+
+function sign_file()
+{
+ local fn=out_dir/$1
+ local tar_fn
+
+ rm -f "$fn.sig"
+ if test -f $fn ; then
+ case "$fn" in
+ *.tar.gz)
+ tar_fn=$(basename "$fn")
+ tar_fn=$(echo "$tar_fn" | sed -e 's/.gz//')
+ echo $tar_fn
+ gunzip < $fn > /tmp/$tar_fn
+ rm -f "/tmp/$tar_fn.sig"
+ gpg2 --sign --detach /tmp/$tar_fn
+ mv /tmp/$tar_fn.sig $fn.sig
+ rm -f /tmp/$tar_fn
+ ;;
+ *)
+ gpg2 --sign --detach $fn
+ esac
+ fi
+}
+
+function upload_file()
+{
+ local fn=out_dir/$1
+
+ if test -f $fn ; then
+ kup put $fn $fn.sig $DEST/$i
+ else
+ kup rm $DEST/$i
+ fi
+}
+
+for i in "${FILES[@]}" ; do
+ sign_file $i
+ echo $i
+done
+
+for i in "${FILES[@]}" ; do
+ upload_file $i
+done
+
+exit 0