1
0
mirror of https://github.com/krglaws/MyLFS.git synced 2025-07-26 15:46:59 +00:00
Files
MyLFS-big_bash_script/phase4/linux.sh
2022-04-13 14:24:27 -04:00

43 lines
869 B
Bash

# LINUX Phase 4
function config_on {
local UNCOMMENTED="^${1}=.*\$"
local COMMENTED="^# ${1} .*\$"
sed -E -i "s/${UCOMMENTED}|${COMMENTED}/${1}=y/" ./.config
}
function config_off {
sed -i "s/^${1}=.*$//" ./.config
}
CONFIGFILE=config-$KERNELVERS
make mrproper
if [ -f /boot/$CONFIGFILE ]
then
cp /boot/$CONFIGFILE ./.config
else
# if kernel config not provided, use default architecture config
make defconfig
config_off CONFIG_IKHEADERS
config_on CONFIG_FB
config_off CONFIG_UEVENT_HELPER
config_on CONFIG_DEVTMPFS
config_on CONFIG_MODULES
fi
make
make modules_install
cp ./.config /boot/$CONFIGFILE
cp arch/x86_64/boot/bzImage /boot/vmlinuz-$KERNELVERS-lfs-11.1
cp System.map /boot/System.map-$KERNELVERS
install -d /usr/share/doc/linux-$KERNELVERS
cp -r Documentation/* /usr/share/doc/linux-$KERNELVERS