summaryrefslogtreecommitdiff
path: root/releasetools/pkgsrc_cdimage.sh
blob: 2ebbae30593eecd7cc5f266db2c4fe07cc3b5189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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}"