Both sides previous revision Previous revision Next revision | Previous revision |
projects:livenet:server [2018/03/13 00:14] – [BUILD IMAGE CLIENT] nicola | projects:livenet:server [2018/03/21 11:56] (current) – [install livenet client package] scipio |
---|
</code> | </code> |
| |
===== Trivial FTP ===== | ==== Trivial FTP ==== |
edit /etc/default/tftp-hpa | edit /etc/default/tftp-hpa |
<code> | <code> |
<code>mount --bind /zfsp_livenet/images/bionic/boot/ /zfsp_livenet/boot/bionic</code> | <code>mount --bind /zfsp_livenet/images/bionic/boot/ /zfsp_livenet/boot/bionic</code> |
| |
| <code> |
DISTR=bionic | DISTR=bionic |
27 echo $DISTR | |
28 cat > /etc/apt/sources.list <QWE | |
29 ############################################################# | |
30 ################### OFFICIAL UBUNTU REPOS ################### | |
31 ############################################################# | |
32 ###### Ubuntu Main Repos | |
33 deb http://archive.ubuntu.com/ubuntu/ ${DISTR} main restricted universe multiverse | |
34 ###### Ubuntu Update Repos | |
35 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-security main restricted universe multiverse | |
36 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-updates main restricted universe multiverse | |
37 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-proposed main restricted universe multiverse | |
38 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-backports main restricted universe multiverse | |
39 ###### Ubuntu Partner Repo | |
40 deb http://archive.canonical.com/ubuntu ${DISTR} partner | |
41 clear | |
42 cat > /etc/apt/sources.list <<QWE | |
43 ############################################################# | |
44 ################### OFFICIAL UBUNTU REPOS ################### | |
45 ############################################################# | |
46 ###### Ubuntu Main Repos | |
47 deb http://archive.ubuntu.com/ubuntu/ ${DISTR} main restricted universe multiverse | |
48 ###### Ubuntu Update Repos | |
49 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-security main restricted universe multiverse | |
50 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-updates main restricted universe multiverse | |
51 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-proposed main restricted universe multiverse | |
52 deb http://archive.ubuntu.com/ubuntu/ ${DISTR}-backports main restricted universe multiverse | |
53 ###### Ubuntu Partner Repo | |
54 deb http://archive.canonical.com/ubuntu ${DISTR} partner | |
55 QWE | |
| |
| 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 ===== |