Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[mini-HowTo] Gentoo Linux LiveCD for Dummies!
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 6, 7, 8 ... 19, 20, 21  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
vibidoo
Guru
Guru


Joined: 27 Nov 2002
Posts: 409

PostPosted: Sun Jan 02, 2005 6:36 pm    Post subject: Reply with quote

I have success to boot completely 8)

But I had to modify the initrd script :

Code:

#!/bin/sh
export PATH=/bin

# Get kernel CMDLINE
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
umount /proc

# Mount CD device
##CDROM=""
##for x in hda hdb hdc hdd
##do
mount -t iso9660 -r /dev/hdc /cdrom > /dev/null 2>&1
##if [ "$?" = "0" ]
 ##then
##CDROM="${x}"
   ## break
  ##fi
##done
# CD not found
##if [ "${CDROM}" == "" ]
##then
 ## exec /bin/sh
  ##exit
##fi

# Mount root and create read-write directories
mount -t squashfs -o loop /cdrom/files/source.img /new > /dev/null 2>&1
mount -t tmpfs -o size=32m none /new/var > /dev/null 2>&1
mount -t tmpfs -o size=32m none /new/etc > /dev/null 2>&1
mount -t tmpfs -o size=32m none /new/tmp > /dev/null 2>&1
mount -t tmpfs -o size=32m none /new/root > /dev/null 2>&1
cd /new/var && tar xpf /cdrom/files/var.tar > /dev/null 2>&1
cd /new/etc && tar xpf /cdrom/files/etc.tar > /dev/null 2>&1
cd /new/root && tar xpf /cdrom/files/root.tar > /dev/null 2>&1

# Pivot root and start real init
cd /new
pivot_root . newroot
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
exec /sbin/init ${CMDLINE}
EOF



Don't know why but I have two unit and with the original initrd script I can not boot to the end
Back to top
View user's profile Send private message
stahlsau
Guru
Guru


Joined: 09 Jan 2004
Posts: 565
Location: WildWestwoods

PostPosted: Thu Jan 06, 2005 7:19 am    Post subject: Reply with quote

Hi,
first of all: thanks for the howto, i know it´s been a lot of work.

second: mmh...it doesn´t work for me :-(
when booting off the iso, it says
Code:
Uncompressing Linux..Ok, booting the kernel.
Blink Blink Blink...

and then there was silence.

I recompiled the kernel, checking all option and removing unnecassary ones, tried /bin/sh instead of linuxrc, edited the grub-boot-lines in all possible ways, no go.
Anyone an idea?
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
s4kk3
Apprentice
Apprentice


Joined: 15 Oct 2004
Posts: 232
Location: Finland

PostPosted: Sat Jan 08, 2005 12:11 pm    Post subject: Reply with quote

I'm not sure if this have been asked before in this thread. I was too lazy to read whole topic but..

Succesfully managed to make image and burn it. When I try to boot it gives a error. It says something about iso9660+something else and after that "Bad file or directory type". If you need I can post full error message.
_________________
My own filemanager project
Back to top
View user's profile Send private message
AAAle
n00b
n00b


Joined: 28 Jul 2004
Posts: 15
Location: Vicenza, Italy

PostPosted: Sat Jan 08, 2005 3:21 pm    Post subject: Reply with quote

Hello all
Finally i got my first livecd works in all the ways but i need a little help for finish it.

I emerge hwdata-knoppix and kudzu-knoppix for making the hw detection work but it doesn't start at boot.

Was anyone able to make it work?

thanks a lot at all and to this beautifull How-to.

***SOLVED***

while i am in chroot do a: rc-update add autoconfig default


Last edited by AAAle on Sat Jan 15, 2005 2:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
chup
n00b
n00b


Joined: 08 Oct 2003
Posts: 24

PostPosted: Sun Jan 09, 2005 12:57 pm    Post subject: Reply with quote

Please help.... My cd does boot, but i get thrown in a very limited bash shell. I cannot login or anything. It stops booting right after starting devfs. I get no errors at all, just that lame bash shell... :(
Hmm, it seems that the cd is just booting initrd, and not the whole cd :(
Any help would be appreciated ;)
I think I know what's the problem: when I execute the build script, I get this error:
tar: *: Cannot stat: No such file or directory
I'm guessing that's why I get the bash shell, since something else isn't on the cdrom.
Any idea on how to fix it?
//edit: changed the tar commands, the tars are now on the cd but still the same :(
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Mon Jan 10, 2005 10:25 am    Post subject: Reply with quote

Chup

I had a similar problem till I spotted that I had compiled squashfs as a module and not directly into the kernel.

The result of this was that the .img file was not mounted, but all errors were being sent to /dev/null so I didn't notice.

A simple mistake as the other options I used only required one tap of the keyboard in menuconfig :)

Neil
Back to top
View user's profile Send private message
chup
n00b
n00b


Joined: 08 Oct 2003
Posts: 24

PostPosted: Mon Jan 10, 2005 1:50 pm    Post subject: Reply with quote

Do you mean compiled as a module on the live cd? I just checked the config, and it's compiled in, not as a module :(

//edit: never mind, I think you mean just my base system which I'm running my comp on. I'll compile squashfs into the kernel and retry :D Thanks!

//edit2: Tried that, still no luck :(

//edit3: Yes, another edit ;) I think my problem is that the script doesn't find the cdrom, and therefor starts /bin/sh. I'm going to try to just put the cdrom at /dev/hdd as it is under my 'normal' Gentoo installation, and check the outcome of that :)

//edit4: :P That has to be the problem, since when I remove the "if cd not found -> init=/bin/sh" I get a kernel panic stating no init found. Now I'm going to have a great time changing the drive letter, making a iso, booting it, etc etc...
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Mon Jan 10, 2005 3:30 pm    Post subject: Reply with quote

I did mean that livecd kernel should have squashfs compiled in.

You don't need to keep making iso' s to check this, during boot at the grub window, press 'e' to edit then change

Code:

init=/linuxrc


to

Code:

init=/bin/sh


then carry out the linuxrc script command by hand. Then you can see what is going on.

You could also change the linuxrc command to see what mount is doing:

Code:

mount -t iso9660 -r /dev/${x} /cdrom > /dev/null 2>&1


to

Code:

mount -t iso9660 -r /dev/${x} /cdrom
Back to top
View user's profile Send private message
AAAle
n00b
n00b


Joined: 28 Jul 2004
Posts: 15
Location: Vicenza, Italy

PostPosted: Sat Jan 15, 2005 2:22 pm    Post subject: Reply with quote

is there a way to get /home/ writable ?

I did that:

Quote:
root@Alien livecd # ./work
Alien / # useradd gendem -m -G users,wheel,audio -s /bin/bash
Alien / # passwd gendem


then i emerge all packages that i wanted, kde too.

when i boot livecd and i try to start kde from gendem user, it doesn't start because gendem don't have permission to write in /home/gendem.

AAAle
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Sat Jan 15, 2005 3:00 pm    Post subject: Reply with quote

Great how to! I have used this with much more success than catalyst so far.

AAAle: add a new line to the linuxrc script to create a new temp fs mount
mount -t tmpfs none /new/home

I have tried to use busybox within initd, but the mount command does not seem to work :(

To make the process easier to manage I have make myself a script for the job, I am posting it in case it is of anyuse to someone:

Code:

#!/bin/sh

SOURCE="livecd_src"
BUILD="build"
STAGE="stage2-x86-2004.3.tar.bz2"
SNAPSHOT="portage-20041022.tar.bz2"
ISO="livecd.iso"
LIVEUSE="livecd cdr"
TIMEZONE="GB"
PACKAGES="metalog vixie-cron slocate dhcpcd udev hotplug coldplug udev openssh"
KERNELPACKAGES="pcmcia-cs"
RCBOOT="coldplug hotplug hostname"
RCDEFAULT="domainname metalog vixie-cron sshd net.eth0"
KERNELRCBOOT=""
KERNELRCDEFAULT="pcmcia"
KERNEL="gentoo-dev-sources"
HOSTNAME="livecd"
CDSEARCH="hda hdb hdc hdd"
OVERLAYSEARCH="hda hdb hdc hdd"

NAME=`basename $0`

## print mesage and exit
die()
{
    echo $1
    exit
}

## prepare the chroot
prep_chroot()
{
mkdir -p $SOURCE/usr/portage/distfiles
mount -o bind /proc $SOURCE/proc
mount -o bind /sys $SOURCE/sys
mount -o bind /dev $SOURCE/dev
mount -o bind /dev/pts $SOURCE/dev/pts
mount -o bind /usr/portage/distfiles $SOURCE/usr/portage/distfiles

cp $0 $SOURCE/tmp
}

## clean the chroot
clean_chroot()
{
rm -rf source/tmp/*

umount $SOURCE/proc
umount $SOURCE/sys
umount $SOURCE/dev/pts
umount $SOURCE/dev
umount $SOURCE/usr/portage/distfiles
}

## set the environment
set_env()
{
env-update
source /etc/profile
}

## run chroot commands on this script
chroot_livecd()
{
prep_chroot
chroot $SOURCE /tmp/$NAME set_env $@
clean_chroot
}

## login command
bash_login()
{
/bin/bash --login
}

## sync command
emerge_sync()
{
emerge sync
}

## emerge system command
emerge_system()
{
emerge system
emerge baselayout
}

## set local time
local_time()
{
ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime || die "Failed to link localtime"
}

## emerge packages
emerge_packages()
{
emerge $PACKAGES
}

## emerge kernel packages
emerge_kernel_packages()
{
emerge $KERNELPACKAGES
}

## update the use flags
mk_make()
{
if [ -e /etc/make.conf.bak ]
then
    cp /etc/make.conf.bak /etc/make.conf
else
    cp /etc/make.conf /etc/make.conf.bak
fi
echo "

## added by livecd script
USE=\"$LIVEUSE\"
" >> /etc/make.conf
}

## run the rc-updates
rc_update()
{
for R in $RCBOOT
do
   rc-update add $R boot || die "Failed rc-update"
done
for R in $RCDEFAULT
do
   rc-update add $R default || die "Failed rc-update"
done
}

## run the post kernel rc-updates
kernel_rc_update()
{
for R in $KERNELRCBOOT
do
   rc-update add $R boot || die "Failed rc-update"
done
for R in $KERNELRCDEFAULT
do
   rc-update add $R default || die "Failed rc-update"
done
}

## build the kernel
build_kernel()
{
emerge $KERNEL
cd /usr/src/linux || die "Failed to cd to the kernel build directory"

kernel_req

make menuconfig || die "Failed to run menuconfig"
make || die "Failed to run kernel make"
make modules_install || die "Failed to run make modules_install"
cp arch/i386/boot/bzImage /boot/vmlinuz || die "Failed to copy kernel"

emerge_kernel_packages
kernel_rc_update
}

## install grub
install_grub()
{
echo "** Using unstable grub version **"
ACCEPT_KEYWORDS="~x86" emerge grub || die "Failed to emerge grub"
echo "
default 0
timeout 5
splashimage=(cd)/boot/grub/splash.xpm.gz

title=Gentoo Linux
        root (cd)
        kernel (cd)/boot/vmlinuz root=/dev/ram0 rw init=/linuxrc cdroot
        initrd (cd)/boot/initrd
" > /boot/grub/grub.conf
}

build_initrd()
{
dd if=/dev/zero of=/boot/initrd bs=1024k count=8 || die "Failed to make initrd file"
mke2fs -Fv /boot/initrd || die "Failed to format initrd with ext2"
mkdir -p /mnt/initrd
mount -o loop /boot/initrd /mnt/initrd || die "Failed to mount initrd"

cd /mnt/initrd
mkdir etc dev lib bin proc new cdrom
touch etc/mtab
touch etc/fstab
cd /

## populate the bin directory
BINS="more rmdir sh cat mount umount mkdir chroot tar ls gzip ../sbin/pivot_root"
for BIN in $BINS
do
  cp /bin/$BIN /mnt/initrd/bin
  LIB=`ldd /bin/$BIN | grep "=>" | grep -v "linux-gate.so.1" | awk '{print $3}'`
  cp -f $LIB /mnt/initrd/lib/
done

mknod /mnt/initrd/dev/console c 5 1
mknod /mnt/initrd/dev/null c 1 3
mknod /mnt/initrd/dev/hda b 3 0
mknod /mnt/initrd/dev/hdb b 3 64
mknod /mnt/initrd/dev/hdc b 22 0
mknod /mnt/initrd/dev/hdd b 22 64
mknod /mnt/initrd/dev/tty c 4 0
mknod /mnt/initrd/dev/loop0 b 7 0

echo "#!/bin/sh
export PATH=/bin

echo \"Starting initrd...\"

# Get kernel CMDLINE
mount -t proc none /proc
CMDLINE=\`cat /proc/cmdline\`
umount /proc

# Mount CD device
CDROM=\"\"
for x in $CDSEARCH
do
  mount -t iso9660 -r /dev/\${x} /cdrom > /dev/null 2>&1
  if [ \"\$?\" = \"0\" ]
  then
    CDROM=\"\${x}\"
    break
  fi
done

# CD not found
if [ -z \"\${CDROM}\" ]
then
  exec /bin/sh
  exit
fi

echo \"CDROM found on: /dev/\${CDROM}\"
echo \"Mount root and create RAM directories...\"

mount -t squashfs -o loop /cdrom/files/source.img /new
mount -t tmpfs  none /new/var
mount -t tmpfs  none /new/etc
mount -t tmpfs  none /new/tmp
mount -t tmpfs  none /new/root
mount -t tmpfs  none /new/mnt
cd /new/var && tar zxpf /cdrom/files/var.tar.gz
cd /new/etc && tar zxpf /cdrom/files/etc.tar.gz
cd /new/root && tar zxpf /cdrom/files/root.tar.gz

echo \"Looking for overlay...\"
cd /new
mkdir /new/mnt/over
for x in $OVERLAYSEARCH
do
  mount /dev/\${x} /new/mnt/over > /dev/null 2>&1
  if [ \"\$?\" == \"0\" ]
  then
    if [ -e /new/mnt/over/overlay.tar.gz ]
    then
      echo \"Found overlay on /dev/\${x}\...\"
      tar zxf /new/mnt/over/overlay.tar.gz
    fi
    umount /new/mnt/over
  fi
done
rmdir /new/mnt/over

echo \"Pivot root...\"

cd /new
pivot_root . newroot
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
echo "In new chroot..."
exec /sbin/init \${CMDLINE}
EOF
" > /mnt/initrd/linuxrc

chmod +x /mnt/initrd/linuxrc

cd /
umount /mnt/initrd || die "Failed to unmount initrd loop device"
}

## prepare the file system
prep_fs()
{
cd /var
mv -f cache db /usr/lib/portage/
ln -s /usr/lib/portage/cache cache
ln -s /usr/lib/portage/db db
cd /lib
mv -f udev-state /var/lib
ln -s /var/lib/udev-state udev-state
echo $HOSTNAME > /etc/hostname
echo "root:" | chpasswd -e
if [ ! -e /etc/conf.d/net.bak ]
then
cp /etc/conf.d/net /etc/conf.d/net.bak
fi
echo "
iface_eth0=\"dhcp\"
dhcpcd_eth0=\"-h $HOSTNAME\"
" > /etc/conf.d/net
}

################
## user commands
################

chroot_sh()
{
chroot_livecd bash_login
}

mk_source()
{
rm -rf $SOURCE
mkdir -p $SOURCE
if [ ! -e $STAGE ]
then
   echo "Download stage...[Enter to continue]" && read r
   links http://www.gentoo.org/main/en/mirrors.xml
fi
if [ ! -e $SNAPSHOT ]
then
   echo "Download snapshot...[Enter to continue]" && read r
   links http://www.gentoo.org/main/en/mirrors.xml
fi
tar jxvpf $STAGE -C $SOURCE || die "Failed to extract stage"
tar jxvpf $SNAPSHOT -C $SOURCE/usr || die "Failed to extract snapshot"
mkdir -p $SOURCE/newroot
}

resolv()
{
if [ ! -e $SOURCE/etc/resolv.conf ]
then
   cp /etc/resolv.conf $SOURCE/etc/
fi
}

emu()
{
qemu -cdrom $ISO -boot c
}

sync()
{
chroot_livecd emerge_sync || die "Failed to emerge sync"
}

set_use()
{
chroot_livecd mk_make
}

system()
{
chroot_livecd emerge_system
chroot_livecd local_time
echo "
/dev/loop0 /        squashfs ro,defaults 0 0
none       /proc    proc     defaults    0 0
none       /dev/shm tmpfs    defaults    0 0
none       /dev/pts devpts   defaults    0 0
" > $SOURCE/etc/fstab
}

packages()
{
chroot_livecd emerge_packages rc_update
}

kernel()
{
chroot_livecd build_kernel
}

kernel_req()
{
echo "
Kernel Settings (2.6)
=====================

Code maturity level options --->
  [*] Prompt for development and/or incomplete code/drivers

General setup --->
  [*] Kernel .config support
  [*]   Enable access to .config through /proc/config.gz

Device Drivers  --->
  Block devices  --->
    <*> Loopback device support
    <*> RAM disk support
    (8192) Default RAM disk size (kbytes)
    [*]   Initial RAM disk (initrd) support

File systems --->
  Pseudo Filesystems --->
    [*] /dev file system support (OBSOLETE)
  Miscellaneous filesystems --->
    <*> SquashFS 2.0 - Squashed file system support
 " | less
}

grub()
{
chroot_livecd install_grub
}

initrd()
{
chroot_livecd build_initrd
}

prep()
{
chroot_livecd prep_fs
}

iso()
{
rm -rf $BUILD
mkdir $BUILD
cp -a $SOURCE/boot $BUILD/
mkdir $BUILD/files

rm -rf $SOURCE/var/tmp/*
rm -rf $SOURCE/var/run/*
rm -rf $SOURCE/var/lock/*
rm -rf $SOURCE/tmp/*
rm -f $SOURCE/etc/mtab
touch $SOURCE/etc/mtab
cp $0 $SOURCE/sbin/

cd $SOURCE/etc/
tar zcvpf ../../$BUILD/files/etc.tar.gz * .[[:alnum:]]*
cd ../var/
tar zcvpf ../../$BUILD/files/var.tar.gz * .[[:alnum:]]*
cd ../root/
tar zcvpf ../../$BUILD/files/root.tar.gz * .[[:alnum:]]*
cd ../../

mksquashfs $SOURCE/ $BUILD/files/source.img -e usr/src usr/portage || die "Failed to build squashfs"

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 \
-boot-info-table -iso-level 4 -hide boot.catalog -o $ISO $BUILD/ || die "Failed to make iso"
}

###################
## command handling
###################

if [ "$#" == "0" ]
   then
   echo "Usage: $NAME [command]

   commands:
   chroot_sh   chroot into the livecd.
   mk_source   make a clean SOURCE directory with the given STAGE
         and SNAPSHOT.
   resolv      make sure the SOURCE has a resolv.conf file
   sync      run emerge sync in the SOURCE.
   set_use      build the make.conf file with the LIVEUSE flags.
   system      build the system.
   packages   build the PACKAGES.
   kernel_req   list the kernel requirements.
      kernel      build the KERNEL.
   grub      install grub.
      initrd      build the initrd.
      prep      prepare the file system.
      iso      build the ISO file.
   emu      run qemu for the ISO file.

   To build a live cd from scratch run:
     $NAME mk_source resolv sync set_use system packages kernel grub initrd prep iso

   script variables:
   SOURCE      the source directory for building the livecd ($SOURCE)
   BUILD      the build directory ($BUILD)
   STAGE      the initial state tarball ($STAGE)
   ISO      the iso name ($ISO)
   SNAPSHOT   the portage snapshot to use ($SNAPSHOT)
   LIVEUSE      the livecd use flags ($LIVEUSE)
   TIMEZONE   the local time zone setting ($TIMEZONE)
   PACKAGES   the system packages to install ($PACKAGES)
   RCBOOT      the rc boot additions ($RCBOOT)
   RCDEFAULT   the rc default additions ($RCDEFAULT)
   KERNEL      the kernel source ($KERNEL)
   KERNELPACKAGES  the post kernel packages ($KERNELPACKAGES)
   KERNELRCBOOT   the post kernel rc boot additions ($KERNELRCBOOT)
   KERNELRCDEFAULT   the post kernel rc default additions ($KERNELRCDEFAULT)
   CDSEARCH   the devices to search for the boot cd from initrd ($CDSEARCH)
   OVERLAYSEARCH   the devices to search for the overlay file from initrd ($OVERLAYSEARCH)
"
fi

for CMD in $@
do
   echo "Running '$CMD'..."
   $CMD
done


Cheers
Neil
Back to top
View user's profile Send private message
GentooBox
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1168
Location: Denmark

PostPosted: Mon Jan 17, 2005 7:42 pm    Post subject: Reply with quote

Thanks for the howto

Is there a way to choose a keymap on bootup ?
_________________
Encrypt, lock up everything and duct tape the rest
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Wed Jan 19, 2005 10:39 pm    Post subject: Reply with quote

You could alter the initrd script, to read a kernel argument or prompt for an option, and then ammend the rc.conf file in the new root.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1595
Location: Just over the horizon

PostPosted: Sun Jan 23, 2005 6:44 pm    Post subject: Reply with quote

This is fantastic! I have a question though. Is it strictly necessary to download the portage snapshot, or could I just mount my sytem's portage tree the way it was done with the portage/distfiles directory? It seems a shame to waste all that space with an entirely seperate portage tree, when I have one of my system that 100% up to date and fully populated. Is there some danger of corrupting or changing the state of my system portage tree by doing this?

Thanks Again!
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Sun Jan 23, 2005 8:32 pm    Post subject: Reply with quote

platojones,

Sorry, I'm not sure if there could be difficulties with a shared protage tree, though you can share the portage/distfiles directory fine. My approach however is that if the cd root has it's own portage tree, then I don't need to keep the host machines tree in sync with the cd root.

Neil
Back to top
View user's profile Send private message
ZeroSkunk
n00b
n00b


Joined: 16 May 2004
Posts: 13

PostPosted: Tue Jan 25, 2005 1:34 am    Post subject: Reply with quote

Hey pinguins and cows

first I have to say that this thread is one of the best I've seen in hear *g*, but I have a small problem! I think the grub eltorito patch is not working on all systems!!

I've made some X-live-CDs for testing on different systems, but the grub loads only on newer DESKTOP-SYSTEMS!!

My laptop doesn't like this bootloader, I think there's any memory problem with some BIOSs. So I figured out that there is a fantastic methode to boot those nice little LIVE-CDs.

I don't realy know the name of this tools which gentoo-live-cds are working with, but I want to try working with the gentoo-pinguins rocking INITRDs ect.

The folders say anything about ISOLINUX, and there are some nice .cfg files which look a little bit like lilo configs.

So my question! Is anybody out there working with this boot methode?? The only thing I found is a slackware way, but I'm not getting realy intelligent out of this! :roll:

http://www.linuxpackages.net/howto.php?page=livecd&title=livecd+HOWTO


:?: Daniel :?:
_________________
////////////////////////////////////////////////////
// Sag nicht alles was du weisst //
// Aber wisse alles was du sagst //
//////////////////////////////////////////////////
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Tue Jan 25, 2005 9:01 pm    Post subject: Reply with quote

Thanks for this guide!

What's the version of grub needed to make this work (i.e. with CD boot support)? Is it still masked? Also, the guide uses the outdated way of
emerging masked packages.

Any reason I can't just bind the entire /usr/portage tree and not just /usr/portage distfiles?
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1595
Location: Just over the horizon

PostPosted: Wed Jan 26, 2005 12:42 am    Post subject: Reply with quote

Hi invalid account,
Sorry this took so long, but my job keeps interfering with my life! Anyway, thank you for the nifty script and the reply. I'm a little queazy about messing with my system portage since I've got my machine working like a "machine", so I'll do some more research before I risk that. Better safe than sorry.
This is a great thread and your script provided a terrific starting place for me to get a viable iso burned. I've got a working livecd right now with everything I need to restore my backups. Life is good!
It has a minor glitch or two and I'm working to iron those out with a few customizations of that super handy script you wrote. But no matter what, I sleep a lot better at night now that I know I can completely restore my system with minimum fuss if the HD dies on me.
Call me nuts, but this stuff is fun, especially when it works.

Thanks again,

Richard
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1595
Location: Just over the horizon

PostPosted: Wed Jan 26, 2005 12:56 am    Post subject: Reply with quote

flickerfly,

Yes the grub version you need is still masked as ~x86. The version you need is 0.95. Make sure you are in the livecd chroot environment before you emerge it. I don't think it's considered stable enough for day to day use just yet. Works great so far on the live cd though.
Just use /etc/portage.keywords in the chroot environment if you don't want to use the deprecated method. If you use Niell's very handy script posted above, you just use the 'livecdscript chroot_sh' command to go into the chroot environment, and you are running inside the the livecd as if it were a different and completely seperate box. You can emerge --sync, update files and do anything you can do on your normal system completely safe in the livecd. I love it.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1595
Location: Just over the horizon

PostPosted: Wed Jan 26, 2005 1:02 am    Post subject: Reply with quote

ZeroSkunk,
I don't have any answers for you at this point, but I'm about to travel the same road you are on very soon. Now that I have my desktop 'rescue' ISO ready to go, I've got an old gentoo laptop, which I use as my broadband router, that I'm going to try this on next. It's an old Dell Inspiron 5000e, so I'll find out soon enough if the unstable grub is up to the job. I'll post my results here for you and others to see.

Richard
Back to top
View user's profile Send private message
Match
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2004
Posts: 117
Location: England

PostPosted: Thu Jan 27, 2005 2:09 pm    Post subject: Reply with quote

tigerike wrote:
Match wrote:

I didn't mount /dev to source/dev because it's not in your guide, but I tried it now and it still doesn't work :(

Also, even if I did make the initrd image outside of the chroot, if I can't do this step then surely nothing's going to work anyway?

Incidently, I just tried running the losetup command outside the chroot, on my normal installation: I get the same error message.

Is there any way of me doing this if I keep on getting this message, or does anyone know of how to solve this problem? Otherwise I guess I'll just have to give up :(

(Thanks for the tutorial anyway, veezi :) - not your fault if I can't get it to work)


I may be totally off base, but it sounds like we are getting the two environments confused here. if you are booted into your normal Linux system, then chrooted into your build fs. when you check /usr/src/linux/.config for the presence of LOOP and for /dev/loop* you are looking at the chrooted system not the base system. In order to mount anything on a loopback, in either your chroot or your base, you have to have loop back in your base kernel.
You should be able to go to /usr/src/linux in your base system and add loopback support in the xconfig, recompile the modules and insmod cloop. Then you should be able to mount the initrd to loop0.


You know, I really should have kept on reading this thread. Then it wouldn't be now (in January) that I just figured this out for myself - I could have just read your reply back in November. I feel reasonably stupid now. Thankyou for your help, and I'm sorry I didn't respond sooner!
_________________
O_o
Back to top
View user's profile Send private message
Match
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2004
Posts: 117
Location: England

PostPosted: Thu Jan 27, 2005 4:21 pm    Post subject: Reply with quote

...and now I'm stuck again, but I've got so far! This is a fantastic tutorial, I can't believe I've got this far :)

I boot my LiveCD and I get Grub which is fine. I then get a load of text on the screen like a normal boot-up for me, except I then get an error message.

Code:
VFS: Mounted root (ext2 filesystem)
Freeing unused kernel memory: 184k freed
cdroot: cdroot: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


Any ideas what could be wrong?

Edit: just in case, here's my grub.conf:

Code:
default 0
timeout 5
splashimage=(cd)/boot/grub/splash.xpm.gz

title=Gentoo Linux
root (cd)
kernel (cd)/boot/kernel root=/dev/ram0 rw init=/linuxrc cdroot
initrd (cd)/boot/initrd


It's probably to do with the cdroot parameter, I get that much: but the tutorial says to put it there. Not sure what's going on :(
_________________
O_o
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Thu Jan 27, 2005 5:27 pm    Post subject: Reply with quote

Match wrote:

Code:
VFS: Mounted root (ext2 filesystem)
Freeing unused kernel memory: 184k freed
cdroot: cdroot: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


That is a pretty standard kernel panic. You can probably find some stuff about it via google. In the past I have gotten this error related to either modulatizing or not building something related to the filesystem such as RAID drivers or fs type drivers. Having not done this myself yet, I can't comment on this in relation to chroot or squashfs.
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
Match
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2004
Posts: 117
Location: England

PostPosted: Thu Jan 27, 2005 6:14 pm    Post subject: Reply with quote

Google gives me nothing much, and the kernel definitely* contains squashfs :(

*Experience has taught me never to say definitely, but cat .config | grep SQUASH gives me one value that's definitely a y...
_________________
O_o
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1595
Location: Just over the horizon

PostPosted: Fri Jan 28, 2005 12:21 am    Post subject: Reply with quote

I was getting that too, but it was the framebuffer stuff in my boot opts that was causing it. Have a really close look at your linuxrc. That panic is at the transition from the initrd to the cdrom environment. Also, did you put the 'livecd' USE variable in your make.conf before you built you packages for your livecd? Remember, that you can pass 'init=/bin/sh' on the boot loader config line from the gentoo splash screen. That will drop you into a basic shell where the linuxrc was being booted before. That is great for debugging.
Back to top
View user's profile Send private message
invalid account
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 199

PostPosted: Fri Jan 28, 2005 6:50 am    Post subject: Reply with quote

Match,

I have also seen this when there is a problem with linuxrc itself. Grub seems to try to run linuxrc, fails then tries to run cdrom. Is linuxrc executable and available in the initrd? I think the best way to start with this is to use init=/bin/sh as platojones suggests. If this doesn't work make sure /bin/sh and the needed libs are avaliable, as if this is missing you can get the same problem with grub trying to run cdrom.

Also if you do try adding init=/bin/sh place it after cdrom:

Code:

... cdrom init=/bin/sh


Neil
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 Previous  1, 2, 3 ... 6, 7, 8 ... 19, 20, 21  Next
Page 7 of 21

 
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