[ptxdist] [PATCH 0/2] kernel image generation extensions
Hei hei, for an older at91sam9g20 based platform I recently updated the kernel from ancient without DT to 4.x with DT. This patch series has two patches. The first is quite small and I consider it useful for everybody. The second depends on the first and covers a special usecase and may not be of common interest. I put it here anyway because it at least shows how I extended the kernel image generation rules. ;-) Greets Alex Alexander Dahl (2): kernel: pass loadaddr for building uImage image_kernel: new options for "appended DT" images platforms/image_kernel.in| 26 ++ platforms/kernel.in | 7 +++ rules/kernel.make| 11 +++ rules/post/image_kernel.make | 32 4 files changed, 76 insertions(+) -- 2.1.4 ___ ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage
On newer kernels (4.x ?) kernel build fails when building an uImage unless you provide LOADADDR as kernel make var, which is put in the resulting uImage header. You could append it to PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This patch extends the menu if uImage is selected so you can directly input the desired address. Signed-off-by: Alexander Dahl --- platforms/kernel.in | 7 +++ rules/kernel.make | 5 + 2 files changed, 12 insertions(+) diff --git a/platforms/kernel.in b/platforms/kernel.in index fd1c492..2a00122 100644 --- a/platforms/kernel.in +++ b/platforms/kernel.in @@ -213,6 +213,13 @@ config KERNEL_IMAGE config KERNEL_DTC bool +config KERNEL_LOADADDR + hex + prompt "uImage load address" + depends on KERNEL_IMAGE_U + help + Newer kernels want this passed if you build an uImage. + config KERNEL_XZ prompt "build xz-utils hosttool" bool diff --git a/rules/kernel.make b/rules/kernel.make index d02a69c..3270231 100644 --- a/rules/kernel.make +++ b/rules/kernel.make @@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \ DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod endif +ifdef PTXCONF_KERNEL_IMAGE_U +KERNEL_MAKEVARS += \ + LOADADDR=$(PTXCONF_KERNEL_LOADADDR) +endif + # # Make the build more predictable if $(KERNEL_DIR) is not a symlink # -- 2.1.4 ___ ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] [PATCH 2/2] image_kernel: new options for "appended DT" images
On a platform where we can not load a separate device tree binary blob with the old bootloader we use the kernel option CONFIG_ARM_APPENDED_DTB to load the DT blob. This requires creating a zImage, concatenate the dtb file and put this back to an uImage. This patch extends the image generation rules so this is possible automatically with just a few options in the menu. Signed-off-by: Alexander Dahl --- platforms/image_kernel.in| 26 ++ platforms/kernel.in | 2 +- rules/kernel.make| 6 ++ rules/post/image_kernel.make | 32 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/platforms/image_kernel.in b/platforms/image_kernel.in index 1f32576..e7928b3 100644 --- a/platforms/image_kernel.in +++ b/platforms/image_kernel.in @@ -44,4 +44,30 @@ config IMAGE_KERNEL_LZOP_EXTRA_ARGS string prompt "extra arguments passed to the lzop command" +menuconfig IMAGE_KERNEL_APPENDED_DTB_ZIMAGE + bool + prompt "Generate image with appended DT blob" + depends on DTC + depends on KERNEL_IMAGE_Z + help + Old bootloaders may not be able load a separate device tree binary + blob, so the kernel offers the option CONFIG_ARM_APPENDED_DTB to + append the dtb directly to a zImage and load it from there. + +config IMAGE_KERNEL_APPENDED_DTB_FILE + string + prompt "dtb filename" + depends on IMAGE_KERNEL_APPENDED_DTB_ZIMAGE + help + You can build several dtb files, but it only makes sense to + concatenate one to the kernel image. Enter the filename here! + +config IMAGE_KERNEL_APPENDED_DTB_UIMAGE + bool + prompt "additional uImage" + depends on IMAGE_KERNEL_APPENDED_DTB_ZIMAGE + select HOST_U_BOOT_TOOLS + help + Make a uImage from the concatenated zImage/dtb file. + endif diff --git a/platforms/kernel.in b/platforms/kernel.in index 2a00122..0a894b2 100644 --- a/platforms/kernel.in +++ b/platforms/kernel.in @@ -216,7 +216,7 @@ config KERNEL_DTC config KERNEL_LOADADDR hex prompt "uImage load address" - depends on KERNEL_IMAGE_U + depends on KERNEL_IMAGE_U || IMAGE_KERNEL_APPENDED_DTB_UIMAGE help Newer kernels want this passed if you build an uImage. diff --git a/rules/kernel.make b/rules/kernel.make index 3270231..dc1e240 100644 --- a/rules/kernel.make +++ b/rules/kernel.make @@ -280,6 +280,12 @@ $(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage ifdef PTXCONF_IMAGE_KERNEL_LZOP $(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage.lzo endif +ifdef PTXCONF_IMAGE_KERNEL_APPENDED_DTB_ZIMAGE +$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linux_dtb.zImage +endif +ifdef PTXCONF_IMAGE_KERNEL_APPENDED_DTB_UIMAGE +$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linux_dtb.uImage +endif endif $(STATEDIR)/kernel.targetinstall.post: diff --git a/rules/post/image_kernel.make b/rules/post/image_kernel.make index a401d71..402b743 100644 --- a/rules/post/image_kernel.make +++ b/rules/post/image_kernel.make @@ -10,6 +10,8 @@ SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL) += $(IMAGEDIR)/linuximage SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL_LZOP) += $(IMAGEDIR)/linuximage.lzo +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL_APPENDED_DTB_ZIMAGE) += $(IMAGEDIR)/linux_dtb.zImage +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL_APPENDED_DTB_UIMAGE) += $(IMAGEDIR)/linux_dtb.uImage ifdef PTXCONF_IMAGE_KERNEL_INITRAMFS $(IMAGEDIR)/linuximage: $(STATEDIR)/image_kernel.compile @@ -33,4 +35,34 @@ $(IMAGEDIR)/linuximage.lzo: $(IMAGEDIR)/linuximage @lzop -f $(call remove_quotes,$(PTXCONF_IMAGE_KERNEL_LZOP_EXTRA_ARGS)) -c "$(<)" > "$(@)" @echo "done." +$(IMAGEDIR)/linux_dtb.zImage: $(IMAGEDIR)/linuximage $(STATEDIR)/dtc.targetinstall + @echo -n "Creating '$(notdir $(@))' from '$(notdir $(<))' ..." + @cat "$(<)" "$(IMAGEDIR)/$(call remove_quotes,$(PTXCONF_IMAGE_KERNEL_APPENDED_DTB_FILE))" > "$(@)" + @echo ' done.' + +# +# Create architecture type for mkimage +# Most architectures are working with label $(PTXCONF_ARCH_STRING) +# but the i386 family needs "x86" instead! +# +ifeq ($(PTXCONF_ARCH_STRING),"i386") +MKIMAGE_ARCH := x86 +else +MKIMAGE_ARCH := $(PTXCONF_ARCH_STRING) +endif + +$(IMAGEDIR)/linux_dtb.uImage: $(IMAGEDIR)/linux_dtb.zImage + @echo "Creating '$(notdir $(@))' from '$(notdir $(<))' ..." + @$(PTXCONF_SYSROOT_HOST)/bin/mkimage \ + -A $(MKIMAGE_ARCH) \ + -O linux \ + -T kernel \ + -C none \ + -a $(PTXCONF_KERNEL_LOADADDR) \ + -e $(PTXCONF_KERNEL_LOADADDR) \ + -n "Linux-$(KERNEL_VERSION)" \ + -d "$(<)" \ + "$(@)" + @echo 'Done.' + # vim: syntax=make -- 2.1.4 ___ ptxdist mai
Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage
On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote: > On newer kernels (4.x ?) kernel build fails when building an uImage > unless you provide LOADADDR as kernel make var, which is put in the > resulting uImage header. You could append it to > PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This > patch extends the menu if uImage is selected so you can directly input > the desired address. I don't have a lot of experience with uImages. Marc, what do you think? > Signed-off-by: Alexander Dahl > --- > platforms/kernel.in | 7 +++ > rules/kernel.make | 5 + > 2 files changed, 12 insertions(+) > > diff --git a/platforms/kernel.in b/platforms/kernel.in > index fd1c492..2a00122 100644 > --- a/platforms/kernel.in > +++ b/platforms/kernel.in > @@ -213,6 +213,13 @@ config KERNEL_IMAGE > config KERNEL_DTC > bool > > +config KERNEL_LOADADDR > + hex > + prompt "uImage load address" > + depends on KERNEL_IMAGE_U > + help > + Newer kernels want this passed if you build an uImage. > + This should be right after the image selection. Michael > config KERNEL_XZ > prompt "build xz-utils hosttool" > bool > diff --git a/rules/kernel.make b/rules/kernel.make > index d02a69c..3270231 100644 > --- a/rules/kernel.make > +++ b/rules/kernel.make > @@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \ > DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod > endif > > +ifdef PTXCONF_KERNEL_IMAGE_U > +KERNEL_MAKEVARS += \ > + LOADADDR=$(PTXCONF_KERNEL_LOADADDR) > +endif > + > # > # Make the build more predictable if $(KERNEL_DIR) is not a symlink > # > -- > 2.1.4 > > > ___ > ptxdist mailing list > ptxdist@pengutronix.de -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ ptxdist mailing list ptxdist@pengutronix.de
[ptxdist] systemd 232
Hi, did you already start working on updating systemd to version 232? Thanks, Clemens PS: Any comments on the nginx patch yet? :) ___ ptxdist mailing list ptxdist@pengutronix.de
Re: [ptxdist] [PATCH] nginx: new package
Hi Clemens, just one comment for now: On Sunday 06 November 2016 20:12:18 Clemens Gruber wrote: > [...] > +if NGINX > + > +menu "Base settings " > + > +config NGINX_OPENSSL > + bool > + prompt "OpenSSL support" > + help > + Include OpenSSL support, which is required for the > + ngx_http_ssl_module. > + > +config NGINX_PCRE > + bool > + select LIBPCRE You already select it in the header. Cheers, Jürgen -- Pengutronix e.K. | Juergen Borleis | Industrial Linux Solutions | http://www.pengutronix.de/ | ___ ptxdist mailing list ptxdist@pengutronix.de