I have a custom dracut module installed as a pre-mount hook (for Fedora 18). This shell script needs to echo some messages to the console, but I'm having no luck making that happen. I've tried: echo foo echo foo > /dev/console echo foo > /dev/kmsg . /lib/dracut-lib.sh info foo . /lib/dracut-lib.sh export DRACUT_QUIET="no" /bin/plymouth --hide-splash info foo
At various times, I've tried booting with rd.info=1, but my final solution needs to not require that. All of these things work as expected from the emergency_shell (reached by passing rd.break on the cmd-line). I've looked at that function and haven't seen what I'm missing. I'm starting to suspect the shell works because of the special setup in the dracut-emergency.service systemd unit, but haven't yet tried retooling things so that my hook scripts becomes not much more than a 'systemctl start mycustom.service', which in turn minics dracut-emergency.service but instead of a user shell, calls another shell script with the bulk of what's presenty in my hook script.
Is there a simpler way or anybody know what I'm doing wrong or need to do differently? Given that I'm doing this all in a LiveOS image, my turn-around time for testing is rather slow and tedious. -- John Florian
On Fri, Mar 08, 2013 at 02:55:40PM -0500, John.Florian@dart.biz wrote:
I have a custom dracut module installed as a pre-mount hook (for Fedora 18). This shell script needs to echo some messages to the console, but I'm having no luck making that happen. I've tried:
This is similar to what we ran into with checkisomd5, now that systemctl is being used by dracut you need to setup a service with access to the console in order for anything to be output (or input).
The service file for that looks like this:
[Unit] Description=Media check on %f DefaultDependencies=no Before=shutdown.target
[Service] Type=oneshot RemainAfterExit=no ExecStart=/bin/checkisomd5 --verbose %f StandardInput=tty-force StandardOutput=inherit StandardError=inherit TimeoutSec=0
You can look at commits 040f3883 and 5204d1d3 in dracut to see how it is setup.
From: "Brian C. Lane" bcl@redhat.com
On Fri, Mar 08, 2013 at 02:55:40PM -0500, John.Florian@dart.biz wrote:
I have a custom dracut module installed as a pre-mount hook (for
Fedora
18). This shell script needs to echo some messages to the console,
but
I'm having no luck making that happen. I've tried:
This is similar to what we ran into with checkisomd5, now that systemctl is being used by dracut you need to setup a service with access to the console in order for anything to be output (or input).
The service file for that looks like this:
[Unit] Description=Media check on %f DefaultDependencies=no Before=shutdown.target
[Service] Type=oneshot RemainAfterExit=no ExecStart=/bin/checkisomd5 --verbose %f StandardInput=tty-force StandardOutput=inherit StandardError=inherit TimeoutSec=0
You can look at commits 040f3883 and 5204d1d3 in dracut to see how it is setup.
-- Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
Thanks for that Brian! I had pretty much came to that conclusion before calling it a day on Friday, but it's very helpful to know that the effort to go that route won't be wasted.
-- John Florian
From: John.Florian@dart.biz
From: "Brian C. Lane" bcl@redhat.com
On Fri, Mar 08, 2013 at 02:55:40PM -0500, John.Florian@dart.biz wrote:
I have a custom dracut module installed as a pre-mount hook (for
Fedora
18). This shell script needs to echo some messages to the console,
but
I'm having no luck making that happen. I've tried:
This is similar to what we ran into with checkisomd5, now that
systemctl
is being used by dracut you need to setup a service with access to the console in order for anything to be output (or input).
The service file for that looks like this:
[Unit] Description=Media check on %f DefaultDependencies=no Before=shutdown.target
[Service] Type=oneshot RemainAfterExit=no ExecStart=/bin/checkisomd5 --verbose %f StandardInput=tty-force StandardOutput=inherit StandardError=inherit TimeoutSec=0
You can look at commits 040f3883 and 5204d1d3 in dracut to see how it
is
setup.
-- Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
Thanks for that Brian! I had pretty much came to that conclusion before calling it a day on Friday, but it's very helpful to know that the effort to go that route won't be wasted.
-- John Florian
I just wanted to drop another note and thank you to mention that I got it working. I had been mimicking how the dracut-emergency.service worked, but the media-check service made an even better example by being even more trivial. So, thanks again!
-- John Florian
---------- Forwarded message ---------- From: "Brian C. Lane" bcl@redhat.com Date: Mon, 11 Mar 2013 06:37:41 -0700 Subject: Re: [Fedora-livecd-list] Can't echo to console from dracut module To: livecd@lists.fedoraproject.org
On Fri, Mar 08, 2013 at 02:55:40PM -0500, John.Florian@dart.biz wrote:
I have a custom dracut module installed as a pre-mount hook (for Fedora 18). This shell script needs to echo some messages to the console, but I'm having no luck making that happen. I've tried:
This is similar to what we ran into with checkisomd5, now that systemctl is being used by dracut you need to setup a service with access to the console in order for anything to be output (or input).
The service file for that looks like this:
[Unit] Description=Media check on %f DefaultDependencies=no Before=shutdown.target
[Service] Type=oneshot RemainAfterExit=no ExecStart=/bin/checkisomd5 --verbose %f StandardInput=tty-force StandardOutput=inherit StandardError=inherit TimeoutSec=0
You can look at commits 040f3883 and 5204d1d3 in dracut to see how it is setup.
livecd@lists.fedoraproject.org