geek sources

Andrey Ovcharov (init_6) edited this page Apr 12, 2014 · 53 revisions

Not just another one of sys-kernel/*-sources… That's because Gentoo is about power of choice.

USE flags and features

sys-kernel/geek-sources Full sources for the Linux kernel including:

What does this all mean?

For example

If you need You need to use Or
aufs sys-kernel/aufs-sources USE="aufs" emerge geek-sources
bfq Now sys-kernel/gentoo-sources include it. However, the officialy you can not use only this patch separately. USE="bfq" emerge geek-sources
bld Officially unsupported USE="bld" emerge geek-sources
cjktty Officially unsupported USE="cjktty" emerge geek-sources
ck sys-kernel/ck-sources USE="ck" emerge geek-sources
epatch_user Officially unsupported In geek-sources work out of the box! Read note #1 below
exfat Officially unsupported USE="exfat" emerge geek-sources
fedora Officially unsupported USE="fedora" emerge geek-sources
gentoo sys-kernel/gentoo-sources USE="gentoo" emerge geek-sources
git sys-kernel/git-sources Read note #1 below
grsec sys-kernel/hardened-sources USE="grsec" emerge geek-sources
ice sys-kernel/tuxonice-sources USE="ice" emerge geek-sources
lqx Officially unsupported USE="lqx" emerge geek-sources
mageia Officially unsupported USE="mageia" emerge geek-sources
mips sys-kernel/mips-sources Read note #1 below
openvz sys-kernel/openvz-sources Read note #1 below
optimize Officially unsupported USE="optimize" emerge geek-sources
pax Officially unsupported USE="pax" emerge geek-sources
pf sys-kernel/pf-sources USE="pf" emerge geek-sources
raspberrypi sys-kernel/raspberrypi-sources Read note #1 below
reiser4 Officially unsupported USE="reiser4" emerge geek-sources
rh Officially unsupported USE="rh" emerge geek-sources
rifs Officially unsupported USE="rifs" emerge geek-sources
rsbac sys-kernel/rsbac-sources USE="rsbac" emerge geek-sources
rt sys-kernel/rt-sources USE="rt" emerge geek-sources
suse Officially unsupported USE="suse" emerge geek-sources
uek Officially unsupported USE="uek" emerge geek-sources
uksm Officially unsupported USE="uksm" emerge geek-sources
vanilla sys-kernel/vanilla-sources Read note #2 below
vserver sys-kernel/vserver-sources Read note #1 below
xbox sys-kernel/xbox-sources Read note #1 below
zen sys-kernel/zen-sources USE="zen" emerge geek-sources
zfs Officially unsupported USE="zfs" emerge geek-sources

Note #0: "Officially unsupported" means that now(2013-11-28) there is no any official support from gentoo. If you are lucky then maybe someone in overlays fix it.

Note #1: Disable all unnecessary USE flags cp <some_name>.{patch,gz,bz,bz2,lrz,xz,zip,Z} /etc/portage/patches/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT}}/<some_name>.{patch,gz,bz,bz2,lrz,xz,zip,Z} and make emerge geek-sources

Note #2: Disable all USE flags and set disable_fixes=yes skip_squeue=yes rm_unneeded_arch=no to /etc/portage/kernel.conf and make emerge geek-sources

Attention! And now a good question. What if you need a kernel simultaneously with: ck, ice and gentoo patches? If anyone knows how to solve this problem officially (only with package from official portage and not by hand) let me know.

Relationship of patches in geek-sources

graph source, if you’re interested

red lines - depends on clean kernel

blue lines - each following depends on the previous

green lines - inheritance

Eclass dependencies in geek-sources

graph source, if you’re interested

Patches & patch sets

Patches can be provided in next form:

  • simple patch/diff
  • patch in *.gz, *.bz, *.bz2, *.lrz, *.xz, *.zip or *.Z

Filenames can contain spaces. Additionally supported by patch sets and info files.

User patches

If you still want more, sys-kernel/geek-sources supports user's patches from /etc/portage/patches/sys-kernel/geek-sources folder.

All of this you can use individually or together in any combination. However you should keep in mind next phrase: with great power comes great responsibility by Uncle Ben (c)

You need to know that any patch that causes conflict in sys-kernel/geek-sources is automatically skipped. There are no checks for those type of patches/USE flags in sys-kernel/geek-sources.

User patches processed in next order:

  • if info file /etc/portage/patches/sys-kernel/geek-sources/info exists, then its content is displayed.
  • if file with list of user's patches /etc/portage/patches/sys-kernel/geek-sources/patch_list:
    • exists, then further work is performed according to the patch list
    • does not exist, then geek-sources tries to apply any files with file extension *.patch, *.gz, *.bz, *.bz2, *.lrz, *.xz, *.zip, *.Z from /etc/portage/patches/sys-kernel/geek-sources

While geek-sources working on a list of patches empty lines and comments are ignored and the rest is seen as relative paths to patches and patches themselves.

And so the same user patches work for any USE flag!

For example if you copy some patches to /etc/portage/patches/sys-kernel/geek-sources/aufs and make:

# USE="aufs" emerge sys-kernel/geek-sources

then those patches that you copied in /etc/portage/patches/sys-kernel/geek-sources/aufs will be applied directly after aufs patchset.

Test patches

Each patch passes couple of checks:

  • Normal patch must exist and contain more than 8 lines.
  • Patch in *.gz, *.bz, *.bz2, *.lrz, *.xz, *.zip, *.Z must exist and its size must be greater than zero.

Only those patches that pass the test check are applied

Default mode crap_patch=ignore

# patch -p1 -g1 --no-backup-if-mismatch --dry-run patch_name && patch -p1 -g1 --no-backup-if-mismatch patch_name

Maximum protection mode set crap_patch=will_not_pass in /etc/portage/kernel.conf

# patch -p1 -g1 --dry-run patch_name && patch -p1 -g1 patch_name
# if find *.orig or *.rej then patch -p1 -g1 -R patch_name; delete *.orig or *.rej

GEEKSOURCES_PATCHING_ORDER

Besides choice of possible patches you also can change the order that is used to apply patches in sys-kernel/geek-sources. Next example shows how to apply patches in alphabetical order.

# echo 'GEEKSOURCES_PATCHING_ORDER="aufs bfq bld brand cjktty ck fedora fix gentoo grsec ice lqx mageia optimize pax pf reiser4 rt squeue suse uksm upatch zen zfs"' > /etc/portage/kernel.conf

If the file /etc/portage/kernel.conf does not exist will use the default value of GEEKSOURCES_PATCHING_ORDER. Default patching order is

# GEEKSOURCES_PATCHING_ORDER="zfs optimize pax lqx pf zen bfq ck cjktty gentoo grsec ice reiser4 rt bld uksm aufs mageia fedora suse brand fix upatch squeue"

Default output:

 * The order of patching is defined in file /etc/portage/kernel.conf with the variable GEEKSOURCES_PATCHING_ORDER is its default value:
 * GEEKSOURCES_PATCHING_ORDER="zfs optimize pax lqx pf zen bfq ck cjktty gentoo grsec ice reiser4 rt bld uksm aufs mageia fedora suse brand fix upatch squeue"
 * You are free to choose any order of patching.
 * For example, if you like the alphabetical order of patching you must set the variable:
 * echo 'GEEKSOURCES_PATCHING_ORDER="aufs bfq bld branding ck fedora fix gentoo grsec ice lqx mageia pax pf reiser4 rt suse uksm upatch zfs"' > /etc/portage/kernel.conf
 * Otherwise i will use the default value of GEEKSOURCES_PATCHING_ORDER!
 * And may the Force be with you…

When using variable GEEKSOURCES_PATCHING_ORDER from file /etc/portage/kernel.conf you see

   * Use GEEKSOURCES_PATCHING_ORDER="zfs optimize pax lqx pf zen bfq ck cjktty gentoo grsec ice reiser4 rt bld uksm aufs mageia fedora suse brand fix upatch squeue" from /etc/portage/kernel.conf

If you accidentally or intentionally lose one of the USE flags from variable GEEKSOURCES_PATCHING_ORDER you will see:

cat /etc/portage/kernel.conf
GEEKSOURCES_PATCHING_ORDER="zfs optimize pax lqx pf zen bfq ck cjktty gentoo grsec ice reiser4 rt bld uksm aufs"

 * Use GEEKSOURCES_PATCHING_ORDER="zfs optimize pax lqx pf zen bfq ck cjktty gentoo grsec ice reiser4 rt bld uksm aufs" from /etc/portage/kernel.conf
 * Not all USE flag present in GEEKSOURCES_PATCHING_ORDER from /etc/portage/kernel.conf
 * The following flags are missing: mageia fedora suse brand fix upatch squeue
 * Probably that's the plan. In that case, never mind.

disable_fixes=yes in /etc/portage/kernel.conf - disable apply sys-kernel/geek-sources/files/{$PV}/fix

skip_squeue=yes in /etc/portage/kernel.conf - skip apply stable-queue patches

rm_unneeded_arch=yes delete all unneeded arch from /usr/src/linux/arch

Branding

Logo

CONFIG_LOGO_LARRY_CLUT224

CONFIG_LOGO_LARRY_HEAD_CLUT224

CONFIG_LOGO_GNU_CLUT224

CONFIG_FONT_ISO_LATIN_1_8x16

CONFIG_VT_CKO

This patch makes messages to be printed with custom color. It can be chosen at compile time, overridden at boot time, and changed at run time.

The "default" color CONFIG_VT_CKO settings:

 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE_SLEEP=y
 CONFIG_VT_CKO=y
 CONFIG_VT_PRINTK_EMERG_COLOR=0x01
 CONFIG_VT_PRINTK_ALERT_COLOR=0x04
 CONFIG_VT_PRINTK_CRIT_COLOR=0x05
 CONFIG_VT_PRINTK_ERR_COLOR=0x09
 CONFIG_VT_PRINTK_WARNING_COLOR=0x0E
 CONFIG_VT_PRINTK_NOTICE_COLOR=0x07
 CONFIG_VT_PRINTK_INFO_COLOR=0x02
 CONFIG_VT_PRINTK_DEBUG_COLOR=0x03
 CONFIG_VT_HW_CONSOLE_BINDING=y

ZFS

If you want to use ZFS support from geek-sources you need to do:

 echo 'sys-fs/zfs -kernel-builtin' >> /etc/portage/profile/package.use.mask 
 echo 'sys-fs/zfs kernel-builtin' >> /etc/portage/package.use 
 echo 'sys-kernel/geek-sources zfs' >> /etc/portage/package.use 
 emerge sys-kernel/geek-sources

In case of errors with spl include module spl into the kernel

 CONFIG_SPL=y