Candela Technologies Logo
Network Testing and Emulation Solutions

Install Script lf_kinstall.pl

Goal: Install and reconfigure your LANforge server with the lf_kinstall.pl script.

The lf_kinstall.pl script can configure a majority of Linux OS features that LANforge requires changes to. This includes:
  • Disabling SELinux
  • Disableing firewall
  • Downloading dnf and LANforce updates
  • Adding VNC and RDP access
  • Adding firmware
  • Disabling or reconfiguring NetworkManager
  • Enabling serial console
  • Modifying kernel options for iommu, pci-aer and kernel memory
  • ...and more...

Usage

lf_kinstall.pl --lfver {lanforge version} --kver {kernel version} {command}
Note: the parameters --do_kern and --do_grub requires the --kver option to specify the kernel version. Candelatech Linux kernels end with "+" to denote extra patches. Use --debug|--verbose|-d to enable debugging.
 Example: ./lf_kinstall.pl --kver 3.5.7+ --lfver 5.2.7 --do_lanforge

Parameters

lfver
Specify LANforge version (i.e., 5.2.6)
kver
Specify kernel version, use a + at the end of kernel versions for Candelatech kernels
skip_kern
Do not install a kernel package, suppresses do_grub, do_kern
hwver
Specify the hardware string: CT521, CT52x-PR, CT521, CT520, LF0202, CT523, CT523c, CT314, LF0312, LF0313, CT522 Can help with html info page configuration. Leave blank if unsure. lf2100_8x Specify adapter board used is the 8x internal splitter/combiner board, for do_sys_reconfig
com-speed
Specify serial com speed (defaults to 115200)
com_port
Specify the serial com port (defaults to ttyS0)
source_dir
Specify location of installation files (must be absolute path).
tmp_dir
Specify the script temporary working directory and backups of system files.
download_only
Download files to tmp-dir, but do not install them or make other changes.
ignore_err
Ignore any (otherwise fatal) errors. May be useful for offline installs where some functionality is better than none.
proxy
Use a proxy for curl, e.g. http://%user:%password@%proxy-ip:%port
do_all_ct
Enables all options except: --xrandr, --runlevel
do_all
Enables all options except: --xrandr, --biosdevname, --runlevel, and --serial Skips the CPU burn-in test.
do_upgrade
Upgrades LANforge software, kernel, firmware, packages and OS packages. No system settings altered. Skips cpu-burn.
do_update
alias for do_upgrade
do_ct_st
Download and install LANforge software and kernel only. Enables 'do_lanforge do_kern do_grub do_http do_selinux=0 do_iommu=0 do_firmware' No yum update. No system settings altered, except for selinux and iommu.
do_ct_swak
Download and install LANforge software but only update grub to point to an already installed kernel. Enables 'do_lanforge do_grub do_http do_selinux=0 do_iommu=0 do_firmware' No system settings altered, except for selinux and iommu.
do_lanforge
Installs LANforge software ONLY, i.e. no kernel installed. No system settings altered.
do_firmware
Download and install ath10k 802.11AC NIC firmware.
do_kern
Install the kernel via download or --source_dir. Enables 'do_grub' option.
do_radius
Install and configure radius server (with default values).
skip_radius
Do not attempt to reconfigure radius. Useful when attempting to speed up do_sys_reconfig on slow systems.
force_new_certs
Re-generate the HotSpot 2.0 R2 (HS20-R2) and/or RADIUS certs, even if we have previously created them.
do_hs20
Build keys, configure apache ssl and other actions to enable this system to act as an HS20-R2 server. Requires specific LANforge configuration as well before this will actually work. This option must be explicitly enabled: It is not enable as part of any of the other option groupings.
hs20_server_ip
IP Address to advertise as HS20 servers. This could be IP address of management port in simple configurations, and for more realistic configurations, perhaps the IP address of something in same network as the HS20 OSEN and .1x APs.
build_scrcpy
Clone and build scrcpy tool (should not be needed for latest 5.4.6 builds)
do_services
Enable/Disable services to work well with LANforge.
ntwk_mgr_ok
Enable NetworkManager. It is disabled by default.
do_pkgs
Install packages from Internet needed by LANforge.
show_large_pkgs
Show top 20 largest packages. Useful during do_image_prep if you want to reduce install footprint.
do_only_pkgs
Only install packages (and groups) and exit. Use when creating VMs or if you want to install all distro packages and reboot before proceeding. If you want to download everything needed, install yum packages for development imaging:
  1) touch /home/lanforge/did_cpuburn /home/lanforge/did_disktest
  2) ./lf_kinstall.pl --lfver ___ --kver ___ --do_selinux=0 --skip_yum_all
  3) ./lf_kinstall.pl --lfver ___ --kver ___ --skip_yum_all --do_all_ct --force_web \
--tmp_dir /home/lanforge/Downloads --download_from http://ctdownloads/ --download_only
  4) reboot
  5) ./lf_kinstall.pl --lfver ___ --kver ___ --do_only_pkgs
  6) poweroff and make your snapshot
do_yum_update
Update OS packages from Internet.
use_yum_cache
do not erase and rebuild yum cache
do_selinux
Configure selinux (it conflicts with LANforge.) do_grub should also be enabled to modify the kernel boot commands.
  0: Disabled (default, if do_all and related options are selected)
  1: Enabled
  -1: Use current settings
do_grub
Modify the grub config files to boot the specified kernel.
do_xrandr
Add work-around to disable LVDS1 using xrandr. This works around Gnome issues on the Lanner WiFi appliances, and perhaps other systems.
do_vnc
Configure VNC for user lanforge.
do_http
Serve LANforge related files at http://localhost
do_gnome
Tweak gnome settings (enble desktop icons, etc)
do_udev
Create /etc/udev/rules.d/70-persistent-net.rules file if it does not already exist. It may still need hand-editing.
do_biosdevname
Enable biosdevname for interface names (uses terms like enp0s1 instead of eth0). Only takes affect when --do_grub is enabled.
  0: Disabled
  1: Enabled
  -1: Use current settings (default)
do_serial
Enable serial console configuration in grub.
  0: Disabled
  1: Enabled
  -1: Use current settings (default) Only takes affect when do_grub is enabled.
do_runlevel
Configure system to run-level 3 or 5
  0: Use current settings (do nothing)
  3: Set to use runlevel 3 (non graphical login)
  5: Set to use runlevel 5 (graphical login, needed for cinnamon)
do_elevator
Add kernel option elevator=noop (i.e. not deadline) for single SSD CFQ optimisation.
  0: Disabled
  1: Enabled
  -1: Use current settings (default) Only takes affect when do_grub is enabled.
do_cma
Configure cma buffer for extra VRF buffer space. Use with --do_grub, applies on reboot. Use these choices:
  -1: do not change
  0: disable
  1: apply 64 megabyte value
  >1: apply this value in megabytes
 Example: --do_grub --do_cma 48
do_slub_debug
Enable/Disable SLUB memory debugging (at least on debugging kernels) Use with --do_grub, applies on reboot. Use these choices:
  -1: do not change
  0: disable
  1: enable slub debugging
 Example: --do_grub --do_slub_debug 1
do_iommu
Configure system to enable/disable intel_iommu. This kernel feature decreases performance, so LANforge typically wants this disabled for optimal Ethernet performance. This can also be disabled in the BIOS by disabling the VT-d option and IOMMU options.
  0: Disabled (default for do_all_ct, do_all, do_ct_swak, do_ct_st)
  1: Enabled
  -1: Use current settings (default) Only takes affect when do_grub is enabled. IOMMU is useful in these conditions: * virtual machine hosting * MediaTek radios * Ath10k radios
do_nomitigations
Configure system to enable/disable spectre and related mitigations. We try to compile out most of these security features since LANforge is not designed to be secure and performance is more important to us. To help make sure all of these mitigations are disabled, we will also pass command-line args to the kernel on bootup to request disabling mitigations. Default is '1'.
  0: Do not add the mitigations=off option
  1: Do add the mitigations=off (default)
  -1: Use current settings Only takes affect when do_grub is enabled.
set_swiotlb
Configure IOMMU buffer size. Requires you use IOMMU setting, so use with --do_grub --do_iommu=1
 Example: --do_grub --do_iommu=1 --set_swiotlb=65536
do_noaer
Configure system to enable/disable pci error reporting. Requires --do_grub.
  0: Disabled (removes grub bootline parameter)
  1: Enabled (adds pci=noaer bootline parameter, DEFAULT)
  -1: Use current settings
do_kmemleak
Configure kernel option for kmemleak. Requires kernel to be compiled with appropriate options to actually enable this.
  0: Disabled
  1: Enabled
  -1: Use current settings (default) Only takes affect when do_grub is enabled.
do_ssd_fstab
Modify rw behaviour for SSDs in /etc/fstab.
do_save_yumc
Specify:
  1: Yum update then save cache.
  20: Delete local cache first then update and save.
do_sys_reconfig
Attempt to re-configure system config files. Only works on certain platforms (APU2, Jetway, Noah2, Axiomtek)
do_vm_reconfig
forces --do_sys_reconfig to run, looking for enpX interfaces and no radios
skip_ifrename
avoids renaming interfaces and rewriting 70-persistent-net
do_ff_homepage
updates Firefox Homepage
do_mgt_dev
Set LANforge management interface, defaults to eth0 on most platforms. Does not presently use --mgt_dev option.
make_ifcfg_eth0
Creates /etc/sysconfig/network-scripts/ifcfg-eth0 from the eth0 entry found in /etc/udev/rules.d/70-persistent-net.rules. Fedora only. Edit 70-persistent first.
do_make_clean
Delete previous install files.
do_cpu_burn
Attemps the CPU burn task. NOTE: The --skip_cpu_burn flag below has precedence.
  0: Do not attempt it.
  1: Do it if we have not already run it on this system previously.
  2: Always run it.
  >10: Run CPU burn test for specified seconds.
do_disk_test
should we fill and re-read disk to make sure it performs well?
  0: Do not attempt it
  1: Do it if /home/lanforge/did_disktest not found unless --skip_disk_test specified
  >1: Always run it, ignoring --skip_disk_test
skip_disk_test
avoid do_disk_test if /home/lanforge/did_disktest is missing
do_xrdp
should we adjust the xrdp.ini and sesman.ini files:
  0: ignore files
  1: adjust files
nocache
Add fake URL argument to disable any HTTP caching.
no_fmirror
Uninstall yum-fastest mirror.
help
Show usage help.
show_urls
Show URLS for all files that should be downloaded, and exit.
print_only
show_urls without website check
print_windows
print out .bat file contents to help with downloading LANforge updates
force_web
Force script to use webserver. Do not use with --source_dir.
download_from
Specify web url to download LANforge packages from, implies --force_web
build_url
This path is appended directly after the --download_from hostname. The default download path will not be used. The string r$lfver will not be inserted. Build paths will not adhere to a directory pattern, use the full path.
create_install_bundle
create a tarball in tmp_dir for copying to another LANforge system, will infer --osver, --osveri for current system unless you specify --force_osver, --force_osveri
use_install_bundle
/path/to/bundle.tar : Upgrade LANforge using an install bundle file. Sets $source_dir, $tmp_dir to directory containing bundle.tar file.
force_notes
Force creating lfnotes.html
force_osver
Override the detected osver string with this value.
force_osveri
Override the detected osversion integer with this value.
skip_grub
Don't do kernel install, even if other options would have selected it.
skip_gui
Don't install LANforge-GUI, even if other options would have selected it.
skip_xorp
Don't install Xorp virtual-router package, even if other options would have selected it.
skip_fmirror
Don't alter systems existing use of yum-plugin-fastestmirror.
skip_cpu_burn
Don't burn-in CPU.
skip_yum_update
Don't yum update packages.
skip_yum_all
Don't yum update packages, or install new ones.
skip_resume
Don't try to use HTTP resume when downloading packages.
fix_web_root
Enable do_http and reset the httpd.conf DocumentRoot and Directory from /home/lanforge/candela_cdrom to /var/www/html
do_image_prep
Erase the network settings and dnf cache in preparation for making a disk image for a clone. Expects /root/resize-home.sh
do_vm_prep
Erase the network settings and dnf cache in preparation for making a OVA image. Expects /root/resize-home.sh
do_fedrepos_default
Select this option to use the fedrepos default command if your yum.repos.d repository URLs have become misconfigured. If fedrepos is not available, consider --do_restore_metalinks option.
do_restore_metalinks
Select this option if you see errors like below:
  1) Repository updates-debuginfo has no mirror or baseurl set.
  2) Repository updates-source has no mirror or baseurl set.
  3) Repository fedora-debuginfo has no mirror or baseurl set.
  4) Repository fedora-source has no mirror or baseurl set.
  5) Error: Failed to synchronize cache for repo 'updates'
  6) Your /etc/yum.repos.d repo files have had changes and are unable to reach mirrors.fedoraproject.org
do_enable_archive_baseurl
Select this option if your mirrors.fedoraproject.org URLs are unable to provide your repository because the content has been moved to archives.fedoraproject.org This option is pretty much opposite of --do_restore_metalinks.
add_random_www_data
creates a series of files in /var/www/html accessable using the url /slug_list.html
bind_apache_mgt_port
configures an /etc/hosts entry lanforge-srv that matches the ip address of the mgt_dev in /home/lanforge/config.values. Updates the /etc/httpd or /etc/apache2 files to bind to that address. Use this option each time you change the mgt_dev.
install_vlc
VLC video player requires RPMFusion repository. This adds the repository and then installs VLC.
download_videos
shortcut for downloading Candelatech videos into /var/www/html/videos so that they might be served for video testing. See /usr/local/lanforge/nginx/video.inc for stanza when enabling directory listings when using nginx.
do_rfgen
shortcut to install packages necessary for using RF generator hardware
do_abandoned_cleanup
create cronjob that espunges systemd slices from logged out session every hour
remove_passwords
removes the passwords from accounts root and lanforge and reconfigures sshd to accept empty passwords. Yes...really, it IS crazy, right?
do_print_label
Use the following two options to print a label with model and mac address information
  1) print_host: hostname owning printer
  2) print_queue: name of print queue, often 'QL-800' or 'LaserWriter-450'
  3) serialno: provide the serial number for chassis, or use 'HOSTNAME'
 Example: --do_print_label --print_host 192.168.100.14:8082 --print_queue QL-800 --serialno HOSTNAME
skip_installer_check
turn off checking md5sum of ./lf_kinstall.pl
regen_https_key
regenerate the /etc/pki/tls/$hostname.crt and .key files so that they have F33+ 4096 bit keys, not smaller keys.
update_pip
Upgrades pip userland
skip_pip
Avoid doing pip upgrades; might be necessary if you have proxies
reset_pip
Use when pip3 updates were installed as root and you have system pip3 package conflicts. This will reinstall the python-pip3 package and 'pip3 remove -r requirements.txt' to remove pip3 libraries from system folder. Follow this with --update_pip to get pip3 libraries into user lanforge folder.
rebuild_pip
this will uninstall the python pip user environments and build a new one from scripts/requirements.txt; if you see errors, you probably are missing newly required library packages provided by the distro. To make sure your packages are up to date, use:
 Example: ./lf_kinstall.pl --do_pkgs
install_pip_lanforge_scripts
this does a pip3 install of lanforge-scripts. This is not necessary if you just need to use /home/lanforge/scripts/py-scripts casually.
disable_audit_logs
Affects kernel audit messages. Use with --do_grub and reboot to have this setting take effect.
  0: enable kernel audit logs (auditd.service not enabled)
  1: disable kernel audit logs
do_enable_max_zram
write /etc/sysctl.d/70-lanforge.conf and apply agressive zram configuration (Fedora >= 30) To undo, remove file and reboot.
do_gui_autostart
Start GUI in VNC server session which starts on boot. Requires LANforgeGUI of specified version to already be installed.
  0: disable GUI autostart
  1: enable GUI autostart
save_gui_cfg
Use this to restore GUI settings on reboot. Running this a second time copies a changed LANforgeGUI/lfcfg.txt file to $home to save new changes.
  1) backup: copies the LANforgeGUI/lfcfg.txt file to $home. Disables lfcustom_gui.bash if it exists.
  2) static: implies backup, creates lfcustom_gui.bash that replaces lfcfg.txt into LANforgeGUI directory every time LANforgeServer is started.
remove_pipewire
Removes pulseaudio-pipewire packages.
  0: do not remove pipewire (default)
  1: remove pipewire
do_interop
installs LANforge server, GUI, firmware and required packages on system to sufficient to allow it to be a resource in a LANforge cluster. Right now, this focuses on Ubuntu based systems. This also will configure Networkmanager to ignore ports except the management interface. We cannot necessarily disable NM on interop equipment.
do_webui
installs and configures LANforge WebUI components. Fedora-34 and higher.
regen_nm_conf
backs up /etc/NetworkManager/NetworkManager.conf and recreates one that specifies that no interfaces except the one with the default route be managed. Enabled by default during do_interop. NM settings you do not want modified should live in separate conf files in /etc/NetworkManager/conf.d. When this option is used without the --mgt_dev option, a new management device will be determined. Default value is 1.
  0: do not modify NetworkManager.conf
  1: update NetworkManager.conf and mgt_dev.nmconnection
  2: update NetworkManager.conf, mgt_dev.nmconnection, but do not restart NetworkManager
mgt_dev
indicate what interface should be configured as the management interface. LANforge works best in cases where there is a dedicated management interface and management network (out of band management). In the case there is only one interface and it has to serve as a traffic port and a management port, that is possible (in band management). Currently this option is only used by the --regen_nm_conf option. If this option is not specified Specify one of these options:
  1) {interface_name}: name of the interface to set
  2) "existing": force the use of the mgt_dev in /home/lanforge/config.values
mgt_dns
specify IP address to add to [ipv4]mgt_dev.dns value in mgt_dev.nmconnection
mgt_ip
specify either "dhcp" or a "ip/cird/gateway" combination for mgt_dev.nmconnection:
  1) mgt_ip=dhcp
  2) mgt_ip=192.168.208.24/20/192.168.208.1
disable_resolved
change NetworkManager dns=systemd-resolved to dns=default and disable systemd-resolved.service
create_raid|make_raid|create_lvm|make_lvm : turn two or more blank drives into a mirrored LVM filesystem If there have been filesystems installed on these drives before, use --wipe_raid to remove the filesystems wipe_raid|remove_raid|remove_lvm : remove LVM volumes and signatures from specified disks. Use this before doing --create_raid the first time on any disk that already has a filesystem.
create_webpage
turn this help into html text for publication
do_release_mirror
for downloading install files necessary to host new releases on the system. These files are placed in /var/www/html/downloads and /var/www/html/private/downloads. In the GUI Release Mgr tab, Download From can list http://192.168.1.101 or whatever the mananagement port IP is. *_dd
Note: If you use commands "yum update" or "dnf update", and you need to use a kernel provided by the repository, use:
 Example: grub2-mkconfig -o /boot/grub2/grub.cfg

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog