You are not logged in.
Hi,
I'm currently experimenting with mkarchiso to create my individual rescue USB stick. Creating the ISO and running it works.
However, I'd like to use my own version of /usr/share/nano/sh.nanorc and I don't know how to put it on the resulting image.
If I put it in the "archiso" directory at the desired location, it conflicts with the file from the "nano" package and the build fails.
On the other hand, I could not find a way to write a file to the target after installing the packages.
Is there a way to do that?
Offline
Multiple, some suggestions:
Add the file of the package into NoExtract of your pacman.conf https://wiki.archlinux.org/title/Pacman … _to_system
Create a PostTransaction libalpm hook that moves the file over on first install from a different location: https://wiki.archlinux.org/title/Pacman#Hooks
I'd probably go with the first approach
Offline
Oh yes ... the NoExtract config option ... I simply forgot about that. The PostTransaction libalpm hook appears too tedious for that purpose.
Unfortunately, NoExtract it did not work.
I've added this line:
NoExtract = usr/share/nano/sh.nanorc
and made sure it's the only one containing NoExtract except comments. I've tried with and without / at the beginning, I also checked the path for typos (using ls and the path copied via clipboard).
But still got the error:
nano: /tmp/mkarchiso/x86_64/airootfs/usr/share/nano/sh.nanorc exists in filesystem
Edit:
I forgot to mention that I also tried the full target path /tmp/mkarchiso/x86_64/airootfs/usr/share/nano/sh.nanorc with and without the / at the beginning.
Last edited by Markus.N2 (2023-11-30 12:09:01)
Offline
I think I'll have to check if I can make my own extended version of mkarchiso that has a "overwrite files" step after installing packages. Hopefully this is not too complicated.
Offline
I've added this line:
NoExtract = usr/share/nano/sh.nanorc
Did you put it in the pacman.conf file that's inside your custom profile's directory?
Offline
Yes, of course.
Offline
Yeah, it doesn't work.
error: failed to commit transaction (conflicting files)
nano: /tmp/archiso-tmp/x86_64/airootfs/usr/share/nano/sh.nanorc exists in filesystem
Errors occurred, no packages were upgraded.
==> ERROR: Failed to install packages to new root
Looks like pacman checks for existing files before looking at NoExtract.
/usr/share/ is a bad place to put custom files anyway, since it's the package manager territory.
I'm assuming you're adding a custom ~/.config/nano/nanorc to the ISO too, since syntax highlighting is not enabled by default in /etc/nanorc.
A solution would be to place your sh.nanorc somewhere else (e.g. /usr/local/share/) and load it from nanorc.
Offline
I'm aware that /usr/share/ is a bad place. However ... in this case it's the location where nano looks for .nanorc files. So I have no choice - at least without a tedious reconfiguration of nano.
Yes, I have a custom nanorc, but there I just include /usr/share/nano/*.nanorc, so I don't know what happens if one of the files conflicts with my custom location.
So I think I'll have to go with plan B: check if I can extend mkarchiso. I have already checked that it's a script, not a binary. So it should be possible.
Last edited by Markus.N2 (2023-12-03 10:01:37)
Offline
Yes, I have a custom nanorc, but there I just include /usr/share/nano/*.nanorc, so I don't know what happens if one of the files conflicts with my custom location.
The last include wins.
Offline