KIWI::CONFIG.SH(1) KIWI Manualpage KIWI::CONFIG.SH(1)NAMEKIWI::config.sh - Configuration File for KIWI image description
DESCRIPTION
The KIWI image description allows to have an optional config.sh script
in place. This script should be designed to take over control of adding
the image operating system configuration. Configuration in that sense
means stuff like activating services, creating configuration files,
prepare an environment for a firstboot workflow, etc. What you
shouldn't do in config.sh is breaking your systems integrity by for
example removing packages or pieces of software. Something like that
can be done in images.sh. The config.sh script is called after the user
and groups have been set up. If there are SUSE Linux related YaST XML
information, these are validated before config.sh is called too. If you
exit config.sh with an exit code != 0 kiwi will exit with an error too.
Example 1. Template for config.sh
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Mount system filesystems
#--------------------------------------
baseMount
#======================================
# Call configuration code/functions
#--------------------------------------
...
#======================================
# Umount kernel filesystems
#--------------------------------------
baseCleanMount
#======================================
# Exit safely
#--------------------------------------
exit 0
COMMON FUNCTIONS
The .kconfig file allows to make use of a common set of functions.
Functions specific to SUSE Linux specific begin with the name suse.
Functions applicable to all linux systems starts with the name base.
The following list describes the functions available inside the
config.sh script.
[baseCleanMount]
Umount the system filesystems /proc, /dev/pts, and /sys.
[baseDisableCtrlAltDel]
Disable the Ctrl-Alt-Del key sequence setting in /etc/inittab
[baseGetPackagesForDeletion]
Return the name(s) of packages which will be deleted
[baseGetProfilesUsed]
Return the name(s) of profiles used to build this image
[baseSetRunlevel {value}]
Set the default run level
[baseSetupBoot]
Set up the linuxrc as init
[baseSetupBusyBox {-f}]
activates busybox if installed for all links from the
busybox/busybox.links file—you can choose custom apps to be forced
into busybox with the -f option as first parameter, for example:
baseSetupBusyBox -f /bin/zcat /bin/vi
[baseSetupInPlaceGITRepository]
Create an in place git repository of the root directory. This
process may take some time and you may expect problems with binary
data handling
[baseSetupInPlaceSVNRepository {path_list}]
Create an in place subversion repository for the specified
directories. A standard call could look like this
baseSetupInPlaceSVNRepository /etc, /srv, and /var/log
[baseSetupPlainTextGITRepository]
Create an in place git repository of the root directory containing
all plain/text files.
[baseSetupUserPermissions]
Search all home directories of all users listed in /etc/passwd and
change the ownership of all files to belong to the correct user and
group.
[baseStripAndKeep {list of info-files to keep}]
helper function for strip* functions read stdin lines of files to
check for removing params: files which should be keep
[baseStripDocs {list of docu names to keep}]
remove all documentation, except one given as parameter
[baseStripInfos {list of info-files to keep}]
remove all info files, except one given as parameter
[baseStripLocales {list of locales}]
remove all locales, except one given as parameter
[baseStripMans {list of manpages to keep}]
remove all manual pages, except one given as parameter example:
baseStripMans more less
[baseStripRPM]
remove rpms defined in config.xml under image=delete section
[baseStripTools {list of toolpath} {list of tools}]
helper function for suseStripInitrd function params: toolpath,
tools
[baseStripUnusedLibs]
remove libraries which are not directly linked against applications
in the bin directories
[baseUpdateSysConfig {filename} {variable} {value}]
update sysconfig variable contents
[Debug {message}]
Helper function to print a message if the variable DEBUG is set to
1
[Echo {echo commandline}]
Helper function to print a message to the controlling terminal
[Rm {list of files}]
Helper function to delete files and announce it to log
[Rpm {rpm commandline}]
Helper function to the RPM function and announce it to log
[suseActivateDefaultServices]
Call all postin scriptlets which among other things activates all
required default services using suseInsertService
[suseActivateServices]
Check all services in /etc/init.d/ and activate them by calling
suseInsertService
[suseCloneRunlevel {runlevel}]
Clone the given runlevel to work in the same way as the default
runlevel 3.
[suseConfig]
Setup keytable language and timezone if specified in config.xml and
call SuSEconfig afterwards
[suseInsertService {servicename}]
Recursively insert a service. If there is a service required for
this service it will be inserted first. The suse insserv program is
used here
[suseRemoveService {servicename}]
Remove a service and its dependent services using the suse insserv
program
[suseService {servicename} {on|off}]
Activate/Deactivate a service by using the chkconfig program The
function requires the service name and the value on or off as
parameters
[suseServiceDefaultOn]
Activates the following services to be on by default using the
chkconfig program: boot.rootfsck boot.cleanup boot.localfs
boot.localnet boot.clock policykitd dbus consolekit haldaemon
network atd syslog cron kbd
[suseSetupProductInformation]
This function will use zypper to search for the installed product
and install all product specific packages. This function only makes
sense if zypper is used as packagemanager
[suseStripPackager {-a}]
Remove smart or zypper packages and db files Also remove rpm
package and db if -a given
PROFILE ENVIRONMENT VARIABLES
The .profile environment file contains a specific set of variables
which are listed below. Some of the functions above makes use of the
variables.
[$kiwi_compressed]
The value of the compressed attribute set in the type element in
config.xml
[$kiwi_delete]
A list of all packages which are part of the packages section with
type="delete" in config.xml
[$kiwi_drivers]
A comma separated list of the driver entries as listed in the
drivers section of the config.xml.
[$kiwi_iname]
The name of the image as listed in config.xml
[$kiwi_iversion]
The image version string major.minor.release
[$kiwi_keytable]
The contents of the keytable setup as done in config.xml
[$kiwi_language]
The contents of the locale setup as done in config.xml
[$kiwi_profiles]
A list of profiles used to build this image
[$kiwi_size]
The predefined size value for this image. This is not the computed
size but only the optional size value of the preferences section in
config.xml
[$kiwi_timezone]
The contents of the timezone setup as done in config.xml
[$kiwi_type]
The basic image type. Can be a simply filesystem image type of
ext2, ext3, reiserfs, squashfs, cpio, or one of the following
complex image types: iso, split, usb, vmx, oem, xen, or pxe.
AUTHOR
Marcus Schäfer <ms (AT) suse.de>
Developer
KIWI 5.05 Created: 10/10/2013 KIWI::CONFIG.SH(1)