Re: [ILUG] mkinitrd and non-RH kernels

From: Paul Jakma (paulj at domain alphyra.ie)
Date: Wed 04 Sep 2002 - 15:59:46 IST


On Wed, 4 Sep 2002, Waider wrote:

> Outta curiosity, can you strace losetup?

did that, it fails on an ioctl on the loop device.

even stranger, using mount to mount files as loopback works.
(obviously with files that already contain an fs image)

however, mkinitrd constructs a filesystem image from scratch, so..

> I mean, I'm sure you've build the loop device either into the kernel
> or as a module; it'd be interesting to see where else this can fail.

# bash -x mkinitrd /tmp/i.img 2.4.18-10
[snip]
+ dd if=/dev/zero of=/tmp/initrd.img.tIUezw bs=1k count=3000
+ '[' -e /dev/.devfsd ']'
+ LOOPDEV=/dev/loop/
+ losetup /dev/loop/0 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/1 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/2 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/3 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/4 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/5 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/6 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/7 /tmp/initrd.img.tIUezw
+ losetup /dev/loop/8 /tmp/initrd.img.tIUezw

so lets recreate that..

# dd if=/dev/zero of=/tmp/initrd.img.tIUezw bs=1k
count=3000
3000+0 records in
3000+0 records out
# losetup /dev/loop0
loop: can't get info on device /dev/loop0: No such device or address
        (as expected - device isnt setup)
# losetup /dev/loop0 /tmp/initrd.img.tIUezw
ioctl: LOOP_SET_FD: Invalid argument
# strace losetup /dev/loop0 /tmp/initrd.img.tIUezw
[snippage]
open("/tmp/initrd.img.tIUezw", O_RDWR|O_LARGEFILE) = 3
open("/dev/loop0", O_RDWR|O_LARGEFILE) = 4
mlockall(MCL_CURRENT|MCL_FUTURE) = 0
ioctl(4, 0x4c00, 0x3) = -1 EINVAL (Invalid argument)
dup(2) = 5
fcntl64(0x5, 0x3, 0x5, 0) = 32770
fstat64(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4018f000
_llseek(5, 0, 0xbfffef00, SEEK_CUR) = -1 ESPIPE (Illegal seek)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(5, "ioctl: LOOP_SET_FD: Invalid argu"..., 37ioctl: LOOP_SET_FD: Invalid argument) = 37
close(5) = 0
munmap(0x4018f000, 4096) = 0
_exit(1) = ?

anyway, i've tried this on several boxes with non-RH kernels now, same
result.

luckily /me has also realised where to find a fresh RH box to mkinitrd
with.

> Waider.

regards,

-- 
Paul Jakma	Sys Admin	Alphyra
	paulj at domain alphyra.ie
Warning: /never/ send email to spam at domain dishone.st or trap at domain dishone.st


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:39 GMT