Bonjour à tous,
Je cherche à créer un cd de boot pour une installation simplifier de nombreux serveurs.
Voici mon fichier ks.cfg
- je souhaite créer automatiquement un user via
- je souhaite que l'install me questionne pour la config rezo. mais rien à faire aucun message malgrès le network --device eth0 --bootproto query
Voila je vous remercie d'avance pour vos conseils et aides.
Je cherche à créer un cd de boot pour une installation simplifier de nombreux serveurs.
Voici mon fichier ks.cfg
# System language
lang fr_FR
# Language modules to install
langsupport fr_FR
# System keyboard
keyboard fr-latin1
# System mouse
mouse
# Sytem timezone
timezone Europe/Paris
# Root password
rootpw --iscrypted XXXXX
# Reboot after installation
reboot
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr yes
# Partition clearing information
clearpart --linux --initlabel
# Disk partitioning information
part swap --size 550
part / --fstype ext3 --size 1 --grow
# System authorization infomation
auth --useshadow --enablemd5
# Network information
network --device eth0 --bootproto query
#network --device eth1 --bootproto query
# Firewall configuration
firewall --disabled
# SELinux configuration
selinux --disabled
# XWindows configuration information
xconfig --depth=32 --resolution=1280x1024 --defaultdesktop=GNOME --startxonboot
# Package install information
%packages
@ base-x
@ graphical-internet
@ server-cfg
@ gnome-desktop
@ web-server
@ dns-server
@ network-server
@ admin-tools
chillispot
numlockx
ntp
%pre
get() {
grep $1 /tmp/netinfo |cut -d'=' -f2
}
device=`get DEVICE`
ip=`get IPADDR`
netmask=`get NETMASK`
host=`get HOSTNAME`
gateway=`get GATEWAY`
nameserver=`grep nameserver /etc/resolv.conf`
line="network --bootproto static --device $device --ip $ip --netmask $netmask --hostname $host --gateway $gateway --$nameserver"
ks="/tmp/ks.cfg"
sed -e "/^network/s/^network.*/$line/" $ks >${ks}.tmp && mv ${ks}.tmp
$ks
%post
/usr/sbin/useradd sofibra
chfn -f 'Didier CAROFF' sofibra
/usr/sbin/usermod -p 'xxxx' sofibra
echo "Hey dude, this is an example of a post install command using echo."
echo "You probably won't be able to see it though if perl isn't executed."
# Modify nameserver
echo "nameserver 10.0.1.10" >> /etc/resolv.conf
echo "10.0.1.10 server.local server" >> /etc/resolv.conf
# Serveur de temps
/usr/sbin/ntpdate -su ntp.univ-lyon1.fr ntp.imag.fr
Donc le cd boot sans problème mais je coince sur plusieurs points, à savoir :- je souhaite créer automatiquement un user via
/usr/sbin/useradd sofibra
chfn -f 'Didier CAROFF' sofibra
/usr/sbin/usermod -p 'xxxx' sofibra
dans le %post mais cela ne marche pas.- je souhaite que l'install me questionne pour la config rezo. mais rien à faire aucun message malgrès le network --device eth0 --bootproto query
Voila je vous remercie d'avance pour vos conseils et aides.