"Anyone who has never made a mistake has never tried anything new." - Albert Einstein
Last week I started with
an article about debugging the autoinstallation process. This week I want to publish the second part of it.
Debug scriptsIf something with your self written scripts seems to go wrong, you can turn on the debugging of that scripts with the
<script>
<debug config:type="boolean">true</debug>
<feedback config:type="boolean">true</feedback>
...
</script>
options. If you don't turn on the
feedback option, you won't see a popup but you'll still find the logs of your scripts in the /var/adm/autoinstall/logs/ directory. With feedback turned on, you'll see the log in a popup too that has to be confirmed.
Debugging the ask-dialogsWhen you use the ask-dialogs and you want to test it without booting into the installation system, you should extract the complete <ask> part from the profile and store it in an own XML file. You can test the dialogs now with:
yast2 ayast_setup setup filename=/tmp/my_ask.xml
That requires that all <stage> entries in an ask-question are set to "cont" (the default is "initial"). If the <stage> is missing or set to "initial", you won't see anything with the help of "ayast_setup" because those dialogs are only raised up in stage one.
Be aware of the fact that all second stage parts of this XML file are really executed. So if there are some post-scripts in your XML for example, those will be executed too and depending on what you do in your scripts, you might end up with a slightly rearranged system :-)
ayast_setup is a very cool part of AutoYaST that can not only be used to debug your ask-sections (or any other second stage section), but also to configure a complete system with an AutoYaST profile from inside the running system (
here is a nice article about it).
Problems with rulesIf you use the rules feature to create a profile dynamically, you have some options for debugging too. If you want to see the values of the pre-defined rules (like "memsize", "karch", "mac" ....) you can run the client:
/usr/lib/YaST2/bin/y2base ayast_probe ncurses
You can run it in the installation system (by switching to the console via CTRL+ALT+F2 for example) or in an already installed system too (
yast2 ayast_probe).
If you are using custom rules based on a shell script written by you, you can run those scripts to see how they behave in the installation environment. They are stored in /tmp/YaST2-...../rule_.... files. You can grep for that tmp dir via
grep 'Writing rule script into' /var/log/YaST2/y2log
That requires that yast has started at least once and autoyast has fetched the XML profile.
If you don't have problems with the rules scripts, but with the merging, you can merge the XML files like AutoYaST would do it to view the result:
/usr/bin/xsltproc --novalid --param replace "'false'" \
--param dontmerge1 "'package'" \
--param with "'a.xml'" --output out.xml \
/usr/share/autoinstall/xslt/merge.xslt base.xml
The dontmerge parameter can be specified in your rules.xml too (see also the
merging documentation).
remote loggingif you want to transfer your logfiles (including y2log messages) to a loghost, you can simply pass the parameter "loghost=10.10.0.162" to your linuxrc parameter list. Of course you need network for that (netsetup=1) and your loghost has to accept log messages from the network (for syslog-ng that requires a
udp(ip("0.0.0.0") port(514)); in the config file).
If you want to use a serial console for remote logging, pass the following to your linuxrc parameter list:
earlyprintk=ttyS0,115200 console=ttyS0,115200
115200 might be too much for your system so you might have to reduce it and ttyS0 is hardware dependent of course (might be ttyS1 or so on your system). On the remote system you might want to use screen like
screen /dev/ttyS0 115200 then.
Still stuck?If you are still stuck, you can always write a mail to the AutoYaST mailinglist (you have to
subscribe to that list if you want to send mails to it).
It's always a good idea to read the
FAQ too.
have fun debugging :-)
ciao, Uwe Gansert