[prev in list] [next in list] [prev in thread] [next in thread] 

List:       suse-autoinstall
Subject:    Re: [opensuse-autoinstall] Question about network
From:       Thomas Fehr <fehr () suse ! de>
Date:       2014-11-29 10:32:55
Message-ID: 20141129103255.GE23567 () suse ! de
[Download RAW message or body]

On Sat, Nov 29, Achim Klausmann wrote:

> Am 28.11.2014 um 10:34 schrieb Simon Crute:
>> You could probably use a pre script to identify the mac address and plug
>> it into the xml file.
> How would this look like?

Pre-Scripts can be used to modify the autoinst.xml file.
If autoyast detects modified xml file after secution of pre script,
it read the modified file and uses it. So you could have a template 
as mac address in your xml file and let pre-script replace template 
by real mac address of system

They are explained in chapter 4.16.1 of 
http://doc.opensuse.org/projects/autoyast

Here is an example of a pre script that replaces /dev/sdx in
partitioning section of autoinstall.xml by a disk of appropriate
size in the system. Similar stuff could be done to modify
mac address.

-------------------------------------------------------
<pre-scripts config:type="list">
  <script>
    <debug config:type="boolean">true</debug>
    <filename>pre_script</filename>
    <interpreter>shell</interpreter>
    <source><![CDATA[
#!/bin/bash
DISK=""
for i in /sys/block/sd*
do
    SIZE=`cat $i/size`
    if [ -z "$DISK" -a $SIZE -gt 20971520 -a $SIZE -lt 41943040 ]
    then
        DISK=/dev/`echo $i | sed "s:^.*/::"`
    fi
done
[ -z "$DISK" ] && DISK=/dev/sda
sed "/device.*dev.sdx/s:/dev/sdx:$DISK:" </tmp/profile/autoinst.xml
>/tmp/profile/modified.xml
       ]]></source>
  </script>
</pre-scripts>
</scripts>
-------------------------------------------------------


Tschuess, 
	Thomas Fehr
-- 
  Thomas Fehr, SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
  GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg)
  Tel: +49-911-74053-0,  Fax: +49-911-74053-482,  Email: fehr@suse.de
  GPG public key available.
-- 
To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic