..

Autoyast FAQ - Frequently Asked Questions

Questions

1. Autoyast

Q: 1.1 How do I invoke an autoinstallation?
Q: 1.2 What is an autoyast profile?
Q: 1.3 How do I create an autoyast profile?
Q: 1.4 What is smallest profile that makes sense?
Q: 1.5 I have an already installed system. Can I create a profile based on that system?
Q: 1.6 How do I do an autoinstallation with autodetection of my soundcard?
Q: 1.7 I want to install from CD only. Where do I put the autoyast profile?
Q: 1.8 I want to use the same profile for IDE and SCSI harddisks.
Q: 1.9 How can I test a merging process on the commandline?
Q: 1.10 Is there a way for persistent network device names in SLES10?
Q: 1.11 Issues with the bnx2 network device driver
Q: 1.12 persistent devices names when cloning bridged networks

2. SUSE Linux general

Q: 2.1 What is the layout of a SLES9 installation server with Service Pack?
Q: 2.2 How do I get a console during the installation and where are the Logfiles?
Q: 2.3 Is there a length limit on the line of parameters passed to linuxrc using the boot menu (kernel command line)?
Q: 2.4 How do I add own RPMs to a SLES10/SL10.1 installation source?
Q: 2.5 How do I setup a SLES10 installation server?
Q: 2.6 I want to sign my add-on product. How can I do that?
Q: 2.7 Can I put an add-on product onto the first CD?
Q: 2.8 How to create a mini boot CD?
Q: 2.9 What is the layout of a SLES10 installation server with Service Pack?

Answers - Autoyast

1.1 How do I invoke an autoinstallation?
On all SUSE Linux versions, the automatic installation gets invoked by adding autoyast=<PATH_TO_PROFILE> to the kernel parameter list. So for example adding autoyast=http://myserver/myconfig.xml will start an automatic installation where the profile with the autoyast configuration gets fetched from the webserver myserver.
Look here for details.

1.2 What is an autoyast profile?
That's the autyast configuration file. In the autoyast profile you have to configure how the system should look like that you want to install via autoyast. So, which Software will be installed, how is the partitioning, what is the root password and so on. Nearly everything you can configure with yast, can also be configured in an autoyast profile. The profile format is an ASCII XML file.

1.3 How do I create an autoyast profile?
You can use the graphical user interface from the yast control center (misc/autoinstallation) or you can run yast2 autoyast from the commandline or you can use your favourite Text/XML Editor.

1.4 What is smallest autoyast profile that makes sense?

SLES9 / SUSE Linux 10.1 and older

<?xml version="1.0"?>
<!DOCTYPE profile SYSTEM "/usr/share/autoinstall/dtd/profile.dtd">
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
    <partitioning config:type="list">
        <drive>
            <use>all</use>
        </drive>
    </partitioning>
    <software>
        <base>default</base>
    </software>
    <users config:type="list">
        <user>
            <encrypted config:type="boolean">false</encrypted>
            <user_password>myrootpassword</user_password>
            <username>root</username>
        </user>
    </users>
</profile>

SLES 10 / openSUSE 10.2 and newer
<?xml version="1.0"?>
<!DOCTYPE profile SYSTEM "/usr/share/autoinstall/dtd/profile.dtd">
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
    <partitioning config:type="list">
        <drive>
            <use>all</use>
        </drive>
    </partitioning>
    <users config:type="list">
        <user>
            <encrypted config:type="boolean">false</encrypted>
            <user_password>myrootpassword</user_password>
            <username>root</username>
        </user>
    </users>
</profile>
Attention! This profile will wipe out all partitions on the first harddisk autoyast can find.
If you want to skip the confirmation screen, you have to set <mode><confirm config:type="boolean"> to false.

1.5 I have an already installed system. Can I create a profile based on that system?
Yes, that's possible. On the already installed system, start "yast2 autoyast" and choose from the menu: Tools -> Create Reference Profile. That will generate an XML file based on the current system. You can use that XML file to reinstall the machine.

1.6 How do I do an autoinstallation with autodetection of my soundcard?

<sound>
    <autoinstall config:type="boolean">true</autoinstall>
    <configure_detected config:type="boolean">true</configure_detected>
</sound>

1.7 I want to install from CD only. Where do I put the autoyast profile?
put it to the root of the CD. Refer to it with file:///...
For some SUSE Linux versions, you have to add install=cd then too, to the kernel parameter list. For some reason yast forgets that it installs from CD when the autoyast parameter is in use.

1.8 I want to use the same profile for IDE and SCSI harddisks
Don't specify the <device> in the autoyast profile for your <drive> section. Autoyast will try to guess the device then which works well in many cases.

1.9 How can I test a merging process on the commandline?
if you want to merge a.xml with base.xml, do the following:

/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 dontmerge1 is optional and just an example for how to do the commandline when you use the dont_merge element in your profile.

1.10 Is there a way for persistent network device names in SLES10?
you can use a chroot script to simulate that:

   <scripts>
       <chroot-scripts config:type="list">
          <script>
             <chrooted config:type="boolean">false</chrooted>
             <filename>udev_config.sh</filename>
             <interpreter>shell</interpreter>
             <source><![CDATA[
#
# simulate behaviour of /lib/udev/rename_netiface to
# create udev config files like in comment #11
#
# FIXME: might only work on i386/x86_64
#        check if "grep HWaddr" really catches all we need
#

UDEV_FILE="/mnt/etc/udev/rules.d/30-net_persistent_names.rules"
DATE=`date`

echo "# autogenerated by autoyast chroot script" > "$UDEV_FILE"
echo "# $DATE" >> "$UDEV_FILE"

for INTERFACE in $(ls /sys/class/net|grep -v lo); do
   MAC_ADDR=$(ip  addr show $INTERFACE|grep link|grep -v loop|awk '{ print $2 }' | tr '[:upper:]' '[:lower:]')
   echo -n "SUBSYSTEM==\"net\", ACTION==\"add\", SYSFS{address}==\"$MAC_ADDR\", " >> "$UDEV_FILE"
   echo "IMPORT=\"/lib/udev/rename_netiface %k $INTERFACE\"" >> "$UDEV_FILE"
done
]]>
             </source>
          </script>
       </chroot-scripts>
  </scripts>

1.11 Issues with the bnx2 network device driver

on SLES10 SP2 the bnx2 driver has the problem, that it takes ages (up to 60s) for him to raise up the network device. Until then, no network is available. That can disturb the automatic installation. First of all, if your installation source is on a network device, YaST can not connect that installation source. That issue was fixed for SP2 (see bugzilla).
Still there are problems when you have init-scripts with a <location> that requires network (like HTTP, FTP,...) because after configuring the network device by autoyast, it take another 60 seconds to raise the device and the <location> is evaluated after the network configuration. As a workaround you have to add an inline post-script that waits for 60 seconds:

   <scripts>
       <post-scripts config:type="list">
          <script>
             <network_needed config:type="boolean">false</network_needed>
             <filename>wait.sh</filename>
             <interpreter>shell</interpreter>
             <source><![CDATA[
sleep 60
]]>
             </source>
          </script>
      </post-scripts>
      <init-scripts config:type="list">
          <script>
             <location>http://.....</location>
             ...
          </script>
      </init-scripts>
   </scripts>

that script will wait 60 seconds and then network should be available and the remote init-scripts can be fetched.
If you need network in your init-script too, then you have to wait again for 60 seconds or so in your init-script.

I know, that sucks but the driver is broken and the description above is just a workaround for a broken network device driver.

1.12 persistent devices names when cloning bridged networks

When cloning a system with a bridged network, the AutoYaST profile doesn't include udev rules for persistent names of network devices. This is because physical eth devices (attached into bridge) are unconfigured.
To keep their persistent names you should write that rules into profile manually (look here for details.)


Answers - General SUSE Linux

2.1 What is the layout of a SLES9 installation server with Service Pack?
here is the layout of a SLES9 installation server with service pack. If you recreate that by hand, it should work. You can leave out the ARCHIVES.gz, INDEX.gz and ls-lR.gz you can see in the tree. For all I known, they are not important on that level. The yast directory with it's two files is very important:

> tree -L 2
.
|-- boot -> sles9-i386/CD1/boot
|-- content -> sles9-i386/CD1/content
|-- control.xml -> sles9-i386/CD1/control.xml
|-- core9-i386
|   |-- ARCHIVES.gz
|   |-- CD1
|   |-- CD2
|   |-- CD3
|   |-- CD4
|   |-- CD5
|   |-- INDEX.gz
|   `-- ls-lR.gz
|-- driverupdate -> sles9-sp-i386/CD1/driverupdate
|-- media.1 -> sles9-i386/CD1/media.1
|-- sles9-i386
|   |-- ARCHIVES.gz
|   |-- CD1
|   |-- INDEX.gz
|   `-- ls-lR.gz
|-- sles9-sp-i386
|   |-- ARCHIVES.gz
|   |-- CD1
|   |-- CD2
|   |-- CD3
|   |-- INDEX.gz
|   `-- ls-lR.gz
`-- yast
    |-- instorder
    `-- order

> cat yast/instorder
/sles9-sp-i386/CD1 /sles9-sp-i386/CD1
/sles9-i386/CD1 /sles9-i386/CD1
/core9-i386/CD1 /core9-i386/CD1
/
> cat yast/order
/sles9-sp-i386/CD1 /sles9-sp-i386/CD1
/sles9-i386/CD1 /sles9-i386/CD1
/core9-i386/CD1 /core9-i386/CD1
/

2.2 How do I get a console during the installation and where are the Logfiles?
For a textconsole press CTRL+ALT+F2. YaST Logfiles can be found in /var/log/YaST2/. The y2log contains the most information about what autoyast is doing. You can use scp to copy the files to another machine.

2.3 Is there a length limit on the line of parameters passed to linuxrc using the boot menu (kernel command line)?
Yes, there is a limit, I am not sure what is it though (someone telling me it is 256 but it might be hardware dependant).
To avoid this, use an info file with all parameters. Make sure all the URLs to the installation source and to the profile are short. Use symlinks or aliases instead of specifying the complete path. Any keyword on the command line that is beyond the allowed length will be ommited.
The length limit was changed with SLES10 SP1 to at least 512 character (hardware dependent).

2.4 How do I add own RPMs to a SLES10/SL10.1 installation source?
To create a tree with RPMs in parallel of your other installation source, use at least version 20060418 of create_update_source.sh from my SUSE Homepage (http://www.suse.de/~ug). The latest inst-source-utils RPM will contain that script too. You can find documentation on how to use that script here. After you have created the tree with your own RPMS, you have two options to tell autoyast about that new installation source. Either in the autoyast profile like this:

<add-on>
  <add_on_products config:type="list">
    <listentry>
      <media_url>http://192.168.66.1/SLES10/updates</media_url>
      <product>SuSE-Linux-Updates</product>
      <product_dir>/</product_dir>
      <name>MyUpdates</name> <!-- available since openSUSE 11.1/SLES11 (bnc#433981) -->
    </listentry>
  </add_on_products>
</add-on>
You can do that with the autoyast UI on SLES10/SL10.1 too. Or another option is to create a file called "add_on_products" on the main installation source. So it looks like this (the "updates" directory was created by the script):
#:/space/SLES10 # tree -L 1
.
|-- ARCHIVES.gz
|-- COPYING
|-- COPYING.de
|-- COPYRIGHT
|-- COPYRIGHT.de
|-- ChangeLog
|-- INDEX.gz
|-- LICENSE.TXT
|-- NEWS
|-- README
|-- README.BETA
|-- README.BETA.DOS
|-- README.DOS
|-- add_on_products
|-- boot
|-- content
|-- control.xml
|-- directory.yast
|-- docu
|-- dosutils
|-- gpg-pubkey-0dfb3188-41ed929b.asc
|-- gpg-pubkey-1d061a62-427a396f.asc
|-- gpg-pubkey-307e3d54-44201d5d.asc
|-- gpg-pubkey-3d25d3d9-36e12d04.asc
|-- gpg-pubkey-9c800aca-40d8063e.asc
|-- ls-lR.gz
|-- media.1
|-- pubring.gpg
|-- suse
`-- updates

#:/space/SLES10 # cat add_on_products
http://192.168.66.1/SLES10/updates

If your add-on is on a device, the add_on_products file looks like this:

hd:/updates?device=/dev/sdb1 /

With that file on the installation source, you don't need to specify the additional installation sources in the autoyast profile.

You can mix those two options. So it's possible to specify one installation source in the autoyast profile and another one in the "add_on_products"-file.
Of course official add-on products like the SDK are handled in the same way. The URL in the add_on_products file might look like this then "http://192.168.66.1/SLES10/sdk/CD1"

if you add own, unsigned RPMs, you should also read the section about signature handling with autoyast in the documentation.

2.5 How do I setup a SLES10 installation server?

mkdir -p sles10/CD{1,2,3,4}
mount -o ro,loop SLES-10-CD1.iso /mnt
cp -rv /mnt/* sles10/CD1
umount /mnt
repeat those steps with CD2, CD3 and CD4. Then use the install-linuxrc parameter like this:
install=http://..../sles10/CD1

2.6 I want to sign my add-on product. How can I do that?
First of all you need a gpg key. I assume you already have one.
Create the add-on product like described in 2.4 with the create_update_source script. Now you should have a directory called "updates". Do the following steps:
cd updates
gpg --export --armor $KEY_ID > content.key
gpg -b --sign --armor content
ls > directory.yast
$KEY_ID is the id of your gpg key.
To make yast accept your new gpg key, you have two choices:
To your autoyast profile add:
  <general>
    <signature-handling>
      <accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
    </signature-handling>
    ...
or, add your key to the initrd. Then you don't need anything special in your autoyast profile:
unpackInitrd initrd
cd /tmp/work-initrd
gpg --export --armor $KEY_ID > my-key.gpg
find . | cpio -H newc -o > /tmp/initrd
gzip /tmp/initrd
mv /tmp/initrd.gz /place/for/initrd

2.7 Can I put an add-on product onto the first CD?
yes, you can do that. Copy your CD1 to the harddisk and create the add-on product like described in 2.4. If you want to use the add_on_products file, you must use cd:///updates as pointer to your add-on.
To create a new CD do:

mkisofs -R -o /tmp/CD1.iso -b boot/i386/loader/isolinux.bin \
       -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .

2.8 How to create a mini boot CD?
A simple boot CD can be created like described below. You can change the file isolinux.cfg in the boot/i386/loader/ directory to add an autoyast=.... parameter.

mkdir /tmp/minicd
cp -a /srv/ftp/mounted-isos/sled10-i386/boot/i386/loader/* /tmp/minicd
cd /tmp/minicd
mkisofs -o /tmp/minicd.iso -b isolinux.bin -c boot.cat
       -no-emul-boot -boot-load-size 4 -boot-info-table
       /tmp/minicd
k3b -cdimage /tmp/minicd.iso

2.9 What is the layout of a SLES10 installation server with Service Pack?
there is no special layout. SP1 contains all packages - a remastered SLES10 if you want so.
The inst-server for SP1 and/or SP2 is created in the same way like a SLES10 one. Just copy the CDs/DVD to disk.


Uwe Gansert