etc/protocols - sync with NetBSD-8
[minix.git] / releasetools / x86_ramimage.sh
blob6e691900dec7add318e0c131a47f2563a46aacea
1 #!/usr/bin/env bash
2 set -e
5 # This script creates a bootable image and should at some point in the future
6 # be replaced by the proper NetBSD infrastructure.
9 : ${ARCH=i386}
10 : ${OBJ=../obj.${ARCH}}
11 : ${TOOLCHAIN_TRIPLET=i586-elf32-minix-}
12 : ${BUILDSH=build.sh}
14 : ${SETS="minix-base"}
16 if [ ! -f ${BUILDSH} ]
17 then
18 echo "Please invoke me from the root source dir, where ${BUILDSH} is."
19 exit 1
22 #: ${RAMDISK_SIZE=$(( 200*(2**20) ))}
24 # set up disk creation environment
25 . releasetools/image.defaults
26 . releasetools/image.functions
28 # where the kernel & boot modules will be
29 MODDIR=${DESTDIR}/boot/minix/.temp
31 echo "Building work directory..."
32 build_workdir "$SETS"
34 echo "Adding extra files..."
35 workdir_add_ramdisk_files
37 # set correct message of the day (log in and install tip)
38 cp releasetools/release/ramdisk/etc/issue ${ROOT_DIR}/etc/issue
39 add_file_spec "etc/issue" extra.cdfiles
41 echo "Bundling packages..."
42 bundle_packages "$BUNDLE_PACKAGES"
44 echo "Creating specification files..."
45 create_input_spec
46 create_protos
48 echo "Writing ramdisk image..."
49 # add the other modules for boot
50 cp ${MODDIR}/* ${WORK_DIR}
51 create_ramdisk_image ${RAMDISK_SIZE}
53 echo ""
54 echo "RAM image modules at ${WORK_DIR}"
55 echo ""
56 echo "To boot this image on kvm:"
57 echo "cd ${WORK_DIR} && qemu-system-i386 --enable-kvm -m 1G -kernel kernel -append \"bootramdisk=1\" -initrd \"${mods}\""