diff options
author | Karel Kočí <cynerd@email.cz> | 2018-03-25 21:42:41 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-03-25 21:42:41 +0200 |
commit | cc482421612132d3561ea7bf7407535358c8984c (patch) | |
tree | 0f6063c3f492bf6bd680324eadd851c2c90247f8 | |
parent | aa2b5583aae3e9f7873b10485de1e051748ce5f6 (diff) | |
download | gentoo-personal-overlay-cc482421612132d3561ea7bf7407535358c8984c.tar.gz gentoo-personal-overlay-cc482421612132d3561ea7bf7407535358c8984c.tar.bz2 gentoo-personal-overlay-cc482421612132d3561ea7bf7407535358c8984c.zip |
linux: allow chaining configurations
-rw-r--r-- | sys-kernel/linux/Manifest | 2 | ||||
-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 | ||||
-rw-r--r-- | sys-kernel/linux/linux-4.14.29-r2.ebuild (renamed from sys-kernel/linux/linux-4.14.27-r2.ebuild) | 5 |
7 files changed, 58 insertions, 133 deletions
diff --git a/sys-kernel/linux/Manifest b/sys-kernel/linux/Manifest index e364c47..742d59f 100644 --- a/sys-kernel/linux/Manifest +++ b/sys-kernel/linux/Manifest @@ -1 +1 @@ -DIST linux-4.14.27.tar.gz 157780772 BLAKE2B ac97b5727e6a2241b7324026d9d9f10efaa867b23a3b61e7541d21edd40dd4c9a1e7abff86361407f0f6e068a0a8192ca395df3e5ef049618a0a5c44f53f925d SHA512 cef41f4b7dbd661ec4903bf242fe6597e9f5af8aa960583e525e58405d461312b180156838a2c3af22b1d73015781d9dfac4adc009cde642cfc8fdb9f9e74533 +DIST linux-4.14.29.tar.gz 157783371 BLAKE2B fecbe2aa8c0defa857eb4001a841f0e5ead08b1c735b2980fe26270d263c43476dbebd128a58362590b12425736da1cda75effad926d16f9ca7a7c018dd0324a SHA512 7adab84d07dc43dfe0beb24e94efe31a6649a0e1b3ccd9f87296266a36f5cf1e2599d6de5421c871670cd215e31d007a3f2b1ae45b2f53b09fe7f8b2d506e7e4 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 diff --git a/sys-kernel/linux/linux-4.14.27-r2.ebuild b/sys-kernel/linux/linux-4.14.29-r2.ebuild index b2c2266..2817fe9 100644 --- a/sys-kernel/linux/linux-4.14.27-r2.ebuild +++ b/sys-kernel/linux/linux-4.14.29-r2.ebuild @@ -14,7 +14,7 @@ S="${WORKDIR}/linux-stable-${VER}" LICENSE="GPLv2" SLOT="${PV}" KEYWORDS="amd64 ~x86" -IUSE="virt +initramfs amd" +IUSE="virt +initramfs amd intel" DEPEND=" sys-devel/bc @@ -24,7 +24,8 @@ src_configure() { # Fix ARCH variable [ "$ARCH" = "amd64" ] && ARCH="x86" - "${FILESDIR}"/config_prepare.sh $(usev virt) $(usev amd) || die "Configuration application failed" + "${FILESDIR}"/config_prepare.sh $(usev amd) $(usev intel) $(usev virt) \ + || die "Configuration application failed" } src_install() { |