You are not logged in.

#1 2017-05-25 16:07:54

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

[SOLVED]Is this a bug when using the plymouth hook?

Hello,

I was recently fiddling with plymouth, but decided against it. So after uninstalling everything, I forgot to remove the plymouth hook. After rebooting to the console login (no display manager), TTY1 would first blink abnormally, then after every key press it appears that enter was also pressed (even though it wasn't). This made logging in impossible. You could enter two keys at most, one for login, one for password. But, ctrl + alt f2 into TTY2 let me log in fine. I would expect that having the hook, but missing the related package(s) and configuration file(s) would error out cleanly, instead of causing this anomaly. I saw no errors otherwise. Something like "Error: Plymouth hook used, but missing package base! Exiting..." in the journal or something would be preferred in my opinion, because the error is now handled cleanly.

Steps to reproduce:
1) Do not install any plymouth or display manager packages. We are testing the effects of these being missing.
2) Add plymouth hook to /etc/mkinitcpio.conf as per the wiki.
3) Rebuild initramfs.
4) Reboot.
5) Press any key, try to login normally.
6) Watch your login screen do weird things described above.
7) ctrl + alt + f2 to login normally.

Is this a bug, and if so, where do I go to report it (somewhere upstream I'm guessing)? Thanks!

Last edited by JohnBobSmith (2017-05-26 19:36:54)


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#2 2017-05-25 17:11:32

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED]Is this a bug when using the plymouth hook?

This hook https://aur.archlinux.org/cgit/aur.git/ … h=plymouth?  Upstream for that would be the aur package maintainer.

Offline

#3 2017-05-25 18:02:50

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED]Is this a bug when using the plymouth hook?

I'm guessing that must be it. I'm going to see if I can test it out, making some changes to see if anything happens. Is that hook just a bash script? If so, it wouldn't be too hard to check for the presence of the plymouth binary. if not, exit. If present, continue. Thanks for the link to the code! smile


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#4 2017-05-25 18:07:53

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED]Is this a bug when using the plymouth hook?

The runtime hooks use ash as provided by busybox if I understand correctly and the install ones bash you can find them under /usr/lib/initcpio/

Offline

#5 2017-05-25 18:25:19

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED]Is this a bug when using the plymouth hook?

Heres some interesting info. After building and installing the plymouth package, removing it, and then adding the hook, mkinitcpio does indeed error out:

==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 4.11.2-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
==> ERROR: Hook 'plymouth' cannot be found
...

So to test I'm going to install the package and re-build initramfs, then remove the package leaving the ininitramfs unchanged. This should generate the error, which I'm trying to catch with this code change from the plymouth source linked above.

run_hook() {
        #Check for the binary
        if [[ ! -e /usr/bin/plymouth ]]; then
            echo "Error: Plymouth hook used, but missing binary!"
        fi
        /usr/bin/plymouth --show-splash
}

Ash seems to be compatible with most BASH syntax: https://en.wikipedia.org/wiki/Almquist_shell so this confirms that the hooks are shell scripts.

EDIT: Oops, I guess my echo here is utterly useless. Fail on my part. Curious, how should one log erors to the journal? Or print them as boot messages? yikes more work and research to be done on my part.

EDIT:
So the following has no effect.

run_earlyhook(){
        #Check for the binary
        if [[ ! -e /usr/bin/plymouth ]]; then
            exit 1
        fi
        # first trigger graphics subsystem
        udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
        # first trigger graphics and tty subsystem
        udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1

        udevadm settle --timeout=30 2>&1

    /usr/bin/mknod /dev/fb c 29 &>/dev/null
        /usr/bin/mkdir -p /dev/pts
        /usr/bin/mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true
        /usr/bin/plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session
}

run_hook() {
        #Check for the binary
        if [[ ! -e /usr/bin/plymouth ]]; then
            exit 1
        fi
        /usr/bin/plymouth --show-splash
}

run_latehook(){
        #Check for the binary
        if [[ ! -e /usr/bin/plymouth ]]; then
            exit 1
        fi
        /usr/bin/plymouth update-root-fs --new-root-dir=/new_root
}

# vim: set ft=sh:

The package is not installed at the time of testing. Time for some more research. I look forward to seeing what I can find/figure out! smile

EDIT: Bleh, this is literally going nowhere. Marking as solved because the solution is to remember to remove the plymouth hook. Part of me wants to fix this but if I'm not capable then I'm not capable and I will refuse to let it consume me.

Last edited by JohnBobSmith (2017-05-26 19:36:31)


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

Board footer

Powered by FluxBB