autorun with dialog doesn't work

Post questions about how to make a customized SystemRescueCd, and if you have problems to install new packages. Please read the handbook first.
xabbu
Posts: 9
Joined: 25 Oct 2008, 17:20

autorun with dialog doesn't work

Postby xabbu » 25 Oct 2008, 17:26

Hello all,

I have created an dialog script which should start at boottime.
So I put the script in /root and named it autorun.

The script starts but I can't navigate or do anything.
When I stop it and start the script direct on the console with ./autorun everything is working fine.

So did you have a solution to create an autorun script with dialog?

Thanks,
xabbu

paupla
Posts: 2
Joined: 13 Nov 2008, 23:17

Re: autorun with dialog doesn't work

Postby paupla » 13 Nov 2008, 23:34

That was my problem too. I've found out that the parser program /usr/sbin/autorun logs all output of the autorun script(s) and "dialog" doesn't like that ;-)

Just modify that program as follows:

Code: Select all

# ---- execute the autorun scripts found ----
for curfile in autorunfiles:
[...]
cmd='sh %s 2>&1'%(curfile)

and it works. In fact that is dirty, but quick ;-)
Someone could find a better workaround for example to check whether the autorun script(s) is/are a bash script with "dialog" inside. Then disable logging the output like above.

HTH
paupla

Ineluki
Posts: 2
Joined: 02 Feb 2010, 20:19

Re: autorun with dialog doesn't work

Postby Ineluki » 02 Feb 2010, 20:21

I have this problem but I don't understand what are you trying to do paupla and your code doesnt work for me, could someone help me please?

paupla
Posts: 2
Joined: 13 Nov 2008, 23:17

Re: autorun with dialog doesn't work

Postby paupla » 07 Mar 2010, 20:19

OK, the actual /usr/sbin/autorun looks like a bit different, but I newly changed that program so the new version 1.4.0 will work with personal dialog-autorun-scripts too.

The detailed todo you can find in http://www.sysresccd.org/Sysresccd-manual-en_How_to_personalize_SystemRescueCd We need most of that steps there.

1. Follow the Steps 1 and 2
2. The customizing (Step 3) is as follows:
  • find /mnt/custom/customcd/files/usr/sbin/autorun
  • make a copy of that original file
  • edit like I wrote on 13 Nov 2008; the () can also be removed if one like
  • save the file
3. Skip Step 4 and maybe go on with Step 5
4. Step 6 rebuilds the /mnt/custom/customcd/isoroot/sysrcd.dat again (with the modified autorun parser-script)
5. In Step 7 copy your autorun-Script(s) with dialog-parts inside and make it/them executable
6. Maybe set your keymap like shown in Step 8 and/or edit boot options (Step 9)
7. Create and burn the ISO-Image (Steps 10 and 11)
8. Finish with umounting and syncing and reboot your machine with the CD/DVD you even burned

If everything was ok, your autorun script appears after boot process and you can use all the dialog features

Good luck!

paupla

Ineluki
Posts: 2
Joined: 02 Feb 2010, 20:19

Re: autorun with dialog doesn't work

Postby Ineluki » 15 Mar 2010, 19:12

OK I'll try that, thanks a lot for your detailed explanation. :)

shalomcrown
Posts: 1
Joined: 06 Feb 2012, 18:21

Re: autorun with dialog doesn't work

Postby shalomcrown » 06 Feb 2012, 18:23

To use dialog without changing the CD, just put the following line in your bash script before running dialog:

Code: Select all

exec >& $(tty)


This is a nasty trick to get the name of current terminal device and redirect all output back to that.

gernot
Posts: 1112
Joined: 07 Apr 2010, 16:19

Re: autorun with dialog doesn't work

Postby gernot » 06 Feb 2012, 18:44

Thanks this solution work.
There is also an other nasty way: viewtopic.php?f=25&t=4319

Gernot


Return to “Customization and installing new packages”

Who is online

Users browsing this forum: No registered users and 0 guests