kernel-{build,install}.eclass: more ARM support
authorAlexey Shvetsov <alexxy@gentoo.org>
Thu, 21 May 2020 18:29:32 +0000 (21:29 +0300)
committerMichał Górny <mgorny@gentoo.org>
Thu, 21 May 2020 19:31:50 +0000 (21:31 +0200)
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
eclass/kernel-build.eclass
eclass/kernel-install.eclass

index ba4b012dc4cfb4d97e7881953f3ed65120e316f1..7d674fa9cf48ac469486ab51f73a1b5f54f4ec28 100644 (file)
@@ -99,9 +99,13 @@ kernel-build_src_compile() {
 # from kernel-install.eclass with the correct paths.
 kernel-build_src_test() {
        debug-print-function ${FUNCNAME} "${@}"
+       local targets=( modules_install )
+       if use arm || use arm64; then
+               targets+=( dtbs_install )
+       fi
 
        emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
-               INSTALL_MOD_PATH="${T}" modules_install
+               INSTALL_MOD_PATH="${T}" "${targets[@]}"
 
        kernel-install_test "${PV}" \
                "${WORKDIR}/build/$(kernel-install_get_image_path)" \
@@ -117,8 +121,19 @@ kernel-build_src_install() {
 
        # do not use 'make install' as it behaves differently based
        # on what kind of installkernel is installed
+       local targets=( modules_install )
+       if use arm || use arm64; then
+               targets+=( dtbs_install )
+       fi
+
        emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
-               INSTALL_MOD_PATH="${ED}" modules_install
+               INSTALL_MOD_PATH="${ED}" "${targets[@]}"
+
+       # on arm or arm64 dtbs also needed
+       if (use arm || use arm64); then
+               emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
+                       INSTALL_PATH="${ED}/boot" dtbs_install
+       fi
 
        # note: we're using mv rather than doins to save space and time
        # install main and arch-specific headers first, and scripts
index c26af5c2e88bad32d591690819225f909c5aa5c8..efccd70608c09f89b5c9b727bce1e4b720ca5b16 100644 (file)
@@ -92,6 +92,12 @@ kernel-install_get_image_path() {
                amd64|x86)
                        echo arch/x86/boot/bzImage
                        ;;
+               arm64)
+                       echo arch/arm64/boot/Image.gz
+                       ;;
+               arm)
+                       echo arch/arm/boot/zImage
+                       ;;
                *)
                        die "${FUNCNAME}: unsupported ARCH=${ARCH}"
                        ;;
@@ -176,6 +182,12 @@ kernel-install_get_qemu_arch() {
                x86)
                        echo i386
                        ;;
+               arm)
+                       echo arm
+                       ;;
+               arm64)
+                       echo aarch64
+                       ;;
                *)
                        die "${FUNCNAME}: unsupported ARCH=${ARCH}"
                        ;;