1: #version=F11
     2: ####version=DEVEL
     3: # Firewall configuration
     4: ### todo: see if this can be removed without complications
     5: ### viros: traits are responsible for locking down
     6: ###firewall --enabled --service=mdns
     7: firewall --disabled
     8: # X Window System configuration information
     9: xconfig  --startxonboot
    10: ### todo: own cgi in mirrors that responds appropriately
    11: ###repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=$basearch
    12: ###repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f11&arch=$basearch
    13: repo --name=released --baseurl=http://mirrors1.kernel.org/fedora/releases/11/Everything/i386/os
    14: ### viros: experiment? should not be necessary to hide this but...
    15: ###repo --name=updates --baseurl=http://mirrors1.kernel.org/fedora/updates/11/i386
    16: # System authorization information
    17: auth --useshadow --enablemd5
    18: # System keyboard
    19: keyboard us
    20: # System language
    21: lang en_US.UTF-8
    22: # SELinux configuration
    23: selinux --enforcing
    24: 
    25: # System services
    26: ### todo: really simple to move to traits
    27: ###services  --disabled=network,sshd --enabled=NetworkManager
    28: services  --disabled=network,sshd,nfs,nfslock --enabled=NetworkManager
    29: # System timezone
    30: ###timezone  US/Eastern
    31: timezone  America/Denver
    32: # Disk partitioning information
    33: ### todo: make this settable in .vml as a synthopt
    34: # note: unsure if --grow --asprimary --ondisk=sda are really needed
    35: part /  --fstype=ext3 --size=4096 --grow --asprimary --ondisk=sda
    36: 
    37: %post
    38: # FIXME: it'd be better to get this installed from a package
    39: cat > /etc/rc.d/init.d/livesys << EOF
    40: #!/bin/bash
    41: #
    42: # live: Init script for live image
    43: #
    44: #### chkconfig: 345 00 99
    45: # chkconfig: 345 00 98
    46: # description: Init script for live image.
    47: 
    48: . /etc/init.d/functions
    49: 
    50: if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ]; then
    51:     exit 0
    52: fi
    53: 
    54: if [ -e /.liveimg-configured ] ; then
    55:     configdone=1
    56: fi
    57: 
    58: exists() {
    59:     which \$1 >/dev/null 2>&1 || return
    60:     \$*
    61: }
    62: 
    63: touch /.liveimg-configured
    64: 
    65: # mount live image
    66: if [ -b \`readlink -f /dev/live\` ]; then
    67:    mkdir -p /mnt/live
    68:    mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
    69: fi
    70: 
    71: livedir="LiveOS"
    72: for arg in \`cat /proc/cmdline\` ; do
    73:   if [ "\${arg##live_dir=}" != "\${arg}" ]; then
    74:     livedir=\${arg##live_dir=}
    75:     return
    76:   fi
    77: done
    78: 
    79: # enable swaps unless requested otherwise
    80: swaps=\`blkid -t TYPE=swap -o device\`
    81: if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
    82:   for s in \$swaps ; do
    83:     action "Enabling swap partition \$s" swapon \$s
    84:   done
    85: fi
    86: if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then
    87:   action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img
    88: fi
    89: 
    90: mountPersistentHome() {
    91:   # support label/uuid
    92:   if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
    93:     homedev=\`/sbin/blkid -o device -t "\$homedev"\`
    94:   fi
    95: 
    96:   # if we're given a file rather than a blockdev, loopback it
    97:   if [ "\${homedev##mtd}" != "\${homedev}" ]; then
    98:     # mtd devs don't have a block device but get magic-mounted with -t jffs2
    99:     mountopts="-t jffs2"
   100:   elif [ ! -b "\$homedev" ]; then
   101:     loopdev=\`losetup -f\`
   102:     if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then
   103:       action "Remounting live store r/w" mount -o remount,rw /mnt/live
   104:     fi
   105:     losetup \$loopdev \$homedev
   106:     homedev=\$loopdev
   107:   fi
   108: 
   109:   # if it's encrypted, we need to unlock it
   110:   if [ "\$(/lib/udev/vol_id -t \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
   111:     echo
   112:     echo "Setting up encrypted /home device"
   113:     plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
   114:     homedev=/dev/mapper/EncHome
   115:   fi
   116: 
   117:   # and finally do the mount
   118:   mount \$mountopts \$homedev /home
   119:   # if we have /home under what's passed for persistent home, then
   120:   # we should make that the real /home.  useful for mtd device on olpc
   121:   if [ -d /home/home ]; then mount --bind /home/home /home ; fi
   122:   [ -x /sbin/restorecon ] && /sbin/restorecon /home
   123:   if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
   124: }
   125: 
   126: findPersistentHome() {
   127:   for arg in \`cat /proc/cmdline\` ; do
   128:     if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
   129:       homedev=\${arg##persistenthome=}
   130:       return
   131:     fi
   132:   done
   133: }
   134: 
   135: if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
   136:   findPersistentHome
   137: elif [ -e /mnt/live/\${livedir}/home.img ]; then
   138:   homedev=/mnt/live/\${livedir}/home.img
   139: fi
   140: 
   141: # if we have a persistent /home, then we want to go ahead and mount it
   142: if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
   143:   action "Mounting persistent /home" mountPersistentHome
   144: fi
   145: 
   146: # make it so that we don't do writing to the overlay for things which
   147: # are just tmpdirs/caches
   148: mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
   149: mount -t tmpfs tmp /tmp
   150: mount -t tmpfs vartmp /var/tmp
   151: [ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
   152: 
   153: if [ -n "\$configdone" ]; then
   154:   exit 0
   155: fi
   156: 
   157: # add compat live user with no passwd
   158: action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
   159: passwd -d liveuser > /dev/null
   160: 
   161: # turn off firstboot for livecd boots
   162: chkconfig --level 345 firstboot off 2>/dev/null
   163: 
   164: # don't start yum-updatesd for livecd boots
   165: chkconfig --level 345 yum-updatesd off 2>/dev/null
   166: 
   167: # turn off mdmonitor by default
   168: chkconfig --level 345 mdmonitor off 2>/dev/null
   169: 
   170: # turn off setroubleshoot on the live image to preserve resources
   171: chkconfig --level 345 setroubleshoot off 2>/dev/null
   172: 
   173: # don't do packagekit checking by default
   174: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_updates never >/dev/null
   175: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_upgrades never >/dev/null
   176: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_refresh_cache never >/dev/null
   177: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_available false >/dev/null
   178: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_distro_upgrades false >/dev/null
   179: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null
   180: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
   181: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
   182: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
   183: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
   184: 
   185: 
   186: # don't start cron/at as they tend to spawn things which are
   187: # disk intensive that are painful on a live image
   188: chkconfig --level 345 crond off 2>/dev/null
   189: chkconfig --level 345 atd off 2>/dev/null
   190: chkconfig --level 345 anacron off 2>/dev/null
   191: chkconfig --level 345 readahead_early off 2>/dev/null
   192: chkconfig --level 345 readahead_later off 2>/dev/null
   193: 
   194: # Stopgap fix for RH #217966; should be fixed in HAL instead
   195: touch /media/.hal-mtab
   196: 
   197: # workaround clock syncing on shutdown that we don't want (#297421)
   198: sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
   199: 
   200: # and hack so that we eject the cd on shutdown if we're using a CD...
   201: if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
   202:   cat >> /sbin/halt.local << FOE
   203: #!/bin/bash
   204: # we want to eject the cd on halt, but let's also try to avoid
   205: # io errors due to not being able to get files...
   206: cat /sbin/halt > /dev/null
   207: cat /sbin/reboot > /dev/null
   208: /usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1
   209: echo "Please remove the CD from your drive and press Enter to finish restarting"
   210: read -t 30 < /dev/console
   211: FOE
   212: chmod +x /sbin/halt.local
   213: fi
   214: 
   215: EOF
   216: 
   217: # bah, hal starts way too late
   218: cat > /etc/rc.d/init.d/livesys-late << EOF
   219: #!/bin/bash
   220: #
   221: # live: Late init script for live image
   222: #
   223: # chkconfig: 345 99 01
   224: # description: Late init script for live image.
   225: 
   226: . /etc/init.d/functions
   227: 
   228: if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
   229:     exit 0
   230: fi
   231: 
   232: exists() {
   233:     which \$1 >/dev/null 2>&1 || return
   234:     \$*
   235: }
   236: 
   237: touch /.liveimg-late-configured
   238: 
   239: # read some variables out of /proc/cmdline
   240: for o in \`cat /proc/cmdline\` ; do
   241:     case \$o in
   242:     ks=*)
   243:         ks="\${o#ks=}"
   244:         ;;
   245:     xdriver=*)
   246:         xdriver="--set-driver=\${o#xdriver=}"
   247:         ;;
   248:     esac
   249: done
   250: 
   251: # this is a bad hack to work around #460581 for the geode
   252: # purely to help move testing along for now
   253: if [ \`grep -c Geode /proc/cpuinfo\` -ne 0 ]; then
   254:   cat > /etc/X11/xorg.conf <<FOE
   255: Section "ServerLayout"
   256: 	Identifier     "Default Layout"
   257: 	Screen      0  "Screen0" 0 0
   258: 	InputDevice    "Keyboard0" "CoreKeyboard"
   259: EndSection
   260: 
   261: Section "InputDevice"
   262: # keyboard added by rhpxl
   263: 	Identifier  "Keyboard0"
   264: 	Driver      "kbd"
   265: 	Option	    "XkbModel" "pc105"
   266: 	Option	    "XkbLayout" "us"
   267: EndSection
   268: 
   269: Section "Monitor"
   270: 	Identifier  "Monitor0"
   271: 	HorizSync   30-67
   272: 	VertRefresh 48-52
   273: 	DisplaySize 152 114
   274: 	Mode "1200x900"
   275: 		DotClock 57.275
   276: 		HTimings 1200 1208 1216 1240
   277: 		VTimings 900 905 908 912
   278: 		Flags    "-HSync" "-VSync"
   279: 	EndMode
   280: EndSection
   281: 
   282: Section "Device"
   283: 	Identifier  "Videocard0"
   284: 	Driver      "amd"
   285: 	VendorName  "Advanced Micro Devices, Inc."
   286: 	BoardName   "AMD Geode GX/LX"
   287: 
   288: 	Option     "AccelMethod" "EXA"
   289: 	Option     "NoCompression" "true"
   290:         Option     "MigrationHeuristic" "greedy"
   291: 	Option     "PanelGeometry" "1200x900"
   292: EndSection
   293: 
   294: Section "Screen"
   295: 	Identifier "Screen0"
   296: 	Device     "Videocard0"
   297: 	Monitor    "Monitor0"
   298: 	DefaultDepth 16
   299: 	SubSection "Display"
   300: 		Depth   16
   301: 		Modes   "1200x900"
   302: 	EndSubSection
   303: EndSection
   304: FOE
   305: fi
   306: 
   307: # if liveinst or textinst is given, start anaconda
   308: if strstr "\`cat /proc/cmdline\`" liveinst ; then
   309:    plymouth --quit
   310:    /usr/sbin/liveinst \$ks
   311: fi
   312: if strstr "\`cat /proc/cmdline\`" textinst ; then
   313:    plymouth --quit
   314:    /usr/sbin/liveinst --text \$ks
   315: fi
   316: 
   317: # configure X, allowing user to override xdriver
   318: if [ -n "\$xdriver" ]; then
   319:    exists system-config-display --noui --reconfig --set-depth=24 \$xdriver
   320: fi
   321: 
   322: EOF
   323: 
   324: # workaround avahi segfault (#279301)
   325: touch /etc/resolv.conf
   326: /sbin/restorecon /etc/resolv.conf
   327: 
   328: chmod 755 /etc/rc.d/init.d/livesys
   329: /sbin/restorecon /etc/rc.d/init.d/livesys
   330: /sbin/chkconfig --add livesys
   331: 
   332: chmod 755 /etc/rc.d/init.d/livesys-late
   333: /sbin/restorecon /etc/rc.d/init.d/livesys-late
   334: /sbin/chkconfig --add livesys-late
   335: 
   336: # work around for poor key import UI in PackageKit
   337: rm -f /var/lib/rpm/__db*
   338: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
   339: 
   340: # go ahead and pre-make the man -k cache (#455968)
   341: /usr/sbin/makewhatis -w
   342: 
   343: # save a little bit of space at least...
   344: ###rm -f /boot/initrd*
   345: # make sure there aren't core files lying around
   346: rm -f /core*
   347: 
   348: %end
   349: 
   350: %post --nochroot
   351: cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
   352: cp $INSTALL_ROOT/usr/share/doc/HTML/readme-live-image/en_US/readme-live-image-en_US.txt $LIVE_ROOT/README
   353: 
   354: # only works on x86, x86_64
   355: if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
   356:   if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
   357:   cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
   358: fi
   359: %end
   360: 
   361: %post
   362: cat >> /etc/rc.d/init.d/livesys << EOF
   363: # disable screensaver locking
   364: gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null
   365: # set up timed auto-login for after 60 seconds
   366: ###cat >> /etc/gdm/custom.conf << FOE
   367: ###[daemon]
   368: ###TimedLoginEnable=true
   369: ###TimedLogin=liveuser
   370: ###TimedLoginDelay=60
   371: ###FOE
   372: 
   373: EOF
   374: 
   375: %end
   376: 
   377: %packages
   378: @admin-tools
   379: @base
   380: @base-x
   381: @core
   382: @dial-up
   383: @fonts
   384: @games
   385: @gnome-desktop
   386: @graphical-internet
   387: @graphics
   388: @hardware-support
   389: @input-methods
   390: @printing
   391: @sound-and-video
   392: NetworkManager-openvpn
   393: NetworkManager-vpnc
   394: abiword
   395: anaconda
   396: festival
   397: festvox-slt-arctic-hts
   398: isomd5sum
   399: kernel
   400: memtest86+
   401: nss-mdns
   402: sendmail
   403: totem-gstreamer
   404: -*debuginfo
   405: -a2ps
   406: -acpid
   407: -aspell-*
   408: -autofs
   409: -ccid
   410: -compat*
   411: -coolkey
   412: -dasher
   413: -ekiga
   414: -esc
   415: -evince-djvu
   416: -evince-dvi
   417: -evolution-help
   418: -f-spot
   419: -gimp-help
   420: -gimp-help-browser
   421: -gnome-games
   422: -gnome-games-help
   423: -gnome-user-docs
   424: -hpijs
   425: -hplip
   426: -hunspell-*
   427: -isdn4k-utils
   428: -man-pages-*
   429: -mpage
   430: -nss_db
   431: -numactl
   432: -pinfo
   433: -ql2100-firmware
   434: -ql2200-firmware
   435: -ql23xx-firmware
   436: -ql2400-firmware
   437: -redhat-lsb
   438: -samba-client
   439: -sane-backends
   440: -sox
   441: -specspo
   442: -tomboy
   443: -totem-xine
   444: -vino
   445: -vorbis-tools
   446: # VirOS: wget is pretty important
   447: #-wget
   448: wget
   449: -words
   450: -xsane
   451: -xsane-gimp
   452: 
   453: %end
   454: