Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.35k stars 171 forks source link

Missing dependency flex on Fedora when running 'config' and using configuration fragments #356

Closed itspngu closed 2 years ago

itspngu commented 3 years ago

The logic in install.sh explicitly does not call _install_dependencies when the user runs the 'config' command: https://github.com/Frogging-Family/linux-tkg/blob/master/install.sh#L198

On my system that borks, as shown in the output below. The 'config' command does not complete successfully when using a configuration fragment as I'm missing missing flex (not entirely sure when or how I uninstalled it, upgraded from F34 to F35 the other day). Installing flex lets the script do its job - I'm not sure if this is a corner case that can be ignored or if this warrants adjustments to install.sh, possibly also for other distros.

$ ./install.sh config ```shell_session ./install.sh config -> External configuration file /home/pngu/.config/frogminer/linux-tkg.cfg will be used and will override customization.cfg values. kernel.org https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git (fetch) kernel.org https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git (push) googlesource.com https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable (fetch) googlesource.com https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable (push) -> Current branch: * (HEAD detached at v5.14.17) -> Reseting files to their original state HEAD is now at 3dfa869cb Linux 5.14.17 Removing .config Removing .config.old Removing Documentation/admin-guide/kernel-parameters.txt.orig Removing Documentation/admin-guide/pm/amd-pstate.rst Removing Documentation/scheduler/sched-BMQ.txt Removing Documentation/vm/multigen_lru.rst Removing arch/arm64/kernel/cpufeature.c.orig Removing arch/x86/Makefile.orig Removing block/elevator.c.orig Removing drivers/Makefile.orig Removing drivers/cpufreq/Kconfig.orig Removing drivers/cpufreq/amd-pstate.c Removing drivers/cpufreq/cpufreq_ondemand.c.orig Removing drivers/cpufreq/intel_pstate.c.orig Removing drivers/firmware/efi/secureboot.c Removing drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c.orig Removing drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c.orig Removing drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c.orig Removing drivers/gpu/drm/amd/display/dc/core/dc.c.orig Removing drivers/hid/hid-quirks.c.orig Removing drivers/idle/intel_idle.c.orig Removing drivers/infiniband/core/addr.c.orig Removing drivers/pci/pci.c.orig Removing fs/proc/base.c.orig Removing fs/proc/internal.h.orig Removing fs/proc/task_mmu.c.orig Removing include/acpi/cppc_acpi.h.orig Removing include/config/ Removing include/generated/ Removing include/linux/mm.h.orig Removing include/linux/page-flags.h.orig Removing include/linux/pagemap.h.orig Removing include/linux/sched.h.orig Removing include/uapi/linux/futex.h.orig Removing init/Kconfig.orig Removing kernel-5.14.17_tkg_bmq.tar.gz Removing kernel.spec Removing kernel/Kconfig.hz.orig Removing kernel/fork.c.orig Removing kernel/futex.c.orig Removing kernel/locking/rwsem.c.orig Removing kernel/sched/alt_core.c Removing kernel/sched/alt_debug.c Removing kernel/sched/alt_sched.h Removing kernel/sched/bmq.h Removing kernel/sched/core.c.orig Removing kernel/sched/cpufreq_schedutil.c.orig Removing kernel/sched/debug.c.orig Removing kernel/sched/fair.c.orig Removing kernel/sched/pds.h Removing kernel/sched/sched.h.orig Removing kernel/sched/topology.c.orig Removing kernel/sysctl.c.orig Removing kernel/time/hrtimer.c.orig Removing kernel/user_namespace.c.orig Removing mm/huge_memory.c.orig Removing mm/page-writeback.c.orig Removing mm/page_alloc.c.orig Removing mm/vmscan.c.orig Removing net/ipv4/tcp.c.orig Removing net/sched/Kconfig.orig Removing scripts/basic/fixdep Removing scripts/kconfig/conf Removing scripts/mkcompile_h.orig -> Switching to linux-5.14.y linux-5.14-kernel.org -> 5.14.y branch exists locally, updating... Switched to branch 'linux-5.14-kernel.org' Your branch is up to date with 'kernel.org/linux-5.14.y'. remote: Enumerating objects: 1, done. remote: Counting objects: 100% (1/1), done. remote: Total 1 (delta 0), reused 1 (delta 0), pack-reused 0 Unpacking objects: 100% (1/1), 809 bytes | 809.00 KiB/s, done. HEAD is now at 3dfa869cb Linux 5.14.17 -> Checking out latest release: v5.14.17 Note: switching to 'v5.14.17'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 3dfa869cb Linux 5.14.17 -> Downloading Graysky2's CPU optimisations patch --2021-11-12 15:20:14-- https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/master/more-uarches-for-kernel-5.8-5.14.patch Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 26726 (26K) [text/plain] Saving to: ‘more-uarches-for-kernel-5.8-5.14.patch’ more-uarches-for-kernel-5.8-5.14.patch 100%[=========================================================================================================================================>] 26.10K --.-KB/s in 0.009s 2021-11-12 15:20:14 (2.69 MB/s) - ‘more-uarches-for-kernel-5.8-5.14.patch’ saved [26726/26726] -> Setting version... -> Using Arch patches -> Applying graysky's cpu opts patch -> Applying clear linux patches -> Applying glitched base patch -> Applying misc additions patch -> Applying patches for WRITE_WATCH support in Wine -> Applying patches for WRITE_WATCH support in Wine -> Applying Project C / BMQ base patch -> Applying BMQ agressive ondemand governor patch -> Applying Glitched BMQ patch -> Using user-provided config file in /home/pngu/git/tkg/linux-tkg/kernel-x86_64-fedora.config -> Using default CPU sched yield type (1) -> Using 2ms round robin interval -> Patching futex_waitv support -> Patching Fsync support -> ###################################################### -> -> Applying your own linux-5.14 patch /home/pngu/git/tkg/linux-tkg/linux514-tkg-userpatches/AMD_CPPC.mypatch -> -> ###################################################### patching file arch/x86/include/asm/cpufeatures.h patching file arch/x86/include/asm/msr-index.h patching file drivers/acpi/cppc_acpi.c patching file drivers/acpi/cppc_acpi.c patching file drivers/acpi/cppc_acpi.c Hunk #1 succeeded at 1260 (offset -15 lines). patching file include/acpi/cppc_acpi.h Hunk #1 succeeded at 137 with fuzz 1 (offset -1 lines). Hunk #2 succeeded at 158 (offset -5 lines). patching file drivers/cpufreq/Kconfig.x86 patching file drivers/cpufreq/Makefile patching file drivers/cpufreq/amd-pstate.c patching file drivers/cpufreq/amd-pstate.c patching file drivers/cpufreq/amd-pstate.c patching file drivers/cpufreq/amd-pstate.c patching file include/trace/events/power.h patching file drivers/cpufreq/amd-pstate.c patching file drivers/cpufreq/amd-pstate.c patching file drivers/cpufreq/amd-pstate.c patching file tools/power/cpupower/utils/helpers/helpers.h patching file tools/power/cpupower/utils/helpers/helpers.h patching file tools/power/cpupower/utils/helpers/misc.c patching file tools/power/cpupower/utils/helpers/cpuid.c patching file tools/power/cpupower/lib/cpufreq.c patching file tools/power/cpupower/lib/cpufreq.h patching file tools/power/cpupower/utils/helpers/amd.c patching file tools/power/cpupower/utils/helpers/amd.c patching file tools/power/cpupower/utils/helpers/helpers.h patching file tools/power/cpupower/utils/helpers/misc.c patching file tools/power/cpupower/utils/cpufreq-info.c patching file tools/power/cpupower/utils/helpers/helpers.h patching file tools/power/cpupower/utils/helpers/misc.c patching file tools/power/cpupower/utils/cpufreq-info.c patching file tools/power/cpupower/utils/helpers/amd.c patching file tools/power/cpupower/utils/helpers/helpers.h patching file Documentation/admin-guide/pm/amd-pstate.rst patching file Documentation/admin-guide/pm/working-state.rst -> ###################################################### -> -> Applying your own linux-5.14 patch /home/pngu/git/tkg/linux-tkg/linux514-tkg-userpatches/lru_5.14.mypatch -> -> ###################################################### patching file arch/arm64/include/asm/cpufeature.h patching file arch/arm64/include/asm/pgtable.h patching file arch/arm64/kernel/cpufeature.c Hunk #1 succeeded at 1654 (offset 4 lines). Hunk #2 succeeded at 2138 (offset 4 lines). patching file arch/arm64/mm/proc.S patching file arch/arm64/tools/cpucaps patching file arch/x86/include/asm/pgtable.h patching file include/linux/pgtable.h patching file mm/memory.c patching file arch/Kconfig patching file arch/x86/Kconfig patching file arch/x86/include/asm/pgtable.h patching file arch/x86/mm/pgtable.c patching file include/linux/pgtable.h patching file mm/vmscan.c patching file fs/fuse/dev.c patching file include/linux/cgroup.h patching file include/linux/mm.h Hunk #1 succeeded at 1091 (offset -1 lines). patching file include/linux/mm_inline.h patching file include/linux/mmzone.h patching file include/linux/page-flags-layout.h patching file include/linux/page-flags.h Hunk #1 succeeded at 871 (offset 23 lines). Hunk #2 succeeded at 882 (offset 23 lines). patching file kernel/bounds.c patching file kernel/cgroup/cgroup-internal.h patching file mm/huge_memory.c Hunk #1 succeeded at 2394 (offset 4 lines). patching file mm/mm_init.c patching file mm/mmzone.c patching file mm/swapfile.c patching file mm/vmscan.c patching file include/linux/mm.h Hunk #1 succeeded at 1777 (offset -1 lines). Hunk #2 succeeded at 1817 (offset -1 lines). patching file include/linux/sched.h Hunk #1 succeeded at 865 (offset 22 lines). patching file mm/memory.c Hunk #1 succeeded at 4761 (offset 9 lines). Hunk #2 succeeded at 4783 (offset 9 lines). patching file mm/swap.c patching file mm/vmscan.c patching file mm/workingset.c patching file fs/exec.c patching file include/linux/memcontrol.h patching file include/linux/mm_types.h patching file kernel/exit.c patching file kernel/fork.c Hunk #1 succeeded at 674 (offset 5 lines). Hunk #2 succeeded at 1073 (offset 6 lines). Hunk #3 succeeded at 1116 (offset 6 lines). Hunk #4 succeeded at 2543 (offset 10 lines). patching file kernel/kthread.c patching file kernel/sched/core.c Hunk #1 succeeded at 4692 (offset 13 lines). Hunk #2 succeeded at 8493 (offset 13 lines). patching file mm/memcontrol.c patching file mm/vmscan.c patching file include/linux/memcontrol.h patching file include/linux/mmzone.h patching file include/linux/oom.h patching file include/linux/swap.h patching file mm/oom_kill.c patching file mm/rmap.c patching file mm/swap.c patching file mm/vmscan.c patching file mm/vmscan.c patching file include/linux/nodemask.h patching file mm/vmscan.c patching file mm/Kconfig patching file Documentation/vm/index.rst patching file Documentation/vm/multigen_lru.rst patching file Documentation/admin-guide/sysctl/vm.rst patching file kernel/sysctl.c Hunk #1 succeeded at 116 (offset 3 lines). Hunk #2 succeeded at 3167 (offset 46 lines). patching file mm/Kconfig patching file mm/vmscan.c -> ###################################################### -> -> Applying your own linux-5.14 patch /home/pngu/git/tkg/linux-tkg/linux514-tkg-userpatches/patch-5.14-redhat.mypatch -> -> ###################################################### patching file arch/arm/Kconfig patching file arch/arm64/Kconfig patching file arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts patching file arch/s390/include/asm/ipl.h patching file arch/s390/kernel/ipl.c patching file arch/s390/kernel/setup.c patching file arch/x86/kernel/setup.c patching file crypto/rng.c patching file drivers/acpi/apei/hest.c patching file drivers/acpi/irq.c patching file drivers/acpi/scan.c patching file drivers/ata/libahci.c patching file drivers/char/ipmi/ipmi_dmi.c patching file drivers/char/ipmi/ipmi_msghandler.c patching file drivers/char/random.c patching file drivers/firmware/efi/Makefile patching file drivers/firmware/efi/efi.c patching file drivers/firmware/efi/secureboot.c patching file drivers/hid/hid-rmi.c patching file drivers/hwtracing/coresight/coresight-etm4x-core.c patching file drivers/input/rmi4/rmi_driver.c patching file drivers/iommu/iommu.c patching file drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c patching file drivers/net/wireguard/main.c patching file drivers/pci/quirks.c patching file drivers/usb/core/hub.c patching file fs/btrfs/async-thread.c patching file fs/xfs/xfs_super.c patching file include/linux/efi.h patching file include/linux/lsm_hook_defs.h patching file include/linux/lsm_hooks.h patching file include/linux/random.h patching file include/linux/rmi.h patching file include/linux/security.h patching file init/Kconfig Hunk #1 succeeded at 1706 (offset 81 lines). patching file kernel/module_signing.c patching file mm/cma.c patching file security/integrity/platform_certs/load_uefi.c patching file security/lockdown/Kconfig patching file security/lockdown/lockdown.c patching file security/security.c patching file sound/soc/intel/boards/sof_sdw.c patching file tools/testing/selftests/bpf/Makefile patching file tools/testing/selftests/bpf/prog_tests/linked_funcs.c patching file tools/testing/selftests/bpf/prog_tests/linked_maps.c patching file tools/testing/selftests/bpf/prog_tests/linked_vars.c patching file tools/testing/selftests/bpf/progs/bpf_cubic.c patching file tools/testing/selftests/bpf/progs/bpf_dctcp.c patching file tools/testing/selftests/bpf/progs/kfunc_call_test.c patching file tools/testing/selftests/bpf/progs/kfunc_call_test_subprog.c patching file tools/testing/selftests/bpf/progs/linked_funcs1.c patching file tools/testing/selftests/bpf/progs/linked_funcs2.c patching file tools/testing/selftests/bpf/progs/linked_maps2.c patching file tools/testing/selftests/bpf/progs/linked_vars1.c patching file tools/testing/selftests/bpf/progs/linked_vars2.c Using config fragment -> Setting config HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c /bin/sh: line 1: flex: command not found make[1]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127 make: *** [Makefile:630: olddefconfig] Error 2 -> Configuration done. -> exit cleanup done ```
AdelKS commented 2 years ago

Hello!

./install.sh config does not install needed dependencies as it's not really meant for distros that are otherwise supported. ./install.sh install in the other hand, installs the needed dependencies.

One could edit install.sh to offer installing dependencies for supported distros when running ./install.sh config. As a workaround, one can run ./install.sh install, abort the script at the end of the dependency installation then run ./install.sh config, which is meant for more "advanced users" who want to compile linux-tkg for their unsupported distro.

itspngu commented 2 years ago

it's not really meant for distros that are otherwise supported

The readme does state that "f you only want the script to patch the sources in linux-src-git, you can use ./install.sh config", which kind of contradicts that statement. You're totally right about people who want to do that being "advanced users" though, if somebody, for some reason, only wants to apply the patches without building, they'll also likely be able to figure out missing dependencies themselves. Closing the issue.

AdelKS commented 2 years ago

The readme does state that "f you only want the script to patch the sources in linux-src-git, you can use ./install.sh config", which kind of contradicts that statement.

This is under the "Generic install" paragraph, which does not state that dependencies are installed: the script doesn't even know which distro you are running, which is the point of "Generic install".

You're totally right about people who want to do that being "advanced users" though, if somebody, for some reason, only wants to apply the patches without building, they'll also likely be able to figure out missing dependencies themselves.

Absolutely