Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

How do I build the kernel in tmpfs?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
leyvi
l33t
l33t
Posts: 718
Joined: Fri Sep 08, 2023 1:22 pm

How do I build the kernel in tmpfs?

  • Quote

Post by leyvi » Mon Oct 27, 2025 7:06 pm

Just the build directory, obviously.
Where do I mount tmpfs?
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Oct 27, 2025 7:40 pm

Mount it wherever you like, and point the kernel build system to it by setting $KBUILD_OUTPUT to that path.
Top
leyvi
l33t
l33t
Posts: 718
Joined: Fri Sep 08, 2023 1:22 pm

  • Quote

Post by leyvi » Mon Oct 27, 2025 10:27 pm

Hu wrote:Mount it wherever you like, and point the kernel build system to it by setting $KBUILD_OUTPUT to that path.
Cool, thanks. Is that an environment variable or a make variable?
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Oct 28, 2025 12:15 am

It is normally put in the environment.
Top
mutiny
n00b
n00b
Posts: 20
Joined: Wed Aug 06, 2014 9:46 am

  • Quote

Post by mutiny » Sat Nov 01, 2025 5:29 pm

Out of curiosity, if portage is configured for tmpfs, does it build gentoo-kernel in tmpfs automatically with $KBUILD_OUTPUT or otherwise itself?
Top
leyvi
l33t
l33t
Posts: 718
Joined: Fri Sep 08, 2023 1:22 pm

  • Quote

Post by leyvi » Sat Nov 01, 2025 5:59 pm

Hu wrote:It is normally put in the environment.
This doesn't work for me. It says the build is messed up, and tells me to run a make thing called mrproper or something like that.
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Nov 01, 2025 6:25 pm

mutiny wrote:Out of curiosity, if portage is configured for tmpfs, does it build gentoo-kernel in tmpfs automatically with $KBUILD_OUTPUT or otherwise itself?
As I read the eclass, it includes O= with appropriate values, in each invocation of make. As I read Documentation/admin-guide/README.rst, this should have the same effect. If I recall correctly, O= is only respected when set on the make command line. KBUILD_OUTPUT is respected when put in the process environment.
leyvi wrote:
Hu wrote:It is normally put in the environment.
This doesn't work for me. It says the build is messed up, and tells me to run a make thing called mrproper or something like that.
This has worked for me for years. Without further details of what you did, there is nothing I can do to debug your environment.
Top
DaggyStyle
Watchman
Watchman
User avatar
Posts: 5969
Joined: Wed Mar 22, 2006 6:57 am

  • Quote

Post by DaggyStyle » Sat Nov 01, 2025 6:37 pm

something like this

Code: Select all

mount -t tmpfs -o size=2G tmpfs ${MNT_POINT}
zcat /proc/config.gz > ${MNT_POINT}/.config
make mrproper -C ${KERNEL_SRC_PATH}
make -C ${KERNEL_SRC_PATH} O=${MNT_POINT} oldconfig
make -C ${KERNEL_SRC_PATH} ${MAKEOPTS} O=${MNT_POINT}
make -C ${KERNEL_SRC_PATH} ${MAKEOPTS} O=${MNT_POINT} modules_install
umount ${MNT_POINT}
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56077
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Nov 01, 2025 7:34 pm

DaggyStyle,

Not quite like that. mrproper wipes out the .config file too, so that should be the first command .
It's probably not required though.

It would be a good idea to install the bzImage before umount too.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic