Linux Boot Server: Difference between revisions
| (15 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
'''Main boot server is clon01'''. | '''Main boot server is clon01'''. | ||
'''TO DO''' Check UBOOT commands to erase existing environment variables: | |||
env default -a -f | |||
env erase | |||
== '''VTP CentOS boot''' == | == '''VTP CentOS boot''' == | ||
UBOOT (example for gem0vtp | UBOOT (example for gem0vtp): | ||
Zynq> printenv | Zynq> printenv | ||
| Line 15: | Line 20: | ||
devicetree_load_address=0x2000000 | devicetree_load_address=0x2000000 | ||
ethact=ethernet@e000b000 | ethact=ethernet@e000b000 | ||
ethaddr=ce:ba:f0:03: | ethaddr=ce:ba:f0:03:xx:xx | ||
extargs=setenv bootargs ${bootargs} console=ttyPS0,115200 ip=:::::eth0:dhcp uio_pdrv_genirq.of_id=my-uio rootwait cma=384MB | extargs=setenv bootargs ${bootargs} console=ttyPS0,115200 ip=:::::eth0:dhcp uio_pdrv_genirq.of_id=my-uio rootwait cma=384MB | ||
fdt_high=0x20000000 | fdt_high=0x20000000 | ||
| Line 41: | Line 46: | ||
Environment size: 1603/131068 bytes | Environment size: 1603/131068 bytes | ||
Zynq> | Zynq> | ||
Copy-Paste following on uboot prompt to program above settings (do it by groups as shown, otherwise it may place some bull...): | |||
setenv bootargs | |||
setenv gatewayip | |||
setenv ipaddr | |||
setenv kernel_path | |||
setenv nfsip | |||
setenv nfsroot | |||
setenv sdboot | |||
setenv sdboot_no | |||
setenv setboot | |||
setenv tftpboot_no | |||
setenv autoload 'no' | |||
setenv baudrate '115200' | |||
setenv bootcmd 'run tftpboot' | |||
setenv bootdelay '3' | |||
setenv bootro 'setenv bootargs ${bootargs} ro' | |||
setenv bootrw 'setenv bootargs ${bootargs} rw' | |||
setenv devicetree_image 'devicetree.dtb' | |||
setenv devicetree_load_address '0x2000000' | |||
setenv ethact 'ethernet@e000b000' | |||
setenv ethaddr 'ce:ba:f0:03:00:d1' | |||
setenv extargs 'setenv bootargs ${bootargs} console=ttyPS0,115200 ip=:::::eth0:dhcp uio_pdrv_genirq.of_id=my-uio rootwait cma=384MB' | |||
setenv fdt_high '0x20000000' | |||
setenv fdtcontroladdr '3ffa9e30' | |||
setenv initrd_high '0x20000000' | |||
setenv kernel_image 'uImage-4.4.0-xilinx-00004-g8d932a' | |||
setenv kernel_load_address '0x2080000' | |||
setenv load_devicetree 'if tftpboot ${devicetree_load_address} ${tftppath}/${devicetree_image}; then echo OK; else echo FAILED; reset; fi;' | |||
setenv load_dhcp 'if dhcp; then echo OK; else echo FAILED; reset; fi;' | |||
setenv load_kernel 'if tftpboot ${kernel_load_address} ${tftppath}/${kernel_image}; then echo OK; else echo FAILED; reset; fi;' | |||
setenv modeboot 'sdboot' | |||
setenv netmask '255.255.255.0' | |||
setenv nfsargs 'setenv bootargs nfsroot=${rootserverip}:${rootpath},vers=3' | |||
setenv rootpath '/vol/diskless/CentOS7/armv7/root' | |||
setenv rootserverip '129.57.167.152' | |||
setenv serverip '129.57.167.4' | |||
setenv stderr 'serial@e0000000' | |||
setenv stdin 'serial@e0000000' | |||
setenv stdout 'serial@e0000000' | |||
setenv tftp_boot_string 'echo TFTPing Image to RAM' | |||
setenv tftpboot 'run load_dhcp tftp_boot_string nfsargs extargs bootro load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}' | |||
setenv tftpboot_rw 'dhcp && run tftp_boot_string nfsargs extargs bootrw load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}' | |||
setenv tftppath 'linux-install/CentOS7-armv7-Diskless' | |||
After that, customize following: | |||
ethaddr | |||
'''tftpboot server settings''' | '''tftpboot server settings''' | ||
| Line 201: | Line 259: | ||
'''Configuring snapshot area''' | '''Configuring snapshot area''' | ||
The list of files and directories which suppose to be in snapshot area (which has RW permissions) should be set in config file ''/diskless/.../ | The list of files and directories which suppose to be in snapshot area (which has RW permissions) should be set in config file ''/diskless/.../snapshot/files''. In particular, ''/et'' has to be added there, and also directory ''/diskless/.../root/et'' should be created. | ||
'''Reboot server, make sure everything is running as expected.''' | '''Reboot server, make sure everything is running as expected.''' | ||
== '''Configuring in chroot''' == | == '''Configuring in chroot''' == | ||
'''NOTE: using ''chroot'' method will allow to run ''yum'', but ''systemctl'' commands will not work. Instead of using ''chroot'', you may boot coontroller with ''rw'' option instead of ''ro''. For VME boot, it can be done by changing ''grub.cnf'', while for VTP boot you have to stop boot proocess using serial connection, and then type ''run tftpboot_rw''.''' | |||
Since root area in VME controllers will be read-only, you cannot ssh to controllers as root and change anything there, only snapshot area can be modified. To make changes in root area, in particular to configure and run ''yum'', ''chroot' command should be used. Login to the boot server as root and do following: | Since root area in VME controllers will be read-only, you cannot ssh to controllers as root and change anything there, only snapshot area can be modified. To make changes in root area, in particular to configure and run ''yum'', ''chroot' command should be used. Login to the boot server as root and do following: | ||
Latest revision as of 16:40, 3 February 2026
Main boot server is clon01.
TO DO Check UBOOT commands to erase existing environment variables:
env default -a -f env erase
VTP CentOS boot
UBOOT (example for gem0vtp):
Zynq> printenv
autoload=no
baudrate=115200
bootcmd=run tftpboot
bootdelay=3
bootro=setenv bootargs ${bootargs} ro
bootrw=setenv bootargs ${bootargs} rw
devicetree_image=devicetree.dtb
devicetree_load_address=0x2000000
ethact=ethernet@e000b000
ethaddr=ce:ba:f0:03:xx:xx
extargs=setenv bootargs ${bootargs} console=ttyPS0,115200 ip=:::::eth0:dhcp uio_pdrv_genirq.of_id=my-uio rootwait cma=384MB
fdt_high=0x20000000
fdtcontroladdr=3ffa9e30
initrd_high=0x20000000
kernel_image=uImage-4.4.0-xilinx-00004-g8d932a
kernel_load_address=0x2080000
load_devicetree=if tftpboot ${devicetree_load_address} ${tftppath}/${devicetree_image}; then echo OK; else echo FAILED; reset; fi;
load_dhcp=if dhcp; then echo OK; else echo FAILED; reset; fi;
load_kernel=if tftpboot ${kernel_load_address} ${tftppath}/${kernel_image}; then echo OK; else echo FAILED; reset; fi;
modeboot=sdboot
netmask=255.255.255.0
nfsargs=setenv bootargs nfsroot=${rootserverip}:${rootpath},vers=3
rootpath=/vol/diskless/CentOS7/armv7/root
rootserverip=129.57.167.152
serverip=129.57.167.4
stderr=serial@e0000000
stdin=serial@e0000000
stdout=serial@e0000000
tftp_boot_string=echo TFTPing Image to RAM
tftpboot=run load_dhcp tftp_boot_string nfsargs extargs bootro load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}
tftpboot_rw=dhcp && run tftp_boot_string nfsargs extargs bootrw load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}
tftppath=linux-install/CentOS7-armv7-Diskless
Environment size: 1603/131068 bytes
Zynq>
Copy-Paste following on uboot prompt to program above settings (do it by groups as shown, otherwise it may place some bull...):
setenv bootargs setenv gatewayip setenv ipaddr setenv kernel_path setenv nfsip setenv nfsroot setenv sdboot setenv sdboot_no setenv setboot setenv tftpboot_no
setenv autoload 'no'
setenv baudrate '115200'
setenv bootcmd 'run tftpboot'
setenv bootdelay '3'
setenv bootro 'setenv bootargs ${bootargs} ro'
setenv bootrw 'setenv bootargs ${bootargs} rw'
setenv devicetree_image 'devicetree.dtb'
setenv devicetree_load_address '0x2000000'
setenv ethact 'ethernet@e000b000'
setenv ethaddr 'ce:ba:f0:03:00:d1'
setenv extargs 'setenv bootargs ${bootargs} console=ttyPS0,115200 ip=:::::eth0:dhcp uio_pdrv_genirq.of_id=my-uio rootwait cma=384MB'
setenv fdt_high '0x20000000'
setenv fdtcontroladdr '3ffa9e30'
setenv initrd_high '0x20000000'
setenv kernel_image 'uImage-4.4.0-xilinx-00004-g8d932a'
setenv kernel_load_address '0x2080000'
setenv load_devicetree 'if tftpboot ${devicetree_load_address} ${tftppath}/${devicetree_image}; then echo OK; else echo FAILED; reset; fi;'
setenv load_dhcp 'if dhcp; then echo OK; else echo FAILED; reset; fi;'
setenv load_kernel 'if tftpboot ${kernel_load_address} ${tftppath}/${kernel_image}; then echo OK; else echo FAILED; reset; fi;'
setenv modeboot 'sdboot'
setenv netmask '255.255.255.0'
setenv nfsargs 'setenv bootargs nfsroot=${rootserverip}:${rootpath},vers=3'
setenv rootpath '/vol/diskless/CentOS7/armv7/root'
setenv rootserverip '129.57.167.152'
setenv serverip '129.57.167.4'
setenv stderr 'serial@e0000000'
setenv stdin 'serial@e0000000'
setenv stdout 'serial@e0000000'
setenv tftp_boot_string 'echo TFTPing Image to RAM'
setenv tftpboot 'run load_dhcp tftp_boot_string nfsargs extargs bootro load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}'
setenv tftpboot_rw 'dhcp && run tftp_boot_string nfsargs extargs bootrw load_kernel load_devicetree && bootm ${kernel_load_address} - ${devicetree_load_address}'
setenv tftppath 'linux-install/CentOS7-armv7-Diskless'
After that, customize following:
ethaddr
tftpboot server settings
/tftpboot/linux-install/CentOS7-armv7-Diskless/uImage-4.4.0-xilinx-00004-g8d932a
uImage-4.4.0-xilinx-00003-gdf4da5
zynq-jlab-vtp.dtb_fixed_uio
devicetree.dtb -> zynq-jlab-vtp.dtb_fixed_uio
By default, root filesystem will be read-only. To make it 'rw', stop booting process on serial connection, type run tftpboot_rw and push <enter>. After that you can ssh as root and run yum etc.
VTP Archlinux boot
Zynq> printenv
autoload=no
baudrate=115200
bootargs=console=ttyPS0,115200 ip=:::::eth0:dhcp nfsroot=${nfsip}:${nfsroot},${nfsargs} uio_pdrv_genirq.of_id=my-uio ro rootwait
bootcmd=run $modeboot
bootdelay=3
devicetree_image=zynq-jlab-vtp.dtb
devicetree_load_address=0x2000000
ethact=ethernet@e000b000
ethaddr=CE:BA:F0:03:00:02
fdt_high=0x20000000
fdtcontroladdr=3ffa9e30
gatewayip=129.57.68.100
initrd_high=0x20000000
ipaddr=129.57.68.38
kernel_image=uImage
kernel_load_address=0x2080000
kernel_path=linux-install/ArchLinux-armv71
modeboot=sdboot
netmask=255.255.255.0
nfsargs=vers=3,tcp,timeo=600,retrans=10
nfsip=129.57.167.152
nfsroot=/vol/diskless/ArchLinux/armv7-devel/root
sdboot=run setboot; echo Copying Linux from TFTP server to RAM...; echo Download Kernel; if tftpboot 0x2080000 linux-install/ArchLinux-armv71/uImage; then echo OK; else echo FAILED; reset; fi; echo Download DeviceTree; if tftpboot 0x2000000 linux-install/ArchLinux-armv71/zynq-jlab-vtp.dtb; then echo OK; else echo FAILED; reset; fi; echo Boot system; bootm 0x2080000 - 0x2000000
sdboot_no=if mmcinfo; then echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && load mmc 0 ${devicetree_load_address} ${devicetree_image} && bootm ${kernel_load_address} - ${devicetree_load_address}; fi
serverip=129.57.167.4
setboot=setenv bootargs console=ttyPS0,115200 ip=:::::eth0:dhcp nfsroot=${nfsip}:${nfsroot},${nfsargs} uio_pdrv_genirq.of_id=my-uio ro rootwait
stderr=serial@e0000000
stdin=serial@e0000000
stdout=serial@e0000000
tftpboot_no=echo Copying Linux from tftp server to RAM... &&tftpboot ${kernel_load_address} linux_vtp/${kernel_image} &&tftpboot ${devicetree_load_address} linux_vtp/${devicetree_image} &&bootm ${kernel_load_address} - ${devicetree_load_address};
Environment size: 1828/131068 bytes
Zynq>
Copy-Paste following on uboot prompt to program above settings (do it line-by-line, otherwise it may place some bull...):
setenv autoload 'no'
setenv baudrate '115200'
setenv bootargs 'console=ttyPS0,115200 ip=:::::eth0:dhcp nfsroot=${nfsip}:${nfsroot},${nfsargs} uio_pdrv_genirq.of_id=my-uio ro rootwait'
setenv bootcmd 'run $modeboot'
setenv bootdelay '3'
setenv devicetree_image 'zynq-jlab-vtp.dtb'
setenv devicetree_load_address '0x2000000'
setenv ethact 'ethernet@e000b000'
setenv ethaddr 'CE:BA:F0:03:00:02'
setenv fdt_high '0x20000000'
setenv fdtcontroladdr '3ffa9e30'
setenv gatewayip '129.57.68.100'
setenv initrd_high '0x20000000'
setenv ipaddr '129.57.68.38'
setenv kernel_image 'uImage'
setenv kernel_load_address '0x2080000'
setenv kernel_path 'linux-install/ArchLinux-armv71'
setenv modeboot 'sdboot'
setenv netmask '255.255.255.0'
setenv nfsargs 'vers=3,tcp,timeo=600,retrans=10'
setenv nfsip '129.57.167.152'
setenv nfsroot '/vol/diskless/ArchLinux/armv7-devel/root'
setenv sdboot 'run setboot; echo Copying Linux from TFTP server to RAM...; echo Download Kernel; if tftpboot 0x2080000 linux-install/ArchLinux-armv71/uImage; then echo OK; else echo FAILED; reset; fi; echo Download DeviceTree; if tftpboot 0x2000000 linux-install/ArchLinux-armv71/zynq-jlab-vtp.dtb; then echo OK; else echo FAILED; reset; fi; echo Boot system; bootm 0x2080000 - 0x2000000'
setenv sdboot_no 'if mmcinfo; then echo Copying Linux from SD to RAM... && load mmc 0 ${kernel_load_address} ${kernel_image} && load mmc 0 ${devicetree_load_address} ${devicetree_image} && bootm ${kernel_load_address} - ${devicetree_load_address}; fi'
setenv serverip '129.57.167.4'
setenv setboot 'setenv bootargs console=ttyPS0,115200 ip=:::::eth0:dhcp nfsroot=${nfsip}:${nfsroot},${nfsargs} uio_pdrv_genirq.of_id=my-uio ro rootwait'
setenv stderr 'serial@e0000000'
setenv stdin 'serial@e0000000'
setenv stdout 'serial@e0000000'
setenv tftpboot_no 'echo Copying Linux from tftp server to RAM... &&tftpboot ${kernel_load_address} linux_vtp/${kernel_image} &&tftpboot ${devicetree_load_address} linux_vtp/${devicetree_image} &&bootm ${kernel_load_address} - ${devicetree_load_address};'
After that, customize following:
ethaddr gatewayip ipaddr netmask
Setting of the Linux server to be used for PXE and EFI boot of the VME controllers
Login to the server as root. Copy two files to the root directory and untar them:
cd / cp /usr/downloads/tftpboot.tar.gz_clondaq15 tftpboot.tar.gz cp /usr/downloads/diskless.tar.gz_clondaq15 diskless.tar.gz gunzip tftpboot.tar.gz gunzip diskless.tar.gz tar xvf tftpboot.tar tar xvf diskless.tar rm tftpboot.tar diskless.tar
Make sure correct snapshot location in root area /diskless/CentOS7/x86_64/root/etc/sysconfig/readonly-root:
CLIENTSTATE=192.168.10.1:/diskless/CentOS7/x86_64/snapshot
In /diskless/CentOS7/x86_64/root area, /etc/ssh/sshd_config must have following setting (to allow remote ssh):
#UsePAM yes
it will be propagated to the controller's snapshot area on the first boot when corresponding snapshot/<vme_controller_name> directory will be created. Not sure about other settings:
HostbasedAuthentication yes #HostbasedAuthentication no
IgnoreRhosts no #IgnoreRhosts yes
PasswordAuthentication yes #PasswordAuthentication yes PasswordAuthentication yes
#UsePrivilegeSeparation sandbox # Default for new installations. UsePrivilegeSeparation sandbox # Default for new installations.
To add or remove VME controllers, modify following files:
/var/named/10.168.192.in-addr.arpa.db /var/named/clontest.com /etc/dhcp/dhcpd.conf
restart corresponding services:
systemctl restart dhcpd systemctl restart named
and check services status:
systemctl status dhcpd systemctl status named
To set gateway, add
net.ipv4.ip_forward=1
to /etc/sysctl.conf and execute
sysctl -p
Configure NFS
Configure DHCP server
Configure DNS server (NOTE: resolv.conf is different for local server !)
Configure Iptables
Do not forget (is it for controllers ?):
chattr +i /etc/resolv.conf
yum install ypbind (????)
Configuring snapshot area
The list of files and directories which suppose to be in snapshot area (which has RW permissions) should be set in config file /diskless/.../snapshot/files. In particular, /et has to be added there, and also directory /diskless/.../root/et should be created.
Reboot server, make sure everything is running as expected.
Configuring in chroot
NOTE: using chroot method will allow to run yum, but systemctl commands will not work. Instead of using chroot, you may boot coontroller with rw option instead of ro. For VME boot, it can be done by changing grub.cnf, while for VTP boot you have to stop boot proocess using serial connection, and then type run tftpboot_rw.
Since root area in VME controllers will be read-only, you cannot ssh to controllers as root and change anything there, only snapshot area can be modified. To make changes in root area, in particular to configure and run yum, chroot' command should be used. Login to the boot server as root and do following:
mount -o bind /home /diskless/CentOS7/x86_64/root/home mount -o bind /usr/local /diskless/CentOS7/x86_64/root/usr/local mount -o bind /usr/clas12 /diskless/CentOS7/x86_64/root/usr/clas12 chroot /diskless/CentOS7/x86_64/root
After that you will see all root directories as if you login to VME controller, and modifications can be made.
Configure yum
Add multilib_policy=all to /etc/yum.conf.
Add (and remove the rest ?) following to /etc/yum.repos.d/CentOS-Base.repo:
[base] name=CentOS-$releasever - Base baseurl=http://archive.kernel.org/centos-vault/centos/$releasever/os/$basearch/
Clean yum database:
rm /var/lib/rpm/__db.*
Install following using yum:
yum install motif-devel tcl-devel tk-devel libXpm-devel apr-devel libXaw-devel ncurses-devel libconfig-devel
Install following for dbedit:
yum install tix itcl itk
Install remaining tcl stuff from /usr/local/src, mounted as /zzz above:
cd /zzz/mysqltcl-3.052 make install ln -s /usr/lib/mysqltcl-3.052 /usr/lib64/tcl8.5/mysqltcl-3.052
NOTE: Login from console may not work because of file /etc/securetty permissions, it must be 644.
NOTE: THere is a service PAM, it may prevent login from console if some required services did not start. To work around, comment out some lines in /etc/pam.d/system-auth-ac file:
#%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. #auth required pam_env.so auth sufficient pam_unix.so nullok try_first_pass #auth requisite pam_succeed_if.so uid >= 1000 quiet_success #auth required pam_deny.so #account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_succeed_if.so uid < 1000 quiet #account required pam_permit.so password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok #password required pam_deny.so session optional pam_keyinit.so revoke #session required pam_limits.so -session optional pam_systemd.so session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid #session required pam_unix.so
After Linux boot server is ready and operational, VME controllers can be booted. On the first boot, individual /diskless/.../snapshot/<controller name> directory will be created for each controller. For VME controller specific information see VME