Build Service/KIWI/Cookbook/FAQ

From openSUSE

Contents

Kiwiheader

Kiwi

KIWI FAQ, TIPS and TRICKS


TIP:

You may also want to visit the SUSE Studio Wiki. KIWI is the back end to SUSE Studio and therefore many of the SUSE Studio Howtos apply to KIWI


Q: Is there a GUI for KIWI ?


Yes,

  • there is YaST module for kiwi called Image Creator providing graphical interaction
  • SUSE Studio is a web based front end for Kiwi.


Q: How can I build a 32-bit image on a 64-bit system?


Prefix your kiwi commands with "linux32", e.g.

linux32 kiwi --prepare ...
linux32 kiwi --create ...


Q: Is there an appliance that contains Kiwi?


Yes, a JeOs based appliance containing Kiwi with the appropriate repositories configured exists, see "http://jordimassaguerpla.blogspot.com/search/label/appliance limejeos". The Notes About Free Software site contains other appliances you might find useful.


Q:How can I influence the state of services using chkconfig?


You can call chkconfig from within the config.sh script in your image descriptions.

The config.sh script is called in a chroot environment in the unpacked image. Distribution specific functions are prefixed accordingly, for example "suseInsertService".

Consult the man pages for a list of functions available in the config.sh script ("man KIWI::config.sh")


Q: How can I change the keyboard layout?


The "keytable" tag within the "preferences" element in the config.xml file determines the keyboard layout of the image. Add the tag, or change the value to a keyboard layout of your liking.

<preferences>
   ...
      <keytable>us.map.gz</keytable>
   ...
</preferences>


Q: Can I use YaST in the unpacked image area?


No, the unpacked image area is an incomplete root file system with important pieces missing. Any modification to the unpacked image outside of the Kiwi prepare step leads to inconsistencies between the resulting image after the create step and the image description.

It is strongly recommended to avoid any manual changes on the unpacked image.


Q: Which package format can I use with KIWI?


At the moment KIWI supports the package managers smart and zypper. The package format is dependent on the selected packag manager. The table below shows the repository format supported by the two package managers.

type smart zypper
apt-dep yes no
apt-rpm yes no
dep-dir yes no
mirrors yes no
red-carpet yes yes
rpm-dir yes yes
rpm-md yes yes
slack-site yes no
up2date-mirrors yes no
urpmi yes no
yast2 yes yes


Q: How can I add NVIDIA and/or ATI binary drivers?


Adding these binary drivers requires changes to the boot-image. You will need to change the boot-image config.xml file for your image type, for example /usr/share/kiwi/image/usbboot/suse-xx.x/config.xml for a usb image, by adding the drivers.

<drivers type="drivers">
   <file name="drivers/nvidia/*"/>
   <file name="drivers/ati/*"/>
</drivers>
Warning

WARNING: PLEASE MAKE SURE YOU WORK ON A COPY



Then you will need to modify the config.xml file for your image to point to your newly created boot-image description.

The drivers element is optional and useful only in the context of the boot image description (initrd). It is not required that a boot image is comprised of drivers and a complete kernel. Therefore, one can save significant space by only including the required drivers in the boot image. The use of the "drivers" element supports this space optimization paradigm.

When the "drivers" element is specified Kiwi will include only the drivers matching the specified file name or glob pattern in the boot image. Kiwi will search pre-defined directories for matching drivers based on the "type" attribute value as listed below.

  • drivers
Each file is specified relative to the /lib/modules/<Version>/kernel directory.
  • netdrivers
Each file is specified relative to the /lib/modules/<Version>/kernel/drivers directory.
  • scsidrivers
Each file is specified relative to the /lib/modules/<Version>/kernel/drivers
  • usbdrivers
Each file is specified relative to the /lib/modules/<Version>/kernel/drivers directory.

The provided information in the "drivers" element will only take effect if a images.sh script exists in the boot-image description and the function suseStripKernel is called from the script.


Q: How can I create an encrypted password for use in the config.xml file?


The password can be created using

kiwi --createpassword

on the command line. This process is interactive and you will be prompted to enter a password.

The output is an encrypted string for the plain text password you entered. You can cut and paste this string into the config.xml file as the value for the "pwd" attribute of the "user" element.


Q: When booting from the network via PXE the following message is displayed


Found TFTP server in kernel cmdline
Checking TFTP server name: 192.168.0.10
TFTP server: 192.168.0.10 not found
Using TFTP server from dhcp-info

In this case the address given by the "kiwitftp" kernel parameter cannot be resolved and the address of the DHCP server is used for TFTP server as well.

This default behavior could potentially be incorrect. However, there is no risk with this behavior. The client already receives data from the DHCP server and therefore it should be permissible to receive additional data from the same server.

If the tftp server is not running on the DHCP server the image download will fail. It is recommended to provide the tftp server address in the pxelinux configuration file, even if it is the same address as the DHCP server.


Q: Howto build a SLES10 LiveCD with a writable /opt directory ?


Best is that you use SLES 10 also as your build host.

Make sure you have installed the latest kiwi version from here:

  http://download.opensuse.org/repositories/Virtualization:/Appliances/SLE_10/


Download the squashfs for SLE10 into the directory /usr/share/kiwi/repo/suse-repo/suse-sle10-repo/. You can get squashfs for SLE10 from here:

  http://download.opensuse.org/repositories/filesystems/SLE_10/


Install the squashfs package also on your SLE10 build system. Kiwi needs to call the mksquashfs tool to create the read-only part so it must be installed


Change the isoboot image description as follows:

  cd /usr/share/kiwi/image/isoboot/suse-SLES10/
  rm -f .checksum.md5
  vi config.xml


Add the line <file name="fs/squashfs/*"/> to the drivers section, e.g.

  <drivers type="drivers">
     ...
     <file name="fs/squashfs/*"/>
     ...
  </drivers>


All this makes sure we have the squashfs module inside the initrd. Kiwi allows split systems only if the read-only part can be used compressed. Otherwise it wouldn't make much sense to split it.


Edit your system image config.xml and change the following:

the type line

  <type boot="isoboot/suse-SLES10" flags="compressed">iso</type>


now we add a split section describing the read/write

     <split>
       <temporary>
          <file name="/var"/>
          <file name="/var/*"/>
          <file name="/opt"/>
          <file name="/opt/*"/>
       </temporary>
     </split>


All this makes sure we use the compressed split system instead of the old-style iso and you can control with the split section what should be read-write and what should stay read-only

That's it. I'm sorry if it sounds a bit complicated but SLE10 was before the appliance program starts and therefore there are some software components missing which are used in newer distributions.


Q: How to build a JeOS with a graphical firstboot

Use the JeOS template and in order to enable the SUSE feature "firstboot" you need the file config-yast-firstboot.xml in you config-directory.

It could be a copy from /etc/YaST2/firstboot.xml which is included in the the package yast2-firstboot-2.17.4-1.64

Please enable your needed steps in the workflow

http://forgeftp.novell.com/yast/doc/SLES11/tdg/bk09ch01s02.html

You _DON'T_ need to create the file /var/lib/YaST2/reconfig_system! This is done by KIWI

In order to use firstboot, please add the following packages in your config.xml

 yast2-ncurses
 yast2-firstboot

If you want a graphical firstboot system you need additionally the following packages in your config.xml

 yast2-installation
 yast2-qt
 xorg-x11-server

You also need and a simple xorg.conf in the directory which is provided by our template

 <your_kiwi_config_dir>/root/etc/x11

Here as reference:

 /usr/share/kiwi/image/suse-SLE10-JeOS/root/etc/X11/xorg.conf

You may copy your own scripts into the directory

 /usr/share/firstboot/scripts


If you want to reconfigure your keyboard with firstboot, you need the packages

 sax2-tools
 sax2-ident
 kbd


That's it - now you should have a graphical firstboot with JeOS


Q: Can i build a SLE10 image with openSUSE 11.1?


Sure, but you need the right tools also installed on you build system and the repositories for SLE10 (DVD/iso/...)

Zypper from SLE10 is too old and does not provide the features we need. So you must use smart as packagemanager in your config.xml

<packagemanager>smart</packagemanager>

In order to use it, you must install smart in you build system.

So please add the repository to your system

http://download.opensuse.org/repositories/smart

and install smart into your system.

If you are use kiwi version < 3.60 and use ext3 as filesystem, you must use a different inode size, because openSUSE 11.1 uses a different one as SLE10.

--fs-inodesize 128

Tip: Use the SLES10 JeOS template as basis for your build

Q: I got the error "dbus is not running, check your installation" at login


Please add the following package to your config.xml

 <package name="dbus-1-x11"/>


Q: YOUR TIP HERE



Q: Where can I request enhancements, report bugs or submit patches?


1) Searching the ailing list archives is your best starting point. Should you be unable to find an answer to your question in the archives you can post to the mailing lists after subscribing.

2) There is an IRC channel on freenode

3) You may file bugs using the Novell bugzilla (a Novell account is required)

  • Classification: All
  • Product: openSUSE.org
  • Component: System Imaging
  • Summary : "kiwi: summarize your report here"
  • Convenient URL to file new KIWI bug (with the settings above)