#!/bin/sh #(c)2004 Barry Kauler, www.goosee.com/puppy #First script to create Puppy Linux image.gz #createpuppy0 is for compiling and installing all sources #in sources0/ folder, to Puppy. #There is a skeleton filesystem for Puppy, called rootfs-skeleton/ #and this is used as the basis for the final filesystem, #called rootfs-complete/. #Files, folders needed by this script (all in same directory): #Folders: rootfs-skeleton/ sources0/ modules/ #Files: busybox.links createpuppy0 #This script will look to see if rootfs-complete/ exists, #if not, will copy rootfs-skeleton/ to create it. PUPPYDIR="`pwd`" #/root/puppy SOURCESDIR="$PUPPYDIR/sources0" DESTDIR="$PUPPYDIR/rootfs-complete" FSSIZE=`cat $PUPPYDIR/rootfs-skeleton/root0/.etc/ramdisksize` echo "Files failed to strip:" > $SOURCESDIR/logstriperr.txt binstripfunc() { #param passed in is full path and filename, no wildchars allowed. #note, do not put quotes around the $1, fails if asterisks if [ ! -h $1 ];then #-h test if symbolic link. strip --strip-unneeded $1 > /dev/null 2>&1 if [ ! $? -eq 0 ];then echo "$1" >> $SOURCESDIR/logstriperr.txt fi fi } libstripfunc() { #param passed in is full path and filename, no wildchars allowed. #note, do not put quotes around the $1, fails if asterisks #WARNING: do not strip all symbols, as this script strips some #lib files at their source, in the host system. if [ ! -h $1 ];then #-h test if symbolic link. strip --strip-debug $1 > /dev/null 2>&1 if [ ! $? -eq 0 ];then echo "$1" >> $SOURCESDIR/logstriperr.txt fi fi } check_status() { /bin/echo -en "\\033[65G" if [ $1 -eq 0 ] then /bin/echo -en "\\033[1;32mdone" else /bin/echo -en "\\033[1;31mfailed" FLAGFAILED=1 fi /bin/echo -e "\\033[0;39m" } skip_key() { if [ "$FIRSTTIME" = "yes" ];then echo -n "Press ENTER to continue (and compile/install $1): " read mmm nnn="y" else echo -en "To compile/install $1, press \"y\", else \"ENTER\" to skip: " read nnn fi } #the sources packages are in sources0/ folder. #the built binaries go into rootfs-complete/ folder. echo echo "This script compiles the sources in $PUPPYDIR/sources0" echo "and installs them in $DESTDIR" echo "This script is also capable of generating a complete image.gz" echo "file, which is a working Puppy. The sources in sources0/ are" echo "selected to build a simple commandline-only Puppy, no X." echo echo "Note, you should be logged in as root before running this script." echo "Note, paths or filenames with spaces will cause a malfunction!" echo echo -e "Would you like to cleanup sources0/ folder by running \"make clean\"" echo -e "or \"make distclean\" in all the packages? This will remove all the" echo "configuration and compiled files. You probably only want to do this" echo "if you want to make everything into a tarball for distribution, or" echo " you need to save space on the drive." echo -e "This script will cleanup then exit if you choose \"y\"." echo -ne "Press \"y\" to clean sources0/, anything else not to: " read mmm if [ "$mmm" = "y" ];then echo "Please wait..." cd $PUPPYDIR/sources0/ncurses-5.3 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/busybox-0.60.5 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/tinylogin-1.4 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/autologin rm -f autologinroot rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/modutils-2.4.25 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/umsdos-1.32 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/iptables-1.2.9 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/cramfs-1.1 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/setserial-2.14 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/popt-1.7 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/bbc-provided/files rm -f and &>/dev/null rm -f or &>/dev/null rm -f dotquad &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/ipcalc rm -f ipcalc &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/psmisc-21.4 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/libbadpenguin-1.1.1 make uninstall &>/dev/null make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/libhardware-0.7.4 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/bcrypt-1.1 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/dhcpcd-1.3.22-pl4 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/eject-2.0.13 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/libdaemon-0.6 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/ifplugd-0.25 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/mp-3.3.7 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/picocom-1.2 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/pciutils-2.1.11 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/hdparm-5.3 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/syslinux-2.11 #08 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/wavplay-1.4 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/disktype-6 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/kbd-1.08 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/setvol-1.1 rm -f setvol &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/e2fsprogs-1.34 cd build make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/dialog-0.9b-20031207 make distclean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR/sources0/ppp-2.4.1 make clean &>/dev/null rm -f log*.txt &>/dev/null cd $PUPPYDIR sync echo "...done. Exiting script." exit fi if [ ! -d $DESTDIR ];then echo echo "Please be sure that your distro has the important development packages" echo "installed (see noted below) -- but do not blindly install everything!." echo "You will need the gcc/c++/perl programming devel packages." echo "-- at installation of the distro, Mandrake offers to install most of" echo "what you need for a development environment." echo "Check that the ncurses rpm is installed, and that the termcap rpm is NOT" echo "-- but, no need for ncurses devel rpm as this script runs rampant over" echo "existing installation and compiles/installs from source." echo "(do not uninstall existing ncurses package as it has too many dependencies)." echo "Also do NOT install the slang dev package." echo "Check that Xaw3d devel package is installed." echo "Check that cdrecord (also called cdrtools) devel package is installed." echo "Check that cdparanoia package is installed." echo "UNINSTALL the ghostscript package!!! I know this is radical, and you will" echo "lose some important dependent packages like OpenOffice, but script" echo "createpuppy3 compiles and installs ghostscript from source tarball, and" echo "installing over an existing ghostscript installation causes grief." echo "UNINSTALL the imagemagick package (it will probably be gone anyway when" echo "you uninstalled ghostscript!)" echo "UNINSTALL pstoedit package, if it is installed." echo "UNINSTALL libemf package, if it is installed." echo "Check that libwmf package is installed." echo "Check that glade package is installed, but NOT glade2 package." echo "Check that libglade0 devel package is installed, but NOT libglade2 package." echo "Check that sane-backends package is installed." echo "Check that libsane1-devel package is installed." echo "For compiling Abiword, check libwmf-devel package is installed." echo "Check that zip package is installed." echo "Check that libmng-devel package is installed." echo "UNINSTALL: Check that libnspr-devel is NOT installed." echo "Check that libmysql12-devel package is installed (needed by Gequel)." echo "Check that tcl, tk, tix packages are installed." echo echo "AFTER installing/removing packages, continue this script..." echo -n "Press ENTER key only to continue, anything else to exit: " read mmm if [ "$mmm" ];then exit fi fi if [ ! -d $DESTDIR ];then echo echo "You must be running this script on a Linux distro" echo "based on a 2.4.x series Linux kernel, NOT a 2.6.x series." echo echo "Also, the host system must have the same version of kernel as used" echo "in Puppy (v2.4.22 for the 0.8.x Puppy series, but do verify, as" echo "I plan to upgrade Puppy to the 2.4.27 kernel soon)." echo "Also, you must have the full kernel source installed in the host." echo "This script expects the kernel source to be at" echo "/usr/src/linux (create a symlink linux -> linux-2.4.xx if necessary)." echo echo -n "Press ENTER to continue: " read vvv echo echo "Also, if you want to change any modules or recompile the kernel," echo "you MUST do it on the host so that the host kernel is exactly the" echo -e "same as that to be used in Puppy. This is because the \"updatemodules.sh\"" echo "script copies modules from the host system for use in Puppy." echo "To find out how to compile the kernel, go to the Puppy web" echo "site www.goosee.com/puppy and you will find a page that" echo "explains this." echo "The same folder in which you find this script also has a" echo "file called kernel-config-xxx, where the xxx is a date." echo "this is the configuration file for compiling the kernel." echo "(note, you can use any 2.4 version, as long as you run updatemodules.sh" echo " so that Puppy is using the exact same kernel and modules)" echo " " echo "IF YOU DO NOT HAVE THE CORRECT KERNEL VERSION, QUIT THIS SCRIPT NOW." echo "IF YOU DO NOT HAVE THE KERNEL SOURCE in /usr/src/linux, QUIT NOW." echo -ne "Press \"y\" key to continue, anything else to quit: " read vvv if [ ! "$vvv" = "y" ];then exit fi echo echo "This script is for building a basic commandline-only Puppy," echo "however sources1/ will build a basic X graphics Puppy and it is" echo "wise if you are sure right now that your host Linux system has" echo "the right version of Xfree..." echo "The host must have Xfree v4.3.0 installed, but v4.2.x may work," echo "and /usr/X11R6/lib/X11/config/ folder must exist." if [ ! -d /usr/X11R6/lib/X11/config ];then echo echo "WHAT! /usr/X11R6/lib/X11/config directory does not exist." echo "You should really quit this script now." echo "You should choose a distro that has Xfree v4.3.0 and make sure" echo -e "that the \"development\" Xfree rpm/deb/tgz package is installed." echo -ne "Press ENTER to quit, \"y\" to continue: " read vvv if [ ! "$vvv" = "y" ];then exit fi else echo "...ok, it does." fi echo echo "Checking if nasm installed..." which nasm if [ ! $? -eq 0 ];then echo echo -e "Some of the packages used in Puppy require \"nasm\" to compile." echo "The host distro does not have nasm installed. Please rectify." echo echo "Cannot continue this script." echo -n "Press ENTER to quit: " read vvv exit else echo "...ok" fi fi #echo #echo "Puppy does not use gpm, the console mouse daemon." #echo "Mandrake 9.0 and 9.2 have it running by default and certain apps are" #echo "compiled with dependency on libgpm.so. I do not want to uninstall gpm" #echo "in the host, but I do want to cripple it so apps we compile for Puppy" #echo "cannot find it when they are configured." #echo "Renaming the libgpm.so* files in /usr/lib..." # mkdir /root/DISABLEDGPM &>/dev/null # FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libgpm.so* | tr "\n" " "`" # for SRC2FILE in $FILESLST # do # mv $SRC2FILE /root/DISABLEDGPM/ # echo "...have moved $SRC2FILE to /root/DISABLEDGPM/" # done #echo #echo "WARNING WARNING WARNING" #echo "WHEN YOU HAVE FINISHED RUNNING THESE SCRIPTS, YOU HAVE TO MANUALLY" #echo "DRAG THE libgpm.so* FILES BACK TO /usr/lib -- DO NOT FORGET!" if [ ! -d $DESTDIR ];then FIRSTTIME="yes" echo echo "This is the first time that you are running this script." echo "Please be sure to follow instructions exactly." echo -en "If you see a red " echo -en "\\033[1;31mfailed" echo -en "\\033[0;39m" echo " message, you may have to abort" echo "the script with CTRL-C and find out why." echo "(or, you may wish to make a note of the file that failed to" echo " compile and just keep going with the script)" echo "(note, the script may have found a default file from the host," echo " so that failed file may already be in rootfs-complete)" fi if [ "$FIRSTTIME" = "yes" ];then echo echo -en "Press ENTER to continue: " read mmm nnn="y" else echo echo "As this is not the first time running this script, folder" echo "$DESTDIR is already existing." echo "Do you want to rebuild everything in rootfs-complete from" echo -en "scratch? (\"y\" or just press ENTER only for no): " read nnn if [ "$nnn" ];then echo echo "Removing existing rootfs-complete/ folder..." FIRSTTIME="yes" cd $PUPPYDIR rm -fr rootfs-complete sync fi fi if [ "$FIRSTTIME" = "yes" ];then echo echo "Creating rootfs-complete/, from rootfs-skeleton/ ..." cd $PUPPYDIR cp -a rootfs-skeleton rootfs-complete sync fi if [ "$FIRSTTIME" = "yes" ];then echo echo "Apps for Puppy are going to be compiled in the host Linux system," echo "so are using library files from the host." echo "We will also need to copy the basic shared library files into Puppy." echo "We need to populate /lib and /usr/lib in Puppy." echo echo "Filling rootfs-complete/lib..." for SRCFILE in ld-*.so* ld-linux.so* libanl*.so* libBrokenLocale*.so* libc.so* libc-*.so libcrypt-*.so* libcrypt.so* libdl*.so* libgcc_s*.so* libm.so* libm-*.so libncurses*.so* libnsl*.so* libnss_compat*.so* libnss_dns*.so* libnss_files*.so* libnss_hesiod*.so* libnss_nis*.so* libnss_nisplus*.so* libpcre.so* libpcprofile*.so* libpthread*.so* libresolv*.so* librt*.so* libSegFault.so libthread_db*.so* libutil*.so* libz.so* do FILESLST="`find /lib -maxdepth 1 -mount -xtype f -name $SRCFILE | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -af $SRC2FILE $DESTDIR/lib/ &>/dev/null sync done done echo echo "Filling rootfs-complete/usr/lib..." #no, compiling c++ apps uses this lib anyway, no need for this link... #echo #echo "Before continuing, would you check and create if necessary, a link" #echo "in /usr/lib libstdc++.so linked to libstdc++.so.5.xxx" #echo "For Mandrake 9.2 this should be:" #echo "# ln -s libstdc++.so.5.0.5 /usr/lib/libstdc++.so" #echo #echo -n "AFTER checking that, press ENTER to continue: " #read wwww #echo for SRCFILE in libbz2*.so* libcrypto*.so* libdb.so* libdb1.so* libexpat*.so* libfontconfig*.so* libgthread-*.so* libgthread.so libid3tag*.so* libieee1284*.so* libm.so libm-*.so libmsgevents*.so* libnsl.so libresolv.so libpcre*.so* libpthread.so libssl.so* libstdc++.so.5* libstdc++.so libthread_db.so libusb*.so* libutil.so libxml2*.so* libz.so do FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name $SRCFILE | tr "\n" " "`" for SRC2FILE in $FILESLST do libstripfunc "$SRC2FILE" #WARNING! WARNING! sync cp -af $SRC2FILE $DESTDIR/usr/lib/ &>/dev/null sync done done fi echo echo "Ok, we have a basic rootfs-complete/ folder, with" echo "the Puppy skeleton filesystem from rootfs-skeleton/." echo echo "Now the script is going to compile/install specific" echo "packages." echo echo -n "Press ENTER key to continue: " read vvv if [ "$FIRSTTIME" = "yes" ];then echo echo "First time, so will be doing every step of this script..." echo "note that each step may generate logconfig.txt, logbuild.txt," echo "loginstall.txt in the package folder, which are logs of" echo "stdout and errout for configuring, compiling, and installing." else echo echo "Not the first time running this script, so rootfs-complete" echo -e "folder has been built, and you only need to choose \"y\" " echo "for any section below if you want to re-compile/install it." fi if [ "$FIRSTTIME" = "yes" ];then echo echo "Looking at dependencies for /lib/libncurses.so..." ldd /lib/libncurses.so echo "And /usr/lib/libncurses.so..." ldd /usr/lib/libncurses.so echo echo "If libncurses.so does not exist, the installation of ncurses is broken." echo "If you see libgpm as a dependency, this is a problem for Puppy." echo "For either of these situations, you MUST compile and install ncurses" echo "from this script, which will overwrite the host installation (and maybe" echo "compromise the hosts package management)." echo echo "PLEASE ONLY DO THIS ONCE FOR YOUR HOST!!!" echo -en "Press \"y\" to compile and install libncurses to host, else just ENTER: " read vvv if [ "$vvv" ];then cd $PUPPYDIR/sources0/ncurses-5.3 echo "This may take awhile..." make uninstall &>/dev/null make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/lib --build=i486-pc-linux-gnu --with-shared --without-gpm &>logconfig.txt make &>logbuild.txt sync if [ -f lib/libncurses.a ];then echo "Removing old libs and relinking to /lib/libncurses.so.5.3..." FILESLST="`find /lib -maxdepth 1 -mount -xtype f -name libncurses*.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do rm -f $SRC2FILE &>/dev/null sync ln -s libncurses.so.5.3 $SRC2FILE done FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libncurses*.so* | tr "\n" " "`" for SRC2FILE in $FILESLST do rm -f $SRC2FILE &>/dev/null sync ln -s /lib/libncurses.so.5.3 $SRC2FILE done rm -f /lib/libncurses.a &>/dev/null rm -f /usr/lib/libncurses.a &>/dev/null echo "Now installing to host..." make install &>loginstall.txt ls /lib/libncurses.so.5.3;check_status $? else echo echo "FAILED TO COMPILE." echo "YOU NEED TO FIND OUT WHAT IS WRONG AND RERUN THIS SCRIPT." echo -n "Press ENTER to exit: " read vvv exit fi fi fi echo "Does not compile here, just copies extra ncurses stuff to Puppy..." skip_key ncurses if [ "$nnn" ];then echo "libncurses already copied to Puppy above." echo "With Puppy v0.9.3 introduced WISH mini-console, which says that it" echo "needs /usr/bin/tic, which is part of the ncurses package." echo "So copying that to Puppy now..." cp -fv /usr/bin/tic $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/tic" fi echo skip_key busybox if [ "$nnn" ];then echo "Compiling and installing busybox package..." echo "Note that this uses the file $PUPPYDIR/busybox.links" echo "Note, also, some apps provided by Busybox, I have left enabled" echo "in the config file, but they are not actually used in Puppy, as" echo "I found them to be inadequate. Full replacements are got from" echo "either the Linux host system or compiled further down this script." echo "Full replacements are: date, find, gunzip, gzip, modprobe +other" echo " apps in modutils package, sed, tar, wget." echo "I have retained losetup, however also installing the full version" echo "from util-linux package below, renaming it to losetup-FULL." echo "Also removed grep and egrep, installing full version," echo "see further down this script." cd $PUPPYDIR/sources0/busybox-0.60.5 make clean &>/dev/null make &>logbuild.txt cp -fv busybox $DESTDIR/bin/;check_status $? sync binstripfunc "$DESTDIR/bin/busybox" echo "Now to find out which (links) are in Busybox..." BBOXLINKS="`cat $PUPPYDIR/busybox.links`" for NXTLINK in $BBOXLINKS do ln -sfv /bin/busybox ${DESTDIR}${NXTLINK} >/dev/null #;check_status $? done echo "...made the links." fi echo echo 'note, for Puppy v0.9.3 I changed the location of "free", "tr", "cut", "head",' echo '"tail", "expr" from /usr/bin to /bin,' echo 'and "chroot" from /usr/sbin to /sbin' echo 'as it is needed by rc.sysinit before /usr is mounted (see busybox.links).' echo 'chroot is needed by /sbin/init.' echo 'For Puppy v0.9.5 I changed "du" from /usr/bin to /bin, as rc.sysinit needs it.' echo 'Also...' #see earlier relocations below... echo echo "The /usr folder in Puppy is not immediately available when" echo -e "Puppy boots, so need to move \"[\" from /usr/bin to /bin." echo -e "Note that Busybox has \"[\" however I am getting it from the" echo -e "host system, where it is a link to \"test\"..." skip_key test if [ "$nnn" ];then cp -afv /usr/bin/[ $DESTDIR/bin/;check_status $? cp -afv /usr/bin/test $DESTDIR/bin/;check_status $? sync binstripfunc "$DESTDIR/bin/test" fi echo echo "Now we need to put some of the full-time replacements for Busybox" echo "apps into Puppy, that we will get from the host Linux system..." echo "Note, getting awk and gawk out of host here also, though they aren't" echo "in this version of Busybox." # NOTE pup0.9.8 using new findutils (has find) in sources11 folder. skip_key full_busybox_replacements if [ "$nnn" ];then echo "Copying awk date find gawk gunzip gzip sed tar..." for SRCFILE in awk date find gawk gunzip gzip sed tar do FNDFILE="`which $SRCFILE 2>/dev/null`" if [ ! "$FNDFILE" = "" ];then cp -afv $FNDFILE $DESTDIR/bin/;check_status $? sync binstripfunc "$DESTDIR/bin/$SRCFILE" else echo "Error, cannot find $SRCFILE";check_status 1 fi done echo "Copying wget..." for SRCFILE in wget do FNDFILE="`which $SRCFILE 2>/dev/null`" if [ ! "$FNDFILE" = "" ];then cp -afv $FNDFILE $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/$SRCFILE" else echo "Error, cannot find $SRCFILE";check_status 1 fi done fi echo skip_key tinylogin if [ "$nnn" ];then echo "Compiling and installing tinylogin..." #note, uses libcrypt.so, from host. cd $PUPPYDIR/sources0/tinylogin-1.4 make clean &>/dev/null make &>logbuild.txt cp -afv tinylogin $DESTDIR/bin/;check_status $? sync binstripfunc "$DESTDIR/bin/tinylogin" #Some of these overwrite above copied from host... for SRCFILE in /bin/addgroup /bin/adduser /bin/delgroup /bin/deluser /bin/login /bin/su /sbin/getty /sbin/sulogin /usr/bin/passwd /usr/bin/vlock do ln -sf /bin/tinylogin ${DESTDIR}${SRCFILE} &>/dev/null done fi echo skip_key autologin if [ "$nnn" ];then echo "Compiling and installing autologin..." cd $PUPPYDIR/sources0/autologin rm -f autologinroot gcc -o autologinroot autologinroot.c &>logbuild.txt cp -fv autologinroot $DESTDIR/bin/;check_status $? sync binstripfunc "$DESTDIR/bin/autologinroot" fi echo echo "For Mandrake 9.0, I just copied the modprobe apps out of the host," echo "however Mandrake 9.2 is more complicated, with different versions of" echo "the apps. Maybe this is because of readiness for the 2.6 kernel?" echo "Whatever, I decided to compile modutils package myself..." skip_key modutils if [ "$nnn" ];then #note, may already be written above. # echo "Installing modutils. Assuming already in host..." # cp -afv "`which depmod 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which genksyms 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which modinfo 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which insmod 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which rmmod 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which modprobe 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which lsmod 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which ksyms 2>/dev/null`" $DESTDIR/sbin/;check_status $? # cp -afv "`which kallsyms 2>/dev/null`" $DESTDIR/sbin/;check_status $? cd $PUPPYDIR/sources0/modutils-2.4.25 make distclean &>/dev/null ./configure --bindir=/bin --sbindir=/sbin --sysconfdir=/etc --localstatedir=/var --enable-combined --enable-zlib --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt #fixes above install, some were peculiar links... rm -f $DESTDIR/sbin/insmod rm -f $DESTDIR/sbin/rmmod rm -f $DESTDIR/sbin/modprobe rm -f $DESTDIR/sbin/lsmod rm -f $DESTDIR/sbin/ksyms rm -f $DESTDIR/sbin/kallsyms rm -f $DESTDIR/sbin/depmod rm -f $DESTDIR/sbin/genksyms sync cp -afv insmod/insmod $DESTDIR/sbin/;check_status $? cp -afv insmod/rmmod $DESTDIR/sbin/;check_status $? cp -afv insmod/modprobe $DESTDIR/sbin/;check_status $? cp -afv insmod/lsmod $DESTDIR/sbin/;check_status $? cp -afv insmod/ksyms $DESTDIR/sbin/;check_status $? cp -afv insmod/kallsyms $DESTDIR/sbin/;check_status $? cp -afv depmod/depmod $DESTDIR/sbin/;check_status $? cp -afv genksyms/genksyms $DESTDIR/sbin/;check_status $? sync #the others are links. binstripfunc "$DESTDIR/sbin/depmod" binstripfunc "$DESTDIR/sbin/genksyms" binstripfunc "$DESTDIR/sbin/insmod" fi echo " " echo "THE KERNEL SOURCE MUST BE IN /usr/src/linux TO COMPILE umsdos!" echo "NOTE: will not compile in Mandrake 9.2 (9.0 is ok) ...darn." echo "I cannot understand the error message. Never mind, I want to phase" echo "out Puppys use of umsdos anyway, this gives me some incentive!" echo "Try your luck..." skip_key umsdos if [ "$nnn" ];then echo "Compiling and installing umsdos package..." echo "Note, the host should have the same kernel as used in Puppy." cd $PUPPYDIR/sources0/umsdos-1.32 make clean &>/dev/null make all &>logbuild.txt cp -afv util/udosctl $DESTDIR/sbin/;check_status $? cp -afv util/umssetup $DESTDIR/sbin/;check_status $? cp -afv util/umssync $DESTDIR/sbin/;check_status $? if [ $FLAGFAILED -eq 1 ];then echo echo "Drat, it failed. Compiles on Slackware 9.1 ok, so fallback is to use" echo "the binary compiled on Slack. Slack 9.1 also has kernel 2.4.22 so should" echo "be ok..." cp -afv $PUPPYDIR/sources0/umssync $DESTDIR/sbin/;check_status $? ln -s umssync $DESTDIR/sbin/udosctl ln -s umssync $DESTDIR/sbin/umssetup fi sync #binstripfunc "$DESTDIR/sbin/udosctl" #binstripfunc "$DESTDIR/sbin/umssetup" binstripfunc "$DESTDIR/sbin/umssync" fi echo echo "THE KERNEL SOURCE MUST BE IN /usr/src/linux TO COMPILE iptables!" skip_key iptables if [ "$nnn" ];then echo "Compiling and installing iptables package..." echo "Note, edited Makefile to turn off ipv6." cd $PUPPYDIR/sources0/iptables-1.2.9 make clean &>/dev/null make &>logbuild.txt cp -fv iptables $DESTDIR/usr/sbin/;check_status $? cp -fv iptables-save $DESTDIR/usr/sbin/;check_status $? cp -fv iptables-restore $DESTDIR/usr/sbin/;check_status $? cd extensions for SRCFILE in libipt_DNAT.so libipt_DSCP.so libipt_ECN.so libipt_LOG.so libipt_MARK.so libipt_MASQUERADE.so libipt_MIRROR.so libipt_REDIRECT.so libipt_REJECT.so libipt_SAME.so libipt_SNAT.so libipt_TCPMSS.so libipt_TOS.so libipt_TTL.so libipt_ULOG.so libipt_ah.so libipt_dscp.so libipt_esp.so libipt_icmp.so libipt_iprange.so libipt_length.so libipt_limit.so libipt_mac.so libipt_mark.so libipt_multiport.so libipt_owner.so libipt_standard.so libipt_state.so libipt_tcp.so libipt_tcpmss.so libipt_tos.so libipt_ttl.so libipt_udp.so libipt_unclean.so do cp -afv $SRCFILE $DESTDIR/usr/lib/iptables/;check_status $? sync libstripfunc "$DESTDIR/usr/lib/iptables/$SRCFILE" done fi echo " " skip_key cramfs if [ "$nnn" ];then echo "Compiling and installing cramfs package..." cd $PUPPYDIR/sources0/cramfs-1.1 make clean &>/dev/null make &>logbuild.txt cp -fv mkcramfs $DESTDIR/usr/bin/;check_status $? cp -fv cramfsck $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/mkcramfs" binstripfunc "$DESTDIR/usr/bin/cramfsck" fi echo skip_key util-linux if [ "$nnn" ];then echo "Installing util-linux. Assuming already in host..." echo "Note, much of util-linux is already in Busybox." echo "Note, renaming losetup to losetup-FULL, as still using Busybox" echo "version of losetup." cp -afv "`which losetup 2>/dev/null`" $DESTDIR/bin/losetup-FULL;check_status $? cp -afv "`which fsck.minix 2>/dev/null`" $DESTDIR/sbin/;check_status $? cp -afv "`which mkfs 2>/dev/null`" $DESTDIR/sbin/;check_status $? cp -afv "`which mkfs.minix 2>/dev/null`" $DESTDIR/sbin/;check_status $? #note, Mandrake doesn't have mkfs.cramfs, but have it above, as mkcramfs... cp -afv "`which mkfs.cramfs 2>/dev/null`" $DESTDIR/sbin/;check_status $? cp -afv "`which mkswap 2>/dev/null`" $DESTDIR/sbin/;check_status $? cp -afv "`which hwclock 2>/dev/null`" $DESTDIR/usr/sbin/;check_status $? cp -afv "`which rdev 2>/dev/null`" $DESTDIR/usr/sbin/;check_status $? cp -afv "`which fdisk 2>/dev/null`" $DESTDIR/sbin/;check_status $? cp -afv "`which fdformat 2>/dev/null`" $DESTDIR/usr/bin/;check_status $? cp -afv "`which umount 2>/dev/null`" $DESTDIR/bin/umount-FULL;check_status $? sync binstripfunc "$DESTDIR/bin/losetup" binstripfunc "$DESTDIR/sbin/fsck.minix" binstripfunc "$DESTDIR/sbin/mkfs" binstripfunc "$DESTDIR/sbin/mkfs.minix" binstripfunc "$DESTDIR/sbin/mkfs.cramfs" binstripfunc "$DESTDIR/sbin/mkswap" binstripfunc "$DESTDIR/usr/sbin/hwclock" binstripfunc "$DESTDIR/usr/sbin/rdev" binstripfunc "$DESTDIR/sbin/fdisk" binstripfunc "$DESTDIR/usr/bin/fdformat" binstripfunc "$DESTDIR/bin/umount" fi echo skip_key e2fsprogs if [ "$nnn" ];then echo "Although these apps are undoubtedly in the host, they may have" echo "various shared libraries depending on compile options." echo "So, compiling e2fsprogs..." #echo "Note, v1.35, have applied ext2online patch, for resizing while mounted." #NOTE 098: v1.35 is patched to support e2compr, see sources11 folder. #NOTE 098: v1.35, also have --enable-fsck NOTE: compression support enabled by default. cd $PUPPYDIR/sources0/e2fsprogs-1.34 cd build make distclean &>/dev/null ../configure --disable-evms --disable-debugfs --disable-imager --disable-nls --enable-dynamic-e2fsck --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt ln -sf e2fsck $DESTDIR/sbin/fsck.ext2 ln -sf e2fsck $DESTDIR/sbin/fsck.ext3 cp -afv e2fsck/e2fsck $DESTDIR/sbin/;check_status $? cp -afv misc/fsck $DESTDIR/sbin/;check_status $? ln -sf mke2fs $DESTDIR/sbin/mkfs.ext2 ln -sf mke2fs $DESTDIR/sbin/mkfs.ext3 cp -afv misc/mke2fs $DESTDIR/sbin/;check_status $? cp -afv resize/resize2fs $DESTDIR/sbin/;check_status $? cp -afv resize/test_extent $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/e2fsck" binstripfunc "$DESTDIR/sbin/fsck" binstripfunc "$DESTDIR/sbin/mke2fs" binstripfunc "$DESTDIR/sbin/resize2fs" binstripfunc "$DESTDIR/sbin/test_extent" #echo "Also copying mke2fs to $PUPPYDIR, used when creating image.gz..." #cp -f $DESTDIR/sbin/mke2fs $PUPPYDIR/;check_status $? fi echo " " skip_key setserial if [ "$nnn" ];then echo "Compiling and installing setserial package..." cd $PUPPYDIR/sources0/setserial-2.14 make distclean &>/dev/null ./configure --prefix=/ --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv setserial $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/setserial" fi echo skip_key dosfstools if [ "$nnn" ];then echo "Installing dosfstools. Assuming already in host..." ln -sf mkdosfs $DESTDIR/sbin/mkfs.msdos cp -afv "`which mkdosfs 2>/dev/null`" $DESTDIR/sbin/;check_status $? ln -sf dosfsck $DESTDIR/sbin/fsck.msdos cp -afv "`which dosfsck 2>/dev/null`" $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/mkdosfs" binstripfunc "$DESTDIR/sbin/dosfsck" fi echo " " skip_key popt if [ "$nnn" ];then echo "Compiling and installing popt package..." echo "note, needed by Gphone package and by ipcalc package." cd $PUPPYDIR/sources0/popt-1.7 make uninstall &>/dev/null make distclean &>/dev/null ./configure --prefix=/usr --disable-nls --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt #...need to install libpopt.a/.so, used by gphone. #ls /usr/lib/libpopt.a;check_status $? #ah, gphone uses shared libpopt.so... cp -afv /usr/lib/libpopt.so $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libpopt.so.0 $DESTDIR/usr/lib/;check_status $? cp -afv /usr/lib/libpopt.so.0.0.0 $DESTDIR/usr/lib/;check_status $? sync libstripfunc "$DESTDIR/usr/lib/libpopt.so.0.0.0" fi echo " " skip_key bbc-provided if [ "$nnn" ];then echo "Compiling and installing bbc-provided package..." cd $PUPPYDIR/sources0/bbc-provided/files rm -f and &>/dev/null rm -f or &>/dev/null rm -f dotquad &>/dev/null gcc -Wall -O2 -s -o and andor.c -DAND &>/dev/null gcc -Wall -O2 -s -o or andor.c -DOR &>/dev/null gcc -Wall -O2 -s -o dotquad dotquad.c &>/dev/null cp -fv and $DESTDIR/usr/bin/;check_status $? cp -fv or $DESTDIR/usr/bin/;check_status $? cp -fv dotquad $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/and" binstripfunc "$DESTDIR/usr/bin/or" binstripfunc "$DESTDIR/usr/bin/dotquad" cd $PUPPYDIR/sources0/ipcalc rm -f ipcalc &>/dev/null gcc -Wall -O2 -s -o ipcalc ipcalc.c -lpopt &>logbuild.txt cp -fv ipcalc $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/ipcalc" fi echo " " skip_key psmisc if [ "$nnn" ];then echo "Compiling and installing psmisc package..." cd $PUPPYDIR/sources0/psmisc-21.4 make distclean &>/dev/null ./configure --prefix=/usr --disable-nls --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv src/fuser $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/fuser" fi echo " " #echo "WARNING: Tried to compile libbadpenguin on Mandrake 9.0," #echo "could not find libc.so. So, I created a link in /lib," #echo "linked libc.so to libc-2.2.5.so -- CHECK RIGHT NOW THAT" #echo "YOU HAVE link libc.so in /lib folder!" skip_key libbadpenguin if [ "$nnn" ];then echo "Compiling and installing libbadpenguin package..." cd $PUPPYDIR/sources0/libbadpenguin-1.1.1 make uninstall &>/dev/null make distclean &>/dev/null ./configure --prefix=/usr --disable-nls --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt echo "...have installed libbadpenguin.a into host, which will be" echo " used when compile libhardware." sync #do not copy this into Puppy!... ls /usr/lib/libbadpenguin.a;check_status $? fi echo " " skip_key libhardware if [ "$nnn" ];then echo "Compiling and installing libhardware package..." echo "note, needs libbadpenguin installed." cd $PUPPYDIR/sources0/libhardware-0.7.4 make distclean &>/dev/null ./configure --prefix=/ --datadir=/lib &>logconfig.txt make &>logbuild.txt cp -fv examples/test-cfdisk $DESTDIR/sbin/;check_status $? cp -fv examples/test-eide $DESTDIR/sbin/;check_status $? cp -fv examples/test-lib $DESTDIR/sbin/;check_status $? cp -fv examples/test-net $DESTDIR/sbin/;check_status $? cp -fv examples/test-pci $DESTDIR/sbin/;check_status $? cp -fv examples/test-scsi $DESTDIR/sbin/;check_status $? cp -fv tools/scanmodule $DESTDIR/sbin/;check_status $? cp -fv tools/probedisk $DESTDIR/sbin/;check_status $? cp -fv tools/probepart $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/test-cfdisk" binstripfunc "$DESTDIR/sbin/test-eide" binstripfunc "$DESTDIR/sbin/test-lib" binstripfunc "$DESTDIR/sbin/test-net" binstripfunc "$DESTDIR/sbin/test-pci" binstripfunc "$DESTDIR/sbin/test-scsi" binstripfunc "$DESTDIR/sbin/scanmodule" binstripfunc "$DESTDIR/sbin/probedisk" binstripfunc "$DESTDIR/sbin/probepart" echo echo "Have got feedback from the Forum, testing Puppy 0.9.0:" echo "Sometimes probepart doesn't work, but we have one compiled statically" echo "with dietlib by Antonio Gallo, that does work. Will now substitute that..." cp -fv $PUPPYDIR/sources0/probepart $DESTDIR/sbin/;check_status $? fi echo " " skip_key bcrypt if [ "$nnn" ];then echo "Compiling and installing bcrypt package..." cd $PUPPYDIR/sources0/bcrypt-1.1 make clean &>/dev/null make &>logbuild.txt cp -fv bcrypt $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/bcrypt" fi echo " " skip_key dhcpcd if [ "$nnn" ];then echo "Compiling and installing dhcpcd package..." cd $PUPPYDIR/sources0/dhcpcd-1.3.22-pl4 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv dhcpcd $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/dhcpcd" fi echo " " skip_key eject if [ "$nnn" ];then echo "Compiling and installing eject package..." cd $PUPPYDIR/sources0/eject-2.0.13 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --host=i486-pc-linux-gnu &>logconfig.txt make &>logbuild.txt cp -fv eject $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/eject" fi echo " " skip_key libdaemon if [ "$nnn" ];then echo "Compiling and installing libdaemon package..." echo "note, libdaemon is needed by ifplugd." cd $PUPPYDIR/sources0/libdaemon-0.6 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=i486-pc-linux-gnu --disable-doxygen --disable-lynx --disable-shared &>logconfig.txt make &>logbuild.txt make install &>loginstall.txt #do not install into Puppy!... ls /usr/lib/libdaemon.a;check_status $? sync fi echo " " skip_key ifplugd if [ "$nnn" ];then echo "Compiling and installing ifplugd package..." echo "note, libdaemon is needed by ifplugd." cd $PUPPYDIR/sources0/ifplugd-0.25 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-lynx --disable-xmltoman --disable-subversion &>logconfig.txt make &>logbuild.txt cp -fv src/ifstatus $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/ifstatus" fi echo " " #echo "mp (console editor) giving trouble compiling under Mandrake 9.0" #echo "-- can't find ncurses library. The curses installation is broken" #echo "-- curses to the guy responsible for that :-)" #echo "See fix notes at top of this script." #echo "Note, temp disable gpm now, as puppy doesn't use libgpm." skip_key mp if [ "$nnn" ];then echo "Compiling and installing mp package..." echo "Note, you might want to look at sources0/mp-3.3.7/logconfig.txt" echo "afterward, so see if found and tested ncurses ok." # echo "Disabling libgpm..." # mkdir /root/DISABLEDGPM &>/dev/null # FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libgpm.so* | tr "\n" " "`" # for SRC2FILE in $FILESLST # do # mv $SRC2FILE /root/DISABLEDGPM/ # echo "...have moved $SRC2FILE to /root/DISABLEDGPM/" # done cd $PUPPYDIR/sources0/mp-3.3.7 make distclean &>/dev/null ./config.sh --without-i18n --without-gtk &>logconfig.txt make &>logbuild.txt cp -fv mp $DESTDIR/usr/local/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/local/bin/mp" # echo "Now restoring libgpm..." # mv /root/DISABLEDGPM/* /usr/lib/ # sync # rmdir /root/DISABLEDGPM &>/dev/null fi echo " " skip_key picocom if [ "$nnn" ];then echo "Compiling and installing picocom package..." cd $PUPPYDIR/sources0/picocom-1.2 make clean &>/dev/null make &>logbuild.txt cp -fv picocom $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/picocom" fi echo " " skip_key pciutils if [ "$nnn" ];then echo "Compiling and installing pciutils package..." echo "note, lspci.c was edited." cd $PUPPYDIR/sources0/pciutils-2.1.11 make clean &>/dev/null make &>logbuild.txt cp -fv lspci $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/lspci" fi echo " " skip_key hdparm if [ "$nnn" ];then echo "Compiling and installing hdparm package..." cd $PUPPYDIR/sources0/hdparm-5.3 make clean &>/dev/null make &>logbuild.txt cp -fv hdparm $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/hdparm" fi echo " " skip_key syslinux if [ "$nnn" ];then echo "Compiling and installing syslinux package..." cd $PUPPYDIR/sources0/syslinux-2.11 #08 make clean &>/dev/null make installer &>logbuild.txt cp -fv syslinux $DESTDIR/usr/sbin/;check_status $? cp -fv isolinux.bin $DESTDIR/usr/sbin/;check_status $? cp -fv ldlinux.sys $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/syslinux" fi echo " " skip_key wavplay if [ "$nnn" ];then echo "Compiling and installing wavplay package..." cd $PUPPYDIR/sources0/wavplay-1.4 make clean &>/dev/null make no_x &>logbuild.txt cp -fv wavplay $DESTDIR/usr/local/bin/;check_status $? ln -sf wavplay $DESTDIR/usr/local/bin/wavrec sync binstripfunc "$DESTDIR/usr/local/bin/wavplay" fi echo " " skip_key disktype if [ "$nnn" ];then echo "Compiling and installing disktype package..." cd $PUPPYDIR/sources0/disktype-6 make clean &>/dev/null make &>logbuild.txt cp -fv disktype $DESTDIR/sbin/;check_status $? sync binstripfunc "$DESTDIR/sbin/disktype" fi echo skip_key kbd if [ "$nnn" ];then echo "Compiling and installing kbd package..." cd $PUPPYDIR/sources0/kbd-1.08 make distclean &>/dev/null #this actually configures datadir=/usr/share/kbd!... ./configure --prefix=/usr --datadir=/share/kbd --disable-nls &>logconfig.txt make &>logbuild.txt #rootfs-skeleton already has /usr/share/kbd stuff, just need... cp -fv src/loadkeys $DESTDIR/usr/sbin/;check_status $? cp -fv src/setfont $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/loadkeys" binstripfunc "$DESTDIR/usr/sbin/setfont" fi echo skip_key setvol if [ "$nnn" ];then echo "Compiling and installing setvol package..." cd $PUPPYDIR/sources0/setvol-1.1 rm -f setvol &>/dev/null gcc -o setvol setvol.c cp -fv setvol $DESTDIR/usr/bin/;check_status $? fi #echo #echo "For now, not compiling nor fully installing the gpm (console mouse)" #echo "package. Justing getting libgpm.so* out of the host." #skip_key gpm #if [ "$nnn" ];then # echo "Installing libgpm..." # echo "Note, this is not a proper installation, and when Puppy boots there" # echo "will be an error message, I think generated by libgpm.so, that cannot" # echo "find /dev/gpmctl -- this is created when gpm, the daemon program, is" # echo "running. Puppy hasn't got gpm. Some apps in the host, and some that" # echo "I am compiling see gpm installed in the host and so compile-in" # echo "support for gpm, at least they need the libgpm.so library to be" # echo "present. Without the gpm daemon, apps still work in Puppy, just no" # echo "console mouse support." # echo "Note, haven't investigated what is needed to install gpm properly." # FILESLST="`find / -maxdepth 3 -mount -xtype f -name libgpm.so* | tr "\n" " "`" # for SRC2FILE in $FILESLST # do # libstripfunc "$SRC2FILE" #WARNING! WARNING! # sync # cp -afv $SRC2FILE $DESTDIR/usr/lib/;check_status $? # sync # done #fi echo skip_key dialog if [ "$nnn" ];then echo "Compiling and installing dialog..." # echo "On Mandrake 9.0, dialog needs libncurses.so and libgpm.so, and it" # echo "wants /dev/gpmctl when I tried to use it (it still worked, but gave" # echo "error msg as no /dev/gpmctl, so ran without mouse support)." # echo "Note, dialog is awful, as stderr is shared with actual data out." # echo "I decided to compile dialog from source, without mouse support." # mkdir /root/DISABLEDGPM &>/dev/null # FILESLST="`find /usr/lib -maxdepth 1 -mount -xtype f -name libgpm.so* | tr "\n" " "`" # for SRC2FILE in $FILESLST # do # mv $SRC2FILE /root/DISABLEDGPM/ # echo "...have moved $SRC2FILE to /root/DISABLEDGPM/" # done cd $PUPPYDIR/sources0/dialog-0.9b-20031207 make distclean &>/dev/null ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --host=i486-pc-linux-gnu --disable-nls --with-ncurses --disable-rc-file &>logconfig.txt make &>logbuild.txt cp -afv dialog $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/dialog" # echo "Now restoring libgpm..." # mv /root/DISABLEDGPM/* /usr/lib/ # sync # rmdir /root/DISABLEDGPM &>/dev/null fi echo echo "ldd is part of glibc package. Note, in Mandrake ldd is a script." echo "getting it out of host system..." skip_key ldd if [ "$nnn" ];then echo "Installing ldd..." cp -afv "`which ldd 2>/dev/null`" $DESTDIR/usr/bin/;check_status $? sync binstripfunc "$DESTDIR/usr/bin/ldd" fi echo skip_key grep if [ "$nnn" ];then cd $DESTDIR/bin rm -f grep &>/dev/null #just in case old busybox symlinks are there. rm -f egrep &>/dev/null echo "get libpcre.so* out of /lib (careful, avoid links in /usr/lib)..." echo "...no, this is already done above." echo "Copy grep and egrep from host to Puppy..." cp -afv /bin/grep $DESTDIR/bin/;check_status $? cp -afv /bin/egrep $DESTDIR/bin/;check_status $? binstripfunc "$DESTDIR/bin/grep" #egrep is a script in Mandrake, just calls grep. fi echo echo "NOTE: have ppp package, which has the pppd daemon." echo "Err, Mandrake 9.2 hasn't got it. Probably needs the right rpm" echo "installed. Well, I'll ride roughshod over the rpm management system" echo "and install it myself... script will check here first though..." skip_key pppd if [ "$nnn" ];then echo "Compiling and installing pppd..." echo "Note, rp-pppoe needs pppd installed in host." FNDPPPD="`which pppd 2>/dev/null`" if [ "$FNDPPPD" = "" ];then echo "Host does not have pppd, so compiling it..." cd $PUPPYDIR/sources0/ppp-2.4.1 make uninstall &>/dev/null make clean &>/dev/null make &>logbuild.txt make install &>loginstall.txt else echo "...it is okay, host does have pppd. Copying it to Puppy..." fi for ONEFILE in chat pppdump pppd pppstats do cp -afv /usr/sbin/$ONEFILE $DESTDIR/usr/sbin/;check_status $? sync binstripfunc "$DESTDIR/usr/sbin/$ONEFILE" done fi #TO DO #ADD CODE FOR ext2resize package #nothing gets installed into Puppy, but ext2resize must be installed to host system. #Script createimagegz uses ext2prepare, which is from this package. ################## echo echo "Kernel modules are in $PUPPYDIR/modules folder." echo "note, they were created by the script updatemodules.sh." echo "PLEASE RUN updatemodules.sh BEFOREHAND IF ANY CHANGES TO MODULES" skip_key modules if [ "$nnn" ];then echo "Copy to Puppy filesystem $DESTDIR/lib/modules/2.4..." cp -a $PUPPYDIR/modules/2.4/* $DESTDIR/lib/modules/2.4/ sync #do not strip modules. fi echo echo "Ok, that is it for sources0 folder." echo -n "Press ENTER to continue: " read vvv ############ echo echo "This script has populated rootfs-complete/ folder, by grabbing" echo "files out of the host and from sources0/. This is intended to" echo "be enough to boot Puppy to the commandline." echo echo "To create files image.gz and usr_cram.fs from rootfs-complete/, run" echo "the script createimagegz." echo "Exiting this script now..." exit ############ #OLD STUFF ############ echo echo "Now the script will build image.gz. You don't have to build" echo "image.gz now, especially if you want to go ahead and compile" echo "and install apps from sources1,2,etc." echo -ne "Press ENTER to continue, \"n\" to exit script now: " read vvv if [ "$vvv" = "n" ];then exit fi echo "Copying rootfs-complete/ to rootfs-tmp1/..." cd $PUPPYDIR rm -fr rootfs-tmp1 2>/dev/null sync cp -af rootfs-complete rootfs-tmp1 sync echo "Converting rootfs-tmp1/usr/ folder to cramfs image file..." cd $PUPPYDIR/rootfs-tmp1 $PUPPYDIR/mkcramfs usr usr_cram.fs sync rm -f -r usr sync cd $PUPPYDIR rm -fr rootfs-tmp2 2>/dev/null sync mkdir rootfs-tmp2 echo "Making ext2 filesystem on rootfs-tmp2/, size $FSSIZE Kbytes..." dd if=/dev/zero of=image bs=1k count=$FSSIZE sync losetup /dev/loop0 image mke2fs -m 0 -b 1024 /dev/loop0 sync mount -t ext2 /dev/loop0 rootfs-tmp2 echo "Copying everything from rootfs-tmp1/ to rootfs-tmp2/..." cp -a rootfs-tmp1/* rootfs-tmp2/ sync echo "Creating compressed file image.gz..." umount rootfs-tmp2 losetup -d /dev/loop0 dd if=image | gzip -9 > image.gz sync rm -f image rm -fr rootfs-tmp1 rm -fr rootfs-tmp2 sync echo "image.gz created!" ####END####