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: ${SETS="minix-base"} 15 16if [ ! -f ${BUILDSH} ] 17then 18 echo "Please invoke me from the root source dir, where ${BUILDSH} is." 19 exit 1 20fi 21 22#: ${RAMDISK_SIZE=$(( 200*(2**20) ))} 23 24# set up disk creation environment 25. releasetools/image.defaults 26. releasetools/image.functions 27 28# where the kernel & boot modules will be 29MODDIR=${DESTDIR}/boot/minix/.temp 30 31echo "Building work directory..." 32build_workdir "$SETS" 33 34echo "Adding extra files..." 35workdir_add_ramdisk_files 36 37# set correct message of the day (log in and install tip) 38cp releasetools/release/ramdisk/etc/issue ${ROOT_DIR}/etc/issue 39add_file_spec "etc/issue" extra.cdfiles 40 41echo "Bundling packages..." 42bundle_packages "$BUNDLE_PACKAGES" 43 44echo "Creating specification files..." 45create_input_spec 46create_protos 47 48echo "Writing ramdisk image..." 49# add the other modules for boot 50cp ${MODDIR}/* ${WORK_DIR} 51create_ramdisk_image ${RAMDISK_SIZE} 52 53echo "" 54echo "RAM image modules at ${WORK_DIR}" 55echo "" 56echo "To boot this image on kvm:" 57echo "cd ${WORK_DIR} && qemu-system-i386 --enable-kvm -m 1G -kernel kernel -append \"bootramdisk=1\" -initrd \"${mods}\"" 58