4 dd if=$TMPDISKUSR of=usrimage bs=$BS count=$USRBLOCKS
6 rootsize=`stat -f %z rootimage`
7 usrsize=`stat -f %z usrimage`
9 rootsects=`expr $rootsize / 512`
10 usrsects=`expr $usrsize / 512`
12 # installboot -m needs at least 1KB
13 dd < /dev/zero >tmpimage count=2
14 partition -fm tmpimage 2 81:$rootsects* 0:0 81:$usrsects
15 installboot_nbsd -m tmpimage /usr/mdec/mbr
16 dd < tmpimage > subpart count=1
18 primsects=`expr 1 + $rootsects + $usrsects`
19 cyl=`expr '(' $primsects ')' / $secs + 1`
20 padsects=`expr $cyl \* $secs - 1 - $primsects`
22 { dd < /dev/zero count=1
26 dd < /dev/zero count=$padsects
28 partition -m hdimage 81:`expr $primsects + $padsects`*
29 installboot_nbsd -m hdimage /usr/mdec/mbr
37 echo "Retrieving packages form $PACKAGEURL"
41 rm -f pkg_summary* || true
42 fetch $PACKAGEURL/$SUMMARY.bz2
44 cat $list | while read name
45 do pkgname="`fgrep PKGNAME=${name} $SUMMARY | sed 's/PKGNAME=//g'`"
46 if [ `echo $pkgname | wc -w` -ne 1 ]
47 then echo " *** Could not resolve $name (not found or too many matches: $pkgname) ***"
48 else echo Getting $pkgname
49 fetch -r ${PACKAGEURL}/${pkgname}.tgz
59 cat >$CDFILES/boot.cfg <<END_BOOT_CFG
60 banner=Welcome to the MINIX 3 installation CD
61 banner================================================================================
63 menu=Regular MINIX 3:multiboot /kernel bootcd=1 cdproberoot=1 rootdevname=ram disable=inet
64 menu=Drop to boot prompt:prompt
80 # This space intentionally left blank - leave to appease bootloader!
81 # This space intentionally left blank - leave to appease bootloader!
82 # This space intentionally left blank - leave to appease bootloader!
83 # This space intentionally left blank - leave to appease bootloader!
84 # This space intentionally left blank - leave to appease bootloader!
85 # This space intentionally left blank - leave to appease bootloader!
86 # This space intentionally left blank - leave to appease bootloader!
87 # This space intentionally left blank - leave to appease bootloader!
88 # This space intentionally left blank - leave to appease bootloader!
89 # This space intentionally left blank - leave to appease bootloader!
90 # This space intentionally left blank - leave to appease bootloader!
91 # This space intentionally left blank - leave to appease bootloader!
92 # This space intentionally left blank - leave to appease bootloader!
93 # This space intentionally left blank - leave to appease bootloader!
94 # This space intentionally left blank - leave to appease bootloader!
95 # This space intentionally left blank - leave to appease bootloader!
96 # This space intentionally left blank - leave to appease bootloader!
97 # This space intentionally left blank - leave to appease bootloader!
104 $RELEASEDIR/usr/sbin/installboot_nbsd $TMPDISKROOT \
105 $RELEASEDIR/usr/mdec/bootxx_minixfs3
107 cat >$RELEASEMNTDIR/boot.cfg <<END_BOOT_CFG
108 menu=Regular MINIX 3:load_mods /boot/minix_default/mod*;multiboot /boot/minix_default/kernel bootcd=2 disable=inet bios_wini=yes bios_remap_first=1 ramimagedev=c0d7p0s0
109 menu=Drop to boot prompt:prompt
118 $RELEASEDIR/usr/sbin/installboot_nbsd $TMPDISKROOT \
119 $RELEASEDIR/usr/mdec/bootxx_minixfs3
121 cat >$RELEASEMNTDIR/boot.cfg <<END_BOOT_CFG
122 menu=Regular MINIX 3:load_mods /boot/minix_default/mod*;multiboot /boot/minix_default/kernel bios_wini=yes bios_remap_first=1 rootdevname=c0d7p0s0
123 menu=Drop to boot prompt:prompt
130 copy_local_packages()
132 if [ -d $PACKAGEDIR -a -f $PACKAGELIST -a $PACKAGES -ne 0 ]
135 indexpath=$PACKAGEDIR/.index
137 if [ ! -d $indexpath ]
138 then mkdir $indexpath
140 if [ ! -d $indexpath ]
141 then echo "Couldn't create $indexpath."
145 echo "" >$PACKAGEDIR/All/$index
147 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
148 for pkgprefix in `cat $PACKAGELIST`
149 do realfn="`echo $PACKAGEDIR/All/${pkgprefix}*.tgz`"
152 # Copy package and create package's index
154 p="`basename $realfn`"
156 cp $p $RELEASEPACKAGE/
158 indexname=$indexpath/$p.$index
159 pkg_info -X $p >$indexname
161 if [ ! -f $indexname ]
162 then echo Missing $indexname.
166 if [ "`wc -l $indexname`" -lt 3 ]
167 then $indexname is too short.
172 cat $indexname >>$PACKAGEDIR/All/$index
175 echo "Can't find $pkgprefix Missing."
179 bzip2 -f $PACKAGEDIR/All/$index
180 cp $PACKAGEDIR/All/$index.bz2 $RELEASEPACKAGE/
192 # Determine number of inodes
193 inodes=`find $path | egrep -v ^$path/usr | wc -l`
194 inodes="`expr $inodes + $extra_inodes`"
196 # Determine number of data zones
197 zonekbs=`du -ks $path | cut -d' ' -f1`
199 [ ! -d $path/usr ] || zonekbsignore=`du -ks $path/usr | cut -d" " -f1`
200 zones="`expr \( $zonekbs - $zonekbsignore \) / \( $BS / 1024 \) + $extra_zones`"
202 # Determine file system size
203 BSBITS="`expr $BS \* 8`"
204 imap_blocks="`expr \( $inodes + $BSBITS - 1 \) / $BSBITS`"
205 inode_blocks="`expr \( $inodes \* 64 + $BS - 1 \) / $BS`"
206 zmap_blocks="`expr \( $zones + $BSBITS - 1 \) / $BSBITS`"
207 blocks="`expr 1 + 1 + $imap_blocks + $zmap_blocks + $inode_blocks + $zones`"
208 kbs="`expr $blocks \* \( $BS / 1024 \)`"
210 # Apply default if higher
211 if [ -n "$mbsdefault" ]
213 kbsdefault="`expr $mbsdefault \* 1024`"
214 if [ "$kbs" -lt "$kbsdefault" ]
216 else echo "warning: ${mbsdefault}mb is too small, using ${kbs}kb"
220 # Create a filesystem on the target ramdisk
221 ramdisk $kbs $ramdisk
222 mkfs.mfs -B $BS -i $inodes $ramdisk