• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1080
  • Last Modified:

Stuck compiling kernel for Ubuntu + Xen PVOPS

I'm following the below instructions to try to build a kernel for Ubuntu / Xen, but I'm getting stuck at 'sudo depmod 2.6.32.27'

the previous command compiles a config-2.6.32.36 that it sticks in the /boot folder, so I think its some disconnect there. sudo depmod 2.6.32.36 completes successfully, but the mkinitramfs on the following command does not complete with either version, as the only init* in the boot folder is the 2.6.32.27.

I think I need an initrd-2.6.32.36 or rebuild 'sudo make linux-2.6-pvops-build' that outputs a 2.6.32.27 kernel, but that is just my best guess.

Trying to reboot into any of these kernels results in panic.

I am not a Linux expert so please keep in mind I may be missing something blatantly obvious
wget "http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz"
tar xvzf xen-4.0.1.tar.gz
cd xen-4.0.1

make world
sudo make install 
sudo make install-xen install-kernels install-tools install-stubdom

make linux-2.6-pvops-config CONFIGMODE=menuconfig

make linux-2.6-pvops-build
sudo make linux-2.6-pvops-install
sudo depmod 2.6.32.27
sudo mkinitramfs -o /boot/initrd-2.6.32.27.img 2.6.32.27
sudo update-grub
sudo reboot

Open in new window

0
bV_
Asked:
bV_
  • 2
1 Solution
 
Duncan RoeSoftware DeveloperCommented:
Where did you get these instructions? (URL if possible)
In make linux-2.6-pvops-config, did you change anything?
It certainly does seem to build a 2.6.32.36 kernel
0
 
Duncan RoeSoftware DeveloperCommented:
I think I have an answer for you, but I must caution that IMO mkinitramfs is not especially up to date. Or it may be that it tracks some other distribution than Slackware (that I use) and possibly Ubuntu (that you use). I suspect it actually tracks Suse, if it tracks anything.
So I updated mkinitramfs to take account of the following 2 issues:

1. Replace vol_id

vol_id has been superseded by blkid. The man page says one can make blkid output in a vol_id compatible form, but it gave me 2 lines so I dropped the second one. I have not tested whether the resultant line actually works.

2. Less udev commands

udevadm has replaced udevcontrol, udevtrigger and udevsettle. Therefore I changed the list of files to transfer from /sbin (I also changed the list because of vol_id)Here are the changes which you can apply with the patch utility, or implement by hand:
--- /usr/sbin/mkinitramfs.bu    2011-04-10 17:04:35.000000000 +1000
+++ /usr/sbin/mkinitramfs       2011-04-10 22:59:57.000000000 +1000
@@ -1,5 +1,5 @@
 #!/bin/bash
-
+#set -x
 ###########################################################################
 # Copyright (c) 2004-2006 Hai Zaar, Gil Ran and Alon Keren                #
 #                                                                         #
@@ -55,7 +55,7 @@
 [[ $SPLASH ]] && BINFILES="$BINFILES,fgconsole,chvt"
 [[ $CD ]] && BINFILES="$BINFILES,isoinfo"
 
-SBINFILES="insmod,modprobe,udevcontrol,udevd,udevsettle,udevtrigger,vol_id"
+SBINFILES="insmod,modprobe,udevadm,udevd,blkid"
 [[ $SPLASH ]] && SBINFILES="$SBINFILES,fbcondecor_helper,fbcondecor_ctl"
 [[ $EVMS ]] && SBINFILES="$SBINFILES,evms_activate,dmsetup"
 [[ $MDRAID ]] && SBINFILES="$SBINFILES,mdadm"
@@ -222,7 +222,7 @@
        # where to boot from
        MAJORMINOR=$(mountpoint -d . | tr : " ")
        mknod $IMAGEDIR/tmpnode b $MAJORMINOR || die
-       UUID=${UUID:-$(vol_id -u $IMAGEDIR/tmpnode)}
+       UUID=${UUID:-$(blkid -oudev -s UUID $IMAGEDIR/tmpnode|grep -v ENC)}
        rm -rf $IMAGEDIR/tmpnode
 
        # See if we were forced to use some console, or if we should not redirct at all

Open in new window

Don't worry about the commented-out set -x on line 2 - that was just me trying to figure out what was going on.

The Trick

Lastly I found there is something you have to do to make mkinitramfs use the kernel you just built, tather than what you have currently installed:
sudo echo 2.6.32.36>/boot/version

Open in new window

Now you should be fine to replace lines 13 and 14 of your instructions with
sudo depmod 2.6.32.36
sudo mkinitramfs -o /boot/initrd-2.6.32.36.img 2.6.32.36

Open in new window

0
 
bV_Author Commented:
echo into version resolved the issue
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now