#!/bin/bash
#================
# FILE          : preinit
#----------------
# PROJECT       : OpenSuSE KIWI Image System
# COPYRIGHT     : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
#               :
# AUTHOR        : Marcus Schaefer <ms@suse.de>
#               :
# BELONGS TO    : Operating System images
#               :
# DESCRIPTION   : This file is called after the image root
#               : has changed by the linuxrc script
#               :
# STATUS        : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
. /include

#======================================
# 1) update mount table
#--------------------------------------
updateMTAB

#======================================
# 2) create framebuffer devices
#--------------------------------------
createFramebufferDevices

#======================================
# 3) check for union filesystem
#--------------------------------------
if [ ! -z "$UNIONFS_CONFIG" ]; then
	# /.../
	# we are using a special root setup with aufs. In this case
	# we can't use the SuSE Linux initrd but must stick to the
	# kiwi boot system.
	# ----
	updateMTAB
	exit 0
fi

#======================================
# 4) create initrd on diskful
#--------------------------------------
setupSUSEInitrd

#======================================
# 5) Install boot loader on diskful
#--------------------------------------
if [ $grubOK = 1 ];then
	installBootLoaderGrub
fi
