Posts

Showing posts with the label Linux From Scratch

LFS - Binutils

INSTALLING BINUTILS package Shifted to www.linuxfromscratch.org - Linux From Scratch - version 6.8 (the book was outdated so shifting to the website by the same other) - It starts with installation of binutils and not BASH. no problem though. The main modifications I made is shifted the sources from /usr/src to a dedicated folder at $LFS/sources The location where the tools are to be installed is $LFS/tools. A symbolic link is created for the same in the host systems INSTALLATION OF BINUTILS check for $LFS, $LFS_TGT else export LFS=/mnt/lfs export LFS_TGT=$(uname -m)-lfs-linux-gnu 1. download the Binutils-2.21.tar.gz into the $LFS/sources 2. tar xvzf binutils-2.21.tar.gz - extracts into a folder called binutils-2.21 3. mkdir $LFS/sources/binutils-build 4. cd $LFS/binutils-build 5. ../binutils-2.21/confiure --targer=$LFS_TGT --prefix=/tools --disable-nls --disable-werror 6. make 7. make install LFS_TGT contains the description of the system. The config.guess inside b...

LFS - BASH - compilation and installation

DOWNLOADING  REQUIRED PACKAGES 1. Downloading bash - (bash-4.2) http://ftp.gnu.org/gnu/bash/ - download the latest tar.gz file. I downloaded bash-4.2.tar.gz It is put inside the folder $LFS/usr/src * as root (sudo -i) cd into the folder $LFS/usr/src/bash-4.2 * ./configure --enable-static-link --prefix=$LFS/usr --disable-nls --without-bash-malloc * make +ERROR: /usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/libc.a(malloc.o): In function `malloc': (.text+0x4ad0): multiple definition of `malloc' ./lib/malloc/libmalloc.a(malloc.o):/mnt/lfs/usr/src/bash-4.2/lib/malloc/malloc.c:1254: first defined here +SOLUTION: ./configure --enable-static-link --prefix=$LFS/usr --disable-nls --without-bash-malloc (INCLUDE "--without-bash-malloc") in the configure option. +REFERENCE: http://www.linuxforums.org/forum/programming-scripting/129616-multiple-definitions-compliling-error.html +make succeded * make prefix=$LFS/usr install * mv $LFS/usr/bin/b...

LFS - Creating a partition

These steps are quite straight forward no errors were encountered. Follow the procedure described in http://www.linuxfromscratch.org/lfs/view/stable/chapter02/chapter02.html CREATING A PARTITION I used Gparted tool to create the partition. The tool is quite straight forward to use. You can download it from the package manager. here is the tutorial -  http://www.dedoimedo.com/computers/gparted.html Created a partition using the steps described here http://www.linuxfromscratch.org/lfs/view/stable/chapter02/creatingpartition.html Created a partition - 50 GB /dev/sda1 (primary partition)                         3 GB /dev/sda4 (primary partition for swap) (note : in my system I have linux (Ubuntu 9.10 karmic koala) installed in logical partition sda5 and swap is in logical parition sda6. primary partition sda2 is extended to create logical partitions.) MOUTING THE NEW PARTITION mkdir /mnt/lfs mount /dev/sd...

Building Linux From Scratch

hi, For long I wanted to build a custom linux system from scratch. Since now I am in my summer hols, I finally find time to do it. I am doing it for a hobby and documenting the procedure I followed, errors that I got and how I have solved them if I have solved them. Hope this documentation serves useful to the people. IMPORTANT - describes the variables that are used, 1. sudo -i is used to go into the superuser mode in ubuntu 2. $LFS = /mnt/lfs - the partition where linux is being built from scratch is mounted into this location 3. all the packages that are to be installed are to be present in $LFS/usr/src 4. $LFS_TGT=$(uname -m)-lfs-linux-gnu INDEX 1. Creating a partition 2. Mounting the partition 3. Creating Directories based on the File Hierarchy Standards (FHS) 4. Installing Bash 5. Installing Bin utils