Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
distributing kernels built on binhost server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
torham
n00b
n00b


Joined: 26 Jun 2023
Posts: 3

PostPosted: Tue Aug 27, 2024 6:35 pm    Post subject: distributing kernels built on binhost server Reply with quote

I'm looking for some advice improving the way I install my kernel from a central build machine.

For regular packages I have a binhost setup, but for the kernel I have this system compiles the kernel and I share the /usr/src/linux directory over NFS. The other systems on my network mount the NFS share and just run `make install`. However, as of late when I do this I get:

Code:
# make module_install
mkdir: cannot create directory ‘.tmp_22607’: Read-only file system
mkdir: cannot create directory ‘.tmp_22612’: Read-only file system
mkdir: cannot create directory ‘.tmp_22617’: Read-only file system
mkdir: cannot create directory ‘.tmp_22622’: Read-only file system
mkdir: cannot create directory ‘.tmp_22627’: Read-only file system
...
mkdir: cannot create directory ‘.tmp_22757’: Read-only file system
mkdir: cannot create directory ‘.tmp_22762’: Read-only file system
mkdir: cannot create directory ‘.tmp_22767’: Read-only file system
mkdir: cannot create directory ‘.tmp_22772’: Read-only file system
make[1]: *** No rule to make target 'module_install'.  Stop.
make: *** [Makefile:234: __sub-make] Error 2


Nothing gets installed. This makes sense I guess, and though it's not clear to me why it needs to make temp directories in this spot to install, I don't think I want to make this a directory writable. How is everyone else going about this?
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1949

PostPosted: Thu Aug 29, 2024 10:51 pm    Post subject: Reply with quote

You can try make V=1 to get better information about what's going on, as it'll print the commands to-be-executed, but FWIW, gentoo-kernel is really made for this (working with binpkgs).
Back to top
View user's profile Send private message
torham
n00b
n00b


Joined: 26 Jun 2023
Posts: 3

PostPosted: Fri Sep 06, 2024 1:43 am    Post subject: Reply with quote

Gentoo-kernel seems close to what I want, I'll experiment with it. I'd like to start my config from `make defconfig`, normally I use ./scripts/kconfig/merge_config.sh to merge my changes from this point. I do see there is a savedconfig option, so I suppose I could run `make defconfig` and copy it over every now and again. It would be nice if there was a way to run a script to prepare the config though.

I also have a custom initramfs, presumably I could put any script in /etc/kernel/preinst.d?
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1029
Location: Somewhere in Denmark

PostPosted: Fri Sep 06, 2024 10:03 pm    Post subject: Reply with quote

Is that copy/pasted output - or typed?

Shouldn't it be
Code:
make modules_install
instead of
Code:
make module_install
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5094
Location: Bavaria

PostPosted: Fri Sep 06, 2024 11:51 pm    Post subject: Reply with quote

torham,

first of all: Welcome to Gentoo Forums ! :D

So, you're another one who configures and installs his kernel himself - like me. :lol: You even have your own custom intramfs. But I'm just wondering why you want to do a “make install” when two simple copy commands can do the job? How the “make install” works is nowadays controlled by the “installkernel” package, which can do some automagic things ... :roll:

Just copy from NFS/usr/src/linux/arch/x86/boot/bzImage to /boot or /efi (depending on how you boot your clients) (and run a "grub-mkconfig" afterwards if you use grub). You might want to browse these two articles.
* https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Cheat_Sheets
* https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI#Cheat_Sheets_for_a_standard_stub_kernel

The same applies to your initramfs - the 2nd copy job:
torham wrote:
I also have a custom initramfs, presumably I could put any script in /etc/kernel/preinst.d?

On a side note, I don't understand why you're doing this either:
torham wrote:
[...] normally I use ./scripts/kconfig/merge_config.sh to merge my changes from this point.

If you've only created a config ONCE that is exactly what you want, then you can use it over and over again by doing a “make oldconfig” with it.
( https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#What_is_.22make_oldconfig.22_.3F )
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 652

PostPosted: Sat Sep 07, 2024 5:52 am    Post subject: Re: distributing kernels built on binhost server Reply with quote

torham wrote:
However, as of late when I do this I get: "Read-only file system"
There was a fairly recent change to security defaults on NFS. I had to change export options (on a system that's been working for 15 years I might add!) to include "no_root_squash", but if you've been exporting "ro" all along then you can ignore that.

If it just wants to make .tmp-[something] files, maybe you can sidestep it with
Code:
mkdir ~/local-linux; cd ~/local-linux; for file in /path/to/nfs/linux/*;do ln -s $file ./$(basename $file);done; make install;make modules_install
which makes a writable local directory and adds the contents of the NFS share as symlinks. You can obviously delete the directory afterwards.

If it is just making .tmp-[something] files though, there is probably a more elegant solution with having the kernel source directory writable by a specific user, and making sure that user is used to access it on the client end; as said user won't have the rights to delete/alter anything extant (as only the NFS host's root user would have that privilege) you can "safely" export/mount it as read/write, but that involves setting up kerberos IIRC (read: A chore if the symlink one liner works, IMHO).
Back to top
View user's profile Send private message
torham
n00b
n00b


Joined: 26 Jun 2023
Posts: 3

PostPosted: Sat Sep 07, 2024 8:51 pm    Post subject: Reply with quote

Thanks for the tips everyone.

pietinger wrote:

But I'm just wondering why you want to do a “make install” when two simple copy commands can do the job?


Well, it is mostly about installing the modules.

pietinger wrote:

If you've only created a config ONCE that is exactly what you want, then you can use it over and over again by doing a “make oldconfig” with it.


I did do this originally, but found that the config fell out of date over time. It also seemed easier to keep track of the changes I made instead of the full config.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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