[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: UML kernel define/config and arch/subarch



On Sun, Jan 22, 2006 at 11:21:34PM +0100, Mattia Dongili wrote:
> Hello,
> 
> as some of you already knows I'm trying to add the "um" subarch to build
> UML kernels.

It seems I had some (partial) success in merging UML kernel build but I
needed some changes to the build scripts and there's still somthing
obscure to me. I'd really appreciate if someone could spend some time
adding some light.

[ I know I still need a lot of work and before going ahead I'd like
  some feedback as I'm still digging into the scripts (I'm not used to
  python) to fully understand the whole process. ]

The first change is related to templates since kernel-package builds
linux-uml-foo instead of linux-image-foo. Thus I hacked gencontrol.py to
check for the existence of control.image.$arch.$subarch.in and use it if
present. Smarter ideas anyone?

/-------------------------------
| diff -Nru -x.svn -xpatches debian/bin/gencontrol.py ../UML/pkg-uml/linux-2.6.15.um/debian/bin/gencontrol.py
| --- debian/bin/gencontrol.py    2006-01-23 19:16:37.903105163 +0100
| +++ ../UML/pkg-uml/linux-2.6.15.um/debian/bin/gencontrol.py     2006-01-29 18:39:04.633879000 +0100
| @@ -97,7 +97,10 @@
|          makeflags['LOCALVERSION_HEADERS'] = localversion_headers
|  
|      def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
| -        image = self.templates["control.image"]
| +        if self.templates.exists("control.image.%s.%s" % (arch, subarch)):
| +          image = self.templates["control.image.%s.%s" % (arch, subarch)]
| +        else:
| +          image = self.templates["control.image"]
|          headers = self.templates["control.headers"]
|          image_latest = self.templates["control.image.latest"]
|          headers_latest = self.templates["control.headers.latest"]
| diff -Nru -x.svn -xpatches debian/lib/python/debian_linux/utils.py ../UML/pkg-uml/linux-2.6.15.um/debian/lib/python/debian_linux/utils.py
| --- debian/lib/python/debian_linux/utils.py     2006-01-16 20:25:38.891158750 +0100
| +++ ../UML/pkg-uml/linux-2.6.15.um/debian/lib/python/debian_linux/utils.py      2006-01-29 19:18:22.554274000 +0100
| @@ -1,4 +1,4 @@
| -import debian, re, textwrap
| +import debian, re, textwrap, os.path
|  
|  class _sorted_dict(dict):
|      __slots__ = ('_list')
| @@ -126,6 +126,9 @@
|  
|          return entries
|  
| +    def exists(self, filename):
| +       return os.path.exists("%s/%s.in" % (self.dir, filename))
| +
|  class wrap(textwrap.TextWrapper):
|      wordsep_re = re.compile(
|          r'(\s+|'                                  # any whitespace
\-------------------------------

Second, I changed debian/rules.real to read

/-------------------------------
| @@ -33,7 +32,7 @@
|  # replaced by the flavour for which the command is run. 
|  #
|  kpkg_image := make-kpkg --append-to-version '$(KPKG_ABINAME)$(LOCALVERSION)'
| -kpkg_image += --arch '$(ARCH)'
| +kpkg_image += --arch '$(KPKG_ARCH)'
|  kpkg_image += --stem linux
|  kpkg_image += --initrd
|  ifdef KPKG_SUBARCH
\-------------------------------

using KPKG_ARCH instead of ARCH to build the make-kpkg command. But I
did see that Sven had already reverted such a modification somewhen in
svn. Is it possible to reintroduce it? (yes it was slightly different)

More changes are needed to deal with the headers package which I believe
it doesn't make much sense building for UML.
I could test if kernel-header-dirs is not defined simply don't include
anything related to the headers?
Also the initrd image won't be needed at install time as that is tightly
related to the rootfs the guest will boot. Probably when creating rootfs
we could also create the ramdisk image.

Am I on a totally wrong track?

That's all right now :)
-- 
mattia
:wq!



Reply to: