Friday 24 September 2010

How to Post Code in Blog{er,spot}

This was a collossal pain in the arse to work out, but actually turned out to be quite easy to implement. Y'see when you post text to a blog post everything works fine. The problem is if you try to post code - html, linux command line stuff. You end up with lots of special characters that the site tries to render in HTML instead of just displaying. So instead of (for example) a line which shows the code to get coloured text, you just get the coloured text. Not helpful.

There are many and varied explanations of how to do this, but I prefer this way which is cobbled together from multiple sources. For my epic Amiga Linux project I needed to be able to display commands to type in AND the outputs of commands. I wanted to have those blocks distinct from each other and the surrounding text. This is what I eventually came up with.

Go to the Design tab, and choose the Edit HTML section. You get a text box which behaves much in the same way as the post editting box. Scroll down until you get to a line which says:

]]></b:skin>

Insert above that line the following text:

.postCode{
background:#eeeeee; 
border:1px solid #A6B0BF; 
font-size:120%; 
line-height:100%; 
overflow:auto; 
padding:10px; 
color:#000000
}
.postOutput{
background:#000000; 
border:1px solid #A6B0BF; 
font-size:120%; 
line-height:100%; 
overflow:auto; 
padding:10px; 
color:#eeeeee
}

My workflow is then to copy the text I am working on into some website or other which will automatically convert all the special characters to their escape codes.

Then I paste the resulting text into the blog editing window in HTML mode. I then switch to compose mode, and change all of the code or output text into quotes. I then switch back to the HTML mode, copy all of the HTML text and paste it into a text editor.

I then do a search and replace all "/blockquote" entries for "/pre" and then "blockquote" for "pre class="postCode"". That converts all of the quotes to the code class that I defined above. It is black text (the colour is 00 for all RGB) on a nearly white background (ee in all RGB - ff for all would be completely white).

I then sift through the post and check for any postCode classes that I need to change to postOutput. That is nearly white text on a black background, which gives good contrast between the two texts. If I do actually want to quote something I do it last.

I end up with the following tag regime for the two types of quoted code:

<pre class="postCode"> code </pre>
or
<pre class="postOutput"> output </pre>

Friday 17 September 2010

Wireless Networking on an Ubuntu LiveCD

I have two PCs which I regularly like to boot to a LiveCD environment. One is a Desktop machine with a Linksys WMP54GS wireless card, the other is a Compaq Mini 700 netbook. The linksys uses Broadcom's 4306 chipset and I think the netbook uses the 4312. I would like them both to work with a LiveCD. Neither of them work with a LiveCD. Using Ubuntu there is a simple solution for each machine. All you do is run (on the desktop):
sudo apt-get install b43-fwcutter
or on the netbook:
sudo apt-get install bcmwl-kernel-source
and the system will connected to Ubuntu's servers through the internet and will automatically download all the software it needs to configure your internet connection which lets you connect to Ubuntu's servers and ... hang on a fucking minute, I've spotted a flaw.

So how else do I solve this thorny little problem BEFORE the LiveCD gets an internet connection. There are two separate solutions - one for each machine. For the Desktop machine, I just need to load the firmware onto the running LiveCD system. The B43 driver is installed by Ubuntu as a kernel module. Using a different operating system (windows is fine for this because the USB Key is FAT32) I dump a copy of the b43 folder (which I have painstakingly explained how to get a hold of elsewhere) containing the firmware onto the USB Key. I can then run the following commands in the terminal (or ideally put them into an executable script on the USB Key).

sudo cp -r "/cdrom/b43" /lib/firmware/
sudo rmmod b43
sudo modprobe b43

What that does is copy the b43 folder from the USB Key (ubuntu mounts the LiveCD medium to /cdrom, no matter what it actually is) to the /lib/firmware directory. The next two commands remove and then reinstall the b43 module to activate the firmware. Wireless networks should now show up in Network Manager.

OK, second solution for the netbook, and a bit trickier. First of all, the above b43 based solution did work. Sometimes. Other times it would come up with error messages visible using [dmesg], and then refuse to work. It would also sometimes cause the interface to fail even when rebooting into a perfectly working installed operating system, resulting in the need to shut the whole thing down and take out its battery before trying again. So, not entirely reliable then. Lets use the proper driver.

First of all, we are going to want to build the driver from source code, so we must have the following packages built into the USB Key:

build-essential
linux-headers-generic

This means that you need to generate a custom LiveCD image. There is simply no point in following these instructions if you are using a vanilla LiveCD image.

Next we want to download the driver. I stuck the USB Key in a running version of Ubuntu and ran the following commands:

cd /media/2G
wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5.60.48.36.tar.gz 

My USB Stick is called [2G] so Ubuntu automounts it into a directory with the same name in [/media]. The next command downloads the latest version of the hybrid driver. I am not sure what a hybrid driver is, but if I had to guess I would say it is a driver AND firmware contained in the same package. Incidentally, you could just use the same URL in windows and save the file to the USB Key. You then reboot to the USB Key and run the following commands (ideally from a script):

cd /tmp
cp /cdrom/hybrid-portsrc-x86_32-v5.60.48.36.tar.gz .
mkdir hybrid_wl 
cd hybrid_wl 
tar -xzvf ../hybrid-portsrc-x86_32-v5.60.48.36.tar.gz 
make clean
make
sudo rmmod b43 
sudo rmmod b44 
sudo rmmod b43legacy
sudo rmmod wl
sudo rmmod ssb 
sudo rmmod ndiswrapper 
sudo rmmod lib80211
sudo modprobe lib80211
sudo insmod wl.ko

The [cp] commands [c]o[p]ys the file we downloaded into the current [.] directory, which is [/tmp] because we just moved into it.

There are lots of [r]e[m]ove [mod]ules commands, because there are so many modules which potentially interfere with the [wl] driver. Again, once this script has finished, the interface should be up and running. This one will take a little longer to run because it is building the module from source code each time.

Friday 10 September 2010

Building a Custom LiveCD for Ubuntu

There are many and varied reasons for running a LiveCD based operating system. In no particular order, you can use it on a PC without a hard disk, or more commonly with a malfunctioning hard disk. You can use it on a friends PC, taking all your applications with you. You can use it to do your online banking in a safe environment. You can use it to ... well you get the picture.

So how do you actually go about customising one? And why would you? Well the nice people at Canonical get to decide which of the MANY Ubuntu packages get to live on the LiveCD that you have downloaded. What if they exclude stuff that you want - support for video playback for instance, or the tools for compiling software from source? Of course, the easy option is to just boot the Ubuntu LiveCD and get networking up and running and off you go - you can download whatever other software you want. The trouble is that when you download software it gets stored in RAM which means a) you need to download it again next time which is a pain especially if you do not have internet available, and b) it uses up space in RAM.

So when you get to know what kind of packages you use on a LiveCD on a regular basis, it might just be a good idea to build them into a customised LiveCD. How hard can it be. Hmmm. Quite hard, but not skull crackingly awful. You can build one on either a windows or linux (ubuntu) desktop machine. Building one from Ubuntu itself, is easy to get into - from windows is going to take a bit more time. It is worth going over the windows steps though, because the LiveCD user may just want to have Ubuntu Live rather than installed.

So, for windows you will need XP, Vista or 7, about 10Gb of free disk space, an internet connection, and this software:

VMWare Player This is virtualisation software. It allows you to run virtual machines on Windows. This version is freeware, it only allows you to run machines that someone else has designed.
VMX Builder This is freeware software which lets you design virtual machines to use in VMWare Player without having to pay for VMWare Server.
Unetbootin This software lets you install a LiveCD image to a USB Key.
Ubuntu LiveCD image We are going to use this to both install onto the Virtual Machine AND as the base for the customized CD.

So, use the VMX Builder to setup a machine. Give it a decent amount of RAM, say half of what you have available, a 10Gb harddisk file (make it the expandable kind) access to 2 of your cores if you have a multi core system AND access to your network. Bridging is fine. Also, make sure that you let it access your USB Devices as that is how we are going to get data into and out of the virtual machine. Lastly, tell it to use the CD Image that you downloaded as its CD Drive.

Before you start, get a FAT32 formatted USB Key and stick a copy of the CD Image on it. Then boot your virtual PC and install Ubuntu from the LiveCD. Reboot, and get the VMWare Player to mount the USB Key. You should now be able to proceed with the following instructions.

Native Ubuntu users should start from this point. You don't have to faff around with virtual machines, the one you have should be perfectly fine for this task. So lets get started.

First of all we are going to need some extra packages for our running system to manipulate the CD image. To install these, run this command from a terminal window.

sudo aptitude install squashfs-tools genisoimage

The CD image contains one large archive file which stores all of the disk environment for the LiveCD. The squashfs-tools handles this archive. Basically, we unpack everything, add our extra packages, and then repack everything. The genisoimage [gen]erates the final [iso] [image] which we put onto the USB Key in due course.

Now, make a working directory in [~] home, and copy the image file into it:

mkdir ~/live
cp /media/[whatever]/ubuntu-10.04-desktop-i386.iso ~/live
cd ~/live

The [whatever] will differ depending on exactly where your system mounts the USB Key you just plugged in. Next we are going to actually mount the CD image so we can use it as if we had burned it to a CD and inserted it. We need to create the mount point first of all:

mkdir mnt
sudo mount -o loop ubuntu-10.04-desktop-i386.iso mnt

The loop [o]ption allows us to mount the image file as a folder.

Now we need to copy all of the files off the mounted image APART from the large squashed file. Again we want a separate folder to store these files:

mkdir extract-cd
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd

Next we need to extract the big archive file:

sudo unsquashfs mnt/casper/filesystem.squashfs

It uncompresses to a folder name we want to change by the typical linux method of [m]o[v]ing it.

sudo mv squashfs-root edit

We are going to be chrooting into the filesystem we just unpacked, and we want to use some of the files on our existing machine to point the way to the internet, and to give us access to our current hardware:

sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/hosts edit/etc/
sudo mount --bind /dev/ edit/dev

Now we chroot in and mount some virtual filesystems:

sudo chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts

We also need to set some system variables and create a symbolic link for some reason or another.

export HOME=/root
export LC_ALL=C
dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

I think the dbus command generates a code for this specific machine that some installation stuff may need. No idea what the [initctl] stuff is all about.
Excellent. We are now at the point where we can start to install stuff. First of all, and this was fucking frustrating trying to work this out, we need to enable the universe and multiverse repositories if we want to install packages from them. We need to do this in command line:

sudo nano /etc/apt/sources.list

This next command adds an external repository to the list of places we can download stuff from. It's a biggie but it basically is just a series of commands that run in sequence.

sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update

Before installing stuff, it might be a good idea to clean out some stuff we are not going to use. First of all have a look at all the installed packages in order of size:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less

The first on the list looks like a massive package, but what you have to understand is that this is showing you the UNCOMPRESSED sizes. Yeah, thanks for that. If you check on http://packages.ubuntu.com/lucid for the ubuntu-docs information, you find it is only taking up a few hundred Kb when squashed.
So what can you remove? Evolution is a prime candidate. Not much use on a LiveCD. You will be using webmail from a LiveCD.

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | grep evolution

This will show you all packages which have evolution in the title. It should look like this:

58440 evolution-common
8468 evolution-data-server-common
7020 evolution
3584 evolution-exchange
1404 evolution-data-server
1120 evolution-webcal
616 evolution-plugins
320 evolution-couchdb
136 evolution-indicator

You can remove all, apart from evolution-data-server-common which is needed by other applications, by running this command:

apt-get remove --purge evolution-common evolution evolution-exchange evolution-data-server evolution-webcal evolution-plugins evolution-couchdb evolution-indicator

I cannot be bothered with HP printer drivers, so:

apt-get remove --purge hplip-data

The language packs also take up a lot of space, and I do not need anything but English. Find these by running:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | grep language-

and then remove the ones we do not want:

apt-get remove --purge language-pack-gnome-fr-base language-pack-gnome-es-base language-pack-gnome-pt-base language-pack-gnome-de-base language-pack-pt-base language-pack-es-base language-pack-fr-base language-pack-de-base language-pack-gnome-bn-base language-pack-bn-base

There are other language packs, but they are to small to worry about clearing up unless you are intent on getting this image as small as possible. The final obvious low hanging fruit are foreign font sets. Do a search for [t]rue[t]ype[f]ont packages:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | grep ttf

12584 ttf-unfonts-core - Korean
6200 ttf-takao-pgothic - Japanese
5456 ttf-thai-tlwg - Thai
5184 ttf-wqy-microhei - Don't know for sure, better keep
4204 ttf-freefont - Latin, keep
2632 ttf-indic-fonts-core - Indian
2564 ttf-dejavu-core - Latin, keep
1724 ttf-liberation - Latin, keep
1708 ttf-opensymbol - Symbols, needed for OpenOffice, keep
592 ttf-khmeros-core Cambodian
216 ttf-punjabi-fonts - Punjabi
144 ttf-lao - Lao, where ever Lao is
116 ttf-kacst-one - Arabic

apt-get remove --purge ttf-unfonts-core ttf-takao-pgothic ttf-thai-tlwg ttf-wqy-microhei ttf-indic-fonts-core ttf-khmeros-core ttf-punjabi-fonts ttf-lao ttf-kacst-one

I may be tempted to remove the cups printing system, but the response to:

apt-get remove --purge cups

is

The following packages will be REMOVED:
  bluez-cups* cups* cups-driver-gutenprint* foo2zjs* foomatic-db* foomatic-db-engine* ghostscript-cups* openprinting-ppds* pxljr* splix* ubuntu-desktop*
0 upgraded, 0 newly installed, 11 to remove and 253 not upgraded.
After this operation, 41.5MB disk space will be freed.

I do not particularly want to mess with the ubuntu-desktop meta file. This makes sure that your LiveCD has all the basic Ubuntu Desktop files installed. Still, 41.5MB is 41.5MB. I will leave this one for future experiment.

I am also going to remove rhythmbox, because it does take up a lot of space, and like evolution it is really the type of application you need to set up on an installed machine rather than running from a LiveCD.

apt-get remove --purge rhythmbox

Even after all of those deletions, once I recompressed the image I found I had saved a paltry 90Mb or so. Ho hum. Once you have carried out all the removals, a good strategy is to upgrade all your remaining packages to the latest versions. You do NOT want to upgrade the Kernel or Grub because that causes bad things to happen and will stop the Live USB stick booting. So, create the following files to 'pin' those packages to their current versions:

sudo cat > hold_back_kernel << "EOF"
Package: linux-generic linux-headers-generic linux-image-generic linux-restricted-modules-generic
Pin: version 2.6.32.21.22
Pin-Priority: 1001
EOF
sudo mv hold_back_kernel /etc/apt/preferences.d/
sudo cat > hold_back_grub << "EOF"
Package: grub-common
Pin: version 1.98-1ubuntu5
Pin-Priority: 1001
EOF
sudo mv hold_back_grub /etc/apt/preferences.d/
sudo apt-get update

You can check that the version numbers are correct (they should be for the Live CD you have downloaded) and check the system knows about the new rules by running these commands:

sudo apt-cache policy
dpkg -l linux-generic
dpkg -l grub-common

The last few lines of all of that should look like this (you can see the version numbers match up):

Pinned packages:
     linux-headers-generic -> 2.6.32.21.22
     linux-image-generic -> 2.6.32.21.22
     grub-common -> 1.98-1ubuntu5
     linux-generic -> 2.6.32.21.22
ubuntu@ubuntu:~$ dpkg -l linux-generic
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                                Description
+++-======================================-======================================-============================================================================================
ii  linux-generic                          2.6.32.21.22                           Complete Generic Linux kernel
ubuntu@ubuntu:~$ dpkg -l grub-common
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                                Description
+++-======================================-======================================-============================================================================================
ii  grub-common                            1.98-1ubuntu5                          GRand Unified Bootloader, version 2 (common files)

You should now be able to run the upgrade excluding those troublesome packages.

sudo apt-get upgrade

We can now run a massive install command to add the extra packages that we want.

sudo apt-get install \
\
build-essential linux-headers-generic libgtk2.0-dev patch bison texinfo \
\
ubuntu-desktop \
\
adblock-plus flashplugin-installer openjdk-6-jre icedtea6-plugin \
\
openoffice.org-writer openoffice.org-java-common openoffice.org-l10n-en-gb openoffice.org-help-en-gb openoffice.org-style-human myspell-en-gb openoffice.org-hyphenation-en-us openoffice.org-thesaurus-en-us openoffice.org-java-common \
\
ttf-mscorefonts-installer \
\
smplayer vlc avidemux audacity pitivi \
\
totem totem-plugins-extra gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse \
\
non-free-codecs libavcodec-unstripped-52 libdvdcss2 libdvdread4 libdvdnav4 \
\
lame mjpegtools twolame mpeg2dec liba52-0.7.4-dev ffmpeg ffmpeg2theora w32codecs \
\
keepassx \
\
xchm comix ghostscript ghostscript-x gqview \
\
wine \
\
transmission \
\
f-spot dcraw gimp gimp-data-extras gimp-help-en \
\
celestia celestia-common celestia-common-nonfree stellarium googleearth googleearth-data \
\
subversion yasm \
autoconf libtool zlib1g-dev libbz2-dev intltool libglib2.0-dev \
libdbus-glib-1-dev libgtk2.0-dev libgudev-1.0-dev \
libwebkit-dev libnotify-dev libgstreamer0.10-dev \
libgstreamer-plugins-base0.10-dev \
\
monodevelop

I also want a couple of bits of software which are not available in the repositories. The first is Handbrake which is used to auto convert between video formats, and then Truecrypt which is a handy encryption system.

The lump of packages near the end of the long list above (subversion to libgstreamer) contains the dependencies for Handbrake. Handbrake itself is installed using the svn system:

cd /tmp
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch
cd build
make install

Truecrypt is a pain in the arse since they want you to accept their stupid licence instead of just releasing under the GPL.

cd /tmp
wget http://www.truecrypt.org/download/truecrypt-7.0-linux-x86.tar.gz
tar -xzvf truecrypt-7.0-linux-x86.tar.gz
./truecrypt-7.0-setup-x86

Extract the package file - it automatically stores it in /tmp. We need to extract it to /, and it auto installs to the correct folders. So:

cd /
tar -xzvf /tmp/truecrypt_7.0_i386.tar.gz

And that is that for Truecrypt.

If you were stupid enough to upgrade the kernel package, it is extremely likely that doing a upgrade of all the packages will change the kernel version. To ensure that the new kernel is actually used, you need to go into the ...
~/live/edit/boot
...folder and copy the latest versions of the vmlinuz compressed kernel and the initrd.img files to the ...
~/live/extract-cd/casper
...folder. You then need to delete the existing initrd.lz file, and rename the initrd.img file you just copied over to replace it. Do the same with the vmlinuz files. This has NEVER worked for me so I do not upgrade the kernel package.

If you want the clock in the LiveCD machine to show the proper time, take a moment and set your time zone and keyboard for UK use:

sudo setxkbmap gb
sudo cp -v --remove-destination /usr/share/zoneinfo/Europe/London /etc/localtime

We now need to clean up some user account stuff incase any of the installed packages made changes:

awk -F: '$3 > 999' /etc/passwd
usermod -u 500 $hit #where hit is any user ID greater than 999

Right, and we are good to do a general clean up:

aptitude clean
rm -rf /tmp/* ~/.bash_history
rm /etc/resolv.conf
rm /var/lib/dbus/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
umount /proc
umount /sys
umount /dev/pts
exit
sudo umount edit/dev

The [rm] commands obviously [r]e[m]ove stuff, and the remaining commands undo the setup commands we used to get into the [chroot] environment. Virtually every time I do this I get a fucking annoying error telling me that it can't umount these things because they are in use. Well, you know what I say to that? Hello Mr. Reboot.

Once the system has come back on, fire up a terminal and:

cd ~/live

Now, update the .manifest file which is a list of installed packages:
chmod +w extract-cd/casper/filesystem.manifest
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
sudo sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop

Now delete the existing squashed archive and replace it. Don't worry if it cannot find one, there shouldn't be one the first time you run through these instructions.
sudo rm extract-cd/casper/filesystem.squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs

That last command will take most time of anything here, as it (re)compressess all the packages we want. If you are feeling particularly narcisstic you can edit the disk details (change the image name) that pop up on boot:

sudo nano extract-cd/README.diskdefines

Now we need to rebuild the md5sum check file:
cd extract-cd
sudo rm md5sum.txt
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt

That will probably take two [sudo] password requests - one for the straight [sudo] and one for the [| sudo] piped version. Do not know why. Irritating as fuck.

And finally we need to build a new iso image:

sudo mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-10.04-desktop-i386-custom.iso .

Once you have that image you use the unetbootin software (which comes in both windows and linux flavours) to load the image onto the USB Key. Job done.

Sunday 5 September 2010

LAP - All in One - Build Times

The actual process of compiling LFS the first time around is lengthy and painful pain in the arse. So it is pleasing to benchmark the time it takes to auto compile the whole lot. These are the relevant times for my i5-750 and the replacement i7-870 using the ramdisk:

Toolchain
750
real 27m30.622s
user 34m23.369s
sys 7m23.240s

870
real 26m41.127s
user 39m37.777s
sys 4m21.224s

Actual Build
750
real 36m3.964s
user 36m2.979s
sys 6m54.990s

870
real 36m8.174s
user 39m14.963s
sys 4m4.027s

Kernel
750
real 13m49.355s
user 7m13.171s
sys 0m33.742s

870
real 12m10.133s
user 9m14.311s
sys 0m35.246s

Hardware & Documentation
real 10mX.XXXs

I did not note down the exact time.

Xorg
real 41m25.104s

Yes, that means that Xorg took longer to compile than the whole LFS system, but it was being built on the USB Key itself, not in RAM. I expect this to drop by at least a third and potentially more if I can tweak the script to unpack and compile on the RAM disk.

Desktop Stuff
real 13m52.810s
user 10m20.872s
sys 1m32.297s

I have also worked out how to install firefox (and will post the full instructions when they are tidied up in due course). I also timed it and the results are:

Firefox (paused a bit and I missed it during plugins).
real 28m6.401s
user 22m36.031s
sys 1m11.702s

That WAS compiled from the ramdisk, and it is worth commenting that a single web browser takes nearly the same amount of time to compile as the rest of the operating system. Sheesh.

LAP - All in One - Desktop

Now to install all the graphical odds and sods, run the following commands in a script:

cd /dev/shm
tar -xzvf /sources/desktop/jpegsrc.v7.tar.gz
cd jpeg-7
./configure --prefix=/usr --enable-static --enable-shared
make
make install
cd ..
rm -rf jpeg-7
ldconfig
tar -xzvf /sources/desktop/slim-1.3.2.tar.gz
cd slim-1.3.2
sed -i -e "s:^MANDIR=.*:MANDIR=/usr/share/man:" -e "s:/usr/X11R6:/usr:" Makefile
sed -i -e 's#X11R6/##g' -e 's#/usr/bin:##' -e 's/# daemon/daemon/' slim.conf
make $CORES_TO_USE
make install
cat >> /etc/inittab << "EOF"
x:5:respawn:/usr/bin/slim >& /dev/null
EOF
cd ..
rm -rf slim-1.3.2
tar -xzvf /sources/desktop/cairo-1.8.10.tar.gz
cd cairo-1.8.10
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf cairo-1.8.10
tar -xjvf /sources/desktop/pcre-8.00.tar.bz2
cd pcre-8.00
./configure --prefix=/usr --docdir=/usr/share/doc/pcre-8.00 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2
make $CORES_TO_USE
make install
mv -v /usr/lib/libpcre.so.* /lib/
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
cd ..
rm -rvf pcre-8.00
tar -xjvf /sources/desktop/glib-2.22.4.tar.bz2
cd glib-2.22.4
./configure --prefix=/usr --with-pcre=system
make $CORES_TO_USE
make $CORES_TO_USE install
cat > /etc/profile.d/glib2-locale.sh << "EOF"
# Use the current locale charset for filenames
# in applications using GLib
export G_FILENAME_ENCODING=@locale
EOF
cd ..
rm -rvf glib-2.22.4
tar -xjvf /sources/desktop/pango-1.26.2.tar.bz2
cd pango-1.26.2
./configure --prefix=/usr --sysconfdir=/etc
make $CORES_TO_USE
make install
cd ..
rm -rvf pango-1.26.2
tar -xjvf /sources/desktop/atk-1.28.0.tar.bz2
cd atk-1.28.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf atk-1.28.0
tar -xzvf /sources/desktop/tiff-3.9.2.tar.gz
cd tiff-3.9.2
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf tiff-3.9.2
tar -xjvf /sources/desktop/gtk+-2.18.7.tar.bz2
cd gtk+-2.18.7
./configure --prefix=/usr --sysconfdir=/etc
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/gtk+-2.18.7/{faq,tutorial}
cp -v -R docs/faq/html/* /usr/share/doc/gtk+-2.18.7/faq
cp -v -R docs/tutorial/html/* /usr/share/doc/gtk+-2.18.7/tutorial
install -v -m644 docs/*.txt /usr/share/doc/gtk+-2.18.7
cd ..
rm -rvf gtk+-2.18.7
tar -xzvf /sources/desktop/libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf libxml2-2.7.6
tar -xzvf /sources/desktop/openbox-3.4.11.1.tar.gz
cd openbox-3.4.11.1
./configure --prefix=/usr --sysconfdir=/etc --disable-startup-notification --disable-session-management
make $CORES_TO_USE
make install
cat > /root/.xinitrc << "EOF"
# Begin .xinitrc file
#xterm  -g 80x20+0+0   &
#xclock -g 100x100-0+0 &
exec openbox-session
EOF

cd ..
rm -rvf openbox-3.4.11.1
mkdir -p /root/.config/openbox
cp /etc/xdg/openbox/*.* /root/.config/openbox
cat > ~/.config/openbox/menu.xml << "EOF"
<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">

<menu id="apps-editors-menu" label="Editors">
<item label="nano">
<action name="Execute">
<command>xterm -e /usr/bin/nano</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="apps-term-menu" label="Terminals">
<item label="Xterm">
<action name="Execute"><command>xterm</command></action>
</item>
</menu>

<menu id="apps-net-menu" label="Internet">
<item label="lynx">
<action name="Execute">
<command>xterm -e /usr/bin/lynx</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="apps-multimedia-menu" label="Multimedia">
<item label="alsamixer">
<action name="Execute">
<command>xterm -e /usr/bin/alsamixer</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="system-menu" label="System">
<item label="Openbox Configuration Manager">
<action name="Execute">
<command>obconf</command>
<startupnotify><enabled>yes</enabled></startupnotify>
</action>
</item>
<separator />
<item label="Reconfigure Openbox">
<action name="Reconfigure" />
</item>
</menu>

<menu id="root-menu" label="Openbox 3">
<separator label="Applications" />
<menu id="apps-editors-menu"/>
<menu id="apps-net-menu"/>
<menu id="apps-multimedia-menu"/>
<menu id="apps-term-menu"/>
<item label="E-UAE Emulator">
<action name="execute"><execute>/usr/bin/uae</execute></action>
</item>
<separator label="System" />
<menu id="system-menu"/>
<separator />
<item label="Log Out">
<action name="Exit">
<prompt>yes</prompt>
</action>
</item>
</menu>

</openbox_menu>
EOF
tar -xzvf /sources/extras/SDL-1.2.13.tar.gz
cd SDL-1.2.13
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/SDL-1.2.13/html
install -v -m644 docs/html/*.html /usr/share/doc/SDL-1.2.13/html
ldconfig
cd ..
rm -rvf SDL-1.2.13

Remember you need to nano [/etc/inittab] to change the default from '3' to '5'.

LAP - All in One - Xorg

This is the script to install Xorg in one go. As with other scripts make sure you have the source files downloaded. Then paste into gedit, and save as a script.

cat >> /etc/profile.d/X.sh << "EOF"
# Begin Xorg Variables
export XORG_PREFIX="/usr"
export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc --mandir=$XORG_PREFIX/share/man --localstatedir=/var"
# End Xorg variables
EOF
source /etc/profile
cd /sources/xorg/proto
for package in $(grep -v '^#' ../proto-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
./configure $XORG_CONFIG
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../proto-7.5-2-compile.log
cd /sources/xorg/util
for package in $(grep -v '^#' ../util-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../util-7.5-2-compile.log
cd /sources/xorg
tar -jxvf libXau-1.0.5.tar.bz2
cd libXau-1.0.5
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf libXau-1.0.5
tar -jxvf libXdmcp-1.0.3.tar.bz2
cd libXdmcp-1.0.3
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf libXdmcp-1.0.3
cd /sources/xorg
tar -xvzf ed-1.4.tar.gz
cd ed-1.4
./configure --prefix=/usr --bindir=/bin
make $CORES_TO_USE
make install
cd ..
rm -rvf ed-1.4
cd /sources/xorg
tar -jxvf freetype-2.3.12.tar.bz2
cd freetype-2.3.12
tar -xvf ../freetype-doc-2.3.12.tar.bz2 --strip-components=2 -C docs
sed -i -r -e 's:.*(#.*BYTE.*) .*:\1:' -e 's:.*(#.*SUBPIX.*) .*:\1:' include/freetype/config/ftoption.h
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/freetype-2.3.12
cp -v -R docs/*     /usr/share/doc/freetype-2.3.12
cd ..
rm -rvf freetype-2.3.12
cd /sources/xorg
tar -xzvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/expat-2.0.1
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.0.1
cd ..
rm -rvf expat-2.0.1
cd /sources/xorg
tar -xzvf fontconfig-2.8.0.tar.gz
cd fontconfig-2.8.0
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-docs --without-add-fonts --with-docdir=/usr/share/doc/fontconfig-2.8.0
make $CORES_TO_USE
make install
cd ..
rm -rvf fontconfig-2.8.0
cd /sources/xorg/lib
for package in $(grep -v '^#' ../lib-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
case "$packagedir" in
libX11-1.3.2 )
CONFIGPARAMS="--without-xcb"
esac
./configure $XORG_CONFIG $CONFIGPARAMS
make $CORES_TO_USE
make install
unset CONFIGPARAMS
ldconfig
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../lib-7.5-2-compile.log
tar -xjvf xbitmaps-1.1.0.tar.bz2
cd xbitmaps-1.1.0
./configure $XORG_CONFIG
make install
cd ..
rm -rvf xbitmaps-1.1.0
cd /sources/xorg
tar -xjvf libpng-1.2.42.tar.bz2
cd libpng-1.2.42
patch -Np1 -i ../libpng-1.2.42-apng-1.patch
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/libpng-1.2.42
install -v -m644    README libpng-1.2.42.txt /usr/share/doc/libpng-1.2.42
cd ..
rm -rvf libpng-1.2.42
tar -jxvf libpthread-stubs-0.1.tar.bz2
cd libpthread-stubs-0.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf libpthread-stubs-0.1
tar -jxvf libdrm-2.4.14.tar.bz2
cd libdrm-2.4.14
./configure --prefix=$XORG_PREFIX
make $CORES_TO_USE
make install
cd ..
rm -rvf libdrm-2.4.14
cd /sources/xorg
tar -xjvf MesaLib-7.6.tar.bz2
tar -xjvf MesaDemos-7.6.tar.bz2
cd Mesa-7.6
sed 's@FLAGS=\"-g@FLAGS=\"@' -i configure
./configure $XORG_CONFIG
make $CORES_TO_USE
make -C progs/xdemos glxinfo glxgears
make install
install -v -m755 progs/xdemos/glx{info,gears} ${XORG_PREFIX}/bin
cd ..
rm -rvf Mesa-7.6
cd /sources/xorg/app
for package in $(grep -v '^#' ../app-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../app-7.5-2-compile.log
tar -xjvf xcursor-themes-1.0.2.tar.bz2
cd xcursor-themes-1.0.2
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf xcursor-themes-1.0.2
cd /sources/xorg/font
for package in $(grep -v '^#' ../font-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../font-7.5-2-compile.log
cd /sources/xorg 
tar -xzvf XML-Parser-2.36.tar.gz
cd XML-Parser-2.36
perl Makefile.PL
make $CORES_TO_USE
make install
cd ..
rm -rvf XML-Parser-2.36
cd /sources/xorg
tar -xjvf intltool-0.40.6.tar.bz2
cd intltool-0.40.6
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m644 -D doc/I18N-HOWTO /usr/share/doc/intltool-0.40.6/I18N-HOWTO
cd ..
rm -rvf intltool-0.40.6
cd /sources/xorg
tar -xjvf xkeyboard-config-1.7.tar.bz2
cd xkeyboard-config-1.7
./configure $XORG_CONFIG --with-xkb-rules-symlink=xorg
make $CORES_TO_USE
make install
install -dv -m755 $XORG_PREFIX/share/doc/xkeyboard-config-1.7
install -v -m644 docs/{README,HOWTO}* $XORG_PREFIX/share/doc/xkeyboard-config-1.7
cd ..
rm -rvf xkeyboard-config-1.7
tar -xjvf luit-1.0.4.tar.bz2
cd luit-1.0.4
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf luit-1.0.4
tar -xzvf pixman-0.15.20.tar.gz
cd pixman-0.15.20
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pixman-0.15.20
cd /sources/xorg
tar -xjvf xorg-server-1.7.1.tar.bz2
cd xorg-server-1.7.1
./configure $XORG_CONFIG --with-module-dir=$XORG_PREFIX/lib/X11/modules --with-xkb-output=/var/lib/xkb --enable-install-setuid --disable-config-hal --disable-config-dbus
make $CORES_TO_USE
make install
cd ..
rm -rvf xorg-server-1.7.1
cd /sources/xorg
tar -xzvf xterm-253.tgz
cd xterm-253
sed -i '/v0/,+1s/new:/new:kb=^?:/' termcap
echo -e '\tkbs=\\177,' >>terminfo
TERMINFO=/usr/lib/terminfo ./configure $XORG_CONFIG --enable-luit --enable-wide-chars --with-app-defaults=$XORG_PREFIX/share/X11/app-defaults
make $CORES_TO_USE
make install
make install-ti
cat >> $XORG_PREFIX/share/X11/app-defaults/XTerm << "EOF"
*VT100*locale: true
*VT100*faceName: Monospace
*VT100*faceSize: 10
*backarrowKeyIsErase: true
*ptyInitialErase: true
EOF
cd ..
rm -rvf xterm-253
cd /sources/xorg/driver
for package in $(grep -v '^#' ../driver-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xf $package
cd $packagedir
case $packagedir in
xf86-input-evdev-[0-9]* | xf86-video-ati-[0-9]* | xf86-video-fbdev-[0-9]* | xf86-video-glint-[0-9]* | xf86-video-newport-[0-9]* )
sed -i -e "s/\xc3\xb8/\\\\[\/o]/" -e "s/\xc3\xa4/\\\\[:a]/" -e "s/\xc3\x9c/\\\\[:U]/" man/*.man
;;
esac
./configure $XORG_CONFIG --with-xorg-module-dir=$XORG_PREFIX/lib/X11/modules
make $CORES_TO_USE
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../driver-7.5-2-compile.log
ln -vsf $XORG_PREFIX /usr/X11R6
mkdir -p /etc/X11 &&
for file in $XORG_PREFIX/{lib/X11/xinit,share/X11/{app-defaults,twm}}
do
mv -v $file /etc/X11/ 2> /dev/null &&
ln -v -s /etc/X11/$(basename $file) $file
done
cat > ~/.xinitrc << "EOF"
# Begin .xinitrc file
xterm  -g 80x20+0+0   &
xclock -g 100x100-0+0 &
twm
EOF
cat > ~/.bashrc << "EOF"
source /etc/profile
EOF
cat >> /etc/sysconfig/createfiles << "EOF"
/tmp/.ICE-unix dir 1777 root root
EOF
After this has run, you will need to generate your xorg.conf file and edit away your your hearts content following these instructions.

LAP - All in One - Hardware

Once you have got the system booting, you can install all the compression and hardware stuff by the following script, again geditted into an executable file.

cd /dev/shm
tar -xzvf /sources/network/wireless_tools.28.tar.gz 
cd wireless_tools.28 
make 
make PREFIX=/usr install 
cd .. 
rm -rvf wireless_tools.28
tar -xjvf /sources/network/net-tools-1.60.tar.bz2
cd net-tools-1.60
patch -Np1 -i /sources/network/net-tools-1.60-gcc34-3.patch
patch -Np1 -i /sources/network/net-tools-1.60-kernel_headers-2.patch
patch -Np1 -i /sources/network/net-tools-1.60-mii_ioctl-1.patch
yes "" | make config
sed -i -e 's|HAVE_IP_TOOLS 0|HAVE_IP_TOOLS 1|g' -e 's|HAVE_MII 0|HAVE_MII 1|g' config.h
sed -i -e 's|# HAVE_IP_TOOLS=0|HAVE_IP_TOOLS=1|g' -e 's|# HAVE_MII=0|HAVE_MII=1|g' config.make
make $CORES_TO_USE
make update
cd ..
rm -rvf net-tools-1.60
tar -xjvf /sources/network/dhcpcd-4.0.11.tar.bz2
cd dhcpcd-4.0.11
make PREFIX= LIBEXECDIR=/lib/dhcpcd DBDIR=/var/lib/dhcpcd SYSCONFDIR=/etc/dhcpcd 
make PREFIX= LIBEXECDIR=/lib/dhcpcd DBDIR=/var/lib/dhcpcd SYSCONFDIR=/etc/dhcpcd install 
sed -i "s;/var/lib/dhcpcd-;/var/lib/dhcpcd/dhcpcd-;g" dhcpcd-hooks/50-dhcpcd-compat 
install -v -m 644 dhcpcd-hooks/50-dhcpcd-compat /lib/dhcpcd/dhcpcd-hooks/ 
cd .. 
rm -rvf dhcpcd-4.0.11 
tar -xjvf /sources/network/blfs-bootscripts-20090302.tar.bz2 
cd blfs-bootscripts-20090302 
make install-service-dhcpcd 
cd .. 
rm -rvf blfs-bootscripts-20090302 
cat > ~/wifi_wl.sh << "EOF"
rmmod b43 
rmmod ssb 
rmmod wl
rmmod lib80211
modprobe lib80211
modprobe wl
dhcpcd -L -t 1 XXXX
iwconfig XXXX essid "YYYY" key ZZZZ
dhcpcd XXXX
EOF
chmod +x ~/wifi_wl.sh
cat > ~/wifi_b43.sh << "EOF"
rmmod b43 
rmmod ssb 
rmmod lib80211
rmmod wl
modprobe b43
sleep 1
iwconfig XXXX essid "YYYY" key ZZZZ
dhcpcd XXXX
EOF
chmod +x ~/wifi_b43.sh
tar -xjvf /sources/network/wget-1.12.tar.bz2 
cd wget-1.12 
./configure --prefix=/usr --sysconfdir=/etc 
make $CORES_TO_USE
make install 
install-info --info-dir=/usr/share/info /usr/share/info/wget.info 
cd .. 
rm -rvf wget-1.12
tar -xzvf /sources/extras/lzma-4.32.7.tar.gz
cd lzma-4.32.7
./configure --prefix=/usr
make $CORES_TO_USE
make check
make install
cd ..
rm -rvf lzma-4.32.7
tar -xzvf /sources/extras/unzip60.tar.gz
cd unzip60
make -f unix/Makefile linux
make prefix=/usr install
cd ..
rm -rvf unzip60
tar -xzvf /sources/extras/zip30.tar.gz
cd zip30
make -f unix/Makefile generic_gcc
make prefix=/usr -f unix/Makefile install
cd ..
rm -rvf zip30
tar -xzvf /sources/extras/bc-1.06.tar.gz 
cd bc-1.06 
sed -i '/PROTO.*readline/d' bc/scan.l 
sed -i '/flex -I8/s/8//' configure 
sed -i '/stdlib/a #include ' lib/number.c 
sed -i 's/program.*save/static &/' bc/load.c 
./configure --prefix=/usr --with-readline 
make $CORES_TO_USE 
make install 
cd .. 
rm -rvf bc-1.06 
tar -xzvf /sources/extras/openssl-0.9.8n.tar.gz 
cd openssl-0.9.8n 
patch -Np1 -i /sources/extras/openssl-0.9.8n-fix_manpages-1.patch 
tar -vxf /sources/extras/BLFS-ca-bundle-3.12.5.tar.bz2 
./config --prefix=/usr --openssldir=/etc/ssl shared zlib-dynamic 
make $CORES_TO_USE 
make MANDIR=/usr/share/man install 
cp -v -r certs /etc/ssl 
install -v -d -m755 /usr/share/doc/openssl-0.9.8n 
cp -v -r       doc/{HOWTO,README,*.{txt,html,gif}} /usr/share/doc/openssl-0.9.8n 
for pem in /etc/ssl/certs/*.pem 
do 
cat $pem 
echo "" 
done > /etc/ssl/ca-bundle.crt 
cd .. 
rm -rvf openssl-0.9.8n 
tar -xjvf /sources/extras/lynx2.8.7rel.1.tar.bz2 
cd lynx2-8-7 
./configure --prefix=/usr --sysconfdir=/etc/lynx --datadir=/usr/share/doc/lynx-2.8.7rel.1 --with-zlib --with-bzlib --with-screen=ncursesw --enable-locale-charset --with-ssl 
make $CORES_TO_USE
make install-full 
chgrp -v -R root /usr/share/doc/lynx-2.8.7rel.1/lynx_doc 
sed -i 's/#\(LOCALE_CHARSET\):FALSE/\1:TRUE/' /etc/lynx/lynx.cfg 
sed -i 's/#\(DEFAULT_EDITOR\):/\1:nano/' /etc/lynx/lynx.cfg 
sed -i 's/#\(PERSISTENT_COOKIES\):FALSE/\1:TRUE/' /etc/lynx/lynx.cfg 
cd .. 
rm -rvf lynx2-8-7 
tar -xzvf /sources/extras/doxygen-1.6.3.src.tar.gz 
cd doxygen-1.6.3 
./configure --prefix /usr --docdir /usr/share/doc/doxygen-1.6.3 
make $CORES_TO_USE
make install 
make install_docs 
cd .. 
rm -rvf doxygen-1.6.3 
tar -jxvf /sources/audio/alsa-lib-1.0.21.tar.bz2
cd alsa-lib-1.0.21
./configure --enable-static &&
make $CORES_TO_USE
make install &&
install -v -m644 -D doc/asoundrc.txt /usr/share/doc/alsa-lib-1.0.21/asoundrc.txt
make doc
install -v -d -m755 /usr/share/doc/alsa-1.0.21/html
install -v -m644 doc/doxygen/html/* /usr/share/doc/alsa-1.0.21/html
cd ..
rm -rvf alsa-lib-1.0.21
tar -jxvf /sources/audio/alsa-plugins-1.0.21.tar.bz2
cd alsa-plugins-1.0.21
./configure
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/alsa-plugins-1.0.21
install -v -m644 doc/{README*,*.txt} /usr/share/doc/alsa-plugins-1.0.21
cd ..
rm -rvf alsa-plugins-1.0.21
tar -jxvf /sources/audio/alsa-utils-1.0.21.tar.bz2
cd alsa-utils-1.0.21
patch -Np1 -i /sources/audio/alsa-utils-1.0.21-no_xmlto-1.patch
./configure
make $CORES_TO_USE
make install
cd ..
rm -rvf alsa-utils-1.0.21
tar -xjvf /sources/audio/blfs-bootscripts-20090302.tar.bz2
cd blfs-bootscripts-20090302
make install-alsa
cd ..
rm -rvf blfs-bootscripts-20090302
touch /etc/asound.state
alsactl store
cat > /etc/udev/rules.d/40-alsa.rules << "EOF"
# /etc/udev/rules.d/40-alsa.rules

# When a sound device is detected, restore the volume settings
KERNEL=="controlC[0-9]*", ACTION=="add", RUN+="/usr/sbin/alsactl restore %n"
EOF
chmod -v 644 /etc/udev/rules.d/40-alsa.rules

After you run this, remember you need to load on the b43 firmware, and you need to edit the wifi_*.sh scripts with your own settings.

Saturday 4 September 2010

LAP - All in One - Actual Build

OK, now on with the actual build. First you need to create the file system to work in. This involves entering and exiting chroots, and restarting the shell, all of which break simple scripts like mine. So do all of the starting stuff by pasting the first chunk of text into the terminal:

sudo mkdir -v /media/lfs/{dev,proc,sys}
sudo mknod -m 600 /media/lfs/dev/console c 5 1
sudo mknod -m 666 /media/lfs/dev/null c 1 3
sudo mount -v --bind /dev /media/lfs/dev
sudo mount -vt devpts devpts /media/lfs/dev/pts
sudo mount -vt tmpfs shm /media/lfs/dev/shm
sudo mount -vt proc proc /media/lfs/proc
sudo mount -vt sysfs sysfs /media/lfs/sys
sudo chroot "/media/lfs" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin CORES_TO_USE=-j4 /tools/bin/bash --login +h
mkdir -pv /{bin,boot,etc/opt,home,lib,mnt,opt}
mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp
mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
mkdir -pv /usr/{,local/}share/{doc,info,locale,man}
mkdir -v  /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -pv /usr/{,local/}share/man/man{1..8}
for dir in /usr /usr/local; do
  ln -sv share/{man,doc,info} $dir
done
case $(uname -m) in
 x86_64) ln -sv lib /lib64 && ln -sv lib /usr/lib64 ;;
esac
mkdir -v /var/{lock,log,mail,run,spool}
mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin
ln -sv /tools/bin/perl /usr/bin
ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib
ln -sv bash /bin/sh
touch /etc/mtab
cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
EOF
cat > /etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
mail:x:34:
nogroup:x:99:
EOF
exec /tools/bin/bash --login +h
touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
chgrp -v utmp /var/run/utmp /var/log/lastlog
chmod -v 664 /var/run/utmp /var/log/lastlog
exit
sudo mount -v --bind /tmp /media/lfs/tmp
sudo chroot "/media/lfs" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin CORES_TO_USE=-j4 /tools/bin/bash --login +h
Next, paste this text into gedit and save it as a script. Make it executable and move it to the root of the Amiga Key to run it.
cd /tmp
tar -xjvf /sources/linux-2.6.32.8.tar.bz2
cd linux-2.6.32.8
make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
find dest/include \( -name .install -o -name ..install.cmd \) -delete
cp -rv dest/include/* /usr/include
cd ..
rm -rvf linux-2.6.32.8
tar -xjvf /sources/man-pages-3.23.tar.bz2
cd man-pages-3.23
make install
cd ..
rm -rvf man-pages-3.23
tar -xjvf /sources/glibc-2.11.1.tar.bz2
cd glibc-2.11.1
DL=$(readelf -l /bin/sh | sed -n 's@.*interpret.*/tools\(.*\)]$@\1@p')
sed -i "s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$DL -o|" scripts/test-installation.pl
unset DL
sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
mkdir -v ../glibc-build
cd ../glibc-build
case `uname -m` in
  i?86) echo "CFLAGS += -march=i486 -mtune=native -O3 -pipe" > configparms ;;
esac
../glibc-2.11.1/configure --prefix=/usr --disable-profile --enable-add-ons --enable-kernel=2.6.18 --libexecdir=/usr/lib/glibc
make $CORES_TO_USE
cp -v ../glibc-2.11.1/iconvdata/gconv-modules iconvdata
touch /etc/ld.so.conf
make install
mkdir -pv /usr/lib/locale
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i de_DE -f UTF-8 de_DE.UTF-8
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fa_IR -f UTF-8 fa_IR
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i ja_JP -f EUC-JP ja_JP
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
localedef -i zh_CN -f GB18030 zh_CN.GB18030
localedef -i en_GB -f UTF-8 en_GB.utf8
localedef -i en_GB -f ISO-8859-1 en_GB
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

hosts: files dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

# End /etc/nsswitch.conf
EOF
cp -v --remove-destination /usr/share/zoneinfo/Europe/London /etc/localtime
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf

/usr/local/lib
/opt/lib

# End /etc/ld.so.conf
EOF
cd ..
rm -rvf glibc-2.11.1  glibc-build
mv -v /tools/bin/{ld,ld-old}
mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
mv -v /tools/bin/{ld-new,ld}
ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
gcc -dumpspecs | sed -e 's@/tools@@g' -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > `dirname $(gcc --print-libgcc-file-name)`/specs
tar -xjvf /sources/zlib-1.2.3.tar.bz2
cd zlib-1.2.3
./configure --prefix=/usr --shared --libdir=/lib
make $CORES_TO_USE
make install
rm -v /lib/libz.so
ln -sfv ../../lib/libz.so.1.2.3 /usr/lib/libz.so
make clean
./configure --prefix=/usr
make $CORES_TO_USE
make install
chmod -v 644 /usr/lib/libz.a
cd ..
rm -rvf zlib-1.2.3
tar -jxvf /sources/binutils-2.20.tar.bz2
cd binutils-2.20
expect -c "spawn ls"
rm -fv etc/standards.info
sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in
mkdir -v ../binutils-build
cd ../binutils-build
../binutils-2.20/configure --prefix=/usr --enable-shared
make $CORES_TO_USE tooldir=/usr
make tooldir=/usr install
cp -v ../binutils-2.20/include/libiberty.h /usr/include
cd ..
rm -rvf binutils-2.20 binutils-build
tar -xjvf /sources/gmp-5.0.0.tar.bz2
cd gmp-5.0.0
./configure --prefix=/usr --enable-cxx --enable-mpbsd
make $CORES_TO_USE
make install
mkdir -v /usr/share/doc/gmp-5.0.0
cp    -v doc/{isa_abi_headache,configuration} doc/*.html /usr/share/doc/gmp-5.0.0
cd ..
rm -rvf  gmp-5.0.0
tar -xjvf /sources/mpfr-2.4.2.tar.bz2
cd mpfr-2.4.2
./configure --prefix=/usr --enable-thread-safe
make $CORES_TO_USE
make install
make html
mkdir -pv /usr/share/doc/mpfr-2.4.2
find . -name \*.html -type f -exec cp -v \{} /usr/share/doc/mpfr-2.4.2 \;
cd ..
rm -rvf mpfr-2.4.2
tar -xzvf /sources/file-5.04.tar.gz
cd file-5.04
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf file-5.04
tar -xjvf /sources/gcc-4.4.3.tar.bz2
cd gcc-4.4.3
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
case `uname -m` in
  i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
esac
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
sed -i 's/getline/get_line/' libiberty/testsuite/test-demangle.c
mkdir -v ../gcc-build
cd ../gcc-build
../gcc-4.4.3/configure --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap
make $CORES_TO_USE
make install
ln -sv ../usr/bin/cpp /lib
ln -sv gcc /usr/bin/cc
cd ..
rm -rvf gcc-4.4.3 gcc-build
tar -xjvf /sources/sed-4.2.1.tar.bz2 
cd sed-4.2.1
./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.1
make $CORES_TO_USE
make html
make install
make -C doc install-html
cd ..
rm -rvf sed-4.2.1
tar -xzvf /sources/pkg-config-0.23.tar.gz
cd pkg-config-0.23
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pkg-config-0.23
tar -xzvf /sources/ncurses-5.7.tar.gz 
cd ncurses-5.7
./configure --prefix=/usr --with-shared --without-debug --enable-widec
make $CORES_TO_USE
make install
mv -v /usr/lib/libncursesw.so.5* /lib
ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
for lib in ncurses form panel menu ; do rm -vf /usr/lib/lib${lib}.so ; echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; done
ln -sfv libncurses++w.a /usr/lib/libncurses++.a
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
ln -sfv libncursesw.a /usr/lib/libcursesw.a
ln -sfv libncurses.a /usr/lib/libcurses.a
mkdir -v       /usr/share/doc/ncurses-5.7
cp -v -R doc/* /usr/share/doc/ncurses-5.7
make distclean
./configure --prefix=/usr --with-shared --without-normal --without-debug --without-cxx-binding
make $CORES_TO_USE sources libs
cp -av lib/lib*.so.5* /usr/lib
cd ..
rm -rvf ncurses-5.7
tar -xjvf /sources/util-linux-ng-2.17.tar.bz2
cd util-linux-ng-2.17
sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' -i $(grep -rl '/etc/adjtime' .)
mkdir -pv /var/lib/hwclock
./configure --enable-arch --enable-partx --enable-write
make $CORES_TO_USE
make install
cd ..
rm -rvf util-linux-ng-2.17
tar -xzvf /sources/e2fsprogs-1.41.10.tar.gz
cd e2fsprogs-1.41.10
mkdir -v build
cd build
../configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs --disable-libblkid --disable-libuuid --disable-uuidd --disable-fsck
make $CORES_TO_USE
make install
make install-libs
chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
gunzip -v /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
makeinfo -o      doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
cd ../../
rm -rvf e2fsprogs-1.41.10
tar -xzvf /sources/coreutils-8.4.tar.gz
cd coreutils-8.4
case `uname -m` in
 i?86 | x86_64) patch -Np1 -i /sources/coreutils-8.4-uname-1.patch ;;
esac
patch -Np1 -i /sources/coreutils-8.4-i18n-1.patch
./configure --prefix=/usr --enable-no-install-program=kill,uptime
make $CORES_TO_USE
make install
mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
mv -v /usr/bin/chroot /usr/sbin
mv -v /usr/bin/{head,sleep,nice} /bin
cd ..
rm -rvf coreutils-8.4
tar -xjvf /sources/iana-etc-2.30.tar.bz2
cd iana-etc-2.30
make $CORES_TO_USE
make install
cd ..
rm -rvf iana-etc-2.30
tar -xjvf /sources/m4-1.4.13.tar.bz2
cd m4-1.4.13
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf m4-1.4.13
tar -xjvf /sources/bison-2.4.1.tar.bz2
cd bison-2.4.1
./configure --prefix=/usr
echo '#define YYENABLE_NLS 1' >> lib/config.h
make $CORES_TO_USE
make install
cd ..
rm -rvf bison-2.4.1
tar -xzvf /sources/procps-3.2.8.tar.gz
cd procps-3.2.8
patch -Np1 -i /sources/procps-3.2.8-watch_unicode-1.patch
make $CORES_TO_USE
make install
cd ..
rm -rvf procps-3.2.8
tar -xjvf /sources/grep-2.5.4.tar.bz2
cd grep-2.5.4
patch -Np1 -i /sources/grep-2.5.4-debian_fixes-1.patch
./configure --prefix=/usr --bindir=/bin --without-included-regex 
make $CORES_TO_USE
make install
cd ..
rm -rvf grep-2.5.4
tar -xzvf /sources/readline-6.1.tar.gz
cd readline-6.1
sed -i '/MV.*old/d' Makefile.in 
sed -i '/{OLDSUFF}/c:' support/shlib-install 
sed -i -e 's/0x0600/0x0601/' -e 's/6\.0/6.1/' -e 's/RL_VERSION_MINOR\t0/RL_VERSION_MINOR\t1/' readline.h 
./configure --prefix=/usr --libdir=/lib
make $CORES_TO_USE SHLIB_LIBS=-lncurses
make install
mv -v /lib/lib{readline,history}.a /usr/lib
rm -v /lib/lib{readline,history}.so
ln -sfv ../../lib/libreadline.so.6 /usr/lib/libreadline.so
ln -sfv ../../lib/libhistory.so.6 /usr/lib/libhistory.so
mkdir   -v       /usr/share/doc/readline-6.1 
install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-6.1 
cd ..
rm -rvf readline-6.1
tar -xzvf /sources/bash-4.1.tar.gz
cd bash-4.1
./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/bash-4.1 --without-bash-malloc --with-installed-readline
make $CORES_TO_USE
make install
cd ..
rm -rvf bash-4.1
tar -xzvf /sources/libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf libtool-2.2.6b
tar -xzvf /sources/gdbm-1.8.3.tar.gz
cd gdbm-1.8.3
./configure --prefix=/usr
make $CORES_TO_USE
make install
make install-compat
install-info --dir-file=/usr/info/dir /usr/info/gdbm.info
cd ..
rm -rvf gdbm-1.8.3
tar -xzvf /sources/inetutils-1.7.tar.gz
cd inetutils-1.7
./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var --disable-ifconfig --disable-logger --disable-syslogd --disable-whois --disable-servers
make $CORES_TO_USE
make install
mv -v /usr/bin/{hostname,ping,ping6} /bin 
mv -v /usr/bin/traceroute /sbin 
cd ..
rm -rvf inetutils-1.7
tar -xjvf /sources/perl-5.10.1.tar.bz2
cd perl-5.10.1
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
patch -Np1 -i /sources/perl-5.10.1-utf8-1.patch
sed -i -e "s|BUILD_ZLIB\s*= True|BUILD_ZLIB = False|" -e "s|INCLUDE\s*= ./zlib-src|INCLUDE = /usr/include|" -e "s|LIB\s*= ./zlib-src|LIB = /usr/lib|" ext/Compress-Raw-Zlib/config.in
sh Configure -des -Dprefix=/usr -Dvendorprefix=/usr -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dpager="/usr/bin/less -isR"
make $CORES_TO_USE
make install
cd ..
rm -rvf perl-5.10.1
tar -xjvf /sources/autoconf-2.65.tar.bz2
cd autoconf-2.65
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf autoconf-2.65
tar -xjvf /sources/automake-1.11.1.tar.bz2
cd automake-1.11.1
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.11.1
make $CORES_TO_USE
make install
cd ..
rm -rvf automake-1.11.1
tar -xzvf /sources/bzip2-1.0.5.tar.gz
cd bzip2-1.0.5
patch -Np1 -i /sources/bzip2-1.0.5-install_docs-1.patch
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
make -f Makefile-libbz2_so
make clean
make $CORES_TO_USE
make PREFIX=/usr install
cp -v bzip2-shared /bin/bzip2 
cp -av libbz2.so* /lib 
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so 
rm -v /usr/bin/{bunzip2,bzcat,bzip2} 
ln -sv bzip2 /bin/bunzip2 
ln -sv bzip2 /bin/bzcat 
cd ..
rm -rvf bzip2-1.0.5
tar -xzvf /sources/diffutils-2.8.1.tar.gz
cd diffutils-2.8.1
patch -Np1 -i /sources/diffutils-2.8.1-i18n-1.patch
touch man/diff.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf diffutils-2.8.1
tar -xjvf /sources/gawk-3.1.7.tar.bz2
cd gawk-3.1.7
./configure --prefix=/usr --libexecdir=/usr/lib
make $CORES_TO_USE
make install
mkdir -v /usr/share/doc/gawk-3.1.7 
cp    -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-3.1.7 
cd ..
rm -rvf gawk-3.1.7
tar -xzvf /sources/findutils-4.4.2.tar.gz
cd findutils-4.4.2
./configure --prefix=/usr --libexecdir=/usr/lib/findutils --localstatedir=/var/lib/locate
make $CORES_TO_USE
make install
mv -v /usr/bin/find /bin 
sed -i 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb
cd ..
rm -rvf findutils-4.4.2
tar -xjvf /sources/flex-2.5.35.tar.bz2
cd flex-2.5.35
patch -Np1 -i /sources/flex-2.5.35-gcc44-1.patch
./configure --prefix=/usr
make $CORES_TO_USE
make install
ln -sv libfl.a /usr/lib/libl.a
cat > /usr/bin/lex << "EOF" 
#!/bin/sh
# Begin /usr/bin/lex
exec /usr/bin/flex -l "$@"
# End /usr/bin/lex
EOF
chmod -v 755 /usr/bin/lex
mkdir -v /usr/share/doc/flex-2.5.35
cp    -v doc/flex.pdf /usr/share/doc/flex-2.5.35 
cd ..
rm -rvf flex-2.5.35
tar -xzvf /sources/gettext-0.17.tar.gz
cd gettext-0.17
patch -Np1 -i /sources/gettext-0.17-upstream_fixes-2.patch
./configure --prefix=/usr --docdir=/usr/share/doc/gettext-0.17 
make $CORES_TO_USE
make install
cd ..
rm -rvf gettext-0.17
tar -xzvf /sources/groff-1.20.1.tar.gz
cd groff-1.20.1
PAGE=A4 ./configure --prefix=/usr
make $CORES_TO_USE
make docdir=/usr/share/doc/groff-1.20.1 install
ln -sv eqn /usr/bin/geqn 
ln -sv tbl /usr/bin/gtbl 
cd ..
rm -rvf groff-1.20.1
tar -xzvf /sources/gzip-1.4.tar.gz
cd gzip-1.4
./configure --prefix=/usr --bindir=/bin
make $CORES_TO_USE
make install
mv -v /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin
mv -v /bin/{zfgrep,zforce,zgrep,zless,zmore,znew} /usr/bin
cd ..
rm -rvf gzip-1.4
tar -xjvf /sources/iproute2-2.6.31.tar.bz2
cd iproute2-2.6.31
sed -i '/^TARGETS/s@arpd@@g' misc/Makefile
make $CORES_TO_USE DESTDIR=
make $CORES_TO_USE DESTDIR= SBINDIR=/sbin MANDIR=/usr/share/man DOCDIR=/usr/share/doc/iproute2-2.6.31 install
cd ..
rm -rvf iproute2-2.6.31
tar -xzvf /sources/kbd-1.15.1.tar.gz
cd kbd-1.15.1
autoreconf
patch -Np1 -i /sources/kbd-1.15.1-backspace-1.patch
./configure --prefix=/usr --datadir=/lib/kbd
make $CORES_TO_USE
make install
mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin
mkdir -v /usr/share/doc/kbd-1.15.1
cp -R -v doc/* /usr/share/doc/kbd-1.15.1 
cd ..
rm -rvf kbd-1.15.1
tar -xzvf /sources/less-436.tar.gz
cd less-436
./configure --prefix=/usr --sysconfdir=/etc
make $CORES_TO_USE
make install
cd ..
rm -rvf less-436
tar -xjvf /sources/make-3.81.tar.bz2
cd make-3.81
patch -Np1 -i /sources/make-3.81-upstream_fixes-1.patch
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf make-3.81
tar -xzvf /sources/man-db-2.5.6.tar.gz
cd man-db-2.5.6
./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc --disable-setuid --with-browser=/usr/bin/lynx --with-vgrind=/usr/bin/vgrind --with-grap=/usr/bin/grap
make $CORES_TO_USE
make install
cd ..
rm -rvf man-db-2.5.6
tar -xjvf /sources/module-init-tools-3.11.1.tar.bz2
cd module-init-tools-3.11.1
./configure
make check
./tests/runtests
make clean 
./configure --prefix=/ --enable-zlib-dynamic --mandir=/usr/share/man
make $CORES_TO_USE
make INSTALL=install install
cd ..
rm -rvf module-init-tools-3.11.1
tar -xjvf /sources/patch-2.6.1.tar.bz2
cd patch-2.6.1
patch -Np1 -i /sources/patch-2.6.1-test_fix-1.patch
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf patch-2.6.1
tar -xzvf /sources/psmisc-22.10.tar.gz
cd psmisc-22.10
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf psmisc-22.10
tar -xjvf /sources/shadow-4.1.4.2.tar.bz2
cd shadow-4.1.4.2
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in
sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' -e 's@/var/spool/mail@/var/mail@' etc/login.defs
./configure --sysconfdir=/etc
make $CORES_TO_USE
make install
mv -v /usr/bin/passwd /bin
pwconv
grpconv
sed -i 's/yes/no/' /etc/default/useradd
cd ..
rm -rvf shadow-4.1.4.2
tar -xzvf /sources/sysklogd-1.5.tar.gz
cd sysklogd-1.5
make $CORES_TO_USE
make BINDIR=/sbin install
cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
EOF
cd ..
rm -rvf sysklogd-1.5
tar -xzvf /sources/sysvinit-2.86.tar.gz
cd sysvinit-2.86
sed -i 's@Sending processes@& configured via /etc/inittab@g' src/init.c
sed -i -e 's/utmpdump wall/utmpdump/' -e 's/mountpoint.1 wall.1/mountpoint.1/' src/Makefile
make $CORES_TO_USE -C src
make -C src install
cat > /etc/inittab << "EOF"
# Begin /etc/inittab
id:3:initdefault:
si::sysinit:/etc/rc.d/init.d/rc sysinit
l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
su:S016:once:/sbin/sulogin
1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
# End /etc/inittab
EOF
cd ..
rm -rvf sysvinit-2.86
tar -xjvf /sources/tar-1.22.tar.bz2
cd tar-1.22
./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/sbin
make $CORES_TO_USE
make install
cd ..
rm -rvf tar-1.22
tar -xzvf /sources/texinfo-4.13a.tar.gz
cd texinfo-4.13
./configure --prefix=/usr
make $CORES_TO_USE
make install
make TEXMF=/usr/share/texmf install-tex
cd ..
rm -rvf texinfo-4.13
tar -xjvf /sources/udev-151.tar.bz2
cd udev-151
tar -xvf /sources/udev-config-20100128.tar.bz2
install -dv /lib/{firmware,udev/devices/{pts,shm}}
mknod -m0666 /lib/udev/devices/null c 1 3
ln -sv /proc/self/fd /lib/udev/devices/fd
ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
ln -sv /proc/kcore /lib/udev/devices/core
./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin --with-rootlibdir=/lib --libexecdir=/lib/udev --docdir=/usr/share/doc/udev-151 --disable-extras --disable-introspection
make $CORES_TO_USE
make install
install -m644 -v rules/packages/64-*.rules /lib/udev/rules.d/
install -m644 -v rules/packages/40-pilot-links.rules /lib/udev/rules.d/
install -m644 -v rules/packages/40-isdn.rules /lib/udev/rules.d/
cd udev-config-20100128
make install
make install-doc
cd ../..
rm -rvf udev-151
tar -xzvf /sources/nano-2.1.10.tar.gz
cd nano-2.1.10
./configure --prefix=/usr --sysconfdir=/etc/nano --enable-color --enable-multibuffer --enable-nanorc
make $CORES_TO_USE
make install
install -v -m644 -D doc/nanorc.sample /etc/nano/nanorc.sample
install -v -m755 -d /usr/share/doc/nano-2.1.10
install -v -m644 doc/{,man/,texinfo/}*.html /usr/share/doc/nano-2.1.10
cat > /etc/nano/nanorc << "EOF"
set autoindent
set const
set fill 72
set historylog
set multibuffer
unset nohelp
set regexp
set smooth
set suspend
EOF
cd ..
rm -rvf nano-2.1.10
And remember to run [passwd root] to set a root password to let you log in. Now proceed with the normal scripting stuff and booting stuff to finish the build.

LAP - All in One - Toolchain

A couple of quick posts now, to build LFS in as few commands as possible - everything scripted. There will be no make checks. Remember to do your apt-gets if necessary. This run also assumes you have ALL of the sources downloaded in advance and located in /sources on the Amiga Key - including optional stuff like Nano. Best way to get all these is from the /sources directory of a previously successful build.

The script will use the ramdisk, so you should set up a separate terminal window and run:

cat > ~/repeat.sh << "EOF"
#!/bin/sh
# usage: repeat [x] 
while true ; do $2 ; sleep $1 ; done
EOF
chmod +x ~/repeat.sh
cat > ~/clearc.sh << "EOF"
sync && sudo echo 3 | sudo tee /proc/sys/vm/drop_caches
EOF
chmod +x ~/clearc.sh
~/repeat.sh 60 ~/clearc.sh
Next follow the configuration instructions. Then copy the following code and paste it into gedit, and save it into the lfs user's folder. Immediately after the [source /etc/profile] step, run the script. Heck, you can even time it.
cd /tmp
tar -xjvf $LFS/sources/binutils-2.20.tar.bz2
mkdir -v binutils-build
cd binutils-build
../binutils-2.20/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-werror
make $CORES_TO_USE
make install
cd ..
rm -rvf binutils-2.20 binutils-build
tar -jxvf $LFS/sources/gcc-4.4.3.tar.bz2
cd gcc-4.4.3
tar -jxf $LFS/sources/mpfr-2.4.2.tar.bz2
mv -v mpfr-2.4.2 mpfr
tar -jxf $LFS/sources/gmp-5.0.0.tar.bz2
mv -v gmp-5.0.0 gmp
mkdir -v ../gcc-build
cd ../gcc-build
../gcc-4.4.3/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c
make $CORES_TO_USE
make install
ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
cd ..
rm -rvf gcc-4.4.3 gcc-build
tar -jxvf $LFS/sources/linux-2.6.32.8.tar.bz2
cd linux-2.6.32.8
make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include
cd ..
rm -rvf linux-2.6.32.8
tar -jxvf $LFS/sources/glibc-2.11.1.tar.bz2
mkdir -v glibc-build
cd glibc-build
case `uname -m` in  i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;esac
../glibc-2.11.1/configure --prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.11.1/scripts/config.guess) --disable-profile --enable-add-ons --enable-kernel=2.6.18 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
make $CORES_TO_USE
make install
cd ..
rm -rvf glibc-build glibc-2.11.1
SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
$LFS_TGT-gcc -dumpspecs | sed -e 's@/lib\(64\)\?/ld@/tools&@g' -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS 
echo "New specs file is: $SPECS"
unset SPECS
tar -jxvf $LFS/sources/binutils-2.20.tar.bz2
mkdir -v binutils-build
cd binutils-build
CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../binutils-2.20/configure --prefix=/tools --disable-nls --with-lib-path=/tools/lib
make $CORES_TO_USE
make install
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin
cd ..
rm -rfv binutils-2.20 binutils-build
tar -jxvf $LFS/sources/gcc-4.4.3.tar.bz2
cd gcc-4.4.3
patch -Np1 -i $LFS/sources/gcc-4.4.3-startfiles_fix-1.patch
cp -v gcc/Makefile.in{,.orig}
sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
cp -v gcc/Makefile.in{,.tmp}
sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp > gcc/Makefile.in
for file in $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
  cp -uv $file{,.orig}
  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools@g' $file.orig > $file
  echo '
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0
#define STANDARD_STARTFILE_PREFIX_1 ""
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  touch $file.orig
done
tar -jxf $LFS/sources/mpfr-2.4.2.tar.bz2
mv -v mpfr-2.4.2 mpfr
tar -jxf $LFS/sources/gmp-5.0.0.tar.bz2
mv -v gmp-5.0.0 gmp
mkdir -v ../gcc-build
cd ../gcc-build
CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../gcc-4.4.3/configure --prefix=/tools  --with-local-prefix=/tools --enable-clocale=gnu  --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap
make $CORES_TO_USE
make install
ln -vs gcc /tools/bin/cc
cd ..
rm -rvf gcc-4.4.3 gcc-build
tar -xzvf $LFS/sources/tcl8.5.8-src.tar.gz
cd tcl8.5.8
cd unix
./configure --prefix=/tools
make $CORES_TO_USE
make install
chmod -v u+w /tools/lib/libtcl8.5.so
make install-private-headers
ln -sv tclsh8.5 /tools/bin/tclsh
cd ../..
rm -rvf tcl8.5.8
tar -xzvf $LFS/sources/expect-5.43.0.tar.gz
cd expect-5.43
patch -Np1 -i $LFS/sources/expect-5.43.0-spawn-1.patch
patch -Np1 -i $LFS/sources/expect-5.43.0-tcl_8.5.5_fix-1.patch
cp -v configure{,.orig}
sed 's:/usr/local/bin:/bin:' configure.orig > configure
./configure --prefix=/tools --with-tcl=/tools/lib --with-tclinclude=/tools/include --with-x=no
make
make SCRIPTS="" install
cd ..
rm -rvf expect-5.43 
tar -xzvf $LFS/sources/dejagnu-1.4.4.tar.gz
cd dejagnu-1.4.4
./configure --prefix=/tools
make install
cd ..
rm -rvf dejagnu-1.4.4
tar -xzvf $LFS/sources/ncurses-5.7.tar.gz 
cd ncurses-5.7
./configure --prefix=/tools --with-shared --without-debug --without-ada --enable-overwrite
make $CORES_TO_USE
make install
cd ..
rm -rvf ncurses-5.7
tar -xzvf $LFS/sources/bash-4.1.tar.gz
cd bash-4.1
./configure --prefix=/tools --without-bash-malloc
make $CORES_TO_USE
make install
ln -vs bash /tools/bin/sh
cd ..
rm -rvf bash-4.1
tar -xzvf $LFS/sources/bzip2-1.0.5.tar.gz
cd bzip2-1.0.5
make $CORES_TO_USE
make PREFIX=/tools install
cd ..
rm -rvf bzip2-1.0.5
tar -xzvf $LFS/sources/coreutils-8.4.tar.gz
cd coreutils-8.4
./configure --prefix=/tools --enable-install-program=hostname
make $CORES_TO_USE
make install
cp -v src/su /tools/bin/su-tools
cd ..
rm -rvf coreutils-8.4
tar -xzvf $LFS/sources/diffutils-2.8.1.tar.gz
cd diffutils-2.8.1
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf diffutils-2.8.1
tar -xzvf $LFS/sources/findutils-4.4.2.tar.gz
cd findutils-4.4.2
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf findutils-4.4.2
tar -xjvf $LFS/sources/gawk-3.1.7.tar.bz2
cd gawk-3.1.7
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf gawk-3.1.7
tar -xzvf $LFS/sources/gettext-0.17.tar.gz
cd gettext-0.17
cd gettext-tools
./configure --prefix=/tools --disable-shared
make $CORES_TO_USE -C gnulib-lib
make $CORES_TO_USE -C src msgfmt
cp -v src/msgfmt /tools/bin
cd ../..
rm -rvf gettext-0.17
tar -xjvf $LFS/sources/grep-2.5.4.tar.bz2
cd grep-2.5.4
./configure --prefix=/tools --disable-perl-regexp --without-included-regex
make $CORES_TO_USE
make install
cd ..
rm -rvf grep-2.5.4
tar -xzvf $LFS/sources/gzip-1.4.tar.gz
cd gzip-1.4
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf gzip-1.4
tar -xjvf $LFS/sources/m4-1.4.13.tar.bz2
cd m4-1.4.13
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf m4-1.4.13
tar -xjvf $LFS/sources/make-3.81.tar.bz2
cd make-3.81
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf make-3.81
tar -xjvf $LFS/sources/patch-2.6.1.tar.bz2
cd patch-2.6.1
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf patch-2.6.1
tar -xjvf $LFS/sources/perl-5.10.1.tar.bz2
cd perl-5.10.1
patch -Np1 -i $LFS/sources/perl-5.10.1-libc-1.patch
sh Configure -des -Dprefix=/tools -Dstatic_ext='Data/Dumper Fcntl IO POSIX'
make $CORES_TO_USE perl utilities ext/Errno/pm_to_blib
cp -v perl pod/pod2man /tools/bin
mkdir -pv /tools/lib/perl5/5.10.1
cp -Rv lib/* /tools/lib/perl5/5.10.1
cd ..
rm -rvf perl-5.10.1
tar -xjvf $LFS/sources/sed-4.2.1.tar.bz2
cd sed-4.2.1
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf sed-4.2.1
tar -xjvf $LFS/sources/tar-1.22.tar.bz2
cd tar-1.22
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf tar-1.22
tar -xzvf $LFS/sources/texinfo-4.13a.tar.gz
cd texinfo-4.13
./configure --prefix=/tools
make $CORES_TO_USE
make install
cd ..
rm -rvf  texinfo-4.13
strip --strip-debug /tools/lib/*
strip --strip-unneeded /tools/{,s}bin/*
rm -rf /tools/{,share}/{info,man}
Then remember to exit the lfs user mode, and run:
sudo chown -R root:root /media/lfs/tools

Friday 3 September 2010

LAP - Unfinished Business

Various things that have occurred to me as I have gone along with this build. Some, I have been able to incorporate in the instructions (such as unpacking and compiling in ram), and others have just appeared to be too formidable. I am going to list the outstanding stuff here, as a kind of bookmark of things I have yet to figure out how to do.

Firstly, the kernel source folder is left on the system as a compressed folder. It needs to be uncompressed to allow the nvidia drivers to be installed. This is a pain. It would be much better if we could just mount the archive file straight to the file system with out unpacking it.

Apparently, this is possible. I apparently need the packages, FUSE, libarchive, and archivemount. Helpfully, this is not described as bug free.

I also have to test out the beta version of e-uae which is the latest version.

I left most of the kernel options at the default settings when I configured it. It works fine, but it is probably somewhat bloated. I should really read the guidance on configuring the kernel in more detail so I can strip out the unnecessary stuff.

I documented the problems I had getting the system to boot, and I explained the reason I shifted to Grub 0.97. I should really try to get the newer version to work.

Since I am talking about booting issues, I would like to try to get the system to boot from an [init]ial [r]am[d]isk. I think this would allow me to boot the drive with reference to its label rather than having to second guess what device name will be assigned to it on boot. This would allow me to move from machine to machine much more easily.

As far as the Amiga is concerned, it should be possible to install a newer version of the operating system. The next version up from Workbench 3.1 is Amiga OS 3.5. It comes on CD. We can mount the CD ISO image straight to the Linux filesystem by running:

mkdir /media/ISOmount -t iso9660 -o loop [3.5 OS cd].iso /media/ISO

You can then just mount that folder as hd2: in the same way as Shared:.

I would also like to explore some other Amiga software, such as WHDLoad, which allows you to load game disks on to the virtual hard disk. Very useful for multi-disk games.

Openbox has a couple of configuration packages which are referenced in the menu that I have setup. I would like to have those installed.

I can only connect to a WEP enabled network, which is not as secure as a WPA network. I need to work out how the fuck to install and run the wpa_supplicant package. I mean seriously, I have read the BLFS and CBLFS instructions, the Arch and Gentoo guidance, and I still have no fucking clue what I am supposed to be doing.

xterm is pretty crap when compared to the terminals which come with a full Desktop Environment such as Gnome or KDE. I am thinking of replacing it with another terminal such as aterm or eterm.

I am also thinking of installing a simple graphical browser for the linux environment. Dillo is an option, but apparently it does not work with the version of GTK that I have installed. Alternatively the package Links, instead of Lynx, can be setup to work in X as well as the console. I am also tempted to try Firefox, but that may be silly to get a basic browser as it is sure to come with a shitload of dependencies.

The other thing I am aware of is that I have only set up the root user. This is useful because it means I do not trip up over permissions bullshit. On the other hand, it is a security risk. I would not have set this up in this manner to use as a full time machine. If I decide to add further packages, or even install the system to a HDD, then I will want to set up a normal user account to use on a day to day basis.

Finally, I want to see if I can install emulators for other systems such as Gamecube, N64, Playstation, and the PS2.

Thursday 2 September 2010

LAP - Lessons Learned?

One of the points of this whole exercise was to learn something. Have I managed to do that? Well...

Getting a hold of all the source packages is tricky. The server beach mirror has everything in the same place, and as a result is very very useful.

The trio of glibc, gcc and binutils is at the core of Linux from Scratch. They also take the most time to get up and running in both the tool chain build and the actual build. Well, aside for the test suites for the auto* packages. They also take most resources to compile and, presumably, install.

Getting the fucking thing to boot is really tricky. Kernel configuration is an expert level task, but the online resources are very useful if you can wade your way through them. It would be very useful if the book could highlight some common problems, and how to solve them. The interaction between /etc/fstab, grub, and the kernel is not clearly explained, and it could be. The treatment of Grub 1.97 in LFS6.6 in particular is pretty shoddy.

The next tricky bit was the installation of X. It is almost like doing the tool chain all over again. It involves multiple packages, and you have to keep your wits about you. I was able to go though it with NVidia and Intel graphics, but I haven't tried it with ATI hardware yet. Switching from Nvidia to Intel should, I feel, be easier than uninstalling and reinstalling the driver every fecking time, but it is the only way I could get it to work. The problem is that the Nvidia driver swans about this place like lord of the manor and deletes all the DRI files that the Intel driver needs.

As for the other hardware, networking is a hit or a miss depending on your card. I tried three different network cards and the results were:

Linksys WMP54GS (Broadcom 4306) - kernel driver worked fine, but needed (non-free) firmware to be obtained independently.
Abit Airpace (Atheros) - an absolute doddle - works as soon as the Atheros options are enabled in the kernel configuration.
Compaq Mini built in (Broadcom 43XX - not sure exactly) - bastard hard. You have to download and compile a stand alone module for the kernel AND disable the existing broadcom drivers before this will work.

Audio was actually a piece of piss. Just make sure you enable the correct drivers in the Kernel configuration, and then install alsa. That, literally, is all there is to it. I am aware, like some native tribesman seeing fighter planes pass high over head, that there is a whole world of fucking hurt out there that I know very, very, little about. In my case, that world is called pulseaudio.

When it comes to the LFS build most things are very well explained. One exception is static and dynamic libraries. I still have only a very sketchy idea what the difference is and what they do. A strong point behind doing a LFS build is to learn how this stuff works, but I am still in the dark.

Also, the sed stuff is a bit of a nightmare. Clearly it is doing something, but it is far from clear, and intuitive, how it is doing what it is doing. Given how prevalent sed is in the build, it would be useful if LFS could give an explanation, or even link to one, about how it fucking works. In a similar, but far less prevalent, vein not all of the patches that are applied are fully explained.

Dependency resolution is a bitch. This is why more user friendly distributions are use friendly! You can just type:

apt-get install libgtk2.0-0

in ubuntu. Sorry:

sudo apt-get install libgtk2.0-0

and it will go and get all the dependencies for you. With LFS, or BLFS you need to read through screeds and screeds of material to find out exactly what packages you need to be able to build gtk, then find them on the internet. THEN find which packages you need to build those ones, etc etc. Then you need to install them all in the right order. It is a bit of a trial. It's a shame that BLFS couldn't maintain a search able database of dependency information on the website. You could then type in the package you wanted to install and it would come back with all the dependencies you would need on top of LFS to get your package to work. It would be AWESOME if the search could auto generate a .wget file with links to all the source code for the dependencies as well. I mean, all of this information is in BLFS anyway - it is just a matter of managing it properly.

I also learned a couple of useful tweaks to the standard LFS instructions which dramatically improve performance. Setting the variable CORES_TO_USE to either -j2 or -j4 made switching the build between my hyperthreading CPU and my Quad Core very easy. Also, using a ramdisk as the working area to unpack archives and compile the software really sped things up - its just a shame that GCC needs a machine with more than 2Gb of RAM to compile in that scenario.

In terms of e-uae, I was actually pleasantly surprised. Other than needing to install GTK to get the GUI and SDL to get fullscreen graphics, it mostly worked fine. I am still not entirely sure what SDL is, but is seems to work.

The Amiga software itself was interesting. The Green Amiga Alien's guides were essential. The only massive problem I encountered was the case sensitive rom file to enable the harddisk, and that was easily solved by just reading the fucking error messages. The documentation for installing the IPF support was woeful, but trial and error got it to work.

In summary, when I started this project a couple of months ago, I had absolutely no idea if it would work. By and large, however, it has. The base system that I have managed to build is one that is a very flexible base. I have chosen to stick an Amiga emulator on top of the install, but you could just as easily stick a desktop environment and an office suite, creating a system that you could actually use for day to day tasks.

Wednesday 1 September 2010

LAP - AWeb

The final package I am going to install in the main build is a web browser for the Amiga. For the avoidance of doubt in the heads of imbeciles, there is no point in doing this if you did not or could not install the network drivers for your system.

Much like e-uae itself, the AWeb browser needs a toolkit to display stuff like buttons, menus and so on. Actually the toolkits we are going to install are used by a number of other applications, so they are useful in and of themselves. One thing which uses them is a replacement icon set, so we will install that as well just now. In addition, the makers of the web browser AWeb no longer supply copies of their software, so I had to resort to archive.org. Seems to work fine though.

umount -v /media/amiga
sudo mkdir /media/lfs 
sudo mount -v -t ext3 /dev/disk/by-label/amiga /media/lfs 
cd /media/lfs/sources/amiga

wget http://aminet.net/util/libs/mui38usr.lha
wget http://aminet.net/dev/gui/ClassAct2Demo.lha
wget http://aminet.net/util/wb/NewIcons46.lha
wget http://web.archive.org/web/20070102173257/http://aweb.sunsite.dk/files/full/AWeb_APL34_full_020.lha

Again, when you have booted to the Amiga you then want to move, or copy, the files from /sources/amiga to ~/amiga/shared/ so that the files are available to the emulated Amiga. Then boot your A1200HD machine.

The first bit of the toolkit we install is Mui, which sounds halfway been a pretentious Moi and a Hawaiian island. In actual fact it sounds like it is GTK for Workbench.
lha x Shared:mui38usr.lha ram:
Open this up in the same way as Picasso. In other words you double click on the ramdisk, then double click on the MUI directory, and finally double click on the icon called "Install-MUI". When asked to select a place to install MUI, click on show drives and select dh0: Installing to the root of dh0: is fine. You should choose to install all image sets. The example programs are not required.
Once it is installed, reboot the Amiga, and navigate to the system->mui folder and run the Mui program located there. When the program opens, hold down the right mouse button and go to the menu at the top of the screen – not the Mui program, but the very top of the desktop. There, select project, choose open, and select Stuntzi.prefs. Save your selection.

ClassAct is another toolkitty type thing which works alongside MUI. It may even be a rival to MUI in some areas of operation.
lha x Shared:classact2demo.lha ram:
Double click on the ram disk and then on "ClassAct" and then on "Install_Classes". The classes should be installed to the default location, which should be SYS:Classes. All other options are OK by default as well, so just 'Yes' and 'Proceed' your way through the install. If you select Novice instead of Intermediate user it will just fire straight through without asking you anything.

The two toolkits are actually the dependencies for a new icon set, so since we have installed the toolkit packages, we may as well now install a new icon set. We want to do this because the Workbench icons are designed to be viewed on an interlaced display. The result is that when you view them through the uaegfx: card they lose half their height and look a bit stupid.
lha x Shared:newicons46.lha ram: 
You then, again, double click on the ram disk, and then double click on "NewIconsV4". Then double click on "Install" and finally on "Install_NewIcons". We are not given the chance to install these as a novice, so go for intermediate. Select all check boxes that appear. You should get the opportunity to install a high end library. Take it.
The first install location should be System:Utilities. You should then be given the chance to update a disk or partition image. It should auto choose dh0:, but if not click on show drives and select dh0: and then proceed. Do the same for dh1:. I think this affects the drawer images IN that device as opposed to its icon on the desktop. I mostly think this because the next thing the install does is offer you the chance to change the desktop icons. Do this in the same way. It offers you different icons this time.
The next install options should be SYS:Storage - Proceed, then Help: - Proceed. When it gets to "include:" you need to step in. Change the install path to System:Utilities, by clicking on dh0:System, then scrolling down the list and choosing Utilities. The "Selected Drawer" box should now show "System:Utilities", and if it does click on Proceed. Next it should ask about the example source code and suggest installing it to Work:. You have not defined work: so choose to install it to System:Storage as a fallback, and then do exactly the same for the Autodoc material.
Then, after a reboot, go to System->Prefs->newiconsprefs, and check the boxes next to RTG Mode, no borders, and transparent.

Finally we come to Aweb which is a web browser for Amiga OS. It is, when compared with today's browsers, basic.
lha x Shared:AWeb_APL34_full_020.lha ram:
Start the install in exactly the same way as before. When you start the install it will suggest installing to the ram disk. This is a stupid idea. Instead, install to System:. When asked, you can confirm that you have more than 2Mb of ram. About 254Mb more in fact.
You then get a message telling you that plugins should be installed to AWeb_APL:, and not AWeb3:. Hmm, OK.
So, plugins then. From the open AWeb_APL_020 folder, double click on plugins. From there you should see three folders, which correspond to the jpeg, gif and png plugins. The procedure is really the same for each one. Avoid using the built in scripts. They are a pain in the arse, and only half work. Do it manually instead. Drop to a Shell and run:
copy ram:AWeb_APL_020/Plugins/awebjfif68020/awebjfif.awebplugin AWeb_APL:Storage
copy ram:AWeb_APL_020/Plugins/awebgif/awebgif.awebplugin AWeb_APL:Storage
copy ram:AWeb_APL_020/Plugins/awebpng/awebpng.awebplugin AWeb_APL:Storage
You should then double click the AWeb icon in the AWeb_APL folder. When the program loads, hold down the right mouse button to bring up the menu, and then go to Settings, and then Browser Settings. From the window that comes up (called AWeb browser settings) click on the IMAGE/GIF line under the 'Type' column. The click on the box at the bottom called 'Action', which brings up a drop down menu from which you choose "AWeb Plugin". Then click the icon next to the "Name" box (just under the arrows next to the box now showing "AWeb Plugin"). From the dialogue box that pops up select storage, select awebgif.awebplugin and hit OK. Now do the same for JPEG and PNG (which are just under GIF). Hey presto, your AWeb browser can now display images!