Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[FAQF] KC14: Kernel compiling, CFLAGS and make.conf settings
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Marel
n00b
n00b


Joined: 29 Apr 2006
Posts: 17
Location: Serbia

PostPosted: Sun May 07, 2006 6:03 pm    Post subject: Reply with quote

I tried
Code:
# export CFLAGS_KERNEL="athlon-xp"
# make V=1

but in output is still only athlon (without xp). Is there something else to do?
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3514
Location: Alsace (France)

PostPosted: Wed May 31, 2006 5:13 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-p-3350460-highlight-.html#3350460

It's in french but should be understanble. You just have to apply the commands.

BTW the march option is defined by menuconfig. Theese few commands should allow you to build your kernel with the CFLAGS from the make.conf
_________________
le "lol" est aux boulets ce que le ";" est au programmeurs
Back to top
View user's profile Send private message
charlie
n00b
n00b


Joined: 21 Oct 2007
Posts: 36

PostPosted: Tue Jul 02, 2013 4:54 am    Post subject: Reply with quote

This function, that you can paste into your .bashrc file, uses the MAKEOPTS and CFLAGS variables from /etc/portage/make.conf to compile your kernel with.

Code:
cdku () {
JOBS=`cat /etc/portage/make.conf | grep ^MAKEOPTS | sed 's@MAKEOPTS="\(.*\)"$@\1@1'`
cd /usr/src/linux &&
mv -v Makefile{,.orig} &&
cat Makefile.orig | sed 's@CFLAGS_KERNEL =@CFLAGS_KERNEL +=@1' > Makefile &&
export CFLAGS_KERNEL=`cat /etc/portage/make.conf | grep ^CFLAGS | sed 's@CFLAGS="\(.*\)"$@\1@1'` &&
sed -i "s@\(export.*INSTALL_PATH\) ?= /boot@\1=/boot@g" Makefile ;
make all ${JOBS} && make modules_install && make firmware && make firmware_install && make install ;
sed -i "s@\(export.*INSTALL_PATH\)=/boot@\1 ?= /boot@g" Makefile
}


If using lilo--the sed instruction changing the INSTALL_PATH line in "Makefile" is there just in case you are compiling the kernel from git and don't want to have a modified Makefile interfering with your "git pull".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum