[parisc-linux] Automated Kernel Build Script.

Charles Wilcox willo@ece.wpi.edu
Wed, 21 Mar 2001 13:55:55 -0500 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1152337369-985199639=:15374
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.OSF.4.33.0103211334151.12400@ece.wpi.edu>

Here is a bash script I developed from the "kernel recipe".  It can save
allot of time, from sitting around waiting for a make to finish just to
type another command and wait again, to preventing another mistyped
command from messing things up.

Motivation:
I produced several kernels that worked with this, but they had their
issues.  That, and there did not appear to be any nice/friendly way to
install all those Debian packages to make a usable system.  I've decided
that these 10 C110 machines will just have to delapidate until a real
distribution gets put together.  Until then, I figure someone else can use
the script I worked on to maybe help them out in their endeavors.

Semi-technical info:
The beginning of the script intentionally destroys the $SOURCE, $BUILD,
and $DEST directories.  If not destroyed, I sometimes would have the build
process fail on me, but starting from scratch worked for me.  Maybe it was
coincidence, play with it and find out for yourself.  Happy hacking.

 -- Charles Wilcox

===========================================================================

#!/bin/bash

##  Copyright (C) 2001, Charles L. Wilcox <willo@wpi.edu>

#set some system variables
MACH=i386-linux
SOURCE=$HOME/source
BUILD=$HOME/build
DEST=$HOME/opt/puffin
PATH=$PATH:$DEST/bin
CVSROOT=":pserver:anonymous@puffin.external.hp.com:/home/cvs/parisc"

#clean up and initialize directory structures
rm -rf $SOURCE
rm -rf $BUILD
rm -rf $DEST
mkdir -p $SOURCE
mkdir -p $BUILD

#login to the CVS server and get the goods
cvs -d $CVSROOT login
cd $SOURCE
cvs -z9 -d $CVSROOT checkout binutils gcc linux glibc palo || exit

#configure and build binutils
mkdir -p $BUILD/binutils
cd $BUILD/binutils
$SOURCE/binutils/configure --host=$MACH --prefix=$DEST --target=hppa-linux \
--enable-targets=hppa64-linux --disable-nls || exit
make || exit
make install || exit
cd $HOME

#configure and build gcc -- Part 1
cd $SOURCE/gcc
$SOURCE/gcc/contrib/gcc_update --touch
mkdir -p $BUILD/gcc
cd $BUILD/gcc
$SOURCE/gcc/configure --host=$MACH --prefix=$DEST --target=hppa-linux \
--enable-shared --disable-nls || exit
rm -rf zlib hppa-linux
make LANGUAGES=c || exit
make LANGUAGES=c install || exit
cd $HOME

#Unpack the kernel and make the header files glibc needs.
cd $SOURCE/linux
make oldconfig || exit
#make menuconfig
make dep || exit
cd $HOME

#configure and build glibc
mkdir -p $BUILD/glibc
cd $BUILD/glibc
$SOURCE/glibc/configure --host=hppa-linux --build=$MACH \
--prefix=$DEST/hppa-linux --with-headers=$SOURCE/linux/include \
--disable-profile --without-cvs --enable-add-ons || exit
make || exit
make install || exit
cd $HOME
ln -sf $SOURCE/linux/include/linux $DEST/hppa-linux/include
ln -sf $SOURCE/linux/include/asm $DEST/hppa-linux/include

#configure and build the rest of gcc
cd $BUILD/gcc
$SOURCE/gcc/configure --host=$MACH --prefix=$DEST --target=hppa-linux \
--enable-shared --disable-nls || exit
make || exit
make install || exit
cd $HOME

#build the kernel
cd $SOURCE/linux
##pico ../palo/Makefile
make palo || exit
cd $HOME

--0-1152337369-985199639=:15374
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=make-puffin
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.OSF.4.33.0103211355550.12557@ece.wpi.edu>
Content-Description: 
Content-Disposition: attachment; filename=make-puffin

IyEvYmluL2Jhc2gNCg0KIyMgIENvcHlyaWdodCAoQykgMjAwMSwgQ2hhcmxl
cyBMLiBXaWxjb3ggPHdpbGxvQHdwaS5lZHU+ICANCg0KI3NldCBzb21lIHN5
c3RlbSB2YXJpYWJsZXMNCk1BQ0g9aTM4Ni1saW51eA0KU09VUkNFPSRIT01F
L3NvdXJjZQ0KQlVJTEQ9JEhPTUUvYnVpbGQNCkRFU1Q9JEhPTUUvb3B0L3B1
ZmZpbg0KUEFUSD0kUEFUSDokREVTVC9iaW4NCkNWU1JPT1Q9Ijpwc2VydmVy
OmFub255bW91c0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