Change "Arming ConditionNeedsUpdate..." to "No errors."

All my Manjaro versions run so well that I have time to play around a bit. :wink:

Are there more elegant methods than

$ sed s/"Arming ConditionNeedsUpdate..."/"No errors."/g /usr/share/libalpm/hooks/systemd-update.hook > ~/a.hook | sudo mv a.hook /usr/share/libalpm/hooks/systemd-update.hook

?
Or more powerful :wink: in "autostart" , if Description in file is= Arming ConditionNeedsUpdate... then ...

I am open for all messages :slight_smile:

1 Like

You can modify the file directly with sed -i ("in-place") but I don't know whether you want that.

I would have written (I always thought special characters had to be escaped?):

sed -i 's/Arming\ ConditionNeedsUpdate\.\.\./No\ errors\./g' /usr/share/libalpm/hooks/systemd-update.hook

2 Likes
-i[ENDUNG], --in-place[=ENDUNG]

              Dateien an Ort und Stelle bearbeiten (erstellt Sicherung, falls ENDUNG angegeben)

Your sed work, thank you :slight_smile:
Was mich immer verrückt macht ist diese Syntax,
[ENDUNG] die in der "man" nicht erklärt wird.
Meinen die Datei-ENDUNG? .hook, das funktioniert dann nicht bei [Text]dateien ohne ENDUNG ? :smiley: :wink:

"[text]" work here, but I will change my work in future to this style to exclude mistakes.

Isn't it better to override the hook in a higher priority directory than edit the system hook directly?

3 Likes

I have no idea, when I switched from Mint to Manjaro it was the first thing I noticed. I wasn't the first one to be confused by "NeedsUpdate". But because the user doesn't have to do anything, a "No Error" etc. would be more appropriate. Found in https://bbs.archlinux.org/viewtopic.php?id=222673

I must now always smile about this message and thought to myself today that must be an end, with the text not with the smile itself. :wink:

I think "ENDUNG" (SUFFIX in the English version) is simply the suffix that is appended to the backup, e.g. systemd-update.hook.suffix. Not sure, you'll have to try :wink:

1 Like

So, this work one time :slight_smile: , next update "Arming" again :wink: but inspired by @tbg


I try this, hope it will work :smiley:

#/etc/pacman.d/hooks/no-error.hook

    [Trigger]
    Operation = Install
    Operation = Upgrade
    Operation = Remove
    Type = Package
    Target = *

    [Action]
    Description = Change "ArmingConditionNeedsUpdate" to "No error" 
    When = PostTransaction
    Exec = /bin/sh -c "sed -i 's/Arming\ ConditionNeedsUpdate\.\.\./No\ errors\./g' /usr/share/libalpm/hooks/systemd-update.hook"

Test failed, reboot needed? no

( 8/12) Restore Linux kernel modules

==> Warning:
         -> Kernel has been updated. Modules of the current kernel
         -> have been backed up so you can continue to use your
         -> computer. However, the new kernel will only work 
         -> at next boot.


( 9/12) Change "ArminNeedsUpdate" to "No error"
(10/12) Orphaned package notification
gobject-introspection 1.60.2-1
intltool 0.51.0-4
js52 52.9.0-3
meson 0.51.0-1
vala 0.44.5-1
yelp-tools 3.32.2-1
(11/12) Checking for .pacnew and .pacsave files...
.pac* files found:
/etc/fwupd/remotes.d/lvfs-testing.conf.pacnew
/etc/fwupd/remotes.d/lvfs.conf.pacnew
/etc/fwupd/remotes.d/vendor.conf.pacnew
/etc/default/grub.pacnew
/etc/libvirt/nwfilter/clean-traffic-gateway.xml.pacnew
/etc/libvirt/qemu/networks/default.xml.pacnew
Please check and merge
(12/12) Arming ConditionNeedsUpdate...

Seems to me I have to read more than I care to. :slight_smile:

1 Like

Take a look here:

Hooks are read from files located in the system hook directory /usr/local/share/libalpm/hooks , and additional custom directories specified in pacman.conf(5) (the default is /usr/local/etc/pacman.d/hooks ). The file names are required to have the suffix ".hook". Hooks are run in alphabetical order of their file name, where the ordering ignores the suffix.

Hooks may be overridden by placing a file with the same name in a higher priority hook directory. Hooks may be disabled by overriding them with a symlink to /dev/null .

Try to define a hook directory in /etc/pacman.d/hooks and put your customized hook there with the same name. If that doesn't succeed use a symlink do /dev/null to override the original hook.

2 Likes
~ >>> ls /etc/pacman.d/hooks/                                                                                                                                                                                                                                                                
insgesamt 12K
-rw-r--r-- 1 root root 381 22.06.2019 14:33 no-error.hook
-rw-r--r-- 1 root root 293 22.06.2019 14:29 orphans.hook
-rw-r--r-- 1 root root 432 22.06.2019 14:25 pacnew-check.hook

pacnew-check and orphans work well, I make other mistake I think :slight_smile:

Instead of no-error.hook copy systemd-update.hook and change the description to your liking. Then see if it works. If it doesn't work replace /etc/pacman-d/hooks/systemd-update.hook with a symlink to /dev/null having the same name.

1 Like

So....it looks like you are trying to place a hook in /etc/pacman.d/hooks/ which modifies the hook in /usr/share/libalpm/hooks.

I don't think you need to do that. Hooks in /etc/pacman.d/hooks/ should take precedence over over the ones in /usr/share/libalpm/hooks

If I understand this correctly, all you need to do is:

  • copy /usr/share/libalpm/hooks/systemd-update.hook to /etc/pacman.d/hooks/systemd-update.hook.
  • Edit the version in /etc/pacman.d/hooks to suit your preferences.

Since the version in /etc has precedence, even when the copy in /usr/share gets updated your custom version will override it.

At least, that is my working theory.

3 Likes

Perfect :slight_smile: , thank you.

1 Like

Forum kindly sponsored by