I think it's not super easy, if there were any kernel boot options that might help boot the HP with a standard kernel (like noapic, nomodeset, etc) I'd try those first.
Some instructions are too long & varied to post here [ https://help.ubuntu.com/community/Kernel/Compile ], but one page actually looks almost reasonable, if you're compiling for the same architecture & Ubuntu release.
These steps are for compiling a kernel on your current machine, if it's the same "type" x64 and running the same Ubuntu version it might work. [From https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel ]:
Obtaining the source for an Ubuntu release
apt-get source linux-image-$(uname -r)
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release codename>.git
For example to obtain the precise tree:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git
If you've not built a kernel on your system before, there are some packages needed before you can successfully build. You can get these installed with:
sudo apt-get build-dep linux-image-$(uname -r)
Modifying the configuration
[ Here's the part where you'd apply your patch. That link looks like the patch just modifies
drivers/mmc/card/block.c, so that file should be in the downloaded source files. It looks like it just adds a little bit to one line, so if you wanted to manually edit the one line with copy & paste that should work, it just removes the "
-" starting lines and adds the "
+" starting lines. Or using the
patch program with
patch --verbose -p1 <the_patch_file (maybe without the
-p1 if it doesn't work, controls how it finds the file to patch, see
man patch for info). If you're not doing other changes I'd skip the rest as the instructions suggest. ]
This step can be skipped if no configuration changes are wanted. The build process will use a configuration that is put together from various sub-config files. The simplest way to modify anything here is to run:
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
This takes the current configuration for each architecture/flavour supported and calls menuconfig to edit its config file. The chmod is needed because the way the source package is created, it loses the executable bits on the scripts.
apt-get will try to "upgrade" the kernel to the stock build/version of the Ubuntu kernel if you build a custom kernel without appending an extra string to the end of your kernel version. To prevent apt-get from listing the Ubuntu kernel as upgradeable when you type apt-get upgrade, you must (from the kernel documentation) append an extra string to the end of your kernel version. This will show up when you type uname, for example.
To prevent this, in the Kernel Configuration Menu, navigate and modify:
- General setup --->
- () Local version - append to kernel release
Building the kernel
Building the kernel is quite easy. Change your working directory to the root of the kernel source tree and then type the following commands:
fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic
If the build is successful, a set of three .deb binary package files will be produced in the directory above the build root directory. For example after building a kernel with version "2.6.38-7.37" on an amd64 system, these three (or four) .deb packages would be produced:
on later releases you will also find a linux-extra- package which you should also install if present.
Testing the new kernel
Install the three-package set (on your build system, or on a different target system) with dpkg -i and then reboot:
sudo dpkg -i linux*2.6.38-7.37*.deb
About the installing it part, I wouldn't bother building an ISO (with something like remastersys) that's probably just another headache ;-)
If you could just copy the files over to the hard drive that might work. I'd usually suggest a linux live cd/usb, but if Ubuntu won't boot... maybe a different distro with a different kernel, or use windows to copy the files, or a partition image and a windows-equivalent