# Build a Gentoo install/boot/rescue LiveCD USB

## Donut

Build your own Gentoo install / boot / rescue LiveCD and USBStick

I've written this how-to after trying to find a boot medium for my home gateway machine which could be used for system rescues and even installing Gentoo. Why not use the standard Gentoo Live CD you ask? Well my gateway machine is one of those small, silent and cool running mini-itx machines (http://www.mini-itx.com) and has no CDROM or floppy drive. I needed some way of getting Gentoo on there and some way of easily rescuing it when the need arises. The good news is that these VIA mini-tix machines are USB bootable and I much preferred the idea of having a little USB drive/stick that I could push into any USB bootable machine and boot into Linux rather than having to set up a PXE networked boot environment (which is also supported).

So I purchased a 64Meg PQI USB stick from http://www.ebuyer.com for about 15 quid and had a go at generating the equivalent of Gentoo LiveCD to work from a USB drive. During my research I found that there was not really any documentation on re-building the Gentoo LiveCD in general (eg. to add uncommon hard-drive and network driver support, etc), so this is also a how-to on re-building the normal LiveCD too. The output of this procedure yields an installation which can be used for both Gentoo Live CDs and USB sticks.

Instructions

Use an existing Gentoo Linux machine and insert your USB stick into it (the USB drive must be at least 28Meg in size and needs to support USB booting). If  you intend to also put the Gentoo stage1 bz2 archive on there too, for installations, you will need an additional 12 Meg. The alternative is to just use 'wget' to retrieve the stage1 archive from a Gentoo mirror once you've booted the Gentoo Live USB stick.

First emerge the livecd-ng ebuild package which I believe is used to create the normal LiveCD (its masked).

```

     ACCEPT_KEYWORDS="~x86" emerge livecd-ng

```

This installs a LiveCD ISO creation script at /usr/sbin/livecd-ng. In addition, a new directory called livecd-ng is created in /etc which will be used to create and store the profile of the type of livecd you wish to create. This contains a profile called gentoo-basic by default which will be used and customised..

Change some of the settings specified in this profile to:

 Use the correct the Gentoo mirror

 Ensure the LiveCD loads the relevant USB modules on boot-up

 Specify the custom Kernel config file to be used.

```

    cd /etc/livecd-ng/profiles/gentoo-basic

    nano -w settings

           (change the CD_STAGETARBALL line to)

              CD_STAGETARBALL=http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/1.4_rc4/x86/x86/stages/stage3-x86-1.4_rc4.tar.bz2

           (add the following usb modules to the START of the STORAGE_MODULES variable)

              usbcore usb-uhci uhci usb-ohci usb-storage

           (change the KERNCONFIG config file name to the following)

              KERNCONFIG=kernel-config-2.4-latest

```

Change the boot message to welcome from the Live USB stick in addition to the Live CD.

```
   

   nano -w motd

      (change the welcome line to)

           Welcome to the Gentoo Linux LiveCD / LiveUSBstick !

```

Copy an existing Kernel config file and customise it to include all the relevant USB modules and to also include support for VFAT filesystems (used as the filesystem on most USB drives).

```

   cp kernel-config-2.4.20_pre4-pcmcia kernel-config-2.4-latest

   nano -w kernel-config-2.4-latest

       (set the following parameters in the 'File Systems' section)

             CONFIG_FAT_FS=y

             CONFIG_MSDOS_FS=y

             CONFIG_VFAT_FS=y

       (set the following parameters in the 'USB Support) section)

             CONFIG_USB=m

             CONFIG_USB_DEVICEFS=y

             # CONFIG_USB_EHCI_HCD is not set

             CONFIG_USB_UHCI=m

             CONFIG_USB_UHCI_ALT=m

             CONFIG_USB_OHCI=m

             CONFIG_USB_STORAGE=m

```

Modify the file stating which masked ebuilds should be included in the LiveCD. Note: We are going to use the latest gentoo-sources kernel instead and partimage is no longer a masked package.

```

   nano -w stage1-experimental

       (REMOVE the following TWO entries:)

            =sys-kernel/xfs-sources-2.4.20_pre4

            sys-apps/partimage

```

Modify the file stating the standard ebuilds to include the latest 2.4 Gentoo kernel and the partimage utility.

```

   nano -w stage1-packages

      (at the end of the file, add the following two entries)

            sys-kernel/gentoo-sources

            sys-apps/partimage

```

The init script used by the LiveCD image on bootup is called liunuxrc. This needs to be modified to add support for booting from the USB drive as well as CDROMs.

```

   nano -w /etc/livecd-ng/profiles/global/linuxrc

     (add the following new function directly preceding the existing findmount() function)

        findusbmount() {

            if mount -t vfat -r /dev/sda1 /newroot/mnt/cdrom; then

                if [ ! -e /newroot/mnt/cdrom/livecd.cloop -a ! -e /newroot/mnt/cdrom/livecd.loop ]; then

                    echo -e "${HILITE}---- /dev/sda1 is not a LiveUSBStick; skipping...${NORMAL}"

                    umount /newroot/mnt/cdrom

                else

                    mounted=/dev/sda1

                    echo -e "${HILITE}---- USB medium found on /dev/sda1${NORMAL}"

                fi

            fi

        }

    (remove the following lines......)

       initmsg "---- Mounting the CD"

       findmount /newroot/dev/cdroms/*

    (....and replace with the following)

       initmsg "---- Mounting the USB/CD"

       findusbmount

       if [ ! "$mounted" ]; then

          findmount /newroot/dev/cdroms/*

       fi

```

Before running the livecd-ng script to generate the ISO image, users have to specify some environment information in a special file in the user's home directory (ie. root). This includes information on the location of the existing system's portage tree plus a temporary location to build the image and download the stage1 bootstrap archive. This probably requires up to 1 Gig of temporary space. I had the most space left in my /opt partition so in my case this is the location I used.

```

   nano -w ~/.livecd-ng

         CD_DISTDIR=/usr/portage/distfiles

         CD_PORTDIR=/usr/portage

         CD_TEMPROOT=/opt/tmp

         CD_STAGELOC=/opt/download

```

For some reason the livecd-ng ebuild seems to be broken and misses out some required packages for generating the LiveCD image. Syslinux and Busybox are accessible as ebuilds but for some reason the 'cloop' utility is not available as an ebuild. This utility is used for creating a compressed boot image. I was able to locate a version on the Knoppix site. If anyone knows why this utility is not included in Gentoo I'd love to know. Note: An existing unanswered forum query which I found about this is located at: https://forums.gentoo.org/viewtopic.php?t=36695

```

  mkdir /etc/livecd-ng/archives

  emerge syslinux

  cp /usr/lib/syslinux/isolinux.bin /etc/livecd-ng/archives/

  emerge -f busybox

  cp /usr/portage/distfiles/busybox-0.60.3.tar.gz /etc/livecd-ng/archives/

  cd /etc/livecd-ng/archives

  wget http://developer.linuxtag.net/knoppix/sources/cloop_0.68-3.tar.gz

```

In addition to not including the above utilities, the versions/archive-formats of these are not what is expected by the livecd-ng script, therefore some settings in this script need to be changed.

```

   nano -w /usr/sbin/livecd-ng

       (change the version and location of the source busybox archive)

          BUSYBOX_TARBALL=busybox-0.60.3.tar.gz

          BUSYBOX_DIR=busybox-0.60.3

       (change the version and location of the source cloop archive)

          CLOOP_TARBALL=cloop_0.68-3.tar.gz

          CLOOP_DIR=cloop-0.68

       (change the busybox archive unpack line from bz2 to gz. ie. tar xj -> tar xz)

          cwrapper tar xzf ${BUSYBOX_TARBALL}

       (change the move of cloop_ucl.o line to be a move of cloop.o instead)

          cp ${CD_BUILDTEMP}/${CLOOP_DIR}/cloop.o ${CD_BUILDCHROOT}-initrd/modules/cloop.o || chroot_die "can't find ucl cloop module"

       (change use of create_compressed_ucl_fs executable line to use create_compressed_fs instead)

          cat ${LOOP_FILE} | ${CD_BUILDTEMP}/${CLOOP_DIR}/create_compressed_fs - 131072 > ${CLOOP_FILE} || chroot_die

```

Create the temporary directories for building the ISO image.

```

   mkdir -p /opt//tmp/gentoo-basic

   mkdir /opt/download

```

Move to the root of the livecd profile ready to run the ISO generation scripts.

```

   cd /etc/livecd-ng

```

Note: More help on the usage of the livecd-ng script can be found by entering the command livecd-ng -h and the command zcat /usr/share/doc/livecd-ng-1.0/README.gz | less

Run the script with the gentoo-basic profile to download all the required packages to be used in the ISO image.

```

   livecd-ng gentoo-basic fetch

```

Build all the packages (including the kernel)

```

   livecd-ng gentoo-basic build

```

Note: You will be prompted whether to include each kernel module which does not exist in the kernel config file created earlier. Once the build has finished it is worthwhile copying the modified kernel config file from /opt/tmp/gentoo-basic/cdroot/usr/src/linux/.config and overwriting /etc/livecd-ng/profiles/gentoo-basic/kernel-config-2.4-latest. If you want to modify the kernel again and rebuild it, you can then just alter 'kernel-config-2.4-latest' and then run 'livecd-ng kernbuild'.

Create the complete initrd root environment for the ISO image.

```

    livecd-ng gentoo-basic initrd

```

Clean out any extraneous files which should not be included in the ISO image.

```

   livecd-ng gentoo-basic clean

```

Note: Ignore this warning if it appears: 'No gentoo-basic clean script found; skipping'

Create the compressed loop image.

```

   livecd-ng gentoo-basic cloop

```

Create the ISO image for the livecd

```

   livecd-ng gentoo-basic isogen

```

Undo any temporary chroot environments used by the script.

```

   livecd-ng gentoo-basic umount

```

You now have a CD bootable Gentoo LiveCD ISO image ready to be burnt onto a CD using your favourite CD burning software. This image will be located at:

/opt/tmp/gentoo-basic/livecd.iso

Note: When burning a CD you may also want to include an extra directory called 'gentoo' at the root of the CD and copy the 3 Gentoo stage bz2 archives from a Gentoo mirror, into there.

Next

These are the last few steps to produce a bootable USB drive in addition to the CD:

Check that the usb drive is inserted into the machine but is NOT mounted

WARNING: These instructions assume that the usb drive has been allocated to device sda1. If you have a SCSI hard drive or other SCSI device this may not be the case so ALTER the device number used below otherwise you will end up blowing away some partitions and/or your hard drive!!

Install the Gentoo package for creating VFAT filesystems

```

   emerge dosfstools

```

Clean out any old crap (like your CV!  :Wink:  ) from the usb stick. This may take a few minutes (ignore the warning at end).

```

   dd if=/dev/zero of=/dev/sda1

```

Format the usb drive with a VFAT filesystem.

```

   mkfs.vfat /dev/sda1

```

Mount the USB stick

```

   mkdir /mnt/usbstick

   mount -t vfat /dev/sda1 /mnt/usbstick

```

Copy the generated LiveCD boot files which were used in the ISO to the root of the USB drive.

```

   cp /opt/tmp/gentoo-basic/isoroot/livecd.cloop /mnt/usbstick/

   cp /opt/tmp/gentoo-basic/isoroot/isolinux/* /mnt/usbstick/

```

Make a copy of the ISO Syslinux bootloader configuration file to the name required by Syslinux for floppy/usb booting.

```

   cp /opt/tmp/gentoo-basic/isoroot/isolinux/isolinux.cfg /mnt/usbstick/syslinux.cfg

```

Note: You may also want to include an extra directory called 'gentoo' at the root of the USB drive and copy the Gentoo stage 1 bz2 archive from a Gentoo mirror, into there.

Unmount usb stick and then run the Syslinux utility to make the USB stick bootable.

```

   umount /mnt/usbstick

   syslinux /dev/sda1

```

You now have a bootable Gentoo LiveUSB stick!!!

Remove the usbstick, and push it into the usb port of the target machine to be booted into Gentoo. Configure the BIOS of the target machine to boot from USB before the hard drive and then boot the machine.

To make a back-up copy of the USB stick image you can use a command like the following:

```

   dd if=/dev/sda1 of=~/gentoousb.img

```

Then whenever you need to restore your USB stick to the Gentoo Live image you built, you can run a command like the following:

```

   dd if=~/gentoousb.img of=/dev/sda1

```

NOTES

As an alternative, Instead of using the livecd-ng package to create a USB bootable Linux device, you could start off with the pre-built LiveCD image provided by Gentoo, mount the iso, modify the linuxrc scripts, add the extra USB modules, copy the contents to the formatted USB stick and then run syslinux to make the device bootable. https://forums.gentoo.org/viewtopic.php?t=21327 should provide some good pointers for getting started with this alternative method.

I don't know how feasible it is, but the Gentoo store could sell small USB sticks with the Gentoo Logo on the side and the Gentoo Live install already included. This would make a great way of providing Gentoo with more funds in addition to normal donations and would probably appeal to a lot more people? The USB drive I bought is tiny and fits on a key ring. This means that I've got Gentoo at my fingertips wherever I may be.

(edited 3-Jun03)

The following bugs and enhancement reqests have been added/modified in relation to this howto to make building livecds and usbs easier:

 BUG 22155: Sort out the livecd-ng script to use correct versions of BusyBox and Cloop and include Busybox, Cloop and Syslinux in the gentoo-basic example profile

 BUG 21411: Include cloop as a standard ebuild for Gentoo

 ER 22157: Modify the linuxrc script and example basic-gentoo profile to provide support for LiveUSBsticks in addition to the LiveCD

Note: The initial linuxrc script changes I've used in the how-to will need some improvement to cycle through all possible USB devices and may also need to ensure that there is no conflict with existing SCSI devices.

Good Luck!

PaulLast edited by Donut on Tue Jun 03, 2003 11:43 am; edited 2 times in total

----------

## mepython

You have very nicely explain how to use livecd-ng and also modify it to create usb bootable iso. I am trying to install livecd through  tftp/NFS, so that I can use it on all machines on LAN. Any idea how to achive this?

----------

## Squinky86

A big "Thank You"!  Though there were a few warnings, after two or three tries experimenting with the USE vars, the iso built, and I will try it out as soon as I can.  Think of the possibilities- custom gamecd's, repair cd's, there's a lot that can be done and this was an excellent howto!

----------

## Donut

FYI, I have updated this how-to include the numbers of the bugs and enhancement request which have been raised to enable building livecds and live usbs to be easier.

mepython: Unfortunately the only way I know of doing remote Gentoo installs is via PXE. See:

https://forums.gentoo.org/viewtopic.php?t=54293&highlight=pxe

Cheers

Paul

----------

## searcher

Wow this sounds cool! I've been thinking about getting a memory stick (they're on sale here right now) to put my own version of a linux on it. So i guess i'd better get one, just to see how it works  :Smile:  Good work on the howto!

----------

## Donut

One of the main caveats about booting usb drives is does your PC's BIOS support booting from USB?

Apparently this is getting more common, but I only know for sure that the VIA mini-itx ones do.

Actually this thread would probably be a good place for others to list which types of PCs and also which types of USB devices they know support USB booting. To start the list off....

USB BIOS bootable systems:

VIA EPIA mini-itx systems

Bootable USB devices:

PQI USB Traveling Disk 32MB - 256MB

Cheers

Paul

----------

## searcher

Well i got me a usb keychain, 64mb. Followed all the stuff in the howto, shutdown pc and rebooted. Had to tinker a bit with the bios, but i finally got a response when selecting "boot from usb-fdd". That's where it ends though, the pc hangs at "Booting from usb-fdd"  :Sad:  Would anyone care to comment on how to setup the BIOS properly to support the usb keychain? Or is my keychain just incapable of being booted from? I didn't get any errors when i ran syslinux /dev/sda1 so i guess it should work .. right? 

Hope anyone has some thoughts on this.

*edit: just for fun i decided to burn a cd with the iso created by the livecd-ng script. And i booted from that ... EXCEPT it hung at the same point where the usb-keychain would hang as well. So i'm trying with the alternative method of modifying the existant iso. See if that works.

----------

## Donut

Hi Searcher

Do you have a BIOS boot option of USB-ZIP in addition to USB-FDD. My machine has both, and I've just checked trying to boot the USB device with each. The USB-ZIP one works fine, but the USB-FDD one does not detect or boot the USB device. I guess this option can only work with usb floppy disk drives.

Hopefully you have a USB-ZIP option. Sorry I wasn't aware of this issue earlier - let us know how you get on.

Paul

----------

## searcher

Well i'm working on modifying the iso, using the thread mentioned in the howto. I have lots of options for booting from usb devices on my K7S5A: usb-fdd, usb-cdrom, usb-hdd, usb-ls120 and usb-zip/mo. I've tried using the zip option with the key, but still no go. As the cd i burnt with the same files didn't work i'm assuming something went wrong with the script. 

The reason i'm bent on getting this to run is the fact you could get a whole system on a usb-stick, something like knoppix, but a lot smaller. I've been looking around and there's a small X server available, about 4 megs large. It should be possible to create a "full" system on the 64 mb available. But first i have to get it running the way it is now  :Wink: 

 *Donut wrote:*   

> Hi Searcher
> 
> Do you have a BIOS boot option of USB-ZIP in addition to USB-FDD. My machine has both, and I've just checked trying to boot the USB device with each. The USB-ZIP one works fine, but the USB-FDD one does not detect or boot the USB device. I guess this option can only work with usb floppy disk drives.
> 
> Hopefully you have a USB-ZIP option. Sorry I wasn't aware of this issue earlier - let us know how you get on.
> ...

 

----------

## perry

Not sure if I should post a request for help here or in a new thread... but here goes.

I'm up to the cloop part, everything else seemed to work right.  But I get a bunch of errors:

```

localhost livecd-ng # livecd-ng gentoo-basic cloop

Using current working directory as LIVECD_ROOT.

80000+0 records in

80000+0 records out

cp: writing `/opt/tmp/gentoo-basic/looproot/usr/sbin/smbd': No space left on device

.....

cp: cannot create directory `/opt/tmp/gentoo-basic/looproot/var': No space left on device

chroot_generate: aborting.

```

There's almost 3 gigs of space on the partition, so that's not the problem.  FWIW, I had to use the 1.4_rc4 stage3 image because it seems like the one referenced in the livecd-ng stuff has disappeared (or wasn't there this morning).

While I'm asking questions, does anyone know if it would be possible to put the image on a zip drive, using the directions from the USB keychain as a guide?  I'd like to make a bootable Zip drive that I can use to load partimage for imaging machines... Would make it easier to change config files and edit scripts if the files were on a Zip disk.  None of the machines I need to image can be booted from their USB ports..

----------

## zaragon

Try increasing LOOP_SIZE in /etc/livecd-ng/profiles/<your profile>/settings. You have 80000 there and that is to small.

The same problem with 'livecd-ng <profile> initrd': edit /usr/sbin/livecd-ng and increase the -N3000 to mke2fs in initrd_create.

----------

## perry

 *zaragon wrote:*   

> Try increasing LOOP_SIZE in /etc/livecd-ng/profiles/<your profile>/settings. You have 80000 there and that is to small.

 

Cool deal, that seems to have done it.  I increased it to 100000.  Thanks!  Now to try out my ISO...

editing this message from my burned CD.  Looks like everything worked!

Back to my normal installation.  Now I understand what I changed  :Smile:   My cloop size reported in 'mount' while booted the CD said that I was using 86MB, CD only had 36MB on it.  Guess I just needed more space on the cloop device since I added samba and partimage to my CD.  I'll play around w/ the Zip disk on Monday at work (on a Redhat machine..).

----------

## searcher

Well i got the image all working (thanks Paul, i owe you one) But still no luck from my usb-stick and config  :Sad:  I'm assuming it's the usb-stick since my bios tells me it is capable from booting from usb. Tried all the options there. So my guess my stick just doesn't support it. Too bad, i'll just use it for knoppix storage then.

Maybe i'll give this a try again once school ends (in about two weeks). I have a lot of stuff to take care of right now  :Very Happy: 

*i'm using some no name brand stick that i got for about 20 euro's, just for the record  :Smile: 

----------

## Cylaris

Do you know what CFLAGs the system uses to build with? Is it the default cflags from /etc/make.conf?

-Cyl

----------

## Donut

The livecd-ng script and associated profile works in its own chrooted temp environment when building an image. This means that your normal Gentoo install isn't affected and you don't have to temporarily change any settings in it.

The settings file included in the livecd-ng profile (eg. /etc/livecd-ng/profiles/gentoo-basic/settings) is the place where you set compile flags, use flags, etc..  You have full control over trying to create a cd/usb which supports as many types of machines as possible or one one that is tuned for a particular machine.

Paul

----------

## OdinsDream

I've been trying out this slackware based bootable usb distribution for a few days, without any luck. I believe it may have something to do with the files unzipping improperly.

In any case, the system fails booting with "No Operating System found.".

It seems a siginificant amount of work had gone into this system, and perhaps you guys can find some nice bits of code there.

It would be nice to see a bootable USB system with the option to add and remove additional features in groups, to accomidate people with different size flash disks. Creating a system to run in 64mb is great, but it would also be nice to copy over some extra utilities if you're using a larger device.

----------

## Cylaris

Another issue I had, is that when I ran the livecd-ng script to clean. It cleaned packages that I had included onto the CD... is there a way to specify it what NOT to clean?

----------

## Cylaris

I must be missing something really simple but I keep getting:

Ext-fs error(device ramdisk(1,0)):ext2_read_inode: xxx 

errors.

Then it

Kernel Panic: No init found. Try passing init=option to kernel

...

I suspect it has something to do with the initrd generation. Maybe I'm

using too large a size? Currently it's set to 50000 blocks.

Any help would be appreciated.

Thanks,

Cyl

----------

## zephyr1256

Is it possible to create a traditional linux filesystem(ext2) install a kernel and root filesystem uncompressed, and have it be bootable(with the mini-itx boards)?  I made an ext2 filesystem on a 32 MB Pen Drive that I got today, assuming I would be able to create a bootable kernel and filesystem like you can on a hard drive.  And I have a mini-itx system coming next week.  Right now with no hard drive floppy or CD, I was planning on building a small linux system on the Pen Drive, and have that be the system for now.  Or do you have to use vfat?

----------

## Donut

Cyl - I'm not sure why you're getting the Kernel panic, but  I will look into the the package clean issue - I need to re-create my environment first as I've got a bit 'over-aggressive' in trimming down the size of my images and now I've broken my version.

zephyr1256 - When I re-create the environment I'll try it with an ext2 filesystem - I guess the only issue may be the host machine bootstrapping the OS? Also I'm sure its possible to have a writable filesystem (I don't know how yet) - this would be an advantage over other 'portable' distros like Koppix because rather than having to save your settings/files on the local hard drive of each host computer you use, you could save them directly on the usb drive. You would just have to be careful to still use a ramdisk where it makes sense otherwise the thing will run like a [slow] dog!   :Wink: 

I've sort of been resisting the temptation of building a custom usb distro based on the Gentoo 'meta' distro (creating a distro is hardly originial!   :Wink:  ) - but its starting to sound more and more appealing. I am also getting a cheap second had Zaurus soon and some of the issues are similiar - what we need is the ability to use a parent host gentoo machine to permanently host a mini-gentoo chrooted distro environment and provide any easy sync utility between this host environment and the small target device (usb / Zaurus / old 486 with tiny hard drive / whatever). Then whenever you want to add a new application to your usb/Zaurus/whatever, you do an emerge in the host computer's chrooted environment and then run a 're-sync utility' to get it onto the small device. The livecd-ng script has part of what we need already so this could be an interesting project....

Seeya

Paul

----------

## Donut

Actually, this looks to be exactly what I was looking for...

http://cvs.gentoo.org/~zwelch/embedded.html

If this will support stageing to the target device as well then that would be great    :Smile: 

----------

## Cylaris

Another helpful hint on creating a custom image is using the livecd-ng <yourlivecd> enter command.

This will chroot into the environment and you can make any changes including emerging files.

Haven't tried to get around my init problem yet. *sigh*

-Cyl.

----------

## AgenT

Donut:

Congratulations on the nice howto. Very informative. I myself have a bootable bios (K7S5A) and a bootable USB drive (uknown brand - very generic) and looked for something like this awhile ago.

As a small request, can you put a space in the middle of the line which starts with "CD_STAGETARBALL=" because it kills the width and forces those with 1024res or below to scroll. You could also mention that there is such a space for those that copy/paste and do not look carefully enough  :Smile: 

----------

## DanBUK

 *Cylaris wrote:*   

> Another issue I had, is that when I ran the livecd-ng script to clean. It cleaned packages that I had included onto the CD... is there a way to specify it what NOT to clean?

 

its all inside /usr/sbin/livecd-ng (assuming you have merged it) the whole thing is written in BASH and i am at the moment not using clean at all, I think its handy to have the dev env on the cd. But thats not to everyones taste.

I had probs when booting my cd, it couldn't mount the cloop filesystem and then cp the var etc home dirs. then Kernel panic. Anyone else had this problem?

Cheers,

Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:03 pm; edited 1 time in total

----------

## searcher

I've tried formatting my usb-stick as an ext2 filesystem, but syslinux won't install to it. It keeps complaining about needing a vfat system.

- searcher

----------

## DanBUK

I think this is mentioned a bit further up this topic but I think all USB sticks need a VFAT filesystem.Last edited by DanBUK on Sun Nov 09, 2003 7:06 pm; edited 1 time in total

----------

## Filo_kg

 *DanBUK wrote:*   

> (...)
> 
> I had probs when booting my cd, it couldn't mount the cloop filesystem and then cp the var etc home dirs. then Kernel panic. Anyone else had this problem?(...)

 

Yes I have also encountered this problem. the system starts to panic after insmod cloop wrong argument or something like that.  I have tried to insert this module with the same parameter on my normal Gentoo system  (as you can read in /usr/sbin/livecd-ng) insmod /path/to/your/cloop/cloop.o file=/path/to/your/image/livecd.cloop and got the same error. However in logs I have found some additional useful info:

Jun 23 21:15:24 filo cloop: Welcome to cloop v0.68

Jun 23 21:15:24 filo cloop: /mnt/hde8/tmp/gentoo-basic/livecd.cloop: 2266 blocks

, 131072 bytes/block, largest block is 131112 bytes.

Jun 23 21:15:24 filo cloop: out of memory for compressed buffer 131112

Which was quite strange because (with 256 MB of RAM) I for sure had enought free memory. 

So I have changed in /usr/sbin/livecd-ng the block size of cloop from 131072 to 6553

cat ${LOOP_FILE} | ${CD_BUILDTEMP}/${CLOOP_DIR}/create_compresse

d_fs - 65536 > ${CLOOP_FILE} || chroot_die

And now I can insert the cloop without any problems. However I didn't check if it works in real cd.

I am just wondering why I had to change the block size? My cloop is about 127MB, I use kernel 2.4.18 (because of the bloody broken HPT370 driver!) and I have changed the size of initrd to -N5000.

Any clues why is it happening?

----------

## DanBUK

 *Filo_kg wrote:*   

> 
> 
> So I have changed in /usr/sbin/livecd-ng the block size of cloop from 131072 to 6553
> 
> cat ${LOOP_FILE} | ${CD_BUILDTEMP}/${CLOOP_DIR}/create_compresse
> ...

 

I'm not sure why its happening and the above fix was nearly correct apart from a little type "131072 to 65536". And it now works from CD boot. 

I am currently building an -mpcu=i686 -o3 flagset iso. With Alsa, X, Mozilla, QT, mplayer, gabber, xchat... some more maybe, if anyone wants the iso, let me know.

edit ... whoops I should read more carefully, it does have the 6 in the code block.... lolLast edited by DanBUK on Sun Nov 09, 2003 7:08 pm; edited 1 time in total

----------

## AgenT

 *searcher wrote:*   

> Well i got the image all working (thanks Paul, i owe you one) But still no luck from my usb-stick and config  I'm assuming it's the usb-stick since my bios tells me it is capable from booting from usb. Tried all the options there. So my guess my stick just doesn't support it. Too bad, i'll just use it for knoppix storage then.
> 
> Maybe i'll give this a try again once school ends (in about two weeks). I have a lot of stuff to take care of right now 
> 
> *i'm using some no name brand stick that i got for about 20 euro's, just for the record 

 

I have the same motherboard and am having the same problem. The cd image I made out of the /opt/tmp/gentoo-basic/livecd.iso works, but the usb stick does not. And as an aside, I too am using a cheap 32mb stick like yourself  :Wink:  It is also supposed to be bootable (at least that is what they claim - I have never tried it). 

I have noticed that no matter what USB option I choose in the bios, it is always listed as USB-FDD, and only listed when the stick is plugged into the usb port at boot.

----------

## DanBUK

Hi All,

I have been playing with livecd-ngand I kept on getting a cloop segmentation fault on the livecd-ng cloop stage. Having done some reading on the cloop bugs db, I think this error is todo with cloop needing memory for the whole clooped image, so as I am upto about 1.2GB on the cd I therefore need 1.2GB of RAM or SWAP available. I am waiting for the current livecd-ng cloop to finish, butI think this has solved my problem. Will let you know in about 30mins when this finishes....

Anyone else been having problems with cloop?

Cheers,

Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:11 pm; edited 1 time in total

----------

## DanBUK

I did in the end solve this seg fault problem, I think. I have reverted back to the 0.63.1-4 version of cloop, as its the marked stable version. (still increased my swap to 1.3GB + 256Mb Ram for the cloop stage) 

And I am currently typing this inside my new livecd. Approx 330Mb ISO image (which is 28% of original size!) . Not much been installed on...

Alsa - All drivers

X (inc nvidia drivers)

Fluxbox

Mplayer

Gimp

Mozilla

Gabber

xChat

Nessus

OpenSSH

mlDonkey(If you wanted to dl to ALL of your HDD space by booting from CD...)

And its running quite well...

Now I think the process of making them is a bit more stable, time for diff versions...

Cheers,

Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:12 pm; edited 1 time in total

----------

## DiS-K

This stuff works great.

I got it working with a Dell USB drive on a Dell Optiplex GX260. 

Hint: Turn on USB Emulation in the Bios if it isn't already. That'll make USB available at boot, and made my Optiplex machine able to boot of the drive.

I also tried to boot of it on a Dell Latitude C640 (portable pc), but unfortunately, it doesn't support booting of USB.

----------

## grudge

Cool, I recently got a 128 mb stick which I use for transferring files between work and home. I'm def going to try this. Just a couple of quick questions :

1) I understand that if your motherboard doesn't support booting from a usb device, then you can still create a small bootdisk which then boots the usb stick. Is this true ? and if so, how would I go to try and create something like this...

2) How easy would it be to load something like X on the stick, obviously the different screencards would be a problem (for use in dif pc's). Any way around this, like a hardware detection proggie ?

3) Same idea as 2, but for different network cards, sound cards, etc ? Would be difficult to create some or other program which runs when you startup to either detect your hardware or which will ask you for the different hardware you have.

I'm just curious ....   :Wink: 

----------

## DanBUK

If your looking for hardware detection, take a look at the Knoppix cdrom, there are autoconfig scripts you can rip/modifiy quite easily.

I have put links to them in this topic:- 

https://forums.gentoo.org/viewtopic.php?t=62734

Hope this is of some help.

Cheers, Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:13 pm; edited 1 time in total

----------

## jspectre

I've been trying to make this work. I was wondering if anyone knew for sure if a LinkSys 2.0 (HighSpeed USB) 256M stick would work? I've got a Soyo K7VTA-B (2BA1) mobo.

I've also got a question on formatting the stick. I formatted it with fdisk, made one giant partition. Tried FAT16. Turned on the boot flag. Should it have been something else? Tried every USB boot option on my mobo (ZIP, FD, CD and HDD) but nothing seemed to work.

Thanks!

----------

## gladbach

needs vfat from up in the thread.

----------

## gladbach

mine is dying in the build process.  I dont see that I am missing anything in the tutorial.... ;/

```
livecd-ng gentoo-basic build

Using current working directory as LIVECD_ROOT.

>>> Extracting stage tarball...

mount: special device /root/.ccache does not exist

chroot_generate: aborting.

```

any ideas?

----------

## semireg

I'm was born on a redhat system, so please forgive my gentoo naiveness.

I have completed all the steps listed in the thread and it boots fine.  However, after I pick my keymap it says "CD not found".  I have a USB 2.0 external cd-rom that I would like to be able to mount discs from.  This enclosure works fine under my redhat system, is there something I'm missing?  lsmod shows usb-storage, usb-uhci and usbcore loaded.

If there is another thread/resource that would be better suited to aide me, thanks for showing me the way   :Smile: 

Loving gentoo, Semireg

----------

## The Sentinel

 *zaragon wrote:*   

> Try increasing LOOP_SIZE in /etc/livecd-ng/profiles/<your profile>/settings. You have 80000 there and that is to small.
> 
> The same problem with 'livecd-ng <profile> initrd': edit /usr/sbin/livecd-ng and increase the -N3000 to mke2fs in initrd_create.

 I've been struggling to get the initrd phase of the livecd-ng script to complete.

Originally I was getting the "no space left on device" error messages when the initrd step was trying to create the device nodes.

Having adjusted:

- The LOOP_SIZE parameter in /etc/livecd-ng/profiles/gentoo-basic/settings to

  180000

- The -N parameter in the mke2fs line of /usr/sbin/livecd-ng to 20000.

I am now able to get past the creating of the device nodes, but get the following error no matter how high I increase the above-mentioned parameters to:

  cp: writing `/gentoo-basic/cdroot-initrd/bin/busybox': No space left on device

chroot_generate: aborting. 

The location the build is taking place has over 1.5 Gb of free space.

I've traced through the scripts and can't find any other parameters that might be casuing this error.

Any ideas?

Ta,

T.S.

----------

## jago25_98

Not all can boot of usb.

If we could make a boot floppy with 

- usb_massstorage

- sd_mod

(2.5+ kernel modules)

and then append="root=/dev/sda1" probably via grub because it can be edited live, then all can boot from usb.

 But does it fit?

----------

## smouge

 *gladbach wrote:*   

> mine is dying in the build process.  I dont see that I am missing anything in the tutorial.... ;/
> 
> ```
> livecd-ng gentoo-basic build
> 
> ...

 

The ccache package is missing. To resolve:

# emerge ccache

----------

## gmichels

I am trying to create a livecd with a kernel with support for the SiI3112 Sata raid controller.

I am using:

- 1.4rc4 stage 3 package

- latest ac-sources

I had to make some minor adjustments in /usr/sbin/livecd-ng such as changing the busybox executable to busybox.sh and change the initrd filesystem inodes to 5000. Apart from that, everything ran fine.

When I try to boot my created livecd, here's what I get:

[img:86c70cf395]http://www.colortechdp.com.br/pessoal/init.jpg[/img:86c70cf395]

I am sure there's support for ramdisk and initrd in the kernel.

```
CONFIG_BLK_DEV_RAM=y

CONFIG_BLK_DEV_RAM_SIZE=8192

CONFIG_BLK_DEV_INITRD=y
```

It looks like the contents of initrd are not being loaded in the ramdisk. Do I have to pass any special command to do such task?

As a test, I tried using 1.4_rc4 initrd in my livecd and it will pass this point, but will kernel panic a bit later while running linuxrc with a 'tried to kill init' error.

I can mount my initrd in a loop device without a problem.

Anyone have knowledge in this?

----------

## cchee

First of all, thanks for great tip here.... i have been looking for this since i get my hand on gentoo (recently)... Now that I follow the instruction, I ran into a problem of conflict package as show below when i ran livecd-ng gentoo-basic build:

[blocks B    ] <dev-perl/ExtUtils-MakeMaker-6.05-r6 (from pkg dev-lang/perl-5.8.0-r12)

[ebuild    U ] dev-lang/perl-5.8.0-r12 [5.8.0-r10]

I am using stage3-x86-1.4_rc4.tar.bz2 in my CD_STAGETARBALL setttings. Any idea on how to resolve this? Thanks in advance.

----------

## gmichels

That happens while trying to emerge irssi, a text based irc client. You could just open /etc/livecd-ng/profiles/gentoo-basic/stage1-packages and comment the irssi line, if you don't need one.

The true cause is because your current portage tree has a newer perl version which has some internal modules (extutils is one of them) and the version in the stage3 tarball is older and still use external modules, which is blocking the update.

Oh btw I managed to solve my initrd problem and it's almost working on my custom hardware.  :Very Happy: 

----------

## second_exodous

Has anyone with a mini-itx board set up a usb flash drive to run linux, leaving the HD in the case(the one I want only can have one HD) for video/music?  I want to build a vdr and want linux to take up as little space as possible, i.e. rest on a little usb flash drive.

Is this possible?  I scanned through this thread and all people are trying to do here is make a live cd.  What I'm wondering is can the entire linux system be just on the usb flash drive?

For a vdr box I don't need any gui(vdr has it's own) and just have networking so I can pull video off of it onto my other computers.  VDR (http://www.cadsoft.de/people/kls/vdr/) even has plugins for playing dvds.  I also wouldn't need drivers beyond the one my coputer needs, since it will only be used on one computer.

I know this is possible with linux, but I'm getting used to emerge and want to use gentoo to do this.  Wasn't there a fork in gentoo just for stuff like this?

Thanx,

Stan

----------

## Ssl

Hello all gentoo linux friends!

First I really appreciate work on this HOWTO and found almost all replies usefull while trying to make my own test-demo-fun-good-way-to-learn-gentoo-internals livecd. 

But I am having problems and hope many of you solved this and are kind enough to help.

Last step I did was ...livecd-ng gentoo-basic isogen and unmount. Burned cd and basically I got this error:

Checking root filesystem...

fsck 1.33 ...

ext2fs_check_of_mount: No such file or directory while determining weather / is mounted

* Filesystem couldn't be fixed [!!]

Give root password for maintaince and so on.

I think it is related with /etc/fstab /etc/mtab but not sure. Any solution?

PS. If this is not detailed enough please ask for more info.

Thank You,

Slobodan Sredojevic

----------

## murphynet

Hey all.

My cd boots up fine until just after "switching to tmpfs"  when it trys to remount the root filesystem with read/write.

"Root filesystem could not be mounted R/W  :Sad: "

could this be a problem with my kernel?

----------

## xanthumn

Thanks for the wonderful howto!

However I have the same problem as murphynet ... CD boots just fine, but stops after switching to tmpfs.

USING: stage3-x86-1.4-20030806.tar.bz2

```

---- Switching to tmpfs root filesystem

INIT: version 2.84 booting

* Remounting root filesystem read-only (if necessary)...  [!!]

* Checking root filesystem...                             [ok]

* Root filesystem could not be mounted R/W :(             [!!]

Give root password for maintenance

(or type Control-D for normal startup):

```

I don't have a root password, so I hit enter and it droped me to a simple prompt but none of the automagic happened. 

[edit] If I run  mount proc -t proc /proc   and then run each service in the /etc/runlevels/boot and default directories I have a usable system.  I just don't know how to get around the root fs being mounted R/W... I will keep you all updated if I work this out. [/edit]

Any info/help is apreciated.Last edited by xanthumn on Sat Sep 06, 2003 2:28 am; edited 1 time in total

----------

## BurnedOutGeek

I have been following the directions and have the following error when I run livecd-ng gentoo-basic initrd:

Using current working directory as LIVECD_ROOT.

80000+0 records in

80000+0 records out

mount: could not find any device /dev/loop#

chroot_generate: aborting.

Any ideas why?  I'm getting close!

Mark

----------

## woffer

Hi,

I'm getting an error while runing liveng-cd gentoo-fegis initrd

```

>>> Executing tar xzf busybox-0.60.5.tar.gz...

>>> Executing make clean...

>>> Executing make DOSTATIC=true...

3000+0 records in

3000+0 records out

mknod: `rd/c6d31p2-': No space left on device

mknod: `rd/c6d31p3-': No space left on device

mknod: `rd/c6d31p4-': No space left on device

mknod: `rd/c6d31p5-': No space left on device

mknod: `rd/c6d31p6-': No space left on device

mknod: `rd/c6d31p7-': No space left on device

and so on for another 3 bilion devices.

```

Anyone got an idea on this ? =)

or has the makedev command been change in the 2.6.0 kernel ? (runing 2.6.0-test4 but the iso should contain a 2.4.20 kernel)

----------

## xanthumn

woffer, this was posted above....   all you need to do is 

 *Quote:*   

> edit /usr/sbin/livecd-ng and increase the -N3000 to mke2fs in initrd_create

 

I increased mine to N5000 and it works fine.

Good luck  :Smile: 

----------

## murphynet

xanthumn, I haven't made any progress but did you do run livcd-ng gentoo-basic clean ?  I did and am suspicious that it might have gotten rid of something of importance.  I haven't tried it without the clean command as school has taken much of my time recently... just a suggestion, I'm not too optimistic about it.

----------

## BurnedOutGeek

That didnt work for me.  I went all the way to 7500 and get the same error.  Any ideas?

Mark

----------

## xanthumn

I did end up needing to run livecd-ng <profilename> clean

to drop the cloop size from 200mb (650mb uncompressed) to 67mb (200 uncompressed).

I figured out the problem I had booting the livecd

It is the stage3 I was using.  I found the older

stage3-x86-1.4_rc4.tar.bz2 here.  

This allowed my livecd creation to boot up fine and dandy. 

It seems that the newer stage3 doesn't start devfs and mount proc before

trying to run checkroot.  

Hope this helps.

-xanthumn

----------

## scottd34

I was having trouble with the release version of the stage 3 tarball.  No matter what I did, it stopped at the extracting stage tarball portion with an error about /opt/download/cdroot/usr/portage not existing.  

Looks like scrounging up an old rc4 is working a bit better.. we shall see if it fixes it.  

Any ideas about what could be wrong and a possible fix so we can use the current release version of stage 3?

----------

## BurnedOutGeek

I was able to get past that point by manually creating the portage directory before it checks for it.  Let me know if you are actually able to get past the initrd phase.  Thats where I am getting stuck.

Mark

----------

## scottd34

ya, no probs with the quick fix of adding the directory manually.. lets see if itll get past the kernel build.. it didnt on the rc version.

Well, im stuck where The Sentinel got stuck.. with the following error no matter how I adjust the two settings for cloop space and inodes in the mke2fs

```
 cp: writing `/gentoo-basic/cdroot-initrd/bin/busybox': No space left on device

chroot_generate: aborting. 
```

If anyone has gotten past this, or seen this error and fixed it.. how did you do it?

----------

## Keyed

When livecd-ng fails with running out of space, check

```
   dd if=/dev/zero of=${CD_BUILDROOT}/initrd bs=1k count=3000

   mke2fs -F -q -N3000 ${CD_BUILDROOT}/initrd

```

If you change -N3000 to a larger value, you also need to change count=3000 to a larger value. I finished a livecd last night. I have not tried booting it yet, I am currently building some stage tarballs and all seems to be working well. After this completes, I am going to put them in the isoroot directory for the livecd and redo the isogen. Then I get to test the booting of my livecd.   :Rolling Eyes: 

----------

## BurnedOutGeek

The interesting thing about this thread is that everyone has had the same error message about running out of disk space except me.  My error, during the initrd stage, says:

Using current working directory as LIVECD_ROOT.

80000+0 records in

80000+0 records out

mount: could not find any device /dev/loop#

chroot_generate: aborting. 

So, has anyone else seen this at ALL?  I am running with the released 1.4 stage3 on the x86 platform.  

Mark

----------

## scottd34

the suggestion in the post above about changing the count variable worked for me.  Give it a shot.. hopefully its the same thing youre having trouble with.

----------

## woffer

oops, how the hell could I miss that.. blackout or something.

Thanks xanthumn.

----------

## BurnedOutGeek

Nope.  Thats still not my problem.

----------

## woffer

Compile the loopback device module in the kernel.

It's under Block devices.

That should fix the missing loop device. (ofc insmod it before trying again)

----------

## BurnedOutGeek

woffer,

Should I make it a module or build it in?  If I make it a module, how do I load it?  Whats it name?

Mark

----------

## woffer

Module is simpler, since you won't use it that often and you don't have to reboot to load it =)

loop.o

edit: load it by typing  modprobe loop

----------

## BurnedOutGeek

Now that DID work, and I was able to get all the way through the process, however, when I try to boot the CD, I just get a whole bunch of errors and then it just dies.  Before building the cloop and creating the image, is it possible to chroot into the new system and make codifications, etc?

Mark

----------

## Keyed

Yes, if you enter

```
livecd-ng -h

[snip]

Other Commands:

  enter         Use "chroot" to start a shell inside the CD root.

            can be used to modify the CD before preparing an iso.

```

Although I have not tried it yet.

----------

## BurnedOutGeek

Interesting.  Seems that it has ONLY done up to a stage 2 install.  Even teh kernel is not emerged and you cant even run the emerge application.  What gives?  How would you build a completely running OS with this?  What am I missing?

Mark

----------

## Keyed

At this point, you are using the kernel from your normal linux. When you "chroot" into cdroot, you are changing your root directory to cdroot and it runs the commands within the directory structure of cdroot. All of the executables within the cdroot tree are operational. All of your pathing is with respect to the directory tree within cdroot. It is primarily for configuration tweaks before making the cd.

----------

## BurnedOutGeek

Ok.  That I can understand, but...  IN a message on page 2, someone talks about how the CD could not mount the filesystem as R/W.  Has anyone found a fix for this yet or do we just have to use the 1.4-rc4 tarball for now?

Mark

----------

## Keyed

I saw where one user had a problem with initrd, but there was another post from the same user saying that he just about had it solved.

It depends on what you are trying to do. This HOWTO was primarily written for make a livecd configured for USB stick booting. Others are using it for just making a livecd/rescue cd like the images available for download, and others want customized livecd. Some of the instructions are primarily intended for the USB booting issue.

I am just about finished building current 20030907 tarballs stage1-x86, stage2-x86, stage3-x86, stage2-pentium4, stage3-pentium4. Just using a few idle cycles, but I wanted to get the stages and put them into isoroot and regenerate the livecd iso before I tested the cd for booting.

I got the livecd-ng to generate the cd image (correctly I hope) and I have had no problems with stager and the  stage building process. When I burn the cd image, I want to have everything I want on it to make for an easy rescue/restore. If it flops, all I have to iron out is the livecd part, the tarballs will be good to store on a cd or on another drive for easy access.

----------

## BurnedOutGeek

Yeah.  What I was looking to do was to create a fully functional Linux CD with Gentoo that would run a specific application.  I guess a KNOPPIX look alike of sorts.  I have the need for a Linux system that can be booted from a CD to run this app.

I can use KNOPPIX for this purpose, and it does very well at it, but it would be much easier to create a system from scratch rather than to attempt to tak eone apart little by little.

Is this not really possible yet with Gentoo?  I did chroot into my ISO system with livecd-ng, but emerge was not there and again, no real usable OS was available fo rme either.

Mark

----------

## xanthumn

woffer: no problem, I had to scan the post several times before I saw that.   :Smile: 

I can report near total success with building a bootable livecd  :Smile: 

I only have some /etc/runlevels/boot/* error messages saying that checkfs, localmount, clock, and bootmisc could not be started.

However, when I check the status of each service, they say they have started.  As I am writing this from within my livecd system, I don't think I need to stress too much.

Thanks for all the help everyone.

As soon as I get a USBstick, the first thing I am going to do is create a LiveUSBstick  :Smile: 

xanthumn

----------

## BurnedOutGeek

Man.  Could you possibly post some of the things that you did to make an actual livecd?  That would be a BIG help!

Mark

----------

## woffer

Woho, my livecd work now!

but I get the same errors as xanthumn, and an extra error before that...

something about /dev/tty0 not being found while setting keymap.

----------

## gerzy

EDIT:   Ignore this post! I've realized that this is a hack that won't get you very far... the real reason for this problem is that the inittab that the livecd-ng build uses is incompatible with the /sbin/rc from the final 1.4 stage3 tarball.  The other init scripts need tweaking as well.  Look for a follow up post from me with the details once I work them out. 

-gerzy

-----------------------------------------------------------------------------

 *BurnedOutGeek wrote:*   

> Ok.  That I can understand, but...  IN a message on page 2, someone talks about how the CD could not mount the filesystem as R/W.  Has anyone found a fix for this yet or do we just have to use the 1.4-rc4 tarball for now?
> 
> Mark

 

If you are using the final 1.4 stage3 tarball, you need to add an entry for the root dev in your fstab... 

```
/dev/root     /      ext2     defaults      0 0
```

Note that the livecd-ng script will replace the fstab in your cdroot with /etc/livecd-ng/profiles/global/aux-files/fstab when you run "livecd-ng gentoo-basic clean", so this is the best place to make the change.  If you have already run "clean", copy this file to ${CD_TMPROOT}/gentoo-basic/cdroot/etc/fstab.

You might also have to add aline somewhere to mount /proc... I added the following line to /etc/init.d/checkroot right after root is mounted read-write:

```
mount -n none /proc -t proc
```

"checkroot" is also copied from /etc/livecd-ng/profiles/global/aux-files during "clean".

Hope this helps!Last edited by gerzy on Wed Sep 10, 2003 10:40 am; edited 1 time in total

----------

## Kronos

Does the stage2 or stage3 gentoo cd include partimage?  if so what version?

Kronos

----------

## Kronos

Also, i can't emerge syslinux because i am getting errors with getting mtools:

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------

LOG FILE = "/tmp/sandbox-mtools-3.9.8-r1-30537.log"

chown:     /var/cache/edb

chown:     /var/cache/edb/dep

open_wr:   /var/cache/edb/mtimedb

--------------------------------------------------------------------------------

kronos

----------

## gerzy

Thought I'd add one thing to this howto.... I had to perform one extra step to get my Gentoo Live USB Stick to boot...

I'm using a Sony SRX87 and Memory Stick to build the system.  The SRX BIOS won't boot off the Mem stick interface but my desktop BIOS will.

I had to add a boot loader at the head of the stick... I used a DOS bootloader that I keep handy in a file.  I had to write the boot loader to /dev/sda and not /dev/sda1.  I grabbed only the bootlader from the MBR of an HDD that had been sys'ed in DOS.  If you do this only grab the first 446 bytes of the MBR... after that you've got the partition table and you don't want your HDD partintion table on your USB stick.

For kicks I tried installing grub as well and, lo and behold... it worked!  Assuming you have grub installed on your build machine, that your USB device shows up as hd1 to grub, and your live Gentoo Live USB Stick is prepped and ready to go, you can do the following... 

Copy the grub files to the USB stick:

```

# mount -t vfat /dev/sda1 /mnt/usbstick

# cp -a /boot/grub /mnt/usbstick

# umount /mnt/usbstick

```

Grub your memstick... be careful to correctly ID your USB interface!!  My system boot partition is ext2 so I knew I had the memstick when grub reported the partition type as fat when I typed the "root" command.

```

# grub

grub> root (hd1,0)

 Filesystem type is fat, partition type 0x6

grub> setup (hd1)

grub> quit

```

Put this entry in the grub.conf on the memstick... Notice I switched to hd0 here. This is because the memstick will be the first BIOS drive when you boot off it.

```

title Gentoo

root (hd0,0)

norootverify

chainloader +1

```

That's what worked for me.

----------

## Kronos

Here's what I am having problems with:

```

hostname livecd-ng # livecd-ng gentoo-basic build

Using current working directory as LIVECD_ROOT.

>>> Extracting stage tarball...

mount: mount point /opt/tmp/gentoo-basic/cdroot/usr/portage does not exist

chroot_generate: aborting.

hostname livecd-ng #

```

Any help?  It looks like something simple.  But I don't know.

-Kronos

----------

## gerzy

 *Kronos wrote:*   

> Here's what I am having problems with:
> 
> ```
> 
> hostname livecd-ng # livecd-ng gentoo-basic build
> ...

 

The final 1.4 stage3 tarball doesn't have the /usr/portage directory in it...

you can fix this as follows:

On or about line #175 of /usr/sbin/livecd-ng edit mount_all() to create the directory if it doesn't exist:

```

mount_all() {

   mount -o bind /dev $CD_BUILDCHROOT/dev || chroot_die

   mount -o bind /proc $CD_BUILDCHROOT/proc || chroot_die

   # Added this since the stage3 tarball doesn't have this dir in it 

   [ ! -e ${CD_BUILDCHROOT}/usr/portage ] && install -d ${CD_BUILDCHROOT}/usr/portage

   mount -o bind $CD_PORTDIR $CD_BUILDCHROOT/usr/portage || chroot_die

   [ ! -e $CD_BUILDCHROOT/tmp/livecd ] && install -d $CD_BUILDCHROOT/tmp/livecd

   mount -o bind $CD_BUILDTEMP $CD_BUILDCHROOT/tmp/livecd || chroot_die

   mount -o bind ${CCACHEDIR} ${CD_BUILDCHROOT}/${CCACHEDIR} || chroot_die

   mount -o bind $CD_DISTDIR $CD_BUILDCHROOT/home/distfiles || chroot_die

}

```

----------

## Kronos

Alright, I used the final stage3 tarball, and has anyone figured out how to get it to boot?  I'm not using the usbstick or anything like that to boot.  I'm just trying to make a livecd that has partimage on it.  Everything worked during the install after a couple of modifications, but it gets can't mount root filesystem type of errors, as follows:

```

* Remounting root filesystem read-only (if necessary)...     [ !! ]

* Checking root filesystem...                                [ ok ]

* Remounting root filesystem read/write...

* Root filesystem could not be mounted R/W :(                [ !! ]

Give root password for maintenance

(or type Control-D for normal startup):

```

Someone has been having issues like this but nobody has posted anything regarding this yet, right?  Any ideas?

-Kronos

----------

## gerzy

 *Kronos wrote:*   

> Alright, I used the final stage3 tarball, and has anyone figured out how to get it to boot?  I'm not using the usbstick or anything like that to boot.  I'm just trying to make a livecd that has partimage on it.  Everything worked during the install after a couple of modifications, but it gets can't mount root filesystem type of errors, as follows:
> 
> ...
> 
> 

 

You can fix this by replacing the contents of /etc/livecd-ng/global/inittab with the following:

```

#

# /etc/inittab:  This file describes how the INIT process should set up

#                the system in a certain run-level.

#

# Author:  Miquel van Smoorenburg, <miquels@cistron.nl>

# Modified by:  Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>

# Modified by:  Daniel Robbins, <drobbins@gentoo.org>

# Modified by:  Martin Schlemmer, <azarah@gentoo.org>

#

# Manually tweaked to work with livecd-ng 1.0 and final 1.4 stage3 tarball

#

# Default runlevel.

id:3:initdefault:

# System initialization, mount local filesystems, etc.

si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.

rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown 

l1:S1:wait:/sbin/rc single

l2:2:wait:/sbin/rc nonetwork

l3:3:wait:/sbin/rc default

l4:4:wait:/sbin/rc default

l5:5:wait:/sbin/rc default

l6:6:wait:/sbin/rc reboot

z6:6:respawn:/sbin/sulogin

# TERMINALS

c1:12345:respawn:/sbin/mingetty --noclear --autologin tty1

c2:12345:respawn:/sbin/mingetty --noclear --autologin tty2

c3:12345:respawn:/sbin/mingetty --noclear --autologin tty3

c4:12345:respawn:/sbin/mingetty --noclear --autologin tty4

# What to do at the "Three Finger Salute".

ca:12345:ctrlaltdel:/sbin/shutdown -r now

# Used by /etc/init.d/xdm to control DM startup.

# Read the comments in /etc/init.d/xdm for more

# info. Do NOT remove, as this will start nothing

# extra at boot if /etc/init.d/xdm is not added

# to the "default" runlevel.

x:a:once:/etc/X11/startDM.sh

# End of /etc/inittab

```

You should also replace the contents of /etc/livecd-ng/global/aux-files/modules with this to get a working system:

```

#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

#

# Manually tweaked to work with livecd-ng 1.0 and final 1.4 stage3 tarball

depend() {

   need checkroot hostname

   use isapnp

}

load_modules() {

   [ -z "$1" ] && return 0

   [ ! -r "$1" ] && return 0

   # Loop over every line in $1

   (egrep -v "^#|^$" "$1"; echo) | # make sure there is a LF at the end

   while read module args

   do

      [ -z "${module}" ] && continue

      ebegin "  Loading module ${module}"

      modprobe -q ${module} ${args} &>/dev/null

      eend $? "  Failed to load ${module}"

   done

   echo

   

   return 0

}

start() {

   # Should not fail if kernel do not have module

   # support compiled in ...

   [ -f /proc/modules ] || return 0

   

   # Here we should fail, as a modular kernel do need

   # depmod command ...

   if [ ! -x /sbin/depmod ]

   then

      eerror "ERROR:  system is missing /sbin/depmod !"

      return 1

   fi

   

   ebegin "Calculating module dependencies"

   /sbin/update-modules &>/dev/null

   eend

   if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]

   then

      einfo "Using /etc/modules.autoload:"

      # Loop over every line in /etc/modules.autoload.

      load_modules /etc/modules.autoload

   else

      local KV="$(</proc/sys/kernel/osrelease)"

      local KV_MAJOR="`KV_major "${KV}"`"

      local KV_MINOR="`KV_minor "${KV}"`"

      # New support for /etc/modules.autoload/kernel-$KV

      if [ "$(get_KV)" -ge "$(KV_to_int '2.5.0')" ] && \

         [ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]

      then

         einfo "Using /etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}:"

         load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"

      else

         einfo "Using /etc/modules.autoload.d/kernel-2.4:"

         load_modules /etc/modules.autoload.d/kernel-2.4

      fi

   fi

   #

   # Just in case a sysadmin prefers generic symbolic links in

   # /lib/modules/boot for boot time modules we will load these modules

   #

   if [ -n "$(modprobe -l -t boot)" ]

   then

      modprobe -a -t boot \*  &>/dev/null

   fi

}

# vim:ts=4

```

Note that these are mininmally merged from the livecd-ng and final 1.4 stage3 tarball versions of these files.   They'll get you up and running though.

EDIT:  I forgot to mention that these files are copied to your cdroot when you run "livecd-ng gentoo-basic clean".   If you're already passed that point you can manually copy inittab to gentoo-basic/cdroot/etc/ and modules to gentoo-basic/cdroot/etc/init.d/ in your build directory.

----------

## watersb

Thanks for a great thread!

If ALL you want to do is to boot from a USB memory stick, I have been able to create a Linux system on a USB memory stick formatted with ext2 that boots just fine.

I have some detailed instructions on a tiny initrd that pivot_root boots the USB stick, if your system cannot boot from the USB storage -- or if BIOSes that can do so indeed require it to be VFAT (instead of ext2).

Of course, this would not be a total solution for a rescue system, since if you lose the boot partition it won't do much good...

But it might be of interest to this thread, so

https://forums.gentoo.org/viewtopic.php?t=31363&start=251

----------

## Kronos

Editing those files got my further along, but still nowhere, really:

 *Quote:*   

> 
> 
> * Setting hostname to cdimage...            [ok]
> 
> :command not found
> ...

 

And so on.

The line 10 in /etc/init.d/modules is the closing bracket in:

depend{

     need checkroot hostname

     use isapnp

}

The line 246 in /sbin/rc this line in start_critical_service():

source "/etc/init.d/${X}" || error "

I logged in as root, hoping that something might just happen to work.  But no.  I could log in as root alright, but the ethernet wasn't detected, and couldn't insmod it (the machine in particular uses the intel gigabit e1000 driver).  Which autodetects using a normal livecd from gentoo.  I tried editing the gentoo-basic CD with just adding the partimage binary, but have had no luck there.

Bleh.  Any ideas, anyone?

----------

## rensi

always when I'm trying to execute the script as su I get this error message:

 *Quote:*   

> bash-2.05b# livecd-ng gentoo-basic build
> 
> Using current working directory as LIVECD_ROOT.
> 
> >>> Extracting stage tarball...
> ...

 

for non-german-speaking: "Keine Berechtigung" means "Permission denied"    :Smile: 

any hints?

thanks

Reini

----------

## [ToXiC]

When useing livecd-ng I get the error "mount: mount point /opt/tmp/gentoo-basic/cdroot/usr/portage does not exist" after giving the command "livecd-ng gentoo-basic build." I did a fetch and it worked fine, I dont know why I am getting this error. Can anyone assist me in this?

----------

## Chadduss

 *[ToXiC] wrote:*   

> When useing livecd-ng I get the error "mount: mount point /opt/tmp/gentoo-basic/cdroot/usr/portage does not exist" after giving the command "livecd-ng gentoo-basic build." I did a fetch and it worked fine, I dont know why I am getting this error. Can anyone assist me in this?

 

I'm getting the same error. Any ideas anyone?

Thanks

----------

## Chadduss

solved! It said that it did not exsist and was overwritten and I knew that there was a point that it would delete the old directory so I literally did this by force. Here are the steps:

Open up two terminals side by side. Have one setup up as livecd-ng gentoo-basic build and the other one as mkdir /opt/tmp/gentoo-basic/cdroot/var/usr/portage. Hit enter telling the one to build and then click on the other terminal hit enter and then ferociously keep hitting up and then enter eventually it will work.

----------

## [ToXiC]

Very primitive but it suppose it worked.

-[ToXiC]

----------

## Chadduss

Hmm now whenever I try to run livecd-ng gentoo-basic initrd I get mount: could not find any device /dev/loop# 

Anybody know what I'm doing wrong?

Thanks

----------

## jehreg

 *Quote:*   

> Hmm now whenever I try to run livecd-ng gentoo-basic initrd I get mount: could not find any device /dev/loop#
> 
> 

 

Yeah, you need to compile the "loop" block device in your kernel....  and when I say "kernel" I mean your main one, not the livecd one.

----------

## ixion

I'm getting this error during the build process -> kernel compile:

```

Root device is (3, 4)

Boot sector 512 bytes.

Setup is 2575 bytes.

System is 3998 kB

System is too big. Try using modules.

make[1]: *** [bzImage] Error 1

make[1]: Leaving directory `/usr/src/linux-2.4.20-gentoo-r7/arch/i386/boot'

make: *** [bzImage] Error 2

chroot_generate: error: Chroot kernel/2nd package build failure

```

I had converted everything to kernel-level and not modules... should somethings be compiled in as modules, or is there a way to allow larger kernels?

EDIT:

I went ahead and put some modules in (instead of compiled in) which solved this problem, but the CD I'm eventually going to make I would like to not have Loadable Module Support enabled. Is there a setting I can change to allow bigger kernels?

----------

## DanBUK

Hi,

Noltha and I have been working on the livecd-ng system.

We have made changes to the system in the following way:

Works with cloop 1.02

Etc files are stored in a subdir on cdrom to allow for faster dev cycle 

when testing etc changes

Added rc option for ease in changing services on livecd

Added all option to run through all the steps needed to make a livecd 

from a profile

Fixed inittab/linuxrc to work with 1.4 stages/current portage tree

Added deps syslinux and busybox

wget'ing cloop srcs

The ebuild and tar of livecd-ng are located:

(EDIT)New link: http://livecd.lockedbox.net/ (/EDIT)

(EDIT)Also some small install instructions for newer version: http://livecd.lockedbox.net/install.html (/EDIT)

In order to use this youll need to grab the ebuild and run:

emerge -f livecd-ng-1.1.ebuild

ebuild livecd-ng-1.1.ebuild digest

ACCEPT_KEYWORDS="~x86" emerge livecd-ng-1.1.ebuild

then you will need to edit /root/.livecd-ng

And add the following:

CD_DISTDIR=/usr/portage/distfiles

CD_PORTDIR=/usr/portage

CD_TEMPROOT=/home/home20/livecd/tmp

CD_STAGELOC=/home/home20/livecd/download

Obviously choose a partition for the TEMPROOT and STAGELOC that have 

enough space free. For the minimal profile, this will be about 1.5Gb

Once you have done this you should be able as root to run:

Either

A - To generate an ISO in one step

cd /etc/livecd-ng

livecd-ng minimal all 

B - To generate an ISO in multiple steps

cd /etc/livecd-ng

livecd-ng minimal fetch

livecd-ng minimal build

livecd-ng minimal enter - Used to make changes to the livecd system

livecd-ng minimal initrdbuild

livecd-ng minimal initrd

livecd-ng minimal auxcp

livecd-ng minimal clean - Use with care will make the ISO smaller but 

will make it harder to modifiy the tree and regenerate - This step is 

not required.

livecd-ng minimal cloop

livecd-ng minimal isogen

If anyone has any problems with the above please do contact me or noltha 

and we will do what we can to help.

Kind Regards,

Daniel.Last edited by DanBUK on Sun Nov 09, 2003 7:18 pm; edited 2 times in total

----------

## Chadduss

Finally! I have gotten everything to work and now it boots up. But I get the same errors as woffer and xanthum

 *woffer wrote:*   

> Woho, my livecd work now!
> 
> but I get the same errors as xanthumn, and an extra error before that...
> 
> something about /dev/tty0 not being found while setting keymap.

 

 *xanthum wrote:*   

> woffer: no problem, I had to scan the post several times before I saw that.  
> 
> I can report near total success with building a bootable livecd  
> 
> I only have some /etc/runlevels/boot/* error messages saying that checkfs, localmount, clock, and bootmisc could not be started. 
> ...

 

Anyone found a resolution?

Thanks!

----------

## DanBUK

the /dev/tty0 you can fix by turning off devfs automount in the kernel

and the rc errors, if you get the aux-files from within my previous post it should be fixed EDIT(I mean from within the tbz2 i have posted)

Cheers Daniel.Last edited by DanBUK on Sun Nov 09, 2003 7:18 pm; edited 1 time in total

----------

## Chadduss

Thanks for the quick reply.

By turning off automounting devfs at boot that doesnt sacrifice any device detection does it?

And for some strange reason when I click on the link to the tbz2 it just displays random characters, when I choose to save link as it's a txt file.

Thanks again!

----------

## DanBUK

the devfs thing, there is a devfs init script and config file, that handle most settings. Default is normally fine

as for the file, try wget'ting it. if its still doing that maybe i need to add a mime type to my apache.... (EDIT) I think Ive fixed the mime issue in apache...Hope so..(/EDIT)Last edited by DanBUK on Sun Nov 09, 2003 7:19 pm; edited 2 times in total

----------

## Chadduss

wget worked (why didn't I think of that?) thanks for the help

----------

## Chadduss

So I decided to give Danbuk's "improved" livecd-ng a try and may I say wow! I didn't run into any trouble at all! It spits out a perfect live-cd!

Thanks to Danbuk and Noltha for a top notch product!

----------

## DanBUK

Thanks Chadduss,

You've made my friday. 

Quick replys - Well i aint slept, but thats my fault.... (07:20am at the moment....)

Its been quite fun working on it. At the moment I am working on getting multi kernels into the script. Auto hardware config noltha is working on. And FB/blootspash support. 

So soon it will be kinda finished.

If anyone has any suggestions, fire away?

Cheers,

Daniel.Last edited by DanBUK on Sun Nov 09, 2003 7:22 pm; edited 1 time in total

----------

## Chadduss

I have one question though. When the CD boots up it comes to that screen "telling you hit F2 for verbose or hit enter" etc. Where is that image kept in the cdroot?

Thanks again!

----------

## DanBUK

The image is at the moment stored the the /etc/livecd-ng/profiles/global/gentoo.lss

in the next verison i will be making it profile independent.

Cheers,

DanB.Last edited by DanBUK on Sun Nov 09, 2003 7:23 pm; edited 1 time in total

----------

## Chadduss

hmm, tried opening it with gimp. Didn't work. Know of anyway that I can edit it?

Thanks

----------

## DanBUK

### Howto make .lss files for screen at boot prompt

Please be aware that the final splash image will be 640 pixels wide

with 4bpp color depth (16 colors)

The vertical dimension should be definitely less then 480 pixels and 

please be aware that you need some space below your image on the splash 

screen for your welcome text - at least one line for the boot prompt. 

So we have a .gif with an optimized palette reduced to 16 colors. Next, 

we need to convert it to .lss, with an intermediate step via .ppm.

The first step is easy:

giftoppm image.gif >image.ppm

./ppmtolss16 '#c0cfc0=7' <image.ppm >image.lss

More detail goto:

http://sweb.cz/Frantisek.Rysanek/splash/isolinux-splash-HOWTO.html

Cheers Dan.

EDIT:

Umm i didnt read properly first time... edit ... right.

lss16toppm < gentoo.lss >gentoo.ppm

ppmtogif gentoo.ppm > gentoo.gif

But i guess you worked that out   :Rolling Eyes: Last edited by DanBUK on Sun Nov 09, 2003 7:23 pm; edited 1 time in total

----------

## Chadduss

Hey, thanks a lot! This is going to make my project all so much easier!

----------

## DanBUK

The current state of the code that i am working on at the moment, has multiple initrd/kernels generated from some more settings in the profile and another kernel config.

Ill test it a little more, then ill post it.

And if anyone could let me know how they get on, I'd be glad.

Cheers,

Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:24 pm; edited 1 time in total

----------

## Zenshi

Hello all,

Im using DanBUK livecd-ng-1.1 to create the LiveUSB image and i stumbled into a problem:

```

Using current working directory as LIVECD_ROOT.

6000+0 records in

6000+0 records out

Error: usbcore.o not found; skipping...

Error: dc395x_trm.o not found; skipping...

```

What i done wrong for the usbcore.o file don't get found? (I don't use dc396x_trm.o so, i don't bother with it)

[edit]

Been testing a bit with it and now i have been having this problem on the livecd-ng minimal build:

```

make: *** No rule to make target `oldconfig'.  Stop.

chroot_generate: error: Chroot kernel/2nd package build failure

```

I used a stage2 tarball to create the build, any hints on what's wrong?

Also, on the 1st case that i posted, i got a livecd.iso of 212Mb, is this normal?

i wanna make a livecd for installing from USB, and i don't wanna buy a 256Mb dongle, they are still too expensive  :Smile: 

[/edit]

Thanks in advance

----------

## Chadduss

to get usb core to work open up the kernel config and have it set to m for module. As for the dcmblah It's not in the vanilla sources kernel for some reason and just will not be builf with make modules. As for the stage tarball I'd suggest using a stage 3

----------

## Zenshi

Hello all,

DanBUK, is there any way to have support for 2.4.6 kernels?

My mobo as a 3Com 940 chipset and i need to create my LiveCD with 2.4.6 kernel in order to have the network card working...

Thanks in advance

----------

## DanBUK

Yes, thats easy... In the profiles folder for each profiele there is a stage1-packages and stage2, the stage1 contains the kernel that is emerged into the system. Or if you allready have a chroot, you can "enter" the chroot , run make menuconfig then exit the chroot and cp the .config from inside the chroots /usr/src/linux and place it in the profile, change the settigns to point to that kernel file and run kernbuild.

I hope that makes sense.

Cheers,

Dan.

 :Razz: Last edited by DanBUK on Sun Nov 09, 2003 7:24 pm; edited 1 time in total

----------

## Zenshi

Hello all,

DanBUK, the problem i was facing was that if i used a 2.6.0 kernel , the compressed_loop.c won't complie straight, that makes any sense to you?

Also, what are the minimal packages to use in stage1 and stage2 to have the smallest possible livecd.cloop file (I dunno why, but the smallest one that i could produce was 123Mb, not goog to fit in my 64MB USB dongle)

----------

## DanBUK

 *Zenshi wrote:*   

> DanBUK, the problem i was facing was that if i used a 2.6.0 kernel , the compressed_loop.c won't complie straight, that makes any sense to you?

 

Yeh that makes perfect sense I should have removed it from the settings before I packaged up, I hand not managed to get it to compile either. 

 *Zenshi wrote:*   

> Also, what are the minimal packages to use in stage1 and stage2 to have the smallest possible livecd.cloop file (I dunno why, but the smallest one that i could produce was 123Mb, not goog to fit in my 64MB USB dongle)

 

At the moment the minimal packages are quite bulky for isdn, asdl, lots etc 

I am today working on a clean list to add into the next version. In the version  you are using you can look at the ./profiles/global/clean file. I have commented a lot out but that will make your cd a lot smaller. Use it with livecd-ng <profile> clean

Hope that makes sense,

cheers,

Dan.Last edited by DanBUK on Sun Nov 09, 2003 7:25 pm; edited 1 time in total

----------

## Zenshi

Hello DanBUK,

      When will you release a version that can use the 2.6.0 kernels?

I really, really need to use 2.6.0 kernel, cause it's the only kernel that has support for my network card...

Thanks in advance

----------

## DanBUK

 *Zenshi wrote:*   

> Hello DanBUK,
> 
>       When will you release a version that can use the 2.6.0 kernels?
> 
> I really, really need to use 2.6.0 kernel, cause it's the only kernel that has support for my network card...
> ...

 

Hi, Umm, I will try out some different cloop versions but i think there are major differences in the way the kernel talks with 2.6 than 2.4, than does not mean that cramfs couldn't be considered, not sure on the compression of it but its somthing to consider. So until cloop gets upto speed with 2.6 there will be problems.Last edited by DanBUK on Sun Nov 09, 2003 7:25 pm; edited 1 time in total

----------

## ixion

now when I boot off of a new CD I'm getting these errors. Now, this is not from the default, but after using gentoo-sources and tweaking a few things..

```

---- Mounting the CD

---- CD medium found on /newroot/dev/cdroms/cdrom0

---- Mounting compressed loopback filesystem

Using /modules/cloop.o

insmod: unresolved symbol zlib_inflate_workspacesize_Rce5ac24f

insmod: unresolved symbol zlib_inflateEnd_R9ef45f92

insmod: unresolved symbol zlib_inflate_R64cf8602

insmod: unresolved symbol zlib_inflateInit_R456e911d

insmod: unresolved symbol zlib_inflateReset_Ref76d642

mount: Mounting /dev/cloop on /newroot/mnt/cloop failed: No such device or address

---- Copying and symlinking files from CD to populate /

mkdir: Cannot create directory 'lib': File exists

cp: root: No such file or directory

cp: home: No such file or directory

cp: var: No such file or directory

ln: ./var/log: No such file or directory

---- Switching to tmpfs root filesystem

exec: chroot: No such file or directory

Kernel panic: Attempted to kill init!

```

I also have a couple questions. Would I be able to have the keymap select eliminated. I would like the CD to boot to a linux system without any interaction. Is this possible? Secondly, can I have custom scripts run on bootup?

----------

## DanBUK

 *ixion wrote:*   

> 
> 
> Using /modules/cloop.o
> 
> insmod: unresolved symbol zlib_inflate_workspacesize_Rce5ac24f
> ...

 It looks like youve changed kernels but havent rerun all the initrd steps, or if your new kernel doesnt have zlib compiled inside(you need to disable encryption i think for that) it will break also.

 *ixion wrote:*   

> 
> 
> I also have a couple questions. Would I be able to have the keymap select eliminated. I would like the CD to boot to a linux system without any interaction. Is this possible? Secondly, can I have custom scripts run on bootup?

 

Yep, if you take a look at the global/linuxrc you will see a section for the keymaps, and for the scsi, about 2/3 down. comment out the keymaps, and scsi if you want. Then whist "enter" the chroot, edit the /etc/rc.conf for the correct keymap, run rc-update add keymaps default , and any others you might want. You can also edit the /etc/conf.d/local.start and .stop for extra commands at boot/shutdown.

Cheers,

Daniel.Last edited by DanBUK on Sun Nov 09, 2003 7:26 pm; edited 1 time in total

----------

## [ToXiC]

I am interested in trying to get a LiveCD with the 2.6 kernel... Does anyone or has anyone been able to do this. Where where any errors while useing "livecd-ng"?

-[ToXiC]

----------

## DanBUK

Hi All,

I have just released a newer version of the livecd script, as i has undergone so many changes i have also renamed/forked it. fb-livecd .

More details: https://forums.gentoo.org/viewtopic.php?p=591401

Cheers,

Daniel.Last edited by DanBUK on Sun Nov 09, 2003 7:26 pm; edited 1 time in total

----------

## Fraggle

I am getting the following error...Any ideas what I did wrong?

```

EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=96865, block=98115

Warning: unable to open an initial console.

EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=16145, block=16355

Kernel panic: No init found. Try passing init= option to kernel.

```

It is driving me nuts!

----------

## Aproxx

Hello!

I had aborted the livecd-ng fetch because it stopped to download. But when I try to restart it, there comes the message: Using working directory as LIVECD_ROOT.

What could I do?

----------

## Fraggle

 *Aproxx wrote:*   

> Hello!
> 
> I had aborted the livecd-ng fetch because it stopped to download. But when I try to restart it, there comes the message: Using working directory as LIVECD_ROOT.
> 
> What could I do?

 

Just remove the partial download.

----------

## Aproxx

oh, thx!

----------

## laffel

Since several days I'm trying to bring the livecd up and running. 

With the new 1.1 livecd-ng I was able to create the iso image but now I've got always an error when booting it.

```
 

* Checking root filesystem...                  [ok]

* Remounting root filesystem read/write...

* Root filesystem could not be mounted R/W :(    [!!]

```

Where is the worm?

----------

## DanBUK

 *laffel wrote:*   

> Since several days I'm trying to bring the livecd up and running. 
> 
> With the new 1.1 livecd-ng I was able to create the iso image but now I've got always an error when booting it.
> 
> ```
> ...

 

Umm Im not sure, could you try out the 1.2 version: http://livecd.lockedbox.net/

There were lots of changes between 1.1 and 1.2

Regards,

Daniel.

EDIT - It kinda looks like your using an earlier version of the chkroot script.

----------

## laffel

Hi Daniel

I tried the new version yesterday but it took the hole night to finish so I will see the result when I'm back at home.

Edit:

Again, it took some hours to complete but now I can boot the cd without any problems. Dan, thanks a lot for your great work!

----------

## Noltha

hi laffel.

Dan and i are working at this moment on custom stage3 tarballs, in order to speed up the livecd generation process.

At the moment, we have thought about building 3 stage3 tarballs:

1) basic (non-gui) stage3 tarball, its just an up to date official stage3 tarball, including some apps needed for the liveCD, listed in /etc/fb-livecd/profiles/{profile}/stage?-* files.

2) qt/kde-gui stage3 tarball: basic stage3 tarball, a complete kde desktop environment and fluxbox desktop environment.

3) gtk+/gnome-gui stage3 tarball, basic stage3 tarball, a complete gnome desktop environment and fluxbox desktop environment.

Not to compile Xfree86, kde, or gnome, will shorten the livecd generation process a lot.

Soon those stage3 tarballs will be available to download from fb-livecd site.

Suggestions?  :Idea: 

greetings.  :Wink: 

----------

## laffel

Hi Noltha,

Sorry I forgot to thank you too. I really appreciate the work of you and Dan  :Very Happy: 

From my point of view I would love to have a gentooished livecd with X and Fluxbox on the top    :Smile: 

I will give a try to the new scripts and install them as soon as my new box is up and running with the help of the cd. It should do the building process in less than 8 hours

----------

## rodrigrj

ok, so as far as the 2.6 kernels  go... you could probably do it if you found some alternative to cloop, thats the only way, ive checked and the cloop modules wont compile against a 2.6... at least not yet... and probably not a while after release

but i have my own problem... i didnt bother messing around w/ livecd-ng, but maybe some people would know whats up... 

im working on a livecd... and it needs to be pretty big, so i made a folder.. started from stage1, and just emerged what i needed.  then i used dd to make a block, formatted ext2 and ext3 (since one didnt work, i though id try the other)

then i ran create_compressed_fs moved it to the iso folder, ran mkisofs w/ all the fun voodoo type options, and am using vmware to test it out...

so anyway, the problem im having is that the cloop file doesnt get mounted... and it took me forever to realize that was my problem because there was absolutely no error output.... the effect it has is that it hangs on when trying to mount proc... 

any ideas??

(if you need more info, let me know)

btw... im using everything else from the gentoo cd... kernels, initrd, modules, etc.

----------

## DanBUK

I would bother messing around with:

http://livecd.lockedbox.net/

You will find it sooo easy to make your own livecd from scratch.

The problem is probably in the linuxrc inside the initrd that your booting, it will be mounting a .cloop file of a cirtain name. Not sure what that will be.

----------

## preacherx

As of the current stage3 tarball for x86 on 11/18/2003  the directory /usr/portage is not included in the tarball.   This is required for app-admin/livecd-ng ver. 1.0  to function.   

I wrote a small code snip to correct for this that verifies if /usr/portage exists in the extracted tarball and makes it if it does not.  This is apposed to simply dying like the script currently does for me.  

You can either download the edited livecd-ng script from:

http://www.e-lsd.com/downloads/livecd-ng.e-lsd

Or insert the following code: 

```
# The newest stage tarballs do not include /usr/portage and so this

# process dies. The following lines are to correct for this.  

# 11/18/2003 ELSDWebmaster - webmaster@e-lsd.com

if [ ! -e "$CD_BUILDCHROOT/usr/portage" ]

then

        mkdir $CD_BUILDCHROOT/usr/portage

fi

# end code edit

```

Between these two lines in the current /usr/sbin/livecd-ng:

```
mount -o bind /proc $CD_BUILDCHROOT/proc || chroot_die

mount -o bind $CD_PORTDIR $CD_BUILDCHROOT/usr/portage || chroot_die

```

----------

## DanBUK

Hi All,

 *Zenshi wrote:*   

> DanBUK, the problem i was facing was that if i used a 2.6.0 kernel , the compressed_loop.c won't complie straight, that makes any sense to you?
> 
> 

 

I dont know why I didnt think of this before, just place loop in your /usr/sbin/fb-livecd or /usr/sbin/livecd-ng. This wont compress, so you will be limited on the loop size. Size of CD minus a bit.

eg:

```

line 287: LOOP_MODE=cloop

change to:

line 287: LOOP_MODE=loop

```

I am still looking at variations on the cloop idea for 2.6 kernels...

Regards,

Daniel.

----------

## TwoSlick

DanBUK,

I'm trying to use your latest script, but it tries to download the older stage3 tarball.  I edited the settings file in the i386 profile, and changed it to the November version stage3.  It now downloads fine, but after unpacking, the script gives this error:

```
Using /etc/fb-livecd as LIVECD_ROOT.

>>> Extracting stage tarball...

mount: can't find /home/livecd/tmp/i386/cdroot/home/distfiles in /etc/fstab or /etc/mtab

chroot_generate: aborting.
```

Any Ideas?

- Tim

----------

## DanBUK

 *TwoSlick wrote:*   

> DanBUK,
> 
> I'm trying to use your latest script, but it tries to download the older stage3 tarball.  I edited the settings file in the i386 profile, and changed it to the November version stage3.  It now downloads fine, but after unpacking, the script gives this error:
> 
> ```
> ...

 

Have you got somthing similar to:

```

CD_DISTDIR=/usr/portage/distfiles

CD_PORTDIR=/usr/portage

CD_TEMPROOT=/home/home20/livecd/tmp

CD_STAGELOC=/home/home20/livecd/download

```

in your /root/.fb-livecd

Cheers,

Daniel.

----------

## TwoSlick

 *Quote:*   

> Have you got somthing similar to: 
> 
> Code:
> 
> CD_DISTDIR=/usr/portage/distfiles 
> ...

 

It appears I was missing the first line.  For some reason, I swear I put that one in. Oh well.  :Smile: 

Thanks for the help!

- Tim

----------

## crazedmodder

During:

```
# livecd-ng gentoo-basic initrd
```

I get these errors:

```
root@orangedeamon livecd-ng # livecd-ng gentoo-basic initrd

Using current working directory as LIVECD_ROOT.

>>> Regenerating /etc/ld.so.cache...

 * Caching service dependencies...

awk: cmd. line:2: fatal: cannot open file `/etc/fstab' for reading (No such file or directory)                         [ ok ]

>>> Executing tar xzf cloop_0.68-5.tar.gz...

```

```
cc -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer -mpreferred-stack-boundary=2 -march=i386 -DNO_MEMCPY   -c -o uncompr.o uncompr.c

cc -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer -mpreferred-stack-boundary=2 -march=i386 -DNO_MEMCPY   -c -o deflate.o deflate.c

deflate.c: In function `deflateCopy':

deflate.c:639: warning: passing arg 1 of `zmemcpy' from incompatible pointer type

deflate.c:639: warning: passing arg 2 of `zmemcpy' from incompatible pointer type

deflate.c:640: warning: passing arg 1 of `zmemcpy' from incompatible pointer type

deflate.c:640: warning: passing arg 2 of `zmemcpy' from incompatible pointer type

cc -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer -mpreferred-stack-boundary=2 -march=i386 -DNO_MEMCPY   -c -o trees.o trees.c

cc -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer -mpreferred-stack-boundary=2 -march=i386 -DNO_MEMCPY   -c -o zutil.o zutil.c

```

```
>>> Executing tar xzf busybox-0.60.3.tar.gz...

>>> Executing make clean...

>>> Executing make DOSTATIC=true...

3000+0 records in

3000+0 records out

/home/rootcd/gentoo-basic/initrd: Cannot create filesystem with requested number of inodes while setting up superblock

mount: wrong fs type, bad option, bad superblock on /dev/loop0,

       or too many mounted file systems

       (could this be the IDE device where you in fact use

       ide-scsi so that sr0 or sda or so is needed?)

Error: dc395x_trm.o not found; skipping...

umount: /home/rootcd/gentoo-basic/cdroot-initrd: not mounted

```

My settings file:

```
root@orangedeamon livecd-ng # cat profiles/gentoo-basic/settings

source ${LIVECD_ROOT}/profiles/global/settings

CD_BUILDROOT=${CD_TEMPROOT}/${CD_PROFILE}

CD_PORTAGE_PROFILE="default-x86-1.4"

CD_USE="xfs acpi4linux crypt ipv6 -slang -X -gtk -arts -svga -directfb -ggi -esd -nas -perl -python"

CD_CFLAGS="-Os -mcpu=i686 -fomit-frame-pointer -ffast-math -pipe"

CD_CXXFLAGS="${CD_CFLAGS}"

#CD_STAGETARBALL=http://www.ibiblio.org/gentoo/releases/1.4_rc1/x86/stage3-i586-1.4_rc1.tar.bz2

CD_STAGETARBALL=ftp://ibiblio.org/pub/Linux/distributions/gentoo/releases/x86/1.4/stages/x86/stage3-x86-20030910.tar.bz2

#modules to auto-detect/copy to the initrd (put in the "/modules/storage" directory)

#aic7xxx_old removed from position after aic7xxx in attempt to fix bugs #12185 and #11278

STORAGE_MODULES="aic79xx aic7xxx BusLogic ncr53c8xx \

NCR53c406a initio advansys aha1740 aha1542 aha152x \

atp870u dtc eata fdomain gdth megaraid pas16 pci2220i \

pci2000 psi240i qlogicfas qlogicfc qlogicisp seagate \

t128 tmscsim u14-34f ultrastor wd7000 dc395x_trm"

LOOP_SIZE="800000"

KERNCONFIG=kernel-config-2.4.20_pre4

```

(I just added a zero in there randomly after reading that 80000 is too small)

My Livecd-ng script:

```
initrd_create() {

        install -d ${CD_BUILDCHROOT}-initrd

        dd if=/dev/zero of=${CD_BUILDROOT}/initrd bs=1k count=3000

        mke2fs -F -q -N30000 ${CD_BUILDROOT}/initrd

        mount -t ext2 -o loop ${CD_BUILDROOT}/initrd ${CD_BUILDCHROOT}-initrd

        #makeinitrd

        if [ ! -e ${CD_BUILDCHROOT}-initrd/bin ]

        then

```

(Again having just added a zero).

stage1-packages

```
root@orangedeamon livecd-ng # cat /etc/livecd-ng/profiles/gentoo-basic/stage1-packages

metalog

ncftp

dialog

lilo

grub

nvi

parted

app-arch/mt-st

sys-apps/star

dev-util/strace

sys-apps/pciutils

net-dialup/wvdial

net-www/lynx

sys-apps/raidtools

sys-apps/e2fsprogs

sys-apps/reiserfs-utils

sys-apps/hdparm

app-editors/nano

sys-apps/less

net-misc/openssh

net-misc/dhcpcd

sys-apps/lvm-user

net-fs/nfs-utils

net-irc/irssi

jfsutils

speedtouch

gpm

dosfstools

mingetty

pwgen

ucl

sys-kernel/vanilla-sources

sys-apps/partimage

x11-base/xfree

x11-base/xfree-drm

x11-misc/xscreensaver

gnome-base/gnome/gnome-2.4

net-www/opera

media-sound/alsa-driver

media-sound/alsa-utils

media-sound/alsa-tools

net-im/amsn

app-text/xpdf

dev-java/blackdown-jdk

x11-misc/numlockx

net-im/gaim

x11-wm/fluxbox

x11-misc/imwheel

app-office/openoffice

media-gfx/gimp

media-sound/amp

media-sound/xmms

media-video/mplayer

media-video/gxine

net-fs/samba

net-print/cups

app-text/psutils

app-text/ghostscript

net-print/hpijs

net-print/gnome-cups-manager

```

(gnome and alsa-driver didn't work so you can ignore those, it couldn't find gnome the first time and I spelled alsa-drivers wrong  :Sad: )

df -h:

```
/dev/hda5             9.4G  3.6G  5.8G  38% /home
```

Can anyone help me figure out why I keep getting errors about not enough space?  Did I put too many programs?

----------

## bdraw

I get the same error and I don't have all those packages added.

awk: cmd. line:2: fatal: cannot open file `/etc/fstab' for reading (No such file or directory)

----------

## cdunham

This has been asked before but not answered. Did the people experiencing this find a solution?

When booting off a LiveCD built using these instructions, I get this (transcribed by hand, so forgive me if it's incomplete):

```
EXT2-fs error (device ramdisk(1,0)): ext2_read_inode: unable to read inode block - inode=5008, block=8197

Warning: unable to open an initial console.
```

The EXT error repeats with inode 5001, same block, followed by:

```
Kernel panic: No init found.  Try passing init= option to kernel.
```

Any ideas? I can mount the initrd, and it looks fine (although there is no init in it, should there be? /sbin is a soft link to /bin).

BTW, I get the same error booting from the USB stick as booting from a CD made from the iso.

Here is my settings file:

```
source ${LIVECD_ROOT}/profiles/global/settings

CD_BUILDROOT=${CD_TEMPROOT}/${CD_PROFILE}

CD_PORTAGE_PROFILE="default-x86-1.4"

CD_USE="xfs acpi4linux crypt -ipv6 -slang -X -gtk -arts -svga -directfb -ggi -esd -nas -perl -python"

CD_CFLAGS="-O3 -mcpu=i686 -pipe"

CD_CXXFLAGS="${CD_CFLAGS}"

#CD_STAGETARBALL=http://www.ibiblio.org/gentoo/releases/1.4_rc1/x86/stage3-i586-1.4_rc1.tar.bz2

#CD_STAGETARBALL=http://www.ibiblio.org/gentoo/experimental/x86/stages/stage3-x86-1.4_pre20030110.tar.bz2

#CD_STAGETARBALL=http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/1.4/stages/x86/stage3-x86-20030910.tar.bz2

CD_STAGETARBALL=http://www.gtlib.cc.gatech.edu/pub/gentoo/releases/x86/1.4/stages/x86/stage3-x86-20030910.tar.bz2

#modules to auto-detect/copy to the initrd (put in the "/modules/storage" directory)

#aic7xxx_old removed from position after aic7xxx in attempt to fix bugs #12185 and #11278

# removed modules that are build into kernel: usbcore usb-uhci uhci usb-ohci usb-storage

STORAGE_MODULES="aic79xx aic7xxx BusLogic ncr53c8xx \

NCR53c406a initio advansys aha1740 aha1542 aha152x \

atp870u dtc eata fdomain gdth megaraid pas16 pci2220i \

pci2000 psi240i qlogicfas qlogicfc qlogicisp seagate \

t128 tmscsim u14-34f ultrastor wd7000 dc395x_trm"

LOOP_SIZE="140000"

#KERNCONFIG=kernel-config-2.4.20_pre4-pcmcia

KERNCONFIG=kernel-config-2.4-latest
```

The difference between it and stock:

```
# diff profiles/gentoo-basic/settings.orig profiles/gentoo-basic/settings

4c4

< CD_USE="xfs acpi4linux crypt ipv6 -slang -X -gtk -arts -svga -directfb -ggi -esd -nas -perl -python"

---

> CD_USE="xfs acpi4linux crypt -ipv6 -slang -X -gtk -arts -svga -directfb -ggi -esd -nas -perl -python"

8c8,10

< CD_STAGETARBALL=http://www.ibiblio.org/gentoo/experimental/x86/stages/stage3-x86-1.4_pre20030110.tar.bz2

---

> #CD_STAGETARBALL=http://www.ibiblio.org/gentoo/experimental/x86/stages/stage3-x86-1.4_pre20030110.tar.bz2

> #CD_STAGETARBALL=http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/1.4/stages/x86/stage3-x86-20030910.tar.bz2

> CD_STAGETARBALL=http://www.gtlib.cc.gatech.edu/pub/gentoo/releases/x86/1.4/stages/x86/stage3-x86-20030910.tar.bz2

10a13

> # removed modules that are build into kernel: usbcore usb-uhci uhci usb-ohci usb-storage

16,17c19,21

< LOOP_SIZE="80000"

< KERNCONFIG=kernel-config-2.4.20_pre4-pcmcia

---

> LOOP_SIZE="140000"

> #KERNCONFIG=kernel-config-2.4.20_pre4-pcmcia

> KERNCONFIG=kernel-config-2.4-latest
```

And I'm using N=10000 (and count=10000 in the line above) in initrd_create.

Thanks!

----------

## cdunham

OK, I reduced the initrd size to 5000, which was enough, and it worked. I think the problem was that the kernel config only allowed for an 8M ram disk. Doh!

Now, on to the next problem:

```
insmod: init_module: cloop: invalid argument

mount: Mounting /dev/cloop on /newroot/mnt/cloop failed: No such device or address
```

----------

## cdunham

.. and that one was fixed by reducing the max block size to 65336 as suggested by Filo_kg above.

----------

## vibidoo

I am working onb that Tips since 4 days already and I can not go further than the livecd-ng buld .

I always have this error 

```

>>> Executing tar xzf busybox-0.60.3.tar.gz...

>>> Executing make clean...

>>> Executing make DOSTATIC=true...

3000+0 records in

3000+0 records out

mke2fs 1.29 (24-Sep-2002)

cp: omitting directory `/opt/tmp/gentoo-basic/tmp/busybox-0.60.3'

chroot_generate: aborting.

```

----------

## rory

 *DanBUK wrote:*   

> 
> 
> I had probs when booting my cd, it couldn't mount the cloop filesystem and then cp the var etc home dirs. then Kernel panic. Anyone else had this problem?

 

Yeah.. I had the same problem, after having to:

1) install ccache ebuild

2) install cdrtools ebuild (for mkisofs)

3) modify livecd-ng:

  a) change size of initrd from "3000" to "8000"

     because there wasn't enough space for devices

  b) increase LOOP_SIZE to 300 Mb

     so the cd would also fit all the stage<n> tarballs

I'm mainly trying to create my own LiveCD

cause the gentoo 1.4 LiveCD fails to load the aacraid.o module,

which I need to install gentoo on my SATA drive

plugged into my Adaptec RAID 2410SA controller.

I saw something on the forums about gentoo 2.6 LiveCD working

for a Dell SATA..  should I just use that ?

Thx,

Rory

----------

## tylerdurden237

 *ixion wrote:*   

> now when I boot off of a new CD I'm getting these errors. Now, this is not from the default, but after using gentoo-sources and tweaking a few things..
> 
> ```
> 
> ---- Mounting the CD
> ...

 

ixion, you will need to recompile your kernel with the following...

```
make menuconfig --> Cryptographic Options 

Enable "Cryptographic API" and then enable "Deflate Compression algorithm"... 

make dep && make bzImage ... ... ... 

```

That should resolve the unresolved symbols.

----------

## ixion

I would like to add a custom grub config file (or lilo if need be) so I can have a bootsplash (VGA=xxx). I can't find the config file anywhere in the script. Is there some way to set this?

----------

## Root Moose

Where can I get the latest version of the fb-livecd package? The livecd.lockedbox.net site doesn't seem to exist and portage only has livecd-ng ver 1.0.

Thanks!

----------

## sdodell

Ditto, and where is the latest livecd documentation?

----------

## ahoogerhuis

Meee tooo?  :Smile: 

Seriously, I've just got myself a 512Mb Verbatim Stick so that I could do exactly this and happened upon this thread, and now the tools is either old (portage) or working (who knows where?).

Link to a current site or update to portage would be nice  :Smile: 

----------

## ahoogerhuis

Or if someone is sitting on a fairly up to date versio of it, and th ebuild, can someone post a link so we can go over it at try to get it maintained? I believe it is GPL from what I've seen, so it wouldn't be a bad thing to do.

----------

## ixion

man, I just looked on my laptop and don't have the tarball or portage overlay.. this is scarry.. if that HDD fails I'm in some trouble... any chance anyone could get the livecd-ng 1.x setups as well?   :Shocked: 

----------

## pevnas

Hi to All,

I have created livecd according this nice howto, but my my cd doesn't boot properly. When the init had start, it immediatly stop with the message, that proc is not mounted. So I mount the proc  

manually with "mount proc". Then the rest of init job is done properly. Could anyone help me. 

Thanks,

I am confused

----------

## geforce

Hi,

I recently downloaded the Gentoo-Games CD-- America Army.  I saw than while booting it was probing all my devices and load the properly drivers then finaly start fluxbox, like PCLINUX or Knoppix.

I have a portable HD (a CASTEL Rack that you can see HERE)

I want to make a kind of LiveCd GEntoo, but like the knoppix one, with KDE, and packages: fully fonctionnal.

here is the project:

I bring my HD at my friend's computer..

We boot the computer on the HD (IDE not USB)

It's magic, Gentoo as configured everything and loaded the proper drivers, then load KDE or Gnome or whatever...

Is it possible with this HowTo ?

Thanks !

GeForce

----------

## DremK

I'm impressed when I see the use of free software to reduce the users freedom.

#gentoo channel is the only one that forces tor users to need request voice, and isn't possible post a message and these forums. Simply because people were using Tor to abuse the forums.Last edited by DremK on Thu Dec 01, 2005 11:28 pm; edited 1 time in total

----------

## n4than

 *Donut wrote:*   

> Build your own Gentoo install / boot / rescue LiveCD and USBStick
> 
> I've written this how-to after trying to find a boot medium for my home gateway machine which could be used for system rescues and even installing Gentoo. Why not use the standard Gentoo Live CD you ask? Well my gateway machine is one of those small, silent and cool running mini-itx machines (http://www.mini-itx.com) and has no CDROM or floppy drive. I needed some way of getting Gentoo on there and some way of easily rescuing it when the need arises. The good news is that these VIA mini-tix machines are USB bootable and I much preferred the idea of having a little USB drive/stick that I could push into any USB bootable machine and boot into Linux rather than having to set up a PXE networked boot environment (which is also supported).
> 
> 

 

I'm interesting in mini-itx solution, specially in Flash Card solution.

Have you installed gentoo without any problems?

Can you give some tips about it and about compatibility of mini-itx and gentoo.

Thx mait  :Very Happy: 

----------

## jkcunningham

 *zephyr1256 wrote:*   

> Is it possible to create a traditional linux filesystem(ext2) install a kernel and root filesystem uncompressed, and have it be bootable(with the mini-itx boards)?  I made an ext2 filesystem on a 32 MB Pen Drive that I got today, assuming I would be able to create a bootable kernel and filesystem like you can on a hard drive.  And I have a mini-itx system coming next week.  Right now with no hard drive floppy or CD, I was planning on building a small linux system on the Pen Drive, and have that be the system for now.  Or do you have to use vfat?

 

The answer is 'yes'. Check out this howto:

http://gentoo-wiki.com/HOWTO_Small_Footprint_Gentoo_on_USB

I was also trying to get this to work on a compact flash chip plugged into a usb-flash reader, but haven't been able to get it to recognize it as a bootable device yet. I'm still working on it. If anyone has any advice - I'm all ears. 

-Jeff

----------

## Tiro

hi to all!  :Smile: 

am trying to complete my personal live usbstick but I encontered a problem that I can't fix...

I followed all the instrutions of the howto but when merging partimage i get this error:

Emerging sys-apps/partimage...

cp: impossible to create the normal file `/opt/tmp/gentoo-basic/cdroot/usr/src/linux/.config': No such file or directory

chroot_generate: aborting.

# ls /opt/tmp/gentoo-basic/cdroot/usr/src/linux

lrwxr-xr-x  1 root root 31  6 ago 23:08 /opt/tmp/gentoo-basic/cdroot/usr/src/linux -> /usr/src/linux-2.4.26-gentoo-r7

# ls /opt/tmp/gentoo-basic/cdroot/usr/src/linux/

ls: /opt/tmp/gentoo-basic/cdroot/usr/src/linux/: No such file or directory

think the problem is the symbolic link but when i fix it can't resume the merging...is possible to resume it..? 

thanks!  :Wink: 

----------

## Tiro

no one..!?   :Sad: 

----------

## Bigun

Gnarly.... marked.. and filed

----------

## axa

Hello here:

i builded my own liveCD base on gentoo1.4 refer to Donut's post.

But i got error when i using my liveCD to boot my server , error message as following:

Using /modles/cloop.o

Switching to tmpfs root filesystem

Copying and symlinking files from CD to populate /

After appear above message , the system hang and stop boot procedure...

its seems can not load initrd process instantly.....but i dont have any idea to  solve this problem....

ANY IDEA???

----------

## Dana Merrick

 *Tiro wrote:*   

> Emerging sys-apps/partimage...
> 
> cp: impossible to create the normal file `/opt/tmp/gentoo-basic/cdroot/usr/src/linux/.config': No such file or directory
> 
> chroot_generate: aborting.

 

First of all, I had this problem too and I fixed it by adding this to the end of my /usr/sbin/live-ng file:

```
# Added to attempt to fix .config problem

[ ! -e ${CD_BUILDCHROOT}/usr/src/linux ] && install -d ${CD_BUILDCHROOT}/usr/src/linux
```

But, secondly, now I'm having my own troubles.

I keep getting this error:

```
make: *** No rule to make target `oldconfig'.  Stop.

chroot_generate: error: Chroot kernel/2nd package build failure

```

After it emerges gentoo-sources. At first it was complaining about fstab being missing but I manages to silence that with a "cp fstab.bak fstab" in the middle of the emerging process (not very elegant, but it worked). But now I'm getting that error, and I don't even know where to begin on fixing that. Any ideas?

----------

## Rooney

 *aragostaragazzo wrote:*   

>  *Tiro wrote:*   Emerging sys-apps/partimage...
> 
> cp: impossible to create the normal file `/opt/tmp/gentoo-basic/cdroot/usr/src/linux/.config': No such file or directory
> 
> chroot_generate: aborting. 
> ...

 

Hi there can i see a fully copy of you livecd-ng file as im still getting this problem and unsre if i have put the extra scripting in the right place.

[/code]

>>> Emerging sys-apps/partimage...

cp: cannot create regular file `/opt/tmp/gentoo-basic/cdroot/usr/src/linux/.config': No such file or directory

chroot_generate: aborting.

[/code]

----------

## Dana Merrick

 *Rooney wrote:*   

> can i see a fully copy of you livecd-ng file as im still getting this problem and unsre if i have put the extra scripting in the right place.

 

Sure, no problem, cept I'll only do the mount_all() function:

```
mount_all() {

        mount -o bind /dev $CD_BUILDCHROOT/dev || chroot_die

        mount -o bind /proc $CD_BUILDCHROOT/proc || chroot_die

        # added this to fix portage problem in new stage3 tarball

        [ ! -e ${CD_BUILDCHROOT}/usr/portage ] && install -d ${CD_BUILDCHROOT}/usr/portage

        mount -o bind $CD_PORTDIR $CD_BUILDCHROOT/usr/portage || chroot_die

        [ ! -e $CD_BUILDCHROOT/tmp/livecd ] && install -d $CD_BUILDCHROOT/tmp/livecd

        mount -o bind $CD_BUILDTEMP $CD_BUILDCHROOT/tmp/livecd || chroot_die

        mount -o bind ${CCACHEDIR} ${CD_BUILDCHROOT}/${CCACHEDIR} || chroot_die

        mount -o bind $CD_DISTDIR $CD_BUILDCHROOT/home/distfiles || chroot_die

        # added to attempt to fix .config problem

        [ ! -e ${CD_BUILDCHROOT}/usr/src/linux ] && install -d ${CD_BUILDCHROOT}/usr/src/linux

}
```

----------

## Rooney

thanks ill try it right now

----------

## hd.brummy

Hi Folks,

i get an error by the 

'livecd-ng gentoo-basic build'  Step

```

Calculating dependecies

emerge: therw are no masked or unmasked ebuilds to satisfy "sys-apps/star"

!!! Error ...... Please correkt.

 
```

Maybe correktly the ebuild must named "sys-apps/stat" 

Where or how can i fixed ?

THX Joerg

----------

## hd.brummy

Hi, 

Problem solved

I found some stupid things in any files:

U have to change following lines

in stage1-packages:

sys-apps/star => sys-apps/stat

sys-apps/raidtools  => sys-fs/raidtools

sys-apps/e2fsprogs => sys-fs/e2fsprogs

sys-apps/reiserfs-utils => sys-fs/reiserfsprogs

sys-apps/lvm-user => sys-fs/lvm-user

in stage2-packages:

sys-apps/iproute => sys-apps/iproute2

Error comes from any changes in the portage tree.

C YA

----------

## doom4

 *aragostaragazzo wrote:*   

> 
> 
> ```
> make: *** No rule to make target `oldconfig'.  Stop.
> 
> ...

 

i have the same problem. really nobody has an answer????

thx for help

----------

## knopper

In case you're looking for a Gentoo based distribution on an usb stick, you could try this: http://knopperdisk.knopper.tk

In case you think I'm promoting this, please delete it, you won't offend me. I just could use some people who test it and/or give some feedback/suggestions.

----------

## Dana Merrick

 *knopper wrote:*   

> In case you're looking for a Gentoo based distribution on an usb stick, you could try this: http://knopperdisk.knopper.tk
> 
> In case you think I'm promoting this, please delete it, you won't offend me. I just could use some people who test it and/or give some feedback/suggestions.

 

This is helpful and I got it running very easily, though it's not what I want in a USB-bootable Gentoo installation.

I want it to be bootable without needing a boot floppy to help it out, and I want it to have portage, which is not included in your version.

A USB livecd is such a great idea because a flash drive is a rewritable media, so I could keep my USB stick up to date and install and remove the programs I needed for a certain situation quickly and easily, though a portage-enabled, self-bootable, USB livecd has been very hard to create.

----------

## knopper

Thanks for trying it! About portage, why don't you execute this:

```

du -h /usr/portage

```

And then reconsider what you just said about including it... :Wink: 

----------

## Dana Merrick

I suppose you're right.

It'd be nice to have other files on my USB stick too...

But what about syncing with portage on a host computer? I have no idea if this is possible, but is there some way to, like, chroot to the USB from a real Gentoo box, and use that portage directory? So then one could run portage commands and update the USB enviroment?

It seems simple but I bet its neigh impossible.

So, giving up on that, is there any way to make the USB stick self bootable, so you dont need a boot floppy?

And also, why not make it writeable? How about a home directory that is the main folder of the USB stick?

Are any of these ideas plausible?

----------

## knopper

 *aragostaragazzo wrote:*   

> I suppose you're right.
> 
> It'd be nice to have other files on my USB stick too...
> 
> But what about syncing with portage on a host computer? I have no idea if this is possible, but is there some way to, like, chroot to the USB from a real Gentoo box, and use that portage directory? So then one could run portage commands and update the USB enviroment?
> ...

 

The only thing you could do is mount the portage tree from another pc in your network with samba or nfs. Though please note that knopperdisk uses a profile of it's own so things could be a bit different.

 *Quote:*   

> 
> 
> So, giving up on that, is there any way to make the USB stick self bootable, so you dont need a boot floppy?
> 
> 

 

In the new version grub is also installed on the usb disk itself which -in theory- should make it possible to boot from the usb disk itself. Though there are just a few bios'es which support this correctly.

 *Quote:*   

> 
> 
> And also, why not make it writeable? How about a home directory that is the main folder of the USB stick?
> 
> Are any of these ideas plausible?

 

You might have noticed that there's a .cloop file on the usb disk and unfortunately this is a read-only filesystem. Only the directories /etc, /root, /mnt and /var are mounted as tmpfs which means they exist in ram and swap (if available).

----------

## Dana Merrick

 *knopper wrote:*   

> Though please note that knopperdisk uses a profile of it's own so things could be a bit different.
> 
> ...
> 
> and unfortunately this is a read-only filesystem. Only the directories /etc, /root, /mnt and /var are mounted as tmpfs which means they exist in ram and swap (if available).

 

Well, it looks like I'm gonna end up doing this and making an uncompressed Gentoo installation on my USB drive. This way I can have a writeable home directory that I can throw files on and keep using my USB drive as just that; a USB drive.

 *knopper wrote:*   

> Though there are just a few bios'es which support this correctly.

 

That's okay, I mainly want this for my school computers, which do support USB booting. I think USB booting is nearly standard on newer motherboards, so I can always go into a Sam's Club and boot their shiny new boxes into Linux.  :Very Happy: .

----------

## hypnotx

Can anyone help with this?

```

kmod: failed to exec /sbin/modprobe -s -k block-major, errno = 2

VFS:  Cannot open root device "ram0" or 01:00

Please append a correct "root=" boot option

Kernel Panic: VFS: Unable to mount root fs on 01:00 

```

Is there something missing in the kernel here?

----------

## jsfan

I've realized that nothing has been written in this forum for long time. However, the "No init found." problem is mentioned here but doesn't seem to have been solved.  :Crying or Very sad: 

I've patched the livecd-ng script so that it works with the current versions of busybox and cloop now. As this took me quite some time, I'm very sad that my LiveCDs won't work.  :Crying or Very sad:  Maybe someone who reads this would like to try my patched script and find out why I get these "No init found." The strange thing is that the cloop image and the initrd are ok (I've manually mounted them), /sbin/init exists and has correct permissions and all fs types I need seem to be in the kernel.

You can download my livecd-ng version at http://www.penpal4u.net/livecd . You'll also find a busybox-config, a kernel-config for 2.4.28 and a changed settings file there. The livecd.diff file shows the diff between my version and the one in the ebuild.

jsfan

----------

## ixion

I would highly recommend using this tutorial:

https://forums.gentoo.org/viewtopic.php?t=244837&highlight=livecd

I dumped the livecd-ng method and haven't looked back. That above tutorial is a dream come true.  :Smile: 

----------

## jsfan

I've seen that howto and I'll use it. However, it doesn't use cloop but sqhashfs. I don't know what to prefer but what I like a lot with the live-ng script is that it is (in theory) easy to use. I wanted to avoid doing everything manually.    :Sad: 

----------

## ixion

If you want full automation, I hear catalyst is good for that (if you do a search for catalyst in these forums you will find a lot of good information).

I know doing it manually is a ton of extra work, but it is so worth it with the customibility that it adds..  :Wink: 

----------

## jsfan

 *Quote:*   

> I know doing it manually is a ton of extra work, but it is so worth it with the customibility that it adds.. 

 

That's exactly why I liked the livcd-ng script. You can easily change everything and still most of the work is done by the script. I've looked at the Catalyst-HOWTO at http://www.gentoo.org/proj/en/releng/catalyst/catalyst-howto.xml

but it looks as if it was much more work than the livecd-ng way...  :Confused: 

I'm checking out the manual way right now. Maybe I'll stick to that...   :Wink: 

----------

## ixion

okay, best of luck, mate!  :Smile: 

Please post here or PM me if you run into any problems doing it the manual way. I had to do a small amount of hacking to get it to work for me, but it's finally up and running. Hopefully I can help save you the trouble if you do have some issues..

----------

## stig

 *doom4 wrote:*   

>  *aragostaragazzo wrote:*   
> 
> ```
> make: *** No rule to make target `oldconfig'.  Stop.
> 
> ...

 

The problem seems to be realted to the "fix" that tries to solve the ".config"-problem. The directory structure for /usr/src/linux get messed up by doing this. Therefore there is nothing to make when the scripes tries to.

Whoa. Bumped into another problem now when I tried it on another machine I've got:

```
livecd-ng gentoo-basic build

Using current working directory as LIVECD_ROOT.

>>> Extracting stage tarball...

/tmp/livecd/stage1-build: line 2: 24787 Illegal instruction     env-update

/tmp/livecd/stage1-build: line 6: 24792 Illegal instruction     emerge --noreplace portage

>>> Emerging ccache...

/tmp/livecd/stage1-build: line 13: 24798 Illegal instruction     emerge --buildpkg --usepkg --noreplace --pretend

 $x

>>> Emerging metalog...

/tmp/livecd/stage1-build: line 13: 24801 Illegal instruction     emerge --buildpkg --usepkg --noreplace --pretend

 $x

>>> Emerging ncftp...

/tmp/livecd/stage1-build: line 13: 24804 Illegal instruction     emerge --buildpkg --usepkg --noreplace --pretend

 $x

>>> Emerging dialog...

/tmp/livecd/stage1-build: line 13: 24807 Illegal instruction     emerge --buildpkg --usepkg --noreplace --pretend

 $x

>>> Emerging lilo...

/tmp/livecd/stage1-build: line 13: 24810 Illegal instruction     emerge --buildpkg --usepkg --noreplace --pretend
```

  .....and so on...

----------

## orvtech

I am having someproblems to locate the file stage3-x86-1.4_rc4.tar.bz2, so when the script calls =http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/1.4_rc4/x86/x86/stages/stage3-x86-1.4_rc4.tar.bz2 it return an error because the file doesn exist. i ve look in more that 4 mirrors and is the same..

any sugestion??

----------

## stig

 *orvtech wrote:*   

> I am having someproblems to locate the file stage3-x86-1.4_rc4.tar.bz2, so when the script calls =http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/1.4_rc4/x86/x86/stages/stage3-x86-1.4_rc4.tar.bz2 it return an error because the file doesn exist. i ve look in more that 4 mirrors and is the same..
> 
> any sugestion??

 

The scipt is old. The directory structure looks different now. Swap it with the following: 

```
http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/2004.3/stages/x86/stage3-x86-2004.3.tar.bz2
```

----------

## stevefink

Running into some errors creating cloop ISO

jp livecd-ng # livecd-ng gentoo-basic cloop

Using current working directory as LIVECD_ROOT.

5000+0 records in

5000+0 records out

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d17p4': No space left on device

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d17p5': No space left on device

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d17p6': No space left on device

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d17p7': No space left on device

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d18p1': No space left on device

cp: cannot create special file `/opt/tmp/gentoo-basic/looproot/dev/rd/c5d18p2': No space left on device

...

list goes on etc.

jp livecd-ng # grep -i loop /etc/livecd-ng/profiles/gentoo-basic/settings 

LOOP_SIZE="5000"

I'm using stage3-x86-2004.3.tar.bz2 with the original version of livecd-ng as 1.1 mirrors are not available as far as I'm aware.  Any help would be appreciated.

-- Steve

----------

## P0w3r3d

my problem with livecd-ng is when i'm creting an initrd image, it is looking for something in /tmp/livecd .... anyone have any idea about this??

----------

## Rainmaker

OK, I sucessfully got a cloop image to build (after a LOT of editing in the original livecd-ng script). I copied everything, syslinux'ed my USB stick, but when I stick it in a USB bootable computer, it just won't boot.

Even when I select "USB stick" in the boot menu, it just boots Win NT!

The uba1 partition has the bootable flag set, and all files seem to be in place

Does my USB stick need support foir this too? It just looks in the MBR, doesn't it? syslinux does not report any errors.

I have a MSI Megastick 256 (USB 1.1 version  :Rolling Eyes:  was a bit too fast to buy a USB stick  :Smile: )

@steverfink:change the LOOP_SIZE variable in the settings file to a bigger value (mine is set to 600000 = 600 MB)

----------

## loonix

I am looking for the giftoppm tool mentioned earlier in this post. Which package is it part of? Thanks

AR

----------

## Aas

It spits an error on me while trying to build.

```
root livecd-ng # livecd-ng gentoo-basic build

Using current working directory as LIVECD_ROOT.

>>> Extracting stage tarball...

mount: mount point /tmp/gentoo-basic/cdroot/usr/portage does not exist

chroot_generate: aborting.
```

Please! What have I done wrong?   :Crying or Very sad: 

Thanks for advices.

----------

## switch87

I have moved your howto to the gentoo wiki, I did not yet updated it so feel free to edit. layout changes are not completed, but working on it. https://wiki.gentoo.org/wiki/Custom_livecd_/_liveUSB

----------

