]> Zhao Yanbai Git Server - minix.git/commitdiff
Add releasetools/pkgsrc_cdimage.sh 96/3496/2
authorJean-Baptiste Boric <jblbeurope@gmail.com>
Tue, 11 Apr 2017 16:19:55 +0000 (18:19 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Sat, 6 May 2017 22:54:46 +0000 (00:54 +0200)
This script uses the image generation framework to create a pkgsrc CD
image, useful for MINIX installations without Internet connectivity.

Change-Id: Ife037f6b6958e38986afad0632f37999ecbb2b55

releasetools/pkgsrc_cdimage.sh [new file with mode: 0755]

diff --git a/releasetools/pkgsrc_cdimage.sh b/releasetools/pkgsrc_cdimage.sh
new file mode 100755 (executable)
index 0000000..2ebbae3
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+set -e
+
+#
+# This script creates a bootable image and should at some point in the future
+# be replaced by the proper NetBSD infrastructure.
+#
+
+: ${ARCH=i386}
+: ${OBJ=../obj.${ARCH}}
+: ${TOOLCHAIN_TRIPLET=i586-elf32-minix-}
+: ${BUILDSH=build.sh}
+
+: ${IMG=minix_pkgsrc.iso}
+: ${SETS=}
+: ${CREATE_IMAGE_ONLY=1}
+
+if [ ! -f ${BUILDSH} ]
+then
+       echo "Please invoke me from the root source dir, where ${BUILDSH} is."
+       exit 1
+fi
+
+# set up disk creation environment
+. releasetools/image.defaults
+. releasetools/image.functions
+
+echo "Building work directory..."
+build_workdir "$SETS"
+
+echo "Bundling packages..."
+bundle_packages "$BUNDLE_PACKAGES"
+
+echo "Creating specification files..."
+cat > ${WORK_DIR}/extra.base <<EOF
+. type=dir uid=0 gid=0 mode=0755
+./usr type=dir uid=0 gid=0 mode=0755
+EOF
+create_input_spec
+create_protos
+
+# Clean image
+if [ -f ${IMG} ]       # IMG might be a block device
+then
+       rm -f ${IMG}
+fi
+
+echo "Writing ISO..."
+${CROSS_TOOLS}/nbmakefs -t cd9660 -F ${WORK_DIR}/input -o "rockridge,label=MINIX_PKGSRC" ${IMG} ${ROOT_DIR}
+
+echo ""
+echo "ISO image at `pwd`/${IMG}"