Total Pageviews

Tuesday, October 15, 2013


Building GCC from source


A request was made to upgrade GCC to the latest version. Since the current version 4.8.1 was not in the repo. I decided to build it from scratch. Speaking of scratch, I used the instructions from LFS, which I had prevoiusly used to build GCC and four times. I downloaded and built several packages that were required for the testing of GCC once it was built:
tcl8.6.1-src.tar.gz
expect5.45.tar.gz
dejagnu-1.5.1.tar.gz
 
Building required version of TCL:
cd unix &&
./configure --prefix=/usr           \
            --without-tzdata        \
            --mandir=/usr/share/man \
            $([ $(uname -m) = x86_64 ] && echo --enable-64bit) &&
make &&

sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
    -e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
    -i tclConfig.sh
Installing TCL:
make install &&
make install-private-headers &&
ln -v -sf tclsh8.6 /usr/bin/tclsh &&
chmod -v 755 /usr/lib/libtcl8.6.so
Building Expect:
./configure --prefix=/usr       \
            --with-tcl=/usr/lib \
            --enable-shared     \
            --with-tclinclude=/usr/include &&
make
Installing Expect:
make install &&
ln -svf expect5.45/libexpect5.45.so /usr/lib
Building Dejagnu:
./configure --prefix=/usr &&
makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi &&
makeinfo --plaintext       -o doc/dejagnu.txt  doc/dejagnu.texi
Installing Dejagnu:
make install &&
install -v -dm755   /usr/share/doc/dejagnu-1.5.1 &&
install -v -m644    doc/dejagnu.{html,txt} \
                    /usr/share/doc/dejagnu-1.5.1
Again, the three previous packages are for testing of the GCC installation, but with a package this large, it is wise to test it. Now on to the GCC build itself:
tar xvf gcc-4.8.1.tar.bz2
cd gcc-4.8.1
GCC wants to be built in a separate directory:
sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in         &&
sed -i 's/\(install-data-am:\).*/\1/'             libffi/include/Makefile.in &&
sed -i 's/install_to_$(INSTALL_DEST) //'          libiberty/Makefile.in      &&
sed -i 's@\./fixinc\.sh@-c true@'                 gcc/Makefile.in            &&

case `uname -m` in
      i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;;
esac &&

mkdir ../gcc-build &&
cd    ../gcc-build &&

../gcc-4.8.1/configure          \
    --prefix=/usr               \
    --libdir=/usr/lib           \
    --libexecdir=/usr/lib       \
    --enable-shared             \
    --enable-threads=posix      \
    --enable-__cxa_atexit       \
    --disable-multilib          \
    --disable-bootstrap         \
    --disable-install-libiberty \
    --with-system-zlib          \
    --enable-clocale=gnu        \
    --enable-lto                \
    --enable-languages=c,c++,fortran,go,java,objc,obj-c++ &&
make

Now to test the make. Warning, this check may take several hours:
ulimit -s 32768 &&
make -k check   &&

../gcc-4.8.1/contrib/test_summary
Now become root and install the build:
make install &&

ln -v -sf ../usr/bin/cpp /lib &&
ln -v -sf gcc /usr/bin/cc     &&

chown -v -R root:root \
    /usr/lib/gcc/*linux-gnu/4.8.1/include{,-fixed} \
    /usr/lib/gcc/*linux-gnu/4.8.1/ada{lib,include}

Saturday, December 1, 2012

Milestone KDE is working

I will try and go back and document what I did to get KDE working, but the biggest thing was to get MesaLib installed. I had the xfce environment working for a few weeks now, but I want KDE. I compiled everything that was necessary for it, except the kde-desktop. That continued to get an error because of a missing library. That was supposed to be built in MesaLib. When I originally built MesaLib I could not get it built per the book, so I ended up just typing configure and make. That left out the library KDE needed. So I went back and rebuilt MesaLib starting with everything, and eliminating lines to configure until I found something that worked. I am still not certain what caused the KDE-Desktop to fail, I need to go back and figure out the exact culprit. But for now I have something that works, Rebuilding Mesa made me have to go back and rebuild some other thing that were built on the original Mesa, like kdelibs, but for now I will take what I have.

Wednesday, November 21, 2012

Building a Bunch of Packages



The are a series of things one must build that take the same route for each build. Example:
You untar the package:
tar xvf package
You change the directory to where it was untarred:
cd packagedir
./configure $XORG_CONFIG
make
make install

In the case of the fonts that need to be built, there are thirty three font packages that have to be built. Luckily we have computers and shell scripts.
I have modified the script in the documentation slightly to fit my needs. First I created a file, called ‘file’, that contains the name of the tar file of the font I want to build. Next I create a directory that contains all of the tar files of those same fonts. Now here is the modified script:
for package in $(grep –v ‘#’ /usr/local/src/blfs/fonts/files)
#Above gets just the name of the compressed tar file
#Example encodings-1.0.4.tar.bz2
do
packagedir=${package%.tar.bz2}
# Above line strips off “.tar.bz2”
tar xvf $package
pushd $packagedir
# Above changes to packagedir, but saves where you came from
./configure $XORG_CONFIG
make
make install
popd
#Above line returns where you came from
Done

And thre you have it. That script will build the thirty-three font packages. This same principle will be used to build Xorg Protocol Headers, as well as, Xorg Applications.

Wednesday, November 14, 2012

Lesson Learned, Don't stop in the middle of something

I made the mistake of stopping the the installation of X11 way back in January. As a result some of what I compiled and installed back in January, was no long compatible with what is on the Beyond Linux From Scratch (BLFS) page. As a result I had to recompile and install a lot of stuff to move on again. Once that was done, I was able to proceed again. Basically it boiled down to reinstalling  the the X11, that way I knew I had a good baseline, rather than continuing to get software that was incompatible with what was already installed. When I left off in January, BLFS was at 7.0, now it is at 7.2, thus the incompatibilities.I now have a working X11, working on the Seamonkey browser and KDE now. I'll write up a more detailed version of what I did to build X11 later.

Saturday, November 3, 2012

Well, after nearly a year, I have started back up on Linux From Scratch. I left off at a bootable system, but only a command line interface. For me it is easier to work in a GUI environment, so I had started building X11. X11 no longer builds as one bundle. I am well on my way, but there is lots to be done. I left off in January compiling the applications for X11, the last two days I have worked on completing them.

total 176K
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 xbitmaps-1.1.0
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 bdftopcf-1.0.3
drwxr-xr-x  4   501   20 4.0K Jan 16  2012 iceauth-1.0.5
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 luit-1.1.0
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 mkfontdir-1.0.6
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 mkfontscale-1.0.9
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 sessreg-1.0.7
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 setxkbmap-1.2.0
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 smproxy-1.0.5
drwxr-xr-x  5 root  root 4.0K Jan 16  2012 twm-1.0.7
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 x11perf-1.5.4
drwxr-xr-x  4   501   20 4.0K Jan 16  2012 xauth-1.0.6
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xbacklight-1.1.2
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xclock-1.0.5
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xcmsdb-1.0.3
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xcursorgen-1.0.4
drwxr-xr-x  4 root  root 4.0K Jan 16  2012 xdpyinfo-1.3.0
drwxr-xr-x  2 root  root 4.0K Jan 16  2012 xdriinfo-1.0.4
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xev-1.1.0
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xgamma-1.0.4
drwxr-xr-x  3 root  root 4.0K Jan 16  2012 xhost-1.0.4
drwxr-xr-x  5   501   20 4.0K Jan 16  2012 xinit-1.3.1
drwxr-xr-x  3 root  root 4.0K Nov  1 08:57 xwd-1.0.4
drwxr-xr-x  3 root  root 4.0K Nov  1 08:59 xpr-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:00 xset-1.2.2
drwxr-xr-x  4 root  root 4.0K Nov  1 09:03 xmodmap-1.0.5
drwxr-xr-x  4 root  root 4.0K Nov  1 09:05 xwininfo-1.1.2
drwxr-xr-x  3 root  root 4.0K Nov  1 09:06 xkill-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:09 xprop-1.2.1
drwxr-xr-x  3 root  root 4.0K Nov  1 09:10 xwud-1.0.3
drwxr-xr-x  4 root  root 4.0K Nov  1 09:14 xrandr-1.3.5
drwxr-xr-x  3 root  root 4.0K Nov  1 09:15 xlsatoms-1.1.0
drwxr-xr-x  3 root  root 4.0K Nov  1 09:16 xkbutils-1.0.3
drwxr-xr-x  3 root  root 4.0K Nov  1 09:17 xsetroot-1.1.0
drwxr-xr-x  3 root  root 4.0K Nov  1 09:22 xvinfo-1.1.1
drwxr-xr-x  3 root  root 4.0K Nov  1 09:23 xrefresh-1.0.4
drwxr-xr-x  4   500  500 4.0K Nov  1 09:25 xinput-1.5.3
drwxr-xr-x  3 root  root 4.0K Nov  1 09:26 xkbevd-1.1.2
drwxr-xr-x  4 16209   50 4.0K Nov  1 09:27 xrdb-1.0.9
drwxr-xr-x  4 root  root 4.0K Nov  1 09:28 xlsclients-1.1.2
drwxr-xr-x  4  1000 1000 4.0K Nov  1 09:29 xkbcomp-1.2.3
drwxr-xr-x  5 root  root 4.0K Nov  2 07:26 ..
drwxr-xr-x  2 root  root 4.0K Nov  2 13:30 tars
-rw-r--r--  1 root  root    0 Nov  2 13:33 xapps
drwxr-xr-x 44 root  root 4.0K Nov  2 13:33 .

Monday, January 16, 2012

Beyond Linux From Sctrach

My last post stated I had a bootable OS now. Once bootable, I needed a network connection. I started trying to get DHCP to work, but after running into some problems, I decided to go with a fixed address, and return to DHCP later. The one thing I find annoying is not being able to cut and paste, so I decided the first thing I needed to get working was some sort of Desktop. The windowing system will be based on X, so I jumped to Xorg to try and get that working. There is a LOT to compiling X. I remember way back in the early 90ties, I download X11 and it honestly took me three days of just compiling to get it to work. Of course that was on a Sun3 system, running Sun OS. I have a faster system, but still this is going to be a lot of work. For example, this is just one section of Xorg, that has to be downloaded, compiled, and installed:
                                             
http://xorg.freedesktop.org/releases/individual/proto/bigreqsproto-1.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/compositeproto-0.4.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/damageproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/dmxproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/dri2proto-2.6.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/fixesproto-5.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/fontsproto-2.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/glproto-1.4.14.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/inputproto-2.0.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/kbproto-1.0.5.tar.bz2
# printproto required for Java
http://xorg.freedesktop.org/releases/individual/proto/printproto-1.0.5.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/randrproto-1.3.2.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/recordproto-1.14.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/renderproto-0.11.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/resourceproto-1.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/scrnsaverproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/videoproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xcmiscproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xextproto-7.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86bigfontproto-1.2.0.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86dgaproto-2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86driproto-2.1.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xf86vidmodeproto-2.3.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xineramaproto-1.2.1.tar.bz2
http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.22.tar.bz2
 
 
Luckily, using wget, the downloads are made easier. And with a few short scripts, so is the compiling. More on that later. 

Monday, January 2, 2012

Finally boots

I have spent the last two days trying to get a bootable kernel. Well, it finally boots. I kept ignoring an error that was right in from of me. The error:

Cannot open root device "sda1" of unknown-block(2,0)
....

hda1
hda2
hda3
hda4

I kept trying to get the machine to recognize /dev/sda, when in fact I should have been looking for /dev/hda. I made sure the disk interface was being recognized, the filesystem was in the kernel,, and a number of other things I compiled into the kernel. I spent a lot of time running "make menuconfig" and installing  new kernels. The biggest reason I was trying to get /dev/sda recognized, was when I was working on the drive externally, Fedora was seeing it as /dev/sdb. Finally I changed my grub.cfg to look for /dev/hda and it booted. There are further problems, I have only a command line interface, but now I can move on the Beyond Linux From Scratch.

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      

~                         

Tuesday, November 15, 2011

A Slight Diversion

A few weeks ago I purchased (4) 1.5 terabyte drives. The first time I configured them I had a volume of over 5 terabytes. Next I tried raidz, but currently I have it configured under RAIDZ2. Both RAIDZ and RAIDZ2 were built using zfs. ZFS is native to Solaris, but can be installed on Linux.

I had running Fedora 15, and installed it:

yum install zfs-fuse

Although the startup script was installed in /etc/init.d, I had to execute the following to have it started at boot time:

chkconfig zfs-fuse on

To create the volume:

zpool create NAS raidz2 sdb sdc sdd sde

It automatically was mounted and just like in Solaris, makes no entry in /etc/fstab.

Eventually I will pull a drive and see if I can still get to the drive. Here is the content of the volume:

-bash-4.2# df -h /NAS
Filesystem Size Used Avail Use% Mounted on
NAS 2.7T 5.0G 2.7T 1% /NAS
-bash-4.2# zpool status
pool: NAS
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
NAS ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
sdb ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
sde ONLINE 0 0 0

errors: No known data errors
-bash-4.2#

Saturday, November 12, 2011

Compiling gcc on the 2nd pass

This is the built of gcc for the 2nd time. Before I continue, I want to point out a mistake I made with wget. Earlier I posted that the easiest way to download the sources is to use wget with a wget-list. I used the wget-list development list:

http://www.linuxfromscratch.org/lfs/view/development/wget-list

I should have used:

http://www.linuxfromscratch.org/lfs/view/stable/wget-list

I noticed this when gcc did not patch correctly. To rectify this, I downloaded the correct sources and rebuilt gcc.

So, the first step after downloading the correct sources I untarred the gcc sources. It isn't necessary to use the "v" switch when untarring a tar file, but I like to see that something is happening. So here I untar the file:

tar jxvf gcc-4.6.1.tar.bz2

The extraction of the file creates a directory:

gcc-4.6.1

Next the source needs to be patched:


cd gcc-4.6.1

patch -Np1 -i ../gcc-4.6.1-startfiles_fix-1.patch

Then in following the directions laid out in the manual:

cp -v gcc/Makefile.in{,.orig}

sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp 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

case $(uname -m) in x86_64) for file in $(find gcc/config -name t-linux64) ; do \ cp -v $file{,.orig} sed '/MULTILIB_OSDIRNAMES/d' $file.orig > $file done ;; esac

Notice in some of the above lines, there is the "\".
This is the line continuation character. In other words all
could be on one line, but the continuation may make it clearer,
or because of the length needs to be continued on the next line.

Now while still in the gcc directory there are three files that need to be untarred and renamed:

tar -jxf ../mpfr-3.1.0.tar.bz2 mv -v mpfr-3.1.0 mpfr tar -jxf ../gmp-5.0.2.tar.bz2 mv -v gmp-5.0.2 gmp tar -zxf ../mpc-0.9.tar.gz mv -v mpc-0.9 mpc


Now create the build directory and cd to it:

mkdir -v ../gcc-build cd ../gcc-build

Now set things up to compile:

CC="$LFS_TGT-gcc -B/tools/lib/" \ AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \ ../gcc-4.6.1/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 --disable-libgomp \ --without-ppl --without-cloog \ --with-mpfr-include=$(pwd)/../gcc-4.6.1/mpfr/src \ --with-mpfr-lib=$(pwd)/mpfr/src/.libs Now compile:

make

And install:

make install

Create a link:

ln -vs gcc /tools/bin/cc

Finally check the compiled gcc:

echo 'main(){}' > dummy.c cc dummy.c readelf -l a.out | grep ': /tools'

If all went well, you should receive:

[Requesting program interpreter: /tools/lib/ld-linux.so.2]



Tuesday, November 8, 2011

Compiling and Patching Glibc

Basically building LFS consists of lots and lots and building packages. In this case I am building glibc, the main "C" library. So I am in the LFS directory. In this case:

/home/LFS

so the first thing I need to do is untar the package:

tar jxvf glibc-2.14.1.tar.bz2

Notice this was a tar file, which was also compressed. This could be done in a two step process, but I did it in one. "j" takes care of the uncompressing. "x" is used to extract the tar file. "v" is verbose, which will display the extraction. "f" is for the file that follows.

Now that the file is extracted, I change to that directory:

cd glibc-2.14.1

Now it needs to be patched:

patch -Np1 -i ../glibc-2.14.1-gcc_fix-1.patch

patch -Np1 -i ../glibc-2.14.1-cpuid-1.patch

glibc had two required patches. Now make the build directory:

mkdir -v ../glibc-build

Now cd to it:

cd ../glibc-build

Set up the configuration parameters:

case `uname -m` in i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;; esac

Now configure:

../glibc-2.14.1/configure --prefix=/tools --host=$LFS_TGT --build=$(../glibc-2.14.1/scripts/config.guess) --disable-profile --enable-add-ons --enable-kernel=2.6.25 --with-headers=/tools/include libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes


Now build the package:

make

And finally install it:

make install

First Compiles

I started with Fedora 15. It had Gnome 3 on it. For some reason I couldn't get a terminal window to open. So after fiddling around for a while, I just went to KDE. Had to install it:
yum install @kde-desktop
Also the Fedora was the desktop version, without a compiler. It didn't have the patch program either. So I installed gcc and patch:

yum install gcc
yum install patch

As previously stated, I had downloaded all of the software and patches. The easiest was is to create a text file that contains all of the software. This is explained on page 18 of the 7.0 manual. Select "wget-list" on page 18, it is highlighted, then save it as a text file. Once you have created the file, execute:

wget -i wget-list -P $LFS/sources.

I had previously defined $LFS, so the download went perfect. Took a while, since there is a lot to download, but it went without a hitch. At that point I was able to started compiling. I was able to compile binutils, gcc, and the Linux API headers last night.

Monday, November 7, 2011

LFS 7.0

The last time I installed LFS, I built it from 6.5. I just purchased a new laptop, so I am taking my old laptop to build LFS on. The latest version is 7.0:

http://www.linuxfromscratch.org/lfs/view/stable/index.html

So far I have installed Fedora 15 to be used to build LFS. I purchased a new hard drive for the old laptop, and swapped the Windows drive out for the new one. I have downloaded all of the packages and a few of the patches, so I am ready to go.

Monday, April 26, 2010

Solaris 10

I originally purchased an Acer Aspire M5641 to install Solaris. It wasn't compatible with Solaris and a lot of other things, so I was never able to install Solaris 10 on it. I did inherit an old Dell and was sucessful in installing Solaris on it, but it was too slow. So after a year of false starts I decided to purchase another machine for Solaris. I looked around at Dell again, since I had already had sucess on it. I found a Dell T100, but but the time my tax return came they had stopped shipping it. I found a Dell T105, and from what I found Solaris would work, but there was a network interface problem. The builtin NIC, would allow the machine to boot. I decided I'd go with it, and buy another interface card. So when it arrived, I disabled the builtin Broadcom NIC, and was able to successfully install Solaris. I purchased a D-Link NIC, but evidentally the chipset had changed since it was first listed on the HLC. I looked around and found an old Network Anywhere card, and although it was slower than the D-Link, it imediatly worked. So I am posting this from my new Solaris machine. I do need to get back to LinuxFromScratch, I still have some thing to solve there.