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, MINIX 3) { image=/boot/image_big; 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 IMG_BASE
=minix
${version}_ide
99 while getopts "s:pchu?r:f:" c
103 echo "Usage: $0 [-p] [-c] [-h] [-r <tag>] [-u] [-f <filename>] [-s <username>]" >&2
107 echo " * Making HD image"
108 IMG_BASE
=minix
${version}_bios
112 echo " * Copying, not SVN"
122 echo " * Making live USB-stick image"
123 IMG_BASE
=minix
${version}_usb
128 FILENAMEOUT
="$OPTARG"
130 s
) USERNAME
="--username=$OPTARG"
137 USRBLOCKS
="`expr $USRMB \* 1024 \* 1024 / $BS`"
138 USRSECTS
="`expr $USRMB \* 1024 \* 2`"
140 ROOTSECTS
="`expr $ROOTKB \* 2`"
141 ROOTBLOCKS
="`expr $ROOTKB \* 1024 / $BS`"
145 echo "Note: this script wants to do svn operations."
154 then TMPDISK
="`cat $TD1`"
155 echo " * Warning: I'm going to overwrite $TMPDISK!"
157 echo "Temporary (sub)partition to use to make the /usr FS image? "
158 echo "I need $USRMB MB. It will be mkfsed!"
159 echo -n "Device: /dev/"
166 else echo "$TMPDISK is not a block device.."
173 then TMPDISK2
="`cat $TD2`"
174 echo " * Warning: I'm going to overwrite $TMPDISK2!"
176 echo "Temporary (sub)partition to use for /tmp? "
177 echo "It will be mkfsed!"
178 echo -n "Device: /dev/"
185 else echo "$TMPDISK2 is not a block device.."
192 then TMPDISK3
="`cat $TD3`"
193 echo " * Warning: I'm going to overwrite $TMPDISK3!"
195 echo "It has to be at least $ROOTKB KB."
197 echo "Temporary (sub)partition to use to make the root FS image? "
198 echo "It will be mkfsed!"
199 echo -n "Device: /dev/"
206 else echo "$TMPDISK3 is not a block device.."
212 umount
$TMPDISK || true
213 umount
$TMPDISK2 || true
214 umount
$TMPDISK3 || true
216 if [ $TMPDISK = $TMPDISK2 -o $TMPDISK = $TMPDISK3 -o $TMPDISK2 = $TMPDISK3 ]
218 echo "Temporary devices can't be equal."
222 echo " * Cleanup old files"
223 rm -rf $RELEASEDIR $IMG $IMAGE $ROOTIMAGE $CDFILES image
*
224 mkdir
-p $CDFILES ||
exit
226 mkfs
-B $BS -b $ROOTBLOCKS $TMPDISK3 ||
exit
227 mkfs
$TMPDISK2 ||
exit
228 echo " * mounting $TMPDISK3 as $RELEASEDIR"
229 mount
$TMPDISK3 $RELEASEDIR ||
exit
230 mkdir
-m 755 $RELEASEDIR/usr
231 mkdir
-m 1777 $RELEASEDIR/tmp
232 mount
$TMPDISK2 $RELEASEDIR/tmp
235 mkfs
-B $BS -b $USRBLOCKS $TMPDISK ||
exit
236 echo " * Mounting $TMPDISK as $RELEASEDIR/usr"
237 mount
$TMPDISK $RELEASEDIR/usr ||
exit
238 mkdir
-p $RELEASEDIR/tmp
239 mkdir
-p $RELEASEDIR/usr
/tmp
240 mkdir
-p $RELEASEDIR/$XBIN
241 mkdir
-p $RELEASEDIR/usr
/bin
242 mkdir
-p $RELEASEDIR/bin
243 mkdir
-p $RELEASEPACKAGE
244 mkdir
-p $RELEASEPACKAGESOURCES
246 echo " * Transfering bootstrap dirs to $RELEASEDIR"
247 cp -p /bin
/* /usr
/bin
/* $RELEASEDIR/$XBIN
248 cp -rp /usr
/lib
$RELEASEDIR/usr
249 cp -rp /bin
/bigsh
/bin
/sh
/bin
/echo $RELEASEDIR/bin
250 cp -rp /usr
/bin
/make /usr
/bin
/install /usr
/bin
/yacc /usr
/bin
/flex
$RELEASEDIR/usr
/bin
252 if [ -d $PACKAGEDIR -a -d $PACKAGESOURCEDIR -a $PACKAGES -ne 0 ]
253 then echo " * Indexing packages"
258 p
="`echo $p | sed 's/.tar.bz2//'`"
261 then echo "$p|`cat $descr`"
265 for d
in $PACKAGEDIR $PACKAGESOURCEDIR
266 do echo Counting size of
$d
270 b
="`bzip2 -dc $d/*.bz2 | wc -c`"
271 echo "`expr 1 + $b / 1024 / 1024`" >$f
275 echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
276 cp $PACKAGEDIR/* $RELEASEPACKAGE/
277 echo " * Transfering $PACKAGESOURCEDIR to $RELEASEPACKAGESOURCES"
278 cp $PACKAGESOURCEDIR/* $RELEASEPACKAGESOURCES/ || true
282 # Make sure compilers and libraries are bin-owned
283 chown
-R bin
$RELEASEDIR/usr
/lib
284 chmod -R u
+w
$RELEASEDIR/usr
/lib
288 echo " * Doing new svn export"
290 REPO
=https
://gforge.cs.vu.nl
/svn
/minix
/branches
/$BRANCH
291 REVISION
="`svn info $USERNAME $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
292 echo "Doing export of revision $REVISION from $REPO."
293 ( cd $RELEASEDIR/usr
&& svn
$USERNAME export -r$REVISION $REPO && mv $BRANCH $SRC )
297 /* Added by release script */
298 #ifndef _SVN_REVISION
299 #define _SVN_REVISION \"$REVISION\"
300 #endif" >>$RELEASEDIR/usr
/src
/include
/minix
/sys_config.h
303 ( cd ..
&& make depend
&& make clean
)
305 ( cd $srcdir && tar cf
- .
) |
( cd $RELEASEDIR/usr
&& mkdir
$SRC && cd $SRC && tar xf
- )
309 if [ "$USB" -ne 0 ]; then
310 IMG
=${IMG_BASE}_
${REVTAG}.img
312 IMG
=${IMG_BASE}_
${REVTAG}.iso
315 echo " * Fixups for owners and modes of dirs and files"
316 chown
-R bin
$RELEASEDIR/usr
/$SRC
317 chmod -R u
+w
$RELEASEDIR/usr
/$SRC
318 find $RELEASEDIR/usr
/$SRC -type d |
xargs chmod 755
319 find $RELEASEDIR/usr
/$SRC -type f |
xargs chmod 644
320 find $RELEASEDIR/usr
/$SRC -name configure |
xargs chmod 755
321 find $RELEASEDIR/usr
/$SRC/commands
-name build |
xargs chmod 755
322 # Bug tracking system not for on cd
323 rm -rf $RELEASEDIR/usr
/$SRC/doc
/bugs
325 # Make sure the CD knows it's a CD, unless it's not
327 then date >$RELEASEDIR/CD
329 echo " * Chroot build"
330 cp chrootmake.sh
$RELEASEDIR/usr
/$SRC/tools
/chrootmake.sh
331 chroot
$RELEASEDIR "PATH=/$XBIN sh -x /usr/$SRC/tools/chrootmake.sh" ||
exit 1
332 # Copy built images for cd booting
333 cp $RELEASEDIR/boot
/image_big image
334 echo " * Chroot build done"
335 echo " * Removing bootstrap files"
336 rm -rf $RELEASEDIR/$XBIN
337 # The build process leaves some file in $SRC as root.
338 chown
-R bin
$RELEASEDIR/usr
/src
*
339 cp issue.
install $RELEASEDIR/etc
/issue
344 elif [ "$HDEMU" -ne 0 ]
349 echo $version_pretty, SVN revision
$SVNREV, generated
`date` >$RELEASEDIR/etc
/version
350 echo " * Counting files"
351 extrakb
=`du -s $RELEASEDIR/usr/install | awk '{ print $1 }'`
352 expr `df $TMPDISK | tail -1 | awk '{ print $4 }'` - $extrakb >$RELEASEDIR/.usrkb
353 find $RELEASEDIR/usr | fgrep
-v /install
/ |
wc -l >$RELEASEDIR/.usrfiles
354 find $RELEASEDIR -xdev |
wc -l >$RELEASEDIR/.rootfiles
355 echo " * Zeroing remainder of temporary areas"
358 cp /dev
/zero
$RELEASEDIR/usr
/.x
2>/dev
/null || true
359 rm $RELEASEDIR/usr
/.x
360 cp /dev
/zero
$RELEASEDIR/.x
2>/dev
/null || true
363 umount
$TMPDISK ||
exit
364 umount
$TMPDISK2 ||
exit
365 umount
$TMPDISK3 ||
exit
368 dd if=$TMPDISK3 of
=$ROOTIMAGE bs
=$BS count
=$ROOTBLOCKS
369 sh mkboot cdfdboot
$TMPDISK3
370 cp $IMAGE $CDFILES/bootflop.img
371 cp release
/cd
/* $CDFILES || true
372 echo "This is Minix version $version_pretty prepared `date`." >$CDFILES/VERSION.TXT
376 if [ "$HDEMU" -ne 0 ]; then
382 if [ "$USB" -ne 0 ]; then
385 writeisofs
-l MINIX
-b $bootimage $h_opt $CDFILES $IMG ||
exit 1
387 if [ "$HDEMU" -eq 0 ]
389 echo "Appending Minix root and usr filesystem"
390 # Pad ISO out to cylinder boundary
391 isobytes
=`stat -size $IMG`
392 isosects
=`expr $isobytes / 512`
393 isopad
=`expr $secs - '(' $isosects % $secs ')'`
394 dd if=/dev
/zero count
=$isopad >>$IMG
396 isosects
=`expr $isosects + $isopad`
397 ( cat $IMG $ROOTIMAGE ;
398 dd if=$TMPDISK bs
=$BS count
=$USRBLOCKS ) >m
400 # Make CD partition table
401 installboot
-m $IMG /usr
/mdec
/masterboot
402 # Make sure there is no hole..! Otherwise the ISO format is
404 partition
-m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS
408 if [ "$FILENAMEOUT" ]
409 then echo "$IMG" >$FILENAMEOUT