Bug#695241: linux: Add basic arm64 support
+++ Ben Hutchings [2013-10-13 19:20 +0100]:
> > diff -urN origs/linux-3.10.11/debian/changelog build/linux-3.10.11/debian/changelog
> > --- origs/linux-3.10.11/debian/changelog 2013-09-10 14:13:17.000000000 +0100
> > +++ build/linux-3.10.11/debian/changelog 2013-10-11 04:05:57.380980848 +0100
> > @@ -1,3 +1,9 @@
> > +linux (3.10.11-1~arm64) UNRELEASED; urgency=low
> > +
> > + * Add arm64 packaging
> > +
> > + -- <wookey@debian.org> Sat, 05 Oct 2013 02:24:25 +0100
> > +
> > linux (3.10.11-1) unstable; urgency=low
> >
> > * New upstream stable update:
>
> This should be targetted at 3.11 (trunk in svn).
Hmm. I was working off latest released package in unstable as that's
the one I get to dowload and build. What do I need to do to 'target
trunk in svn'? (e.g. where is it?)
> > diff -urN origs/linux-3.10.11/debian/config/arm64/config build/linux-3.10.11/debian/config/arm64/config
> > --- origs/linux-3.10.11/debian/config/arm64/config 1970-01-01 01:00:00.000000000 +0100
> > +++ build/linux-3.10.11/debian/config/arm64/config 2013-10-09 16:56:22.585330811 +0100
> > @@ -0,0 +1,35 @@
> > +##
> > +## File arch/arm64/Kconfig
> > +##
> > +CONFIG_ARCH_VEXPRESS=y
> > +CONFIG_CMDLINE="console=ttyAMA0"
>
> I don't think it is appropriate to include a command line in a Debian
> kernel configuration.
We need to specify the default console somehow - is there a better
way? I just copied that out of existing arm64 kernel configs. Maybe
it's set in the kernel itself; and this line is not needed? I can't
see such code. Nor is it set in the dts - and maybe it should be. (I
can't build it to test because I need a toolchain and rootfs, and this
patch is part of getting a working debian crosstoolchain.)
> > +##
> > +## File drivers/block/Kconfig
> > +##
> > +CONFIG_BLK_DEV_RAM=y
>
> Why?
It was in all the existing arm64 configs, and people I asked said it
was a good idea. I don't actually have a concrete reason. I believe
it's needed for initrds, but maybe I'm wrong about that?
> > +##
> > +## File mm/Kconfig
> > +##
> > +CONFIG_HUGETLB_PAGE=y
>
> ...is not a configurable symbol (or defined in mm/Kconfig).
Hmm. that does seem to be left over from ancient kernels. OK, forget
that too.
> > +##
> > +## File drivers/mmc/Kconfig
> > +##
> > +CONFIG_MMC=y
> > +
> > +##
> > +## File drivers/regulator/Kconfig
> > +##
> > +CONFIG_REGULATOR_VEXPRESS=y
> > +
> > +##
> > +## File block/partitions/Kconfig
> > +##
> > +CONFIG_EFI_PARTITION=y
>
> ...is already set that way in debian/config/config.
Sorry - thought I'd checked for all those. Must have missed that one.
That's fine then.
> > +##
> > +## File fs/nfs/Kconfig
> > +##
> > +CONFIG_ROOT_NFS=y
>
> Pointless when you have an initramfs, so disable it.
But we don't have an initramfs yet. klibc is not yet ported to arm64
so initramfs doesn't work, so we can't use it. Once klibc arm64 is in
debian, I agree this setting is not needed for a distro kernel.
It's also really useful with a model which is all we have to build on
currently.
> > diff -urN origs/linux-3.10.11/debian/config/arm64/config.vexpress build/linux-3.10.11/debian/config/arm64/config.vexpress
> > --- origs/linux-3.10.11/debian/config/arm64/config.vexpress 1970-01-01 01:00:00.000000000 +0100
> > +++ build/linux-3.10.11/debian/config/arm64/config.vexpress 2013-10-08 03:12:22.195734618 +0100
> > @@ -0,0 +1,3 @@
> > +#
> > +# All arm64 flavours are intended to use the same kernel config.
> > +# So nothing in here yet
> [...]
>
> Then why is the flavour called 'vexpress'? I would suggest just 'arm64'.
Everyone calls it that, because that's what the model emulates, and
that's the only 'hardware' available. But yes, from debian's POV maybe
'arm64' is better. Does there have to be a 'flavour' name as well as
an arch name? Could be arm64mp in line with 32-bit arm? or just
'generic'? Having 'arm64' for both arch and flavour seems a bit clumsy.
Does a config/arm64/config.arm64 file do anything if we already have
config/arm64/config? Or should it just be deleted? None of the other
arches give an example of a null $flavour. Or do we need to keep it
arch=arm64, flavour=arm64 so the machinery works?
We will need a per-flavour DTB I guess.
> Also, you seem to have forgotten to include your changes to
> debian/rules.real.
I didn't change anything in there as I though $arch was
parameterised, but I see there is arch-specific stuff. And the base
build I can test so far worked without changing anything.
Patch updated according to the above.
Wookey
--
Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
diff -urN origs/linux-3.10.11/arch/s390/include/asm/cmb.h.1 build/linux-3.10.11/arch/s390/include/asm/cmb.h.1
diff -urN origs/linux-3.10.11/debian/changelog build/linux-3.10.11/debian/changelog
--- origs/linux-3.10.11/debian/changelog 2013-09-10 14:13:17.000000000 +0100
+++ build/linux-3.10.11/debian/changelog 2013-10-11 04:05:57.380980848 +0100
@@ -1,3 +1,10 @@
+linux (3.10.11-1~arm64) UNRELEASED; urgency=low
+
+ * Add support for stage1 build of linux-libc-dev
+ * Add arm64 packaging
+
+ -- <wookey@debian.org> Sat, 05 Oct 2013 02:24:25 +0100
+
linux (3.10.11-1) unstable; urgency=low
* New upstream stable update:
diff -urN origs/linux-3.10.11/debian/config/arm64/config build/linux-3.10.11/debian/config/arm64/config
--- origs/linux-3.10.11/debian/config/arm64/config 1970-01-01 01:00:00.000000000 +0100
+++ build/linux-3.10.11/debian/config/arm64/config 2013-10-14 03:30:34.675760904 +0100
@@ -0,0 +1,20 @@
+##
+## File arch/arm64/Kconfig
+##
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_CMDLINE="console=ttyAMA0"
+
+##
+## File drivers/mmc/Kconfig
+##
+CONFIG_MMC=y
+
+##
+## File drivers/regulator/Kconfig
+##
+CONFIG_REGULATOR_VEXPRESS=y
+
+##
+## File fs/nfs/Kconfig
+##
+CONFIG_ROOT_NFS=y
diff -urN origs/linux-3.10.11/debian/config/arm64/config.arm64 build/linux-3.10.11/debian/config/arm64/config.arm64
--- origs/linux-3.10.11/debian/config/arm64/config.arm64 1970-01-01 01:00:00.000000000 +0100
+++ build/linux-3.10.11/debian/config/arm64/config.arm64 2013-10-08 03:12:22.195734618 +0100
@@ -0,0 +1,3 @@
+#
+# All arm64 flavours are intended to use the same kernel config.
+# So nothing in here yet
\ No newline at end of file
diff -urN origs/linux-3.10.11/debian/config/arm64/defines build/linux-3.10.11/debian/config/arm64/defines
--- origs/linux-3.10.11/debian/config/arm64/defines 1970-01-01 01:00:00.000000000 +0100
+++ build/linux-3.10.11/debian/config/arm64/defines 2013-10-14 02:46:57.794783543 +0100
@@ -0,0 +1,15 @@
+[base]
+flavours:
+ arm64
+kernel-arch: arm64
+
+[image]
+configs:
+ arm64/config
+
+[arm64_build]
+image-file: arch/arm64/boot/zImage
+
+[arm64_description]
+hardware: Generic arm64 hardware
+
diff -urN origs/linux-3.10.11/debian/config/defines build/linux-3.10.11/debian/config/defines
--- origs/linux-3.10.11/debian/config/defines 2013-09-07 22:48:51.000000000 +0100
+++ build/linux-3.10.11/debian/config/defines 2013-10-05 02:11:11.144228257 +0100
@@ -7,6 +7,7 @@
amd64
armel
armhf
+ arm64
hppa
i386
ia64
diff -urN origs/linux-3.10.11/debian/config.defines.dump build/linux-3.10.11/debian/config.defines.dump
\ No newline at end of file
diff -urN origs/linux-3.10.11/debian/control build/linux-3.10.11/debian/control
--- origs/linux-3.10.11/debian/control 2013-09-10 14:13:31.000000000 +0100
+++ build/linux-3.10.11/debian/control 2013-10-11 04:02:48.580045698 +0100
@@ -4,7 +4,7 @@
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Uploaders: Bastian Blank <waldi@debian.org>, Frederik Schüler <fs@debian.org>, maximilian attems <maks@debian.org>, Ben Hutchings <ben@decadent.org.uk>
Standards-Version: 3.9.4
-Build-Depends: debhelper (>> 7), cpio, kmod | module-init-tools, python (>= 2.7), lzma [armel], kernel-wedge (>= 2.84), quilt, patchutils, bc, gcc-4.7 [alpha amd64 armel armhf i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64], gcc-4.4 [hppa], binutils-hppa64 [hppa], gcc-4.4-hppa64 [hppa], gcc-4.8 [m68k]
+Build-Depends: debhelper (>> 7), cpio, kmod | module-init-tools, python (>= 2.7), lzma [armel], kernel-wedge (>= 2.84), quilt, patchutils, bc, gcc-4.7 [alpha amd64 armel armhf arm64 i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64], gcc-4.4 [hppa], binutils-hppa64 [hppa], gcc-4.4-hppa64 [hppa], gcc-4.8 [m68k]
Build-Depends-Indep: xz-utils, xmlto
Vcs-Svn: svn://anonscm.debian.org/svn/kernel/dists/trunk/linux/
Vcs-Browser: http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/
@@ -67,7 +67,7 @@
Multi-Arch: foreign
Package: linux-libc-dev
-Architecture: alpha amd64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64 x32
+Architecture: alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64 x32
Section: devel
Provides: linux-kernel-headers
Depends: ${misc:Depends}
@@ -80,7 +80,7 @@
Multi-Arch: same
Package: linux-headers-3.10-3-all
-Architecture: alpha amd64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
+Architecture: alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
Depends: linux-headers-3.10-3-all-${kernel:Arch} (= ${binary:Version}), ${misc:Depends}
Description: All header files for Linux 3.10 (meta-package)
This package depends against all architecture-specific kernel header files
@@ -96,7 +96,7 @@
kernel modules.
Package: linux-headers-3.10-3-common
-Architecture: alpha amd64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
+Architecture: alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
Depends: ${misc:Depends}
Description: Common header files for Linux 3.10-3
This package provides the architecture-specific common kernel header files
@@ -3725,10 +3725,10 @@
that load into the kernel provided by the linux-image-3.10-3-omap package.
Package: linux-image-3.10-3-vexpress
-Architecture: armhf
+Architecture: arm64 armhf
Provides: linux-image, linux-modules-3.10-3-vexpress
Pre-Depends: debconf | debconf-2.0
-Depends: kmod | module-init-tools, linux-base (>= 3~), ${misc:Depends}, initramfs-tools (>= 0.110~) [armhf] | linux-initramfs-tool [armhf]
+Depends: kmod | module-init-tools, linux-base (>= 3~), ${misc:Depends}, initramfs-tools (>= 0.110~) [armhf arm64] | linux-initramfs-tool [armhf arm64]
Recommends: firmware-linux-free (>= 3~)
Suggests: linux-doc-3.10, debian-kernel-handbook, fdutils [armhf]
Breaks: at (<< 3.1.12-1+squeeze1), initramfs-tools (<< 0.110~)
@@ -3737,7 +3737,7 @@
family of processors.
Package: linux-headers-3.10-3-vexpress
-Architecture: armhf
+Architecture: arm64 armhf
Provides: linux-headers
Depends: linux-headers-3.10-3-common (= ${binary:Version}), linux-kbuild-3.10, ${misc:Depends}, gcc-4.7
Description: Header files for Linux 3.10-3-vexpress
@@ -3748,6 +3748,14 @@
modules that load into the kernel provided by the
linux-image-3.10-3-vexpress package.
+Package: linux-headers-3.10-3-all-arm64
+Architecture: arm64
+Depends: ${misc:Depends}, linux-headers-3.10-3-vexpress (= ${binary:Version})
+Description: All header files for Linux 3.10 (meta-package)
+ This package depends against all architecture-specific kernel header files
+ for Linux kernel version 3.10, generally used for building out-of-tree
+ kernel modules.
+
Package: linux-headers-3.10-3-all-hppa
Architecture: hppa
Depends: ${misc:Depends}, linux-headers-3.10-3-parisc (= ${binary:Version}), linux-headers-3.10-3-parisc-smp (= ${binary:Version}), linux-headers-3.10-3-parisc64 (= ${binary:Version}), linux-headers-3.10-3-parisc64-smp (= ${binary:Version})
diff -urN origs/linux-3.10.11/debian/control.md5sum build/linux-3.10.11/debian/control.md5sum
diff -urN origs/linux-3.10.11/debian/rules build/linux-3.10.11/debian/rules
--- origs/linux-3.10.11/debian/rules 2013-05-04 21:47:13.000000000 +0100
+++ build/linux-3.10.11/debian/rules 2013-10-05 02:35:15.067387273 +0100
@@ -28,6 +28,15 @@
build: build-arch build-indep
+#for stage1 don't try to do base setup - just build the libc-headers
+ifneq (,$(filter stage1,$(DEB_BUILD_PROFILE)))
+
+build-arch: debian/control
+
+build-indep: debian/control
+
+else
+
build-arch: debian/control
dh_testdir
$(MAKE) -f debian/rules.gen build-arch_$(DEB_HOST_ARCH)
@@ -36,12 +45,24 @@
dh_testdir
$(MAKE) -f debian/rules.gen build-indep
+endif
+
binary: binary-indep binary-arch
+#for stage1 don't try to do base setup - just build the libc-headers
+ifneq (,$(filter stage1,$(DEB_BUILD_PROFILE)))
+binary-arch:
+ dh_testdir
+ $(MAKE) -f debian/rules.gen binary-libc-dev_$(DEB_HOST_ARCH)
+
+else
+
binary-arch:
dh_testdir
$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
+endif
+
binary-indep:
dh_testdir
$(MAKE) -f debian/rules.gen binary-indep
diff -urN origs/linux-3.10.11/debian/rules.real build/linux-3.10.11/debian/rules.real
--- origs/linux-3.10.11/debian/rules.real 2013-07-22 00:31:19.000000000 +0100
+++ build/linux-3.10.11/debian/rules.real 2013-10-14 03:29:58.015573734 +0100
@@ -375,12 +375,12 @@
install-image_sh4_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/zImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
-ifneq ($(filter armel armhf,$(ARCH)),)
+ifneq ($(filter armel armhf arm64,$(ARCH)),)
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image: DTB_INSTALL_DIR = /usr/lib/linux-image-$(REAL_VERSION)
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_image:
install -m644 '$(DIR)/arch/$(KERNEL_ARCH)/boot/zImage' $(INSTALL_DIR)/vmlinuz-$(REAL_VERSION)
+$(MAKE_CLEAN) -C $(DIR) dtbs
- shopt -s nullglob ; for i in $(DIR)/arch/arm/boot/dts/*.dtb ; do \
+ shopt -s nullglob ; for i in $(DIR)/arch/$(KERNEL_ARCH)/boot/dts/*.dtb ; do \
install -D -m644 $$i '$(PACKAGE_DIR)'/'$(DTB_INSTALL_DIR)'/$$(basename $$i) ; \
done
endif
Reply to: