注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Debian-sources"

From Funtoo
Jump to navigation Jump to search
m (Undo revision 9467 by Pytony (talk))
m (Note that you're not limited to tweak_config)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Ebuild
{{Ebuild
|Summary=This is the Debian kernel. This is default recommended kernel to use in http://www.funtoo.org/Funtoo_Linux_Installation
|Summary=This is the Debian kernel. This is default recommended kernel to use in [[Funtoo_Linux_Installation]]
|CatPkg=sys-kernel/debian-sources
|CatPkg=sys-kernel/debian-sources
|Maintainer=Oleg,
|Maintainer=Oleg,
|Homepage=http://www.funtoo.org/Funtoo_Linux_Kernels
|Homepage=http://www.funtoo.org/Funtoo_Linux_Kernels
}}
}}
== Introduction ==
== Introduction ==
This is the Debian kernel. It is roughly equal to a kernel shipped by Debian Linux in their releases. Ebuild now support the <code>binary</code> USE flag. The aim of this ebuild is to have support for near all possible hardware and users shouldn't really dig into configs, aka "install and forget".  Daniel has added a special config-extract command which can be used to list all available official Debian kernel configurations, and generate them from the Debian files included with the kernel.  
This is the Debian kernel. It is roughly equal to a kernel shipped by Debian Linux in their releases. Ebuild now support the <code>binary</code> USE flag. The aim of this ebuild is to have support for near all possible hardware and users shouldn't really dig into configs, aka "install and forget".  Daniel has added a special config-extract command which can be used to list all available official Debian kernel configurations, and generate them from the Debian files included with the kernel.  
== Usage ==
== Usage ==
<console>
{{console|body=
###i## echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
###i## echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
###i## emerge debian-sources
###i## emerge debian-sources
###i## nano -w /etc/boot.conf
###i## nano -w /etc/boot.conf
###i## boot-update
###i## boot-update
</console>
}}
{{fancyimportant|1=
 
<code>debian-sources</code> with <code>binary</code> USE flag also automatically installing a /usr/src/linux symlink pointing to debian kernel.}}
{{important|1=
{{c|debian-sources}} with {{c|binary}} USE flag also automatically installing a /usr/src/linux symlink pointing to debian kernel.}}
 
== Advanced use ==
== Advanced use ==
Additional information about using <code>config-extract</code> tool and genkernel tips can be found here:
 
http://www.funtoo.org/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel
Additional information about using {{c|config-extract}} tool and genkernel tips can be found here:
[[Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel]]
 
=== Tweaking Kernel Config Options via /etc/portage/env ===
 
If you want to tweak specific kernel config options while still having the {{c|binary}} USE flag enabled, one can make use of the [https://wiki.gentoo.org/wiki//etc/portage/package.env /etc/portage/env] directory.
 
In particular, one can create a file called {{c|/etc/portage/env/sys-kernel/debian-sources}}, and use it to call the {{c|tweak_config}} function in the debian-sources ebuild. Since that file is sourced before executing any phase of the ebuild, one could "hook" the {{c|src_compile}} phase and run {{c|tweak_config}} right before it.
 
The {{c|tweak_config}} function has three arguments: path to the kernel config, option key, and option value. In the case of debian-sources, the first argument is always {{c|"${T}"/config}}, as that's where genkernel expects the config to be located.
 
Here's a simple example, which enables the Tux logo on boot:
{{file|name=/etc/portage/env/sys-kernel/debian-sources|lang=Shell|body=
#!/bin/bash
if [ "${EBUILD_PHASE}" == "compile" ]; then
tweak_config "${T}"/config CONFIG_LOGO y
fi
}}
 
Note that you're not limited to calling the {{c|tweak_config}} function. You can, in theory, overwrite the entire config as well.
 
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 19:44, March 30, 2022

Debian-sources

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


Introduction

This is the Debian kernel. It is roughly equal to a kernel shipped by Debian Linux in their releases. Ebuild now support the binary USE flag. The aim of this ebuild is to have support for near all possible hardware and users shouldn't really dig into configs, aka "install and forget". Daniel has added a special config-extract command which can be used to list all available official Debian kernel configurations, and generate them from the Debian files included with the kernel.

Usage

root # echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
root # emerge debian-sources
root # nano -w /etc/boot.conf
root # boot-update
   Important

debian-sources with binary USE flag also automatically installing a /usr/src/linux symlink pointing to debian kernel.

Advanced use

Additional information about using config-extract tool and genkernel tips can be found here: Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel

Tweaking Kernel Config Options via /etc/portage/env

If you want to tweak specific kernel config options while still having the binary USE flag enabled, one can make use of the /etc/portage/env directory.

In particular, one can create a file called /etc/portage/env/sys-kernel/debian-sources, and use it to call the tweak_config function in the debian-sources ebuild. Since that file is sourced before executing any phase of the ebuild, one could "hook" the src_compile phase and run tweak_config right before it.

The tweak_config function has three arguments: path to the kernel config, option key, and option value. In the case of debian-sources, the first argument is always "${T}"/config, as that's where genkernel expects the config to be located.

Here's a simple example, which enables the Tux logo on boot:

   /etc/portage/env/sys-kernel/debian-sources (Shell source code)
#!/bin/bash
if [ "${EBUILD_PHASE}" == "compile" ]; then
	tweak_config "${T}"/config CONFIG_LOGO y
fi

Note that you're not limited to calling the tweak_config function. You can, in theory, overwrite the entire config as well.