Making slackpkg $ROOT aware
For the maintenance of my live CD/USB I use {install,upgrade,remove}pkg with the ROOT parameter. E.g. when SQFS is the directory I unsquashed the root filesystem in:
Code:
ROOT="$(readlink -f SQFS/squashfs-root)" # absolute path When looking at the /usr/sbin/slackpkg script I saw that I can override the configuration directory with a CONF parameter. In that configuration directory there is the slackpkg.conf file which sets a.o. the TEMP download and WORKDIR filelists directories. I could hardcode those directories, but using the ROOT parameter seems more appropriate: Code:
--- slackpkg.conf.orig 2013-05-22 22:11:21.000000000 +0200 Code:
ROOT="$(readlink -f SQFS/squashfs-root)" # absolute path Note that we copied the /etc/slackpkg configuration directory to /SQFS/squashfs-root/etc/slackpkg and amended the slackpkg.conf file in there. Actually we could have amended the "host" slackpkg.conf file instead (and invoke slackpkg without the CONF parameter), but separating the "host" and "live" configurations makes it possible to change other arguments (such as the slackware version and mirror) as well. There are some minor hickups though: -- an (empty) "live" /var/lib directory has to be created; -- the "host" /usr/libexec/slackpkg/pkglist.awk file has to be amended: Code:
--- pkglist.awk.orig 2011-04-05 07:54:29.000000000 +0200 |
Actually /usr/libexec/slackpkg/core-functions.sh as distributed already contains a lot of (and /usr/libexec/slackpkg/function.d/dialog-functions.sh one) $ROOT references: all are in the form of the (pkgtools-compatible) "$ROOT/var/log/packages" phrase.
Now have a look at the "if ( $2 != "var" )" test in the /usr/libexec/slackpkg/pkglist.awk script: only when $ROOT is empty (or non-existent) that test will succeed! With a non-empty $ROOT the test will fail and slackpkg will malfunction. Changing that test to "if ( $(NF-3) != "var" )" will make the test succeed in both cases. By implication there are no users running slackpkg as distributed with the $ROOT argument. This means that whether or not $ROOT is added to the TEMP and WORKDIR settings in /etc/slackpkg/slackpkg.conf becomes a matter of taste. I would say it should, but otherwise an alternative slackpkg.conf (via the $CONF argument) is also a possibility. So my requests are: -- amend the /usr/libexec/slackpkg/pkglist.awk script -- see the diff in yesterday's posting; -- amend the /etc/slackpkg/slackpkg.conf file -- see the diff in yesterday's posting; -- create the $WORKDIR directory if not present -- e.g. in /usr/libexec/slackpkg/core-functions.sh system_setup(): Code:
--- core-functions.sh.orig 2015-12-16 08:01:12.000000000 +0100 |
Grab the git repo here: https://git.rlworkman.net/slackpkg/
Code:
git clone git://git.rlworkman.net/slackpkg |
Had a look at the commits.
For as far as I am aware adding the $ROOT to the TMPDIR creation is superfluous, the "host's" /tmp should suffice. Actually my testing (see below) showed the "new" TMPDIR creation will fail if $ROOT/tmp does not exist yet. Just curious: what is the advantage of amending mkdirs etc. all over the place over just amending two config lines? I then cloned the git and tried to check out the burdi01 branch. I have no git experience to speak of so it took me quite some time to figure out that you forgot a "cd slackpkg" in the instructions. Once that hurdle was taken I ran the slackbuild. Apart from the TMPDIR remark above the generated package fulfills my use case. Regards, Dick :D |
Quote:
Quote:
Quote:
Of course, I can't promise that this will be accepted, but once you tell me it works for you, I'll do another prerelease to get some wider testing. |
Robby , while you are at it, two small suggestions:
Greetings, |
Quote:
I now have tested ok my use case: slackpkg update, install, reinstall, upgrade-all and remove. Kind regards, Dick :D |
|
Quote:
I guess some sort of warning that e.g. "14.2" != "current" which requires confirmation would be fine, but it would only need to happen the first time. That's low on my priority list, but I won't necessarily reject it (or the first one) if someone else wants to implement it. |
2 Attachment(s)
Hello,
Quote:
|
Quote:
What do you mean by this? Code:
+ # Are cdrom and local really relevant? |
I mean: isn't the scheme file:// good enough for all local files?
On the other hand maybe I am missing other schemes for unofficial remote mirrors like on a samba share, whatever. |
You guys can do something about the offering to update LILO? Read: removing it or transforming it in whatever plugin?
Was demonstrated in the past that it can be nonfunctional and prone to create confusion. And anyway there are many other ways than LILO to boot Slackware, i.e. elilo, grub, syslinux, etc... PS. I never used (and I never will do) that slackpkg then does not affect me personally, if someone think that I will have some personal profit. :p |
I use local:// since a long time ago here (nfs-mounted trees), so I'm reluctant to change anything in that regard :-)
Re the patches, they are pushed to a "didier" branch as follows: Code:
commit 000fcef0ed53495119526d6fcf4b588749e849b6 (HEAD -> didier, origin/didier) |
Quote:
I'm inclined to say that slackpkg shouldn't offer to do anything - just tell the user that the kernel image changed and to make sure that some appropriate action is taken. However, I suspect that will break somebody's work flow somewhere, and that somebody will be even angrier (and for better reason) than all of the folks angry that slackpkg is offering to do something useless. After all, if we have to choose between "useless" and "harmful," it seems that useless is the better choice. I have an idea for how to make both groups happy, so I'll see about implementing that... |
All times are GMT -5. The time now is 12:37 PM. |