Migrate from Linux 2.6.18 to 2.6.31 and higher

From Xen
Revision as of 11:23, 30 January 2012 by Pmhahn (talk | contribs) (→‎inittab)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Build PV-OPS kernel

Refer to XenParavirtOps

If your boot hangs during the initrd stage, try compiling the kernel with these two options enabled:

CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y

Before rebooting

SAS/SCSI/SATA drivers

RHEL5 compared to 2.6.31.6 has certain SATA drivers which changed names. Notable is the ata_piix which in the pvops is called pata_oldpiix. There might be others, it is PARAMOUNT that you check the name of the driver in RHEL5 against your new kernel and include it in /etc/modprobe.conf. Otherwise mkinitrd will fail to package it in and when booting your new kernel, the initrd won't load the driver for the storage.

What you have to do is add in /etc/modprobe.conf the new module name of your SATA driver.

For example, the 'ata_piix' is the SATA controller module in RHEL5. In the PVOPS kernel it is called pata_oldpiix. You MUST ensure that in the /etc/modprobe.conf file there is an entry such as this:

....
alias scsi_hostadapter ata_piix
alias scsi_hostadapter1 pata_oldpiix
,but there might be other modules which have changed names in the PVOPS kernel. 

After altering the file, run 'mkinitrd -v --depmod /boot/<initrd image name> <2.6.31-and-higher>' and verify that the proper storage module is being packaged.

EHCI, OHCI, ..

The USB drivers are by default statically compiled in the PV-OPS kernel while under 2.6.18 they are modules. When running 'mkinitrd' you might see:


WARNING: No module ehci-hcd found for kernel 2.6.31.6-0.0.pvops_3.x86_64, continuing anyway
WARNING: No module ohci-hcd found for kernel 2.6.31.6-0.0.pvops_3.x86_64, continuing anyway
WARNING: No module uhci-hcd found for kernel 2.6.31.6-0.0.pvops_3.x86_64, continuing anyway
WARNING: No module ata_piix found for kernel 2.6.31.6-0.0.pvops_3.x86_64, continuing anyway


It is OK to ignore the warnings about the USB controller modules (ehci,ohci,uhci) as they are compiled in the kernel instead of being modules.

console=hvc0

The 2.6.18 used the tty or the xvc as the name of the character device. In the PV-OPS kernels that has changed to the 'hvc0'. It is important that you modify in your Linux kernel line to have console=hvc0.

inittab

If during runtime you see:

Dec 31 22:23:27 tst004 init: Id "co" respawning too fast: disabled for 5 minutes

that means that the entry that exists in the /etc/inittab for 'co is not working. In 2.6.18 kernel, it looks as such:

....
 co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav
...

That won't work under PVOPS, as the the xvc module has changed its name to hvc. You need to edit that file and have:

....
 co:2345:respawn:/sbin/agetty hvc0 9600 vt100-nav
...

Please be aware that if you remove the xvc entry and boot the 2.6.18 kernel you won't have console access.

securetty

If you cannot login as root on the console when running the PVOPS kernel, the reason is likely that the console module is not mentioned in /etc/securetty. Make sure that you have this in that file:


...
hvc0


Summary

This little scriptlet does the outlined steps for you:


# RHEL -> FC11 quick upgrade path.
grep -q xenfs /etc/fstab || echo "xenfs                   /proc/xen               xenfs   defaults        0 0" >> /etc/fstab
if grep -q ata_piix /etc/modprobe.conf ; then
	NR=`cat /etc/modprobe.conf | grep scsi | wc -l | sed s/[[:space:]]*//`
	grep -q pata_oldpiix /etc/modprobe.conf || echo "alias scsi_hostadapter$NR pata_oldpiix" >> /etc/modprobe.conf
fi
grep -q hvc /etc/inittab || echo "co:2345:respawn:/sbin/agetty hvc0 9600 vt100-nav" >> /etc/inittab
grep -q hvc0 /etc/securetty || echo "hvc0" >> /etc/securetty


The scritplet also modifies /etc/fstab,/etc/inittab, and /etc/securetty to make it possible to boot the pvops machine. The changes do not affect the 2.6.18-X line kernel adversely.

Troubleshooting

xend is not starting

The PVOPS changed how the /proc/xen is exported to user-space. Now it is considered an XenFS filesystem that has to be mounted to be usable. Make sure you have this in /etc/fstab:

xenfs                   /proc/xen               xenfs   defaults        0 0