Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| projects:livenet:server [2018/03/12 23:21] – nicola | projects:livenet:server [2018/03/21 11:56] (current) – [install livenet client package] scipio | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{indexmenu> | + | ===== Requirements ===== |
| + | ** HW**: 2 nic device | ||
| - | ===== Software richiesto ===== | + | **OS**: Ubuntu server 17.10 |
| - | **Sistema operativo**: Ubuntu server | + | < |
| + | |||
| + | **Optional config** | ||
| + | |||
| + | < | ||
| + | |||
| + | **network config ** | ||
| + | nano / | ||
| + | |||
| + | < | ||
| + | # This file describes the network interfaces available on your system | ||
| + | # For more information, | ||
| + | network: | ||
| + | version: 2 | ||
| + | renderer: networkd | ||
| + | ethernets: | ||
| + | ens3: | ||
| + | dhcp4: no | ||
| + | addresses: [10.1.22.2/ | ||
| + | gateway4: 192.168.122.1 | ||
| + | nameservers: | ||
| + | addresses: [8.8.8.8, | ||
| + | ens4: | ||
| + | dhcp4: yes | ||
| + | |||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | < | ||
| + | ===== Build livenet environment ===== | ||
| + | ==== Preparazione dell' | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | |||
| + | Download package | ||
| + | edit / | ||
| + | |||
| + | < | ||
| + | # folder that contains livenet system | ||
| + | BASE=/ | ||
| + | IMAGES=${BASE}/ | ||
| + | BOOT=${BASE}/ | ||
| + | </ | ||
| + | |||
| + | ==== Trivial FTP ==== | ||
| + | edit / | ||
| + | < | ||
| + | TFTP_USERNAME=" | ||
| + | TFTP_DIRECTORY="/ | ||
| + | TFTP_ADDRESS=" | ||
| + | TFTP_OPTIONS=" | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | cp -a / | ||
| + | |||
| + | cp / | ||
| + | |||
| + | edit / | ||
| + | < | ||
| + | default menu.c32 | ||
| + | prompt 0 | ||
| + | #timeout 100 | ||
| + | |||
| + | menu title PXE Special Boot Menu | ||
| + | MENU AUTOBOOT Starting Livenet in # seconds | ||
| + | |||
| + | label bootlocal | ||
| + | menu label ^Boot local disk | ||
| + | menu default | ||
| + | | ||
| + | |||
| + | label nfs | ||
| + | menu label Ubuntu | ||
| + | | ||
| + | | ||
| + | |||
| + | label nfs | ||
| + | menu label Ubuntu 14.04 - install | ||
| + | | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== BUILD IMAGE CLIENT ==== | ||
| + | zfs create livenet/ | ||
| + | debootstrap --arch amd64 bionic / | ||
| + | |||
| + | cd / | ||
| + | run .... | ||
| + | < | ||
| + | R=bionic | ||
| + | cat > ${R}/ | ||
| + | 127.0.0.1 | ||
| + | ::1 | ||
| + | ff02:: | ||
| + | ff02:: | ||
| + | QWK | ||
| + | |||
| + | chroot ${R} lsb_release -c | awk ' | ||
| + | chroot bionic/ | ||
| + | chroot ${R} apt-get -y -q install locales dialog | ||
| + | chroot ${R} locale-gen en_GB.UTF-8 | ||
| + | chroot ${R} locale-gen it_IT.UTF-8 | ||
| + | chroot ${R} update-locale LANG=it_IT.UTF-8 LANGUAGE=it: | ||
| + | echo Europe/Rome > ${R}/ | ||
| + | cp ${R}/ | ||
| + | cat > ${R}/ | ||
| + | #!/bin/sh | ||
| + | |||
| + | # dpkg/apt not start any daemons when things are installed in the chroot | ||
| + | |||
| + | if [ ! " | ||
| + | exit 101 | ||
| + | fi | ||
| + | QWE | ||
| + | |||
| + | chmod +x ${R}/ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | DISTR=bionic | ||
| + | |||
| + | cat > / | ||
| + | ############################################################# | ||
| + | ################### | ||
| + | ############################################################# | ||
| + | ###### Ubuntu Main Repos | ||
| + | deb http:// | ||
| + | ###### Ubuntu Update Repos | ||
| + | deb http:// | ||
| + | deb http:// | ||
| + | deb http:// | ||
| + | deb http:// | ||
| + | ###### Ubuntu Partner Repo | ||
| + | deb http:// | ||
| + | QWE | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | apt update apt -y upgrade | ||
| + | apt -y install initramfs-tools | ||
| + | </ | ||
| + | |||
| + | ==== install livenet client package ==== | ||
| + | |||
| + | < | ||
| + | # copiare / | ||
| + | cd /root | ||
| + | git clone https:// | ||
| + | cd livenet-client | ||
| + | git checkout bionic | ||
| + | mv .git / | ||
| + | git status | ||
| + | find / -maxdepth 1 > .gitignore | ||
| + | |||
| + | </ | ||
| + | |||
| + | inside git directory | ||
| + | < | ||
| + | rsync -avb etc/ /etc/ | ||
| + | rsync -avb usr/ /usr/ | ||
| + | rsync -avb debian / | ||
| + | rsync -avb README.md / | ||
| + | apt-get -y install linux-generic | ||
| + | </ | ||
| + | |||
| + | ==== etc/ | ||
| + | < | ||
| + | #!/bin/sh -e | ||
| + | # initramfs hook for livenet | ||
| + | #set -x | ||
| + | PREREQ="" | ||
| + | |||
| + | # Output pre-requisites | ||
| + | prereqs() | ||
| + | { | ||
| + | echo " | ||
| + | } | ||
| + | |||
| + | case " | ||
| + | prereqs) | ||
| + | | ||
| + | exit 0 | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | . / | ||
| + | |||
| + | rm ${DESTDIR}/ | ||
| + | copy_exec /bin/cpio /bin | ||
| + | |||
| + | mkdir -p ${DESTDIR}/ | ||
| + | cp / | ||
| + | [ -f / | ||
| + | cp / | ||
| + | |||
| + | manual_add_modules aufs | ||
| + | manual_add_modules overlayfs | ||
| + | auto_add_modules net | ||
| + | auto_add_modules nfsv4 | ||
| + | |||
| + | # pulizia di firmware non necessario e pesante | ||
| + | set +e | ||
| + | rm -f ${DESTDIR}/ | ||
| + | set -e | ||
| + | |||
| + | ### qui sotto andrebbe commentato in produzione ### | ||
| + | |||
| + | # tastiera italiana in initram | ||
| + | # attivata da do_debug_shell (loadkeys / | ||
| + | #cp -au / | ||
| + | |||
| + | # nfs4 | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #cp -au / | ||
| + | |||
| + | #cat > ${DESTDIR}/ | ||
| + | # | ||
| + | #EOF | ||
| + | #cat > ${DESTDIR}/ | ||
| + | # | ||
| + | #EOF | ||
| + | |||
| + | # debug purpose ################ | ||
| + | # ricordati di mettere FRAMEBUFFER=n in / | ||
| + | #copy_exec / | ||
| + | #copy_exec /sbin/lsmod /bin | ||
| + | #copy_exec / | ||
| + | ################################# | ||
| + | |||
| + | # wireless ##################### | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #copy_exec / | ||
| + | #cp -au / | ||
| + | ################################# | ||
| + | </ | ||
| + | |||
| + | ===Rebuild initramfs image === | ||
| + | ln-mng --kernel | ||
| + | |||
| + | ===== DHCP ===== | ||
| + | ==== Abilitare dhcpd su specifica scheda ==== | ||
| + | Editare la riga in | ||
| + | |||
| + | / | ||
| + | |||
| + | < | ||
| + | |||
| + | ==== Configurazione dhcpd ==== | ||
| + | editare il file / | ||
| + | al termine service isc-dhcp-service restart | ||
| + | < | ||
| + | ddns-update-style none; | ||
| + | authoritative; | ||
| + | |||
| + | option domain-name | ||
| + | option domain-name-servers | ||
| + | |||
| + | allow bootp; | ||
| + | allow booting; | ||
| + | |||
| + | option space PXE; | ||
| + | # Code 1: Multicast IP address of bootfile | ||
| + | option PXE.mtftp-ip code 1 = ip-address; | ||
| + | # Code 2: UDP port that client should monitor for MTFTP responses | ||
| + | option PXE.mtftp-cport code 2 = unsigned integer 16; | ||
| + | # Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests | ||
| + | option PXE.mtftp-sport code 3 = unsigned integer 16; | ||
| + | # Code 4: Number of secondes a client must listen for activity before trying | ||
| + | # to start a new MTFTP transfer | ||
| + | option PXE.mtftp-tmout code 4 = unsigned integer 8; | ||
| + | option PXE.mtftp-delay code 5 = unsigned integer 8; | ||
| + | # Code 5: Number of secondes a client must listen before trying to restart | ||
| + | # a MTFTP transfer | ||
| + | option PXE.discovery-control code 6 = unsigned integer 8; | ||
| + | option PXE.discovery-mcast-addr code 7 = ip-address; | ||
| + | set vendor-string = option vendor-class-identifier; | ||
| + | |||
| + | class " | ||
| + | match if substring(option vendor-class-identifier, | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | class " | ||
| + | match if substring(option vendor-class-identifier, | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | class " | ||
| + | match if (substring(option vendor-class-identifier, | ||
| + | log ( info, " | ||
| + | } | ||
| + | |||
| + | shared-network " | ||
| + | subnet | ||
| + | option subnet-mask 255.255.255.0; | ||
| + | option routers 10.1.22.2; | ||
| + | # | ||
| + | # | ||
| + | |||
| + | pool { | ||
| + | # restringe il lease solo alla classe LIVENET | ||
| + | allow members of " | ||
| + | range 10.1.22.10 10.1.22.100; | ||
| + | filename "/ | ||
| + | next-server 10.1.22.2; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | </ | ||
| - | apt install bash debootstrap schroot syslinux nfs-kernel-server tftpd-hpa xorriso pigz zfsutils-linux | ||
| - | **software facoltativo ma usato nel test** | ||
| - | apt install isc-dhcp-server | ||