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=Regular MINIX 3 (with AHCI):multiboot /kernel bootcd=1 cdproberoot=1 rootdevname=ram disable=inet ahci=yes
65 menu=Edit menu option:edit
66 menu=Drop to boot prompt:prompt
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!
98 # This space intentionally left blank - leave to appease bootloader!
99 # This space intentionally left blank - leave to appease bootloader!
106 $RELEASEDIR/usr/sbin/installboot_nbsd $TMPDISKROOT \
107 $RELEASEDIR/usr/mdec/bootxx_minixfs3
109 cat >$RELEASEMNTDIR/boot.cfg <<END_BOOT_CFG
110 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
111 menu=Edit menu option:edit
112 menu=Drop to boot prompt:prompt
121 $RELEASEDIR/usr/sbin/installboot_nbsd $TMPDISKROOT \
122 $RELEASEDIR/usr/mdec/bootxx_minixfs3
124 cat >$RELEASEMNTDIR/boot.cfg <<END_BOOT_CFG
125 menu=Regular MINIX 3:load_mods /boot/minix_default/mod*;multiboot /boot/minix_default/kernel bios_wini=yes bios_remap_first=1 rootdevname=c0d7p0s0
126 menu=Edit menu option:edit
127 menu=Drop to boot prompt:prompt
134 copy_local_packages()
136 if [ -d $PACKAGEDIR -a -f $PACKAGELIST -a $PACKAGES -ne 0 ]
139 indexpath=$PACKAGEDIR/.index
141 if [ ! -d $indexpath ]
142 then mkdir $indexpath
144 if [ ! -d $indexpath ]
145 then echo "Couldn't create $indexpath."
149 echo "" >$PACKAGEDIR/All/$index
151 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
152 for pkgprefix in `cat $PACKAGELIST`
153 do realfn="`echo $PACKAGEDIR/All/${pkgprefix}*.tgz`"
156 # Copy package and create package's index
158 p="`basename $realfn`"
160 cp $p $RELEASEPACKAGE/
162 indexname=$indexpath/$p.$index
163 pkg_info -X $p >$indexname
165 if [ ! -f $indexname ]
166 then echo Missing $indexname.
170 if [ "`wc -l $indexname`" -lt 3 ]
171 then $indexname is too short.
176 cat $indexname >>$PACKAGEDIR/All/$index
179 echo "Can't find $pkgprefix Missing."
183 bzip2 -f $PACKAGEDIR/All/$index
184 cp $PACKAGEDIR/All/$index.bz2 $RELEASEPACKAGE/
196 # Determine number of inodes
197 inodes=`find $path | egrep -v ^$path/usr | wc -l`
198 inodes="`expr $inodes + $extra_inodes`"
200 # Determine number of data zones
201 zonekbs=`du -ks $path | cut -d' ' -f1`
203 [ ! -d $path/usr ] || zonekbsignore=`du -ks $path/usr | cut -d" " -f1`
204 zones="`expr \( $zonekbs - $zonekbsignore \) / \( $BS / 1024 \) + $extra_zones`"
206 # Determine file system size
207 BSBITS="`expr $BS \* 8`"
208 imap_blocks="`expr \( $inodes + $BSBITS - 1 \) / $BSBITS`"
209 inode_blocks="`expr \( $inodes \* 64 + $BS - 1 \) / $BS`"
210 zmap_blocks="`expr \( $zones + $BSBITS - 1 \) / $BSBITS`"
211 blocks="`expr 1 + 1 + $imap_blocks + $zmap_blocks + $inode_blocks + $zones`"
212 kbs="`expr $blocks \* \( $BS / 1024 \)`"
214 # Apply default if higher
215 if [ -n "$mbsdefault" ]
217 kbsdefault="`expr $mbsdefault \* 1024`"
218 if [ "$kbs" -lt "$kbsdefault" ]
220 else echo "warning: ${mbsdefault}mb is too small, using ${kbs}kb"
224 # Create a filesystem on the target ramdisk
225 ramdisk $kbs $ramdisk
226 mkfs.mfs -B $BS -i $inodes $ramdisk