Page 1 of 1

urpmi fail on diskless rpi5

PostPosted: Mar 27th, '24, 10:55
by john_gibbe
Hello,
I try to set a diskless Raspberry Pi5. I boot magiea 9 over the wired network on nfs v4 root share.
urpmi show always this error:
Code: Select all
urpmi database is locked (another program is already using it).

1) I removed /var/lib/urpmi/.LOCK and /var/lib/rpm/.RPMLOCK, but error emerge again.
2) I suspect it has to do with locking issue on NFSv4. I try to make Raspberry Pi5 to boot on nfs v3 but can't succeed despite I have a well working nfsv3 server.
3) I have found that urpmi use perl flock that is said not to work on nfs. I've seen also that there is a mageia perl packet named perl-File-NFSLock-1.290.0-3.mga9. I installed it and I try to modify /usr/share/perl5/vendor_perl/urpm/lock.pm despite I don't understand a word of perl. I replaced the three occurances of flock(... by File::NFSLock->new(... with no success. Error message was:
Code: Select all
$VAR1 = undef;
Not a HASH reference at /usr/share/perl5/vendor_perl/File/NFSLock.pm line 88.

4) I tried also to use fcntl(... instead of flock(... but still get the same message "urpmi database is locked (another program is already using it)."

I think that with 3) I was not far to the solution but I don't know anything of perl and can't get the correct syntax or give correct arguments to the NFSLock function.
Maybe there is here a more skilled guy to help me?

Re: urpmi fail on diskless rpi5

PostPosted: Mar 27th, '24, 19:03
by doktor5000
You don't mention your kernel commandline, or how you boot via nfs4 rootfs ?

It's probably better if you ask that question on the dev mailing list: https://ml.mageia.org/l/info/dev
I don't know anyone that uses an NFS rootfs. Last thread here was over 10 years ago: https://forums.mageia.org/en/viewtopic.php?f=8&t=5509

Re: urpmi fail on diskless rpi5

PostPosted: Mar 28th, '24, 00:28
by john_gibbe
Raspberry Pi5's "on-lan" boot process is specific. First you have to modify its reeprom to set the boot order code 0xe21 (First SD card, next lan and finally fail)
Then you have to set your dhcp server and add a line in your dhcp.conf:
Code: Select all
host RPI5_1 {  hardware ethernet 2c:cf:67:30:a4:0f; fixed-address 192.168.0.196; option routers 192.168.0.254; option tftp-server-name "192.168.0.193"; option vendor-class-identifier "PXEClient"; }

that give your RPI a fixed address (easier if you want to access it by ssh) and tell it where is the tftp server on which it will load files needed to boot (rpi firmware). In these files figure out the configuration file of your RPI (eg bluetooth is active or not, same for wifi, aso...) in config.txt and the command line file named cmdline.txt which look like that:
Code: Select all
console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.0.193:/home/nfs/aarch64/mageia/root_directory,tcp,vers=4.2 rw ip=dhcp rootfstype=nfs fsck.repair=no rootwait splash plymouth.ignore-serial-consoles

then RPI mount the nfsroot and boot the Mageia9 arm image I've put on the nfs server. Get some problem with X11 and opengl but works pretty well when switch on plasma wayland.

Re: urpmi fail on diskless rpi5

PostPosted: Mar 28th, '24, 01:52
by doktor5000
You could try to mount it as nfsv3 if the server supports that and exports it also as nfsv3.
If you do that, and if you only mount that share on one client you could try to add the nolock option or play around with the local_lock options, see the nfs man page for details.

Re: urpmi fail on diskless rpi5

PostPosted: Mar 28th, '24, 08:39
by john_gibbe
I have already tried NFSv3 because NFVv4 don't expose posix ACLs but unfortunally it seems RPI5 don't understand NFSv3 protocol and stop the boot process. I imagine reeprom has a limited space and they have implemented only one protocol :(

Re: urpmi fail on diskless rpi5

PostPosted: Mar 31st, '24, 23:11
by filip
john_gibbe, I'm sorry that I can't help you and I hope it will be resolved but I wonder how did you create a RPI5 bootable image? Was Wiki page helpfull?

Can you please improve it with your experience? I would like to raise the significance of RPI images and I and probably several others appreciate any help.

Re: urpmi fail on diskless rpi5

PostPosted: Apr 13th, '24, 18:05
by jayden6
I've attempted NFSv3 since NFVv4 doesn't expose posix ACLs, but unfortunately, it appears that RPI5 doesn't support the NFSv3 protocol and halts the boot process. I suspect the reeprom has limited space, and they've implemented only one protocol.