2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
2022-02-16 00:41:13 +00:00
|
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
PKG_NAME="linux"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="GPL"
|
2023-11-04 22:16:38 +00:00
|
|
|
PKG_VERSION="6.5.10"
|
2022-11-01 10:04:06 +00:00
|
|
|
PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SITE="http://www.kernel.org"
|
2022-02-16 00:41:13 +00:00
|
|
|
PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host"
|
2023-11-03 21:23:43 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain linux:host kmod:host cpio:host xz:host keyutils ncurses openssl:host wireless-regdb ${KERNEL_EXTRA_DEPENDS_TARGET}"
|
2022-02-16 00:41:13 +00:00
|
|
|
PKG_NEED_UNPACK="${LINUX_DEPENDS} $(get_pkg_directory initramfs) $(get_pkg_variable initramfs PKG_NEED_UNPACK)"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LONGDESC="This package contains a precompiled kernel image and the modules."
|
|
|
|
PKG_IS_KERNEL_PKG="yes"
|
2022-02-16 00:41:13 +00:00
|
|
|
PKG_STAMP="${KERNEL_TARGET} ${KERNEL_MAKE_EXTRACMD}"
|
|
|
|
|
2022-07-10 23:39:21 +00:00
|
|
|
PKG_PATCH_DIRS+="${LINUX} ${DEVICE} default"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_KERNEL_CFG_FILE=$(kernel_config_path) || die
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ -n "${KERNEL_TOOLCHAIN}" ]; then
|
2022-11-01 10:04:06 +00:00
|
|
|
PKG_DEPENDS_HOST="${PKG_DEPENDS_HOST} gcc-${KERNEL_TOOLCHAIN}:host"
|
|
|
|
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} gcc-${KERNEL_TOOLCHAIN}:host"
|
2022-02-16 00:41:13 +00:00
|
|
|
HEADERS_ARCH=${TARGET_ARCH}
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ "${PKG_BUILD_PERF}" != "no" ] && grep -q ^CONFIG_PERF_EVENTS= ${PKG_KERNEL_CFG_FILE}; then
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_BUILD_PERF="yes"
|
2023-06-13 11:37:59 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" binutils elfutils libunwind zlib openssl libtraceevent libtracefs"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2023-03-04 15:05:43 +00:00
|
|
|
if [[ "${TARGET_ARCH}" =~ i*86|x86_64 ]]; then
|
2022-02-16 00:41:13 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" elfutils:host pciutils"
|
|
|
|
PKG_DEPENDS_UNPACK+=" intel-ucode kernel-firmware"
|
|
|
|
elif [ "${TARGET_ARCH}" = "arm" -a "${DEVICE}" = "iMX6" ]; then
|
|
|
|
PKG_DEPENDS_UNPACK+=" firmware-imx"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [[ "${KERNEL_TARGET}" = uImage* ]]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" u-boot-tools:host"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
# Ensure that the dependencies of initramfs:target are built correctly, but
|
|
|
|
# we don't want to add initramfs:target as a direct dependency as we install
|
|
|
|
# this "manually" from within linux:target
|
|
|
|
for pkg in $(get_pkg_variable initramfs PKG_DEPENDS_TARGET); do
|
|
|
|
! listcontains "${PKG_DEPENDS_TARGET}" "${pkg}" && PKG_DEPENDS_TARGET+=" ${pkg}" || true
|
|
|
|
done
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
post_patch() {
|
2022-02-16 00:41:13 +00:00
|
|
|
# linux was already built and its build dir autoremoved - prepare it again for kernel packages
|
|
|
|
if [ -d ${PKG_INSTALL}/.image ]; then
|
|
|
|
cp -p ${PKG_INSTALL}/.image/.config ${PKG_BUILD}
|
|
|
|
kernel_make -C ${PKG_BUILD} prepare
|
|
|
|
|
|
|
|
# restore the required Module.symvers from an earlier build
|
|
|
|
cp -p ${PKG_INSTALL}/.image/Module.symvers ${PKG_BUILD}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-06-30 10:28:25 +00:00
|
|
|
make_init() {
|
|
|
|
: # reuse make_target()
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_init() {
|
|
|
|
if [ -n "${INITRAMFS_MODULES}" ]; then
|
|
|
|
mkdir -p ${INSTALL}/etc
|
|
|
|
mkdir -p ${INSTALL}/usr/lib/modules
|
|
|
|
|
|
|
|
for i in ${INITRAMFS_MODULES}; do
|
|
|
|
module=`find .install_pkg/$(get_full_module_dir)/kernel -name ${i}.ko`
|
|
|
|
if [ -n "${module}" ]; then
|
|
|
|
echo ${i} >> ${INSTALL}/etc/modules
|
|
|
|
cp ${module} ${INSTALL}/usr/lib/modules/`basename ${module}`
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${UVESAFB_SUPPORT}" = yes ]; then
|
|
|
|
mkdir -p ${INSTALL}/usr/lib/modules
|
|
|
|
uvesafb=`find .install_pkg/$(get_full_module_dir)/kernel -name uvesafb.ko`
|
|
|
|
cp ${uvesafb} ${INSTALL}/usr/lib/modules/`basename ${uvesafb}`
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
make_host() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_host() {
|
|
|
|
make \
|
|
|
|
ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
|
|
|
|
HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
|
|
|
|
HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
|
|
|
|
HOSTCFLAGS="${HOST_CFLAGS}" \
|
|
|
|
HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
|
|
|
|
HOSTLDFLAGS="${HOST_LDFLAGS}" \
|
|
|
|
INSTALL_HDR_PATH=dest \
|
|
|
|
headers_install
|
|
|
|
mkdir -p ${SYSROOT_PREFIX}/usr/include
|
|
|
|
cp -R dest/include/* ${SYSROOT_PREFIX}/usr/include
|
|
|
|
}
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
pre_make_target() {
|
|
|
|
( cd ${ROOT}
|
|
|
|
rm -rf ${BUILD}/initramfs
|
|
|
|
rm -f ${STAMPS_INSTALL}/initramfs/install_target ${STAMPS_INSTALL}/*/install_init
|
|
|
|
${SCRIPTS}/install initramfs
|
|
|
|
)
|
|
|
|
pkg_lock_status "ACTIVE" "linux:target" "build"
|
|
|
|
|
|
|
|
cp ${PKG_KERNEL_CFG_FILE} ${PKG_BUILD}/.config
|
|
|
|
|
|
|
|
# set initramfs source
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_INITRAMFS_SOURCE "$(kernel_initramfs_confs) ${BUILD}/initramfs"
|
|
|
|
|
2022-07-10 16:20:13 +00:00
|
|
|
# set default hostname based on ${DEVICE}
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_DEFAULT_HOSTNAME "${DEVICE}"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# disable swap support if not enabled
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ ! "${SWAP_SUPPORT}" = yes ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_SWAP
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# disable nfs support if not enabled
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ ! "${NFS_SUPPORT}" = yes ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_NFS_FS
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# disable cifs support if not enabled
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ ! "${SAMBA_SUPPORT}" = yes ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_CIFS
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# disable iscsi support if not enabled
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ ! "${ISCSI_SUPPORT}" = yes ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_SCSI_ISCSI_ATTRS
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_ISCSI_TCP
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_ISCSI_BOOT_SYSFS
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_ISCSI_IBFT_FIND
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_ISCSI_IBFT
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
# disable lima/panfrost if libmali is configured
|
|
|
|
if [ "${OPENGLES}" = "libmali" ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_DRM_LIMA
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_DRM_PANFROST
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
# disable wireguard support if not enabled
|
|
|
|
if [ ! "${WIREGUARD_SUPPORT}" = yes ]; then
|
|
|
|
${PKG_BUILD}/scripts/config --disable CONFIG_WIREGUARD
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2023-03-04 15:05:43 +00:00
|
|
|
if [[ "${TARGET_ARCH}" =~ i*86|x86_64 ]]; then
|
2022-02-05 14:23:32 +00:00
|
|
|
# copy some extra firmware to linux tree
|
2022-02-16 00:41:13 +00:00
|
|
|
mkdir -p ${PKG_BUILD}/external-firmware
|
|
|
|
cp -a $(get_build_dir kernel-firmware)/.copied-firmware/{amdgpu,amd-ucode,i915,radeon,e100,rtl_nic} ${PKG_BUILD}/external-firmware
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
cp -a $(get_build_dir intel-ucode)/intel-ucode ${PKG_BUILD}/external-firmware
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
FW_LIST="$(find ${PKG_BUILD}/external-firmware \( -type f -o -type l \) \( -iname '*.bin' -o -iname '*.fw' -o -path '*/intel-ucode/*' \) | sed 's|.*external-firmware/||' | sort | xargs)"
|
|
|
|
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_EXTRA_FIRMWARE "${FW_LIST}"
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_EXTRA_FIRMWARE_DIR "external-firmware"
|
|
|
|
|
|
|
|
elif [ "${TARGET_ARCH}" = "arm" -a "${DEVICE}" = "iMX6" ]; then
|
|
|
|
mkdir -p ${PKG_BUILD}/external-firmware/imx/sdma
|
|
|
|
cp -a $(get_build_dir firmware-imx)/firmware/sdma/*imx6*.bin ${PKG_BUILD}/external-firmware/imx/sdma
|
|
|
|
cp -a $(get_build_dir firmware-imx)/firmware/vpu/*imx6*.bin ${PKG_BUILD}/external-firmware
|
|
|
|
|
|
|
|
FW_LIST="$(find ${PKG_BUILD}/external-firmware -type f | sed 's|.*external-firmware/||' | sort | xargs)"
|
|
|
|
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_EXTRA_FIRMWARE "${FW_LIST}"
|
|
|
|
${PKG_BUILD}/scripts/config --set-str CONFIG_EXTRA_FIRMWARE_DIR "external-firmware"
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-03 12:03:44 +00:00
|
|
|
yes "" | kernel_make oldconfig
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-07-13 21:59:42 +00:00
|
|
|
if [ -f "${ROOT}/${DISTRO}/kernel_options" ]; then
|
2022-02-16 00:41:13 +00:00
|
|
|
while read OPTION; do
|
|
|
|
[ -z "${OPTION}" -o -n "$(echo "${OPTION}" | grep '^#')" ] && continue
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ "${OPTION##*=}" == "n" -a "$(${PKG_BUILD}/scripts/config --state ${OPTION%%=*})" == "undef" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2022-06-30 10:28:25 +00:00
|
|
|
if [ "$(${PKG_BUILD}/scripts/config --state ${OPTION%%=*})" != "$(echo ${OPTION##*=} | tr -d '"')" ]; then
|
2022-02-16 00:41:13 +00:00
|
|
|
MISSING_KERNEL_OPTIONS+="\t${OPTION}\n"
|
|
|
|
fi
|
2022-07-13 21:59:42 +00:00
|
|
|
done < ${ROOT}/${DISTRO}/kernel_options
|
2022-02-16 00:41:13 +00:00
|
|
|
|
|
|
|
if [ -n "${MISSING_KERNEL_OPTIONS}" ]; then
|
|
|
|
print_color CLR_WARNING "LINUX: kernel options not correct: \n${MISSING_KERNEL_OPTIONS%%}\nPlease run ./tools/check_kernel_config\n"
|
|
|
|
fi
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
make_target() {
|
2022-02-16 00:41:13 +00:00
|
|
|
# arm64 target does not support creating uImage.
|
|
|
|
# Build Image first, then wrap it using u-boot's mkimage.
|
|
|
|
if [[ "${TARGET_KERNEL_ARCH}" = "arm64" && "${KERNEL_TARGET}" = uImage* ]]; then
|
|
|
|
if [ -z "${KERNEL_UIMAGE_LOADADDR}" -o -z "${KERNEL_UIMAGE_ENTRYADDR}" ]; then
|
|
|
|
die "ERROR: KERNEL_UIMAGE_LOADADDR and KERNEL_UIMAGE_ENTRYADDR have to be set to build uImage - aborting"
|
|
|
|
fi
|
|
|
|
KERNEL_UIMAGE_TARGET="${KERNEL_TARGET}"
|
|
|
|
KERNEL_TARGET="${KERNEL_TARGET/uImage/Image}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DTC_FLAGS=-@ kernel_make ${KERNEL_TARGET} ${KERNEL_MAKE_EXTRACMD} modules
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ "${PKG_BUILD_PERF}" = "yes" ]; then
|
2022-02-05 14:23:32 +00:00
|
|
|
( cd tools/perf
|
|
|
|
|
|
|
|
# arch specific perf build args
|
2022-02-16 00:41:13 +00:00
|
|
|
case "${TARGET_ARCH}" in
|
2023-03-04 15:05:43 +00:00
|
|
|
x86_64|i*86)
|
2022-02-05 14:23:32 +00:00
|
|
|
PERF_BUILD_ARGS="ARCH=x86"
|
|
|
|
;;
|
|
|
|
aarch64)
|
|
|
|
PERF_BUILD_ARGS="ARCH=arm64"
|
|
|
|
;;
|
|
|
|
*)
|
2022-02-16 00:41:13 +00:00
|
|
|
PERF_BUILD_ARGS="ARCH=${TARGET_ARCH}"
|
2022-02-05 14:23:32 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
WERROR=0 \
|
|
|
|
NO_LIBPERL=1 \
|
|
|
|
NO_LIBPYTHON=1 \
|
|
|
|
NO_SLANG=1 \
|
|
|
|
NO_GTK2=1 \
|
|
|
|
NO_LIBNUMA=1 \
|
|
|
|
NO_LIBAUDIT=1 \
|
|
|
|
NO_LZMA=1 \
|
|
|
|
NO_SDT=1 \
|
2022-02-16 00:41:13 +00:00
|
|
|
CROSS_COMPILE="${TARGET_PREFIX}" \
|
|
|
|
JOBS="${CONCURRENCY_MAKE_LEVEL}" \
|
|
|
|
make ${PERF_BUILD_ARGS}
|
|
|
|
mkdir -p ${INSTALL}/usr/bin
|
|
|
|
cp perf ${INSTALL}/usr/bin
|
2022-02-05 14:23:32 +00:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ -n "${KERNEL_UIMAGE_TARGET}" ]; then
|
2022-02-05 14:23:32 +00:00
|
|
|
# determine compression used for kernel image
|
|
|
|
KERNEL_UIMAGE_COMP=${KERNEL_UIMAGE_TARGET:7}
|
2022-02-16 00:41:13 +00:00
|
|
|
KERNEL_UIMAGE_COMP=$(echo ${KERNEL_UIMAGE_COMP:-none} | sed 's/gz/gzip/; s/bz2/bzip2/')
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# calculate new load address to make kernel Image unpack to memory area after compressed image
|
2022-02-16 00:41:13 +00:00
|
|
|
if [ "${KERNEL_UIMAGE_COMP}" != "none" ]; then
|
|
|
|
COMPRESSED_SIZE=$(stat -t "arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_TARGET}" | awk '{print $2}')
|
2022-02-05 14:23:32 +00:00
|
|
|
# align to 1 MiB
|
2022-02-16 00:41:13 +00:00
|
|
|
COMPRESSED_SIZE=$(( ((${COMPRESSED_SIZE} - 1 >> 20) + 1) << 20 ))
|
|
|
|
PKG_KERNEL_UIMAGE_LOADADDR=$(printf '%X' "$(( ${KERNEL_UIMAGE_LOADADDR} + ${COMPRESSED_SIZE} ))")
|
|
|
|
PKG_KERNEL_UIMAGE_ENTRYADDR=$(printf '%X' "$(( ${KERNEL_UIMAGE_ENTRYADDR} + ${COMPRESSED_SIZE} ))")
|
2022-02-05 14:23:32 +00:00
|
|
|
else
|
|
|
|
PKG_KERNEL_UIMAGE_LOADADDR=${KERNEL_UIMAGE_LOADADDR}
|
|
|
|
PKG_KERNEL_UIMAGE_ENTRYADDR=${KERNEL_UIMAGE_ENTRYADDR}
|
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
mkimage -A ${TARGET_KERNEL_ARCH} \
|
2022-02-05 14:23:32 +00:00
|
|
|
-O linux \
|
|
|
|
-T kernel \
|
2022-02-16 00:41:13 +00:00
|
|
|
-C ${KERNEL_UIMAGE_COMP} \
|
|
|
|
-a ${PKG_KERNEL_UIMAGE_LOADADDR} \
|
|
|
|
-e ${PKG_KERNEL_UIMAGE_ENTRYADDR} \
|
|
|
|
-d arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_TARGET} \
|
|
|
|
arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_UIMAGE_TARGET}
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
KERNEL_TARGET="${KERNEL_UIMAGE_TARGET}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target() {
|
2022-02-16 00:41:13 +00:00
|
|
|
mkdir -p ${INSTALL}/.image
|
|
|
|
cp -p arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_TARGET} System.map .config Module.symvers ${INSTALL}/.image/
|
|
|
|
|
|
|
|
kernel_make INSTALL_MOD_PATH=${INSTALL}/$(get_kernel_overlay_dir) modules_install
|
|
|
|
rm -f ${INSTALL}/$(get_kernel_overlay_dir)/lib/modules/*/build
|
|
|
|
rm -f ${INSTALL}/$(get_kernel_overlay_dir)/lib/modules/*/source
|
|
|
|
|
|
|
|
if [ "${BOOTLOADER}" = "u-boot" ]; then
|
|
|
|
mkdir -p ${INSTALL}/usr/share/bootloader/device_trees
|
|
|
|
if [ -d arch/${TARGET_KERNEL_ARCH}/boot/dts/amlogic ]; then
|
|
|
|
cp arch/${TARGET_KERNEL_ARCH}/boot/*dtb.img ${INSTALL}/usr/share/bootloader/ 2>/dev/null || :
|
|
|
|
[ "${DEVICE}" = "Amlogic-ng" ] && cp arch/${TARGET_KERNEL_ARCH}/boot/dts/amlogic/*.dtb ${INSTALL}/usr/share/bootloader/device_trees 2>/dev/null || :
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
2022-02-16 00:41:13 +00:00
|
|
|
elif [ "${BOOTLOADER}" = "bcm2835-bootloader" ]; then
|
2022-06-30 10:28:25 +00:00
|
|
|
# RPi firmware will decompress gzipped kernels prior to booting
|
|
|
|
if [ "${TARGET_KERNEL_ARCH}" = "arm64" ]; then
|
|
|
|
pigz --best --force ${INSTALL}/.image/${KERNEL_TARGET}
|
|
|
|
mv ${INSTALL}/.image/${KERNEL_TARGET}.gz ${INSTALL}/.image/${KERNEL_TARGET}
|
|
|
|
fi
|
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/share/bootloader/overlays
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# install platform dtbs, but remove upstream kernel dtbs (i.e. without downstream
|
|
|
|
# drivers and decent USB support) as these are not required by LibreELEC
|
2022-02-16 00:41:13 +00:00
|
|
|
for dtb in arch/${TARGET_KERNEL_ARCH}/boot/dts/*.dtb arch/${TARGET_KERNEL_ARCH}/boot/dts/*/*.dtb; do
|
|
|
|
if [ -f ${dtb} ]; then
|
|
|
|
cp -v ${dtb} ${INSTALL}/usr/share/bootloader
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
|
|
|
done
|
2022-02-16 00:41:13 +00:00
|
|
|
rm -f ${INSTALL}/usr/share/bootloader/bcm283*.dtb
|
|
|
|
# duplicated in overlays below
|
|
|
|
safe_remove ${INSTALL}/usr/share/bootloader/overlay_map.dtb
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-02-16 00:41:13 +00:00
|
|
|
# install overlay dtbs
|
|
|
|
for dtb in arch/arm/boot/dts/overlays/*.dtb \
|
|
|
|
arch/arm/boot/dts/overlays/*.dtbo; do
|
|
|
|
cp ${dtb} ${INSTALL}/usr/share/bootloader/overlays 2>/dev/null || :
|
|
|
|
done
|
|
|
|
cp -p arch/${TARGET_KERNEL_ARCH}/boot/dts/overlays/README ${INSTALL}/usr/share/bootloader/overlays
|
2022-02-05 14:23:32 +00:00
|
|
|
fi
|
2022-12-06 03:06:09 +00:00
|
|
|
makeinstall_host
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
2023-01-14 20:35:12 +00:00
|
|
|
|
|
|
|
post_install() {
|
|
|
|
if [ ! -d ${INSTALL}/$(get_full_firmware_dir) ]
|
|
|
|
then
|
|
|
|
mkdir -p ${INSTALL}/$(get_full_firmware_dir)/
|
|
|
|
fi
|
|
|
|
|
|
|
|
# regdb and signature is now loaded as firmware by 4.15+
|
|
|
|
if grep -q ^CONFIG_CFG80211_REQUIRE_SIGNED_REGDB= ${PKG_BUILD}/.config; then
|
|
|
|
cp $(get_build_dir wireless-regdb)/regulatory.db{,.p7s} ${INSTALL}/$(get_full_firmware_dir)
|
|
|
|
fi
|
|
|
|
}
|