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 ... 19, 20, 21  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
vinky
Apprentice
Apprentice


Joined: 24 Feb 2005
Posts: 214
Location: Sweden

PostPosted: Thu Apr 20, 2006 7:17 pm    Post subject: Reply with quote

that one is a bit different from the one I used( the one on the first page of this thread)
your guide uses genkernel and that makes the initrd where the linuxrc is automatically
check this part of the guide.
http://gentoo-wiki.com/HOWTO_build_a_LiveCD_from_scratch#Checking.2Fediting_the_Initramfs
Back to top
View user's profile Send private message
Thegreatone
n00b
n00b


Joined: 12 Jul 2005
Posts: 36

PostPosted: Thu Apr 20, 2006 7:34 pm    Post subject: Reply with quote

This is my initrd:

Code:
# Default to the udev device manager
USE_UDEV_NORMAL=1

# Insert ctrl character
# ctrl-V then esc will print ^[
# ctrl-V then ctrl-shift-m will print ^M
BACK_UP="\033[1K\033[0G"
NORMAL="\033[0m"
WARN="\033[33;1m"
BAD="\033[31;1m"
BOLD="\033[1m"
GOOD="\033[32;1m"


# From KNOPPIX LINUXRC
# Reset fb color mode
RESET="]R"
# ANSI COLORS
# Erase to end of line
CRE="
"
# Clear and reset Screen
CLEAR="c"
# Normal color
NORMAL=""
# RED: Failure or error message
RED=""
# GREEN: Success message
GREEN=""
# YELLOW: Descriptions
YELLOW=""
# BLUE: System mesages
BLUE=""
# MAGENTA: Found devices or drivers
MAGENTA=""
# CYAN: Questions
CYAN=""
# BOLD WHITE: Hint
WHITE=""

# Clear screen with colormode reset
# echo "$CLEAR$RESET"
# echo "$CLEAR"
# Just go to the top of the screen
# echo -n ""

KV="`uname -r`"
KMAJOR=`echo $KV | cut -f1 -d.`
KMINOR=`echo $KV | cut -f2 -d.`
KVER="${KMAJOR}.${KMINOR}"
MISCOPTS='idebug detect'

if [ "${KMAJOR}" -eq 2 -a "${KMINOR}" -ge '6' ]
then
   KV_2_6_OR_GREATER="yes"
fi

QUIET=1
ROOT_LINKS='bin sbin lib lib32 lib64 boot usr opt'
ROOT_TREES='etc root home var'
INSMOD='insmod'
if [ "${KMINOR}" -gt '4' ]
then
   KSUFF='.ko'
else
   KSUFF='.o'
fi

REAL_ROOT=''
CDROOT=0
CDROOT_DEV=''
NEW_ROOT="/newroot"
CONSOLE="/dev/console"

# Only sections that are in by default or those that
# are not module groups need to be defined here...
HWOPTS='usb firewire keymap cache evms2 sata lvm2 dmraid slowusb'
MY_HWOPTS='usb firewire sata dmraid'
HWOPTS="$HWOPTS ataraid dmraid evms2 firewire lvm2 pcmcia sata scsi usb "
 070701003FFBAE000081ED0000000000000000000000014447DBB700003921000000030000000400000000000000000000001300000000etc/initrd.scripts    #!/bin/ash

. /etc/initrd.defaults
backup() {
   echo -ne "\033[0G\033[0K"
}

strlen() {
   if [ -z "$1" ]
   then
      echo "usage: strlen <variable_name>"
      die
   fi
   eval echo "\${#${1}}"
}

parse_opt() {
   case "$1" in
      *\=*)
         local key_name="`echo "$1" | cut -f1 -d=`"
         local key_len=`strlen key_name`
         local value_start=$((key_len+2))
         echo "$1" | cut -c ${value_start}-
      ;;
   esac
}

modules_load() {
   for module in $*
   do
      echo ${module} >> /etc/modules/extra_load
   done

   modules_scan extra_load
}

modules_scan() {
   local MODS
   [ -d /etc/modules/${1} ] || touch /etc/modules/${1}

   MODS=`cat /etc/modules/${1}`
   for x in ${MODS}
   do
      MLOAD=`echo ${MLIST} | sed -e "s/.*${x}.*/${x}/"`
      if [ "${MLIST}" = "${x}" ] # Only module to no-load
      then
         echo -e "${BOLD}   ::${NORMAL} Skipping ${x}..."
      elif [ "${MLOAD}" = "${MLIST}" ] # == No change == No specified no-load
      then
         [ -n "${DEBUG}" ] && echo -ne "${BOLD}   ::${NORMAL} Checking for ${x}..."
         # find -name does not work since the return status is always zero
         if find /lib/modules | grep "${x}${KSUFF}" >/dev/null 2>&1
         then
            echo -ne "${BOLD}   ::${NORMAL} Scanning for ${x}..."
            modprobe ${x} -n
            backup
            echo -ne "${NORMAL}"
         fi
      else
         echo -e "${BOLD}   ::${NORMAL} Skipping ${x}..."
      fi
   done
}

findcdmount() {
   if [ "$#" -gt "0" ]
   then
      for x in $*
      do
         # Check for a block device to mount
         if [ -b "${x}" ]
         then
            good_msg "Attempting to mount CD:- ${x}"
            mount -r ${x} ${NEW_ROOT}/mnt/cdrom > /dev/null 2>&1
            if [ "$?" = '0' ]
            then
               # Check for a LiveCD
               if [ -e ${NEW_ROOT}/mnt/cdrom/livecd ]
               then
                  REAL_ROOT="${x}"
                  break
               else
                  umount ${NEW_ROOT}/mnt/cdrom
               fi
            fi
         fi
      done
      if [ "${REAL_ROOT}" != '' ]
      then
         good_msg "CD medium found on ${x}"
      fi
   fi
}

cache_cd_contents() {
   # Check loop file exists and cache to ramdisk if DO_cache is enabled
   if [ "${LOOPTYPE}" != "noloop" ] && [ "${LOOPTYPE}" != "sgimips" ]
   then
      check_loop
      if [ "${DO_cache}" ]
      then
         good_msg "Copying loop file for caching..."
         cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP}
         if [ $? -ne 0 ]
         then
            bad_msg "Failed to cache the loop file! Lack of space?"
            rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null
            rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null
         else
            LOOPEXT='../'
         fi
      fi
   fi
}

mount_sysfs() {
   if [ "${KV_2_6_OR_GREATER}" ]
   then
      # Udev is semi-broken on non /sys sysfs mount points.
      mount -t sysfs /sys /sys >/dev/null 2>&1
      ret=$?

   
      # sysfs mount failed .. udev wont work fall back to devfs if available
      [ "$ret" -eq '0' ] || USE_UDEV_NORMAL=0
   fi
}

# Insert a directory tree $2 to an union specified by $1
# Top-level read-write branch is specified by it's index 0
# $1 = union absolute path (starting with /)
# $2 = path to data directory
#
union_insert_dir() {
   /sbin/unionctl $1 --add --after 0 --mode ro $2
   if [ $? = '0' ]
   then
      good_msg "Addition of $2 to $1 successful"
   fi
}

findnfsmount() {
   if [ "${IP}" != '' ]
   then
      if [ "${NFSROOT}" = '' ]
      then
         # Obtain NFSIP   
         OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"`
         for OPTION in $OPTIONS
         do
            if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ]
            then
               NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`
            fi
         done
         
         # Obtain NFSPATH
         OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"`   
         for OPTION in $OPTIONS
         do
            if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ]
            then
               NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`
             fi
         done

         # Setup NFSROOT
         if [ "${NFSIP}" != '' ] && [ "$NFSPATH" != '' ]
         then
            NFSROOT="${NFSIP}:${NFSPATH}"
         else
            bad_msg "The DHCP Server did not send a valid root-path."
            bad_msg "Please check your DHCP setup, or provide a nfsroot=<...> parameter."
         fi
      fi

      if [ "${NFSROOT}" != '' ]
      then
         if [ "${CDROOT}" != '0' ]
         then
            good_msg "Attempting to mount NFS CD image on ${NFSROOT}"
            mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}/mnt/cdrom
            if [ "$?" = '0' ]
            then
               REAL_ROOT="/dev/nfs"
            else
               bad_msg "NFS Mounting failed. Is the path corrent ?"
            fi
         else   
            good_msg "Attemping to mount NFS root on ${NFSROOT}"
            mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} ${NEW_ROOT}
            if [ "$?" = '0' ]
            then
               REAL_ROOT="/dev/nfs"
            else
               bad_msg "NFS Mounting failed. Is the path correct ?"
            fi
            # FIXME: Need to start portmap and the other rpc daemons in order to
            # FIXME: remount rw.
         fi

      fi
   fi
}

kill_devfsd() {
   killall devfsd > /dev/null 2>&1
}

check_loop() {
   if [ "${LOOP}" = '' -o ! -e "mnt/cdrom/${LOOP}" ]
   then
   
      bad_msg "Invalid loop location: ${LOOP}"
      bad_msg 'Please export LOOP with a valid location, or reboot and pass a proper loop=...'
      bad_msg 'kernel command line!'
   
      run_shell
   fi
}

run_shell() {
   /bin/ash
}

runUdev() {
   mount -t tmpfs -o size=100k udev /dev
   mkdir /dev/pts
   mkdir /dev/shm
   echo /sbin/udevsend > /proc/sys/kernel/hotplug
   /sbin/udevstart
   ln -snf /proc/self/fd /dev/fd
   ln -snf /proc/self/fd/0 /dev/stdin
   ln -snf /proc/self/fd/1 /dev/stdout
   ln -snf /proc/self/fd/2 /dev/stderr
   ln -snf /proc/kcore /dev/core
}

test_success() {
   error_string=$1
   error_string="${error_string:-run command}"
   # If last command failed send error message and fall back to a shell   
   if [ "$?" != '0' ]
   then
      splash 'verbose'
      bad_msg 'Failed to $1; failing back to the shell...'
      run_shell
   fi
}

good_msg() {
   msg_string=$1
   msg_string="${msg_string:-...}"
   echo -e "${GOOD}>>${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
}

bad_msg() {
   msg_string=$1
   msg_string="${msg_string:-...}"
   echo -e "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
}

warn_msg() {
   msg_string=$1
   msg_string="${msg_string:-...}"
   echo -e "${WARN}**${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
}

bind_mount_dev() {
   # bind-mount /dev/ so that loop devices can be found
   mount -o bind ${NEW_ROOT}/dev /dev
}

start_dev_mgr() {
   # Check udev is available...
   if [ "${KV_2_6_OR_GREATER}" -a ! "${USE_UDEV_NORMAL}" -eq '0' -a -x /sbin/udev ]
   then
      USE_UDEV_NORMAL=1
   else
      USE_UDEV_NORMAL=0
   fi

   if [ "${USE_UDEV_NORMAL}" -eq '1' ]
   then
      cd /sys
      [ "${DO_slowusb}" ] && sleep 10
      kill_devfsd
      good_msg 'Activating udev'
      runUdev
      [ "${DO_slowusb}" ] && sleep 20
      cd /
   else
      if [ ! -e /dev/.devfsd ]
      then
         good_msg 'Activating devfs'
         mount -t devfs devfs /dev
         devfsd /dev -np
      fi
   fi
}

bootstrapCD() {
   # Locate the cdrom device with our media on it.
   [ -n "${CDROOT_DEV}" ] && DEVICES="$DEVICES ${CDROOT_DEV}" # Device specified on the command line
   DEVICES="$DEVICES /dev/cdroms/*" # CDROM DEVICES
   DEVICES="$DEVICES /dev/ide/cd/*" # CDROM DEVICES
   DEVICES="$DEVICES /dev/sr*" # UML DEVICES
   DEVICES="$DEVICES /dev/sd*" # USB Keychain
   DEVICES="$DEVICES /dev/hd*" # IDE devices
   DEVICES="$DEVICES /dev/ubd* /dev/ubd/*" # UML DEVICES
   DEVICES="$DEVICES /dev/iseries/vcd*" # iSeries Devices

   findcdmount $DEVICES
}

cmdline_hwopts() {
   # Scan CMDLINE for any "doscsi" or "noscsi"-type arguments
   
   local FOUND
   local TMP_HWOPTS

   for x in $HWOPTS
   do
      for y in $CMDLINE
      do
         if [ "${y}" = "do${x}" ]
         then
            MY_HWOPTS="${MY_HWOPTS} $x"
         elif [ "${y}" = "no${x}" ]
         then
            MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`"
         fi
      done
   done
   
   # Shouldnt need to sort this as the following loop should figure out the
   # duplicates and strip them out
   #MY_HWOPTS=`echo ${MY_HWOPTS}|  sort`
   
   for x in ${MY_HWOPTS}
   do
      FOUND=0
      for y in ${TMP_HWOPTS}
      do
         if [ "${y}" = "${x}" ]
         then
            FOUND=1
         fi
      done
      if [ ! "${FOUND}" = '1' ]
      then
         TMP_HWOPTS="${TMP_HWOPTS} ${x}"
      fi
   done

   MY_HWOPTS=${TMP_HWOPTS}
}

load_modules() {
   # Load modules listed in MY_HWOPTS if /lib/modules exists
   
   if [ -d '/lib/modules' ]
   then
      good_msg 'Loading modules'
      # Load appropriate kernel modules
      for modules in $MY_HWOPTS
      do
         modules_scan $modules
         eval DO_`echo $modules | sed 's/-//'`=1
      done
   else
      good_msg 'Skipping module load; no modules in the initrd!'
   fi
}

detect_sbp2_devices() {
   # http://www.linux1394.org/sbp2.php
   
   # /proc
   # /proc/scsi/sbp2/0, /proc/scsi/sbp2/1, etc.
   #
   # You may manually add/remove SBP-2 devices via the procfs with:
   # add-single-device <h> <b> <t> <l> or remove-single-device <h> <b> <t> <l>,
   # where:
   #
   # <h> = host (starting at zero for first SCSI adapter)
   # <b> = bus (normally zero)
   # <t> = target (starting at zero for first SBP-2 device)
   # <l> - lun (normally zero)
   # e.g. To manually add/detect a new SBP-2 device
   # echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
   # e.g. To manually remove a SBP-2 device after it's been unplugged
   # echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi
   # e.g. To check to see which SBP-2/SCSI devices are currently registered
   # cat /proc/scsi/scsi

   [ -e /proc/scsi/scsi ] && echo 'scsi add-single-device 0 0 0 0' > /proc/scsi/scsi
}

setup_keymap() {
   if [ "${DO_keymap}" ]
   then
      if [ ! -e /dev/vc/0 -a ! -e /dev/tty0 ]
      then
         DEVBIND=1
         mount -o bind ${NEW_ROOT}/dev /dev
      fi
      [ ! -e /dev/tty0 ] && ln -s /dev/tty1 /dev/tty0

      chooseKeymap

      [ "${DEVBIND}" -eq '1' ] && umount /dev
      
      if [ -e /etc/sysconfig/keyboard -a "${CDROOT}" -eq '1' ]
      then
         mkdir -p ${NEW_ROOT}/etc/sysconfig/
         cp /etc/sysconfig/keyboard ${NEW_ROOT}/etc/sysconfig/keyboard
      fi
   fi
}

chooseKeymap() {
   good_msg "Loading keymaps"
   cat /lib/keymaps/keymapList
   read -t 10 -p '<< Load keymap (Enter for default): ' keymap
   if [ -e /lib/keymaps/${keymap}.map ]
   then
      good_msg "Loading the ''${keymap}'' keymap"
      loadkmap < /lib/keymaps/${keymap}.map
      xkeymap=${keymap}
      echo ${keymap} | egrep -e "[0-9]+" >/dev/null 2>&1
      if [ "$?" -eq '0'  ]
      then
         xkeymap=`tail -n 7 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1`
      fi
      mkdir -p /etc/sysconfig
      echo "XKEYBOARD=${xkeymap}" > /etc/sysconfig/keyboard
   elif [ "$keymap" = '' ]
   then
      echo
      good_msg "Keeping default keymap"
   else
      bad_msg "Sorry, but keymap ''${keymap}'' is invalid!"
      chooseKeymap
   fi
}

startVolumes() {
   #good_msg 'Checking if volumes need to be started...'
   
   if [ "${USE_DMRAID_NORMAL}" -eq '1' ]
   then
      if [ -e '/sbin/dmraid' ]
      then
         good_msg "Activating Device-Mapper RAID(s)"
         if [ '${DMRAID_OPTS}' = '' ]
         then
            /sbin/dmraid -ay
         else
            /sbin/dmraid -ay ${DMRAID_OPTS}
         fi
      fi
   fi

   if [ "${USE_LVM2_NORMAL}" -eq '1' ]
   then
      if [ -e '/bin/vgscan' -a -e '/bin/vgchange' ]
      then
         for dev in ${RAID_DEVICES}
         do
            setup_md_device "${dev}"
         done

         good_msg "Scanning for Volume Groups"
         /bin/vgscan --ignorelockingfailure --mknodes 2>/dev/null
         good_msg "Activating Volume Groups"
         /bin/vgchange -ay --ignorelockingfailure 2>/dev/null

         # Disable EVMS since lvm2 is activated and they dont work together.
         if [ "${USE_EVMS2_NORMAL}" -eq '1' ]
         then
            bad_msg "Disabling EVMS Support because LVM2 started"
            bad_msg "Do not add dolvm2 to the cmdline if this is not what you want"
            bad_msg "LVM2 and EVMS do not work well together"
            USE_EVMS2_NORMAL=0
         fi
      else
         bad_msg "vgscan or vgchange not found: skipping LVM2 volume group activation!"
      fi
   fi

   if [ "${USE_EVMS2_NORMAL}" -eq '1' ]
   then
      if [ -e '/sbin/evms_activate' ]
      then
         good_msg "Activating EVMS"
         evms_activate
      fi
   fi
}

sdelay() {
   # Sleep a specific number of seconds if SDELAY is set otherwise only sleep
   # 1 second
   if [ -n "${SDELAY}" ]
   then
      sleep ${SDELAY}
   else
      sleep 1
   fi
}

quiet_kmsg() {
   # if QUIET is set make the kernel less chatty
   [ -n "$QUIET" ] && echo '0' > /proc/sys/kernel/printk
}

verbose_kmsg() {
   # if QUIET is set make the kernel less chatty
   [ -n "$QUIET" ] && echo '6' > /proc/sys/kernel/printk
}


cdupdate() {
   if [ "${CDROOT}" -eq '1' ]
   then
      if [ -x /${NEW_ROOT}/mnt/cdrom/cdupdate.sh ]
      then
         good_msg "Running cdupdate.sh"
         ${NEW_ROOT}/mnt/cdrom/cdupdate.sh
         if [ "$?" != '0' ]
         then
            splash 'verbose'
            bad_msg "Executing cdupdate.sh failed!"
            run_shell
         fi
      else
         good_msg 'No cdupdate.sh script found, skipping...'
      fi
   fi
}

setup_md_device() {
   local device

   [ -z "$1" ] && device="${REAL_ROOT}" || device="$1"
   [ -z "${device}" ] && return # LiveCD

   if [ `echo ${device}|sed -e 's#\(/dev/md\)[[:digit:]]\+#\1#'` = "/dev/md" ]
   then
      good_msg 'Detected real_root as a md device. Setting up the device node...'
      MD_NUMBER=`echo ${device}|sed -e 's#/dev/md\([[:digit:]]\+\)#\1#'`
      if [ ! -e /dev/md${MD_NUMBER} ]
      then
         mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 2>&1
         [ "$?" -ne 0 ] && bad_msg "Creation of /dev/md${MD_NUMBER} failed..."
      fi
      mdstart ${MDPART} /dev/md${MD_NUMBER}
   fi
}

rundebugshell() {
   if [ -n "$DEBUG" ]
   then
      good_msg 'Starting debug shell as requested by "debug" option.'
      good_msg 'Type "exit" to continue with normal bootup.'
      [ -x /bin/sh ] && /bin/sh || /bin/ash
   fi
}

setup_unionfs() {
   if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
   then
      # Directory used for rw changes in union mount filesystem
      UNION=/union
      MEMORY=/memory
      if [ -z "$UID" ]
      then
         CHANGES=$MEMORY/unionfs_changes/default
      else
         CHANGES=$MEMORY/unionfs_changes/$UID
      fi

      mkdir -p ${MEMORY}
      mkdir -p ${UNION}
      good_msg "Loading unionfs module"
      modprobe unionfs > /dev/null 2>&1
      if [ -n "${UNIONFS}" ]
      then
         CHANGESDEV=${UNIONFS}
         good_msg "mounting $CHANGESDEV to $MEMORY for unionfs support"
         mount -t auto $CHANGESDEV $MEMORY
         # mount tmpfs only in the case when changes= boot parameter was
         # empty or we were not able to mount the storage device
         ret=$?
         if [ "${ret}" -ne 0 ]
         then
            bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs"
            mount -t tmpfs tmpfs $MEMORY
         fi
         if [ "${CDROOT}" -eq '1' -a ! -f ${MEMORY}/livecd.unionfs  ]
         then
            umount $MEMORY
            bad_msg "failed to find livecd.unionfs file on $CHANGESDEV"
            bad_msg "create a livecd.unionfs file on this device if you wish to use it for unionfs"
            bad_msg "falling back to ramdisk based unionfs for safety"
            mount -t tmpfs tmpfs $MEMORY
         fi
      else
         good_msg "Mounting ramdisk to $MEMORY for unionfs support..."
         mount -t tmpfs tmpfs $MEMORY
      fi

      mkdir -p $CHANGES
      mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION}
      ret=$?
      if [ "${ret}" -ne 0 ]
      then
         die "Can't setup union ${UNION} in  directory!"
      fi
   else
      USE_UNIONFS_NORMAL=0
   fi
}
Back to top
View user's profile Send private message
scriptX
n00b
n00b


Joined: 05 Jul 2005
Posts: 69

PostPosted: Fri Apr 21, 2006 3:32 am    Post subject: Reply with quote

Code:

haktik livecds # qemu -cdrom gentoo-live.iso


QEMU:
Quote:

>> Copying read-write image contents to tmpfs
cp: etc: No such file or directory
cp: root: No such file or directory
cp: home: No such file or directory
cp: var: No such file or directory
>> No cdupdate.sh script found, skipping...
>> Booting (initramfs)...
chroot: cannot execute /bin/sh: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


Code:

haktik / # ls /bin | grep sh
bash
bashlogin
rbash
sh


I used the `genkernel initrd` method, if that's got anything to do with it...
Back to top
View user's profile Send private message
marciv
n00b
n00b


Joined: 22 Feb 2006
Posts: 8
Location: Berlin/Germany

PostPosted: Fri Apr 21, 2006 5:12 pm    Post subject: Reply with quote

Hi, please can someone help me...
I have now a new error,
my livecd stops at the end of the linuxrc script!
Code:

mount: /dev/hdb is not a valid block device
LiveCD found in /dev/hdc
NET: Registered protocol family 1
umount: /initrd: device is busy
umount: /initrd: device is busy

After :
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
exec /sbin/init ${CMDLINE}
EOF
it hangs without an error...

[Edit]
When i try to start /sbin/init manually i get this message:
Code:

init: timeout opening/writing control channel /dev/initctl



Ha! now my livecd works.
Without the nvidia drivers but it works...

[edit]
How do i get the nvidia drivers to work?
The nvidia-settings program says "The OpenGL extension 'GLX' is not suported by the X server"...blah blah
and glxinfo says: "error while loading shared libraries: libnvidia-tls.so.1: cannot handle TLS data"
I tested the CD on another PC with ati-drivers and it works, but why not the nvidia-driver?
[/edit]
_________________
Hardware: Athlon XP 2600+ Barton, Shuttle AN35N Ultra nforce2, 512 MB DDR DC Ram, Geforce 6800
OS: Gentoo Linux |Kernel 2.6.15-r1|KDE 3.4.3


Last edited by marciv on Sun Apr 23, 2006 1:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
scriptX
n00b
n00b


Joined: 05 Jul 2005
Posts: 69

PostPosted: Sun Apr 23, 2006 12:01 am    Post subject: Reply with quote

scriptX wrote:
Code:

haktik livecds # qemu -cdrom gentoo-live.iso


QEMU:
Quote:

>> Copying read-write image contents to tmpfs
cp: etc: No such file or directory
cp: root: No such file or directory
cp: home: No such file or directory
cp: var: No such file or directory
>> No cdupdate.sh script found, skipping...
>> Booting (initramfs)...
chroot: cannot execute /bin/sh: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


Code:

haktik / # ls /bin | grep sh
bash
bashlogin
rbash
sh


I used the `genkernel initrd` method, if that's got anything to do with it...


BBBBBUUUUUUMMMMMMPPPPPPPP kthnxbye
Back to top
View user's profile Send private message
Sunthief
n00b
n00b


Joined: 22 Dec 2005
Posts: 34
Location: Grand Forks, BC

PostPosted: Tue May 09, 2006 11:51 pm    Post subject: Reply with quote

Hey just wanted to say thanks for all your hard work!!

Now I have a little bit of a modified project. I am using the Lived layout to make some routers on 512MB flash Cards. Everything seems to be working up to a point. Here's my grub config:

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

title=Gentoo Linux
        root (hd0,0)
        kernel /boot/vmlinuz root=/dev/ram0 rw init=/linuxrc
        initrd /boot/initrd


I had to manually install Grub on the Memory card and it's an IDE card interface so its located at /dev/hda1.

I get the boot screen and initrd seems to work fine but I keep getting this error when it attempts to run the "/linuxrc" init script.

Code:

Failed to execute /linixrc. Attempting defaults...
Kernel Panic - not syncing: No init found.  Try passing init= option to kernal.


here is my linuxrc file:
Code:
#!/bin/sh
export PATH=/bin

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

echo "Mounting Image"

mount -t ext2 -r /dev/hda1 /cdrom > /dev/null 2>&1                                                     



echo "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

echo "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



Now if I change the init= option to /bin/sh, I can go into my initrd just fine, I can even go through the steps of the linuxrc file manually and get the sucker to start booting. I can also run the /linuxrc file with the ./linuxrc at the terminal, but it wont start booting. i suspect it has something to do with the CMDLINE variable not being correct (/bin/sh instead of /linuxrc) My questions are:

-Why can't it execute /linuxrc script, when I can execute it manually?
-How accurate is the error message, is it possible it's executing the linuxrc script and just failing somewhere in there?
-Got any ideas to help out my project?
_________________
Nick Muzzio
www.sunthief.com
------------------------------------------
Sun E-250 Enterprise Server
Dual 400Mhz 64bit Ultra Sparc CPU's
2GB Ram
Back to top
View user's profile Send private message
marciv
n00b
n00b


Joined: 22 Feb 2006
Posts: 8
Location: Berlin/Germany

PostPosted: Wed May 10, 2006 2:31 pm    Post subject: Reply with quote

Yes! I get it.
Now i have nvidia and ati drivers, reiser4, skas3 and a UML Slackware on my Live cd
Thx Veezi and Lepaca for the howto's.
_________________
Hardware: Athlon XP 2600+ Barton, Shuttle AN35N Ultra nforce2, 512 MB DDR DC Ram, Geforce 6800
OS: Gentoo Linux |Kernel 2.6.15-r1|KDE 3.4.3
Back to top
View user's profile Send private message
Sunthief
n00b
n00b


Joined: 22 Dec 2005
Posts: 34
Location: Grand Forks, BC

PostPosted: Wed May 10, 2006 4:47 pm    Post subject: Reply with quote

OK well I changed my linuxrc file a bunch and now I finally got it to boot. It looks like if the linuxrc doesn't run correctly you get that very generic error during booting. Hope maybe it will help someone else know where to look in the future.
_________________
Nick Muzzio
www.sunthief.com
------------------------------------------
Sun E-250 Enterprise Server
Dual 400Mhz 64bit Ultra Sparc CPU's
2GB Ram
Back to top
View user's profile Send private message
KingOfSka
n00b
n00b


Joined: 07 Jun 2005
Posts: 11

PostPosted: Sun Jun 04, 2006 12:10 pm    Post subject: Reply with quote

i followed the same guide from the wiki, step by step, but when i try to boot the livecd, the cdrom medium is found at /dev/iseries/vcd* , which is not true, so the booting process couldn't continue... any suggestion ?
Back to top
View user's profile Send private message
jayblanc54
n00b
n00b


Joined: 07 Jun 2006
Posts: 1
Location: Nancy, France

PostPosted: Wed Jun 07, 2006 10:55 pm    Post subject: Reply with quote

Hy,

It's gonna be the 6 image that I'm creating (genkernel and squashfs time, it's long) and I'm crazy ; it's not working.
Resume :
1. Installation Gentoo OK
2. Chroot OK
3. emerge system and tools OK
4. emerge gnome-light OK
5. configuring system OK
6. configuring kernel OK
7. clean OK
8. bootloader OK
9. final clean and build OK

Testing iso with vmplayer CRASH :

::Scanning for dm-mirror...dm-mirror loaded
>> Activating udev (green, i guess it's ok)
>> Making tmpfs for /newroot (green)
>> No bootable medium found. Waiting for new devices (yellow)
!! Could not find CD to boot, something else needed !
>> Determining root device (green)
!! The root block device is unspecified or not detected.
Please specify a device to boot, or "shell" for a shell...

I don't understand where I made a mistake. I search the web for explanation, read this thread but without having answear. I'm trying to use unionfs instead of tmpfs but I don't think problem come from here.

my question if anybody could help me :

1. At what time of boot process this error occures ? (kernel loading, root filesystem switching, ...) As I'm not a geek of booting process, I can't figure out what's happening and where to search...

2. I read the note : Writeable /home directories with genkernel and unionfs in the How to TALK and i don't kow how to create the livecd.unionfs ?? Actually I used mksquashfs with a file named livecd.unionfs but I'm not sure. I read the exemple of Union-fs site and it doesn't seem to work like that but I don't find how to create an image of a directory (is mounting a directory with unionfs and adding branch to it is the way to create the livecd image ?)

3. What is exactly the difference between /dev/loop0 in etc/fstab and the /dev/ram0 in grub config ?

you and your help is really welcome :-)
Back to top
View user's profile Send private message
scriptX
n00b
n00b


Joined: 05 Jul 2005
Posts: 69

PostPosted: Wed Jul 19, 2006 6:20 pm    Post subject: Reply with quote

jayblanc54 wrote:

::Scanning for dm-mirror...dm-mirror loaded
>> Activating udev (green, i guess it's ok)
>> Making tmpfs for /newroot (green)
>> No bootable medium found. Waiting for new devices (yellow)
!! Could not find CD to boot, something else needed !
>> Determining root device (green)
!! The root block device is unspecified or not detected.
Please specify a device to boot, or "shell" for a shell...


I had this exact problem, it turns out that I didn't compile some options into the kernel (they were modules). I changed a few options so I don't know which ones they were exactly, but I think it was that I didn't compile the ISO9660 filesystem into the kernel (Filesystems -> CD-ROM/DVD Filesystems -> ISO9660 -> "ISO 9660 CDROM file system support"). If that doesn't fix it, go through and look for options that regard a CD/DVD or CD/DVD drive, etc.

EDIT: Oh.... rather old post :p
Back to top
View user's profile Send private message
JasonB87
n00b
n00b


Joined: 25 Aug 2006
Posts: 11

PostPosted: Fri Aug 25, 2006 8:31 pm    Post subject: I've been driven to no ends! Reply with quote

Alright I've built my livecd and am testing it out on vmware. Grub launches and loads the initrd and then I run into this error

No filesystem could Mount root, tried: ext3 ext2 squashfs msdos vfat iso9660 ntfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)


Here is my linuxrc script:

Code:
#!/bin/sh
export PATH=/bin

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

# Mount option
# mount -t iso9660 -r /dev/hdc /cdrom > /dev/null 2>&1

# Mount CD device
CDROM=""
for x in hda hdb hdc hdd
do
  mount -t iso9660 -r /dev/${x} /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/livecd.squashfs /newroot > /dev/null 2>&1
mount -t tmpfs -o size=32m none /newroot/var > /dev/null 2>&1
mount -t tmpfs -o size=32m none /newroot/etc > /dev/null 2>&1
mount -t tmpfs -o size=32m none /newroot/tmp > /dev/null 2>&1
mount -t tmpfs -o size=32m none /newroot/root > /dev/null 2>&1
cd /newroot/var && tar xpf /cdrom/files/var.tar > /dev/null 2>&1
cd /newroot/etc && tar xpf /cdrom/files/etc.tar > /dev/null 2>&1
cd /newroot/root && tar xpf /cdrom/files/root.tar > /dev/null 2>&1

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


My other question is do i leave /dev/loop0 mount at /mnt/initrd?
Any clues to what i'm doing wrong?
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Sat Aug 26, 2006 10:46 am    Post subject: Reply with quote

Sorry for crossposting :) The following is taken from Talk page, I have the same problem:

Quote:
Problems with Symbolic Links

After "Copying read-write image ...", when, I think, the linuxrc script starts to run, it starts giving me a LOT of errors in the form : "ln: creating symbolic link `/var/lib/init.d/softscripts.new/clock` to `/etc/init.d/clock`: No such file or directory". The same goes to all the files in init.d, such as hostname, domainname, net.lo etc... Does anyone have a clue as to what is the problem? I tried to switch to init=/bin/sh instead of the linuxrc and it still boots like this. I followed the instructions on the site exactly as it is written and I fail to see where the problem is. can anyone please help?

* [mapelo] I have the same problem, and all files and directories in tmpfs (etc,var,...) are NOT write access, only read access.


Is there any way to solve it?
www.technoportal.pl/photo/live.jpg
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Sat Aug 26, 2006 12:53 pm    Post subject: Reply with quote

ok, I solved it by adding livecd-tools to my livecd source
Back to top
View user's profile Send private message
rickvernam
Guru
Guru


Joined: 09 Jul 2004
Posts: 313

PostPosted: Fri Sep 08, 2006 9:01 pm    Post subject: Reply with quote

followed the how-to as closely as I could. I get a kernel panic when trying to execute /linuxrc

(fyi: I'm typing this out from qemu...)
Code:
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 8192KiB [1 disk] into ram disk... done.
input: ImExPS/2 Generic Explorer Mouse as /class/input/input1
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 112k freed
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.


linuxrc is copied identically from the OPs how-to...
(all file system references below are while chrooted in...)
Code:

mutt / # stat /mnt/initrd/linuxrc
  File: `/mnt/initrd/linuxrc'
  Size: 972             Blocks: 2          IO Block: 4096   regular file
Device: 702h/1794d      Inode: 18          Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)


If I press 'e' while in grub menu and edit the kernel's init parameter to '/bin/sh' I get the same error as above, but instead of not being able to execute /linuxrc, it says it is unable to execute /bin/sh ... however
Code:
mutt / # stat /mnt/initrd/bin/sh
  File: `/mnt/initrd/bin/sh'
  Size: 648400          Blocks: 1276       IO Block: 4096   regular file
Device: 702h/1794d      Inode: 19          Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)


/boot/grub/grub.conf
Code:

default 0
timeout 25

title=Live CD
 root (cd)
 kernel (cd)/boot/vmlinuz video=vesafb-tng:mtrr,ywrap,1024x768@60 root=/dev/ram0 rw init=/linuxrc cdroot
 initrd (cd)/boot/initrd


Kernel Config:
In Drivers/Block devices
Code:
<*> Loopback device support
<*> Ram disk support
(1)      Default number of RAM disks
(49152) Default RAM disk size (kbytes)
[*]  Inital RAM filesystem and RAM disk (initramfs/initrd) suport


In File systems
Code:
<*> Second extended fs support
<*> ROM file system support


In File systems/CD-ROM Filesystems
Code:
<*> ISO 9660 CDROM file system support
[*]    Microsoft Joliet CDROM extensions
[*]    Transparent decompression extension


In File systems/Miscellaneous filesysems (I have tried both with and without the options for memory-constrained systems)
Code:
<*> SquashFS 3.0 - Squashed file system support
[*]    Additional options for memory-constrained systems
(3)        Number of fragments cached (NEW)
[*]        Use Vmalloc rather than Kmalloc
Back to top
View user's profile Send private message
rickvernam
Guru
Guru


Joined: 09 Jul 2004
Posts: 313

PostPosted: Thu Sep 14, 2006 11:04 pm    Post subject: Reply with quote

rickvernam wrote:
followed the how-to as closely as I could. I get a kernel panic when trying to execute /linuxrc

(fyi: I'm typing this out from qemu...)
Code:
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 8192KiB [1 disk] into ram disk... done.
input: ImExPS/2 Generic Explorer Mouse as /class/input/input1
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 112k freed
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.


After being stumped for a week, I finally figured it out.

but first, a bit of background.
I had, as instructions said, copied /bin/sh /bin/cat ...etc to the initrd fs.
Also, I did ldd /bin/sh, copied the resulting stuff from lib... and the same for everything in bin.

The idea was to copy ALL of bin and ALL of lib into the initrd. While I had to omit some of the clearly unneeded things from bin, it all fit in a 7MB initrd.
And most importantly, it works!!

So, clearly the problem was that I was not careful enough when copying the lib stuff specified by ldd.
What a waste of a perfectly good week. sheesh.
Back to top
View user's profile Send private message
psychocandy
Apprentice
Apprentice


Joined: 09 Nov 2006
Posts: 192

PostPosted: Fri Nov 24, 2006 12:02 pm    Post subject: Re: [mini-HowTo] Gentoo Linux LiveCD for Dummies! Reply with quote

[quote="veezi"]
Code:
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size \
4 -boot-info-table -iso-level 4 -hide boot.catalog -o ~/livecd.iso target/


OK. So -b is to produce a bootable El Torito CD....

I think its -B for sparc but where do I get the boot image from ???
Back to top
View user's profile Send private message
bobber205
Guru
Guru


Joined: 23 Aug 2006
Posts: 561
Location: Oregon

PostPosted: Tue Dec 12, 2006 6:08 pm    Post subject: Reply with quote

It would be nice to have a tutorial that explains how to make a livecd from windows xp. All the ones I can find already assume you have at least some kind of linux distro installed or usually gentoo already.
Back to top
View user's profile Send private message
mrosack
n00b
n00b


Joined: 02 Dec 2006
Posts: 5

PostPosted: Sun Dec 30, 2007 2:24 pm    Post subject: Reply with quote

rickvernam wrote:

After being stumped for a week, I finally figured it out.

but first, a bit of background.
I had, as instructions said, copied /bin/sh /bin/cat ...etc to the initrd fs.
Also, I did ldd /bin/sh, copied the resulting stuff from lib... and the same for everything in bin.

The idea was to copy ALL of bin and ALL of lib into the initrd. While I had to omit some of the clearly unneeded things from bin, it all fit in a 7MB initrd.
And most importantly, it works!!

So, clearly the problem was that I was not careful enough when copying the lib stuff specified by ldd.
What a waste of a perfectly good week. sheesh.


I had EXACTLY they same problem you did, but I found a different fix without copying everything into bin/lib. This might be obvious, but it took me a day to figure it out - if you have a 64 bit system, copy everything into /lib64 and create a symlink /lib pointing to /lib64. Most of my binaries were linked to the lib64 directory, so it couldn't find them on boot because I just had a /lib directory in my initrd.
Back to top
View user's profile Send private message
sch
n00b
n00b


Joined: 07 Jul 2005
Posts: 10
Location: Zielona Góra / POLAND

PostPosted: Mon Jan 21, 2008 12:32 am    Post subject: Reply with quote

Hi, I try to run Xorg+KDE on my livecd, but i get this error: (no space Ieft on device)

Code:
x Activating (possibIe) swap [ oX ]
 x Setting up dM-crypt Mappings ... [ oX ]
 x Setting systeM cIocX using the hardware cIocX [LocaI Ti Me] [ oX ]
 x Configuring XerneI paraMeters [ oX ]
 x Updating environMent [ oX ]
 x CIeaning /var/IocX, /var/run [ oX ]
 x Updating inittab .. [ oX ]
 /sbin/rc: Iine 512: echo: write error: Ho space Ieft on device
 x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.XIYtUF8'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]
 x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.XbPve2u'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]

 x Error running '/sbin/depscan.sh'!
 x PIease correct any probIeMs above.
 /sbin/rc: Iine 565: echo: write error: Ho space Ieft on device
 x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.XiLbXcU'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]


x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.XbPve2u'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]

 x Error running '/sbin/depscan.sh'!
 x PIease correct any probIeMs above.
 /sbin/rc: Iine 565: echo: write error: Ho space Ieft on device
 x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.XiLbXcU'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]

 x Error running '/sbin/depscan.sh'!
 x PIease correct any probIeMs above.
 IHIT: Entering runIeveI: 3
 x Caching service dependencies ...
 gawX: /Iib/rcscripts/awX/gendepends.awX:537: (FILEHAME=- FHR=158) fataI: print t
 o ''/var/Iib/init.d/treecache.X5iFaOp'' faiIed (no space Ieft on device)
 x FaiIed to cache service dependencies [ !! ]

 x Error running '/sbin/depscan.sh'!
 x PIease correct any probIeMs above.

 (none) root #





I use
Code:
rc-update add mkxf86config default

and
Code:
rc-update add autoconfig default


But, when i write hwsetup & mkxf86cinfig, startx works.
startkde write error: no space Ieft on device

What do i wrong, or what i should do?
Thanks! Sorry, my english isn`t very good.. :oops:
_________________
Gentoo Linux x86_64 [2.6.23-gentoo-r3] :: KDE 3.5.8 :: GCC4.2.2

---
Lepiej siedzieć cicho i udawać idiotę,
niż się odezwać i rozwiać wszelkie wątpliwości..
Back to top
View user's profile Send private message
Shamus397
Apprentice
Apprentice


Joined: 03 Apr 2005
Posts: 218
Location: Ur-th

PostPosted: Wed Feb 20, 2008 1:59 am    Post subject: Reply with quote

Remove mkxf86config from default. Autoconfig will run it automatically.


NOTE TO SELF (for future reference):

Add noresume to the kernel argument list to prevent spurious
Code:
ls: : No such file or directory
messages from showing up during boot.
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Mon Apr 14, 2008 9:56 pm    Post subject: Reply with quote

My turn to bump an old topic.

Seeing as this guide is older than written word itself, I've had to modify it a lot to get it working for me.

Anyways, Im having a problem mounting the CD-ROM drive as part of linuxrc's script:
Code:
* Executing linuxrc
* Mounting /proc
* Unmounting /proc
* Mounting optical device
mount: /dev/hda is not a valid block device
mount: /dev/hdb is not a valid block device
mount: /dev/hdc is not a valid block device
mount: /dev/hdd is not a valid block device
*** NO optical device found, dropping a shell ***
sh-3.2# _


Im really not sure why Im getting these errors. My kernel (2.6.24-gentoo-r4) is (as far as I know) setup properly with the right items built in, rather than modules. My linuxrc file looks like this:
Code:
#!/bin/sh
export PATH=/bin

# Get kernel CMDLINE
echo " * Mounting /proc"
mount -t proc none /proc
CMDLINE=`cat /proc/cmdline`
echo " * Unmounting /proc"
umount /proc

# Mount CD device
echo " * Mounting optical device"
CDROM=""
for x in hda hdb hdc hdd cdrom
do
  mount -t iso9660 -r /dev/${x} /cdrom
  if [ "$?" = "0" ]
  then
    CDROM="${x}"
    break
  fi
done

# CD no found
if [ "${CDROM}" == "" ]
then
  echo " *** NO optical device found, dropping a shell ***"
  exec /bin/sh
  exit
fi

# Mount root and create read-write directories
echo " * Mounting root file system"
mount -t squashfs -o loop /cdrom/files/source.img /new > /dev/null 2>&1
echo " * Mounting /var"
mount -t tmpfs -o size=32m none /new/var > /dev/null 2>&1
echo " * Mounting /etc"
mount -t tmpfs -o size=32m none /new/etc > /dev/null 2>&1
echo " * Mounting /tmp"
mount -t tmpfs -o size=32m none /new/tmp > /dev/null 2>&1
echo " * Mounting /root"
mount -t tmpfs -o size=32m none /new/root > /dev/null 2>&1
echo " * Filling directories"
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
echo " * Attempting pivot"
cd /new
pivot_root . newroot
exec chroot . /bin/sh <<- EOF >dev/console 2>&1
echo " * Starting init"
exec /sbin/init ${CMDLINE}
EOF


Anyone with advice - feel free to help :)
Back to top
View user's profile Send private message
Jupiter1TX
Guru
Guru


Joined: 24 Feb 2006
Posts: 546
Location: 3rd Rock

PostPosted: Fri Apr 18, 2008 9:07 pm    Post subject: Reply with quote

I also am having a problem with linuxrc
Code:

mounting squashfs file system
mount:mounting /dev/loop0 on /newroot/mnt/livecd failed:invalid argument
failed to $1; falling back to the shell

_________________
Core i7 920 D0 | Asus P6T DLX | Patriot Viper 1600 6GB | Antec Quattro 850W
Geforce 8800GTX OC2 768MB | Dell 22" LCD | Koolance Exos2/Swiftech GTZ
GCC 4.6.1 | 3.7.x-geek | Xorg-7.4-x | KDE-4.7.x | Compiz
Back to top
View user's profile Send private message
bob doe
Apprentice
Apprentice


Joined: 11 Jun 2007
Posts: 207

PostPosted: Tue Jun 10, 2008 2:35 pm    Post subject: Reply with quote

post your linuxrc and init files (btw, if you use an initramfs you dont need linuxrc afaik)
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 ... 19, 20, 21
Page 21 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