# HowTo Hack My Gentoo Linux Boot CD

## securiteaze

HowTo Hack My Gentoo Linux Boot CD

Version 1.0b

Disclaimer: This may lead to the creation of many coasters (broken cdr's)

Acquire the gentoo bootable CD iso:*

Either by downloading it

```
mkdir /PathToISO

cd /PathToISO

wget http://ibiblio.org/pub/Linux/distributions/gentoo/releases/1.2/gentoo-ix86-1.2.iso
```

Or extract it from a previously burned cd

```
mkdir /PathToISO

dd if=/dev/cdroms/cdrom0 of=/PathToISO/gentoo.iso
```

Create a directory and copy the contents of a gentoo boot CD into it.*

```
mkdir /mnt/loop0

mount /PathToISO/gentoo-ix86-1.2.iso /mnt/loop0 -o loop

mkdir /mnt/iso

cd /mnt/loop0

find | cpio -pdm /mnt/iso

cd /mnt

umount /mnt/loop0

```

Install mkisofs, which is now part of app-cdr/cdrtools (required for this howto)*

```
emerge sync

emerge cdrtools
```

To add your own kernel (Don't forget to include supoport for ramdisks and initrd)

```
cp /usr/src/KernelVersion/arch/i386/boot/bzImage /mnt/iso/isolinux/kernel
```

To change the contents of the ramdrive

Copy and uncompress the image

```
cp /mnt/iso/isolinux/rescue.gz /mnt

cd /mnt

gunzip rescue.gz

```

Mount the image

```
mount /mnt/rescue /mnt/loop0 -o loop

```

Creating a larger loopback filesystem (64M) and mount it

```
dd if=/dev/zero of=/mnt/bigrescue  bs=512k count=128

mke2fs -F /mnt/bigrescue

mount /mnt/bigrescue /mnt/loop1

```

Copy the original content of the ramdisk to the new larger one

```
cp -a /mnt/loop0/* /mnt/loop1/

umount /mnt/loop0

```

Add whatever software you like

```
cp /usr/bin/links2 /mnt/loop1/usr/bin

```

Don't forget to include the needed libraries!

To find out which libraries are needed us the 'ldd' command.

```
user@hostname#ldd /usr/bin/links2

        libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x4001b000)

        libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x4004b000)

        libdl.so.2 => /lib/libdl.so.2 (0x40117000)

        libgpm.so.1 => /usr/lib/libgpm.so.1 (0x4011a000)

        libm.so.6 => /lib/libm.so.6 (0x40120000)

        libc.so.6 => /lib/libc.so.6 (0x40143000)

        libncurses.so.5 => /lib/libncurses.so.5 (0x40266000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

```

Test the ramdisk image

```
mount /proc /mnt/loop1/proc -o bind

chroot /mnt/loop1 /bin/sh

echo "nameserver 127.0.0.1" > /etc/resolv.conf

links2 example.com

exit
```

Unmount, compress, and add the new ramdisk 

```

umount /mnt/loop1/proc

umount /mnt/loop1

gzip /mnt/bigrescue

cp /mnt/bigrescue.gz /mnt/iso/isolinux/rescue.gz
```

Configure boot parameters for to bigger ramdisk.

Edit /mnt/iso/isolinux/isolinux.cfg.

There are two lines that look this:

```

APPEND devfs=nomount vga=normal load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=22000 <snip>

```

Change the 'ramdisk_size' parameter to reflect the new size of the ramdisk.

Both instances should now look like this:

```
APPEND devfs=nomount vga=normal load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=65536 <snip>
```

To add custom/new gentoo build tarballs or other such things

```
cp /Path/Somewhere/UberGentoo.tar.bz2 /mnt/iso/

cp /Path/Somewhere/stage1-ix86-1.4_rc1-20020908-1208.tar.bz2 /mnt/iso/

```

To remove old gentoo build tarballs:

```
rm /mnt/iso/stage?-*1.2.tbz2

```

To make the image iso image:

```
cd /mnt/iso

rm /mnt/iso/isolinux/boot.catalog

mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso .

```

This will creat a bootable ISO image in /mnt named newgentoo.iso

*Update - changed recursive copy method in favor of cpio 11-06-02

*Update - mkisofs is now part of cdrtools 11-06-02

*Update(1.0b) - added iso aquisition, altered layout 11-08-02

*Update - fixed typo /mnt/loop1 -> /mnt/loop1/proc

Comments? Suggestions?

----------

## arkane

One thing to note: I've had problems when creating the ramdisk and just doing a cp -a.  I had more success going into the directory tree I want to copy and doing " find | cpio -pdm <destination> "

that was one of the major issues I ran into when I was making a custom Gentoo cd in this thread: https://forums.gentoo.org/viewtopic.php?t=14619&highlight=

----------

## taskara

can't emerge mkisofs

packages.mask says it is now obsolete, and that cdrtools took it's place.

so how does this affect this cd hacking?  :Wink: 

----------

## securiteaze

The mkisofs package is now part of cdrtools, changes are reflected above.

----------

## arkane

Another thing to note for people doing this (as I found out in the thread I posted), you can use VMWare to test your ISO before you burn it.  In the preferences, under the cdrom section you can have it point to an image.  When it boots, it will use the ISO image directly from harddisk.  If it doesn't boot right, you just saved yourself a CDR.

I was so glad when I found this information out, it saved me alot of CDRs.

----------

## taskara

ok cdrtools it is  :Smile: 

using vmware is a good idea.. but what about the good ol fashion way of a cd-rw ? if it doesn't work, reformat it  :Smile: 

I'll give this a go sometime.. but

emerge -u world just destroyed my gentoo system.. the ONLY comand I can do is 

```
ls
```

  :Laughing: 

----------

## rottie

Thats cool and I will do it that way if I have to but ... i would like to use my windows machine to add files to the image ... use winiso to plop the files in the iso .. the only problem is  :Smile:  that when I boot off my new cd i get a md5 checksum error on the cd .. Anyone know how to get around this. Do I just have to create a new checksum .. and how do you do that ?

Thanks for any help.

rottie

----------

## securiteaze

 *Quote:*   

> Thats cool and I will do it that way if I have to but ... i would like to use my windows machine to add files to the image ... use winiso to plop the files in the iso .. the only problem is  that when I boot off my new cd i get a md5 checksum error on the cd .. Anyone know how to get around this. Do I just have to create a new checksum .. and how do you do that ? 
> 
> 

 

If you really want to make it in windows, maybe this will help

----------

## px

you can create the iso image by this:

dd if=/dev/cdroms/cdrom0 of=/your.iso

I think it's a better way to retrieve the content of the cd, isn't it?

----------

## securiteaze

 *Quote:*   

> ...I think it's a better way to retrieve the content of the cd, isn't it?

 AFAIK we weren't retrieving the contents from the CD, just modifying the contents of the iso.  

On the other hand this seems like a good addition to the howto.  :Wink: 

----------

## rottie

Thats right .. I am not trying to retrieve the contents off the disk.

I would just like to add some of my scripts to the install to make life easy. Maybe a wack of different stages so I can install all of my machines from one disk. i386,i486,i586,i686 etc...

When I edit the iso it is still bootable .. and it "does" boot off of the cd .. 

I just get a cd checksum error ... ie

----

Gentoo boot up information <here>

version website blablahblah...

Checking checksum ... 

Error : CD checksum failed.

----

er something like that .. I will try and get the exact message when I get home.

My question is .. how do I create a new checksum or how do I remove the check for the checksum .. or an alternative method to put stuff on the cd that wont take me a day to do.  :Wink:  (even though I dont really mind doing that.)

Thanks for everyones input ..

rottie

----------

## securiteaze

I believe that step 8 in the howto will resolve your checksum problems.

It should not take all day to build a new iso, it takes me less than an hour.  :Smile: 

----------

## et al

 *rottie wrote:*   

> 
> 
>  .. or an alternative method to put stuff on the cd that wont take me a day to do.  (even though I dont really mind doing that.)
> 
> Thanks for everyones input ..
> ...

 

I made a script that puts stage1_rc1, portage and 'lots' of distfiles on gentoo12 cd(s). I tested a chrooted install of the system with it.

here is the code, it's "work in progress" and it will propably not run without modification. (I don't have the time to finish it right now).

You can add your files in the "some includes" section.

```

#!/bin/bash

# distgen: create bootable/installable gentoo source cd distribution

#          from the gentoo-1.2 install-iso and the 1.4 stage1-tarbal

#          (move old distsfiles)

# what to put on cd

emergeclass=world   # world/system

emergeadd="openoffice parted"  # at least one! (bash)

# where are gentoo 1.4 stage1 and gentoo1.2 iso

stage1_14=/mnt/gentoo14/stage1-x86-1.4_rc1-20020908-1208.tar.bz2

iso_12=/mnt/gentoo14/gentoo-ix86-1.2.iso

# where to put cd images

isodest=/mnt/gentoo14

# cdwriter ID for my 10x CDRW

cddev="0,1,0"

tmp=/tmp/distgen

# end config

source /etc/make.globals

source /etc/make.conf

mkdir -p $tmp

set -x

# download files

emerge -f -e $emergeclass

emerge -f -e $emergeadd

# packs are ebuilds

#get ebuilds split to "dir pack version"

( emerge -p -e system && emerge -p -e $emergeclass && emerge -p -e $emergeadd ) |\

  grep '\['|awk '{print $NF}'|\

  sed -e 's%\(.*\)/\(.*\)-\([0-9].*\)%\1 \2 \3%' \

  > ${tmp}/packs

# remove doubles keep order (to get bootstrap on cd1)

> ${tmp}/packs.sort

while read dir pack version

do

 if ! grep -q "$dir $pack $version" ${tmp}/packs.sort

 then

 echo "$dir $pack $version" >> ${tmp}/packs.sort

 fi

done < ${tmp}/packs

# count sizes, sumsize per pack

balnum=0

while read dir pack version

do

  sumsize=0

  awk '{print $3}' ${PORTDIR}/$dir/$pack/files/digest-$pack-$version > $tmp/tarbals.tmp

  while read tarbal

  do

    if [[ -e ${DISTDIR}/$tarbal ]]

    then

      let balnum=$balnum+1

      size=$(ls -s --block-size=2048 ${DISTDIR}/$tarbal|awk '{print $1}')

      let sumsize=$sumsize+$size

      echo $balnum $dir $pack $version $tarbal $size $sumsize

    else

      echo "not found: ${DISTDIR}/$tarbal" 1>&2

    fi

  done < $tmp/tarbals.tmp

done < ${tmp}/packs.sort > ${tmp}/tarbals

# reverse order and set sumsize per pack for every tarbal

sort -nr ${tmp}/tarbals > ${tmp}/tarbals.rev

packold=""

sumsizeold=0

while read balnum dir pack version tarbal size sumsize

do

  if [[ "$packold" == "$pack-$version" ]]

  then

    sumsize=$sumsizeold

  fi

  echo $balnum $dir $pack $version $tarbal $size $sumsize

  packold="$pack-$version"

  sumsizeold=$sumsize

done < ${tmp}/tarbals.rev > ${tmp}/tarbals.rev.sized

# get normal sort again

sort -n ${tmp}/tarbals.rev.sized > ${tmp}/tarbals.sized

# write cd-file add cd destdir "distfiles"

while read balnum dir pack version tarbal size sumsize

do

  echo "$dir/$pack-$version ${DISTDIR}/$tarbal $sumsize distfiles"

done < ${tmp}/tarbals.sized > ${tmp}/tarbals.cd

#-----------------

## cd1 files

# portage

tar  cjf ${tmp}/portage.tar.bz2 -C ${PORTDIR} --exclude=./distfiles --exclude=./packages .

# some includes

> ${tmp}/cddesc.cd

echo  ${tmp}/cddesc.cd  > ${tmp}/cd1.incl

echo  $stage1_14  >> ${tmp}/cd1.incl

echo  /var/cache/edb/world >> ${tmp}/cd1.incl

echo  /etc/make.conf >> ${tmp}/cd1.incl

echo  ${tmp}/portage.tar.bz2 >> ${tmp}/cd1.incl

## myself !!

echo  $0 >> ${tmp}/cd1.incl

#echo $(dirname $0)/distinst

cat ${tmp}/cd1.incl| tr " " "\n" > ${tmp}/cd1.incl2

# sum file sizes

cd1sum=0

for i in $(cat ${tmp}/cd1.incl2)

do

  let cd1sum=$cd1sum+$(ls -s --block-size=2048 $i |awk '{print $1}')

done

while read file

do

  echo "cd1files $file $cd1sum"

done < ${tmp}/cd1.incl2 > ${tmp}/cd1.cd

## gentoo-ix86-1.2.iso

mkdir ${tmp}/cdrom

mount -o loop $iso_12 ${tmp}/cdrom

mkdir -p ${tmp}/isolinux/isolinux

cp -R ${tmp}/cdrom/isolinux ${tmp}/isolinux

umount ${tmp}/cdrom

echo  "${tmp}/isolinux/isolinux/boot.catalog" > ${tmp}/cd1.isolinux

echo  "${tmp}/isolinux/isolinux/isolinux.bin" >> ${tmp}/cd1.isolinux

echo  "${tmp}/isolinux/isolinux/isolinux.cfg" >> ${tmp}/cd1.isolinux

echo  "${tmp}/isolinux/isolinux/kernel" >> ${tmp}/cd1.isolinux

echo  "${tmp}/isolinux/isolinux/message.txt" >> ${tmp}/cd1.isolinux

echo  "${tmp}/isolinux/isolinux/rescue.gz ">> ${tmp}/cd1.isolinux

# file sizes

isolinuxsize=0

for i in $(cat ${tmp}/cd1.isolinux)

do

  let isolinuxsize=$isolinuxsize+$(ls -s --block-size=2048 $i |awk '{print $1}')

done

# split to cd with $isolinuxsize as startsize

awk 'BEGIN {maxsize=320000; actsize='$isolinuxsize'; actpack=""; vol=1}

            {if (actpack != $1) actsize=actsize+$3;

            if (actsize > maxsize) { vol=vol+1; actsize=$3 }  ;

       print vol, actsize, $1, $2, $3, $4; actpack=$1}

    ' ${tmp}/cd1.cd ${tmp}/tarbals.cd \

    > ${tmp}/cddesc

# mkiso

nvol=$(tail -n1 ${tmp}/cddesc|awk '{print $1}')

awk -F"/| " '{print $1,$NF"/"$(NF-2)}' ${tmp}/cddesc > ${tmp}/cddesc.cd

n=1

while [[ $n -le $nvol ]]

do

  > ${tmp}/cddesc.cd$n

  > ${tmp}/cd$n

  awk '{if ($1=='$n') print $6"/="$4}' ${tmp}/cddesc >> ${tmp}/cddesc.cd$n

#remove double entries (hack, different packs use the same tarbals)

  sort -u ${tmp}/cddesc.cd$n > ${tmp}/cddesc.cd$n.sort

  if [[ $n -gt "1" ]]

  then

    mkisofs -R -r -o $isodest/gentoo14-cd${n}.iso \

      -graft-points \

      -path-list ${tmp}/cddesc.cd$n.sort \

      ${tmp}/cd$n ${tmp}/cddesc.cd

  else

    mkisofs -b isolinux/isolinux.bin \

      -c isolinux/boot.catalog \

      -no-emul-boot -boot-load-size 4 -boot-info-table \

      -R -r -o $isodest/gentoo14-cd${n}.iso \

      -graft-points \

      -path-list ${tmp}/cddesc.cd$n.sort \

      ${tmp}/isolinux ${tmp}/cd$n

  fi

#write cdrw

  read -p "burn gentoo14-cd${n}.iso? " ans

  if [[ $ans == "y" ]]

  then

    cdrecord -v -eject speed=10 blank=fast fs=10m dev=$cddev $isodest/gentoo14-cd${n}.iso

  fi

  let n=$n+1

done

exit

#---------------------------

#----------------

#----------------

#---------

exit

#move !!!!!!!!!!

#!!!!!!!!!!

#!!!!!!!!!!!

exit

# ${tmp} ???

source /etc/make.globals

source /etc/make.conf

mkdir ${DISTDIR}/attic/

#set tmp !!!!!!

awk '{print $5}' ${tmp}/tarbals > ${tmp}/distfiles

for i in ${DISTDIR}/*

do

  if ! grep ${i##*/} ${tmp}/distfiles > /dev/null

  then

    echo ">>> move $i > ${DISTDIR}/attic";mv $i ${DISTDIR}/attic/

  else

    echo "||| keep $i"

  fi

done

#!!!!!!!!!!!!!!!

#

##fetchcommand

#\\\\\\\\\\\\\\\\\\

##/etc/make.conf

#FETCHCOMMAND='/tmp/wantcd ${FILE}'

#\\\\\\\\\\\\\\\\\\

##/tmp/wantcd

#source /etc/make.globals

#mount /mnt/cdrom

#wantcd=$(grep $1 /mnt/cdrom/cddesc.cd|awk '{print $1}')

#umount /mnt/cdrom

#echo

#read -p "need cd${wantcd}"

#mount -o loop $isodest/gentoo14-cd${wantcd}.iso /mnt/cdrom

##chose one ...

##mount -o bind /mnt/cdrom/distfiles ${DISTDIR}

##cp /mnt/cdrom/distfiles/$1 ${DISTDIR}/

#while read sect ebuild version

#do

#  if [ -e /mnt/genplay/usr/portage/packages/All/$ebuild-$version.tbz2 ]

#  then

#    ls -l /mnt/genplay/usr/portage/packages/$sect/$ebuild-$version.tbz2

#  fi

#done < /tmp/distgen/packs.sort

```

And the code for the test install (it mounts the cd image).

```

#!/bin/bash

tmp=/tmp/instdist

instdest=/mnt/genplay

cdimgepref=/mnt/gentoo14/gentoo14-cd

mkdir -p ${tmp}/cdrom

function mountcd {

  umount ${tmp}/cdrom

  mount -o loop ${cdimgepref}${1}.iso ${tmp}/cdrom

}

mountcd 1

set -x

# http://www.gentoo.org/doc/build.html

# 9.Unpacking the Stage Tarballs

#9.1

if ! [[ -d $instdest ]]

then exit 9

fi

cd $instdest

tar -xvjpf ${tmp}/cdrom/stage1-x86-1.4_rc1-20020908-1208.tar.bz2

mount -o bind /proc $instdest/proc

cp /etc/resolv.conf $instdest/etc/resolv.conf

cd -

# extra: install portage

cd $instdest/usr/portage/

mkdir distfiles packages

tar -xvjpf ${tmp}/cdrom/portage.tar.bz2

cd -

mount -o bind ${tmp}/cdrom/distfiles $instdest/usr/portage/distfiles

cp ${tmp}/cdrom/make.conf $instdest/tmp/

cp ${tmp}/cdrom/world $instdest/tmp/

# 9.2

# now its gone

#chroot /mnt/gentoo /bin/bash

cat << EOSYSTEM  > $instdest/tmp/instsystem

#!/bin/sh

set -x

cp /tmp/make.conf /etc

env-update

source /etc/profile

#10.Getting the Current Portage Tree using Rsync

# we have portage from the cd

#11.Progressing from stage1 to stage2

# Code listing 11.1: Setting make.conf Options

# nano -w /etc/make.conf (Adjust these settings)

#

# make.conf is a copy from cd

#some tests

emerge -f -p system

emerge -V

emerge -p portage

# emerging portage in bootstrap removes make.conf

(sleep 300; cp /tmp/make.conf /etc) &

# Code listing 11.2: Bootstrapping

cd /usr/portage

scripts/bootstrap.sh || exit

sleep 20

#Code listing 11.3: Changing Portage's Storage Path

# export PORTAGE_TMPDIR="/otherdir/tmp"

#12.Progressing from stage2 to stage3

#Code listing 12.1: Installing the Rest of the System

export CONFIG_PROTECT=""

emerge -e -p system

# with packages and recompile all

emerge -e -b system || exit

sleep 30

#13.Final steps: Timezone

ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime

#14.Final steps: kernel and system logger

#we use world file from cdimge ...

#15.Final steps: Install Additional Packages

# now install rest

while read i

do

  echo \$i

  emerge -p \$i

done < /tmp/world

# compile kernel, install boot loader, edit /etc/fstab

# edit /etc/hostname, /etc/hosts, set root pw

# configure network

echo you are now chrooted in $instdest

/bin/bash

EOSYSTEM

chmod u+x $instdest/tmp/instsystem

chroot $instdest /bin/bash -c /tmp/instsystem

echo back from chroot

sleep 2

umount $instdest/usr/portage/distfiles

umount $instdest/proc

```

----------

## mmontg1

 *Quote:*   

> mount /proc /mnt/loop1 -o bind 

 

should be

```
mount /proc /mnt/loop1/proc -o bind 
```

----------

## DArtagnan

.

----------

## tagore

Hi All.

I have some questions:

1) For example I want to create a CD live that he is server of games

( Counter-strike ) but I like to know since I can do so that when initiates she has an IP predetermined by my, and that it is not possible to be changed.

2) Eliminate the detection of keyboard. Load default predetermined by my.

3) Automatic entrance after the detection of hardware.

4) Automatic starting of the service ( Counter-Strike server )

Summarizing that places the CD and automaticamente it takes the service without interaction with a human.

it is this possible?

cheers.

----------

## acidreign

Yes, this is possible, you could follow the instructions as per above, maybe 64mb might not be enough for the CS ramdisk though.

You would have to modify "inittab" to start your counterstrike server directly.  I would be happy to help you with this project if you wish to persue it ?

----------

## tagore

Hi again  :Razz: 

legend iso # pwd

/mnt/iso

legend iso # ls

isolinux

legend iso # mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso

mkisofs: Missing pathspec.

Usage: mkisofs [options] file...

Use mkisofs -help

to get a list of valid options.

legend iso #

what is wrong?

acidreign:

at this moment I am thinking like doing it, acceptance helps  :Smile: 

----------

## tagore

this is for gentoo 1.2 , and how to hack gentoo 1.4??? 

anyone help me?

cheers.

P.D.: livecd-ng , more info? anyone?

----------

## papaC

You are missing the "." from the end of your command.

```
mkisofs [...all command line options] .
```

or if you are not in the directory anymore

```
mkisofs [...all command line options]  /path/to/use
```

As for 1.2 vs 1.4 I haven't tried but guess it would be mostly the same.

----------

## hmm

hi all,

I tried adding some files of mine to a BOOTable liveCD and I got that infamous checksum error..

Then I tried extracting the ISO image to my HD and copied my files there and then I built a new ISO image w/ both Nero and CDRWIN and used the BOOT image from the original liveCD ISO and STILL I get that damn checksum error!

I looked at securiteazes guide and at stage 8 he uses "isolinux/isolinux.bin" which is 9400 bytes but he loads only 4 sectors (-boot-load-size 4)? But when I extract the BootImage w/ for example IsoBuster its 2000 bytes.

So I tried using "isolinux/isolinux.bin" as a BOOT image but CDRWIN didnt let me load 4 sectors for it nor any other sector size and Nero did something but it didnt work.. ;P

I wanna make my own BOOTable CD w/ extra stages and programs and quake3 server files and such so I can take it to a clean computer and install gentoo w/ everything I need, any1 have any ideas?

Sum1 must have done this in windows too?

PS. maybe that guy that coded ISOLINUX should lighten up a bit ;P DS.

-thx

----------

## hmm

*update*

omg I have done it... and guess w/ what? 

yup friggin mkisofs... 

!long live cygwin!

it was long time ago I used mkisofs, couple of years back on solaris, and its a bit illogical. it seems that boot image needs to be in a "isolinux" subfolder and that mkisofs somehow takes that file and shrinks it to 4 sectors and copies the modified file to the boot sector...

then I needed to be in the same folder as the files (plus the thing above where boot image needs to be in a subfolder named "isolinux") for some strange reason so I had to exclude mkisofs and some other files..

but now after several hours of burning and building images and reading...it works

still if any1 knows how to do this w/ programs such as CDRWIN, Nero and alike plz infrom us.

-thx

----------

## pahud

Hello Guys, 

1.4_rc3 LiveCD has a blue splash screen on boot.

How can I change that screen to aother picture?

----------

## rodrigrj

the easiest way i can see is to get a picture and call it gentoo and then put it in the isolinux dir

----------

## pahud

 *rodrigrj wrote:*   

> the easiest way i can see is to get a picture and call it gentoo and then put it in the isolinux dir

 

I've noticed that the image format is .lss.

If I have a png picture, what is the easiest way to conver it into lss?

----------

## rodrigrj

ive tried everything written above, but i still get errors when trying to run my new ramdisk, there's a kernel panic because no init was found and i should "try passing init=  option to kernel" but thats already in there... 

and while im at it, does anyone know how i could get a script to start automatically after the cd is done loading??

----------

## genfoo

check out isolinux resources for those answers...

make sure that your /sbin/init file is executable, and you can add whatever you want in there... note that if you're hacking a live cd its a whoooollleee different procedure as it uses a custom init to kick things over

for reference, the iso building scripts are available thru the web-cvs link on gentoo's website , look around in the gentoo-src cvs module and you may find some things that make this whole procedure a _lot_ less painful  :Wink: 

----------

## synic

I made the CD, and it boots, but if I just press enter to boot the gentoo kernel with the default options, it says that initrd.1024 cannot be found.  The only way I can get it to boot is to type "nofb" for no frame buffer (it seems to find that initrd ok).  

What am I doing wrong?

Thanks,

synic

P.S.  I looked in the isolinux directory on the cd and all the initrd files, including initrd.1024, are there.

----------

## revil

I'm guessing things have changed a bit since livecd version 1.2.

rescue.gz no longer resides on the cd.  any clue how to do it now?

----------

## hackertype

I also get a message saying initrd.1024 cannot be found.  Using nofb allows me to boot though.

I want to make my CD this way because livecd-ng makes you download and build everything.  I also didn't see any facility for adding custom files to the livecd using livecd-ng.

----------

## gatiba

I have downloaded gentoo-3stages-x86-1.4_rc4.iso (214 mb) but when i mount it on loop0 i can't find rescue.gz !

It's not in isolinux ...

----------

## Squinky86

 *gatiba wrote:*   

> I have downloaded gentoo-3stages-x86-1.4_rc4.iso (214 mb) but when i mount it on loop0 i can't find rescue.gz !
> 
> It's not in isolinux ...

 

Yeah, this howto is only good for the 1.2 livecds.  This thread will help you build a recent one; basically, what you need is in the cloop file.  Good luck!

----------

## nngs

very useful

one minor correction: last command needs a '-l' option

----------

## [ToXiC]

When compiling a new kernel for the LiveCD what needs to be included to make it fully functional? Filesystems, etc?

----------

## [ToXiC]

When I do a " mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -

b /opt/working/iso/isolinux/isolinux.bin -c /opt/working/iso/isolinux/boot.cat -o /opt/newgentoo.iso" I get the error "mkisofs: Missing pathspec."

ANy ideas as to what I am doing wrong? I am making a new 1.4 cd.

-[ToXiC]

----------

## taskara

 *Squinky86 wrote:*   

> Yeah, this howto is only good for the 1.2 livecds.  This thread will help you build a recent one; basically, what you need is in the cloop file.  Good luck!

 

maybe you should look there? not sure this works properly with 1.4  :Sad: 

----------

## 7biohazard7

 *synic wrote:*   

> I made the CD, and it boots, but if I just press enter to boot the gentoo kernel with the default options, it says that initrd.1024 cannot be found.  The only way I can get it to boot is to type "nofb" for no frame buffer (it seems to find that initrd ok).  
> 
> What am I doing wrong?
> 
> Thanks,
> ...

 

I also get a message saying initrd.1024 cannot be found. Using nofb allows me to boot though. 

Help,please.

----------

## rodrigrj

the only way ive been able to get around it is to just name initrd.1024 to initrd and change isolinux.cfg so that it looks for initrd my default

this has worked for my own personal use because i dont really need any of the others... 

ps: in some instances renaming to initrd.800 has worked too

----------

## quark67

The partthat's confusing me here is where you say, 'make sure you include the needed libraries.' Once I have found out what libraries are needed, exactly how do I include them? Also this guide is quite old and there is no longer a ram disk image called 'rescue.tgz' There is however one called initrd. (No .tgz extension) How I wonder should I xtractthis? Any input anyone can offer would be deeply appreciated.

Q

----------

## quark67

Oh - and here is the output I got from the last two stages of this process. Apparently a few things have changed since Gentoo 1.4.

bash-2.05b# cd /mnt/iso

bash-2.05b#

bash-2.05b# rm /mnt/iso/isolinux/boot.catalog

rm: cannot remove `/mnt/iso/isolinux/boot.catalog': No such file or directory

bash-2.05b# rm /mnt/iso/isolinux/boot.catalog

rm: cannot remove `/mnt/iso/isolinux/boot.catalog': No such file or directory

bash-2.05b# mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso

mkisofs: Missing pathspec.

Usage: mkisofs [options] file...

Use mkisofs -help

to get a list of valid options.

bash-2.05b#[/code]

Q

----------

## rodrigrj

in order to extract the initrd you would type

gunzip -c initrd > somefile

and then you mount -o loop somefile /to/some/dir

but that really wont do you any good as the initrd is only 4megs (me thinks) and is only used for the purpose of setting up the system. if you want to add anything nowadays you need to use the .cloop file in the cdrom

you cant add anything though, because if you mount with the cloop module, it will be read only, you could try extract_compressed_fs, but i still dont know if there's room. therefore, you'd have to do like the tutorial on the first page says in order to create the loopback filesystem.... 

then you'll need to run create_compressed_fs in order to create a .cloop file.

copy that onto the cd, call it livecd.cloop, and you should be golden

*note: cloop, create_compressed_fs, and extract_compressed_fs can be obtained by emerging cloop

----------

## rodrigrj

you posted while i was typing.... grrr no i have to write some more

bash-2.05b# mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso 

after that you neet to tell it what directory to use for the iso

so it should look like

```
bash-2.05b# mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso my-gentoo-dir

```

----------

## quark67

Mmm I'm not sure I understood rodrigr there, not quite. It would be nice if someone could make an updated 1.4 guide - but oh well...  :Wink: 

To be honest I'm not looking to do anything fancy, just add a 2.6 kernel to the ISO so that the whole system will be built with a 2.6 kernel in place. I don't know, but at a hunch it might help with some consistency issues I've been having.

I tried your instructions to burn the iso, i.e. I navagated to the directory containing all the files that would be on he iso are located (that is the two directories called 'isolinux' and gentoo') which in my case is simply /mnt/iso and ran the command '# mkisofs -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.catalog -o /mnt/newgentoo.iso /mnt/gentoo (mnt/gentoo being a directory I have made and where i would like the iso to be placed).'  However the only response  got was 'mkisofs: Uh oh, I cant find the boot catalog directory 'isolinux'

This directory is in factlocated at /mnt/iso/isolinux....

So if all I want to do is run the cd with a new 2.6x kerne included, how I wonder would  achieve this? I don't care about aditional software,(so long as lynx and nano are still there) although it would be nice to figure out how to do a a later date.

Also  noticed that the files that this process made contained an initrd taken from the iso. I wonder therefore, is it ok just to use the initrd that genkernel made for my 2.6 kernel, and replace the one that came off the cd? It just seems that  would then have a matching initrd and kernel and kernel headers, which I assume would make a lot of sense.

Please tell me how to o this. I would be very interested n your response.

Q

----------

## rodrigrj

im sorry, what i meant was that the last argument is the folder where the files you want to be on the iso are ... in your case /mnt/iso - thats where the files you want to put on the cds are, right?

also, ive tried, and it is currently impossible to put a 2.6 kernel on the cd because the cloop module does not have support for that kernel, yet....

if you really had your heart set on using a 2.6 kernel, then you'd have to copy everything in the cloop device file (usually called livecd.cloop) into a ramdisk file....

----------

## quark67

There is a new official (beta) 2.6 live CD anyway. What would still be cool though would be if there was a Gentoo ISO generator, like there is for Geexbox. It is then up to you whatever programs you include on the live CD.

Q

----------

## rodrigrj

try livecdng

----------

## quark67

You got a link? There's a lot of chat about it on the forums, but no links...

Q

----------

## rodrigrj

......

emerge livecd-ng

----------

## quark67

Cool thanks.

Q

----------

## Redeeman

nice, but what i would like, was a guide like the one to hack knoppix cd, i would like to place my own kernel on the livecd, and change the startup services, add some applications and stuff, it would own! can someone help me?

----------

## DanBUK

 *rodrigrj wrote:*   

> ......
> 
> emerge livecd-ng

 

[Shameless self promotion]

I have been working on the livecd generation script. The newer version isnt in portage, but ive made some ebuilds and a tbz2 with the newer version.

To get it installed : http://livecd.lockedbox.net/install.html

[/Shameless self promotion]

I hope it helps some of you with making your LiveCDs

Cheers,

Daniel.

----------

## quark67

Well, if it lets us include X and other things, perhaps it will... Only joking, thanks for the great work.  :Smile: 

Q

----------

## DanBUK

 *quark67 wrote:*   

> Well, if it lets us include X and other things, perhaps it will... Only joking, thanks for the great work. 

 

Humm, yeh you can stick what ever you fancy on it  :Smile: 

On a different tack: http://uptime.daemonbox.de - join in a little uptime game?

----------

## kermitjunior

marker, baby. TIme to roll my own!

----------

## stahlsau

woohoo, nice one! Thanks for the howto!

Finally a howto that works for me  :Wink: 

Now i got my ultimate-rescue-DVD with my own kernel, quickpkg-created packages of my whole system and a backup of /etc and my /home. I love it. Doing a clean and full install with optimized precompiled packages in half an hour is really great!

----------

## Kronos

Bringing this back up - now trying to do this with the 2005.0 minimal cd, add a few things, then repack.  Process worked fine (gentoo.igz instead of rescue.gz) but boot fails with a kernel panic - init not found.  Anybody know what happened, had tried this, etc?

----------

## cotlod

Excuse me for my english, i'll try to remember something...

The problem: how can I 'unzip' file .igz?I'm novice with gentoo.

thanks

----------

## wescott

Thanks for posting this howto.  I am going to need it when I make an easier install process for the distro I've been developing for my customers!

----------

## vanten

Sweet! I will look into this HowTo in detail later (after getting me a UMPC   :Cool: . )

Thanks for adding it!

edit: better late then never...  :Smile: 

----------

