figless / centos / livemedia

Forked from centos/livemedia 5 years ago
Clone

Blame kickstarts/centos-7-live-gnome.cfg

5262fc
5262fc
lang en_GB.UTF-8
5262fc
keyboard us
5262fc
timezone Europe/Brussels --isUtc
5262fc
auth --useshadow --enablemd5
5262fc
selinux --enforcing
5262fc
firewall --enabled --service=mdns
5262fc
xconfig --startxonboot
5262fc
part / --size 8192 --fstype ext4
5262fc
services --enabled=NetworkManager --disabled=network,sshd
5262fc
5262fc
5262fc
# Root password
5262fc
rootpw --iscrypted $6$K2nKf02kVKG68960$OywvoaViphSITuro/liKvCj7Pm/CH/xqzz/lsoXyaKSR1lYf0vHAqSUc483a9MCCBkIwfr/hNMfqwxqVO0OEg1
5262fc
6d68a7
repo --name=base --baseurl=http://buildlogs.centos.org/centos/7/os/x86_64-latest/
5262fc
5262fc
%packages
5262fc
@base
5262fc
@core
5262fc
@dial-up
5262fc
@directory-client
5262fc
@fonts
5262fc
@gnome-desktop
5262fc
@guest-agents
5262fc
@guest-desktop-agents
5262fc
@input-methods
5262fc
@internet-browser
5262fc
@java-platform
5262fc
@multimedia
5262fc
@network-file-system-client
5262fc
@print-client
5262fc
@x11
5262fc
@internet-applications
5262fc
@office-suite
5262fc
@remote-desktop-clients
5262fc
@gnome-apps
5262fc
5262fc
5262fc
#Live install tools
5262fc
anaconda
5262fc
system-config-keyboard
5262fc
firefox
5262fc
0dc5ca
# For UEFI/Secureboot support
0dc5ca
grub2
0dc5ca
grub2-efi
0dc5ca
efibootmgr
0dc5ca
shim
5262fc
5262fc
%end
5262fc
5262fc
%post
5262fc
# FIXME: it'd be better to get this installed from a package
5262fc
cat > /etc/rc.d/init.d/livesys << EOF
5262fc
#!/bin/bash
5262fc
#
5262fc
# live: Init script for live image
5262fc
#
5262fc
# chkconfig: 345 00 99
5262fc
# description: Init script for live image.
5262fc
### BEGIN INIT INFO
5262fc
# X-Start-Before: display-manager
5262fc
### END INIT INFO
5262fc
5262fc
. /etc/init.d/functions
5262fc
5262fc
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
5262fc
    exit 0
5262fc
fi
5262fc
5262fc
if [ -e /.liveimg-configured ] ; then
5262fc
    configdone=1
5262fc
fi
5262fc
5262fc
exists() {
5262fc
    which \$1 >/dev/null 2>&1 || return
5262fc
    \$*
5262fc
}
5262fc
5262fc
# Make sure we don't mangle the hardware clock on shutdown
5262fc
ln -sf /dev/null /etc/systemd/system/hwclock-save.service
5262fc
5262fc
livedir="LiveOS"
5262fc
for arg in \`cat /proc/cmdline\` ; do
5262fc
  if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then
5262fc
    livedir=\${arg##rd.live.dir=}
5262fc
    return
5262fc
  fi
5262fc
  if [ "\${arg##live_dir=}" != "\${arg}" ]; then
5262fc
    livedir=\${arg##live_dir=}
5262fc
    return
5262fc
  fi
5262fc
done
5262fc
5262fc
# enable swaps unless requested otherwise
5262fc
swaps=\`blkid -t TYPE=swap -o device\`
5262fc
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
5262fc
  for s in \$swaps ; do
5262fc
    action "Enabling swap partition \$s" swapon \$s
5262fc
  done
5262fc
fi
5262fc
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
5262fc
  action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img
5262fc
fi
5262fc
5262fc
mountPersistentHome() {
5262fc
  # support label/uuid
5262fc
  if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
5262fc
    homedev=\`/sbin/blkid -o device -t "\$homedev"\`
5262fc
  fi
5262fc
5262fc
  # if we're given a file rather than a blockdev, loopback it
5262fc
  if [ "\${homedev##mtd}" != "\${homedev}" ]; then
5262fc
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
5262fc
    mountopts="-t jffs2"
5262fc
  elif [ ! -b "\$homedev" ]; then
5262fc
    loopdev=\`losetup -f\`
5262fc
    if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
5262fc
      action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
5262fc
    fi
5262fc
    losetup \$loopdev \$homedev
5262fc
    homedev=\$loopdev
5262fc
  fi
5262fc
5262fc
  # if it's encrypted, we need to unlock it
5262fc
  if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
5262fc
    echo
5262fc
    echo "Setting up encrypted /home device"
5262fc
    plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
5262fc
    homedev=/dev/mapper/EncHome
5262fc
  fi
5262fc
5262fc
  # and finally do the mount
5262fc
  mount \$mountopts \$homedev /home
5262fc
  # if we have /home under what's passed for persistent home, then
5262fc
  # we should make that the real /home.  useful for mtd device on olpc
5262fc
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
5262fc
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
5262fc
  if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
5262fc
}
5262fc
5262fc
findPersistentHome() {
5262fc
  for arg in \`cat /proc/cmdline\` ; do
5262fc
    if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
5262fc
      homedev=\${arg##persistenthome=}
5262fc
      return
5262fc
    fi
5262fc
  done
5262fc
}
5262fc
5262fc
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
5262fc
  findPersistentHome
5262fc
elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
5262fc
  homedev=/run/initramfs/live/\${livedir}/home.img
5262fc
fi
5262fc
5262fc
# if we have a persistent /home, then we want to go ahead and mount it
5262fc
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
5262fc
  action "Mounting persistent /home" mountPersistentHome
5262fc
fi
5262fc
5262fc
# make it so that we don't do writing to the overlay for things which
5262fc
# are just tmpdirs/caches
5262fc
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
5262fc
mount -t tmpfs vartmp /var/tmp
5262fc
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
5262fc
5262fc
if [ -n "\$configdone" ]; then
5262fc
  exit 0
5262fc
fi
5262fc
5262fc
# add fedora user with no passwd
5262fc
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
5262fc
passwd -d liveuser > /dev/null
5262fc
usermod -aG wheel liveuser > /dev/null
5262fc
5262fc
# Remove root password lock
5262fc
passwd -d root > /dev/null
5262fc
5262fc
# turn off firstboot for livecd boots
5262fc
systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
5262fc
systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
5262fc
systemctl stop firstboot-text.service 2> /dev/null || :
5262fc
systemctl stop firstboot-graphical.service 2> /dev/null || :
5262fc
5262fc
# don't use prelink on a running live image
5262fc
sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
5262fc
5262fc
# turn off mdmonitor by default
5262fc
systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
5262fc
systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
5262fc
systemctl stop mdmonitor.service 2> /dev/null || :
5262fc
systemctl stop mdmonitor-takeover.service 2> /dev/null || :
5262fc
5262fc
# don't enable the gnome-settings-daemon packagekit plugin
5262fc
gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || :
5262fc
5262fc
# don't start cron/at as they tend to spawn things which are
5262fc
# disk intensive that are painful on a live image
5262fc
systemctl --no-reload disable crond.service 2> /dev/null || :
5262fc
systemctl --no-reload disable atd.service 2> /dev/null || :
5262fc
systemctl stop crond.service 2> /dev/null || :
5262fc
systemctl stop atd.service 2> /dev/null || :
5262fc
5262fc
# Mark things as configured
5262fc
touch /.liveimg-configured
5262fc
5262fc
# add static hostname to work around xauth bug
5262fc
# https://bugzilla.redhat.com/show_bug.cgi?id=679486
5262fc
echo "localhost" > /etc/hostname
5262fc
b9cc3f
# Fixing the lang install issue when other lang than English is selected . See http://bugs.centos.org/view.php?id=7217
b9cc3f
/usr/bin/cp /usr/lib/python2.7/site-packages/blivet/size.py /usr/lib/python2.7/site-packages/blivet/size.py.orig
b9cc3f
/usr/bin/sed -i "s#return self.humanReadable()#return self.humanReadable().encode('utf-8')#g" /usr/lib/python2.7/site-packages/blivet/size.py
b9cc3f
5262fc
EOF
5262fc
5262fc
# bah, hal starts way too late
5262fc
cat > /etc/rc.d/init.d/livesys-late << EOF
5262fc
#!/bin/bash
5262fc
#
5262fc
# live: Late init script for live image
5262fc
#
5262fc
# chkconfig: 345 99 01
5262fc
# description: Late init script for live image.
5262fc
5262fc
. /etc/init.d/functions
5262fc
5262fc
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
5262fc
    exit 0
5262fc
fi
5262fc
5262fc
exists() {
5262fc
    which \$1 >/dev/null 2>&1 || return
5262fc
    \$*
5262fc
}
5262fc
5262fc
touch /.liveimg-late-configured
5262fc
5262fc
# read some variables out of /proc/cmdline
5262fc
for o in \`cat /proc/cmdline\` ; do
5262fc
    case \$o in
5262fc
    ks=*)
5262fc
        ks="--kickstart=\${o#ks=}"
5262fc
        ;;
5262fc
    xdriver=*)
5262fc
        xdriver="\${o#xdriver=}"
5262fc
        ;;
5262fc
    esac
5262fc
done
5262fc
5262fc
# if liveinst or textinst is given, start anaconda
5262fc
if strstr "\`cat /proc/cmdline\`" liveinst ; then
5262fc
   plymouth --quit
5262fc
   /usr/sbin/liveinst \$ks
5262fc
fi
5262fc
if strstr "\`cat /proc/cmdline\`" textinst ; then
5262fc
   plymouth --quit
5262fc
   /usr/sbin/liveinst --text \$ks
5262fc
fi
5262fc
5262fc
# configure X, allowing user to override xdriver
5262fc
if [ -n "\$xdriver" ]; then
5262fc
   cat > /etc/X11/xorg.conf.d/00-xdriver.conf <
5262fc
Section "Device"
5262fc
	Identifier	"Videocard0"
5262fc
	Driver	"\$xdriver"
5262fc
EndSection
5262fc
FOE
5262fc
fi
5262fc
5262fc
EOF
5262fc
5262fc
chmod 755 /etc/rc.d/init.d/livesys
5262fc
/sbin/restorecon /etc/rc.d/init.d/livesys
5262fc
/sbin/chkconfig --add livesys
5262fc
5262fc
chmod 755 /etc/rc.d/init.d/livesys-late
5262fc
/sbin/restorecon /etc/rc.d/init.d/livesys-late
5262fc
/sbin/chkconfig --add livesys-late
5262fc
5262fc
# enable tmpfs for /tmp
5262fc
systemctl enable tmp.mount
5262fc
5262fc
# work around for poor key import UI in PackageKit
5262fc
rm -f /var/lib/rpm/__db*
5262fc
releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
5262fc
basearch=$(uname -i)
5262fc
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
5262fc
echo "Packages within this LiveCD"
5262fc
rpm -qa
5262fc
# Note that running rpm recreates the rpm db files which aren't needed or wanted
5262fc
rm -f /var/lib/rpm/__db*
5262fc
5262fc
# go ahead and pre-make the man -k cache (#455968)
5262fc
/usr/bin/mandb
5262fc
5262fc
# save a little bit of space at least...
5262fc
rm -f /boot/initramfs*
5262fc
# make sure there aren't core files lying around
5262fc
rm -f /core*
5262fc
5262fc
# convince readahead not to collect
5262fc
# FIXME: for systemd
5262fc
5262fc
cat >> /etc/rc.d/init.d/livesys << EOF
5262fc
5262fc
5262fc
# disable updates plugin
5262fc
cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
5262fc
[org.gnome.settings-daemon.plugins.updates]
5262fc
active=false
5262fc
FOE
5262fc
5262fc
# Show the system-config-keyboard tool on the desktop
5262fc
mkdir /home/liveuser/Desktop -p >/dev/null
6d68a7
cat /usr/share/applications/system-config-keyboard.desktop | sed '/NotShowIn/d' |sed 's/Terminal=false/Terminal=true/' > /home/liveuser/Desktop/system-config-keyboard.desktop
5262fc
cat /usr/share/applications/liveinst.desktop | sed '/NoDisplay/d' > /home/liveuser/Desktop/liveinst.desktop 
5262fc
chmod +x /home/liveuser/Desktop/*.desktop
5262fc
chown -R liveuser:liveuser /home/liveuser
5262fc
5262fc
# Liveuser face
5262fc
if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
5262fc
    cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /home/liveuser/.face
5262fc
    chown liveuser:liveuser /home/liveuser/.face
5262fc
fi
5262fc
5262fc
# make the installer show up
5262fc
if [ -f /usr/share/applications/liveinst.desktop ]; then
5262fc
  # Show harddisk install in shell dash
5262fc
  sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop 
5262fc
  # need to move it to anaconda.desktop to make shell happy
5262fc
  #cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
5262fc
fi
5262fc
  cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
5262fc
[org.gnome.shell]
5262fc
favorite-apps=['liveinst.desktop','firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop', 'anaconda.desktop']
5262fc
FOE
5262fc
5262fc
5262fc
# set up auto-login
5262fc
cat > /etc/gdm/custom.conf << FOE
5262fc
[daemon]
5262fc
AutomaticLoginEnable=True
5262fc
AutomaticLogin=liveuser
5262fc
FOE
5262fc
5262fc
# Turn off PackageKit-command-not-found while uninstalled
5262fc
if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
5262fc
  sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
5262fc
fi
5262fc
5262fc
# make sure to set the right permissions and selinux contexts
5262fc
chown -R liveuser:liveuser /home/liveuser/
5262fc
restorecon -R /home/liveuser/
5262fc
5262fc
# Fixing default locale to us
5262fc
localectl set-keymap us
5262fc
localectl set-x11-keymap us
5262fc
EOF
5262fc
5262fc
# rebuild schema cache with any overrides we installed
5262fc
glib-compile-schemas /usr/share/glib-2.0/schemas
5262fc
5262fc
5262fc
%end