Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Build a Gentoo install/boot/rescue LiveCD USB
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Sun Jun 01, 2003 5:59 pm    Post subject: Build a Gentoo install/boot/rescue LiveCD USB Reply with quote

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).

Code:

     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.


Code:

    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.

Code:
   
   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).

Code:

   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.

Code:

   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.

Code:

   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.

Code:

   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.

Code:

   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

Code:

  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.

Code:

   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.

Code:

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


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

Code:

   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.

Code:

   livecd-ng gentoo-basic fetch


Build all the packages (including the kernel)

Code:

   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.

Code:

    livecd-ng gentoo-basic initrd


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

Code:

   livecd-ng gentoo-basic clean


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

Create the compressed loop image.

Code:

   livecd-ng gentoo-basic cloop


Create the ISO image for the livecd

Code:

   livecd-ng gentoo-basic isogen


Undo any temporary chroot environments used by the script.

Code:

   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

Code:

   emerge dosfstools


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

Code:

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


Format the usb drive with a VFAT filesystem.

Code:

   mkfs.vfat /dev/sda1


Mount the USB stick

Code:

   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.

Code:

   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.

Code:

   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.

Code:

   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:

Code:

   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:

Code:

   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!

Paul


Last edited by Donut on Tue Jun 03, 2003 11:43 am; edited 2 times in total
Back to top
View user's profile Send private message
mepython
n00b
n00b


Joined: 24 Jan 2003
Posts: 24

PostPosted: Mon Jun 02, 2003 2:01 am    Post subject: Great Explanation Reply with quote

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?
Back to top
View user's profile Send private message
Squinky86
Retired Dev
Retired Dev


Joined: 25 Mar 2003
Posts: 309
Location: Alabama, USA

PostPosted: Mon Jun 02, 2003 1:04 pm    Post subject: Reply with quote

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!
_________________
Me
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Tue Jun 03, 2003 11:46 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
searcher
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 175
Location: NL

PostPosted: Tue Jun 03, 2003 12:17 pm    Post subject: Reply with quote

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 :) Good work on the howto!
_________________
You are unique ... just like everyone else.
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Tue Jun 03, 2003 12:54 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
searcher
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 175
Location: NL

PostPosted: Thu Jun 05, 2003 6:23 pm    Post subject: Reply with quote

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" :( 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.
_________________
You are unique ... just like everyone else.
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Thu Jun 05, 2003 7:12 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
searcher
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 175
Location: NL

PostPosted: Thu Jun 05, 2003 7:55 pm    Post subject: Reply with quote

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 ;)

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.

Paul

_________________
You are unique ... just like everyone else.
Back to top
View user's profile Send private message
perry
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 142
Location: Cornfields of Indiana

PostPosted: Sat Jun 07, 2003 12:34 am    Post subject: Reply with quote

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:

Code:

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..
Back to top
View user's profile Send private message
zaragon
n00b
n00b


Joined: 19 May 2003
Posts: 14
Location: Sweden

PostPosted: Sat Jun 07, 2003 8:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
perry
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 142
Location: Cornfields of Indiana

PostPosted: Sun Jun 08, 2003 1:05 am    Post subject: Reply with quote

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 :) 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..).
Back to top
View user's profile Send private message
searcher
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 175
Location: NL

PostPosted: Thu Jun 12, 2003 1:38 pm    Post subject: Reply with quote

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 :D

*i'm using some no name brand stick that i got for about 20 euro's, just for the record :)
_________________
You are unique ... just like everyone else.
Back to top
View user's profile Send private message
Cylaris
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Mon Jun 16, 2003 10:56 am    Post subject: Reply with quote

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

-Cyl
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Mon Jun 16, 2003 1:16 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
OdinsDream
Veteran
Veteran


Joined: 01 Jun 2002
Posts: 1057

PostPosted: Mon Jun 16, 2003 3:04 pm    Post subject: Reply with quote

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.
_________________
s/(?<!gnu\/)linux(?! kernel)/GNU\/Linux/gi

Don't blame me. I didn't vote for him.

http://john.simplykiwi.com
Back to top
View user's profile Send private message
Cylaris
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Mon Jun 16, 2003 4:46 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Cylaris
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Tue Jun 17, 2003 9:47 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
zephyr1256
Apprentice
Apprentice


Joined: 10 Mar 2003
Posts: 170
Location: Kingsport, TN

PostPosted: Fri Jun 20, 2003 2:57 am    Post subject: Reply with quote

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 Congress shall have power...To promote the progress of science and useful arts, by securing for limited times to authors and inventors the exclusive right to their respective writings and discoveries; --U.S. Constitution. Article 1, Section 8.
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Fri Jun 20, 2003 7:05 am    Post subject: Reply with quote

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! ;)

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! ;) ) - 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
Back to top
View user's profile Send private message
Donut
n00b
n00b


Joined: 27 Apr 2003
Posts: 40

PostPosted: Sat Jun 21, 2003 7:27 am    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message
Cylaris
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Sat Jun 21, 2003 10:29 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Mon Jun 23, 2003 5:55 pm    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message
DanBUK
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2003
Posts: 105
Location: London, UK

PostPosted: Mon Jun 23, 2003 6:19 pm    Post subject: Livecd-ng init probs when booting the 'new' livecd. Reply with quote

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
Back to top
View user's profile Send private message
searcher
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 175
Location: NL

PostPosted: Mon Jun 23, 2003 9:28 pm    Post subject: Reply with quote

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
_________________
You are unique ... just like everyone else.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum