================ Mass Install ================ :Author: Andrea Manni :Copyright: GFDL :Version: 1.0 .. sectnum:: .. contents:: Indice degli argomenti .. |date| date:: Generata il |date|, sono disponibili versioni in HTML, PDF, OpenOffice e testo semplice. Il sito di rifermento per questa guide e altre analoghe e' http://doc.andreamanni.com Chi volesse segnalare errori, suggerimenti o modifiche puo' contattare per email andrea at piffa punto net, questa guida viene mantenuta in un deposito GIT pubblico: http://git.andreamanni.com/ UUID ======== Per vedere partizioni, label e UUID:: blkid Debian mirror =============== Installare ``debmirror``, invocarlo con qualcosa tipo:: debmirror --allow-dist-rename --progress --nosource \ --dist=stable,testing,sid --arch=i386,amd64 --host=mirror.switch.ch/ftp/mirror/ --method=http /mnt/mirror/debian/ Nel caso si cerchi di sincronizzare piu' mirror (ad esempio un portatile, un server) e' consigliabile usare su tutti gli host la **stessa verione** di debmirror, ad esempio quella di stable oppure sid: http://packages.debian.org/squeeze/debmirror . Non dovrebbe esserci dipendenze ad installare una versione piu' aggiornata su un sitema (es. Squeeze su Lenny). Se si vuole tracciare Sid, l'ideale sarebbe usare un debmirror preso da Sid nel caso che ci siano cambiamenti nella struttura del mirror (ma la cosa sarebbe preoccupante!) o nella firma della release sid. Keyring --------- Su Lenny o altri sistemi le chiavi gpg sono collocate in un archivio diverso da quello usato da debmirror:: cp /root/.gnupg/pubring.gpg /root/.gnupg/trustedkeys.gpg Se si cerca di sincronizzare il mirror da una versione *vecchia* di Debian potrebbero non essere disponibli le ultime chiavi GPG:: gpg --keyserver subkeys.pgp.net --recv 9AA38DCD55BE302B gpg --export --armor 55BE302B | apt-key add - Struttura mirror ------------------ Talvolta sincronizzando mirrors diversi *possono perdersi* alcuni degli hooks alle varie release delle distribuzioni. Una tipica struttura della cartella ``dists`` dovrebbe assomigliare a:: time:~/scripts# ls -l /mnt/mirror/debian/dists/ total 12 drwxr-xr-x 5 root root 4096 Nov 1 19:01 lenny drwxr-xr-x 5 root root 4096 Nov 1 19:01 sid drwxr-xr-x 5 root root 4096 Nov 1 19:01 squeeze lrwxrwxrwx 1 root root 5 Feb 25 2009 stable -> lenny lrwxrwxrwx 1 root root 7 Jan 12 2010 testing -> squeeze lrwxrwxrwx 1 root root 3 Nov 11 2009 unstable -> sid Questo e' gestito in automatico dal flag ``--allow-dist-rename``, disponibile dalla release di Squeeze di debmirror ( http://packages.debian.org/squeeze/debmirror ), invocata alla:: debmirror --allow-dist-rename \ --progress --nosource --dist=stable,testing,sid --arch=i386,amd64 --host=mirror.switch.ch/ftp/mirror/ --method=http /mnt/mirror/debian/ Ubuntu mirror -------------- Script:: ## THE NEXT LINE IS NEEDED THE REST OF THE LINES STARTING WITH A # CAN BE DELETED #!/bin/bash ## Setting variables with explanations. # # Don't touch the user's keyring, have our own instead # export GNUPGHOME=/root/ubuntu_keyring # Arch= -a # Architecture. For Ubuntu can be i386, powerpc or amd64. # sparc, only starts in dapper, it is only the later models of sparc. # arch=i386 # Minimum Ubuntu system requires main, restricted # Section= -s # Section (One of the following - main/restricted/universe/multiverse). # You can add extra file with $Section/debian-installer. ex: main/debian-installer,universe/debian-installer,multiverse/debian-installer,restricted/debian-installer # section=main,restricted,universe,multiverse,main/debian-installer,universe/debian-installer,multiverse/debian-installer,restricted/debian-installer # Release= -d # Release of the system (Dapper, Edgy, Feisty, Gutsy, Hardy, Intrepid), and the -updates and -security ( -backports can be added if desired) # release=lucid,lucid-security,lucid-updates,karmic,karmic-security,karmic-updates # Server= -h # Server name, minus the protocol and the path at the end # CHANGE "*" to equal the mirror you want to create your mirror from. au. in Australia ca. in Canada. # This can be found in your own /etc/apt/sources.list file, assuming you have Ubuntu installed. # #server=it.archive.ubuntu.com server=mirror.switch.ch/ftp #server=ubuntu-archive.mirrors.proxad.net/ #server=mirrors.kernel.org/ # Dir= -r # Path from the main server, so http://my.web.server/$dir, Server dependant # inPath=ubuntu # Proto= -e # Protocol to use for transfer (http, ftp, hftp, rsync) # Choose one - http is most usual the service, and the service must be avaialbe on the server you point at. # proto=http # Outpath= # Directory to store the mirror in # Make this a full path to where you want to mirror the material. # outPath=/mnt/usb/mirror/ubuntu/ # The --nosource option only downloads debs and not deb-src's # The --progress option shows files as they are downloaded # --source \ in the place of --no-source \ if you want sources also. # --nocleanup Do not clean up the local mirror after mirroring is complete. Use this option to keep older repository # Start script # debmirror -a $arch \ --no-source \ -s $section \ -h $server \ -d $release \ -r $inPath \ --progress \ -e $proto \ $outPath #### End script to automate building of Ubuntu mirror #### Anche qui servira' un keyring, si possono importare le chiavi manualemte nel keyring princiapale o usare un keyring separato, ad esempio se avete compiato direttamente un keyring da una Ubuntu:: ``/root/ubuntu_keyring'' Rsync.conf ============ Per poter scrivere con uid/gid root bisogna settare uid/gud a root. Tenere poi il filesystem in ``nosuid,noexec`` :: /etc/fstab :: /dev/mapper/main-fs /mnt/fs ext4 ro,noauto,noexec,nosuid 0 0 ``/etc/rsyncd.conf`` :: # MODULE OPTIONS [fs] comment = Clusters file systems path = /mnt/fs use chroot = yes # max connections=10 lock file = /var/lock/rsyncd # the default for read only is yes... read only = no list = yes uid = root gid = root # exclude = # exclude from = # include = # include from = # auth users = # secrets file = /etc/rsyncd.secrets strict modes = yes # hosts allow = # hosts deny = ignore errors = no ignore nonreadable = yes transfer logging = no # log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes. timeout = 600 refuse options = checksum dry-run dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz Eventualmente per il mirror dei pacchetti:: [mirror] comment = public archive path = /mnt/mirror use chroot = yes # max connections=10 lock file = /var/lock/rsyncd # the default for read only is yes... read only = yes list = yes uid = nobody gid = nogroup # exclude = # exclude from = # include = # include from = # auth users = # secrets file = /etc/rsyncd.secrets strict modes = yes # hosts allow = # hosts deny = ignore errors = no ignore nonreadable = yes transfer logging = no # log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes. timeout = 600 refuse options = checksum dry-run dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz Dnsmasq ========= Per servire i pacchetti dal propio mirror senza dover usare delle voci personalizzarte nei ``sources.list`` dei client si intercettino le connessioni HTTP verso un mirror a livello DNS con Dnsmaq, aggiungendo voci a ``/etc/hosts`` del server DNS usato per la LAN:: # Mirror for APT 192.168.0.10 ftp.it.debian.org Ovviamenti i pacchetti andranno serviti con un server HTTP. Boot from .iso =============== Per poter fare il boot da un file \*.iso senza masterizzarlo:: apt-get install grml-rescueboot cd /boot/grml wget iso_file... update-grub