[opensuse-autoinstall] AutoYaST on USB key and in XEN setup (SLES 10sp3)
Howdy, I am trying to build a rules based deployment that will ultimately be on a custom DVD My intent is that the autoyast configuration be in /cf/... on the deployment media. I want to use a simple rules file in '/cf/rules/rules.xml' to parse the kernel command line to determine other files to pull in. The first rule is an unconditional match on product (could be anything) to fake the equivalent of "#include <FOO.xml>" (i'm not sure if i can, or it's advisable to use a "<class>" here instead?) The other two are custom rules that parse the kernel command line looking for a site designation and a node-type designation to include those specific profile files. I am initially testing this on a USB Key i built using 'mksusebootdisk'. My understanding is that if i placed this rules file on the USB key's VFAT filesystem as '/cf/rules/rules.xml' and boot with: linux autoyast=usb:///cf/ ZORKsite=site1 ZORKnode=ingest That the autoyast system should detect that "/cf" is a directory, it should then look for /cf/rules/rules.xml, it should find it, load and process it and should then include my "base" profile and the two files that match the site and node type. (i.e. it shouldn't require anything other than /cf/rules/rules.xml and the files i ultimately include, which would be in /cf/) I am, however, getting an error that the profile couldn't be loaded. I want to verify that i am using the proper autoyast pathing syntax above and that i understand the loading and parsing process as stated in the previous paragraph. I.E. is what i'm trying to do a correct and/or advisable way to use a rules file to parse the command line as the primary means of pulling the rest of the configurations into play? Secondarily, i wanted to test this stuff out using a virtual machine, but the virtual machine manager wants to be TOO helpful. Apparently, it will accept an "AutoYast" statement that can ONLY be a single profile file. (autoinst.xml), not a directory, therefore no rules can be run. What i tried, instead, was to create an ext2 disk image containing my autoyast setup, and put "autoyast=device:xvdc/cf" into the kernel line. Only the VM creation wizard sees the "autoyast" directive, pulls it from the kernel line, and then tries to handle it itself in the same way, and fails. Is there a method of doing what i want using the standard SLES10 XEN virtual machine management functions so i can test this setup without having to venture down to the machine room with USB key in hand to find that something's still wrong? My rules.xml file is included below: Thanks, --stephen P.S. If i put 'autoyast=usb:///cf/rules/rules.xml' autoyast DOES find the file, but it doesn't work. Initially i noticed a failure, because i was using "PATH=/sbin:/usr/sbin:$(getconf PATH)" and surprisingly 'getconf' isn't on the boot media install environment :-( Also, does the install "shell" support POSIX 'printf' instead of 'echo -n'? ------------------------------------------------------------------------------------------------- <?xml version="1.0"?> <!DOCTYPE autoinstall> <autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <!-- This rules file will generate a targetted profile stack for ZORK systems installation based upon cmdline parameters of the form: Example boot command lines: linux autoyast=cd:/cf ZORKsite=zork1 ZORKnode=in2 --> <rules config:type="list"> <!-- Setup the BASE ZORK system parameters --> <!-- This rule basically amounts to "#include ZORK_base.xml" --> <rule> <product> <match>*</match> <match_type>exact</match_type> </product> <result> <profile>ZORK_base.xml</profile> <continue config:type="boolean">true</continue> </result> </rule> <!-- === RULE:custom1: Determine the ZORK Site we're at === --> <rule> <custom1> <script> <![CDATA[ #!/bin/sh # Determine which SITE we are being installed at PATH="/bin:/sbin:/usr/bin:/usr/sbin" # Get a Kernel Command Line option. return value (after =) # or the command line option if it takes no arguments getkernopt() { sed -e 's/^.*\('$1'=\?[^[:space:]]*\).*$/\1/;s/^[^=]*=//' /proc/cmdline } zorksite="$(getkernopt ZORKsite)" if [ -z "${zorksite}" ]; then echo "ERROR_SITE_NOT_SPECIFIED (kernel command line=[$(cat /proc/cmdline)])" 1>&2 else echo -n "${zorksite}" fi ]]> </script> <match>*</match> <match_type>exact</match_type> </custom1> <result> <profile>ZORKsite-@custom1@.xml</profile> <continue config:type="boolean">true</continue> </result> </rule> <!-- === RULE:custom2: Determine the ZORK NODE we're installing === --> <rule> <custom2> <script> <![CDATA[ #!/bin/sh # Determine which NODE we are being installing as PATH="/bin:/sbin:/usr/bin:/usr/sbin" # Get a Kernel Command Line option. return value (after =) # or the command line option if it takes no arguments getkernopt() { sed -e 's/^.*\('$1'=\?[^[:space:]]*\).*$/\1/;s/^[^=]*=//' /proc/cmdline } PATH=/bin:/sbin:/usr/bin:/usr/sbin zorknode="$(getkernopt ZORKnode)" if [ -z "${zorknode}" ]; then echo "ERROR_NODE_NOT_SPECIFIED (kernel command line=[$(cat /proc/cmdline)])" 1>&2 else echo -n "${zorknode}" fi ]]> </script> <match>*</match> <match_type>exact</match_type> </custom2> <result> <profile>ZORKnode-@custom2@.xml</profile> <continue config:type="boolean">true</continue> </result> </rule> </rules> </autoinstall> ------------------------------------------------------------------------------------------------- -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdowdy@ucar.edu - http://www.ral.ucar.edu/~sdowdy/ -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Friday 08 January 2010 Stephen Dowdy wrote:
The first rule is an unconditional match on product (could be anything) to fake the equivalent of "#include <FOO.xml>" (i'm not sure if i can, or it's advisable to use a "<class>" here instead?)
a "matching always" rule is fine for that. You could put a class into the other XML snippets that pulls in the FOO.xml but I don't see a benefit in that.
I am initially testing this on a USB Key i built using 'mksusebootdisk'.
My understanding is that if i placed this rules file on the USB key's VFAT filesystem as '/cf/rules/rules.xml' and boot with:
linux autoyast=usb:///cf/ ZORKsite=site1 ZORKnode=ingest
The idea is correct but there is a problem because your installation source is on the the USB device. Autoyast tries to mount that device then and this fails because it's already mounted as readonly from the resolver (at least that would happen on SLES11 and IIRC it's the same on SLES10 SP3). Your /cf/ directory is on the installation source so you can use a fallback: autoyast=file:///cf/ As an alternative you can create a second partition on the USB stick that only contains the /cf/ directory. Then autoyast=usb:///cf/ works too. On openSUSE 11.3 and SLES11 SP1 that's fixed BTW.
I.E. is what i'm trying to do a correct and/or advisable way to use a rules file to parse the command line as the primary means of pulling the rest of the configurations into play?
yes, that's fine.
Secondarily, i wanted to test this stuff out using a virtual machine, but the virtual machine manager wants to be TOO helpful. Apparently, it will accept an "AutoYast" statement that can ONLY be a single profile file. (autoinst.xml), not a directory, therefore no rules can be run. What i tried, instead, was to create an ext2 disk image containing my autoyast setup, and put "autoyast=device:xvdc/cf" into the kernel line. Only the VM creation wizard sees the "autoyast" directive, pulls it from the kernel line, and then tries to handle it itself in the same way, and fails.
Is there a method of doing what i want using the standard SLES10 XEN virtual machine management functions so i can test this setup without having to venture down to the machine room with USB key in hand to find that something's still wrong?
Sorry, I'm not experienced with XEN. I use virtual box to test my autoyast stuff. But "device:xvdc/cf" is wrong anyway. Must be "device://xvdc/cf/"
Also, does the install "shell" support POSIX 'printf' instead of 'echo -n'?
yes it does -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Uwe, Thanks for responding... Uwe Gansert wrote, On 01/11/2010 02:06 AM:
on Friday 08 January 2010 Stephen Dowdy wrote: ... a "matching always" rule is fine for that. You could put a class into the other XML snippets that pulls in the FOO.xml but I don't see a benefit in that.
Oops, my fault. I had an extraneous "_" in a file name that i'd renamed (e.g. the rule was pulling in ZORK_base.xml, and i'd renamed the file ZORKbase.xml). AFAICT, using the <rule> bit for unconditional inclusion is more desireable than putting in <class> stuff in each potential conditionally included profile bit. I just presume that "rules.xml" can't have any "class" directives in it, so using the wildcard match is "the way to go?"
I am initially testing this on a USB Key i built using 'mksusebootdisk'.
My understanding is that if i placed this rules file on the USB key's VFAT filesystem as '/cf/rules/rules.xml' and boot with:
linux autoyast=usb:///cf/ ZORKsite=site1 ZORKnode=ingest
The idea is correct but there is a problem because your installation source is on the the USB device. Autoyast tries to mount that device then and this fails because it's already mounted as readonly from the resolver (at least that would happen on SLES11 and IIRC it's the same on SLES10 SP3). Your /cf/ directory is on the installation source so you can use a fallback: autoyast=file:///cf/ As an alternative you can create a second partition on the USB stick that only contains the /cf/ directory. Then autoyast=usb:///cf/ works too. On openSUSE 11.3 and SLES11 SP1 that's fixed BTW.
It does work, but i have to diddle it a bit. It initially fails with something like "Make sure install media is in Disk 1" (can't recall exactly.). All i have to do is hit "[BACK]", then proceed through the selection for Language and Keyboard, then "Setup or Install System", then select "Hard Disk" and then the partition for the USB key, then it works fine. But from what i'm reading, "file:///cf/" should "just work" as expected? I'll give that a try. Thanks for the tip on the secondary partition, that's useful to know.
Sorry, I'm not experienced with XEN. I use virtual box to test my autoyast stuff. But "device:xvdc/cf" is wrong anyway. Must be "device://xvdc/cf/"
I think i just mistyped, but the SLES XEN virtual machine manager still tries to "help" too much and keeps me from being able to specify the autoyast stuff. I guess i'll give up on that for now. If i find time later, i'll check out virtualbox.
Also, does the install "shell" support POSIX 'printf' instead of 'echo -n'? yes it does Great.
I'm now at the next problem, but i'll post a new thread to keep this from getting too complicated. --stephen -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdowdy@ucar.edu - http://www.ral.ucar.edu/~sdowdy/ -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Monday 11 January 2010 Stephen Dowdy wrote:
I just presume that "rules.xml" can't have any "class" directives in it, so using the wildcard match is "the way to go?"
that's right
My understanding is that if i placed this rules file on the USB key's VFAT filesystem as '/cf/rules/rules.xml' and boot with:
linux autoyast=usb:///cf/ ZORKsite=site1 ZORKnode=ingest
It does work, but i have to diddle it a bit. It initially fails with something like "Make sure install media is in Disk 1" (can't recall exactly.).
All i have to do is hit "[BACK]", then proceed through the selection for Language and Keyboard, then "Setup or Install System", then select "Hard Disk" and then the partition for the USB key, then it works fine.
okay, then the problem is different. linuxrc can not find the installation source on it's own for some reason. Does that dialog appear without autoyast=.... parameter too? Do you see any special error on any console? This is not very likely but do you have a parameter "manual=1" set? That would trigger the dialog too. The dialog you see raises before autoyast has started at all so it's hardly an autoyast issue.
But from what i'm reading, "file:///cf/" should "just work" as expected? I'll give that a try.
with the error above, I have doubts a change of the autoyast parameter will help.
Thanks for the tip on the secondary partition, that's useful to know.
but will not help with the problem above either :) Maybe you don't need that at all, with the file:/// parameter or the own partition for the profile. I'm not 100% sure how the resolver behaves on SP3. On SP3 it was not needed for sure and on SLES11 it is needed for sure but I'm uncertain about SP3. The hint with the file:/// only helps if autoyast can not find it's profile. But in your case linuxrc can not find the inst-source. -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Uwe Gansert wrote, On 01/12/2010 01:03 AM:
on Monday 11 January 2010 Stephen Dowdy wrote:
My understanding is that if i placed this rules file on the USB key's VFAT filesystem as '/cf/rules/rules.xml' and boot with:
linux autoyast=usb:///cf/ ZORKsite=site1 ZORKnode=ingest It does work, but i have to diddle it a bit. It initially fails with something like "Make sure install media is in Disk 1" (can't recall exactly.).
All i have to do is hit "[BACK]", then proceed through the selection for Language and Keyboard, then "Setup or Install System", then select "Hard Disk" and then the partition for the USB key, then it works fine.
okay, then the problem is different. linuxrc can not find the installation source on it's own for some reason. Does that dialog appear without autoyast=.... parameter too? Do you see any special error on any console? This is not very likely but do you have a parameter "manual=1" set? That would trigger the dialog too. The dialog you see raises before autoyast has started at all so it's hardly an autoyast issue.
But in your case linuxrc can not find the inst-source.
FWIW, Following up... Well, the only way i can get a USB key (made via mksusebootdisk) to boot and find the autoyast configs (which i store at /cf on the install media) properly is: linux install=hd://dev/sdc1/ autoyast=usb:///cf/ (using hd: install method with usb: autoyast method) That finds linuxrc right off (w/o having to back up through the menus to specify it). Using autoyast=file:///cf/ in this case doesn't work, you *have* to specify usb:///cf/ (i presume the USB method performs mounting functions that hd: method doesn't) However, other combos that didn't work: using 'install=usb:///' doesn't work, and linux instmode=usb autoyast=file:///cf/ yields: Could not find the SUSE linux Enterpise Server 10 Installation Source Activating manual setup program. going on that, and selecting menus to start system on sdc1 doesn't work as autoyast is NOT found linux install=hd:/sdc/ autoyast=file:///cf/ linux install=usb:/// autoyast=file:///cf/ dud url: disk:/?device=*usb* disk: trying to mount: /dev/sddc1 disk: /dev/sdc1: mount ok ... Automatic setup not possible linux install=device://sdc1/ autoyast=file:///cf/ no good (can't remember failure mode, just had it listed as not working) linux install=hd://dev/sdc1/ autoyast=hd://dev/sdc1/cf/ linuxrc loads properly, but AutoYaST can NOT be found --stephen -- Stephen Dowdy - Systems Administrator - NCAR/RAL 303.497.2869 - sdowdy@ucar.edu - http://www.ral.ucar.edu/~sdowdy/ -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Thursday 21 January 2010 Stephen Dowdy wrote:
Well, the only way i can get a USB key (made via mksusebootdisk) to boot and find the autoyast configs (which i store at /cf on the install media) properly is:
linux install=hd://dev/sdc1/ autoyast=usb:///cf/ (using hd: install method with usb: autoyast method)
That finds linuxrc right off (w/o having to back up through the menus to specify it). Using autoyast=file:///cf/ in this case doesn't work, you *have* to specify usb:///cf/ (i presume the USB method performs mounting functions that hd: method doesn't)
autoyast does not understand autoyast=hd:/... only linuxrc does but linuxrc does not understand install=usb:/// You can see a list of linuxrc install= parameters here: http://en.opensuse.org/Linuxrc for autoyast look here: http://www.suse.de/~ug/autoyast_doc/invoking_autoinst.html -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Mon, 11 Jan 2010, Stephen Dowdy wrote:
Uwe Gansert wrote, On 01/11/2010 02:06 AM:
The idea is correct but there is a problem because your installation source is on the the USB device. Autoyast tries to mount that device then and this fails because it's already mounted as readonly from the resolver (at least that would happen on SLES11 and IIRC it's the same on SLES10 SP3). Your /cf/ directory is on the installation source so you can use a fallback: autoyast=file:///cf/ As an alternative you can create a second partition on the USB stick that only contains the /cf/ directory. Then autoyast=usb:///cf/ works too. On openSUSE 11.3 and SLES11 SP1 that's fixed BTW.
It does work, but i have to diddle it a bit. It initially fails with something like "Make sure install media is in Disk 1" (can't recall exactly.).
All i have to do is hit "[BACK]", then proceed through the selection for Language and Keyboard, then "Setup or Install System", then select "Hard Disk" and then the partition for the USB key, then it works fine.
You have to tell linuxrc where the install environment (yast) is, when it's not on a cd. Like 'install=hd:/<repo_dir>' if you want to start from an (usb-)disk. Also, there could be a timing problem with usb storage. In that case adding 'usbwait=N' to delay the disk access by N seconds can help. Steffen -- Das Nichtrauchen entfernt uns von der Zivilisation und setzt den Mann mit seinem Dackel gleich. -- J. C. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (3)
-
Steffen Winterfeldt
-
Stephen Dowdy
-
Uwe Gansert