2 # $NetBSD: build_image.sh,v 1.1.1.1 2002/09/10 13:58:51 leo Exp $
3 # This script is a quick hack to generate the various floppies in the
4 # 'installation/floppies' directory. This script cannot be run in the
5 # build environment, it is provided as a howto.
6 # When msdos support is added to makefs, it makes sense to provide a
7 # decent script that can be integrated into the build environment.
11 DESTDIR
=/tmp
/flop_images
12 TOOLDIR
=/tmp
/flop_tools
13 KERNEL_DIR
=/tmp
/kernels
19 IMAGE144
="hades_boot HADES milan_isa_boot MILAN-ISAIDE"
20 IMAGE144
="$IMAGE144 milan_pci_boot MILAN-PCIIDE"
21 TOOLS
="chg_pid.ttp file2swp.ttp loadbsd.ttp rawwrite.ttp aptck.ttp"
24 if [ ! -d $TOOLDIR ]; then
29 cat ${i}.gz.uu |
(cd $TOOLDIR; uudecode)
30 gunzip
-f $TOOLDIR/${i}.gz
35 base_img
=$1; geom
=$2; shift 2
41 cat ${base_img}.fs.gz.uu |
(cd /tmp
; uudecode)
42 gunzip
/tmp
/${base_img}.fs.gz
43 $SUDO vnconfig
$VND_DEV /tmp
/${base_img}.fs
$geom
44 $SUDO mount
-t msdos
/dev
/${VND_DEV}c
${MNT_DIR}
46 # Copy the kernel first...
47 cp ${KERNEL_DIR}/netbsd-${2}.gz ${MNT_DIR}/netbsd
49 # Thereafter the tools, some may not fit :-(
51 cp $TOOLDIR/$i ${MNT_DIR} 2> /dev
/null
53 echo "$i does not fit on ${1}.fs"
57 echo "Contents of ${1}.fs:\n"; ls -l ${MNT_DIR}
59 $SUDO umount
${MNT_DIR}
60 $SUDO vnconfig
-u ${VND_DEV}
61 mv /tmp
/${base_img}.fs
/tmp
/$1.fs
63 mv /tmp
/$1.fs.gz
$DESTDIR
69 if [ ! -d $DESTDIR ]; then
73 if [ ! -d $KERNEL_DIR ]; then
74 echo "Please put the kernel images in $KERNEL_DIR!!"
77 rm -f $TOOLDIR/* $DESTDIR/*
80 do_images boot720
"512/18/1/80" ${IMAGE720}
81 do_images boot144
"512/18/2/80" ${IMAGE144}
83 echo "The images can be found in: $DESTDIR"