Manual network configuration in a Kickstart install

shay1197

New Member
Joined
Mar 30, 2021
Messages
1
Reaction score
0
Credits
21
Hi Everyone,
I am trying to configure manual network in the middle of the installion with kickstart.
so I found script to do it-
%include /mnt/sysimage/root/ks-pre.ks
%pre
exec < /dev/tty6 > /dev/tty6
chvt 6
clear
NETWORK_INTERFACES=$(ls /sys/class/net)
for NET in $NETWORK_INTERFACES; do
# skip loopback interface
if [ "$NET" = "lo" ]; then
continue
fi
echo "======= Configuring for $NET ======="
echo -n "Do you want to configure this interface? [y/n] "
read YN
if [ "$YN" != "y" ]; then
continue
fi
echo -n "Configure as static (default is DHCP)? [y/n] "
read YN
if [ "$YN" = "y" ]; then
read -p "Enter hostname: " HOSTNAME
read -p "Enter IP address: " IP_ADDR
read -p "Enter netmask: " NETMASK
read -p "Enter getway: " GATEWAY
read -p "Enter nameserver: " DNS
echo "network --bootproto=static --ip=$IP_ADDR --netmask=$NETMASK --device=$NET --gateway=$GATEWAY --nameserver=$DNS --hostname=$HOSTNAME" >> /mnt/sysimage/root/ks-pre.log
else
echo "network --bootproto=dhcp --device=$NET --hostname=$HOSTNAME" >> /mnt/sysimage/root/ks-pre.ks
fi
done
##Go back to tty1##
exec < /dev/tty1 > /dev/tty1
chvt 1
################################################

But I am getting this message (You see it on the pic)
Capture.PNG


How can I resolve it?

Thanks,
Shay
 


G'day @shay1197 and welcome to linux.org :)

Your question is lacking in some key information, so after this, you might want to read this

https://linuxtips.gq/2021/01/19/how-to-ask-a-good-support-question/

Specifically,

  1. Kickstart is a Redhat product - are you using Redhat, CentOS, Fedora, or other, and if so which version?
  2. Where did you download Kickstart from and what was the name of the download? The error message you got refers to a path which translates to "/tmp/packages_conf", from French
  3. so I found script to do it-
    Can you tell us where from?
  4. Did you do any Googling? I searched under "linux /tmp/paquets_conf" and straight away found this page - https://doc.ubuntu-fr.org/kickstart and Google gave me the opportunity to translate the page, but if you do so, be aware that the syntax of commands needs to be carefully looked at.
I myself do not know enough about Kickstart to assist, but subject to your answers, I will move this to Command Line, where scripting inquiries are better dealt with.

I will also ask @dos2unix (Kickstart experience) and @JasKinasis (scripting) to keep an eye on this Thread (going to Command Line, likely) in case they can assist.

HTH

Chris Turner
wizardfromoz
 
Can you share the ks-pre.ks file which all the output gets written to, so /mnt/sysimage/root/ks-pre.ks? I would think though that somewhere in ks-pre.ks "%include /tmp/paquets_conf" is defined and because it that file doesn't exists the script fails. Looking at the French documentation @wizardfromoz shared that file should exists and it should contain all the packages you want installed during your Kickstart installation. Guessing paquets is French for packages, so you need to make sure that file exists and had a list of packages so that Kickstart can process it. Talking about this part:
Code:
# Installation eds paquets supplémentaires
%packages --resolvedeps
%include /tmp/paquets_conf
Later on in the Kickstart file the /tmp/paquets_conf is defined.
Code:
# Configuration des paquets à installer
if [ "$distrib" == "xubuntu" ]; then
    cat > /tmp/paquets_conf << eof
        @ xubuntu-desktop
        bsd-mailx
        cups-pdf
        icedtea6-plugin
        ntp
        numlockx
        ocsinventory-agent
        openoffice.org
        smbfs
        ssh
        ssmtp
        #ttf-mscorefonts-installer
        vino
    eof
else
    cat > /tmp/paquets_conf << eof
        @ ubuntu-desktop
        bsd-mailx
        cups-pdf
        icedtea6-plugin
        ntp
        ocsinventory-agent
        smbfs
        ssh
        ssmtp
        thunderbird-locale-fr
        #ttf-mscorefonts-installer
    eof
fi
So somewhere in your pre-ks you will something similar, you could probably change that part to something like this since expecting you to only be wanting to use it for one system?
Code:
cat > /tmp/paquets_conf << eof
        @ ubuntu-desktop
        bsd-mailx
        cups-pdf
        icedtea6-plugin
        ntp
        ocsinventory-agent
        smbfs
        ssh
        ssmtp
        thunderbird-locale-fr
        #ttf-mscorefonts-installer
    eof
Replacing the package names with the ones you want, the top one is a package group name. Lastly the part where the file with the list of packages is defined will have probably come before where it is included and you can give it a different name instead of the French name. So it would look something like this and in this order.
Code:
cat > /tmp/packages.txt << eof
        @ ubuntu-desktop
       firefox
       thunderbird
       pidgin
       steam
       chrony
       ssh
       postfix
    eof
# Install packages listed in file
%packages --resolvedeps
%include /tmp/packages.txt
 
Last edited:

Members online


Top