Linux-KBuild Archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: ns@tfwno.gf
Cc: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas@fjasle.eu>,
	linux-kbuild@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: make install doesn't install proper files for some architectures
Date: Fri, 23 Feb 2024 12:31:47 +0900	[thread overview]
Message-ID: <CAK7LNARtPGSvihrOnhUXPEhw2o-q-UUtTx7xg7TVVby6KPTGXQ@mail.gmail.com> (raw)
In-Reply-To: <06e09da69e6c34d03a303c11088d9ffd@tfwno.gf>

On Fri, Feb 23, 2024 at 2:07 AM <ns@tfwno.gf> wrote:
>
> Greetings,
>
> The kernel's build system has an install target. Most of the time this
> works fine, but it is limited to only one file, which can make it busted
> for some arches.
>
> One example of a target where it is busted is a generic ppc32 kernel,
> where there are plenty of supported platforms, some of which can boot
> perfectly fine through Open Firmware & some which are from bad, bad
> times o' yore where you had to embed the DT straight into the kernel. &
> some more on top of that. When you run make install for ppc32, it only
> installs the uncompressed vmlinux. This is almost certainly not the
> correct decision for _any_ of the platforms in question, & it totally
> leaves out the properly wrapped images that many of these platforms
> absolutely need in order to boot (e.g. PS3 & Wii, which need an image
> with an embedded DT).
>
> This is not really great. By contrast, the all target built all the
> specific images that my config selected. I didn't have to read the
> arch's boot Makefile to figure out what files I have to build. Is there
> any target which does the same but for installing every image the all
> target produced? It'd be a much better experience than leaving the
> details of every arch & bizzare platform supported by it up to (most
> likely incomplete) scripts, when the Makefiles already have all that
> information properly written. I suppose it'd also come in handy if e.g.
> x86 had a saner image format [1] in the future or something of the sort.
>
> [1]:
> https://source.denx.de/u-boot/u-boot/-/blob/master/doc/usage/fit/x86-fit-boot.rst




If you see scripts/install.sh, the second parameter
to 'installkernel' is ${KBUILD_IMAGE}.



arch Makefile can set the best image to install,
but there is no such code in arch/powerpc/Makefile.

Presumably, 'make install' will install the default
'vmlinux' for powerpc.






$ git grep KBUILD_IMAGE -- arch/
arch/arm/Makefile:KBUILD_IMAGE := $(boot)/xipImage
arch/arm/Makefile:KBUILD_IMAGE := $(boot)/zImage
arch/arm/Makefile:all:  $(notdir $(KBUILD_IMAGE))
arch/arm/Makefile:$(INSTALL_TARGETS): KBUILD_IMAGE =
$(boot)/$(patsubst %install,%Image,$@)
arch/arm64/Makefile:KBUILD_IMAGE        := $(boot)/Image.gz
arch/arm64/Makefile:KBUILD_IMAGE        := $(boot)/vmlinuz.efi
arch/arm64/Makefile:all:        $(notdir $(KBUILD_IMAGE))
arch/arm64/Makefile:install: KBUILD_IMAGE := $(boot)/Image
arch/loongarch/Makefile:KBUILD_IMAGE    := $(boot)/vmlinux.elf
arch/loongarch/Makefile:KBUILD_IMAGE    := $(boot)/$(image-name-y).efi
arch/loongarch/Makefile:all:    $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS)
arch/loongarch/Makefile:        $(Q)install -D -m 755 $(KBUILD_IMAGE)
$(INSTALL_PATH)/$(image-name-y)-$(KERNELRELEASE)
arch/m68k/Makefile:install: KBUILD_IMAGE := vmlinux.gz
arch/mips/boot/compressed/Makefile:$(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE
arch/nios2/Makefile:KBUILD_IMAGE := $(nios2-boot)/vmImage
arch/nios2/Makefile:  echo  '* vmImage         - Kernel-only image for
U-Boot ($(KBUILD_IMAGE))'
arch/parisc/Makefile:KBUILD_IMAGE := $(boot)/bzImage
arch/parisc/Makefile:install: KBUILD_IMAGE := vmlinux
arch/parisc/Makefile:zinstall: KBUILD_IMAGE := vmlinuz
arch/riscv/Makefile:KBUILD_IMAGE := $(boot)/xipImage
arch/riscv/Makefile:KBUILD_IMAGE        := $(boot)/Image.gz
arch/riscv/Makefile:KBUILD_IMAGE := $(boot)/loader.bin
arch/riscv/Makefile:KBUILD_IMAGE := $(boot)/Image.gz
arch/riscv/Makefile:KBUILD_IMAGE := $(boot)/vmlinuz.efi
arch/riscv/Makefile:all:        $(notdir $(KBUILD_IMAGE))
arch/riscv/Makefile:install: KBUILD_IMAGE := $(boot)/Image
arch/riscv/Makefile:zinstall: KBUILD_IMAGE := $(boot)/Image.gz
arch/s390/Makefile:#KBUILD_IMAGE is necessary for packaging targets
like rpm-pkg, deb-pkg...
arch/s390/Makefile:KBUILD_IMAGE := $(boot)/bzImage
arch/sh/Makefile:KBUILD_IMAGE           := $(boot)/$(defaultimage-y)
arch/sh/Makefile:all: $(notdir $(KBUILD_IMAGE))
arch/sparc/Makefile:KBUILD_IMAGE := $(boot)/zImage
arch/x86/Makefile:# KBUILD_IMAGE specify target image being built
arch/x86/Makefile:KBUILD_IMAGE := $(boot)/bzImage
arch/x86/Makefile:      $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)




-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2024-02-23  3:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 17:07 make install doesn't install proper files for some architectures ns
2024-02-23  3:31 ` Masahiro Yamada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNARtPGSvihrOnhUXPEhw2o-q-UUtTx7xg7TVVby6KPTGXQ@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=ns@tfwno.gf \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).