Fedora Linux Support Community & Resources Center
  #1  
Old 22nd April 2010, 04:03 PM
savagehobo Offline
Registered User
 
Join Date: Mar 2008
Posts: 34
linuxfedorafirefox
kickstart config background and scrip

Hello,

I have been working on a school project to create a customized Fedora distrobution to boot up broken windows computers at school. I have been working on a kickstart file and have been creating images with the livecdcreator. The issue right now is that I'm trying to setup a custom background, and that a scrip I've been placing on the desktop is having the '$password" parsed out. The ks script is shown below, any suggestiongs would be helpful.

Code:
%include fedora-live-base.ks
selinux --disabled

%packages
#Don't need games
#@games
@graphical-internet
@sound-and-video
@gnome-desktop
nss-mdns
NetworkManager-vpnc
NetworkManager-openvpn
# we don't include @office so that we don't get OOo.  but some nice bits
abiword
cheese

# avoid weird case where we pull in more festival stuff than we need
festival
festvox-slt-arctic-hts

# dictionaries are big
-aspell-*
-hunspell-*
-man-pages*
-words

# save some space
-gnome-user-docs
-evolution-help
-gnome-games-help
-nss_db
-isdn4k-utils
-dasher
-evince-dvi
-evince-djvu
-desktop-backgrounds-basic
-constantine-backgrounds-extras

# these pull in excessive dependencies
-ekiga
-tomboy

#Extra Tools
smartmontools
#gsmartcontrol
testdisk
lshw
lshw-gui
gparted
emacs
clamav
clamav-update
telnet

#Fix for SELINUX Disabled
/usr/sbin/lokkit

%end

%post
cat >> /etc/rc.d/init.d/livesys << EOF
# 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
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/gnome/lockdown/disable_lock_screen true >/dev/null

# set up timed auto-login for after 60 seconds
cat >> /etc/gdm/custom.conf << FOE
[daemon]
TimedLoginEnable=true
TimedLogin=root
TimedLoginDelay=2
FOE

# Add Desktop icon for gparted
mkdir /root/Desktop
cp /usr/share/applications/fedora-gparted.desktop /root/Desktop
chown root:root /root/Desktop/fedora-gparted.desktop



# Add Bowser Mount Script
#raw
touch /root/Desktop/mount_bowser.sh
cat >> /root/Desktop/mount_bowser.sh << FOE
mkdir /mnt/Bowser
echo "Mounting Bowser at /mnt/Bowser.  Please enter the Helpdesk password:"

stty -echo
read passwd
stty echo

sudo mount -t cifs //192.168.1.1/backup /mnt/Bowser -o username=helpdesk,password=\$passwd
FOE
#endraw
chmod a+x /root/Desktop/mount_bowser.sh

# Add Bowser UnMount Script
touch /root/Desktop/unmount_bowser.sh
cat >> /root/Desktop/unmount_bowser.sh << FOE
umount /mnt/Bowser
FOE
chmod a+x /root/Desktop/unmount_bowser.sh

# Add PhotoRec Icon
touch /root/Desktop/PhotoRec.desktop
cat >> /root/Desktop/PhotoRec.desktop << FOE
#!/usr/bin/env xdg-open

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
Name[en_US]=PhotoRec
Exec=/usr/sbin/photorec
Comment[en_US]=PhotoRec
Icon[en_US]=/usr/share/icons/hicolor/48x48/apps/gdu-unmountable.png
Name=PhotoRec
Comment=PhotoRec
Icon=/usr/share/icons/hicolor/48x48/apps/gdu-unmountable.png
FOE
chmod a+x /root/Desktop/PhotoRec.desktop

# But not trash and home
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/trash_icon_visible false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/home_icon_visible false >/dev/null

# Turn off PackageKit-command-not-found while uninstalled
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf

# setup cntrl-shift-enter for terminal
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /apps/metacity/global_keybindings/run_command_terminal '<Shift><Control>Return' >/dev/null

# Nautilus Browser Stuff
gconftool-2 -t bool -s /apps/nautilus/preferences/always_use_browser true

# Remove liveinst from Desktop
rm /root/Desktop/liveinst.desktop > /dev/null

# Setup Default Background
gconftool-2 --type string --set /desktop/gnome/background/picture_filename /usr/share/backgrounds/1280-wide.png > /dev/null

EOF

%end

%post --nochroot
mkdir -p $LIVE_ROOT/usr/share/backgrounds
cp /1280-wide.png $LIVE_ROOT/usr/share/backgrounds
%end


---------- Post added at 08:03 AM CDT ---------- Previous post was at 07:58 AM CDT ----------

Just to clairify the script that has the $password part parsed out is:

# Add Bowser Mount Script
#raw
touch /root/Desktop/mount_bowser.sh
cat >> /root/Desktop/mount_bowser.sh << FOE
mkdir /mnt/Bowser
echo "Mounting Bowser at /mnt/Bowser. Please enter the Helpdesk password:"

stty -echo
read passwd
stty echo

sudo mount -t cifs //192.168.1.1/backup /mnt/Bowser -o username=helpdesk,password=\$passwd
FOE
#endraw
chmod a+x /root/Desktop/mount_bowser.sh






and I am trying to move 1280-wide.png from the root directory on my laptop to the /usr/share/backgrounds on the live system with the lines:

%post --nochroot
mkdir -p $LIVE_ROOT/usr/share/backgrounds
cp /1280-wide.png $LIVE_ROOT/usr/share/backgrounds
%end
Reply With Quote
  #2  
Old 26th April 2010, 10:44 PM
savagehobo Offline
Registered User
 
Join Date: Mar 2008
Posts: 34
linuxfedorafirefox
Re: kickstart config background and scrip

As it turns out I was able to get this to work by moving the "%post --nochroot" part above the regular "%post". I also copied to a new directory and then from that directory into the final locations rather than directly into the /usr/share/backgrounds folder.

Code:
...
%post --nochroot

mkdir $INSTALL_ROOT/usr/share/extrastuff
cp /usr/share/backgrounds/1280-wide.png $INSTALL_ROOT/usr/share/extrastuff/
cp /root/Desktop/mount.sh $INSTALL_ROOT/usr/share/extrastuff/

%end

%post
...

%end
Reply With Quote
Reply

Tags
kickstart, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC5 system-config-kickstart ashleyCV8 EOL (End Of Life) Versions 0 27th October 2006 07:57 AM
system-config-kickstart FC5 will not run Luniz2k1 Using Fedora 0 14th October 2006 12:11 AM
use system-config-kickstart from FC2 for FC1 JJS EOL (End Of Life) Versions 0 9th June 2004 11:21 AM


Current GMT-time: 12:12 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat