[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#340508: missing modules on s390/s390x (mkinitramfs for 2.6.14)



(CC to d-s390 as there may be people who can provide additional 
information.)

On Friday 02 December 2005 22:58, you wrote:
> can you please retest if that device gets created?

OK. I've done some testing and made some progress.

First, the following modules need to be available in the initrd:
- dasd_eckd_mod
- dasd_fba_mod
- dasd_mod
- dcssblk

It I add these in /etc/mkinitramfs/modules, they will of course be loaded, 
but the dasd devices are not created. A boot results in:

<snip from console>
Loading, please wait...
Begin: Initializing /dev ...
Done.
Begin: Loading modules ...
Done.
Begin: Running /scripts/init-premount ...
Done.
Begin: Mounting root file system ...
Begin: Running /scripts/local-top ...
Done.
ALERT  /dev/dasda1 does not exist. Dropping to a shell
</snip>

Reason is that dasd_mod needs an option to tell it which dasd devices 
should be used. I've written a script that creates a config file for 
modprobe in /etc/modprobe.d/.
The script is a first approximation and probably needs cleaning up. 
Background info and some possible issues are documented in the script.

The script was added in /etc/mkinitramfs/hooks/
During reconfiguration of the kernel-image, I got the following error.
<snip>
$ sudo dpkg-reconfigure linux-image-2.6.14-2-s390
Using /usr/sbin/mkinitramfs to build the ramdisk.
Full list of probed ramdisk generating tools :
/usr/sbin/mkinitrd /usr/sbin/mkinitrd.yaird /usr/sbin/mkinitramfs.
ln: creating symbolic link `/tmp/mkinitramfs_Znxcw0//etc/modprobe.d/dasd'
    to `/tmp/initramfs_dasd': File exists
</snip>

I used 'set -x' in the script to debug and that told me it was being 
executed twice! This looks like a bug in initramfs-tools.

A boot with the initrd thus created resulted in:

<snip from console>
Loading, please wait...
Begin: Initializing /dev ...
Done.
Begin: Loading modules ...
dasd(eckd): 0.0.0120: 3390/02(CU:3990/02) Cyl:1113 Head:15 Sec:224
dasd(eckd): 0.0.0120: (4kB blks): 801360kB at 48kB/trk compatible disk 
layout
 dasda:VOL1/  LX0120: dasda1 dasda2
dasd(eckd): 0.0.0121: 3390/02(CU:3990/02) Cyl:1113 Head:15 Sec:224
dasd(eckd): 0.0.0121: (4kB blks): 801360kB at 48kB/trk compatible disk 
layout
 dasdb:VOL1/  0X0121: dasdb1 dasdb2
Done.
Begin: Running /scripts/init-premount ...
Done.
Begin: Mounting root file system ...
Begin: Running /scripts/local-top ...
Done.
Begin: Running /scripts/local-premount ...
Done.
FATAL: Module ext3 not found.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Begin: Running /scripts/log-bottom ...
Done.
Done.
Begin: Running /scripts/init-bottom ...
Done.
Kernel panic - not syncing: Attempted to kill init
HHCCP011I CPU0000: Disabled wait state
          PSW=000A0000 8003025E
</snip>

So now the devices are created.
The "FATAL: Module ext3 not found." error is bogus as ext3 is built in.
The next lines tell that a ext3 partition is mounted.
I have no idea why init fails after that. As I did not get a shell, I'm 
not sure how to debug further. Suggestions welcome.

Cheers,
FJP

fjp@mordor:~$ cat /etc/mkinitramfs/hooks/dasd_cfg
#! /bin/sh

# initramfs hook script: /etc/mkinitramfs/hooks/dasd_cfg

# dasd_mod module needs option listing dasd's to initialize
# Example: options dasd_mod dasd=0120,0121
# Devices are taken from /proc/dasd/devices. Example (from 2.4.27 kernel):
# $ cat /proc/dasd/devices
# 0120(ECKD) at ( 94:  0) is dasda      : active at blocksize: 4096, 200340 blocks, 782 MB
# 0121(ECKD) at ( 94:  4) is dasdb      : active at blocksize: 4096, 200340 blocks, 782 MB


# TODO
# Maybe /proc/dasd/devices needs to be parsed better.
# I assume that the ordering of devices is determined by their order in the
# module option. I'm not sure of the sorting in /proc/dasd/devices, so it
# may not do the right thing if dasda is 0121 and dasdb is 0120.
# I'm also not sure how reliable the format of the file is.


. /usr/share/initramfs-tools/hook-functions

[ -r /proc/dasd/devices ] || exit 1

dasd_dev=$(cut -d"(" -f1 /proc/dasd/devices)
for dev in $dasd_dev; do
        [ -n "$dasd_devs" ] && dasd_devs="${dasd_devs},"
        dasd_devs="${dasd_devs}${dev}"
done

if [ -n "$dasd_devs" ] ; then
        echo "options dasd_mod dasd=$dasd_devs" >/tmp/initramfs_dasd

        copy_exec /tmp/initramfs_dasd /etc/modprobe.d/dasd
fi

Attachment: pgpvXqS5v4iwt.pgp
Description: PGP signature


Reply to: