LTS

    Innovation Version

      Using kickstart for Automatic Installation

      Introduction

      Overview

      You can use the kickstart tool to automatically install the openEuler OS in either of the following ways:

      • Semi-automatic installation: You only need to specify the location of the kickstart file. kickstart automatically configures OS properties such as keyboard, language, and partitions.
      • Automatic installation: The OS is automatically installed.

      Advantages and Disadvantages

      Table 1 lists the advantages and disadvantages of semi-automatic installation and full-automatic installation using kickstart. You can select an installation mode as required.

      Table 1 Advantages and disadvantages

      Installation Mode

      Advantage

      Disadvantage

      Semi-automatic installation

      Services such as TFTP, PXE, and DHCP do not need to be prepared.

      You need to manually specify the path of the kickstart file.

      Full-automatic installation

      The OS is installed automatically.

      Services, such as TFTP, DHCP, and PXE, need to be configured.

      Background

      kickstart

      kickstart is an unattended installation mode. kickstart records typical parameters that need to be manually entered during the installation and generates the configuration file ks.cfg. During the installation, the installation program searches for the ks.cfg configuration file first for required parameters. If no matching parameters are found, you need to manually configure these parameters. If all required parameters are covered by the kickstart file, automatic installation can be achieved by specifying only the path of the kickstart file.

      kickstart can be used for both full-automatic and semi-automatic installation.

      PXE

      Preboot eXecution Environment (PXE)) works in client/server network mode. The PXE client can obtain an IP address from the DHCP server during the startup and implement client boot and installation through the network based on protocols such as trivial file transfer protocol (TFTP).

      TFTP

      TFTP is used to transfer simple and trivial files between clients and the server.

      Semi-automatic Installation Guide

      Environment Requirements

      The environment requirements for semi-automatic installation of openEuler using kickstart are as follows:

      • Physical or virtual machines (for details about how to create VMs, see the documents from corresponding vendors), including the machine where kickstart is used for automatic installation and the machine where the openEuler will be installed.
      • httpd: stores the kickstart file.
      • ISO image: openEuler-20.03-LTS-aarch64-dvd.iso

      Procedure

      To use kickstart to perform semi-automatic installation of openEuler, perform the following steps:

      Environment Preparation

      NOTE:
      Before the installation, ensure that the firewall of the HTTP server is disabled. Run the following command to disable the firewall:

      iptables -F  
      
      1. Install and start the httpd service.

        # dnf install httpd -y
        # systemctl start httpd
        # systemctl enable httpd
        
      2. Run the following commands to prepare the kickstart file:

        # mkdir /var/www/html/ks
        #vim /var/www/html/ks/openEuler-ks.cfg ===>The file can be obtained by modifying the anaconda-ks.cfg file automatically generated on openEuler, or can be created using the system-config-kickstart tool.
        ====================================
        ***Modify the following information as required.***
        #version=DEVEL
        ignoredisk --only-use=sda
        autopart --type=lvm
        # Partition clearing information
        clearpart --none --initlabel
        # Use graphical install
        graphical
        # Use CDROM installation media
        cdrom
        # Keyboard layouts
        keyboard --vckeymap=cn --xlayouts='cn'
        # System language
        lang zh_CN.UTF-8
        
        # Network information
        network  --bootproto=dhcp --device=enp4s0 --ipv6=auto --activate
        network  --hostname=openeuler.com
        # Root password
        rootpw --iscrypted $6$fQE83lxEZ48Or4zc$j7/PlUMHn29yTjCD4Fi44WTZL/RzVGxJ/7MGsZMl6QfE3KjIVT7M4UrhFXbafvRq2lUddAFcyWHd5WRmXfEK20
        # Run the Setup Agent on first boot
        firstboot --enable
        # Do not configure the X Window System
        skipx
        # System services
        services --disabled="chronyd"
        # System timezone
        timezone Asia/Shanghai --isUtc--nontp
        
        %packages
        @^minimal-environment
        @standard
        
        %end
        
        %anaconda
        pwpolicy root --minlen=8 --minquality=1 --notstrict --nochanges --notempty
        pwpolicy user --minlen=8 --minquality=1 --notstrict --nochanges --emptyok
        pwpolicy luks --minlen=8 --minquality=1 --notstrict --nochanges --notempty
        %end
        
        %post
        #enable kdump
        sed  -i "s/ ro / ro crashkernel=1024M,high /" /boot/efi/EFI/openEuler/grub.cfg
        %end
        =====================================
        

        NOTE:
        The method of generating the encrypted password is as follows:
        # python3
        Python 3.7.0 (default, Apr 1 2019, 00:00:00)
        [GCC 7.3.0] on linux
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import crypt
        >>> passwd = crypt.crypt("myPasswd")
        >>> print(passwd)
        $6$63c4tDmQGn5SDayV$mZoZC4pa9Jdt6/ALgaaDq6mIExiOO2EjzomB.Rf6V1BkEMJDcMddZeGdp17cMyc9l9ML9ldthytBEPVcnboR/0

      3. Mount the ISO image file to the CD-ROM drive of the machine where openEuler is to be installed.

        If you want to install openEuler through the NFS, specify the path (which is cdrom by default) of installation source in the kickstart file.

      Installing the System

      1. Boot the system and enter the installation option page.

        1. On the installation wizard page in Starting the Installation, select Install openEuler 20.03 LTS and press e.

        2. Add inst.ks=http://server_ip/ks/openEuler-ks.cfg to the boot parameters.

        3. Press Ctrl+x to start the automatic installation.

      2. Verify the installation.

        After the installation is complete, the system automatically reboots. If the first boot option of the system is set to the CD-ROM, the installation page will be displayed again. In this case, shut down the machine and change boot sequence to boot the system from the hard drive preferentially.

      Full-automatic Installation Guide

      Environment Requirements

      The environment requirements for full-automatic installation of openEuler using kickstart are as follows:

      • Physical or virtual machines (for details about how to create VMs, see the documents from corresponding vendors), including the machine where kickstart is used for automatic installation and the machine where openEuler will be installed.
      • httpd: stores the kickstart file.
      • tftp: provides vmlinuz and initrd files.
      • DHCPD/PXE: provides the DHCP service.
      • ISO image: openEuler-20.03-LTS-aarch64-dvd.iso

      Procedure

      To use kickstart to perform full-automatic installation of openEuler, perform the following steps:

      Environment Preparation

      NOTE:
      Before the installation, ensure that the firewall of the HTTP server is disabled. Run the following command to disable the firewall:

      iptables -F  
      
      1. Install and start the httpd service.

        # dnf install httpd -y
        # systemctl start httpd
        # systemctl enable httpd
        
      2. Install and configure tftp.

        # dnf install tftp-server -y
        # vim /etc/xinetd.d/tftp
        service tftp
        {
        socket_type = dgram
        protocol = udp
        wait = yes
        user = root
        server = /usr/sbin/in.tftpd
        server_args = -s /var/lib/tftpboot
        disable = no
        per_source = 11
        cps = 100 2
        flags = IPv4
        }
        # systemctl start tftp
        # systemctl enable tftp
        # systemctl start xinetd
        # systemctl status xinetd
        # systemctl enable xinetd
        
      3. Prepare the installation source:

        # mount openEuler-20.03-LTS-aarch64-dvd.iso /mnt
        # cp -r /mnt/* /var/www/html/openEuler/
        
      4. Set and modify the kickstart configuration file openEuler-ks.cfg. Select the HTTP installation source by referring to 3.

        #vim  /var/www/html/ks/openEuler-ks.cfg
        ====================================
        ***Modify the following information as required.***
        #version=DEVEL
        ignoredisk --only-use=sda
        autopart --type=lvm
        # Partition clearing information
        clearpart --none --initlabel
        # Use graphical install
        graphical
        # Keyboard layouts
        keyboard --vckeymap=cn --xlayouts='cn'
        # System language
        lang zh_CN.UTF-8
        #Use http installation source
        url  --url=//192.168.122.1/openEuler/
        %post
        #enable kdump
        sed  -i "s/ ro / ro crashkernel=1024M,high /" /boot/efi/EFI/openEuler/grub.cfg
        %end
        ...
        
      5. Modify the PXE configuration file grub.cfg as follows:

        # cp -r /mnt/images/pxeboot/* /var/lib/tftpboot/
        # cp /mnt/EFI/BOOT/grubaa64.efi /var/lib/tftpboot/
        # cp /mnt/EFI/BOOT/grub.cfg /var/lib/tftpboot/
        # ls /var/lib/tftpboot/
        grubaa64.efi  grub.cfg  initrd.img  TRANS.TBL  vmlinuz
        # vim /var/lib/tftpboot/grub.cfg
        set default="1"
        
        function load_video {
          if [ x$feature_all_video_module = xy ]; then
            insmod all_video
          else
            insmod efi_gop
            insmod efi_uga
            insmod ieee1275_fb
            insmod vbe
            insmod vga
            insmod video_bochs
            insmod video_cirrus
          fi
        }
        
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        
        set timeout=60
        
        
        ### BEGIN /etc/grub.d/10_linux ###
        menuentry 'Install openEuler 20.03 LTS' --class red --class gnu-linux --class gnu --class os {
                set root=(tftp,192.168.1.1)
                linux /vmlinuz ro inst.geoloc=0 console=ttyAMA0 console=tty0 rd.iscsi.waitnet=0 inst.ks=http://192.168.122.1/ks/openEuler-ks.cfg
                initrd /initrd.img
        }
        
      6. Run the following commands to configure DHCP (or use dnsmasq instead):

        # dnf install dhcp -y
        #
        # DHCP Server Configuration file.
        #   see /usr/share/doc/dhcp-server/dhcpd.conf.example
        #   see dhcpd.conf(5) man page
        #
        # vim /etc/dhcp/dhcpd.conf
        ddns-update-style interim;
        ignore client-updates;
        filename "grubaa64.efi";  #  Location of the pxelinux startup file;
        next-server 192.168.122.1;     # (IMPORTANT) TFTP server IP address;
        subnet 192.168.122.0 netmask 255.255.255.0 {
        option routers 192.168.111.1; # Gateway address
        option subnet-mask 255.255.255.0; # Subnet mask
        range dynamic-bootp 192.168.122.50 192.168.122.200; # Dynamic IP address range
        default-lease-time 21600;
        max-lease-time 43200;
        }
        # systemctl start dhcpd
        # systemctl enable dhcpd
        

      Installing the System

      1. On the Start boot option screen, press F2 to boot from the PXE and start automatic installation.

      2. The automatic installation window is displayed.

      3. Verify the installation.

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份