HOWTO create a LiveDVD/USB from a custom build of CentOS 6.2

General support questions
lleb
Posts: 14
Joined: 2012/03/18 14:53:14

Re: HOWTO create a LiveDVD/USB from a custom build of CentOS 6.2

Post by lleb » 2012/03/22 21:35:33

i think i resolved this issue, but now im getting errors when it starts to end. it never umounts the virtual partitions and drives leaving me with no .iso. i have made some major changes tot he kickstart script.

[code]
firewall --disabled
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# Network information
network --bootproto=dhcp --device=eth0 --nameserver=8.8.8.8 --onboot=on
# System authorization information
auth --useshadow --passalgo=md5
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# adding repos

repo --name=a-base --baseurl=http://mirror.centos.org/centos/6.2/os/i386
repo --name=a-updates --baseurl=http://mirror.centos.org/centos/6.2/updates/i386
repo --name=a-live --baseurl=http://www.nanotechnologies.qc.ca/propos/linux/centos-live/i386/live
repo --name=a-google-chrome --baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386

# Installation logging level
logging --level=info
#Root password
rootpw --iscrypted $1$tX3SYG9H$X/RENO4wHFcFCZri8t02F/
# X Window System configuration information
xconfig --defaultdesktop=KDE
# Reboot after installation
#reboot
reboot --eject
# System timezone
timezone America/New_York
# System bootloader configuration
bootloader --location=mbr append vga=791
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --ondisk sda --fstype="ext3" --size=100
part / --ondisk sda --fstype="ext3" --grow --size=9000
part /usr/rx30 --ondisk sda --fstype="ext3" --grow --size=9000 --asprimary
part swap --ondisk sda --fstype="swap" --recommended

%packages
syslinux
kernel
@additional-devel
@backup-client
@base
@cifs-file-server
@compat-libraries
@console-internet
@debugging
@desktop-debugging
@development
@dial-up
@fonts
@ftp-server
@graphical-admin-tools
@graphics
@hardware-monitoring
@internet-applications
@internet-browser
@java-platform
@kde-desktop
@legacy-unix
@legacy-x
@mail-server
@mainframe-access
@mysql
@mysql-client
@network-file-system-client
@network-server
@network-tools
@nfs-file-server
@office-suite
@performance
@perl-runtime
@print-client
@print-server
@remote-desktop-clients
@server-platform
@system-admin-tools
@system-management
@web-server
@x11
@rx30-cfg
@rx30-chat
#AdobeReader_enu
arptables_jf
arpwatch
bitmap-console-fonts
bitmap-fixed-fonts
bitmap-lucida-typewriter-fonts
bitmap-miscfixed-fonts
cmake
compat-gcc-34
compat-gcc-34-c++
compat-gcc-34-g77
dos2unix
dropwatch
dump
efax
ftp
gcc-objc
gcc-objc++
ghostscript-gtk
glibc-static
google-chrome
iptraf
iptstate
krb5-appl-servers
lftp
libXmu
lsscsi
m17n-db-generic
mc
memtest86+
mgetty
mgetty-sendfax
mgetty-viewfax
mtr-gtk
mutt
mysql-bench
mysql-test
ncompress
ncurses-static
openmotif
openmotif22
perl-TimeDate
perl-Bit-Vector

# other usefull packages
#Cluster_Administration-en-US
#Deployment_Guide-en-US
#Global_File_System-en-US
#Virtualization-en-US
#busybox
#mailx
#patch
yum-fastestmirror
yum-metadata-parser
# end other usefull packages

perl-Carp-Clan
perl-Date-Calc
perl-DateManip
perl-libwww-perl
perl-Compress-Zlib
perl-HTML-Parser
perl-HTML-Tagset
perl-URI
perl-DBD-MySQL
postfix
pptp
python
rdesktop
rdist
rsh
rsyslog-gnutls
rsyslog-gnutls
rsyslog-gssapi
rsyslog-gssapi
rsyslog-mysql
rusers
screen
sg3_utils
#swatch
symlinks
syslinux
system-config-lvm
tcp_wrappers
telnet
telnet-server
tftp
thunderbird
tree
tuned
udftools
unix2dos
uuidd
wireshark
xorg-x11-fonts-ethiopic
xorg-x11-fonts-75dpi
xorg-x11-fonts-ISO8859-1-75dpi
xorg-x11-fonts-ISO8859-14-100dpi
xorg-x11-fonts-ISO8859-14-75dpi
xorg-x11-fonts-ISO8859-15-75dpi
xorg-x11-fonts-ISO8859-2-100dpi
xorg-x11-fonts-ISO8859-2-75dpi
xorg-x11-fonts-ISO8859-9-100dpi
xorg-x11-fonts-ISO8859-9-75dpi
xorg-x11-twm
xorg-x11-xdm
xterm
yum-plugin-protect-packages
yum-plugin-security
#libFS
#xorg-x11-xfs

%post --nochroot

mkdir -p /mnt/source;mount -t iso9660 /tmp/cdrom /mnt/source
tar -xzvf /mnt/source/post/rx30sysfiles.tgz -C /mnt/sysimage/
#tar -xvzf /mnt/source/post/ltsp.tgz -C /mnt/sysimage/opt
mkdir /mnt/sysimage/tftpboot
tar -xvzf /mnt/source/post/tftpboot.tgz -C /mnt/sysimage/tftpboot
mkdir /mnt/sysimage/usr/rx30/.kde
mkdir /mnt/sysimage/usr/rx30/.kde/share
mkdir /mnt/sysimage/usr/rx30/.kde/share/config
mkdir /mnt/sysimage/usr/rx30/llinstl
mkdir /mnt/sysimage/usr/rx30/llinstl/bak

tar -xvzf /mnt/source/post/kdeshareconfig.tgz -C /mnt/sysimage/usr/rx30/.kde/share/config
cp /mnt/source/changelog /mnt/sysimage/root

########################################################################
# Create a sub-script so the output can be captured
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
########################################################################
cat > /root/postnochroot-install << EOF_postnochroot
#!/bin/bash

# add livecd-iso-to-disk utility on the LiveCD
# only works on x86, x86_64
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
fi

# customize boot menu entries
grep -A4 'label linux0' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
grep -A2 'label local' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt

sed "s/label linux0/label linuxtext0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textmode.txt
sed -i "s/Boot/Boot (text mode)/" \$LIVE_ROOT/isolinux/textmode.txt
sed -i "s/liveimg/liveimg 3/" \$LIVE_ROOT/isolinux/textmode.txt
sed -i "/menu default/d" \$LIVE_ROOT/isolinux/textmode.txt

touch \$LIVE_ROOT/isolinux/installer.txt
if [ -e \$INSTALL_ROOT/boot/livecd-installer.img -a -e \$INSTALL_ROOT/boot/vmlinuz-installer* ]; then
mv \$INSTALL_ROOT/boot/livecd-installer.img \$LIVE_ROOT/isolinux/install.img
mv \$INSTALL_ROOT/boot/vmlinuz-installer* \$LIVE_ROOT/isolinux/vminst
cat > \$LIVE_ROOT/isolinux/installer.txt << EOF_installer
label installer
menu label Network Installation
kernel vminst
append initrd=install.img text
EOF_installer
fi

cat \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/current.txt
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
cat \$LIVE_ROOT/isolinux/cleaned.txt \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/textmode.txt \$LIVE_ROOT/isolinux/installer.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/isolinux.cfg
rm -f \$LIVE_ROOT/isolinux/*.txt

EOF_postnochroot

/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log




%post

## LiveCD version for the link toward the release notes
VERSION="6.2"
## locales for the Live CD
PRIMARY_LANGUAGE="en"
PRIMARY_LOCALE="en_US"

## default LiveCD user
LIVECD_USER="rx30"

########################################################################
# Create a sub-script so the output can be captured
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
########################################################################
cat > /root/post-install << EOF_post
#!/bin/bash

echo ###################################################################
echo ## Creating the livesys init script
echo ###################################################################

cat > /etc/rc.d/init.d/livesys << 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
\\\$*
}

# read some variables out of /proc/cmdline
for o in \\\`cat /proc/cmdline\\\` ; do
case \\\$o in
xdriver=*)
xdriver="--set-driver=\\\${o#xdriver=}"
;;
esac
done

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

## fix various bugs and issues
# configure X, allowing user to override xdriver
exists system-config-display --noui --reconfig --set-depth=24 \\\$xdriver

# turn off firstboot for livecd boots
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot

# create a patch for kudzu init script
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

# patch kudzu init script
/usr/bin/patch /etc/rc.d/init.d/kudzu /tmp/kudzu.patch > /dev/null
rm -f /tmp/kudzu.patch

# stopgap fix for RH #217966; should be fixed in HAL instead
touch /media/.hal-mtab

# workaround clock syncing on shutdown that we don't want (RH #297421)
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt

# workaround avahi segfault (RH #273301)
touch /etc/resolv.conf
/sbin/restorecon /etc/resolv.conf

# set the LiveCD hostname
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=livecd.localdomain/g' /etc/sysconfig/network
/bin/hostname livecd.localdomain

## create the LiveCD default user
# add default user with no password
/usr/sbin/useradd -c "LiveCD default user" $LIVECD_USER
/usr/bin/passwd -d $LIVECD_USER > /dev/null
# give default user sudo privileges
echo "$LIVECD_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# 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

# add documentation shortcuts
mkdir -p /home/$LIVECD_USER/Desktop/Documentation
cp /usr/share/applications/Cluster_Administration-en-US.desktop /home/$LIVECD_USER/Desktop/Documentation/
cp /usr/share/applications/Deployment_Guide-en-US.desktop /home/$LIVECD_USER/Desktop/Documentation/
cp /usr/share/applications/Global_File_System-en-US.desktop /home/$LIVECD_USER/Desktop/Documentation/
cp /usr/share/applications/Virtualization-en-US.desktop /home/$LIVECD_USER/Desktop/Documentation/
cat > /home/$LIVECD_USER/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
cat > /home/$LIVECD_USER/Desktop/Documentation/Release_Notes.desktop << EOF_release_notes
[Desktop Entry]
Name=How To Install
Comment=Enterprise Linux
Exec=firefox http://wiki.centos.org/Manuals/ReleaseNotes/CentOSLiveCD$VERSION
Icon=/usr/share/pixmaps/redhat-web-browser.png
Categories=Documentation;
Type=Application
Encoding=UTF-8
Terminal=false
EOF_release_notes

CreateDesktopIconHD()
{
cat > /home/$LIVECD_USER/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[fr_CA]=Disques durs locaux
URL=/mnt/disc
Icon=/usr/share/icons/Bluecurve/48x48/devices/gnome-dev-harddisk.png
EOF_HDicon

chmod 755 /home/$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
}

CreateDesktopIconLVM()
{
cat > /home/$LIVECD_USER/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[fr_CA]=Volumes logiques locaux
URL=/mnt/lvm
Icon=/usr/share/icons/Bluecurve/48x48/devices/gnome-dev-harddisk.png
EOF_LVMicon

chmod 755 /home/$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
}

# don't mount disk partitions if 'nodiskmount' is given as a boot option
if ! strstr "\\\`cat /proc/cmdline\\\`" nodiskmount ; then
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="ext4 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="ext4 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
fi

# give back ownership to the default user
chown -R $LIVECD_USER:$LIVECD_USER /home/$LIVECD_USER
EOF_initscript

chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys

echo ###################################################################
echo ## Trim down the LiveCD to save some space
echo ###################################################################
# remove unneeded initrd file(s)
rm -f /boot/initrd*
# temporary RPM databases can be removed
rm -f /usr/var/lib/rpm/__db.00*
# make sure there aren't core files lying around
rm -f /core*

# remove files for unsupported languages in various applications
(cd /var/lib/scrollkeeper; \
if [ \`ls | wc -w\` -gt 11 ]; 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 8 ]; 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 10 ]; then \
mkdir ../temp_dir; \
mv 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)

# remove rarely used documentation files
(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)

# remove manual pages for unsupported languages
(cd /usr/share/man; \
if [ \`ls | wc -w\` -gt 16 ]; then \
mkdir ../temp_dir; \
mv man* $PRIMARY_LANGUAGE $SECONDARY_LANGUAGE ../temp_dir; \
rm -rf *; mv ../temp_dir/* .; rmdir ../temp_dir; \
sync; \
fi)
EOF_post

/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log





tar -zxvf /etc/openfire.tgz -C /opt

if [ -e /etc/hosts.orig ]
then echo "/etc/hosts file already installed"
else echo "Installing /etc/hosts with 10 netterms..."
cp /etc/hosts /etc/hosts.orig
hostname=rx30
echo -e "127.0.0.1\tlocalhost\tlocalhost.localdomain
12.164.113.100\tll_host
192.168.0.254\t$hostname\t$hostname.localdomain
192.168.0.2\tnetterm1
192.168.0.3\tnetterm2
192.168.0.4\tnetterm3
192.168.0.5\tnetterm4
192.168.0.\tmylan
12.164.113.15\tftp.rx30.com
12.164.113.103\tsshserver
" >/etc/hosts
fi

echo -e "NETWORKING=yes
HOSTNAME=rx30.localdomain
GATEWAY=192.168.0.1" >/etc/sysconfig/network
# new kluge to eliminate NM_controlled, MTU and MAC lines in CentOS6
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/ifcfg-eth0.BAK

echo -e "DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.254
NETMASK=255.255.255.0
DNS1=208.67.222.222" >/etc/sysconfig/network-scripts/ifcfg-eth0

## Timestamp root history
echo "export HISTTIMEFORMAT='%m %d %Y- %H:%M:%S '" >>/root/.bash_profile

cp /usr/bin/vpninstl /root
if [ -e /etc/profile.orig ]
then echo "/etc/profile already updated"
else echo "Updating /etc/profile..."
cp /etc/profile /etc/profile.orig
echo "
if [ -r /etc/default/timezone ]
then TZ=\`cat /etc/default/timezone\`
export TZ
fi
INIT_TTY=\`tty\`
TTY1=\`basename \$INIT_TTY\`
TTY=\`echo \$TTY1 | cut -c1-3\`
if [ \$TTY = \"tty\" ]
then
unicode_stop
fi
" >/etc/profile
fi

if [ -e /etc/rc.d/rc.local.orig ]
then echo "/etc/rc.d/rc.local already updated"
else echo "Updating /etc/rc.local..."
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.orig
echo "
chmod 777 /dev/ttyS*
/bin/loadkeys << EOF
keycode 14 = BackSpace
keycode 111 = Delete
EOF
initctl start tty TTY=tty1 &
chmod 666 /etc/sane.d/net.conf" >> /etc/rc.d/rc.local
fi

/usr/sbin/groupadd -f -g 505 group
if [ $? -ne 0 ]
then echo "Groupadd group FAILED"
fail=`expr $fail + 1`
fi

#install swatch file into place

cp /opt/extras/swatch.sata /etc/swatch.conf

echo -e "
*.mozilla*
*.kde*" >> /usr/rx30/excludes.conf

mkdir /usr/rx30/Desktop
cp /etc/skel/Desktop/* /usr/rx30/Desktop
ln -s /usr/sbin/openvpn /usr/local/sbin/openvpn
mv /usr/bin/rxupdate.sh /usr/rx30
mv /usr/bin/rxutils.sh /usr/rx30
mv /usr/bin/rbld.sh /usr/rx30
mv /usr/bin/rx30dcs.dcr /usr/rx30
mv /usr/bin/browser.sh /usr/rx30
mv /usr/bin/tdsinstall.gui /usr/rx30
mv /usr/bin/getlogs.sh /usr/rx30
rm /usr/rx30/.kde/share/apps/konsole/Shell.profile
mv /usr/share/konsole/Shell.profile /usr/rx30/.kde/share/apps/konsole
mv /usr/share/konsole/Ansi.profile /usr/rx30/.kde/share/apps/konsole
mv /usr/share/konsole/Scoansi.profile /usr/rx30/.kde/share/apps/konsole

# Creating rx30 user and fixing permissions

echo "rx30:\$1\$7czGzB77\$UYXB/n5VuwAYdDEn8fdz7.:13472:0:99999:7:::" >> /etc/shadow
echo -e "rx30:x:502:505:Rx30 Pharmacy System:/usr/rx30:/bin/bash" >> /etc/passwd
chown -R rx30:group /usr/rx30
cp /etc/skel/.bash_profile /usr/rx30
cp /etc/skel/.bashrc /usr/rx30
chown -R rx30:group /usr/rx30/.bash_profile /usr/rx30/excludes.conf /usr/rx30/.bashrc /usr/rx30/.kde /usr/rx30
chmod -R 775 /usr/rx30/.bash_profile /usr/rx30/excludes.conf /usr/rx30/.kde

if [ '!' -e /usr/rx30/prt2dsk ]
then cp -p /usr/bin/prt2dsk /usr/rx30
cp -p /usr/bin/prt2dsk.cnf /usr/rx30
chown rx30:group /usr/rx30/prt2dsk*
fi
# Make mount directories
mkdir /mnt/dvd /mnt/cdrom /mnt/floppy /mnt/usb
# adding mount point for usb backup stick with vol label
echo "LABEL=rx30usbbackup /mnt/usb ext3 user,rw,noauto 0 0" >>/etc/fstab

# Copy ltsp related stuff into place
#cp /opt/extras/rx30ltsp/Xsetup_workstation /etc/X11/xdm
#cp /opt/extras/rx30ltsp/rx30ltsp.jpg /etc/X11/xdm
#cp /opt/extras/rx30ltsp/kbd_mode /opt/ltsp/i386/bin
cp -R /opt/ltsp/i386/etc/sane.d /etc
mkdir -p /var/opt/ltsp/swapfiles

# copy luxi fonts into rx30
# seems to be the only fonts that work with gui rx30
cp /opt/ltsp/i386/usr/X11R6/lib/X11/fonts/TTF/* /usr/share/X11/fonts/TTF/

# Turn services on for filtering and jammins and misc networking

chkconfig --add ipfilter
chkconfig --add postfix
chkconfig dhcpd on
chkconfig nfs on
chkconfig vsftpd on
chkconfig ntpd on
chkconfig smb on
chkconfig xfs on
#Turn off System monitoring

chkconfig mdmonitor off
rm -rf /etc/cron.daily/0logwatch
chkconfig swatch off
#chkconfig swatch on

# Turn off un-needed services

chkconfig gpm off
chkconfig sendmail off
chkconfig smartd off
chkconfig hplip off
chkconfig nasd off
chkconfig iptables off
chkconfig ip6tables off
chkconfig postfix off
chkconfig NetworkManager off
# Change file modes for Misc RX30 purposes.

ln -s /usr/bin/xauth /usr/X11R6/xauth
chmod +x /usr/rx30/Desktop/RX30.desktop
chmod 4555 /usr/sbin/pppd
chown rx30 /etc/ppp/chap-*
chown rx30 /etc/ppp/pap-*
chmod -R 777 /etc/ppp
chmod -R 775 /usr/rx30
chmod 775 /usr/rx30/.bashrc
chown root /sbin/uugetty
chgrp root /sbin/uugetty
chmod 755 /sbin/uugetty
chmod 440 /etc/sudoers
chmod 700 /usr/bin/tdsconfig
cp /bin/ll_instl /usr/rx30
chown rx30 /usr/rx30/ll_instl
chmod 6711 /bin/ll_instl
chmod 6711 /bin/ll_tcpd
# location of dhcpd.conf changed in CentOS 6
mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig
ln -s /etc/dhcpd.conf /etc/dhcp/dhcpd.conf
ln -s /tftpboot/* /var/lib/tftpboot/
%end[/code]

again thanks for the help and guidance.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: HOWTO create a LiveDVD/USB from a custom build of CentOS 6.2

Post by pschaff » 2012/03/25 10:39:50

Again, too much for me to analyze. It just occurred to me that I forgot to mention [url=http://revisor.fedoraunity.org/]Fedora Revisor[/url]. [url=http://www.scientificlinux.org/download/]Scientific Linux[/url] packages it. CentOS does not.

AndrewSerk
Posts: 60
Joined: 2010/11/21 03:41:16

Re: HOWTO create a LiveDVD/USB from a custom build of CentOS 6.2

Post by AndrewSerk » 2012/03/26 13:42:02

Hi lleb,
There seems to be a few things in you .ks that are for a .ks install not a livecd/DVD that may be causing the issues you are seeing:
[code]# X Window System configuration information xconfig
--defaultdesktop=KDE
# Reboot after installation #reboot reboot --eject
# System timezone timezone America/New_York
# System bootloader configuration bootloader --location=mbr append vga=791
# Partition clearing information clearpart --all --initlabel
# Disk partitioning information part /boot --ondisk sda --fstype="ext3" --size=100 part / --ondisk sda --fstype="ext3" --grow --size=9000 part /usr/rx30 --ondisk sda --fstype="ext3" --grow --size=9000 --asprimary part swap --ondisk sda --fstype="swap" --recommended [/code]
I didn't go through the whole .ks line by line but the above lines may be causing the umount issue. There is normaly not any part info or defaultdesktop info ect. for a liveDVD/CD.

Hope this helps,

Andrew

AndrewSerk
Posts: 60
Joined: 2010/11/21 03:41:16

Re: HOWTO create a LiveDVD/USB from a custom build of CentOS 6.2

Post by AndrewSerk » 2012/03/26 13:54:55

I missspoke about there not being any part info. There usually is part info but not in the format you have used.
Normaly you will see something like:
[code]part / --size 4096 --fstype ext4[/code]
for a livecd. Change the size if needed to a DVD:
[code]part / --size 8192 --fstype ext4[/code]

Hope this helps

Post Reply