8 PACKAGEDIR
=/usr
/bigports
/Packages
9 PACKAGESOURCEDIR
=/usr
/bigports
/Sources
15 dd if=$TMPDISK of
=usrimage bs
=$BS count
=$USRBLOCKS
17 rootsize
=`stat -size rootimage`
18 usrsize
=`stat -size usrimage`
20 rootsects
=`expr $rootsize / 512`
21 usrsects
=`expr $usrsize / 512`
23 # installboot -m needs at least 1KB
24 dd < /dev
/zero
>tmpimage count
=2
25 partition
-fm tmpimage
2 81:$rootsects* 0:0 81:$usrsects
26 installboot
-m tmpimage
/usr
/mdec
/masterboot
27 dd < tmpimage
> subpart count
=1
29 primsects
=`expr 1 + $rootsects + $usrsects`
30 cyl
=`expr '(' $primsects ')' / $secs + 1`
31 padsects
=`expr $cyl \* $secs - 1 - $primsects`
33 { dd < /dev
/zero count
=1
37 dd < /dev
/zero count
=$padsects
39 partition
-m hdimage
81:`expr $primsects + $padsects`*
40 installboot
-m hdimage
/usr
/mdec
/masterboot
45 $RELEASEDIR/usr
/bin
/installboot
-d $TMPDISK3 \
46 $RELEASEDIR/usr
/mdec
/bootblock boot
/boot
53 bootbig(1, Regular MINIX 3) { image=/boot/image_big; boot }
54 bootsmall(2, Small MINIX 3 (<16MB)) {image=/boot/image_small; boot }
55 main() { trap 10000 boot ; menu; }
56 save' |
$RELEASEDIR/usr
/bin
/edparams
$TMPDISK3
61 usr_roflag="-r"' > $RELEASEDIR/etc
/fstab
66 $RELEASEDIR/usr
/bin
/installboot
-d $TMPDISK3 \
67 $RELEASEDIR/usr
/mdec
/bootblock boot
/boot
72 save' |
$RELEASEDIR/usr
/bin
/edparams
$TMPDISK3
77 ' > $RELEASEDIR/etc
/fstab
81 RELEASEPACKAGE
=${RELEASEDIR}/usr
/install
/packages
82 RELEASEPACKAGESOURCES
=${RELEASEDIR}/usr
/install
/package-sources
85 CDFILES
=/usr
/tmp
/cdreleasefiles
86 sh tell_config OS_RELEASE . OS_VERSION
>/tmp
/rel.$$
87 version_pretty
=`sed 's/[" ]//g;/^$/d' </tmp/rel.$$`
88 version
=`sed 's/[" ]//g;/^$/d' </tmp/rel.$$ | tr . _`
89 IMG_BASE
=minix
${version}_ide
98 while getopts "pchu?r:" c
102 echo "Usage: $0 [-p] [-c] [-h] [-r <tag>] [-u]" >&2
106 echo " * Making HD image"
107 IMG_BASE
=minix
${version}_bios
111 echo " * Copying, not SVN"
121 echo " * Making live USB-stick image"
122 IMG_BASE
=minix
${version}_usb
131 USRBLOCKS
="`expr $USRMB \* 1024 \* 1024 / $BS`"
132 USRSECTS
="`expr $USRMB \* 1024 \* 2`"
134 ROOTSECTS
="`expr $ROOTKB \* 2`"
135 ROOTBLOCKS
="`expr $ROOTKB \* 1024 / $BS`"
139 echo "Note: this script wants to do svn operations."
148 then TMPDISK
="`cat $TD1`"
149 echo " * Warning: I'm going to overwrite $TMPDISK!"
151 echo "Temporary (sub)partition to use to make the /usr FS image? "
152 echo "I need $USRMB MB. It will be mkfsed!"
153 echo -n "Device: /dev/"
160 else echo "$TMPDISK is not a block device.."
167 then TMPDISK2
="`cat $TD2`"
168 echo " * Warning: I'm going to overwrite $TMPDISK2!"
170 echo "Temporary (sub)partition to use for /tmp? "
171 echo "It will be mkfsed!"
172 echo -n "Device: /dev/"
179 else echo "$TMPDISK2 is not a block device.."
186 then TMPDISK3
="`cat $TD3`"
187 echo " * Warning: I'm going to overwrite $TMPDISK3!"
189 echo "It has to be at least $ROOTKB KB."
191 echo "Temporary (sub)partition to use to make the root FS image? "
192 echo "It will be mkfsed!"
193 echo -n "Device: /dev/"
200 else echo "$TMPDISK3 is not a block device.."
206 umount
$TMPDISK || true
207 umount
$TMPDISK2 || true
208 umount
$TMPDISK3 || true
210 if [ $TMPDISK = $TMPDISK2 -o $TMPDISK = $TMPDISK3 -o $TMPDISK2 = $TMPDISK3 ]
212 echo "Temporary devices can't be equal."
216 echo " * Cleanup old files"
217 rm -rf $RELEASEDIR $IMG $IMAGE $ROOTIMAGE $IMGBZ $CDFILES image
*
218 mkdir
-p $CDFILES ||
exit
220 mkfs
-B $BS -b $ROOTBLOCKS $TMPDISK3 ||
exit
221 mkfs
$TMPDISK2 ||
exit
222 echo " * mounting $TMPDISK3 as $RELEASEDIR"
223 mount
$TMPDISK3 $RELEASEDIR ||
exit
224 mkdir
-m 755 $RELEASEDIR/usr
225 mkdir
-m 1777 $RELEASEDIR/tmp
226 mount
$TMPDISK2 $RELEASEDIR/tmp
228 mkfs
-B $BS -b $USRBLOCKS $TMPDISK ||
exit
229 echo " * Mounting $TMPDISK as $RELEASEDIR/usr"
230 mount
$TMPDISK $RELEASEDIR/usr ||
exit
231 mkdir
-p $RELEASEDIR/tmp
232 mkdir
-p $RELEASEDIR/usr
/tmp
233 mkdir
-p $RELEASEDIR/$XBIN
234 mkdir
-p $RELEASEDIR/usr
/bin
235 mkdir
-p $RELEASEDIR/bin
236 mkdir
-p $RELEASEPACKAGE
237 mkdir
-p $RELEASEPACKAGESOURCES
239 echo " * Transfering bootstrap dirs to $RELEASEDIR"
240 cp -p /bin
/* /usr
/bin
/* $RELEASEDIR/$XBIN
241 cp -rp /usr
/lib
$RELEASEDIR/usr
242 cp -rp /bin
/bigsh
/bin
/sh
$RELEASEDIR/bin
243 cp -rp /usr
/bin
/make /usr
/bin
/install /usr
/bin
/yacc /usr
/bin
/flex
$RELEASEDIR/usr
/bin
245 if [ -d $PACKAGEDIR -a -d $PACKAGESOURCEDIR -a $PACKAGES -ne 0 ]
246 then echo " * Indexing packages"
251 p
="`echo $p | sed 's/.tar.bz2//'`"
254 then echo "$p|`cat $descr`"
258 for d
in $PACKAGEDIR $PACKAGESOURCEDIR
259 do echo Counting size of
$d
263 b
="`bzip2 -dc $d/*.bz2 | wc -c`"
264 echo "`expr 1 + $b / 1024 / 1024`" >$f
268 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
269 cp $PACKAGEDIR/* $RELEASEPACKAGE/
270 echo " * Transfering $PACKAGESOURCEDIR to $RELEASEPACKAGESOURCES"
271 cp $PACKAGESOURCEDIR/* $RELEASEPACKAGESOURCES/ || true
275 # Make sure compilers and libraries are bin-owned
276 chown
-R bin
$RELEASEDIR/usr
/lib
277 chmod -R u
+w
$RELEASEDIR/usr
/lib
281 echo " * Doing new svn export"
282 REPO
=https
://gforge.cs.vu.nl
/svn
/minix
/trunk
/$SRC
283 REVISION
="`svn info $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
284 echo "Doing export of revision $REVISION from $REPO."
285 ( cd $RELEASEDIR/usr
&& svn
export -r$REVISION $REPO )
288 ( cd ..
&& make depend
&& make clean
)
290 ( cd $srcdir && tar cf
- .
) |
( cd $RELEASEDIR/usr
&& mkdir
$SRC && cd $SRC && tar xf
- )
294 if [ "$USB" -ne 0 ]; then
295 IMG
=${IMG_BASE}_
${REVTAG}.img
297 IMG
=${IMG_BASE}_
${REVTAG}.iso
302 echo " * Fixups for owners and modes of dirs and files"
303 chown
-R bin
$RELEASEDIR/usr
/$SRC
304 chmod -R u
+w
$RELEASEDIR/usr
/$SRC
305 find $RELEASEDIR/usr
/$SRC -type d |
xargs chmod 755
306 find $RELEASEDIR/usr
/$SRC -type f |
xargs chmod 644
307 find $RELEASEDIR/usr
/$SRC -name configure |
xargs chmod 755
308 find $RELEASEDIR/usr
/$SRC/commands
-name build |
xargs chmod 755
309 # Bug tracking system not for on cd
310 rm -rf $RELEASEDIR/usr
/$SRC/doc
/bugs
312 # Make sure the CD knows it's a CD, unless it's not
314 then date >$RELEASEDIR/CD
316 echo " * Chroot build"
317 chroot
$RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh" ||
exit 1
318 echo " * Chroot build done"
319 echo " * Removing bootstrap files"
320 rm -rf $RELEASEDIR/$XBIN
321 # The build process leaves some file in $SRC as root.
322 chown
-R bin
$RELEASEDIR/usr
/src
*
323 cp issue.
install $RELEASEDIR/etc
/issue
328 elif [ "$HDEMU" -ne 0 ]
333 echo $version_pretty >$RELEASEDIR/etc
/version
334 echo " * Counting files"
335 extrakb
=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'`
336 expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb
337 find $RELEASEDIR/usr | fgrep
-v /install
/ |
wc -l >$RELEASEDIR/.usrfiles
338 find $RELEASEDIR -xdev |
wc -l >$RELEASEDIR/.rootfiles
339 echo " * Zeroing remainder of temporary areas"
342 cp /dev
/zero
$RELEASEDIR/usr
/.x
2>/dev
/null || true
343 rm $RELEASEDIR/usr
/.x
344 cp /dev
/zero
$RELEASEDIR/.x
2>/dev
/null || true
347 umount
$TMPDISK ||
exit
348 umount
$TMPDISK2 ||
exit
349 umount
$TMPDISK3 ||
exit
351 (cd ..
&& make depend
)
356 make image_small ||
exit 1
357 dd if=$TMPDISK3 of
=$ROOTIMAGE bs
=$BS count
=$ROOTBLOCKS
358 # Prepare image and image_small for cdfdboot
360 sh mkboot cdfdboot
$TMPDISK3
361 cp $IMAGE $CDFILES/bootflop.img
362 cp release
/cd
/* $CDFILES || true
363 echo "This is Minix version $version_pretty prepared `date`." >$CDFILES/VERSION.TXT
367 if [ "$HDEMU" -ne 0 ]; then
373 if [ "$USB" -ne 0 ]; then
376 writeisofs
-l MINIX
-b $bootimage $h_opt $CDFILES $IMG ||
exit 1
378 if [ "$HDEMU" -eq 0 ]
380 echo "Appending Minix root and usr filesystem"
381 # Pad ISO out to cylinder boundary
382 isobytes
=`stat -size $IMG`
383 isosects
=`expr $isobytes / 512`
384 isopad
=`expr $secs - '(' $isosects % $secs ')'`
385 dd if=/dev
/zero count
=$isopad >>$IMG
387 isosects
=`expr $isosects + $isopad`
388 ( cat $IMG $ROOTIMAGE ;
389 dd if=$TMPDISK bs
=$BS count
=$USRBLOCKS ) >m
391 # Make CD partition table
392 installboot
-m $IMG /usr
/mdec
/masterboot
393 # Make sure there is no hole..! Otherwise the ISO format is
395 partition
-m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS