xref: /minix/releasetools/pkgsrc_cdimage.sh (revision 35b65c5a)
1#!/usr/bin/env bash
2set -e
3
4#
5# This script creates a bootable image and should at some point in the future
6# be replaced by the proper NetBSD infrastructure.
7#
8
9: ${ARCH=i386}
10: ${OBJ=../obj.${ARCH}}
11: ${TOOLCHAIN_TRIPLET=i586-elf32-minix-}
12: ${BUILDSH=build.sh}
13
14: ${IMG=minix_pkgsrc.iso}
15: ${SETS=}
16: ${CREATE_IMAGE_ONLY=1}
17
18if [ ! -f ${BUILDSH} ]
19then
20	echo "Please invoke me from the root source dir, where ${BUILDSH} is."
21	exit 1
22fi
23
24# set up disk creation environment
25. releasetools/image.defaults
26. releasetools/image.functions
27
28echo "Building work directory..."
29build_workdir "$SETS"
30
31echo "Bundling packages..."
32bundle_packages "$BUNDLE_PACKAGES"
33
34echo "Creating specification files..."
35cat > ${WORK_DIR}/extra.base <<EOF
36. type=dir uid=0 gid=0 mode=0755
37./usr type=dir uid=0 gid=0 mode=0755
38EOF
39create_input_spec
40create_protos
41
42# Clean image
43if [ -f ${IMG} ]	# IMG might be a block device
44then
45	rm -f ${IMG}
46fi
47
48echo "Writing ISO..."
49${CROSS_TOOLS}/nbmakefs -t cd9660 -F ${WORK_DIR}/input -o "rockridge,label=MINIX_PKGSRC" ${IMG} ${ROOT_DIR}
50
51echo ""
52echo "ISO image at `pwd`/${IMG}"
53