projects:livenet:server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:livenet:server [2018/03/13 00:12] nicolaprojects:livenet:server [2018/03/21 11:56] (current) – [install livenet client package] scipio
Line 51: Line 51:
 </code> </code>
  
-===== Trivial FTP =====+==== Trivial FTP ====
 edit /etc/default/tftp-hpa edit /etc/default/tftp-hpa
 <code> <code>
Line 133: Line 133:
 </code> </code>
  
-mount --bind /zfsp_livenet/images/bionic/boot/ /zfsp_livenet/boot/bionic+<code>mount --bind /zfsp_livenet/images/bionic/boot/ /zfsp_livenet/boot/bionic</code>
  
 +<code>
 +DISTR=bionic
 +
 +cat > /etc/apt/sources.list <<QWE
 +#############################################################
 +################### OFFICIAL UBUNTU REPOS ###################
 +#############################################################
 +###### Ubuntu Main Repos
 +deb http://archive.ubuntu.com/ubuntu/ ${DISTR} main restricted universe multiverse 
 +###### Ubuntu Update Repos
 +deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-security main restricted universe multiverse 
 +deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-updates main restricted universe multiverse 
 +deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-proposed main restricted universe multiverse 
 +deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-backports main restricted universe multiverse 
 +###### Ubuntu Partner Repo
 +deb http://archive.canonical.com/ubuntu ${DISTR} partner
 +QWE
 +</code>
 +
 +<code>
 +apt update apt -y upgrade
 +apt -y install initramfs-tools  python-passlib pv screen byobu lsof pigz rsync nfs-common libpam-script xloadimage conntrack
 +</code>
 +
 +==== install livenet client package ====
 +
 +<code>
 +# copiare /home/scipio/.netrv e /home/scipio/.gitconfig in <chroot>/root/
 +cd /root
 +git clone  https://github.com/scipioni/livenet-client.git
 +cd livenet-client
 +git checkout bionic
 +mv .git /
 +git status
 +find / -maxdepth 1 > .gitignore
 +
 +</code>
 +
 +inside git directory
 +<code>
 +rsync -avb etc/ /etc/
 +rsync -avb usr/ /usr/
 +rsync -avb debian /
 +rsync -avb README.md /
 +apt-get -y install linux-generic
 +</code>
 +
 +==== etc/initramfs-tools/hooks/livenet ====
 +<code>
 +#!/bin/sh -e
 +# initramfs hook for livenet
 +#set -x
 +PREREQ=""
 +
 +# Output pre-requisites
 +prereqs()
 +{
 +       echo "$PREREQ"
 +}
 +
 +case "$1" in
 +    prereqs)
 +       prereqs
 +       exit 0
 +       ;;
 +esac
 +
 +. /usr/share/initramfs-tools/hook-functions
 +
 +rm ${DESTDIR}/bin/cpio # importante! altrimenti rimane un cpio troppo semplificato
 +copy_exec /bin/cpio /bin
 +
 +mkdir -p ${DESTDIR}/conf
 +cp /etc/livenet/livenet.conf ${DESTDIR}/conf
 +[ -f /etc/livenet/livenet.conf.override ] && cp /etc/livenet/livenet.conf.override ${DESTDIR}/conf
 +cp /etc/initramfs-tools/scripts/functions-livenet ${DESTDIR}/conf
 +
 +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}/lib/firmware/* >/dev/null 2>&1
 +set -e
 +
 +### qui sotto andrebbe commentato in produzione ###
 +
 +# tastiera italiana in initram
 +# attivata da do_debug_shell (loadkeys /etc/boottime.kmap.gz)
 +#cp -au /etc/console-setup/cached.kmap.gz ${DESTDIR}/etc/boottime.kmap.gz
 +
 +# nfs4
 +#copy_exec /usr/sbin/rpc.idmapd /bin
 +#copy_exec /sbin/mount.nfs /bin
 +#cp -au /etc/netconfig ${DESTDIR}/etc/netconfig
 +
 +#cat > ${DESTDIR}/etc/passwd <<EOF
 +#nobody::65534:65534:nobody:/nonexistent:/bin/sh
 +#EOF
 +#cat > ${DESTDIR}/etc/group <<EOF
 +#nogroup:x:65534:
 +#EOF
 +
 +# debug purpose ################
 +# ricordati di mettere FRAMEBUFFER=n in /etc/initramfs-tools/conf.d/splash
 +#copy_exec /sbin/ifconfig
 +#copy_exec /sbin/lsmod /bin
 +#copy_exec /usr/bin/lspci /bin
 +#################################
 +
 +# wireless #####################
 +#copy_exec /sbin/iwconfig
 +#copy_exec /sbin/iwlist
 +#copy_exec /sbin/iwpriv
 +#copy_exec /sbin/iwevent
 +#copy_exec /sbin/iwgetid
 +#copy_exec /sbin/iwspy
 +#copy_exec /usr/sbin/rfkill
 +#cp -au /lib/firmware/iwl*-[13].ucode ${DESTDIR}/lib/firmware
 +#################################
 +</code>
 +
 +===Rebuild initramfs image ===
 +ln-mng --kernel
  
 ===== DHCP ===== ===== DHCP =====
  • projects/livenet/server.1520896325.txt.gz
  • Last modified: 2018/03/13 00:12
  • by nicola