[tipp] Customizing SysRescCD 2.4.1 for LFS Host system Specs

Post questions about how to make a customized SystemRescueCd, and if you have problems to install new packages. Please read the handbook first.
R0N
Posts: 5
Joined: 14 Jan 2012, 17:25

[tipp] Customizing SysRescCD 2.4.1 for LFS Host system Specs

Postby R0N » 17 Jan 2012, 17:09

customizing System Rescue CD 2.4.1 or higher to meet LFS 7.0 Host system requirements.

http://www.linuxfromscratch.org/lfs/view/stable/prologue/hostreqs.html

Due to the termination of the LFS live cd project, I found System Rescue CD was the most compatible alternative, however a small customization is required, which I would like to share, because I'm still waiting for my gcc built to finish...

Here's what I did:


Boot from sysresccd with docache option

Code: Select all

mkdir /mnt/lfs
mount /dev/sda3 /mnt/lfs
mkdir /mnt/lfs/customcd
mount -o bind /mnt/lfs/customcd /mnt/custom

Where you use your own mountpoint, every time I use /dev/sda3.

Code: Select all

cd /mnt/lfs
cp /usr/sbin/sysresccd-custom .

nano sysresccd-custom

On line 93 change all instances of /mnt/custom into /mnt/lfs, save and close again. This is because df does not show /mnt/custom and because /mnt/custom is a dummy file system inside /mnt/lfs, so their sizes are equal.

Code: Select all

./sysresccd-custom extract
mount -o bind /proc /mnt/custom/customcd/files/proc
mount -R -o bind /dev /mnt/custom/customcd/files/dev
mount -o bind /sys /mnt/custom/customcd/files/sys

-R so mount recursively binds /pts and /shm which are mount points inside of /dev. These are required for creating pty's.

Code: Select all

chroot /mnt/custom/customcd/files /bin/bash
gcc-config (gcc-config -c)

As also described in http://www.sysresccd.org/Sysresccd-manual-en_How_to_personalize_SystemRescueCd /mnt/custom/customcd/files is going to be the root folder of what is going to be our customized System Rescue CD.

The next steps require an internet connection, otherwise you have to find your own way of putting the source tarballs in /usr/src and skip the wget's

First add bison-2.3

Code: Select all

cd /usr/src
wget http://ftp.gnu.org/gnu/bison/bison-2.3.tar.bz2
tar -xf bison-2.3.tar.bz2
cd bison-2.3
./configure
make
make install

I deviated from the the System Rescue CD manual, since I have never worked with emerge. My attempts resulted in many 'masked' packages with many 'keyword' issues and other things I have never heard of before. Also lots of dependencies and patches, so many that at some point I just deleted /customcd and started the whole thing over with just plain old source tarballs with makefiles. Those worked fine for me right away.

Now also add texinfo-4.9

Code: Select all

cd..
wget http://ftp.gnu.org/gnu/texinfo/texinfo-4.9.tar.bz2
tar -xf texinfo-4.9.tar.bz2
cd texinfo-4.9
./configure
make
make install

Remove unneeded remaining files and exit the chrooted environment.

Code: Select all

cd..
rm -rf *
exit

unmount /proc, back to our modified sysresccd-custom script to generate the iso image.

Code: Select all

umount /mnt/custom/customcd/files/proc
cd /mnt/lfs
./sysresccd-custom squashfs
./sysresccd-custom isogen my_srcd

Burn the CD.

Code: Select all

cdrecord /mnt/custom/customcd/isofile/sysresccd-ccyymmdd-hhmm.iso

Reboot the System into the Customized System Rescue CD and create a symbolic link to bison.

Keep in mind that this last step is needed everytime you boot your customized System Rescue CD, in order to be able to build everything in Linux from Scratch.

Code: Select all

ln -sv /usr/local/bin/bison /usr/bin/yacc

Finally you can run version-check.sh, provided by LFS on their requirements page so you can see for yourself that all tools needed to build LFS from your System Rescue CD are available now.

Code: Select all

bash version-check.sh

Ronnie van Aarle.

TTorai
Posts: 5
Joined: 17 Apr 2010, 19:46

Re: [tipp] Customizing SysRescCD 2.4.1 for LFS Host system S

Postby TTorai » 06 May 2012, 16:02

Hi,

i want to tell that Your Instructions still work. Have created a CD with sysresccd-2.6.0 for LFS-7.1. I have used bison-2.5 and texinfo-2.13a.

Oh, and i should tell that in Your instructions there is a "$" missing in the line "gcc-config (gcc-config -c)". It has to be like this "gcc-config $(gcc-config -c)".

Many thanks to the OP for making this thread.

TTorai
Posts: 5
Joined: 17 Apr 2010, 19:46

Re: [tipp] Customizing SysRescCD 2.4.1 for LFS Host system S

Postby TTorai » 14 Feb 2014, 17:31

I just tested if this tip is still useful with sysresccd-3.8.1, bison-3.0 and texinfo-5.1; To build a lfs-7.4 System.

And i can report that it works!

These are the changes i made, compared to the original tip:

Code: Select all

gcc-config $(gcc-config -c)

Code: Select all

wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.xz
tar xf bison-3.0.tar.xz
cd bison-3.0
./configure --prefix=/usr

Code: Select all

cd ..
wget http://ftp.gnu.org/gnu/texinfo/texinfo-5.1.tar.xz
tar xf texinfo-5.1.tar.xz
cd texinfo-5.1
./configure --prefix=/usr

Also, i have NOT to do the yacc-link every boot.

In LFS-7.4 Section 6.14, gmp-5.1.2 failed to pass the tests (it failed to detect my AMD A8-6500). https://wiki.gentoo.org/wiki/Safe_CFLAGS helped to get around this. I just entered (and left active in this chroot) the following before configure gmp:

Code: Select all

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=amdfam10 -mcx16 -mpopcnt -pipe"
CXXFLAGS="${CFLAGS}"


I was going through the complete lfs-book.

Have fun to build lfs.

Sincerely, TTorai.

TTorai
Posts: 5
Joined: 17 Apr 2010, 19:46

Re: [tipp] Customizing SysRescCD 2.4.1 for LFS Host system S

Postby TTorai » 24 Nov 2016, 07:55

Hereby i try to renew the original tip http://www.system-rescue-cd.org/forums/viewtopic.php?f=25&t=4383.
Haven't done all steps, so please don't use it yet!

####################################
# CONSIDER IT: WORK IN PROGRESS. #
####################################

Customizing "System Rescue CD", to meet requirements a Host system needs, for building "Linux from Scratch".

Currently using LFS 7.10-systemd and SystemRescueCd-x86-4.9.0

http://linuxfromscratch.org/lfs/view/stable/chapter02/hostreqs.html

Due to the fact that there is still no officially working LFS live CD project, but System Rescue CD is also still a good alternative for building LFS; I would like to show the steps here to alter the CD so that you can build LFS:

Boot from sysresccd with docache option.

Code: Select all

mkdir /mnt/lfs
mount /dev/sda3 /mnt/lfs
mkdir /mnt/lfs/customcd
mount -o bind /mnt/lfs/customcd /mnt/custom

Where you use your own mountpoint, every time I use /dev/sda3: an empty ext4 partition.

Code: Select all

cd /mnt/lfs
cp /usr/sbin/sysresccd-custom .

nano sysresccd-custom

On line 93 change all instances of /mnt/custom into /mnt/lfs, save and close again. This is because df does not show /mnt/custom and because /mnt/custom is a dummy file system inside /mnt/lfs, so their sizes are equal.

Code: Select all

./sysresccd-custom extract
mount -o bind /proc /mnt/custom/customcd/files/proc
mount -R -o bind /dev /mnt/custom/customcd/files/dev
mount -o bind /sys /mnt/custom/customcd/files/sys

-R so mount recursively binds /pts and /shm which are mount points inside of /dev. These are required for creating pty's.

Code: Select all

chroot /mnt/custom/customcd/files /bin/bash
gcc-config $(gcc-config -c)

As also described in http://www.sysresccd.org/Sysresccd-manual-en_How_to_personalize_SystemRescueCd /mnt/custom/customcd/files is going to be the root folder of what is going to be our customized System Rescue CD.

The next steps require an internet connection, otherwise you have to find your own way of putting the source tarballs in /usr/src and skip the wget's

First add bison/yacc

Code: Select all

cd /usr/src
wget http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.xz
tar -xf bison-3.0.4.tar.xz
cd bison-3.0.4
./configure
make
make install

I deviated from the the System Rescue CD manual, since I have never worked with emerge. My attempts resulted in many 'masked' packages with many 'keyword' issues and other things I have never heard of before. Also lots of dependencies and patches, so many that at some point I just deleted /customcd and started the whole thing over with just plain old source tarballs with makefiles. Those worked fine for me right away.

Now also add texinfo/makeinfo

Code: Select all

cd ..
wget http://ftp.gnu.org/gnu/texinfo/texinfo-6.1.tar.xz
tar -xf texinfo-6.1.tar.xz
cd texinfo-6.1
./configure
make
make install

Remove unneeded remaining files and exit the chrooted environment.

Code: Select all

cd ..
rm -rf *
exit

unmount /proc, back to our modified sysresccd-custom script to generate the iso image.

Code: Select all

umount /mnt/custom/customcd/files/proc
cd /mnt/lfs
./sysresccd-custom squashfs
./sysresccd-custom isogen my_srcd

Burn the CD.

Code: Select all

cdrecord /mnt/custom/customcd/isofile/sysresccd-ccyymmdd-hhmm.iso

Or write it to a USB Flash Drive.

Code: Select all

isohybrid /mnt/custom/customcd/isofile/sysresccd-ccyymmdd-hhmm.iso
dd if=/mnt/custom/customcd/isofile/sysresccd-ccyymmdd-hhmm.iso of=/dev/sdx

Where /dev/sdx should represent your Flash Drive (be SURE it is!).

Reboot the System into the Customized System Rescue CD and create a symbolic link to bison.

Keep in mind that this last step is needed everytime you boot your customized System Rescue CD, in order to be able to build everything in Linux from Scratch.

Code: Select all

ln -sv /usr/local/bin/bison /usr/bin/yacc

Finally you can run version-check.sh, provided by LFS on their requirements page so you can see for yourself that all tools needed to build LFS from your System Rescue CD are available now.

Code: Select all

bash version-check.sh

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: [tipp] Customizing SysRescCD 2.4.1 for LFS Host system S

Postby gernot » 26 Nov 2016, 08:38

Thanks

Gernot

Erus
Posts: 1
Joined: 01 Dec 2016, 16:26

Re: [tipp] Customizing SysRescCD 2.4.1 for LFS Host system S

Postby Erus » 01 Dec 2016, 16:31

Hello,

I'm following your instruction to create an lfs 7.10 bootable livecd but I have a few errors.

Code: Select all

./sysresccd-custome extract


Gives me :

Code: Select all

/mnt/custom is mounted -> ok
there is enough estimated free space here (113494 MB) -> ok
cannot copy bootprog to /mnt/custom/customcd/isoroot/ (non critical error, maybe be caused by "docache")
cannot copy usbstick.htm to /mnt/custom/customcd/isoroot/ (non critical error, maybe be caused by "docache")


I tried to keep going anyways and it gives me more errors when I make the iso and even if it creates it I cannot boot.

Thank you.


Return to “Customization and installing new packages”

Who is online

Users browsing this forum: No registered users and 1 guest