diff options
Diffstat (limited to 'sys-kernel/linux/files')
-rw-r--r-- | sys-kernel/linux/files/amd.config | 82 | ||||
-rw-r--r-- | sys-kernel/linux/files/archbase.config (renamed from sys-kernel/linux/files/arch.config) | 0 | ||||
-rwxr-xr-x | sys-kernel/linux/files/config_prepare.sh | 83 | ||||
-rw-r--r-- | sys-kernel/linux/files/intel.config | 9 | ||||
-rw-r--r-- | sys-kernel/linux/files/overlay.config | 10 |
5 files changed, 54 insertions, 130 deletions
diff --git a/sys-kernel/linux/files/amd.config b/sys-kernel/linux/files/amd.config index a6e42e6..832a6eb 100644 --- a/sys-kernel/linux/files/amd.config +++ b/sys-kernel/linux/files/amd.config @@ -1,7 +1,3 @@ -# No logo -CONFIG_LOGO=n -CONFIG_LOCALVERSION="" - # Ryzen specific CONFIG_MK8=y CONFIG_PROCESSOR_SELECT=y @@ -20,54 +16,10 @@ CONFIG_X86_INTEL_PSTATE=n CONFIG_X86_P4_CLOCKMOD=n CONFIG_INTEL_IOMMU=n -# Disable nouveau, radeon and intel -CONFIG_DRM_NOUVEAU=n -CONFIG_DRM_RADEON=n +# Disable intel CONFIG_DRM_I915=n CONFIG_DRM_GMA500=n -# Enable incompatible v3 process information file format -CONFIG_BSD_PROCESS_ACCT_V3=y - -# Built in keyboard support -CONFIG_KEYBOARD_ATKBD=y - -# SATA support compile in -CONFIG_ATA=y -CONFIG_SATA_AHCI=y -CONFIG_BLK_DEV_SD=y -# Compile BTRFS to kernel (used for root) -CONFIG_BTRFS_FS=y -# Compile FAT to kernel (used for efi partition) -CONFIG_VFAT_FS=y -# Cryptsetup -CONFIG_BLK_DEV_DM=y -CONFIG_DM_CRYPT=y -CONFIG_CRYPTO_XTS=y -CONFIG_CRYPTO_SHA256_SSSE3=y -CONFIG_CRYPTO_SHA512_SSSE3=y -CONFIG_CRYPTO_AES_X86_64=y -CONFIG_CRYPTO_USER_API_SKCIPHER=y - -# Built in USB -CONFIG_USB=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_STORAGE=y -# Built in HID (keyboard and so on) -CONFIG_HID_GENERIC=y -CONFIG_USB_HID=y -CONFIG_I2C_HID=y -CONFIG_HID_ASUS=y - -# Compile to kernel also other filesytems so we can use it if we need it -CONFIG_EXT4_FS=y -CONFIG_OVERLAY_FS=y -CONFIG_SQUASHFS=y - -# Scrollback buffer size -CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=1024 - # AMD GPU CONFIG_AGP=y CONFIG_DRM=y @@ -77,35 +29,3 @@ CONFIG_HSA_AMD=y # VFIO (gpu passtrough) CONFIG_VFIO=y CONFIG_VFIO_PCI=y - -# X input -CONFIG_INPUT_EVDEV=y - -# Consolekit -CONFIG_AUDIT=y - -# Build configuration into the kernel but as module -CONFIG_IKCONFIG=m -CONFIG_IKCONFIG_PROC=y - -# Chromium requires user namespace sandbox? -CONFIG_USER_NS=y - -## Gentoo specific just to be sure -# Udev -CONFIG_DEVTMPFS=y -CONFIG_TMPFS=y -CONFIG_UNIX=y -CONFIG_MMU=y -CONFIG_SHMEM=y -# Portage -CONFIG_CGROUPS=y -CONFIG_NAMESPACES=y -CONFIG_IPC_NS=y -CONFIG_NET_NS=y -CONFIG_SYSVIPC=y -# OpenRC -CONFIG_BINFMT_SCRIPT=y - -# Options enabled just to make previous options enabled -CONFIG_LEDS_CLASS=y diff --git a/sys-kernel/linux/files/arch.config b/sys-kernel/linux/files/archbase.config index 31a820d..31a820d 100644 --- a/sys-kernel/linux/files/arch.config +++ b/sys-kernel/linux/files/archbase.config diff --git a/sys-kernel/linux/files/config_prepare.sh b/sys-kernel/linux/files/config_prepare.sh index c2b5854..ede6fc8 100755 --- a/sys-kernel/linux/files/config_prepare.sh +++ b/sys-kernel/linux/files/config_prepare.sh @@ -3,60 +3,65 @@ set -e B="$(dirname $0)" -BASE=arch.config -OVERLAY=overlay.config - if [ "$1" = "amd" ]; then - OVERLAY=amd.config + BASE="archbase.config" + CONFIG="overlay.config amd.config" +elif [ "$1" = "intel" ]; then + BASE="archbase.config" + CONFIG="overlay.config intel.config" elif [ "$1" = "virt" ]; then - BASE= - OVERLAY=virt.config + BASE="" + CONFIG="virt.config" +else + BASE="archbase.config" + CONFIG="overlay.config" fi ################################################################################# # First just deploy base configuration (provided or just kernel default) -if [ -n "$BASE" ]; then - cp "$B/$BASE" .config -else +if [ -z "$BASE" ]; then make defconfig +else + cp "$B/$BASE" .config fi -# We are done if no overlay is specified -[ -n "$OVERLAY" ] || exit 0 - -# And now apply changes from overlay.config -while read L; do - echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines - echo "$L" | grep -qE "#.*" && continue # Ignore comments - # Remove lines with changed settings - OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')" - sed -i "#^$OPTION#d" .config - # Put config - echo "$L" >> .config -done < "$B/$OVERLAY" +# Apply changes in config +for CNF in $CONFIG; do + while read L; do + echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines + echo "$L" | grep -qE "#.*" && continue # Ignore comments + # Remove lines with changed settings + sed -i "#^$(echo "$L" | grep -oE '^CONFIG_.*=')#d" .config + # Put config + echo "$L" >> .config + done < "$B/$CNF" +done # As next step run olddefconfig (note: stderr contains some output about overrided # options so I am ignoring it) make olddefconfig 2>/dev/null # Now let's check that configuration -EC=0 -while read L; do - echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines - echo "$L" | grep -qE "#.*" && continue # Ignore comments - OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')" - VALUE="$(echo "$L" | grep -oE '=.*$')" - if [ "$VALUE" = "=n" ]; then - if grep -qE "^$OPTION=y" .config; then - EC=1 - echo -e "\e[1;31mY:\e[0m$L" - fi - else - if ! grep -qE "^$L$" .config; then - EC=1 - echo -e "\e[1;31mN:\e[0m$L" +for CNF in $CONFIG; do + EC=0 + while read L; do + echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines + echo "$L" | grep -qE "#.*" && continue # Ignore comments + OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')" + VALUE="$(echo "$L" | grep -oE '=.*$')" + if [ "$VALUE" = "=n" ]; then + # Handle =n and "not set" as being same + if grep -qE "^$OPTION=y" .config; then + EC=1 + echo -e "\e[1;31m$CNF:\e[0m$L" + fi + else + if ! grep -qE "^$L$" .config; then + EC=1 + echo -e "\e[1;31m$CNF:\e[0m$L" + fi fi - fi -done < "$B/$OVERLAY" + done < "$B/$CNF" +done exit $EC diff --git a/sys-kernel/linux/files/intel.config b/sys-kernel/linux/files/intel.config new file mode 100644 index 0000000..b8c2f0e --- /dev/null +++ b/sys-kernel/linux/files/intel.config @@ -0,0 +1,9 @@ +# Intel i915 driver (video) +CONFIG_AGP=y +CONFIG_AGP_INTEL=y +CONFIG_DRM=y +CONFIG_DRM_I915=y + +# VFIO (gpu passtrough) +CONFIG_VFIO=y +CONFIG_VFIO_PCI=y diff --git a/sys-kernel/linux/files/overlay.config b/sys-kernel/linux/files/overlay.config index 7f9c56b..6b32a74 100644 --- a/sys-kernel/linux/files/overlay.config +++ b/sys-kernel/linux/files/overlay.config @@ -48,16 +48,6 @@ CONFIG_SQUASHFS=y # Scrollback buffer size CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=1024 -# Intel i915 driver (video) -CONFIG_AGP=y -CONFIG_AGP_INTEL=y -CONFIG_DRM=y -CONFIG_DRM_I915=y - -# VFIO (gpu passtrough) -CONFIG_VFIO=y -CONFIG_VFIO_PCI=y - # X input CONFIG_INPUT_EVDEV=y |