1 #!/bin/sh 2 3 # Configuration: 4 if [ -e userinstall-defaults-uml ]; then 5 . "$PWD/userinstall-defaults-uml" 6 elif [ -e /etc/default/userinstall-uml ]; then 7 . /etc/default/userinstall-uml 8 else 9 echo "No defaults found for userinstall (UML)." 1>&2 10 exit 1 11 fi 12 13 if [ ! -e "$PACKAGEROOT" ]; then 14 echo "A package root must first be made using user-setup." 1>&2 15 exit 1 16 fi 17 18 THISDIR=`dirname "$0"` 19 20 if [ ! -e linux ]; then 21 if [ ! -e "$LINUXDIRNAME" ]; then 22 if [ ! -e "$LINUXARCHIVE" ]; then 23 echo "Getting the Linux kernel archive..." 1>&2 24 wget -O "$LINUXARCHIVE" "$LINUXADDRESS" 25 fi 26 27 echo "Unpacking the archive..." 1>&2 28 tar jxf "$LINUXARCHIVE" 29 fi 30 if [ ! -e "$LINUXDIRNAME/linux" ]; then 31 32 # Copy our configuration into the unpacked directory. 33 # Normally we would do this: 34 # make defconfig ARCH=um 35 # make menuconfig ARCH=um 36 # In "File systems", "CD-ROM/DVD Filesystems", press Y for "ISO 9660...". 37 # The supplied configuration file should include this information. 38 echo "Adding configuration..." 1>&2 39 if [ -e "$LINUXDIRNAME/.config" ]; then 40 if [ ! -e "$LINUXDIRNAME/.config.original" ]; then 41 echo "$LINUXDIRNAME/.config -> $LINUXDIRNAME/.config.original" 1>&2 42 mv "$LINUXDIRNAME/.config" "$LINUXDIRNAME/.config.original" 43 fi 44 fi 45 46 echo "uml-linux-build.config -> $LINUXDIRNAME/.config" 47 cp "$THISDIR/uml-linux-build.config" "$LINUXDIRNAME/.config" 48 fi 49 50 # Enter the unpacked directory and build. 51 cd "$LINUXDIRNAME" 52 53 #echo "Patching hostaudio for SDL..." 54 #patch -p0 < ../patches/hostaudio_kern.c.diff 55 56 echo "Building..." 1>&2 57 make ARCH=um 58 59 # Mount the root filesystem and install the modules. 60 echo "Making the modules..." 1>&2 61 make modules ARCH=um 62 63 echo "Installing the modules..." 1>&2 64 make modules_install INSTALL_MOD_PATH="$PACKAGEROOT" ARCH=um 65 cd .. 66 fi 67 68 # Now get the executable and remove the build directory. 69 if [ ! -e linux ]; then 70 mv "$LINUXDIRNAME/linux" . 71 fi 72 73 if [ -e linux ]; then 74 echo "To remove the Linux kernel sources, do this:" 1>&2 75 echo "rm -rf '$LINUXDIRNAME'" 1>&2 76 fi