Package Base Details: linux-xanmod

Git Clone URL: https://aur.archlinux.org/linux-xanmod.git (read-only, click to copy)
Submitter: Yoshi2889
Maintainer: figue (figuepluto, jfigueras)
Last Packager: figue
Votes: 128
Popularity: 2.24
First Submitted: 2017-02-14 09:40 (UTC)
Last Updated: 2024-04-22 06:42 (UTC)

Pinned Comments

figue commented on 2018-12-14 00:50 (UTC) (edited on 2023-02-27 20:00 (UTC) by figue)

This package have several variables to enable/disable features.

##
## The following variables can be customized at build time. Use env or export to change at your wish
##
##   Example: env _microarchitecture=98 use_numa=n use_tracers=n makepkg -sc
##
## Look inside 'choose-gcc-optimization.sh' to choose your microarchitecture
## Valid numbers between: 0 to 99
## Default is: 0 => generic
## Good option if your package is for one machine: 98 (Intel native) or 99 (AMD native)
if [ -z ${_microarchitecture+x} ]; then
  _microarchitecture=0
fi

## Disable NUMA since most users do not have multiple processors. Breaks CUDA/NvEnc.
## Archlinux and Xanmod enable it by default.
## Set variable "use_numa" to: n to disable (possibly increase performance)
##                             y to enable  (stock default)
if [ -z ${use_numa+x} ]; then
  use_numa=y
fi

## Since upstream disabled CONFIG_STACK_TRACER (limits debugging and analyzing of the kernel)
## you can enable them setting this option. Caution, because they have an impact in performance.
## Stock Archlinux has this enabled. 
## Set variable "use_tracers" to: n to disable (possibly increase performance, XanMod default)
##                                y to enable  (Archlinux default)
if [ -z ${use_tracers+x} ]; then
  use_tracers=n
fi

# Unique compiler supported upstream is GCC
## Choose between GCC and CLANG config (default is GCC)
## Use the environment variable "_compiler=clang"
if [ "${_compiler}" = "clang" ]; then
  _compiler_flags="CC=clang HOSTCC=clang LLVM=1 LLVM_IAS=1"
fi

# Choose between the 4 main configs for stable branch. Default x86-64-v1 which use CONFIG_GENERIC_CPU2:
# Possible values: config_x86-64-v1 (default) / config_x86-64-v2 / config_x86-64-v3 / config_x86-64-v4
# This will be overwritten by selecting any option in microarchitecture script
# Source files: https://github.com/xanmod/linux/tree/5.17/CONFIGS/xanmod/gcc
if [ -z ${_config+x} ]; then
  _config=config_x86-64-v1
fi

# Compress modules with ZSTD (to save disk space)
if [ -z ${_compress_modules+x} ]; then
  _compress_modules=n
fi

# Compile ONLY used modules to VASTLY reduce the number of modules built
# and the build time.
#
# To keep track of which modules are needed for your specific system/hardware,
# give module_db script a try: https://aur.archlinux.org/packages/modprobed-db
# This PKGBUILD read the database kept if it exists
#
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
if [ -z ${_localmodcfg} ]; then
  _localmodcfg=n
fi

# Tweak kernel options prior to a build via nconfig
if [ -z ${_makenconfig} ]; then
  _makenconfig=n
fi

Personally I'm running now xanmod kernel compiled with this:

env _microarchitecture=98 use_tracers=n use_numa=n _localmodcfg=y _compress_modules=y makepkg -sic

Also, you can now create the file myconfig in your local repo to build this package with a custom config or use ${XDG_CONFIG_HOME}/linux-xanmod/myconfig. This file can be a full kernel config or be a script with several entries to add/remove options (you have several examples in PKGBUILD by using scripts/config):

Code involved:

  for _myconfig in "${SRCDEST}/myconfig" "${HOME}/.config/linux-xanmod/myconfig" "${XDG_CONFIG_HOME}/linux-xanmod/myconfig" ; do
    if [ -f "${_myconfig}" ] && [ "$(wc -l <"${_myconfig}")" -gt "0" ]; then
      if grep -q 'scripts/config' "${_myconfig}"; then
        # myconfig is a partial file. Executing as a script
        msg2 "Applying myconfig..."
        bash -x "${_myconfig}"
      else
        # myconfig is a full config file. Replacing default .config
        msg2 "Using user CUSTOM config..."
        cp -f "${_myconfig}" .config
      fi
      echo
      break
    fi
  done

Latest Comments

« First ‹ Previous 1 .. 21 22 23 24 25 26 27 28 29 30 31 .. 51 Next › Last »

figue commented on 2021-01-11 18:50 (UTC) (edited on 2021-01-11 23:01 (UTC) by figue)

@Singularity can you upload myconfig somewhere?

Edit: you can try to execute directly myconfig as a script:

Maybe something like this?

--- PKGBUILD    2021-01-09 23:54:32.306194466 +0100
+++ /tmp/PKGBUILD   2021-01-12 00:01:05.930930894 +0100
@@ -182,15 +182,8 @@
       cp -f "${startdir}"/myconfig .config
     else
       # myconfig is a partial file. Applying every line
-      msg2 "Applying configs..."
-      cat "${startdir}"/myconfig | while read -r _linec ; do
-        if echo "$_linec" | grep "scripts/config" ; then
-          set -- $_linec
-          "$@"
-        else
-          warning "Line format incorrect, ignoring..."
-        fi
-      done
+      msg2 "Applying configs as a script..."
+      sh "${startdir}"/myconfig
     fi
     echo
   fi

Singularity commented on 2021-01-11 17:53 (UTC)

@figue Thanks. Didn't make a difference. I also tried the shell built-in "command". I'm think that it happens already at the time of reading the file.

figue commented on 2021-01-10 22:00 (UTC) (edited on 2021-01-10 22:02 (UTC) by figue)

@Singularity it seems that bash parse this line as:

scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES '""'

and then scripts/config doesn't like it...

Can you try to modify PKGBUILD and add the following line:

set -- scripts/config

before this?

set -- $_linec

So the final code will be:

      cat "${startdir}"/myconfig | while read -r _linec ; do
        if echo "$_linec" | grep "scripts/config" ; then
          set -- scripts/config
          set -- $_linec
          "$@"
        else
          warning "Line format incorrect, ignoring..."
        fi
      done

figue commented on 2021-01-10 21:36 (UTC)

@MithicSpirit I don't use Grub since 0.97... So I don't know. If you know the way, I can modify the sources. Anyway, this package is based on linux in core/linux

Singularity commented on 2021-01-10 19:34 (UTC)

@figue Yes, if I execute the command form the last post in terminal (or the PKGBUILD), the result in the .config will be CONFIG_ANDROID_BINDER_DEVICES="".

But if placing this command inside the myconfig file, the resulting line in the .config will be CONFIG_ANDROID_BINDER_DEVICES="\"\""

MithicSpirit commented on 2021-01-10 17:07 (UTC)

Is there a way to make this package automatically replace the main entry for Arch in GRUB? Currently, I'm having to manually edit the main one in grub-customizer.

figue commented on 2021-01-10 15:22 (UTC)

@Singularity do you mean that the myconfig process parses some commands in a bad way? Can you provide your full myconfig please?

Singularity commented on 2021-01-10 13:34 (UTC)

The code for reading the myconfig file, could it be adjusted? It does not remove spaces, they will end up escaped in the config file. That's how it should be when placing there a full config. But when using scripts/config commands instead, it's bad because on the one hand the commands must be, in difference to the usage in the PKGBUILD, without spaces, but on the other hand, it's impossible to set an empty string, as it will be a syntax error if no spaces are used, and using spaces will make the spaces be part of the string. I.e. scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES "" can be used in the PKGBUILD, but not in myconfig.

figue commented on 2021-01-05 22:14 (UTC)

@burster yes, cachy patches are not included in 5.10.X for now.

If you want to try a new scheduler you can install package linux-xanmod-cacule which has new CacULE scheduler developed by the same guy that developed cachy:

Links:

https://github.com/xanmod/linux/tags

https://github.com/hamadmarri/cacule-cpu-scheduler

https://aur.archlinux.org/packages/linux-xanmod-cacule/

burster commented on 2021-01-05 17:16 (UTC) (edited on 2021-01-05 17:16 (UTC) by burster)

[burster@liza linux-xanmod]$ env use_cachy=y makepkg -s

Cachy branch is not ready yet...