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.29
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 .. 20 21 22 23 24 25 26 27 28 29 30 .. 51 Next › Last »

figue commented on 2021-01-20 13:15 (UTC)

@agamemnon just define in the terminal the variable _microarchitecture to your desired value, for example:

env _microarchitecture=42 makepkg -sic

That will build for native.

harappan commented on 2021-01-20 12:11 (UTC)

how I can i edit the results from gcc-optimization? It defaults to the generic cpu, but I know my cpu microarchitecture, and I can't manually edit it.

Teddo commented on 2021-01-16 10:45 (UTC) (edited on 2021-01-16 10:50 (UTC) by Teddo)

@figue with the snapshot and makepkg I installed it but with pikaur and git clone I still have the error

fatal: branch name not valid: init.defaultBranch =

figue commented on 2021-01-15 09:15 (UTC)

@Teddo IDK about pikaur... Use regular git clone and makepkg to build the package and we see where is the issue.

Teddo commented on 2021-01-15 08:12 (UTC) (edited on 2021-01-15 08:13 (UTC) by Teddo)

@figue I don't know. I'm using pikaur and I can install other packages

figue commented on 2021-01-14 12:54 (UTC)

@Singularity great! If nobody has any objection, I'll implement it in all xanmod packages I maintain. Thank you!

Answering your question, "myconfig" idea was born here, in XanMod's AUR package as far as I know and implemented only here by myself... But I don't know if others have taken this idea for their packages too.

Singularity commented on 2021-01-14 12:37 (UTC) (edited on 2021-01-14 12:38 (UTC) by Singularity)

@figue Good idea, and it works. I adjusted it a bit farther:


-        if echo "$_linec" | grep "scripts/config" ; then
-          set -- $_linec
-          "$@"
+        if echo "$_linec" | grep -e "scripts/config" -e "^#" ; then
+          bash -c '$_linec'

Example config (but nothing special here):


scripts/config --enable  CONFIG_SATA_AHCI
scripts/config --module  CONFIG_ASHMEM
scripts/config --enable  "CONFIG_ANDROID_BINDER_IPC"
# Btw, scripts/config will use by default CONFIG_ as prefix
scripts/config --enable  ANDROID_BINDERFS
scripts/config --set-str CONFIG_ANDROID_BINDER_DEVICES ''
   # leading / trailing whitespaces are trimmed by bash due to the IFS, so that line is matched by grep ^# too

Btw, are there other packages which also allow for a "myconfig"?

figue commented on 2021-01-13 17:50 (UTC)

@Teddo ??? maybe some odd issue with AUR? This package is working fine.

Teddo commented on 2021-01-13 15:09 (UTC)

I can't download the package. fatal: branch name not valid: init.defaultBranch =