You are not logged in.

#1 2018-08-29 16:05:48

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

[SOLVED] Custom pacman cache with archiso 'build.sh' script

Hopefully I've chosen the right sub-forum wink

I've been expermenting with a custom archiso. I am using the official archiso to build a custom one. Becase the live environment lacks space, I'd like to specify a custom pacman CacheDir.

What I did was modify the pacman.conf in the working archiso copy (i.e copied from /usr/share/archiso/configs/releng). However the script 'build.sh' ignores this and uses the value from the /etc/pacman.conf file (the relevant code is in the function called 'make_pacman_conf').

If I put the path I want into /etc/pacman.conf then the archiso build.sh works fine. But it seems unnatural to have to change a system config when there is a suitable local one that could be used. I wonder if I'm doing it wrong or if this is a use pattern that wasn't considered ?

It would seem to me to make sense to only customise the CacheDir if it isn't already set in the archiso pacman.conf.

Or should I specify a custom dir another way (I did look in build.sh, but I couldn't see one) ?

Last edited by starfry (2018-08-29 17:16:05)

Offline

#2 2018-08-29 16:26:33

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

I'm a bit confused what you want to do. build.sh should only be using pacman to create the ISO, using cached packages in your system cachedir. What's the issue there and why is this counter-intuitive? (Also note, there should be no reason for you to *want* to store the files on the ISO image, unless you're building an offline ISO. But take a look at archboot if that's what you're interested in.)

If you want to change where pacman, when run from the booted ISO, stores its cached downloads, then change the pacman.conf in your archiso configs/* directory.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-08-29 16:36:46

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

The filesystem containing /var/cache/pacman/pkg is too small (it's booted from a live archiso (the official one downloaded from arch). So I have to point it elsewhere (on a mounted filesystem). I am not trying to include the cache in the iso.

I tried customising the pacman.conf copied from /usr/share/archiso/configs/releng but that just got clobbered by build.sh when it makes a copy in the work subdirectory.

Offline

#4 2018-08-29 16:47:25

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

So, you're using an ISO image to run the archiso scripts in order to generate another ISO image?

I think it is safe to say, it is okay to modify /etc/pacman.conf for this. That's host-specific information, not something an archiso profile needs to know about.

Or, you could bind-mount some other filesystem/directory to /var/cache/pacman/pkg though the difference is basically academic.

Last edited by eschwartz (2018-08-29 16:48:35)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2018-08-29 17:15:44

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

Eschwartz wrote:

So, you're using an ISO image to run the archiso scripts in order to generate another ISO image?

Yes, exactly.

Eschwartz wrote:

I think it is safe to say, it is okay to modify /etc/pacman.conf for this. That's host-specific information, not something an archiso profile needs to know about.

Or, you could bind-mount some other filesystem/directory to /var/cache/pacman/pkg though the difference is basically academic.

Yes that's what I've done, and it works fine. It just seemed odd that I couldn't write all my config mods to one place - the pacman.conf in my copied config directory. That's where I added custom repos that I needed and it felt natural to make all changes there, in one place.

I guess because the config pacman.conf ends up in the iso then it does indeed make sense the way that it does it.

Offline

#6 2018-08-29 17:20:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

Well, sure, because the pacman.conf explicitly replaces all cachedirs with the system ones, using make_pacman_conf() for the workdir. That pacman.conf is not really meant for installing, just for copying over -- so it is temporarily copied, the cachedir settings for the final ISO is overwritten by ones suitable for use in build.sh itself, and that right there does not accept the options you want.

You *could* modify all `pacman` commands to use --cachedir /path/to/my/cachedir (which will add that as an additional cachedir, prioritized above the ones in /etc/pacman.conf) but that is in no way part of the *existing* build.sh configurability.

Last edited by eschwartz (2018-08-29 17:26:46)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2018-08-29 19:07:12

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

Eschwartz wrote:

That pacman.conf is not really meant for installing, just for copying over

One of the other things I do is add a repo to that config and that is used for installing (in particular, I added the archzfs repo to pacman.conf). So it must be used, at least partially, for installing. AIUI it writes its modified version into the 'work' directory.

I may (but only if there's a zfs/kernel version disparity) add a temporary local file-based repo as well that contains the required kernel. Ideally I would not want that one in the pacman.conf written into the iso but I can see no way to avoid that.

Offline

#8 2018-08-29 19:18:23

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Custom pacman cache with archiso 'build.sh' script

starfry wrote:
Eschwartz wrote:

That pacman.conf is not really meant for installing, just for copying over

One of the other things I do is add a repo to that config and that is used for installing (in particular, I added the archzfs repo to pacman.conf). So it must be used, at least partially, for installing. AIUI it writes its modified version into the 'work' directory.

Sure, like I said it grabs that conf file in order to use your options like custom repos. That's necessary if you want to set them to be preinstalled.

I may (but only if there's a zfs/kernel version disparity) add a temporary local file-based repo as well that contains the required kernel. Ideally I would not want that one in the pacman.conf written into the iso but I can see no way to avoid that.

That's problematic because there's no way to make it generally available. Not to the ISO user, and not to other people who want to see your configs, unless you check a giant tarball into git...


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB