Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cleaning up boot errors / udev in intramfs?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 391

PostPosted: Sat Apr 14, 2012 3:51 am    Post subject: Cleaning up boot errors / udev in intramfs? Reply with quote

Hi all,

I have been trying to get rid of boot error messages. So far, I am working on the following:

Code:

The link /dev/datavg/home should have been created by udev, but it was not found.  Falling back to direct link creation.


I can't seem to figure out why it does this. My fstab uses /dev/mapper/datavg-home to mount the directories. My guess it has something to do with my second question here - using udev in an initramfs

I have also bee trying to do that. My init script looks like this:

Code:
 
#!/bin/busybox sh

uuidlabel_root() {
   for cmd in $(cat /proc/cmdline) ; do
      case $cmd in
      root=*)
         dev=${cmd#root=}
         type=${dev%%=*}
         echo "Mounting root fs..."
         if [ $type = "LABEL" ] || [ $type = "UUID" ] ; then
            mount -o ro $(findfs "$dev") /mnt/root
         else
            mount -o ro ${dev} /mnt/root
         fi
         ;;
      esac
   done
}

rescue_shell() {
   echo "$@"
   echo "Error - Dropping into RESCUE SHELL"
   busybox --install -s
   exec /bin/sh
}

load_modules() {
   MODULES="raid1.ko"
   MOD_PATH="/lib/modules"
   for MODULE in ${MODULES} ; do
      insmod -f ${MOD_PATH}/${MODULE}
   done
}

check_filesystem() {
    # most of code coming from /etc/init.d/fsck

    local fsck_opts= check_extra= RC_UNAME=$(uname -s)

    # FIXME : get_bootparam forcefsck
    if [ -e /forcefsck ]; then
        fsck_opts="$fsck_opts -f"
        check_extra="(check forced)"
    fi

    echo "Checking local filesystem $check_extra : $1"

    if [ "$RC_UNAME" = Linux ]; then
        fsck_opts="$fsck_opts -C0 -T"
    fi

    trap : INT QUIT

    # using our own fsck, not the builtin one from busybox
    /sbin/fsck ${fsck_args--p} $fsck_opts $1

    case $? in
        0)      return 0;;
        1)      echo "Filesystem repaired"; return 0;;
        2|3)    if [ "$RC_UNAME" = Linux ]; then
                        echo "Filesystem repaired, but reboot needed"
                        reboot -f
                else
                        rescue_shell "Filesystem still have errors; manual fsck required"
                fi;;
        4)      if [ "$RC_UNAME" = Linux ]; then
                        rescue_shell "Fileystem errors left uncorrected, aborting"
                else
                        echo "Filesystem repaired, but reboot needed"
                        reboot
                fi;;
        8)      echo "Operational error"; return 0;;
        12)     echo "fsck interrupted";;
        *)      echo "Filesystem couldn't be fixed";;
    esac
    rescue_shell
}



#Mount /proc and /sys
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev


#Do my stuff!
#rescue_shell "FORCED RESCUE SHELL"

#udevd
if [ -x /sbin/udevd ]; then
   UDEV_PATH=/sbin
else
   UDEV_PATH=/lib/udev
fi

${UDEV_PATH}/udevd --daemon --resolve-names=never
/usr/bin/udevadm trigger
/usr/bin udevadm settle

#Activate raid arrays
if [ -e /etc/mdadm.conf ]; then mdadm -As ; fi
if [ -x /sbin/lvm ]; then lvm vgchange -a y > /dev/null; fi
#mount -t ext4 -o ro /dev/mapper/datavg-usr /mnt/root/usr || rescue_shell

uuidlabel_root || rescue_shell "Error in uuidlabel_root"

#space seperated list of mountpoints to find in fstab
mountpoints="/usr"
ln -s /mnt/root/etc/fstab /etc/fstab


# ... to check filesystems and mount our devices.
for m in $mountpoints ; do
    check_filesystem $m

    echo "Mounting $m"
    # mount the device and ...
    mount $m || rescue_shell "Error while mounting $m"

    # ... move the tree to its final location
    mount --move $m "/mnt/root"$m || rescue_shell "Error while moving $m"
done

echo "Done - Switching to real root..."


/usr/bin/killall -w ${UDEV_PATH}/udevd

#Clean up
umount /proc
umount /sys
umount /dev


exec switch_root /mnt/root /sbin/init


and my initramfs structure
Code:

.
./init
./bin
./bin/busybox
./sbin
./sbin/fsck.ext4
./sbin/fsck
./sbin/mdadm
./sbin/blkid
./sbin/lvm
./lib64
./lib64/libblkid.so.1
./lib64/ld-linux-x86-64.so.2
./lib64/udev
./lib64/udev/rules.d
./lib64/udev/rules.d/95-dm-notify.rules
./lib64/udev/rules.d/95-upower-battery-recall-toshiba.rules
./lib64/udev/rules.d/78-sound-card.rules
./lib64/udev/rules.d/97-bluetooth-hid2hci.rules
./lib64/udev/rules.d/75-net-description.rules
./lib64/udev/rules.d/60-persistent-storage.rules
./lib64/udev/rules.d/60-persistent-v4l.rules
./lib64/udev/rules.d/60-persistent-input.rules
./lib64/udev/rules.d/60-apcupsd.rules
./lib64/udev/rules.d/60-persistent-storage-tape.rules
./lib64/udev/rules.d/90-network.rules
./lib64/udev/rules.d/61-accelerometer.rules
./lib64/udev/rules.d/95-upower-battery-recall-lenovo.rules
./lib64/udev/rules.d/69-dm-lvm-metad.rules
./lib64/udev/rules.d/95-upower-battery-recall-gateway.rules
./lib64/udev/rules.d/95-upower-hid.rules
./lib64/udev/rules.d/50-udev-default.rules
./lib64/udev/rules.d/70-libgphoto2.rules
./lib64/udev/rules.d/97-bluetooth.rules
./lib64/udev/rules.d/60-persistent-serial.rules
./lib64/udev/rules.d/95-upower-battery-recall-fujitsu.rules
./lib64/udev/rules.d/95-upower-csr.rules
./lib64/udev/rules.d/75-tty-description.rules
./lib64/udev/rules.d/10-virtualbox.rules
./lib64/udev/rules.d/40-hplip.rules
./lib64/udev/rules.d/90-alsa-restore.rules
./lib64/udev/rules.d/41-libsane.rules
./lib64/udev/rules.d/99-fuse.rules
./lib64/udev/rules.d/90-pulseaudio.rules
./lib64/udev/rules.d/99-nvidia.rules
./lib64/udev/rules.d/13-dm-disk.rules
./lib64/udev/rules.d/95-upower-wup.rules
./lib64/udev/rules.d/95-keyboard-force-release.rules
./lib64/udev/rules.d/75-probe_mtd.rules
./lib64/udev/rules.d/95-keymap.rules
./lib64/udev/rules.d/95-upower-battery-recall-ibm.rules
./lib64/udev/rules.d/42-usb-hid-pm.rules
./lib64/udev/rules.d/86-hpmud_plugin.rules
./lib64/udev/rules.d/80-udisks.rules
./lib64/udev/rules.d/95-udev-late.rules
./lib64/udev/rules.d/40-gentoo.rules
./lib64/udev/rules.d/95-upower-battery-recall-dell.rules
./lib64/udev/rules.d/11-dm-lvm.rules
./lib64/udev/rules.d/60-cdrom_id.rules
./lib64/udev/rules.d/56-hpmud_add_printer.rules
./lib64/udev/rules.d/64-md-raid.rules
./lib64/udev/rules.d/60-persistent-alsa.rules
./lib64/udev/rules.d/75-cd-aliases-generator.rules
./lib64/udev/rules.d/10-dm.rules
./lib64/udev/rules.d/80-drivers.rules
./lib64/udev/rules.d/70-udev-acl.rules
./lib64/udev/rules.d/75-persistent-net-generator.rules
./lib64/udev/rules.d/56-hpmud_support.rules
./lib64/udev/rules.d/80-udisks2.rules
./lib64/udev/hid2hci
./lib64/udev/udevd
./lib64/udev/cdrom_id
./lib64/udev/ata_id
./lib64/udev/scsi_id
./lib64/libusb-0.1.so.4
./lib64/libext2fs.so.2
./lib64/librt.so.1
./lib64/libuuid.so.1
./lib64/libdl.so.2
./lib64/libe2p.so.2
./lib64/libcom_err.so.2
./lib64/libc.so.6
./lib64/libncursesw.so.5
./lib64/libz.so.1
./lib64/libpthread.so.0
./sys
./dev
./dev/null
./dev/zero
./dev/console
./lib
./etc
./etc/udev
./etc/udev/rules.d
./etc/udev/rules.d/70-persistent-net.rules
./etc/udev/rules.d/66-kpartx.rules
./etc/udev/rules.d/10-local.rules
./etc/udev/rules.d/65-multipath.rules
./etc/udev/rules.d/kino.rules
./etc/udev/rules.d/70-persistent-cd.rules
./etc/udev/udev.conf
./etc/mdadm.conf
./mnt
./mnt/root
./usr
./usr/bin
./usr/bin/killall
./usr/bin/udevadm
./usr/bin/nano
./usr/lib64
./usr/lib64/libmagic.so.1
./usr/lib64/libudev.so.0
./usr/lib64/libkmod.so.2
./root
./root/.ash_history
./proc


I did just copy stuff which may not be necessary, but I figure I can clean it up once I get it working - it is still a work in progress. Anyway, I can't seem to get udevd to start - I always get the following error:
Code:

udevd bind failed - no such file or directory

I have dropped into a shell during iniramfs above and tried running the command at the shell - it doesn't gove a whole lot of info, like what directory/node it is trying to bind to, even after I changed the log level to debug in udevd.conf and redirected the ouptut to the console. Any suggedtions on what this is and how to use this? It seems like automaticallay made ones from dracut use udev, but I can't seem to get it all to work together. In fact, I used to use dracut until I upgraded to udev-182 and it basically stopped mounting my /usr, which resides on an lvm on raid partition, so I decided to hack my own together and try to learn a little something.

Anyway, really just a learning question - not critical as I still boot into my system. The only other problem I have noticed is when I shut down, start-stop daemon finds no udevd process and there is some trouble unmounting home, but it seems to recover. If anyone has suggestions on how to fix this, I'd be appreciative. I have been googling, but haven't found a whole lot of info on my particular problems. Some pointers on where to look / which log files to dig info out of would also be helpful.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
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