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) ***"
51 else echo Getting $pkgname
52 fetch -r ${PACKAGEURL}/${pkgname}.tgz
62 cat >$CDFILES/boot.cfg <<END_BOOT_CFG
63 banner=Welcome to the MINIX 3 installation CD
64 banner================================================================================
66 menu=Regular MINIX 3:multiboot /kernel bootcd=1 cdproberoot=1 rootdevname=ram
67 menu=Regular MINIX 3 (with AHCI):multiboot /kernel bootcd=1 cdproberoot=1 rootdevname=ram ahci=yes
68 menu=Edit menu option:edit
69 menu=Drop to boot prompt:prompt
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!
100 # This space intentionally left blank - leave to appease bootloader!
101 # This space intentionally left blank - leave to appease bootloader!
102 # This space intentionally left blank - leave to appease bootloader!
106 copy_local_packages()
108 if [ -d $PACKAGEDIR -a -f $PACKAGELIST -a $PACKAGES -ne 0 ]
111 indexpath=$PACKAGEDIR/.index
113 if [ ! -d $indexpath ]
114 then mkdir $indexpath
116 if [ ! -d $indexpath ]
117 then echo "Couldn't create $indexpath."
121 echo "" >$PACKAGEDIR/All/$index
123 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
124 for pkgprefix in `cat $PACKAGELIST`
125 do realfn="`echo $PACKAGEDIR/All/${pkgprefix}*.tgz`"
128 # Copy package and create package's index
130 p="`basename $realfn`"
132 cp $p $RELEASEPACKAGE/
134 indexname=$indexpath/$p.$index
135 pkg_info -X $p >$indexname
137 if [ ! -f $indexname ]
138 then echo Missing $indexname.
142 if [ "`wc -l <$indexname`" -lt 3 ]
143 then $indexname is too short.
148 cat $indexname >>$PACKAGEDIR/All/$index
151 echo "Can't find $pkgprefix Missing."
155 bzip2 -f $PACKAGEDIR/All/$index
156 cp $PACKAGEDIR/All/$index.bz2 $RELEASEPACKAGE/
168 # Determine number of inodes
169 inodes=`find $path | egrep -v ^$path/usr | wc -l`
170 inodes="`expr $inodes + $extra_inodes`"
172 # Determine number of data zones
173 zonekbs=`du -ks $path | cut -d' ' -f1`
175 [ ! -d $path/usr ] || zonekbsignore=`du -ks $path/usr | cut -d" " -f1`
176 zones="`expr \( $zonekbs - $zonekbsignore \) / \( $BS / 1024 \) + $extra_zones`"
178 # Determine file system size
179 BSBITS="`expr $BS \* 8`"
180 imap_blocks="`expr \( $inodes + $BSBITS - 1 \) / $BSBITS`"
181 inode_blocks="`expr \( $inodes \* 64 + $BS - 1 \) / $BS`"
182 zmap_blocks="`expr \( $zones + $BSBITS - 1 \) / $BSBITS`"
183 blocks="`expr 1 + 1 + $imap_blocks + $zmap_blocks + $inode_blocks + $zones`"
184 kbs="`expr $blocks \* \( $BS / 1024 \)`"
186 # Apply default if higher
187 if [ -n "$mbsdefault" ]
189 kbsdefault="`expr $mbsdefault \* 1024`"
190 if [ "$kbs" -lt "$kbsdefault" ]
192 else echo "warning: ${mbsdefault}mb is too small, using ${kbs}kb"
196 # Create a filesystem on the target ramdisk
197 ramdisk $kbs $ramdisk
198 mkfs.mfs -B $BS -i $inodes $ramdisk