Total Pageviews

Friday, December 30, 2011

Finished Compiling!

I have finally finished compiling all of the sources. I also compiled the kernel, and installed GRUB and am now ready to boot for the first time. MBR has been installed, and fstab adjusted. I built the system on an external drive and therefore was being recognized as sdb. When it is installed in the laptop, it will be recognized as sda. 

Monday, December 26, 2011

Continued Compiling

I continued compiling today. I am finally getting to the end of Chapter 6. Today I compiled and installed:

diffutils-3.2
gawk-4.0.0
findutils-4.4.2
flex-2.5.35
gettext-0.18.1.1
groff-1.21
GRUB-1.99
gzip-1.4
iproute2-2.6.39
kbd-1.1.15.2
less-444
libpipline-1.2.0
make-3.82
xz-5.0.3
man-db-2.6.0.2
module-init-tools-3.16
patch-2.6.1
psmisc-22.14
shadow-4.1.4.3
sysklogd-1.5
sysvinit-2.88dsf
tar-1.26
texinfo-4.13a

Now, it has taken me a long time to get to this point. All due to the fact I let it sit for so long. It is important to note that if you shutdown the system, it is important to create the environment again, namely:


mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

And:

chroot "$LFS" /tools/bin/env -i     HOME=/root TERM="$TERM" PS1='\u:\w\$ '     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin     /tools/bin/bash --login +h

Otherwise the built binaries won't get installed in the proper locations.

Sunday, December 25, 2011

Lazy Christmas Day

Since I had a lot of free time on Christmas, I decided to pick up on LFS. Having previously downloaded everything, it makes compiling quite easy. I was able to compile and install:

readline
bash
libtool
gdbm
inetutils
perl
autoconf
automake

Actually most time the time today was spent waiting for the tests to complete. In other words, the configure and makes went rather quickly, but the tests that were run prior to the install, took quite a bit of time. I had to patch two pieces of source code, both readline and bash. The patching takes place as follows. After I chrooted the environment, the old /home/lfs becomes "/". Then I stored all the patches in the patches directory, and all of the tar files in the tar-files directory. To patch readline, I moved bash-4.2.tar.gz, and then unzipped and untarred it:

mv tar-files/bash-4.2.tar.gz /
tar zxvf bash-4.2.tar.gz

cd bash-4.2
mv ../patches/ bash-4.2-fixes-3.patch /
patch -Np1 -i ../bash-4.2-fixes-3.patch

Then after patching, I configured  and compiled:

./configure --prefix=/usr --bindir=/bin     --htmldir=/usr/share/doc/bash-4.2 --without-bash-malloc     --with-installed-readline

make

Once you get the knack of building, everything is pretty much straight forward. There is the untarring of the sources, patching if required, configuration, compiling, testing, and finally installing.








Monday, December 12, 2011

A New Disk

I am building my system on an old HP Pavilion. I originally purchased a 160 GB drive, loaded Fedora on it, and then started the build. I decided some time later, that I wanted a dedicated drive for my  Linux From Scratch install. So I bought a 2nd, 160 GB drive.

I then went into gparted and laid out the disk as I wanted. I made a 9.5 root filesystem,  a 4+ gig swap partition, a 50 gig /usr partition, and a 35 gig home partition. I made filesystems on all the partitions except for the swap partition.

I then mounted the '/' partition and copied all of my work to it. In other words, the new disk came up as /dev/sdf. The first partition was mounted as:

mount /dev/sdf1 /mnt


I then copied everything from my /home/LFS to the /mnt, and the umounted it:

umount /mnt

Finally I mounted the new filesystem over the topof the old work:

mount /dev/sdf1 /home/LFS

It could have been mounted elsewhere, but I chose that point because it agrees with the LFS account I had set up.








Sunday, November 27, 2011

Entering the Chroot Environment

Enough of the system is built now to enter into a chrooted environment. If you're not clear on what a chrooted environment is, think of it as ftp'ing into a properly set-up Linux or Unix server. If the ftp is chrooted you don't see the entire system, what you see is the ftp environment and you are probably limited to the pub directory. Below is a listing of the root directory prior to going into the chrooted environment. Below the list I will go into the chrooted system.

gcr@localhost /]$ ls -larth /
total 154K
drwxr-xr-x.   2 root root    0 Dec 31  1969 zfs-kstat
drwxr-xr-x.   2 root root 4.0K May 18  2011 srv
drwxr-xr-x.   2 root root 4.0K May 18  2011 opt
drwxr-xr-x.   2 root root 4.0K May 18  2011 mnt
drwx------.   2 root root  16K Nov  5 14:40 lost+found
drwxr-xr-x.  12 root root 4.0K Nov  5 14:49 usr
drwxr-xr-x.  18 root root 4.0K Nov  5 15:26 var
drwxrwxr-x.   2 root root 4.0K Nov  5 19:12 .config
dr-xr-xr-x.   2 root root  12K Nov  5 20:28 sbin
dr-xr-xr-x.   2 root root 4.0K Nov  5 20:28 bin
dr-xr-xr-x.  20 root root  12K Nov  7 16:32 lib
lrwxrwxrwx.   1 root root   15 Nov  7 17:17 tools -> /home/LFS/tools
drwxr-xr-x.   2 root root 4.0K Nov 13 17:53 NAS
drwxr-xr-x.   7 root root 4.0K Nov 16 19:04 home
dr-xr-xr-x.   5 root root 1.0K Nov 19 21:36 boot
dr-xr-xr-x. 184 root root    0 Nov 27 11:18 proc
drwxr-xr-x.   7 root root    0 Nov 27 11:18 selinux
drwxr-xr-x.  13 root root    0 Nov 27 11:18 sys
drwxr-xr-x.   2 root root   40 Nov 27 11:18 media
drwxr-xr-x.  19 root root 3.7K Nov 27 11:18 dev
-rw-rw-r--.   1 root root  47K Nov 27 11:18 .readahead
dr-xr-xr-x.  25 root root 4.0K Nov 27 11:18 ..
dr-xr-xr-x.  25 root root 4.0K Nov 27 11:18 .
drwxr-xr-x. 135 root root  12K Nov 27 12:31 etc
drwxr-xr-x.  34 root root 1.2K Nov 27 12:32 run
dr-xr-x---.  18 root root 4.0K Nov 27 12:44 root
drwxrwxrwt.  90 root root 4.0K Nov 27 18:58 tmp
[gcr@localhost /]$

This is the command taken directly from the book:

chroot "$LFS" /tools/bin/env -i     HOME=/root TERM="$TERM" PS1='\u:\w\$ '     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin     /tools/bin/bash --login +h

Now the new root:

root:/# ls
Desktop    Public           binutils-build             gcc-4.6.2              glibc-build  mnt             proc  sys        var
Documents  Templates        binutils-build-first-pass  gcc-4.6.2-first-build  home         mpfr-3.1.0.tar  root  tar-files  wget-list
Downloads  Videos           boot                       gcc-build              lib          new-download    run   tmp
Music      bin              dev                        gcc-build-first-pass   linux-3.1    opt             sbin  tools
Pictures   binutils-2.21.1  etc                        glibc-2.14.1           media        patches         srv   usr
root:/#

The above is actually the root directory of LFS or /home/LFS

root:/# pwd
/
root:/#






Sunday, November 20, 2011

RSYNC

I wanted to backup my work on the new NAS volume I created. Specifically, everything in the /home directory. The first time I backed it up I used "cp -rp". That took a which to backup since I am currently using a USB port. Anyway, as you can see below its about 7 gig and growing. So the next time I used rsync.
The first time I used rsync it took about the same amount of time. Below the output of the df you'll see rsync in action. Rsync, after the first transfer, and this could be to a remote host, will copy the new files.

gcr@localhost ~]$ df -h /NAS
Filesystem            Size  Used Avail Use% Mounted on
NAS                   2.7T  6.9G  2.7T   1% /NAS
[gcr@localhost ~]$

Basically after backing up the /home directory, the only changes have been as a result of web action. So instead of backing up the 7 gig again, only a small portion of it gets moved:

bash-4.2# rsync -av /home /NAS
sending incremental file list
rsync: readlink_stat("/home/gcr/.gvfs") failed: Permission denied (13)
home/gcr/.xsession-errors
home/gcr/.kde/share/apps/nepomuk/repository/main/data/virtuosobackend/
home/gcr/.kde/share/apps/nepomuk/repository/main/data/virtuosobackend/soprano-virtuoso.db
home/gcr/.kde/share/apps/nepomuk/repository/main/data/virtuosobackend/soprano-virtuoso.trx
home/gcr/.kde/share/apps/okular/docdata/19908381.w_free01-2.pdf.xml
home/gcr/.mozilla/firefox/t4e2qibe.default/cookies.sqlite
home/gcr/.mozilla/firefox/t4e2qibe.default/cookies.sqlite-shm
home/gcr/.mozilla/firefox/t4e2qibe.default/cookies.sqlite-wal
home/gcr/.mozilla/firefox/t4e2qibe.default/places.sqlite-shm
home/gcr/.mozilla/firefox/t4e2qibe.default/places.sqlite-wal
home/gcr/.mozilla/firefox/t4e2qibe.default/Cache/_CACHE_001_

sent 23399659 bytes  received 21406 bytes  57758.48 bytes/sec
total size is 6026219118  speedup is 257.30


This is much fast, especially if it is to a remote host.

Saturday, November 19, 2011

Finished installing remaining packages of 2nd pass




I left off at the install of tcl,  so today I picked up with the installation of expect and continued on. Below you will find the commands I used to untar the particular packages. Most of the packages took the same steps to untar, configure, make, test, and install. There were two glitches. One compile required 'yacc'. yacc was not on my system, so I had to install bison. yacc is part of Bison.

The other problem I had was coreutils. coreutils had an xz extension.I had never seen an xz extention. Luckily, I had xz installed on my system. I used it to decompress the file, then used tar to extract it. Outside of that everything went smoothly.

xz coreutils-8.14.tar.xz

tar jxvf expect5.45.tar.gz   
tar zxvf dejagnu-1.5.tar.gz      
tar zxvf check-0.9.8.tar.gz      
tar zxvf ncurses-5.9.tar.gz      
tar zxvf bash-4.2.tar.gz      
tar jxvf bzip2-1.0.6.tar.gz      
tar zxvf bzip2-1.0.6.tar.gz      
tar jxvf coreutils-8.14.tar.xz      
tar zxvf coreutils-8.14.tar.xz      
tar xvf coreutils-8.14.tar      
tar zxvf diffutils-3.2.tar.gz      
tar zxvf file-5.09.tar.gz      
tar zxvf  findutils-4.4.2.tar.gz      
tar jxvf gawk-4.0.0.tar.bz2      
tar zxvf gettext-0.18.1.1.tar.gz      
tar zxvf grep-2.9.tar.gz      
tar zxvf gzip-1.4.tar.gz      
tar jxvf m4-1.4.16.tar.bz2      
tar jxvf make-3.82.tar.bz2      
tar jxvf patch-2.6.1.tar.bz2      
tar jxvf perl-5.14.2.tar.bz2      
tar jxvf sed-4.2.1.tar.bz2      
tar jxvf tar-1.26.tar.bz2      
tar zxvf texinfo-4.13a.tar.gz      
tar jxvf xz-4.0.3.tar.bz2      

~