7 PACKAGEDIR
=/usr
/bigports
/Packages
8 PACKAGESOURCEDIR
=/usr
/bigports
/Sources
14 dd if=$TMPDISK of
=usrimage bs
=$BS count
=$USRBLOCKS
16 rootsize
=`stat -size rootimage`
17 usrsize
=`stat -size usrimage`
19 rootsects
=`expr $rootsize / 512`
20 usrsects
=`expr $usrsize / 512`
22 # installboot -m needs at least 1KB
23 dd < /dev
/zero
>tmpimage count
=2
24 partition
-fm tmpimage
2 81:$rootsects* 0:0 81:$usrsects
25 installboot
-m tmpimage
/usr
/mdec
/masterboot
26 dd < tmpimage
> subpart count
=1
28 primsects
=`expr 1 + $rootsects + $usrsects`
29 cyl
=`expr '(' $primsects ')' / $secs + 1`
30 padsects
=`expr $cyl \* $secs - 1 - $primsects`
32 { dd < /dev
/zero count
=1
36 dd < /dev
/zero count
=$padsects
38 partition
-m hdimage
81:`expr $primsects + $padsects`*
39 installboot
-m hdimage
/usr
/mdec
/masterboot
44 $RELEASEDIR/usr
/bin
/installboot
-d $TMPDISK3 \
45 $RELEASEDIR/usr
/mdec
/bootblock boot
/boot
52 bootbig(1, Regular MINIX 3) { image=/boot/image_big; boot }
53 bootsmall(2, Small MINIX 3 (<16MB)) {image=/boot/image_small; boot }
54 main() { trap 10000 boot ; menu; }
55 save' |
$RELEASEDIR/usr
/bin
/edparams
$TMPDISK3
60 usr_roflag="-r"' > $RELEASEDIR/etc
/fstab
65 $RELEASEDIR/usr
/bin
/installboot
-d $TMPDISK3 \
66 $RELEASEDIR/usr
/mdec
/bootblock boot
/boot
71 save' |
$RELEASEDIR/usr
/bin
/edparams
$TMPDISK3
76 ' > $RELEASEDIR/etc
/fstab
80 RELEASEPACKAGE
=${RELEASEDIR}/usr
/install
/packages
81 RELEASEPACKAGESOURCES
=${RELEASEDIR}/usr
/install
/package-sources
84 CDFILES
=/usr
/tmp
/cdreleasefiles
85 sh tell_config OS_RELEASE . OS_VERSION
>/tmp
/rel.$$
86 version_pretty
=`sed 's/[" ]//g;/^$/d' </tmp/rel.$$`
87 version
=`sed 's/[" ]//g;/^$/d' </tmp/rel.$$ | tr . _`
88 subfn
="subreleaseno.$version"
90 then sub
="`cat $subfn`"
93 echo "`expr $sub + 1`" >$subfn
94 IMG_BASE
=minix
${version}_ide_build
$sub
102 while getopts "pchu?r:" c
106 echo "Usage: $0 [-p] [-c] [-h] [-r <tag>] [-u]" >&2
110 echo " * Making HD image"
111 IMG_BASE
=minix
${version}_bios_build
$sub
115 echo " * Copying, not SVN"
125 echo " * Making live USB-stick image"
126 IMG_BASE
=minix
${version}_usb_build
$sub
133 if [ "$USB" -ne 0 ]; then
143 USRBLOCKS
="`expr $USRMB \* 1024 \* 1024 / $BS`"
144 USRSECTS
="`expr $USRMB \* 1024 \* 2`"
146 ROOTSECTS
="`expr $ROOTKB \* 2`"
147 ROOTBLOCKS
="`expr $ROOTKB \* 1024 / $BS`"
151 echo "Note: this script wants to do svn operations."
160 then TMPDISK
="`cat $TD1`"
161 echo " * Warning: I'm going to overwrite $TMPDISK!"
163 echo "Temporary (sub)partition to use to make the /usr FS image? "
164 echo "I need $USRMB MB. It will be mkfsed!"
165 echo -n "Device: /dev/"
172 else echo "$TMPDISK is not a block device.."
179 then TMPDISK2
="`cat $TD2`"
180 echo " * Warning: I'm going to overwrite $TMPDISK2!"
182 echo "Temporary (sub)partition to use for /tmp? "
183 echo "It will be mkfsed!"
184 echo -n "Device: /dev/"
191 else echo "$TMPDISK2 is not a block device.."
198 then TMPDISK3
="`cat $TD3`"
199 echo " * Warning: I'm going to overwrite $TMPDISK3!"
201 echo "It has to be at least $ROOTKB KB."
203 echo "Temporary (sub)partition to use to make the root FS image? "
204 echo "It will be mkfsed!"
205 echo -n "Device: /dev/"
212 else echo "$TMPDISK3 is not a block device.."
218 umount
$TMPDISK || true
219 umount
$TMPDISK2 || true
220 umount
$TMPDISK3 || true
222 if [ $TMPDISK = $TMPDISK2 -o $TMPDISK = $TMPDISK3 -o $TMPDISK2 = $TMPDISK3 ]
224 echo "Temporary devices can't be equal."
228 echo " * Cleanup old files"
229 rm -rf $RELEASEDIR $IMG $IMAGE $ROOTIMAGE $IMGBZ $CDFILES image
*
230 mkdir
-p $CDFILES ||
exit
232 mkfs
-B $BS -b $ROOTBLOCKS $TMPDISK3 ||
exit
233 mkfs
$TMPDISK2 ||
exit
234 echo " * mounting $TMPDISK3 as $RELEASEDIR"
235 mount
$TMPDISK3 $RELEASEDIR ||
exit
236 mkdir
-m 755 $RELEASEDIR/usr
237 mkdir
-m 1777 $RELEASEDIR/tmp
238 mount
$TMPDISK2 $RELEASEDIR/tmp
240 mkfs
-B $BS -b $USRBLOCKS $TMPDISK ||
exit
241 echo " * Mounting $TMPDISK as $RELEASEDIR/usr"
242 mount
$TMPDISK $RELEASEDIR/usr ||
exit
243 mkdir
-p $RELEASEDIR/tmp
244 mkdir
-p $RELEASEDIR/usr
/tmp
245 mkdir
-p $RELEASEDIR/$XBIN
246 mkdir
-p $RELEASEDIR/usr
/bin
247 mkdir
-p $RELEASEDIR/bin
248 mkdir
-p $RELEASEPACKAGE
249 mkdir
-p $RELEASEPACKAGESOURCES
251 echo " * Transfering bootstrap dirs to $RELEASEDIR"
252 cp -p /bin
/* /usr
/bin
/* $RELEASEDIR/$XBIN
253 cp -rp /usr
/lib
$RELEASEDIR/usr
254 cp -rp /bin
/bigsh
/bin
/sh
$RELEASEDIR/bin
255 cp -rp /usr
/bin
/make /usr
/bin
/install /usr
/bin
/yacc /usr
/bin
/flex
$RELEASEDIR/usr
/bin
257 if [ -d $PACKAGEDIR -a -d $PACKAGESOURCEDIR -a $PACKAGES -ne 0 ]
258 then echo " * Indexing packages"
263 p
="`echo $p | sed 's/.tar.bz2//'`"
266 then echo "$p|`cat $descr`"
270 for d
in $PACKAGEDIR $PACKAGESOURCEDIR
271 do echo Counting size of
$d
275 b
="`bzip2 -dc $d/*.bz2 | wc -c`"
276 echo "`expr 1 + $b / 1024 / 1024`" >$f
280 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
281 cp $PACKAGEDIR/* $RELEASEPACKAGE/
282 echo " * Transfering $PACKAGESOURCEDIR to $RELEASEPACKAGESOURCES"
283 cp $PACKAGESOURCEDIR/* $RELEASEPACKAGESOURCES/ || true
287 # Make sure compilers and libraries are bin-owned
288 chown
-R bin
$RELEASEDIR/usr
/lib
289 chmod -R u
+w
$RELEASEDIR/usr
/lib
293 echo " * Doing new svn export"
294 ( cd $RELEASEDIR/usr
&& svn
export $SVNREV https
://gforge.cs.vu.nl
/svn
/minix
/trunk
/src
)
296 ( cd ..
&& make depend
&& make clean
)
298 ( cd $srcdir && tar cf
- .
) |
( cd $RELEASEDIR/usr
&& mkdir src
&& cd src
&& tar xf
- )
301 echo " * Fixups for owners and modes of dirs and files"
302 chown
-R bin
$RELEASEDIR/usr
/src
303 chmod -R u
+w
$RELEASEDIR/usr
/src
304 find $RELEASEDIR/usr
/src
-type d |
xargs chmod 755
305 find $RELEASEDIR/usr
/src
-type f |
xargs chmod 644
306 find $RELEASEDIR/usr
/src
-name configure |
xargs chmod 755
307 find $RELEASEDIR/usr
/src
/commands
-name build |
xargs chmod 755
308 # Bug tracking system not for on cd
309 rm -rf $RELEASEDIR/usr
/src
/doc
/bugs
311 # Make sure the CD knows it's a CD, unless it's not
313 then date >$RELEASEDIR/CD
315 echo " * Chroot build"
316 chroot
$RELEASEDIR "PATH=/$XBIN sh -x /usr/src/tools/chrootmake.sh" ||
exit 1
317 echo " * Chroot build done"
318 echo " * Removing bootstrap files"
319 rm -rf $RELEASEDIR/$XBIN
320 # The build process leaves some file in src as root.
321 chown
-R bin
$RELEASEDIR/usr
/src
*
322 cp issue.
install $RELEASEDIR/etc
/issue
327 elif [ "$HDEMU" -ne 0 ]
332 echo $version_pretty >$RELEASEDIR/etc
/version
333 echo " * Counting files"
334 extrakb
=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'`
335 expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb
336 find $RELEASEDIR/usr | fgrep
-v /install
/ |
wc -l >$RELEASEDIR/.usrfiles
337 find $RELEASEDIR -xdev |
wc -l >$RELEASEDIR/.rootfiles
338 echo " * Zeroing remainder of temporary areas"
341 cp /dev
/zero
$RELEASEDIR/usr
/.x
2>/dev
/null || true
342 rm $RELEASEDIR/usr
/.x
343 cp /dev
/zero
$RELEASEDIR/.x
2>/dev
/null || true
346 umount
$TMPDISK ||
exit
347 umount
$TMPDISK2 ||
exit
348 umount
$TMPDISK3 ||
exit
350 (cd ..
&& make depend
)
355 make image_small ||
exit 1
356 dd if=$TMPDISK3 of
=$ROOTIMAGE bs
=$BS count
=$ROOTBLOCKS
357 # Prepare image and image_small for cdfdboot
359 sh mkboot cdfdboot
$TMPDISK3
360 cp $IMAGE $CDFILES/bootflop.img
361 cp release
/cd
/* $CDFILES || true
362 echo "This is Minix version $version_pretty prepared `date`." >$CDFILES/VERSION.TXT
366 if [ "$HDEMU" -ne 0 ]; then
372 if [ "$USB" -ne 0 ]; then
375 writeisofs
-l MINIX
-b $bootimage $h_opt $CDFILES $IMG ||
exit 1
377 if [ "$HDEMU" -eq 0 ]
379 echo "Appending Minix root and usr filesystem"
380 # Pad ISO out to cylinder boundary
381 isobytes
=`stat -size $IMG`
382 isosects
=`expr $isobytes / 512`
383 isopad
=`expr $secs - '(' $isosects % $secs ')'`
384 dd if=/dev
/zero count
=$isopad >>$IMG
386 isosects
=`expr $isosects + $isopad`
387 ( cat $IMG $ROOTIMAGE ;
388 dd if=$TMPDISK bs
=$BS count
=$USRBLOCKS ) >m
390 # Make CD partition table
391 installboot
-m $IMG /usr
/mdec
/masterboot
392 # Make sure there is no hole..! Otherwise the ISO format is
394 partition
-m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS