WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Problem booting dom0 - can't find partition

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Problem booting dom0 - can't find partition
From: Deepa S <deepas@xxxxxxxxxxxxx>
Date: Thu, 11 Jan 2007 18:19:40 -0500
Delivery-date: Mon, 15 Jan 2007 02:44:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)
I'm having issues booting dom0 where it fails since it cannot find the boot partition.

Details:
This is on a 32-bit system.

I installed SLES10 and chose the Xen packages along with it. This Xen kernel boots fine. But when I extract xen-unstable (on Jan 9th), build it, build an initrd for it and boot it, dom0 boot fails. (Before building Xen from source, I moved all the xen files installed by SLES in /boot to another directory). Below are the exact messages when the failure occurs:
.................
................
hda: TOSHIBA MK4019GAXB, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Loading processor
Loading thermal
Loading fan
Loading reiserfs
Waiting for device /dev/hda1 to appear:........... not found -- exiting to /bin/sh
$

After this, the keyboard locks up and I can't do anything except power cycle the system.

I compared the contents of the initrd installed by SLES and the one I built and the only thing that differs is the init file. I'm attaching both versions of init here.

I'm also attaching the dmesg output from the successful boot of the Xen kernel from SLES. Here's the same part of the output as the failing one above:
.................
SvrWks CSB5: IDE controller at PCI slot 0000:00:0f.1
SvrWks CSB5: chipset revision 147
SvrWks CSB5: not 100% native mode: will probe irqs later
   ide0: BM-DMA at 0x0700-0x0707, BIOS settings: hda:DMA, hdb:DMA
   ide1: BM-DMA at 0x0708-0x070f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: TOSHIBA MK4019GAXB, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 128KiB
hda: 78140160 sectors (40007 MB), CHS=65535/16/63, UDMA(66)
hda: cache flushes supported
hda: hda1 hda2
Probing IDE interface ide1...
ReiserFS: hda1: found reiserfs format "3.6" with standard journal
ReiserFS: hda1: using ordered data mode
reiserfs: using flush barriers
ReiserFS: hda1: journal params: device hda1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
ReiserFS: hda1: checking transaction log (hda1)
ReiserFS: hda1: Using r5 hash to sort names
...........

One thing I noticed while building the initrd is that it complained about not finding dependencies for the "edd" module. I looked at SLES docs, and it says to ignore the error.

I'm also attaching the boot config file here.

Any pointers on what's happening here or how I can debug this problem further?

Thanks,
Deepa


<cid:part1.02000107.04090200@linux.ibm.com>
Linux version 2.6.16.21-0.8-xen (geeko@buildhost) (gcc version 4.1.0 (SUSE 
Linux)) #1 SMP Mon Jul 3 18:25:39 UTC 2006
1069MB HIGHMEM available.
831MB LOWMEM available.
On node 0 totalpages: 486830
  DMA zone: 212990 pages, LIFO batch:31
  DMA32 zone: 0 pages, LIFO batch:0
  Normal zone: 0 pages, LIFO batch:0
  HighMem zone: 273840 pages, LIFO batch:31
DMI 2.3 present.
ACPI: RSDP (v000 IBM                                   ) @ 0x000fdfc0
ACPI: RSDT (v001 IBM    SERBLADE 0x00001000 IBM  0x45444f43) @ 0x7ffeff80
ACPI: FADT (v001 IBM    SERBLADE 0x00001000 IBM  0x45444f43) @ 0x7ffeff00
ACPI: MADT (v001 IBM    SERBLADE 0x00001000 IBM  0x45444f43) @ 0x7ffefe80
ACPI: DSDT (v001 IBM    SERBLADE 0x00001000 INTL 0x02002025) @ 0x00000000
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
ACPI: LAPIC_NMI (acpi_id[0x00] dfl dfl lint[0x1])
ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
ACPI: IOAPIC (id[0x0e] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 14, version 17, address 0xfec00000, GSI 0-15
ACPI: IOAPIC (id[0x0d] address[0xfec01000] gsi_base[16])
IOAPIC[1]: apic_id 13, version 17, address 0xfec01000, GSI 16-31
ACPI: IOAPIC (id[0x0c] address[0xfec02000] gsi_base[32])
IOAPIC[2]: apic_id 12, version 17, address 0xfec02000, GSI 32-47
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ4 used by override.
Enabling APIC mode:  Flat.  Using 3 I/O APICs
Using ACPI (MADT) for SMP configuration information
Built 1 zonelists
Kernel command line: root=/dev/hda1 showopts
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 65536 bytes)
Xen reported: 2000.010 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Software IO TLB enabled: 
 Aperture:     2 megabytes
 Kernel range: 0x00000000c0dc3000 - 0x00000000c0fc3000
vmalloc area: f4800000-fb7fe000, maxmem 33ffe000
Memory: 1906840k/1947320k available (1915k kernel code, 31224k reserved, 651k 
data, 172k init, 1095360k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 5005.40 BogoMIPS (lpj=10010803)
Security Framework v1.0.0 initialized
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 3febd3f1 00000000 00000000 00000000 00000000 
00000000 00000000
CPU: After vendor identify, caps: 3febd3f1 00000000 00000000 00000000 00000000 
00000000 00000000
CPU: Trace cache: 12K uops, L1 D cache: 8K
CPU: L2 cache: 512K
CPU: After all inits, caps: 3febd3f1 00000000 00000000 00000080 00000000 
00000000 00000000
checking if image is initramfs... it is
Freeing initrd memory: 6105k freed
 not found!
ENABLING IO-APIC IRQs
Brought up 2 CPUs
Initializing CPU#1
migration_cost=10
Grant table initialized
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: Using configuration type 1
ACPI: Subsystem revision 20060127
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
Boot video device is 0000:00:01.0
PCI: Ignoring BAR0-3 of IDE controller 0000:00:0f.1
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Root Bridge [PCI1] (0000:02)
PCI: Probing PCI hardware (bus 02)
ACPI: PCI Interrupt Routing Table [\_SB_.PCI1._PRT]
ACPI: PCI Root Bridge [PCI2] (0000:01)
PCI: Probing PCI hardware (bus 01)
ACPI: PCI Interrupt Routing Table [\_SB_.PCI2._PRT]
ACPI: PCI Interrupt Link [LPUS] (IRQs *7)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 10 devices
xen_mem: Initialising balloon driver.
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
TC classifier action (bugs to netdev@xxxxxxxxxxxxxxx cc hadi@xxxxxxxxxx)
Setting up standard PCI resources
Allocating PCI resources starting at 80000000 (gap: 80000000:7ec00000)
pnp: 00:01: ioport range 0x510-0x517 could not be reserved
pnp: 00:01: ioport range 0x504-0x507 could not be reserved
pnp: 00:01: ioport range 0x500-0x503 could not be reserved
pnp: 00:01: ioport range 0x420-0x427 has been reserved
pnp: 00:01: ioport range 0x460-0x461 has been reserved
pnp: 00:07: ioport range 0x1ec-0x1ef has been reserved
pnp: 00:07: ioport range 0x400-0x4fe could not be reserved
pnp: 00:07: ioport range 0x600-0x600 has been reserved
pnp: 00:07: ioport range 0x800-0x80f has been reserved
audit: initializing netlink socket (disabled)
audit(1168555688.944:1): initialized
highmem bounce pool size: 64 pages
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Real Time Clock Driver v1.12ac
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 64000K size 1024 blocksize
Xen virtual console successfully installed as ttyS0
Event-channel device installed.
mice: PS/2 mouse device common for all mice
input: PC Speaker as /class/input/input0
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 262144 bytes)
TCP established hash table entries: 262144 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
NET: Registered protocol family 1
Using IPI No-Shortcut mode
Freeing unused kernel memory: 172k freed
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SvrWks CSB5: IDE controller at PCI slot 0000:00:0f.1
SvrWks CSB5: chipset revision 147
SvrWks CSB5: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x0700-0x0707, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0x0708-0x070f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: TOSHIBA MK4019GAXB, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 128KiB
hda: 78140160 sectors (40007 MB), CHS=65535/16/63, UDMA(66)
hda: cache flushes supported
 hda: hda1 hda2
Probing IDE interface ide1...
ReiserFS: hda1: found reiserfs format "3.6" with standard journal
ReiserFS: hda1: using ordered data mode
reiserfs: using flush barriers
ReiserFS: hda1: journal params: device hda1, size 8192, journal first block 18, 
max trans len 1024, max batch 900, max commit age 30, max trans age 30
ReiserFS: hda1: checking transaction log (hda1)
ReiserFS: hda1: Using r5 hash to sort names
Adding 2104504k swap on /dev/hda2.  Priority:-1 extents:1 across:2104504k
tg3.c:v3.49 (Feb 2, 2006)
ACPI: PCI Interrupt 0000:02:01.0[A] -> GSI 16 (level, low) -> IRQ 16
Linux agpgart interface v0.101 (c) Dave Jones
eth0: Tigon3 [partno(BCM95703A31) rev 1002 PHY(5703)] (PCIX:100MHz:64-bit) 
10/100/1000BaseT Ethernet 00:09:6b:00:12:56
eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] Split[0] WireSpeed[0] TSOcap[1] 
eth0: dma_rwctrl[769f4000] dma_mask[64-bit]
ACPI: PCI Interrupt 0000:01:01.0[A] -> GSI 17 (level, low) -> IRQ 17
eth1: Tigon3 [partno(BCM95703A31) rev 1002 PHY(5703)] (PCIX:100MHz:64-bit) 
10/100/1000BaseT Ethernet 00:09:6b:00:12:57
eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] Split[0] WireSpeed[0] TSOcap[1] 
eth1: dma_rwctrl[769f4000] dma_mask[64-bit]
usbcore: registered new driver usbfs
usbcore: registered new driver hub
piix4_smbus 0000:00:0f.0: Found 0000:00:0f.0 device
piix4_smbus 0000:00:0f.0: Unusual config register value
piix4_smbus 0000:00:0f.0: Try using fix_hstcfg=1 if you experience problems
piix4_smbus 0000:00:0f.0: Illegal Interrupt configuration (or code out of date)!
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ACPI: PCI Interrupt Link [LPUS] enabled at IRQ 7
ACPI: PCI Interrupt 0000:00:0f.2[A] -> Link [LPUS] -> GSI 7 (level, low) -> IRQ 
7
ohci_hcd 0000:00:0f.2: OHCI Host Controller
ohci_hcd 0000:00:0f.2: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:0f.2: irq 7, io mem 0xfebfe000
usb usb1: new device found, idVendor=0000, idProduct=0000
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: OHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.16.21-0.8-xen ohci_hcd
usb usb1: SerialNumber: 0000:00:0f.2
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
usb 1-2: new full speed USB device using ohci_hcd and address 2
device-mapper: 4.5.0-ioctl (2005-10-04) initialised: dm-devel@xxxxxxxxxx
dm-netlink version 0.0.2 loaded
usb 1-2: new device found, idVendor=04b4, idProduct=5204
usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: 4 Port Hub
usb 1-2: Manufacturer: Cypress Semiconductor
usb 1-2: configuration #1 chosen from 1 choice
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected
usb 1-2.1: new full speed USB device using ohci_hcd and address 3
usb 1-2.1: new device found, idVendor=04b3, idProduct=4002
usb 1-2.1: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2.1: Product: PPC I/F
usb 1-2.1: Manufacturer: IBM
usb 1-2.1: SerialNumber: IBMRAPT0R   
usb 1-2.1: configuration #1 chosen from 1 choice
usb 1-2.3: new full speed USB device using ohci_hcd and address 4
usb 1-2.3: new device found, idVendor=04b3, idProduct=4004
usb 1-2.3: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.3: Product: HIDK/M
usb 1-2.3: Manufacturer: IBM
usb 1-2.3: configuration #1 chosen from 1 choice
usbcore: registered new driver hiddev
input: IBM PPC I/F as /class/input/input1
input: USB HID v1.10 Keyboard [IBM PPC I/F] on usb-0000:00:0f.2-2.1
input: IBM PPC I/F as /class/input/input2
input: USB HID v1.10 Mouse [IBM PPC I/F] on usb-0000:00:0f.2-2.1
input: IBM HIDK/M as /class/input/input3
input: USB HID v1.10 Keyboard [IBM HIDK/M] on usb-0000:00:0f.2-2.3
input: IBM HIDK/M as /class/input/input4
input: USB HID v1.10 Mouse [IBM HIDK/M] on usb-0000:00:0f.2-2.3
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
loop: loaded (max 8 devices)
AppArmor: AppArmor (version 2.0-19.43r6320) initialized
audit(1168555709.277:2): AppArmor (version 2.0-19.43r6320) initialized

NET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
ip6_tables: (C) 2000-2006 Netfilter Core Team
ip_tables: (C) 2000-2006 Netfilter Core Team
Netfilter messages via NETLINK v0.30.
ip_conntrack version 2.4 (8192 buckets, 65536 max) - 232 bytes per conntrack
ACPI: Power Button (FF) [PWRF]
tg3: eth1: Link is up at 1000 Mbps, full duplex.
tg3: eth1: Flow control is off for TX and off for RX.
IA-32 Microcode Update Driver: v1.14-xen <tigran@xxxxxxxxxxx>
IA-32 Microcode Update Driver v1.14-xen unregistered
eth1: no IPv6 routers present
SFW2-INext-ACC-TCP IN=eth1 OUT= MAC=00:09:6b:00:12:57:00:09:6b:49:41:63:08:00 
SRC=192.168.46.1 DST=192.168.46.113 LEN=44 TOS=0x00 PREC=0x00 TTL=64 ID=22748 
DF PROTO=TCP SPT=47182 DPT=22 WINDOW=5840 RES=0x00 SYN URGP=0 OPT (020405B4) 
SFW2-INext-ACC-TCP IN=eth1 OUT= MAC=00:09:6b:00:12:57:00:09:6b:49:41:63:08:00 
SRC=192.168.46.1 DST=192.168.46.113 LEN=44 TOS=0x00 PREC=0x00 TTL=64 ID=15312 
DF PROTO=TCP SPT=51897 DPT=22 WINDOW=5840 RES=0x00 SYN URGP=0 OPT (020405B4) 
#! /bin/bash

export PATH=/sbin:/usr/sbin:/bin:/usr/bin

die() {
    umount /proc
    umount /sys
    umount /dev
    exit $1
}

exec < /dev/console > /dev/console 2>&1

mount -t tmpfs -o mode=0755 udev /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/kmsg c 1 11
mkdir /dev/pts
mkdir -m 1777 /dev/shm
ln -s /proc/self/fd /dev/fd
ln -s fd/0 /dev/stdin
ln -s fd/1 /dev/stdout
ln -s fd/2 /dev/stderr

mount -tproc proc /proc
mount -tsysfs sysfs /sys

echo "" > /proc/sys/kernel/hotplug

kernel_cmdline="$@"

# Default timeout is 30 seconds
udev_timeout=30

for o in $(cat /proc/cmdline); do
    if [ "$z_arg" ] ; then
        init_args="$init_args $o"
        z_arg=
        continue
    fi
    case $o in
    linuxrc=trace)
        echo -n "cmdline: "
        for arg in $@; do
            echo -n "$arg "
        done
        echo ""
        set -x
        debug_linuxrc=1
        ;;
    noresume)
        resume_mode=off
        ;;
    sysrq=yes|sysrq=1)
        echo 1 > /proc/sys/kernel/sysrq
        ;;
    -z)
        init_args="$init_args $o"
        z_arg=1
        ;;
    -s)
        runlevel=s
        ;;
    -b|emergency)
        init_args="$init_args emergency"
        ;;
    -a|auto)
        init_args="$init_args auto"
        ;;
    1|2|3|4|5|S|s|single)
        runlevel=$o
        ;;
    rw)
       read_write=1
       ;;
    ro)
       read_only=1
       ;;
    esac
done


for o in $(cat /proc/cmdline); do
    case $o in
    root=*)
        rootdev=${o#root=}
        rootdev_cmdline=1
        ;;
    nfsroot=*)
        rootdev=${o#nfsroot=}
        rootdev_cmdline=1
        ;;
    resume=*)
        resumedev=${o#resume=}
        ;;
    journal=*)
        journaldev=${o#journal=}
        ;;
    mduuid=*)
        md_uuid=${o#mduuid=}
        ;;
    init=*)
        init=${o#init=}
        ;;
    udev_timeout=*)
        udev_timeout=${o#udev_timeout=}
        ;;
    rootflags=*)
        rootfsflags=${o#rootflags=}
        ;;
    esac
done

if [ -z "$rootdev" ]; then
    rootdev=/dev/hda1
else
    # lilo strips off the /dev/prefix from device names!
    case $rootdev in
        /dev/disk/by-name/*)
            rootdevid=${rootdev#/dev/disk/by-name/}
            rootdevid=${rootdevid%-part*}
            ;;
        /dev/md*)
            md_dev=$rootdev
            md_minor=${rootdev#/dev/md}
            ;;
        /dev/*)
            ;;
        LABEL=*)
            label=${rootdev#LABEL=}
            echo "SUBSYSTEM=\"block\", SYSFS{start}=\"*\", 
PROGRAM=\"/sbin/vol_id -l %N\", RESULT=\"$label\", SYMLINK+=\"root\"" > 
/etc/udev/rules.d/01-label.rules
            echo "KERNEL=\"dm-[0-9]*\", PROGRAM=\"/sbin/vol_id -l %N\", 
RESULT=\"$label\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/01-label.rules
            rootdev=/dev/root
            ;;
        UUID=*)
            uuid=${rootdev#UUID=}
            echo "SUBSYSTEM=\"block\", SYSFS{start}=\"*\", 
PROGRAM=\"/sbin/vol_id -u %N\", RESULT=\"$uuid\", SYMLINK+=\"root\"" > 
/etc/udev/rules.d/02-uuid.rules
            echo "KERNEL=\"dm-[0-9]*\", PROGRAM=\"/sbin/vol_id -u %N\", 
RESULT=\"$uuid\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/02-uuid.rules
            rootdev=/dev/root
            ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            maj=$((0x0$rootdev >> 8))
            min=$((0x0$rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            maj=$((0x$rootdev >> 8))
            min=$((0x$rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        0x[0-9a-fA-F][0-9a-fA-F]*)
            maj=$(($rootdev >> 8))
            min=$(($rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        *:*)
            rootfstype="nfs"
            ;;
        *)
            rootdev=/dev/$rootdev
            ;;
    esac
fi

# Verify manual resume mode
if [ "" != "off" -a -n "$resumedev" ]; then
    if [ -w /sys/power/resume ]; then
        echo "Trying manual resume from $resumedev"
        resume_mode=1
    else
        resumedev=
    fi
else
    resume_mode=
fi

# Check for debugging
if [ -n "$debug_linuxrc" ]; then
    echo "udev_log=\"debug\"" >> /etc/udev/udev.conf
else
    echo "udev_log=\"error\"" >> /etc/udev/udev.conf
fi

# Set default for the journal device
if [ -z "$journaldev" ]; then
    journaldev=
fi

mkdevn () 
{ 
    local major=$1 minor=$2 minorhi minorlo;
    major=$(($major * 256));
    minorhi=$(($minor / 256));
    minorlo=$(($minor % 256));
    minor=$(($minorhi * 256 * 4096));
    echo $(( $minorlo + $major + $minor ))
}

devmajor () 
{ 
    local devn=$(($1 / 256));
    echo $(( $devn % 4096 ))
}

devminor () 
{ 
    local devn=${1:-0};
    echo $(( $devn % 256 ))
}

block_driver () 
{ 
    local devn block major driver;
    case "$1" in 
        /dev/*)
            devn=$(devnumber $1 2> /dev/null)
        ;;
        *:*)
            set -- $(IFS=: ; echo $1);
            devn=$(mkdevn $1 $2)
        ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            devn=$((0x$1))
        ;;
    esac;
    [ -z "$devn" ] && return 1;
    major=$(devmajor $devn);
    driver=$(cat /proc/devices | sed -n "s/^[ ]*$major \(.*\)/\1/p;/Block/p" | 
tail -1);
    case "$driver" in 
        Block*)
            return 1
        ;;
        *)
            echo $driver;
            return 0
        ;;
    esac
}

devnumber () 
{ 
    set -- $(ls -lL $1);
    mkdevn ${5%,} $6
}


echo "Starting udevd"
/sbin/udevd --daemon

echo "Creating devices"
/sbin/udevtrigger
/sbin/udevsettle --timeout=$udev_timeout

# workaround chicken/egg bug in mdadm
# they do the ioctl on the not yet existing device node...
i=0
while [ $((i)) -lt 32 ] ; do
  mknod -m 660 /dev/md$i b 9 $i
  i=$((i + 1))
done


caps="$(</proc/xen/capabilities)"
if [ "$caps" != "${caps%control_d*}" ]; then

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    ide-core.*)
      params="$params ${p#ide-core.}"
      ;;
  esac
done

# check for IDE parameter in /proc/cmdline
for p in $(cat /proc/cmdline) ; do
  case $p in
    ide=*)
      ide_params="$ide_params $p"
      ;;
    hd?=*)
      ide_params="$ide_params $p"
      ;;
  esac
done
if [ -n "$ide_params" ]; then
  params="$params options=\"$ide_params\""
fi

echo "Loading ide-core"
modprobe ide-core $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    ide-disk.*)
      params="$params ${p#ide-disk.}"
      ;;
  esac
done

echo "Loading ide-disk"
modprobe ide-disk $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    serverworks.*)
      params="$params ${p#serverworks.}"
      ;;
  esac
done

echo "Loading serverworks"
modprobe serverworks $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    processor.*)
      params="$params ${p#processor.}"
      ;;
  esac
done

echo "Loading processor"
modprobe processor $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    thermal.*)
      params="$params ${p#thermal.}"
      ;;
  esac
done

echo "Loading thermal"
modprobe thermal $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    fan.*)
      params="$params ${p#fan.}"
      ;;
  esac
done

echo "Loading fan"
modprobe fan $params

else

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    xennet.*)
      params="$params ${p#xennet.}"
      ;;
  esac
done
echo "Loading xennet"
modprobe xennet $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    xenblk.*)
      params="$params ${p#xenblk.}"
      ;;
  esac
done
echo "Loading xenblk"
modprobe xenblk $params

fi


# Waiting for a device to appear
# device node will be created by udev
udev_check_for_device() {
    local root
    local retval=1
    local timeout=$udev_timeout
    root=$1
    if [ -n "$root" ]; then
        echo -n "Waiting for device $root to appear: "
        while [ $timeout -gt 0 ]; do
            if [ -e $root ]; then
                echo " ok"
                retval=0
                break;
            fi
            sleep 1
            echo -n "."
            timeout=$(( $timeout - 1 ))
        done
    fi
    return $retval;
}

udev_discover_resume() {
    local resume
    # Waits for the resume device to appear
    if [ -n "$resume_mode" ]; then
        if [ -e $resumedev ] ; then
            # Try major:minor number of the device node
            devn=$(devnumber $resumedev)
            major=$(devmajor $devn)
            minor=$(devminor $devn)
            devn=
       fi
       if [ -n "$major" -a -n "$minor" ]; then
            echo "$major:$minor" > /sys/power/resume
            major=
            minor=
        else
            echo "resume device $resumedev not found (ignoring)"
       fi
    fi
}

udev_discover_root() {
    local root
    case "$rootdev" in
        *:*) root= ;;
        /dev/nfs) root= ;;
        /dev/*) root=${rootdev#/dev/} ;;
    esac
    if [ -z "$root" ]; then
        return 0
    fi
    if udev_check_for_device $rootdev  ; then
        # Get major:minor number of the device node
        devn=$(devnumber $rootdev)
        major=$(devmajor $devn)
        minor=$(devminor $devn)
    fi
    if [ -n "$devn" ]; then
        echo "rootfs: major=$major minor=$minor" \
            "devn=$devn"
        echo $devn > /proc/sys/kernel/real-root-dev
        return 0
    else
        return 1
    fi
}

/sbin/udevsettle --timeout=$udev_timeout


params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    reiserfs.*)
      params="$params ${p#reiserfs.}"
      ;;
  esac
done

echo "Loading reiserfs"
modprobe reiserfs

# Wait for udev to settle
/sbin/udevsettle --timeout=$udev_timeout
# Check for a resume device
udev_discover_resume

# And now for the real thing
if ! udev_discover_root ; then
    echo "not found -- exiting to /bin/sh"
    cd /
    PATH=$PATH PS1='$ ' /bin/sh -i
fi

if [ -z "$rootfstype" ]; then
    rootfstype=$(/sbin/vol_id -t $rootdev)
    [ $? -ne 0 ] && rootfstype=
    [ -n "$rootfstype" ] && [ "$rootfstype" = "unknown" ] && $rootfstype=
fi

# check filesystem if possible
if [ -z "$rootfstype" ]; then
    echo "invalid root filesystem -- exiting to /bin/sh"
    cd /
    PATH=$PATH PS1='$ ' /bin/sh -i
elif [ -x /bin/fsck.${rootfstype} ]; then
    # fsck is unhappy without it
    echo "$rootdev / $rootfstype defaults 1 1" > /etc/fstab
    fsckopts="-V -a"
    # Check external journal for reiserfs
    [ "$rootfstype" = "reiserfs" -a -n "$journaldev" ] && fsckopts="-j 
$journaldev $fsckopts"
    fsck -t $rootfstype $fsckopts $rootdev
    # Return the fsck status
    ROOTFS_FSCK=$?
    export ROOTFS_FSCK
    ROOTFS_FSTYPE=$rootfstype
    export ROOTFS_FSTYPE
    if [ $ROOTFS_FSCK -gt 1 -a $ROOTFS_FSCK -lt 4 ]; then
        # reboot needed
        echo "fsck succeeded, but reboot is required."
        echo "Rebooting system."
        /bin/reboot -d -f
    elif [ $ROOTFS_FSCK -gt 3 ] ; then
        echo "fsck failed. Mounting root device read-only."
        read_write=
    else
        if [ "$read_only" ]; then
            echo "fsck succeeded. Mounting root device read-only."
            read_write=
        else
            echo "fsck succeeded. Mounting root device read-write."
            read_write=1
        fi
    fi
fi

opt="-o ro"
[ -n "$read_write" ] && opt="-o rw"
[ "$rootfstype" = "nfs" ] && opt="${opt},nolock"

# tell kernel root is /dev/ram0, prevents remount after initrd
echo 256 > /proc/sys/kernel/real-root-dev
# mount the actual root device below /root
echo "Mounting root $rootdev"
# check external journal
[ "$rootfstype" = "xfs" -a -n "$journaldev" ] && opt="${opt},logdev=$journaldev"
[ "$rootfstype" = "xfs" -a -n "$rootfsflags" ] && opt="${opt},$rootfsflags"
[ "$rootfstype" = "reiserfs" -a -n "$journaldev" ] && 
opt="${opt},jdev=$journaldev"
[ -n "$rootfstype" ] && opt="${opt} -t $rootfstype"
if [ -x /bin/nfsmount -a "$rootfstype" = "nfs" ]; then
    nfsmount $rootdev /root || die 1
else
    mount $opt $rootdev /root || die 1
fi
# Look for an init binary on the root filesystem
if [ -n "$init" ] ; then
    if [ ! -f "/root$init" ]; then
        init=
    fi
fi

if [ -z "$init" ] ; then
    for i in /sbin/init /etc/init /bin/init /bin/sh ; do
        if [ ! -f "/root$i" ] ; then continue ; fi
        init="$i"
        break
    done
fi

if [ -z "$init" ] ; then
    echo "No init found. Try passing init= option to the kernel."
    die 1
fi

# Parse root mount options
if [ -f /root/etc/fstab ] ; then
    fsoptions=$(cat /root/etc/fstab | while read d m f o r; do if [ "$m" == "/" 
] ; then echo $o; fi; done)
    set -- $(IFS=,; echo $fsoptions)
    fsoptions=
    while [ "$1" ] ; do
        case $1 in
        *quota) ;;
        defaults) ;;
        *)
            if [ "$fsoptions" ] ; then
                fsoptions="$fsoptions,$1"
            else
                fsoptions="$1"
            fi
            ;;
        esac
        shift
    done
    if [ "$fsoptions" ] ; then
        mount -o remount,$fsoptions $rootdev /root
    fi
fi

# Create framebuffer devices
if [ -f /proc/fb ]; then
    cat /proc/fb | while read fbnum fbtype; do
        if [ $(($fbnum < 32)) ] ; then
            [ -c /dev/fb$fbnum ] || mknod /dev/fb$fbnum c 29 $fbnum
        fi
    done
fi

/bin/mount --move /dev /root/dev

# Call vendor-specific init script
if [ -x /vendor_init.sh ] ; then
    /vendor_init.sh
fi

# kill udevd, we will run the one from the real root
kill $(pidof udevd)

# kill iscsid, will be restarted from the real root
iscsi_pid=$(pidof iscsid)
[ "$iscsi_pid" ] && kill -KILL $iscsi_pid

# ready to leave
cd /root
umount /proc
umount /sys

# Export root fs information
ROOTFS_BLKDEV="$rootdev"
export ROOTFS_BLKDEV

exec /bin/run-init -c ./dev/console /root $init $init_args $runlevel
echo could not exec run-init!
die 0

#! /bin/bash

export PATH=/sbin:/usr/sbin:/bin:/usr/bin

die() {
    umount /proc
    umount /sys
    umount /dev
    exit $1
}

exec < /dev/console > /dev/console 2>&1

mount -t tmpfs -o mode=0755 udev /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/kmsg c 1 11
mkdir /dev/pts
mkdir -m 1777 /dev/shm
ln -s /proc/self/fd /dev/fd
ln -s fd/0 /dev/stdin
ln -s fd/1 /dev/stdout
ln -s fd/2 /dev/stderr

mount -tproc proc /proc
mount -tsysfs sysfs /sys

echo "" > /proc/sys/kernel/hotplug

kernel_cmdline="$@"

# Default timeout is 30 seconds
udev_timeout=30

for o in $(cat /proc/cmdline); do
    if [ "$z_arg" ] ; then
        init_args="$init_args $o"
        z_arg=
        continue
    fi
    case $o in
    linuxrc=trace)
        echo -n "cmdline: "
        for arg in $@; do
            echo -n "$arg "
        done
        echo ""
        set -x
        debug_linuxrc=1
        ;;
    noresume)
        resume_mode=off
        ;;
    sysrq=yes|sysrq=1)
        echo 1 > /proc/sys/kernel/sysrq
        ;;
    -z)
        init_args="$init_args $o"
        z_arg=1
        ;;
    -s)
        runlevel=s
        ;;
    -b|emergency)
        init_args="$init_args emergency"
        ;;
    -a|auto)
        init_args="$init_args auto"
        ;;
    1|2|3|4|5|S|s|single)
        runlevel=$o
        ;;
    rw)
       read_write=1
       ;;
    ro)
       read_only=1
       ;;
    esac
done


for o in $(cat /proc/cmdline); do
    case $o in
    root=*)
        rootdev=${o#root=}
        rootdev_cmdline=1
        ;;
    nfsroot=*)
        rootdev=${o#nfsroot=}
        rootdev_cmdline=1
        ;;
    resume=*)
        resumedev=${o#resume=}
        ;;
    journal=*)
        journaldev=${o#journal=}
        ;;
    mduuid=*)
        md_uuid=${o#mduuid=}
        ;;
    init=*)
        init=${o#init=}
        ;;
    udev_timeout=*)
        udev_timeout=${o#udev_timeout=}
        ;;
    rootflags=*)
        rootfsflags=${o#rootflags=}
        ;;
    esac
done

if [ -z "$rootdev" ]; then
    rootdev=/dev/hda1
else
    # lilo strips off the /dev/prefix from device names!
    case $rootdev in
        /dev/disk/by-name/*)
            rootdevid=${rootdev#/dev/disk/by-name/}
            rootdevid=${rootdevid%-part*}
            ;;
        /dev/md*)
            md_dev=$rootdev
            md_minor=${rootdev#/dev/md}
            ;;
        /dev/*)
            ;;
        LABEL=*)
            label=${rootdev#LABEL=}
            echo "SUBSYSTEM=\"block\", SYSFS{start}=\"*\", 
PROGRAM=\"/sbin/vol_id -l %N\", RESULT=\"$label\", SYMLINK+=\"root\"" > 
/etc/udev/rules.d/01-label.rules
            echo "KERNEL=\"dm-[0-9]*\", PROGRAM=\"/sbin/vol_id -l %N\", 
RESULT=\"$label\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/01-label.rules
            rootdev=/dev/root
            ;;
        UUID=*)
            uuid=${rootdev#UUID=}
            echo "SUBSYSTEM=\"block\", SYSFS{start}=\"*\", 
PROGRAM=\"/sbin/vol_id -u %N\", RESULT=\"$uuid\", SYMLINK+=\"root\"" > 
/etc/udev/rules.d/02-uuid.rules
            echo "KERNEL=\"dm-[0-9]*\", PROGRAM=\"/sbin/vol_id -u %N\", 
RESULT=\"$uuid\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/02-uuid.rules
            rootdev=/dev/root
            ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            maj=$((0x0$rootdev >> 8))
            min=$((0x0$rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            maj=$((0x$rootdev >> 8))
            min=$((0x$rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        0x[0-9a-fA-F][0-9a-fA-F]*)
            maj=$(($rootdev >> 8))
            min=$(($rootdev & 0xff))
            echo "SUBSYSTEM=\"block\", SYSFS{dev}=\"$maj:$min\", 
SYMLINK+=\"root\"" > /etc/udev/rules.d/05-lilo.rules
            rootdev=/dev/root ;;
        *:*)
            rootfstype="nfs"
            ;;
        *)
            rootdev=/dev/$rootdev
            ;;
    esac
fi

# Verify manual resume mode
if [ "" != "off" -a -n "$resumedev" ]; then
    if [ -w /sys/power/resume ]; then
        echo "Trying manual resume from $resumedev"
        resume_mode=1
    else
        resumedev=
    fi
else
    resume_mode=
fi

# Check for debugging
if [ -n "$debug_linuxrc" ]; then
    echo "udev_log=\"debug\"" >> /etc/udev/udev.conf
else
    echo "udev_log=\"error\"" >> /etc/udev/udev.conf
fi

# Set default for the journal device
if [ -z "$journaldev" ]; then
    journaldev=
fi

mkdevn () 
{ 
    local major=$1 minor=$2 minorhi minorlo;
    major=$(($major * 256));
    minorhi=$(($minor / 256));
    minorlo=$(($minor % 256));
    minor=$(($minorhi * 256 * 4096));
    echo $(( $minorlo + $major + $minor ))
}

devmajor () 
{ 
    local devn=$(($1 / 256));
    echo $(( $devn % 4096 ))
}

devminor () 
{ 
    local devn=${1:-0};
    echo $(( $devn % 256 ))
}

block_driver () 
{ 
    local devn block major driver;
    case "$1" in 
        /dev/*)
            devn=$(devnumber $1 2> /dev/null)
        ;;
        *:*)
            set -- $(IFS=: ; echo $1);
            devn=$(mkdevn $1 $2)
        ;;
        [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])
            devn=$((0x$1))
        ;;
    esac;
    [ -z "$devn" ] && return 1;
    major=$(devmajor $devn);
    driver=$(cat /proc/devices | sed -n "s/^[ ]*$major \(.*\)/\1/p;/Block/p" | 
tail -1);
    case "$driver" in 
        Block*)
            return 1
        ;;
        *)
            echo $driver;
            return 0
        ;;
    esac
}

devnumber () 
{ 
    set -- $(ls -lL $1);
    mkdevn ${5%,} $6
}


echo "Starting udevd"
/sbin/udevd --daemon

echo "Creating devices"
/sbin/udevtrigger
/sbin/udevsettle --timeout=$udev_timeout

# workaround chicken/egg bug in mdadm
# they do the ioctl on the not yet existing device node...
i=0
while [ $((i)) -lt 32 ] ; do
  mknod -m 660 /dev/md$i b 9 $i
  i=$((i + 1))
done


caps="$(</proc/xen/capabilities)"
if [ "$caps" != "${caps%control_d*}" ]; then

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    serverworks.*)
      params="$params ${p#serverworks.}"
      ;;
  esac
done

echo "Loading serverworks"
modprobe serverworks $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    processor.*)
      params="$params ${p#processor.}"
      ;;
  esac
done

echo "Loading processor"
modprobe processor $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    thermal.*)
      params="$params ${p#thermal.}"
      ;;
  esac
done

echo "Loading thermal"
modprobe thermal $params

params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    fan.*)
      params="$params ${p#fan.}"
      ;;
  esac
done

echo "Loading fan"
modprobe fan $params

fi


# Waiting for a device to appear
# device node will be created by udev
udev_check_for_device() {
    local root
    local retval=1
    local timeout=$udev_timeout
    root=$1
    if [ -n "$root" ]; then
        echo -n "Waiting for device $root to appear: "
        while [ $timeout -gt 0 ]; do
            if [ -e $root ]; then
                echo " ok"
                retval=0
                break;
            fi
            sleep 1
            echo -n "."
            timeout=$(( $timeout - 1 ))
        done
    fi
    return $retval;
}

udev_discover_resume() {
    local resume
    # Waits for the resume device to appear
    if [ -n "$resume_mode" ]; then
        if [ -e $resumedev ] ; then
            # Try major:minor number of the device node
            devn=$(devnumber $resumedev)
            major=$(devmajor $devn)
            minor=$(devminor $devn)
            devn=
       fi
       if [ -n "$major" -a -n "$minor" ]; then
            echo "$major:$minor" > /sys/power/resume
            major=
            minor=
        else
            echo "resume device $resumedev not found (ignoring)"
       fi
    fi
}

udev_discover_root() {
    local root
    case "$rootdev" in
        *:*) root= ;;
        /dev/nfs) root= ;;
        /dev/*) root=${rootdev#/dev/} ;;
    esac
    if [ -z "$root" ]; then
        return 0
    fi
    if udev_check_for_device $rootdev  ; then
        # Get major:minor number of the device node
        devn=$(devnumber $rootdev)
        major=$(devmajor $devn)
        minor=$(devminor $devn)
    fi
    if [ -n "$devn" ]; then
        echo "rootfs: major=$major minor=$minor" \
            "devn=$devn"
        echo $devn > /proc/sys/kernel/real-root-dev
        return 0
    else
        return 1
    fi
}

/sbin/udevsettle --timeout=$udev_timeout


params=
for p in $(cat /proc/cmdline) ; do
  case $p in
    reiserfs.*)
      params="$params ${p#reiserfs.}"
      ;;
  esac
done

echo "Loading reiserfs"
modprobe reiserfs

# Wait for udev to settle
/sbin/udevsettle --timeout=$udev_timeout
# Check for a resume device
udev_discover_resume

# And now for the real thing
if ! udev_discover_root ; then
    echo "not found -- exiting to /bin/sh"
    cd /
    PATH=$PATH PS1='$ ' /bin/sh -i
fi

if [ -z "$rootfstype" ]; then
    rootfstype=$(/sbin/vol_id -t $rootdev)
    [ $? -ne 0 ] && rootfstype=
    [ -n "$rootfstype" ] && [ "$rootfstype" = "unknown" ] && $rootfstype=
fi

# check filesystem if possible
if [ -z "$rootfstype" ]; then
    echo "invalid root filesystem -- exiting to /bin/sh"
    cd /
    PATH=$PATH PS1='$ ' /bin/sh -i
elif [ -x /bin/fsck.${rootfstype} ]; then
    # fsck is unhappy without it
    echo "$rootdev / $rootfstype defaults 1 1" > /etc/fstab
    fsckopts="-V -a"
    # Check external journal for reiserfs
    [ "$rootfstype" = "reiserfs" -a -n "$journaldev" ] && fsckopts="-j 
$journaldev $fsckopts"
    fsck -t $rootfstype $fsckopts $rootdev
    # Return the fsck status
    ROOTFS_FSCK=$?
    export ROOTFS_FSCK
    ROOTFS_FSTYPE=$rootfstype
    export ROOTFS_FSTYPE
    if [ $ROOTFS_FSCK -gt 1 -a $ROOTFS_FSCK -lt 4 ]; then
        # reboot needed
        echo "fsck succeeded, but reboot is required."
        echo "Rebooting system."
        /bin/reboot -d -f
    elif [ $ROOTFS_FSCK -gt 3 ] ; then
        echo "fsck failed. Mounting root device read-only."
        read_write=
    else
        if [ "$read_only" ]; then
            echo "fsck succeeded. Mounting root device read-only."
            read_write=
        else
            echo "fsck succeeded. Mounting root device read-write."
            read_write=1
        fi
    fi
fi

opt="-o ro"
[ -n "$read_write" ] && opt="-o rw"
[ "$rootfstype" = "nfs" ] && opt="${opt},nolock"

# tell kernel root is /dev/ram0, prevents remount after initrd
echo 256 > /proc/sys/kernel/real-root-dev
# mount the actual root device below /root
echo "Mounting root $rootdev"
# check external journal
[ "$rootfstype" = "xfs" -a -n "$journaldev" ] && opt="${opt},logdev=$journaldev"
[ "$rootfstype" = "xfs" -a -n "$rootfsflags" ] && opt="${opt},$rootfsflags"
[ "$rootfstype" = "reiserfs" -a -n "$journaldev" ] && 
opt="${opt},jdev=$journaldev"
[ -n "$rootfstype" ] && opt="${opt} -t $rootfstype"
if [ -x /bin/nfsmount -a "$rootfstype" = "nfs" ]; then
    nfsmount $rootdev /root || die 1
else
    mount $opt $rootdev /root || die 1
fi
# Look for an init binary on the root filesystem
if [ -n "$init" ] ; then
    if [ ! -f "/root$init" ]; then
        init=
    fi
fi

if [ -z "$init" ] ; then
    for i in /sbin/init /etc/init /bin/init /bin/sh ; do
        if [ ! -f "/root$i" ] ; then continue ; fi
        init="$i"
        break
    done
fi

if [ -z "$init" ] ; then
    echo "No init found. Try passing init= option to the kernel."
    die 1
fi

# Parse root mount options
if [ -f /root/etc/fstab ] ; then
    fsoptions=$(cat /root/etc/fstab | while read d m f o r; do if [ "$m" == "/" 
] ; then echo $o; fi; done)
    set -- $(IFS=,; echo $fsoptions)
    fsoptions=
    while [ "$1" ] ; do
        case $1 in
        *quota) ;;
        defaults) ;;
        *)
            if [ "$fsoptions" ] ; then
                fsoptions="$fsoptions,$1"
            else
                fsoptions="$1"
            fi
            ;;
        esac
        shift
    done
    if [ "$fsoptions" ] ; then
        mount -o remount,$fsoptions $rootdev /root
    fi
fi

# Create framebuffer devices
if [ -f /proc/fb ]; then
    cat /proc/fb | while read fbnum fbtype; do
        if [ $(($fbnum < 32)) ] ; then
            [ -c /dev/fb$fbnum ] || mknod /dev/fb$fbnum c 29 $fbnum
        fi
    done
fi

/bin/mount --move /dev /root/dev

# Call vendor-specific init script
if [ -x /vendor_init.sh ] ; then
    /vendor_init.sh
fi

# kill udevd, we will run the one from the real root
kill $(pidof udevd)

# kill iscsid, will be restarted from the real root
iscsi_pid=$(pidof iscsid)
[ "$iscsi_pid" ] && kill -KILL $iscsi_pid

# ready to leave
cd /root
umount /proc
umount /sys

# Export root fs information
ROOTFS_BLKDEV="$rootdev"
export ROOTFS_BLKDEV

exec /bin/run-init -c ./dev/console /root $init $init_args $runlevel
echo could not exec run-init!
die 0

# Modified by YaST2. Last modification on Wed Jan 10 22:27:13 UTC 2007
color white/blue black/light-gray
default 1
timeout 8
gfxmenu (hd0,0)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE Linux Enterprise Server 10
    root (hd0,0)
    kernel /boot/vmlinuz root=/dev/hda1 vga=0x314    resume=/dev/hda2  
splash=silent showopts
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: xen###
title XEN
    root (hd0,0)
    kernel /boot/xen.gz 
# xen unstable
    module /boot/vmlinuz-xen root=/dev/hda1 showopts
# works for SLES 10 GA
    #module /boot/vmlinuz-xen root=/dev/hda1 vga=0x314    resume=/dev/hda2  
splash=silent showopts
    module /boot/initrd-xen

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE Linux Enterprise Server 10
    root (hd0,0)
    kernel /boot/vmlinuz root=/dev/hda1 vga=normal showopts ide=nodma apm=off 
acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd /boot/initrd
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users