Attached patch installs the kernel headers into the UML package. But it
is not the equivalent of the kernel header packages shipped by the
Debian Kernel team. Many of the arch/ specific headers as well as the
Module symbol versions file is missing.

Thus this does not help in building kernel modules for packages like
iscsitarget, dkms etc.

Perhaps someone could take and extend it further to provide proper support.


On Sunday 12 December 2010 01:06 AM, Ritesh Raj Sarraf wrote:
> Maybe you should consider packaging the headers now.
>
> We have kvm, but even with virtio, it is not very pleasing on a laptop.
> Then we have lxc, but that does not allow playing with kernel modules.
>
> The closest option is the good old UML.
>
>
> -- 
> Ritesh Raj Sarraf | http://people.debian.org/~rrs
> Debian - The Universal Operating System
From 8dd7c0bae54197ea5756ac219f6f136c1f6aade4 Mon Sep 17 00:00:00 2001
From: Ritesh Raj Sarraf <r...@researchut.com>
Date: Mon, 18 Jun 2012 23:53:31 +0530
Subject: [PATCH] Add support for UML kernel headers

Signed-off-by: Ritesh Raj Sarraf <r...@researchut.com>

Closes: #186930
---
 debian/rules |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/debian/rules b/debian/rules
index edb0ed4..25b6785 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,7 @@ kernel_dir:=linux-source-$(kernel_version)
 debian:=$(CURDIR)/debian
 tmp:=$(debian)/user-mode-linux
 tmpmodules:=$(debian)/uml-modules
+tmpheaders:=$(debian)/uml-headers
 DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 #SUBARCH?=$(shell uname -m)
 
@@ -103,12 +104,19 @@ endif
 		INSTALL_MOD_PATH=$(tmpmodules) \
 		INSTALL_MOD_STRIP=$(MODSTIP)
 
+        $(MAKE) -C $(kernel_dir) headers_install \
+                INSTALL_HDR_PATH=$(tmpheaders)
+
 	-rm $(tmpmodules)/lib/modules/*/build
 	-rm $(tmpmodules)/lib/modules/*/source
+
 	mv $(tmpmodules)/lib/modules \
 		$(tmp)/usr/lib/uml/modules
 	rm -rf $(tmpmodules)
 
+        mv $(tmpheaders) $(tmp)/usr/lib/uml/headers
+        rm -rf $(tmpheaders)
+
 	install -m 644 $(kernel_dir)/.config \
 		$(tmp)/usr/share/doc/user-mode-linux/config
 
-- 
1.7.10

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to