In a "merged-usr" system, `/lib` is a symlink to `/usr/lib`. When installing *sys-apps/systemd*, Portage checks to ensure this is the case. If this happens after `make modules_install` is run, `/lib` is a directory, which causes the installation to fail. To avoid this, we need to explicitly install the modules into `/usr/lib` so that the symlink can be created later.
35 lines
983 B
Bash
Executable File
35 lines
983 B
Bash
Executable File
#!/bin/sh
|
|
# vim: set sw=4 ts=4 sts=4 et :
|
|
|
|
set -e
|
|
|
|
. ./config
|
|
|
|
emerge -vnj ${kernel_pkg}
|
|
|
|
export ARCH=arm64 CROSS_COMPILE=${target}-
|
|
mkdir -p linux
|
|
cd linux
|
|
/usr/src/linux/scripts/kconfig/merge_config.sh -m \
|
|
/usr/src/linux/arch/*/configs/${kernel_defconfig}_defconfig \
|
|
../linux.config
|
|
make -C /usr/src/linux O=${PWD} olddefconfig
|
|
make -j$(nproc)
|
|
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 linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
|
cp -au linux/.config /mnt/gentoo/boot/config-${kver}
|
|
cp -au linux/System.map /mnt/gentoo/boot/System.map-${kver}
|
|
|
|
printf 'Installing device tree binaries ...\n'
|
|
mkdir -p output/efi-part/overlays
|
|
cp -au linux/arch/arm64/boot/dts/${device_tree} output/efi-part/
|
|
cp -au \
|
|
linux/arch/arm64/boot/dts/overlays/*.dtb \
|
|
linux/arch/arm64/boot/dts/overlays/*.dtbo \
|
|
output/efi-part/overlays/
|