Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2003 14:04:59 -0500
From:      "Charles Howse" <chowse@charter.net>
To:        "'Kent Stewart'" <kstewart@owt.com>, "'ODHIAMBO Washington'" <wash@wananchi.com>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: scripting the buildworld/installworld process
Message-ID:  <006001c37185$1ba1e650$04fea8c0@moe>
In-Reply-To: <200309011418.33352.kstewart@owt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Well, it worked!  After a fashion...
This morning I swapped my small primary HDD and larger secondary HDD,
then created the new slices/mount points, and re-installed:
Primary Master 8.something G:
/	500M
Swap	256M
/var	500M
/tmp	500M
/usr	<remainder> over 6G

Secondary Slave 2.1G:
/usr/obj	1000M
/disk2 <remainder> about 1G
Drat!  I should have put the swap partition on the second HDD!  Oh well.

Getting the times for the different processes into a log worked well,
the entire buildworld/installworld took about 2.5 hours on my Celeron
300 w/ 64M.

I did have to re-edit the first script, because it wasn't able to
process all the sections that had this:
\time -aho $blog make buildworld |=20
tee $tlog |=20
tail -n 50 $tlog > $bdir/buildworld.log

It would just zoom through the whole script and write empty log files.
Finished in about 2 seconds!  :-)

I left the sections of the script like this:
\time -aho $blog make buildworld

Once I got everything tweaked, it worked fine!

I did have a problem with portupgrade -Na, it finished with the
following message:
The following packages were not installed or upgraded:
! Cvsup-without-gui-16.1g	Unknown build error
! XFree86-4-libraries		Unknown build error
* mtools				Skipped

Any ideas what may have caused this?  I've been trying to get mtools
installed, and it always fails.


Thanks to all who responded!  I appreciate it!
Scripts and build.log attached.
Run in the following order:
Update
Update1
Update2
upgrade

------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: application/octet-stream;
	name="upgrade"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="upgrade"

#!/usr/local/bin/bash=0A=
#=0A=
# Use portupgrade to upgrade the system=0A=
=0A=
/usr/bin/tar -czvf /root/dbpkg.tgz /var/db/pkg=0A=
/usr/local/sbin/pkgdb -F=0A=
/usr/local/sbin/portupgrade -Na=0A=
=0A=

------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: application/octet-stream;
	name="build.log"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="build.log"

Time for buildworld:		2h3m49.08s real=0A=
Time for make buildkernel:	19m18.84s real=0A=
Time for installkernel:		23.40s real=0A=
Time for installworld:		4m43.20s real=0A=
Time for make clean:		0.11s real=0A=
Time for make all install:	32.94s real=0A=
=0A=

------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: application/octet-stream;
	name="update"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="update"

#!/usr/local/bin/bash=0A=
#=0A=
# Update the sources and ports=0A=
=0A=
echo -n "Have you booted to single user mode and enabled softupdates? =
[y/n]: "=0A=
read a=0A=
if [ "$a" =3D n ] ; then=0A=
    exit 1=0A=
fi=0A=
=0A=
if [ -a /etc/cvsupfile ] ; then=0A=
    /usr/local/bin/cvsup -g -L 1 /etc/cvsupfile=0A=
else=0A=
    cp /disk2/larry/etc/cvsupfile /etc/cvsupfile=0A=
    /usr/local/bin/cvsup -g -L 1 /etc/cvsupfile=0A=
fi=0A=
=0A=

------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: application/octet-stream;
	name="update1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="update1"

#!/usr/local/bin/bash=0A=
#=0A=
# Update the system, run in multi-user mode.=0A=
#=0A=
# Checks the exit status of all important commands,=0A=
# Exits on exit status of anything other than 0, =0A=
# Prints the name of the command that failed.=0A=
# Logs the last 10 lines of screen output for important commands.=0A=
=0A=
bailout() {=0A=
if [ "$?" -ne 0 ] ; then=0A=
    echo "Update1 has bailed out!!"=0A=
    echo "The command that failed was..."=0A=
    echo $cmd=0A=
    exit 1=0A=
fi=0A=
}=0A=
=0A=
echo -n "Have you read /usr/src/UPDATING? [y/n]: "=0A=
read a=0A=
if [ "$a" =3D n ] ; then=0A=
    less /usr/src/UPDATING=0A=
    exit 2=0A=
fi=0A=
=0A=
echo -n "Have you merged /etc/group and /usr/src/etc/group? [y/n]: "=0A=
read b=0A=
if [ "$b" =3D n ] ; then=0A=
    diff -c /etc/group /usr/src/etc/group | less=0A=
    exit 3=0A=
fi=0A=
=0A=
echo -n "Have you merged /etc/master.passwd and =
/usr/src/etc/master.passwd? [y/n]: "=0A=
read c=0A=
if [ "$c" =3D n ] ; then=0A=
    diff -c /etc/master.passwd /usr/src/etc/master.passwd=0A=
    exit 4=0A=
fi=0A=
=0A=
cmd=3D"cp /disk2/larry/etc/make.conf /etc"=0A=
cp /disk2/larry/etc/make.conf /etc=0A=
bailout=0A=
=0A=
cmd=3D"cp /disk2/larry/usr/src/sys/i386/conf/CUSTOM =
/usr/src/sys/i386/conf"=0A=
cp /disk2/larry/usr/src/sys/i386/conf/CUSTOM /usr/src/sys/i386/conf=0A=
bailout=0A=
=0A=
cmd=3D"Clean out /usr/obj"=0A=
echo -n "Clean out /usr/obj? [y/n]: "=0A=
read d=0A=
if [ "$d" =3D y ] ; then=0A=
    cd /usr/obj=0A=
    chflags -R noschg *=0A=
    rm -rf *=0A=
fi=0A=
bailout=0A=
=0A=
echo -n "Continue with build? [y/n]: "=0A=
read e=0A=
if [ "$e" =3D n ] ; then=0A=
    exit 5=0A=
fi=0A=
=0A=
if [ ! -d /var/log/build ] ; then=0A=
    mkdir /var/log/build=0A=
fi=0A=
=0A=
bdir=3D/var/log/build=0A=
blog=3D$bdir/build.log=0A=
=0A=
cmd=3D"make buildworld"=0A=
cd /usr/src=0A=
echo -n "Time for buildworld:" > $blog=0A=
\time -aho $blog make buildworld=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
cmd=3D"make buildkernel"=0A=
echo -n "Time for make buildkernel:" >> $blog=0A=
\time -aho $blog make buildkernel=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
cmd=3D"make installkernel"=0A=
echo -n "Time for installkernel:" >> $blog=0A=
\time -aho  $blog make installkernel=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
echo "Reboot to single user mode and run /disk2/larry/bin/update2"
------=_NextPart_000_0061_01C3715B.32CBDE50
Content-Type: application/octet-stream;
	name="update2"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="update2"

#!/usr/local/bin/bash=0A=
#=0A=
# Update the system. Run in single user mode.=0A=
=0A=
bailout () {=0A=
if [ "$?" -ne 0 ] ; then=0A=
    echo "Update2 has bailed out!!"=0A=
    echo "The command that failed was..."=0A=
    echo $cmd=0A=
    exit 1=0A=
fi=0A=
}=0A=
=0A=
echo -n "Continue with installworld? [y/n]: "=0A=
read a =0A=
if [ "$a" =3D n ] ; then=0A=
    exit 2=0A=
fi=0A=
=0A=
bdir=3D/var/log/build=0A=
blog=3D$bdir/build.log=0A=
=0A=
cmd=3D"make installworld"=0A=
echo -n "Time for installworld:" >> $blog=0A=
cd /usr/src=0A=
\time -aho $blog make installworld=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
cmd=3D"cp -Rp /etc /etc.old"=0A=
if [ -d /etc.old ] ; then=0A=
    rm -r /etc.old=0A=
fi    =0A=
cp -Rp /etc /etc.old=0A=
bailout=0A=
=0A=
cmd=3D"rm -r /var/tmp/temproot"=0A=
if [ -d /var/tmp/temproot ] ; then=0A=
    cd /var/tmp/temproot=0A=
    chflags -R noschg *=0A=
    cd=0A=
    rm -r /var/tmp/temproot=0A=
fi=0A=
bailout=0A=
=0A=
cmd=3D"mergemaster -a"=0A=
/usr/sbin/mergemaster -a=0A=
bailout=0A=
=0A=
cmd=3D"./MAKEDEV all"=0A=
cd /dev=0A=
./MAKEDEV all=0A=
bailout=0A=
=0A=
cmd=3D"make clean"=0A=
cd /usr/src/release/sysinstall=0A=
echo -n "Time for make clean:" >> $blog=0A=
\time -aho $blog make clean=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
cmd=3D"make all install"=0A=
echo -n "Time for make all install:" >> $blog=0A=
\time -aho $blog make all install=0A=
bailout=0A=
echo >> $blog=0A=
=0A=
echo "Finished!  Do ps and top work?"
------=_NextPart_000_0061_01C3715B.32CBDE50--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006001c37185$1ba1e650$04fea8c0>