LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 03-24-2011, 12:48 AM   #1
lazardo
Member
 
Registered: Feb 2010
Location: SF Bay Area
Posts: 75

Rep: Reputation: Disabled
mkinitrd library load failure, '-s', 13.37 / current / RC3


mkinitrd seems to be failing to load some libraries OR I'm being stupid and can't see it.
Code:
bash-4.1# echo $x
virtio_blk:virtio_net:virtio_balloon:virtio:virtio_pci:virtio_ring:virtio-rng:virtio_console
bash-4.1# mkinitrd -k 2.6.37.4 -c -o initrd_2.6.37.4 -s initrd_2.6.37.4-tree -f ext4 -r /dev/sda1 -m ext4:$x
OK: /lib/modules/2.6.37.4/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/2.6.37.4/kernel/fs/mbcache.ko added.
OK: /lib/modules/2.6.37.4/kernel/fs/ext4/ext4.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_ring.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/block/virtio_blk.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/net/virtio_net.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_balloon.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_pci.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/char/hw_random/virtio-rng.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/char/virtio_console.ko added.
cp: with --parents, the destination must be a directory
Try `cp --help' for more information.
cp: with --parents, the destination must be a directory
Try `cp --help' for more information.
cp: with --parents, the destination must be a directory
Try `cp --help' for more information.
4016 blocks
/boot/initrd_2.6.37.4 created.
Be sure to run lilo again if you use it.
The mkinitrd section that seems to be the source:
Code:
   ( 
     cd $SOURCE_TREE
     for i in $(find -L . -type l -exec readlink -m /{} \; 2>/dev/null ) ; do
       cp -P --parents ${i} $SOURCE_TREE
     done 
   )
The missing libraries are 'libnsl-2.13.so', 'libm-2.13.so' and 'libc-2.13.so'. Running the same command without '-s' works. mkinitrd-1.4.6-x86_64-7

Cheers,

Last edited by lazardo; 03-24-2011 at 12:51 AM. Reason: clarification
 
Old 03-24-2011, 05:42 AM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 2,377

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Although the man page doesn't explicitly say so, it looks like the mkinitrd script relies on the -s argument being an absolute path.

Input validation is a little lacking in this script. It really ought to either canonicalize it with readlink or throw out an error and abort if a relative path is passed.
 
Old 03-24-2011, 03:03 PM   #3
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 248

Rep: Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507
Quote:
Originally Posted by GazL View Post
Although the man page doesn't explicitly say so, it looks like the mkinitrd script relies on the -s argument being an absolute path.

Input validation is a little lacking in this script. It really ought to either canonicalize it with readlink or throw out an error and abort if a relative path is passed.
Another thing gets canonicalized.

Thanks, GazL!
 
Old 03-24-2011, 03:04 PM   #4
lazardo
Member
 
Registered: Feb 2010
Location: SF Bay Area
Posts: 75

Original Poster
Rep: Reputation: Disabled
[PATCH] mkinitrd-1.4.6-x86_64-7 in 13.37 current RC3

Quote:
Originally Posted by GazL View Post
Although the man page doesn't explicitly say so, it looks like the mkinitrd script relies on the -s argument being an absolute path.

Input validation is a little lacking in this script. It really ought to either canonicalize it with readlink or throw out an error and abort if a relative path is passed.
Thanks to GazL hint:

Code:
--- /sbin/mkinitrd	2011-03-21 16:04:57.000000000 -0700
+++ ./mkinitrd.patch	2011-03-24 12:37:58.863271061 -0700
@@ -327,6 +327,9 @@
       ;;
     -s)
       SOURCE_TREE="$2"
+      if [ ! "$(echo $SOURCE_TREE | cut -b1)" = "/" ]; then
+        SOURCE_TREE=$(pwd)/$SOURCE_TREE
+      fi
       shift 2
       ;;
     -u)
Eliminates need for '-s' argument absolute path in mkinitrd-1.4.6-x86_64-7.

After thought for side-effect readers: In the real virtual world, only the 'virtio_blk' module is required for 'mkinitrd' since [in this case] the root device uses it.

Code:
bash-4.1$ sudo ./mkinitrd.patch -k 2.6.37.4 -c -f ext4 -r /dev/sda1 \
> -m ext4:virtio_blk:virtio_net:virtio_balloon:virtio:virtio_pci:virtio_ring:virtio-rng:virtio_console \
> -o test4 -s test4-tree
OK: /lib/modules/2.6.37.4/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/2.6.37.4/kernel/fs/mbcache.ko added.
OK: /lib/modules/2.6.37.4/kernel/fs/ext4/ext4.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_ring.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/block/virtio_blk.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/net/virtio_net.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_balloon.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/virtio/virtio_pci.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/char/hw_random/virtio-rng.ko added.
OK: /lib/modules/2.6.37.4/kernel/drivers/char/virtio_console.ko added.
9205 blocks
/boot/test4 created.
Be sure to run lilo again if you use it.

# list is complete
bash-4.1$ find test4-tree -name \*.so
test4-tree/lib64/libnsl-2.13.so
test4-tree/lib64/libnss_compat-2.13.so
test4-tree/lib64/libnss_files-2.13.so
test4-tree/lib64/libm-2.13.so
test4-tree/lib64/ld-2.13.so
test4-tree/lib64/libc-2.13.so

Last edited by lazardo; 03-25-2011 at 01:04 AM. Reason: virtio clarification
 
Old 03-24-2011, 03:42 PM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 2,377

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Quote:
Originally Posted by volkerdi View Post
Another thing gets canonicalized.

Thanks, GazL!

Just be careful not to hit the shift key when typing that first letter 'c'. Wouldn't want to see Slackware accidentally Ubuntized due to a typo!
 
  


Reply

Tags
booting, current, mkinitrd, oops


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware-current: mkinitrd -c -m ahci:ext3 -k 2.6.36.1 failure burdi01 Slackware 10 12-28-2010 02:22 PM
Won't load Gnome on rc3.d codex73 Linux - General 2 04-25-2008 07:21 AM
Slackware-current and mkinitrd-1.3.2 prontxo Slackware 4 04-11-2008 11:18 AM
Slackware-current and mkinitrd-1.3.1 prontxo Slackware 8 03-30-2008 06:43 AM
php5, libmysqlclient and slackware-current(RC3) BCarey Slackware 5 09-16-2006 12:04 PM


All times are GMT -5. The time now is 06:13 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration