#!/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. # # Supported command line switches: # -i build iso image instead of qemu imaeg # -b bitcode build, increase partition sizes as necessary # : ${ARCH=i386} : ${OBJ=../obj.${ARCH}} : ${TOOLCHAIN_TRIPLET=i586-elf32-minix-} : ${BUILDSH=build.sh} : ${SETS="minix-base minix-comp minix-games minix-man minix-tests tests"} : ${IMG=minix_x86.img} if [ ! -f ${BUILDSH} ] then echo "Please invoke me from the root source dir, where ${BUILDSH} is." exit 1 fi # we create a disk image of about 2 gig's # for alignment reasons, prefer sizes which are multiples of 4096 bytes : ${BOOTXX_SECS=32} : ${ROOT_SIZE=$(( 128*(2**20) - ${BOOTXX_SECS} * 512 ))} : ${HOME_SIZE=$(( 128*(2**20) ))} : ${USR_SIZE=$(( 1792*(2**20) ))} # set up disk creation environment . releasetools/image.defaults . releasetools/image.functions # all sizes are written in 512 byte blocks ROOTSIZEARG="-b $((${ROOT_SIZE} / 512 / 8))" USRSIZEARG="-b $((${USR_SIZE} / 512 / 8))" HOMESIZEARG="-b $((${HOME_SIZE} / 512 / 8))" # where the kernel & boot modules will be MODDIR=${DESTDIR}/boot/minix/.temp echo "Building work directory..." build_workdir "$SETS" echo "Adding extra files..." # create a fstab entry in /etc cat >${ROOT_DIR}/etc/fstab <${ROOT_DIR}/boot.cfg <