Re: Anaconda Traceback when using %pre scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Apr 2008, Chris Lumens wrote:

> > Suddenly, the Anaconda installer gives me tracebacks when using %pre 
> > scripts. I can see the last part of the traceback:
> > 
> > File "/usr/lib/anaconda/kickstart.py", line 90, 
> >     os.chmod("%s" % messages, 0600)
> > 
> > OSError: [Errno 2] No such file or directory: 'False'
> 
> What does your kickstart file look like?

It's somewhat "odd": We have a base ks.cfg that is "customer configurable" 
and stable between upgrades. This file includes several other files which 
are more "internal". I'm attaching the files. 


Regards, 
---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.se
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00
repo --name=fedora  --baseurl=file:///import/mirrors/fedora/releases/8/Fedora/i386/os
repo --name=updates --baseurl=file:///import/mirrors/fedora/updates/8/i386
repo --name=TLCOS --baseurl=file:///tmp/TLCOS-repo

# DO NOT EDIT THIS FILE WITH NOTEPAD OR SIMILAR If there are CR/LF
# newlines in this file, as written by most windows editors,
# installation will not work.  The editor "metapad" is shipped with
# TLCOS on the CD, in the metapad subdirectory. Use "metapad" to edit
# this file from Windows, since metapad knows how to write correct
# newlines.

#
# Kickstart options section
#

# Installation source
cdrom
#url --url http://tlinstallhost/TLCOS
#nfs --server 10.47.255.35 --dir /export/TLCOS

# Keyboard and mouse
#keyboard us
#keyboard sv-latin1

# Language
#lang en_US.UTF-8
#lang sv_SE.UTF-8

# Remove this section to disable the disk erase confirm dialog
%pre 
/mnt/runtime/confirm-erase
%end

# Graphics card configuration
# The line below will try to autodetect your card
xconfig --startxonboot --resolution 1024x768 --depth 16 

# Misc
bootloader
network --bootproto dhcp --device=eth0
timezone --utc Europe/Stockholm


%include /mnt/runtime/base.cfg
%include /mnt/runtime/partitioning.cfg
%include /mnt/runtime/packages.cfg


#
# Postinstall section
#
%post --nochroot
cp /mnt/runtime/postinstall.sh /mnt/sysimage/tmp/postinstall.sh
%end

%post
source /tmp/postinstall.sh

# Set your server name and options here
# Example: configure_tlclient_args thinlinc.example.com
# If no server name is configured, the client will save the hostname of the
# last server it connected to. demo.thinlinc.com will be the default.
configure_tlclient_args 

# To activate sshd, uncomment the line below
#/sbin/chkconfig sshd on

# To activate NetworkManager, uncomment the line below
#/sbin/chkconfig NetworkManager on


%end
install 
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5
%pre --interpreter /usr/bin/python
import os
import subprocess
os.mkdir("/tmp/mnt")
for n in range(8):
    devletter = chr(ord("a") + n)
    dev = "/dev/sd%s" % devletter
    if subprocess.call(["mount", dev, "/tmp/mnt"]) == 0:
        if os.path.exists("/tmp/mnt/tlsplash.png"):
            f = os.open("/sys/block/sd%s/device/delete" % devletter, os.O_WRONLY)
            os.write(f, "1")
            os.close(f)
        subprocess.call("umount", "/tmp/mnt")
%end

zerombr
clearpart --all --initlabel
partition / --fstype ext3 --size=1000 --asprimary
partition swap --recommended
%packages --nobase
@core
@base-x
@hardware-support
kernel
openssh-server
openssh-clients
dhclient
cups
autofs
pcsc-lite
pcsc-lite-libs
numlockx
acpid
joe
NetworkManager-gnome
xfwm4
xfce4-panel
thinlinc-client
thinlinc-logos
-fedora-logos
-fedora-release-notes
-kernel-PAE
-kernel-debug
-kernel-PAE-debug
-kernel-doc
-kernel-xen
-kernel-xen-devel
-selinux-policy-targeted 
-setroubleshoot
-desktop-backgrounds-basic
-prelink
-krb5-auth-dialog
-smolt
-smolt-firstboot
-mesa-libGL
-glx-utils
-mesa-libGLU
-xorg-x11-utils
-gdm
-fedorainfinity-gdm-theme
-file
-file-libs
-vte
-rhgb
-policycoreutils-gui
-system-config-services
-xorg-x11-apps
-setserial
-gnome-keyring-pam

# Fonts
xorg-x11-fonts-ISO8859-1-100dpi
-baekmuk-ttf-fonts-gulim
-baekmuk-ttf-fonts-common
-cjkunifonts-uming
-sazanami-fonts-gothic
-lohit-fonts-tamil
-lohit-fonts-punjabi
-lohit-fonts-telugu
-lohit-fonts-bengali
-liberation-fonts
-jomolhari-fonts
-lohit-fonts-hindi
-lohit-fonts-gujarati
-lohit-fonts-oriya
-paktype-fonts
-kacst-fonts
-lohit-fonts-kannada
-bitmap-fonts
-dejavu-lgc-fonts
-xorg-x11-fonts-truetype

# Compose Needs
anaconda-runtime
#iscsi-initiator-utils
memtest86+
#vnc-server
%end
_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux