lang en_US.UTF-8,ko_kr.UTF-9,ko_kr.EucKR keyboard us timezone asia/seoul auth --useshadow --enablemd5 selinux --disabled firewall --disabled #repo --name=a-base --baseurl=http://ftp.telus.net/pub/centos/5/os/$basearch #repo --name=a-updates --baseurl=http://ftp.telus.net/pub/centos/5/updates/$basearch #repo --name=a-extras --baseurl=http://ftp.telus.net/pub/centos/5/extras/$basearch repo --name=a-base --baseurl=http://ftp.daum.net/centos/5/os/$basearch repo --name=a-updates --baseurl=http://ftp.daum.net/centos/5/updates/$basearch repo --name=a-extras --baseurl=http://ftp.daum.net/centos/5/extras/$basearch repo --name=a-live --baseurl=http://www.nanotechnologies.qc.ca/propos/linux/centos-live/$basearch/live xconfig --startxonboot services --enabled=NetworkManager,dhcdbd --disabled=network,sshd,nfslock %packages bash kernel syslinux #comps-extras compiz vim-enhanced @office @admin-tools @system-tools @korean-support @base @network-server @base-x @smb-server @printing @Development Tools @Development Libraries @GNOME Desktop Environment @Games and Entertainment @System Tools @X Window System gnome-desktop grub rdesktop fonts-korean dhcp vnc-server xchat nmap-frontend tsclient k3b scribus squashfs-tools -sysreport # other usefull packages Cluster_Administration-en-US Deployment_Guide-en-US Virtualization-en-US memtest86+ patch yum-fastestmirror yum-metadata-parser # LiveCD bits to set up the livecd and be able to install # Installation from the livecd requires anaconda >= 11.2.0.66 anaconda anaconda-runtime livecd-installer %post #!/bin/bash # ## locales for the Live CD PRIMARY_LANGUAGE="en" PRIMARY_LOCALE="en_US" SECONDARY_LANGUAGE="ko" SECONDARY_LOCALE="ko_KR" # FIXME: it'd be better to get this installed from a package cat > /etc/rc.d/init.d/centos-live << EOF_initscript #!/bin/bash # # live: Init script for live image # # chkconfig: 345 00 99 # description: Init script for live image. . /etc/init.d/functions if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-configured ] ; then exit 0 fi exists() { which \$1 >/dev/null 2>&1 || return \$* } touch /.liveimg-configured # mount live image if [ -b /dev/live ]; then mkdir -p /mnt/live mount -o ro /dev/live /mnt/live fi # enable swaps unless requested otherwise swaps=\`blkid -t TYPE=swap -o device\` if ! strstr "\`cat /proc/cmdline\`" noswap -a [ -n "\$swaps" ] ; then for s in \$swaps ; do action "Enabling swap partition \$s" swapon \$s done fi # configure X exists system-config-display --noui --reconfig --set-depth=24 # unmute sound card exists alsaunmute 0 2> /dev/null # add default user with no password useradd -c "LiveCD default user" centos passwd -d centos > /dev/null # set up timed auto-login for after 10 seconds sed -i -e 's/\[daemon\]/[daemon]\nTimedLoginEnable=true\nTimedLogin=centos\nTimedLoginDelay=10/' /etc/gdm/custom.conf # disable screensaver locking gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null # give default user sudo privileges echo "centos ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # add documentation shortcuts on the default user desktop mkdir -p /home/centos/Desktop/Documentation cp /usr/share/applications/Cluster_Administration.desktop /home/centos/Desktop/Documentation/ cp /usr/share/applications/Deployment_Guide.desktop /home/centos/Desktop/Documentation/ cp /usr/share/applications/Global_File_System.desktop /home/centos/Desktop/Documentation/ cp /usr/share/applications/Virtualization.desktop /home/centos/Desktop/Documentation/ cat > /home/centos/Desktop/Documentation/Additional_Documentation.desktop << EOF_documentation [Desktop Entry] Name=Additional Documentation Comment=Enterprise Linux Exec=firefox http://www.centos.org/docs/5/ Icon=/usr/share/pixmaps/redhat-web-browser.png Categories=Documentation; Type=Application Encoding=UTF-8 Terminal=false EOF_documentation # add keyboard configuration utility to the desktop cp /usr/share/applications/system-config-keyboard.desktop /home/centos/Desktop/ # turn off firstboot for livecd boots echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot # don't start yum-updatesd for livecd boots chkconfig --level 345 yum-updatesd off &>/dev/null # don't start cron/at as they tend to spawn things which are # disk intensive that are painful on a live image chkconfig --level 345 crond off &>/dev/null chkconfig --level 345 atd off &>/dev/null chkconfig --level 345 anacron off &>/dev/null chkconfig --level 345 readahead_early off &>/dev/null chkconfig --level 345 readahead_later off &>/dev/null # Stopgap fix for RH #217966; should be fixed in HAL instead touch /media/.hal-mtab CreateDesktopIconHD() { mkdir -p /home/centos/Desktop >/dev/null cat > /home/centos/Desktop/Local\ hard\ drives.desktop << EOF_HDicon [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Link Name=Local hard drives Name[en_US]=Local hard drives Name[ko_KR]=Disques durs locaux URL=/mnt/disc Icon=/usr/share/icons/Bluecurve/48x48/devices/gnome-dev-harddisk.png EOF_HDicon chmod 755 /home/centos/Desktop/Local\ hard\ drives.desktop } CreateDesktopIconLVM() { mkdir -p /home/centos/Desktop >/dev/null cat > /home/centos/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Link Name=Local logical volumes Name[en_US]=Local logical volumes Name[ko_KR]=Volumes logiques locaux URL=/mnt/lvm Icon=/usr/share/icons/Bluecurve/48x48/devices/gnome-dev-harddisk.png EOF_LVMicon chmod 755 /home/centos/Desktop/Local\ logical\ volumes.desktop } MOUNTOPTION="ro" HARD_DISKS=\`egrep "[sh]d.$" /proc/partitions | tr -s ' ' | sed 's/^ *//' | cut -d' ' -f4\` echo "Mounting hard disk partitions... " for DISK in \$HARD_DISKS; do # Get the device and system info from fdisk (but only for fat and linux partitions). 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-\` for FDISK_ENTRY in \$FDISK_INFO; do PARTITION=\`echo \$FDISK_ENTRY | cut -d':' -f1\` MOUNTPOINT="/mnt/disc/\${PARTITION##/dev/}" mkdir -p \$MOUNTPOINT MOUNTED=FALSE # get the partition type case \`echo \$FDISK_ENTRY | cut -d':' -f2-\` in *fat*) FSTYPES="vfat" EXTRAOPTIONS=",uid=500";; *) FSTYPES="ext3 ext2" EXTRAOPTIONS="";; esac # try to mount the partition for FSTYPE in \$FSTYPES; do if mount -o "\${MOUNTOPTION}\${EXTRAOPTIONS}" -t \$FSTYPE \$PARTITION \$MOUNTPOINT &>/dev/null; then echo "\$PARTITION \$MOUNTPOINT \$FSTYPE noauto,\${MOUNTOPTION}\${EXTRAOPTIONS} 0 0" >> /etc/fstab echo -n "\$PARTITION " MOUNTED=TRUE CreateDesktopIconHD fi done [ \$MOUNTED = "FALSE" ] && rmdir \$MOUNTPOINT done done echo FSTYPES="ext3 ext2" echo "Scanning for logical volumes..." if ! lvm vgscan 2>&1 | grep "No volume groups"; then echo "Activating logical volumes ..." modprobe dm_mod >/dev/null echo "mkdmnod" | nash --quiet lvm vgchange -ay LOGICAL_VOLUMES=\`lvm lvdisplay -c | sed "s/^ *//" | cut -d: -f1\` if [ ! -z "\$LOGICAL_VOLUMES" ]; then echo "Making device nodes ..." lvm vgmknodes echo -n "Mounting logical volumes ... " for VOLUME_NAME in \$LOGICAL_VOLUMES; do VG_NAME=\`echo \$VOLUME_NAME | cut -d/ -f3\` LV_NAME=\`echo \$VOLUME_NAME | cut -d/ -f4\` MOUNTPOINT="/mnt/lvm/\${VG_NAME}-\${LV_NAME}" mkdir -p \$MOUNTPOINT MOUNTED=FALSE for FSTYPE in \$FSTYPES; do if mount -o \$MOUNTOPTION -t \$FSTYPE \$VOLUME_NAME \$MOUNTPOINT &>/dev/null; then echo "\$VOLUME_NAME \$MOUNTPOINT \$FSTYPE defaults,\${MOUNTOPTION} 0 0" >> /etc/fstab echo -n "\$VOLUME_NAME " MOUNTED=TRUE CreateDesktopIconLVM break fi done [ \$MOUNTED = FALSE ] && rmdir \$MOUNTPOINT done echo else echo "No logical volumes found" fi fi # Give back ownership to the default user for its own files chown -R centos:centos /home/centos EOF_initscript chmod 755 /etc/rc.d/init.d/centos-live /sbin/restorecon /etc/rc.d/init.d/centos-live /sbin/chkconfig --add centos-live # Modify the kudzu script to configure correctly the keyboard layout for # the graphical environment cat > /tmp/kudzu.patch << EOF_kudzupatch --- kudzu.orig 2007-07-27 20:27:03.000000000 -0400 +++ kudzu 2007-07-27 20:27:23.000000000 -0400 @@ -35,6 +35,10 @@ action "" /bin/false fi + # Reconfigure the keyboard + . /etc/sysconfig/keyboard + /usr/bin/system-config-keyboard \$KEYTABLE 2&> /dev/null + # We don't want to run this on random runlevel changes. touch /var/lock/subsys/kudzu # However, if they did configure X and want runlevel 5, let's EOF_kudzupatch /usr/bin/patch /etc/rc.d/init.d/kudzu /tmp/kudzu.patch rm -f /tmp/kudzu.patch ## save a little bit of space at least... rm -f /boot/initrd* rm -f /usr/var/lib/rpm/__db.00* # remove files for unsupported languages in various applications # # Saved space: 95MB # (cd /var/lib/scrollkeeper; \ if [ `ls | wc -w` -gt 9 ]; then \ mkdir ../temp_dir; \ mv C $PRIMARY_LANGUAGE $SECONDARY_LANGUAGE index scrollkeeper_docs TOC ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ sync; \ fi) (cd /usr/lib/locale; \ if [ `ls | wc -w` -gt 28 ]; then \ mkdir ../temp_dir; \ mv $PRIMARY_LOCALE* $SECONDARY_LOCALE* ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ /usr/sbin/build-locale-archive; \ sync; \ fi) (cd /usr/share/locale; \ if [ `ls | wc -w` -gt 17 ]; then \ mkdir ../temp_dir; \ mv all_languages C locale.alias ../temp_dir; \ mv $PRIMARY_LANGUAGE $PRIMARY_LOCALE $SECONDARY_LANGUAGE $SECONDARY_LOCALE ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ sync; \ fi) (cd /usr/share/apps/ksgmltools2/customization; \ if [ `ls | wc -w` -gt 25 ]; then \ mkdir ../temp_dir; \ mv catalog dtd htdig* kde* obsolete README xsl ../temp_dir; \ mv $PRIMARY_LANGUAGE $PRIMARY_LOCALE $SECONDARY_LANGUAGE $SECONDARY_LOCALE ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ sync; \ fi) # remove rarely used documentation files # # Space saved: 7MB # (cd /usr/share/doc; \ if find . -maxdepth 1 -mmin -60 >/dev/null; then \ find . -iname changelog* -exec rm -f {} \; ;\ find . -iname changes -exec rm -f {} \; ;\ find . -iname news -exec rm -f {} \; ;\ sync; \ fi) (cd /usr/share/doc/HTML; \ if [ `ls | wc -w` -gt 25 ]; then \ mkdir ../temp_dir; \ mv $PRIMARY_LANGUAGE $SECONDARY_LANGUAGE index.html ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ sync; \ fi) # remove manual pages for unsupported languages # # Space saved: 1MB # (cd /usr/share/man; \ if [ `ls | wc -w` -gt 20 ]; then \ mkdir ../temp_dir; \ mv man* $PRIMARY_LANGUAGE $SECONDARY_LANGUAGE ../temp_dir; \ rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \ sync; \ fi)