Blame ks/centos6-liveDVD-desktop.cfg

Fabian Arrotin 9e7827
lang en_US.UTF-8
Fabian Arrotin 9e7827
keyboard us
Fabian Arrotin 9e7827
timezone US/Eastern
Fabian Arrotin 9e7827
auth --useshadow --enablemd5
Fabian Arrotin 9e7827
selinux --enforcing
Fabian Arrotin 9e7827
firewall --enabled --service=mdns
Fabian Arrotin 9e7827
repo --name=base    --baseurl=file://REPOPATH
Fabian Arrotin 9e7827
xconfig --startxonboot
Fabian Arrotin 9e7827
part / --size 4800 --fstype ext4
Fabian Arrotin 9e7827
services --enabled=NetworkManager --disabled=network,sshd
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%packages
Fabian Arrotin 9e7827
syslinux
Fabian Arrotin 9e7827
kernel
Fabian Arrotin 9e7827
%packages
Fabian Arrotin 9e7827
@base
Fabian Arrotin 9e7827
@core
Fabian Arrotin 9e7827
@debugging
Fabian Arrotin 9e7827
@basic-desktop
Fabian Arrotin 9e7827
@desktop-platform
Fabian Arrotin 9e7827
@directory-client
Fabian Arrotin 9e7827
@dutch-support
Fabian Arrotin 9e7827
@british-support
Fabian Arrotin 9e7827
@fonts
Fabian Arrotin 9e7827
@french-support
Fabian Arrotin 9e7827
@general-desktop
Fabian Arrotin 9e7827
@german-support
Fabian Arrotin 9e7827
@graphical-admin-tools
Fabian Arrotin 9e7827
@graphics
Fabian Arrotin 9e7827
@input-methods
Fabian Arrotin 9e7827
@internet-applications
Fabian Arrotin 9e7827
@internet-browser
Fabian Arrotin 9e7827
@java-platform
Fabian Arrotin 9e7827
@kde-desktop
Fabian Arrotin 9e7827
@legacy-x
Fabian Arrotin 9e7827
@network-file-system-client
Fabian Arrotin 9e7827
@network-tools
Fabian Arrotin 9e7827
@office-suite
Fabian Arrotin 9e7827
@print-client
Fabian Arrotin 9e7827
@remote-desktop-clients
Fabian Arrotin 9e7827
@server-platform
Fabian Arrotin 9e7827
@x11
Fabian Arrotin 9e7827
mtools
Fabian Arrotin 9e7827
pax
Fabian Arrotin 9e7827
python-dmidecode
Fabian Arrotin 9e7827
oddjob
Fabian Arrotin 9e7827
sgpio
Fabian Arrotin 9e7827
genisoimage
Fabian Arrotin 9e7827
wodim
Fabian Arrotin 9e7827
qt-mysql
Fabian Arrotin 9e7827
certmonger
Fabian Arrotin 9e7827
pam_krb5
Fabian Arrotin 9e7827
krb5-workstation
Fabian Arrotin 9e7827
nscd
Fabian Arrotin 9e7827
pam_ldap
Fabian Arrotin 9e7827
nss-pam-ldapd
Fabian Arrotin 9e7827
gnome-pilot
Fabian Arrotin 9e7827
ImageMagick
Fabian Arrotin 9e7827
inkscape
Fabian Arrotin 9e7827
evolution-exchange
Fabian Arrotin 9e7827
thunderbird
Fabian Arrotin 9e7827
xchat
Fabian Arrotin 9e7827
xterm
Fabian Arrotin 9e7827
xorg-x11-xdm
Fabian Arrotin 9e7827
libXmu
Fabian Arrotin 9e7827
stunnel
Fabian Arrotin 9e7827
iptraf
Fabian Arrotin 9e7827
wireshark
Fabian Arrotin 9e7827
openoffice.org-base
Fabian Arrotin 9e7827
openoffice.org-javafilter
Fabian Arrotin 9e7827
openoffice.org-report-builder
Fabian Arrotin 9e7827
openoffice.org-headless
Fabian Arrotin 9e7827
openoffice.org-wiki-publisher
Fabian Arrotin 9e7827
openoffice.org-presentation-minimizer
Fabian Arrotin 9e7827
openoffice.org-emailmerge
Fabian Arrotin 9e7827
openoffice.org-ogltrans
Fabian Arrotin 9e7827
rdesktop
Fabian Arrotin 9e7827
#-rhn-setup-gnome
Fabian Arrotin 9e7827
#-yum-rhn-plugin
Fabian Arrotin 9e7827
#-rhnsd
Fabian Arrotin 9e7827
-akonadi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# FIXME : gimp need libgegl-0.0.so.0 and libbabl-0.0.so.0
Fabian Arrotin 9e7827
gimp
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# livecd bits to set up the livecd and be able to install
Fabian Arrotin 9e7827
memtest86+
Fabian Arrotin 9e7827
#livecd-tools
Fabian Arrotin 9e7827
anaconda
Fabian Arrotin 9e7827
device-mapper-multipath
Fabian Arrotin 9e7827
isomd5sum
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%end
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%post
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
## default LiveCD user
Fabian Arrotin 9e7827
LIVECD_USER="centoslive"
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
########################################################################
Fabian Arrotin 9e7827
# Create a sub-script so the output can be captured
Fabian Arrotin 9e7827
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
Fabian Arrotin 9e7827
########################################################################
Fabian Arrotin 9e7827
cat > /root/post-install << EOF_post
Fabian Arrotin 9e7827
#!/bin/bash
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
echo ###################################################################
Fabian Arrotin 9e7827
echo ## Creating the livesys init script
Fabian Arrotin 9e7827
echo ###################################################################
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
cat > /etc/rc.d/init.d/livesys << EOF_initscript
Fabian Arrotin 9e7827
#!/bin/bash
Fabian Arrotin 9e7827
#
Fabian Arrotin 9e7827
# live: Init script for live image
Fabian Arrotin 9e7827
#
Fabian Arrotin 9e7827
# chkconfig: 345 00 99
Fabian Arrotin 9e7827
# description: Init script for live image.
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
. /etc/init.d/functions
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
Fabian Arrotin 9e7827
    exit 0
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
if [ -e /.liveimg-configured ] ; then
Fabian Arrotin 9e7827
    configdone=1
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
exists() {
Fabian Arrotin 9e7827
    which \\\$1 >/dev/null 2>&1 || return
Fabian Arrotin 9e7827
    \\\$*
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
touch /.liveimg-configured
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# mount live image
Fabian Arrotin 9e7827
if [ -b \\\`readlink -f /dev/live\\\` ]; then
Fabian Arrotin 9e7827
   mkdir -p /mnt/live
Fabian Arrotin 9e7827
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
livedir="LiveOS"
Fabian Arrotin 9e7827
for arg in \\\`cat /proc/cmdline\\\` ; do
Fabian Arrotin 9e7827
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
Fabian Arrotin 9e7827
    livedir=\\\${arg##live_dir=}
Fabian Arrotin 9e7827
    return
Fabian Arrotin 9e7827
  fi
Fabian Arrotin 9e7827
done
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# enable swaps unless requested otherwise
Fabian Arrotin 9e7827
swaps=\\\`blkid -t TYPE=swap -o device\\\`
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
Fabian Arrotin 9e7827
  for s in \\\$swaps ; do
Fabian Arrotin 9e7827
    action "Enabling swap partition \\\$s" swapon \\\$s
Fabian Arrotin 9e7827
  done
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
Fabian Arrotin 9e7827
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
mountPersistentHome() {
Fabian Arrotin 9e7827
  # support label/uuid
Fabian Arrotin 9e7827
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
Fabian Arrotin 9e7827
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
Fabian Arrotin 9e7827
  fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
  # if we're given a file rather than a blockdev, loopback it
Fabian Arrotin 9e7827
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
Fabian Arrotin 9e7827
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
Fabian Arrotin 9e7827
    mountopts="-t jffs2"
Fabian Arrotin 9e7827
  elif [ ! -b "\\\$homedev" ]; then
Fabian Arrotin 9e7827
    loopdev=\\\`losetup -f\\\`
Fabian Arrotin 9e7827
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
Fabian Arrotin 9e7827
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
Fabian Arrotin 9e7827
    fi
Fabian Arrotin 9e7827
    losetup \\\$loopdev \\\$homedev
Fabian Arrotin 9e7827
    homedev=\\\$loopdev
Fabian Arrotin 9e7827
  fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
  # if it's encrypted, we need to unlock it
Fabian Arrotin 9e7827
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
Fabian Arrotin 9e7827
    echo
Fabian Arrotin 9e7827
    echo "Setting up encrypted /home device"
Fabian Arrotin 9e7827
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
Fabian Arrotin 9e7827
    homedev=/dev/mapper/EncHome
Fabian Arrotin 9e7827
  fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
  # and finally do the mount
Fabian Arrotin 9e7827
  mount \\\$mountopts \\\$homedev /home
Fabian Arrotin 9e7827
  # if we have /home under what's passed for persistent home, then
Fabian Arrotin 9e7827
  # we should make that the real /home.  useful for mtd device on olpc
Fabian Arrotin 9e7827
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
Fabian Arrotin 9e7827
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
Fabian Arrotin 9e7827
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
findPersistentHome() {
Fabian Arrotin 9e7827
  for arg in \\\`cat /proc/cmdline\\\` ; do
Fabian Arrotin 9e7827
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
Fabian Arrotin 9e7827
      homedev=\\\${arg##persistenthome=}
Fabian Arrotin 9e7827
      return
Fabian Arrotin 9e7827
    fi
Fabian Arrotin 9e7827
  done
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
Fabian Arrotin 9e7827
  findPersistentHome
Fabian Arrotin 9e7827
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
Fabian Arrotin 9e7827
  homedev=/mnt/live/\\\${livedir}/home.img
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# if we have a persistent /home, then we want to go ahead and mount it
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
Fabian Arrotin 9e7827
  action "Mounting persistent /home" mountPersistentHome
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# make it so that we don't do writing to the overlay for things which
Fabian Arrotin 9e7827
# are just tmpdirs/caches
Fabian Arrotin 9e7827
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
Fabian Arrotin 9e7827
mount -t tmpfs tmp /tmp
Fabian Arrotin 9e7827
mount -t tmpfs vartmp /var/tmp
Fabian Arrotin 9e7827
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
if [ -n "\\\$configdone" ]; then
Fabian Arrotin 9e7827
  exit 0
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
## fix various bugs and issues
Fabian Arrotin 9e7827
# unmute sound card
Fabian Arrotin 9e7827
exists alsaunmute 0 2> /dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# turn off firstboot for livecd boots
Fabian Arrotin 9e7827
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# turn off mdmonitor by default
Fabian Arrotin 9e7827
chkconfig --level 345 mdmonitor       off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# turn off setroubleshoot on the live image to preserve resources
Fabian Arrotin 9e7827
chkconfig --level 345 setroubleshoot  off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# don't start cron/at as they tend to spawn things which are
Fabian Arrotin 9e7827
# disk intensive that are painful on a live image
Fabian Arrotin 9e7827
chkconfig --level 345 auditd          off 2>/dev/null
Fabian Arrotin 9e7827
chkconfig --level 345 crond           off 2>/dev/null
Fabian Arrotin 9e7827
chkconfig --level 345 atd             off 2>/dev/null
Fabian Arrotin 9e7827
chkconfig --level 345 readahead_early off 2>/dev/null
Fabian Arrotin 9e7827
chkconfig --level 345 readahead_later off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable kdump service
Fabian Arrotin 9e7827
chkconfig --level 345 kdump           off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable microcode_ctl service
Fabian Arrotin 9e7827
chkconfig --level 345 microcode_ctl   off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable smart card services
Fabian Arrotin 9e7827
chkconfig --level 345 openct          off 2>/dev/null
Fabian Arrotin 9e7827
chkconfig --level 345 pcscd           off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable postfix service
Fabian Arrotin 9e7827
chkconfig --level 345 postfix         off 2>/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# Stopgap fix for RH #217966; should be fixed in HAL instead
Fabian Arrotin 9e7827
touch /media/.hal-mtab
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# workaround clock syncing on shutdown that we don't want (#297421)
Fabian Arrotin 9e7827
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# set the LiveCD hostname
62e016
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=livedvd.centos/g' /etc/sysconfig/network
62e016
/bin/hostname livedvd.centos
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
## create the LiveCD default user
Fabian Arrotin 9e7827
# add default user with no password
Fabian Arrotin 9e7827
/usr/sbin/useradd -c "LiveCD default user" $LIVECD_USER
Fabian Arrotin 9e7827
/usr/bin/passwd -d $LIVECD_USER > /dev/null
Fabian Arrotin 9e7827
# give default user sudo privileges
Fabian Arrotin 9e7827
echo "$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
## configure default user's desktop
Fabian Arrotin 9e7827
# set up timed auto-login at 10 seconds
Fabian Arrotin 9e7827
cat >> /etc/gdm/custom.conf << FOE
Fabian Arrotin 9e7827
[daemon]
Fabian Arrotin 9e7827
TimedLoginEnable=true
Fabian Arrotin 9e7827
TimedLogin=$LIVECD_USER
Fabian Arrotin 9e7827
TimedLoginDelay=10
Fabian Arrotin 9e7827
FOE
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# add keyboard and display configuration utilities to the desktop
Fabian Arrotin 9e7827
mkdir -p /home/$LIVECD_USER/Desktop >/dev/null
Fabian Arrotin 9e7827
cp /usr/share/applications/gnome-keyboard.desktop           /home/$LIVECD_USER/Desktop/
Fabian Arrotin 9e7827
cp /usr/share/applications/gnome-display-properties.desktop /home/$LIVECD_USER/Desktop/
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable screensaver locking
Fabian Arrotin 9e7827
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# disable PackageKit update checking by default
Fabian Arrotin 9e7827
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t int /apps/gnome-packagekit/update-icon/frequency_get_updates "0" >/dev/null
Fabian Arrotin 9e7827
8678b8
# Switching to Thunderbird as the default MUA
8678b8
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /desktop/gnome/url-handlers/mailto/command "thunderbird %" >/dev/null
8678b8
8678b8
Fabian Arrotin 9e7827
# detecting disk partitions and logical volumes 
Fabian Arrotin 9e7827
CreateDesktopIconHD()
Fabian Arrotin 9e7827
{
Fabian Arrotin 9e7827
cat > /home/$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
Fabian Arrotin 9e7827
[Desktop Entry]
Fabian Arrotin 9e7827
Encoding=UTF-8
Fabian Arrotin 9e7827
Version=1.0
Fabian Arrotin 9e7827
Type=Link
Fabian Arrotin 9e7827
Name=Local hard drives
Fabian Arrotin 9e7827
Name[en_US]=Local hard drives
Fabian Arrotin 9e7827
Name[fr_CA]=Disques durs locaux
Fabian Arrotin 9e7827
URL=/mnt/disc
Fabian Arrotin 9e7827
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
Fabian Arrotin 9e7827
EOF_HDicon
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
chmod 755 /home/$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
CreateDesktopIconLVM()
Fabian Arrotin 9e7827
{
Fabian Arrotin 9e7827
mkdir -p /home/$LIVECD_USER/Desktop >/dev/null
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
cat > /home/$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
Fabian Arrotin 9e7827
[Desktop Entry]
Fabian Arrotin 9e7827
Encoding=UTF-8
Fabian Arrotin 9e7827
Version=1.0
Fabian Arrotin 9e7827
Type=Link
Fabian Arrotin 9e7827
Name=Local logical volumes
Fabian Arrotin 9e7827
Name[en_US]=Local logical volumes
Fabian Arrotin 9e7827
Name[fr_CA]=Volumes logiques locaux
Fabian Arrotin 9e7827
URL=/mnt/lvm
Fabian Arrotin 9e7827
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
Fabian Arrotin 9e7827
EOF_LVMicon
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
chmod 755 /home/$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# don't mount disk partitions if 'nodiskmount' is given as a boot option
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" nodiskmount ; then
Fabian Arrotin 9e7827
	MOUNTOPTION="ro"
Fabian Arrotin 9e7827
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
	echo "Mounting hard disk partitions... "
Fabian Arrotin 9e7827
	for DISK in \\\$HARD_DISKS; do
Fabian Arrotin 9e7827
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
Fabian Arrotin 9e7827
	    FDISK_INFO=\\\`fdisk -l /dev/\\\$DISK | tr [A-Z] [a-z] | egrep "fat|linux" | egrep -v "swap|extended|lvm" | sed 's/*//' | tr -s ' ' | tr ' ' ':' | cut -d':' -f1,6-\\\`
Fabian Arrotin 9e7827
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
Fabian Arrotin 9e7827
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
Fabian Arrotin 9e7827
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
Fabian Arrotin 9e7827
		mkdir -p \\\$MOUNTPOINT
Fabian Arrotin 9e7827
		MOUNTED=FALSE
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
		# get the partition type
Fabian Arrotin 9e7827
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
Fabian Arrotin 9e7827
		*fat*) 
Fabian Arrotin 9e7827
		    FSTYPES="vfat"
Fabian Arrotin 9e7827
		    EXTRAOPTIONS=",uid=500";;
Fabian Arrotin 9e7827
		*)
Fabian Arrotin 9e7827
		    FSTYPES="ext4 ext3 ext2"
Fabian Arrotin 9e7827
		    EXTRAOPTIONS="";;
Fabian Arrotin 9e7827
		esac
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
		# try to mount the partition
Fabian Arrotin 9e7827
		for FSTYPE in \\\$FSTYPES; do
Fabian Arrotin 9e7827
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
Fabian Arrotin 9e7827
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
Fabian Arrotin 9e7827
			echo -n "\\\$PARTITION "
Fabian Arrotin 9e7827
			MOUNTED=TRUE
Fabian Arrotin 9e7827
			CreateDesktopIconHD
Fabian Arrotin 9e7827
		    fi
Fabian Arrotin 9e7827
		done
Fabian Arrotin 9e7827
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
Fabian Arrotin 9e7827
	    done
Fabian Arrotin 9e7827
	done
Fabian Arrotin 9e7827
	echo
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# don't mount logical volumes if 'nolvmmount' is given as a boot option
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" nolvmmount ; then
Fabian Arrotin 9e7827
        MOUNTOPTION="ro"
Fabian Arrotin 9e7827
	FSTYPES="ext4 ext3 ext2"
Fabian Arrotin 9e7827
	echo "Scanning for logical volumes..."
Fabian Arrotin 9e7827
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
Fabian Arrotin 9e7827
	    echo "Activating logical volumes ..."
Fabian Arrotin 9e7827
	    modprobe dm_mod >/dev/null
Fabian Arrotin 9e7827
	    lvm vgchange -ay
Fabian Arrotin 9e7827
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
Fabian Arrotin 9e7827
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
Fabian Arrotin 9e7827
		echo "Making device nodes ..."
Fabian Arrotin 9e7827
		lvm vgmknodes
Fabian Arrotin 9e7827
		echo -n "Mounting logical volumes ... "
Fabian Arrotin 9e7827
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
Fabian Arrotin 9e7827
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
Fabian Arrotin 9e7827
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
Fabian Arrotin 9e7827
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
Fabian Arrotin 9e7827
		    mkdir -p \\\$MOUNTPOINT
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
		    MOUNTED=FALSE
Fabian Arrotin 9e7827
		    for FSTYPE in \\\$FSTYPES; do
Fabian Arrotin 9e7827
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
Fabian Arrotin 9e7827
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
Fabian Arrotin 9e7827
			    echo -n "\\\$VOLUME_NAME "
Fabian Arrotin 9e7827
			    MOUNTED=TRUE
Fabian Arrotin 9e7827
			    CreateDesktopIconLVM
Fabian Arrotin 9e7827
			    break
Fabian Arrotin 9e7827
			fi
Fabian Arrotin 9e7827
		    done
Fabian Arrotin 9e7827
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
Fabian Arrotin 9e7827
		done
Fabian Arrotin 9e7827
		echo
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
	    else
Fabian Arrotin 9e7827
		echo "No logical volumes found"
Fabian Arrotin 9e7827
	    fi
Fabian Arrotin 9e7827
	fi
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# give back ownership to the default user
Fabian Arrotin 9e7827
chown -R $LIVECD_USER:$LIVECD_USER /home/$LIVECD_USER
Fabian Arrotin 9e7827
EOF_initscript
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# bah, hal starts way too late
Fabian Arrotin 9e7827
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
Fabian Arrotin 9e7827
#!/bin/bash
Fabian Arrotin 9e7827
#
Fabian Arrotin 9e7827
# live: Late init script for live image
Fabian Arrotin 9e7827
#
Fabian Arrotin 9e7827
# chkconfig: 345 99 01
Fabian Arrotin 9e7827
# description: Late init script for live image.
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
. /etc/init.d/functions
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
Fabian Arrotin 9e7827
    exit 0
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
exists() {
Fabian Arrotin 9e7827
    which \\\$1 >/dev/null 2>&1 || return
Fabian Arrotin 9e7827
    \\\$*
Fabian Arrotin 9e7827
}
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
touch /.liveimg-late-configured
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# read some variables out of /proc/cmdline
Fabian Arrotin 9e7827
for o in \\\`cat /proc/cmdline\\\` ; do
Fabian Arrotin 9e7827
    case \\\$o in
Fabian Arrotin 9e7827
    ks=*)
Fabian Arrotin 9e7827
        ks="\\\${o#ks=}"
Fabian Arrotin 9e7827
        ;;
Fabian Arrotin 9e7827
    xdriver=*)
Fabian Arrotin 9e7827
        xdriver="--set-driver=\\\${o#xdriver=}"
Fabian Arrotin 9e7827
        ;;
Fabian Arrotin 9e7827
    esac
Fabian Arrotin 9e7827
done
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# if liveinst or textinst is given, start anaconda
Fabian Arrotin 9e7827
if strstr "\\\`cat /proc/cmdline\\\`" liveinst ; then
Fabian Arrotin 9e7827
   plymouth --quit
Fabian Arrotin 9e7827
   /usr/sbin/liveinst \\\$ks
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
if strstr "\\\`cat /proc/cmdline\\\`" textinst ; then
Fabian Arrotin 9e7827
   plymouth --quit
Fabian Arrotin 9e7827
   /usr/sbin/liveinst --text \\\$ks
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# configure X, allowing user to override xdriver
Fabian Arrotin 9e7827
if [ -n "\$xdriver" ]; then
Fabian Arrotin 9e7827
    exists system-config-display --noui --reconfig --set-depth=24 \\\$xdriver
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
EOF_lateinitscript
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# workaround avahi segfault (#279301)
Fabian Arrotin 9e7827
touch /etc/resolv.conf
Fabian Arrotin 9e7827
/sbin/restorecon /etc/resolv.conf
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
chmod 755 /etc/rc.d/init.d/livesys
Fabian Arrotin 9e7827
/sbin/restorecon /etc/rc.d/init.d/livesys
Fabian Arrotin 9e7827
/sbin/chkconfig --add livesys
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
chmod 755 /etc/rc.d/init.d/livesys-late
Fabian Arrotin 9e7827
/sbin/restorecon /etc/rc.d/init.d/livesys-late
Fabian Arrotin 9e7827
/sbin/chkconfig --add livesys-late
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# go ahead and pre-make the man -k cache (#455968)
Fabian Arrotin 9e7827
/usr/sbin/makewhatis -w
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# save a little bit of space at least...
Fabian Arrotin 9e7827
rm -f /var/lib/rpm/__db*
Fabian Arrotin 9e7827
rm -f /boot/initrd*
Fabian Arrotin 9e7827
rm -f /boot/initramfs*
Fabian Arrotin 9e7827
# make sure there aren't core files lying around
Fabian Arrotin 9e7827
rm -f /core*
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# convince readahead not to collect
Fabian Arrotin 9e7827
rm -f /.readahead_collect
Fabian Arrotin 9e7827
touch /var/lib/readahead/early.sorted
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# import RPM GPG keys
Fabian Arrotin 9e7827
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
Fabian Arrotin 9e7827
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
EOF_post
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%end
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%post --nochroot
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
########################################################################
Fabian Arrotin 9e7827
# Create a sub-script so the output can be captured
Fabian Arrotin 9e7827
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
Fabian Arrotin 9e7827
########################################################################
Fabian Arrotin 9e7827
cat > /root/postnochroot-install << EOF_postnochroot
Fabian Arrotin 9e7827
#!/bin/bash
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# Copy licensing information
Fabian Arrotin 9e7827
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# add livecd-iso-to-disk utility on the LiveCD
Fabian Arrotin 9e7827
# only works on x86, x86_64
Fabian Arrotin 9e7827
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
Fabian Arrotin 9e7827
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
Fabian Arrotin 9e7827
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
Fabian Arrotin 9e7827
fi
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# customize boot menu entries
Fabian Arrotin 9e7827
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
Fabian Arrotin 9e7827
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
Fabian Arrotin 9e7827
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
Fabian Arrotin 9e7827
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
Fabian Arrotin 9e7827
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
Fabian Arrotin 9e7827
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
Fabian Arrotin 9e7827
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
Fabian Arrotin 9e7827
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
sed -i "s/liveimg/liveimg liveinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
sed -i "s/liveimg/liveimg textinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
cat \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/check.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/current.txt
Fabian Arrotin 9e7827
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
Fabian Arrotin 9e7827
cat \$LIVE_ROOT/isolinux/cleaned.txt \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/textboot.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/install.txt \$LIVE_ROOT/isolinux/textinstall.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/isolinux.cfg
Fabian Arrotin 9e7827
rm -f \$LIVE_ROOT/isolinux/*.txt
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# Forcing plymouth to show the logo in vesafb 
Fabian Arrotin 9e7827
sed -i "s/rhgb/rhgb vga=791/g"	\$LIVE_ROOT/isolinux/isolinux.cfg
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
# Disabling auto lvm/disk mount (that will crash the "Install to Hard Drive feature")
Fabian Arrotin 9e7827
sed -i "s/quiet/quiet nodiskmount nolvmmount/g"	\$LIVE_ROOT/isolinux/isolinux.cfg
Fabian Arrotin 9e7827
63b5ba
# Fix the "liveinst doesn't start in gui mode when not enough memory available" - switching to terminal mode
63b5ba
sed -i "s/Terminal=false/Terminal=true/" \$LIVE_ROOT/home/centoslive/Desktop/liveinst.desktop
63b5ba
Fabian Arrotin 9e7827
EOF_postnochroot
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
Fabian Arrotin 9e7827
Fabian Arrotin 9e7827
%end