Instead of copying the Portage configuration files to `/etc/portage` and
`/usr/${target}/etc/portage`, the build scripts now use the
configuration directories from the source directory. This avoids issues
with changes (especially removal of files) getting propagated to the
actual configuration paths.
41 lines
1.2 KiB
Bash
Executable File
41 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# vim: set sw=4 ts=4 sts=4 et :
|
|
|
|
set -e
|
|
|
|
O="${1}"
|
|
|
|
. ./config
|
|
|
|
PORTAGE_CONFIGROOT="${PWD}"/portage/config/host \
|
|
emerge -vnj ${kernel_pkg}
|
|
|
|
export ARCH=arm64 CROSS_COMPILE=${target}-
|
|
unset MAKEFLAGS MAKEOVERRIDES MAKELEVEL
|
|
mkdir -p "${O}"/linux
|
|
/usr/src/linux/scripts/kconfig/merge_config.sh -m \
|
|
-O "${O}"/linux \
|
|
/usr/src/linux/arch/*/configs/${kernel_defconfig}_defconfig \
|
|
linux.config
|
|
cd "${O}"/linux
|
|
make -C /usr/src/linux O=${PWD} olddefconfig
|
|
make -j$(nproc)
|
|
touch arch/arm64/boot/Image.gz
|
|
kver=$(make -s kernelversion)
|
|
make modules_install INSTALL_MOD_PATH=/mnt/gentoo/usr
|
|
cd -
|
|
|
|
printf 'Installing Kernel %s ...\n' "${kver}"
|
|
mkdir -p /mnt/gentoo/boot
|
|
cp -au "${O}"/linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
|
cp -au "${O}"/linux/.config /mnt/gentoo/boot/config-${kver}
|
|
cp -au "${O}"/linux/System.map /mnt/gentoo/boot/System.map-${kver}
|
|
|
|
printf 'Installing device tree binaries ...\n'
|
|
mkdir -p "${O}"/efi-part/overlays
|
|
cp -u "${O}"/linux/arch/arm64/boot/dts/${device_tree} "${O}"/efi-part/
|
|
cp -u \
|
|
"${O}"/linux/arch/arm64/boot/dts/overlays/*.dtb \
|
|
"${O}"/linux/arch/arm64/boot/dts/overlays/*.dtbo \
|
|
"${O}"/efi-part/overlays/
|