NOTA: El fitxer de preseed no funciona amb LIVE CD d'escriptori d'Ubuntu, ja que utilitza ubiquity i aquest encara no és 100% automatitzable. https://blueprints.launchpad.net/ubuntu/+spec/ubiquity-automation https://wiki.ubuntu.com/Ubiquity/Automation. Una alternativa és utilitzar el CD alternate i instal·lar el paquet Ubuntu-Desktop!
http://www.scribd.com/doc/14313466/Preseeding-the-Debian-Installer
Cal indicar un paràmetre d'instal·lació amb l'opció F6 del menú inicial del CD d'instal·lació.
Tenim múltiples mètodes:
Per initrd:
Posant un fitxer anomenat:
preseed.cfg
A l'arrel del fitxer initrd.
Per xarxa:
preseed/url=http://host/path/to/preseed.cfg preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
NOTA: Podeu utilitzar l'alias url per a simplificar. El ús del checksum és per tal d'assegurar la integritat del fitxer
CD:
preseed/file=/cdrom/preseed.cfg preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
USB:
preseed/file=/hd-media/preseed.cfg preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
NOTA: Observeu que es pot especificar el checksum del fitxer per a més seguretat. El podeu calcular amb md5sum
Consulteu la carpeta:
/var/lib/cdebconf
Ho podeu fer des de les consoles virtuals 2 o 3 amb Ctrl+Alt+F2 o F3 (ControlDret+Numero a Virtual Box)
Els fitxers que hi trobareu son:
# ls /var/lib/cdefconf passwords.dat questions.dat templates.dat
Consulteu també els fitxers:
/var/lib/cdefconf/templates.dat /var/lib/cdefconf/questions.dat
Consulteu debconf-set-selections
Consulteu Ldap#Automatitzaci.C3.B3_de_la_instal.C2.B7laci.C3.B3_utilitzant_preseeding.
Vegeu també Ubuntu Custom un script bash que automatitza el procés.
Els paràmetres d'arrancada que es poden utilitzar per indicar el fitxer de preseed són:
preseed/url: El fitxer està accessible a través de la xarxa. preseed/file: El fitxer està accesible al propi LIVE CD (o USB LIVE)
Es poden utilitzar les abreviacions o alias:
url file
Aquests paràmetres han d'indicar el camí per arribar al fitxer des de l'arrel del LIVE CD. Existeix certa custom de posar els fitxer preseed a la carpeta:
preseed/
Per indicar a d-i quin fitxer utilitzar es modifica el fitxer isolinux.cfg del CD per tal de pasar els paràmetres al kernel de forma correcte i que aquest al seu torn els passi al instal·lador de Debian (d-i). Un exemple de com accedir i modificar el fitxer:
$ cd $ sudo mkdir ubuntuserver/ $ sudo mount -o loop ubuntu-11.04-server-i386.iso ubuntuserver/ Vegeu Loop devices
Ara teniu muntat el CD. Tingueu en compte que la carpeta ubuntuserver no forma part del disc dur sinó del CD i per tant serà un sistema de fitxers de només lectura. Per poder fer modificacions cal obtenir una copia:
$ rsync -av ubuntuserver/ ubuntuservercustom
Ara modifiqueu el fitxer:
$ joe ubuntuservercustom/isolinux/txt.cfg
NOTA: Des de fa varies versions de Ubuntu, la configuració de isolinux es divideix en múltiples fitxers. La part que ens interessa es troba al fitxer indicat i no pas al fitxer principal isolinux.cfg
Aquí podeu afegir una entrada després de la primera línia:
default custominstall
poseu:
label custominstall menu label Install ^Custom Ubuntu Server kernel /install/vmlinuz append file=/cdrom/preseed/custom.seed vga=788 initrd=/install/initrd.gz quiet --
Ara canvieu la primera línia a:
default custominstall
On custominstall és el nom que li hem donat a la nostra pròpia opció de menú. Fixeu-vos que el fitxer escollit de preseed és:
/cdrom/preseed/custom.seed
Una opció que us permetrà no haver de tornar a crear el CD cada cop que feu una modificació al fitxer de preseed es obtenir-lo sempre de la xarxa i així poder-lo modificar sense necessitat de tornar a crear el CD.
label custominstall menu label Install ^Custom Ubuntu Server kernel /install/vmlinuz append auto=true priority=critical url=http://www.iesebre.com/ubuntu/custom.seed vga=788 initrd=/install/initrd.gz quiet --
On heu de canviar el nom de domini per el del vostre servidor i configurar Apache per mostrar el fitxer de seed a la URL http://www.iesebre.com/ubuntu/custom.seed
IMPORTANT: {{{1}}}
Podeu deixar-vos múltiples opcions:
label custominstall menu label Install ^Custom Ubuntu Server kernel /install/vmlinuz append auto=true priority=critical url=http://www.iesebre.com/ubuntu/custom.seed vga=788 initrd=/install/initrd.gz quiet -- label custominstall1 menu label Install ^Custom Ubuntu Server kernel /install/vmlinuz append auto=true priority=critical url=http://www.iesebre.com/ubuntu/custom1.seed vga=788 initrd=/install/initrd.gz quiet -- label custominstall2 menu label Install ^Custom Ubuntu Server kernel /install/vmlinuz append auto=true priority=critical url=http://www.iesebre.com/ubuntu/custom2.seed vga=788 initrd=/install/initrd.gz quiet --
I així podeu provar amb diferents fitxers.
Per a les plataformes x86 i AMD64 el següent script us pot ser útils
IMAGE=custom.iso BUILD=/opt/cd-image/ mkisofs -r -V "Custom Ubuntu Install CD" \ -cache-inodes \ -J -l -b isolinux/isolinux.bin \ -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table \ -o $IMAGE $BUILD
Per cremar el CD:
Per trobar la localització del vostre CD executeu:
$ cdrecord --scanbus
I executeu quelcom similar (canvieu el dispositiu)
$ sudo nice -18 cdrecord dev=ATA:0,1,0 --speed=24 --blank=fast -v -gracetime=2 -tao $IMAGE
NOTA: La imatge només us cal cremar-la si la heu de provar en un sistema físic! La recomanació és que utilitzeu algun sistema de màquines virtual com Virtual Box per a fer les proves sense necessitat de cremar CDs reals
<owner> <question name> <question type> <value>
Normes:
An alternative method is to do a manual installation and then, after rebooting, use the debconf-get-selections from the debconf-utils package to dump both the debconf database and the installer's cdebconf database to a single file:
$ debconf-get-selections --installer > file $ debconf-get-selections >> file
Recursos:
Al establir el valor d'un paràmetre de preseed, aleshores aquest paràmetre ja no es pregunta. Es pot utilitzar l'operador:
?=
en comptes de:
=
Per establir el valor per defecte quan hi ha múltiples opcions.
$ debconf-set-selections -c preseed.cfg
Si no diu res és que és correcte (no news good news). Es pot utilitzar l'opció verbose:
$ debconf-set-selections -v -c preseed.cfg
NOTA: Pot ser que a la versió alternate al CD no hi hagi un nucli per a servers?!. L'error que apareix al log és:
base-installer: warning: Kernel override 'linux-server' no present base-installer: info Found kernels 'linux-generic,linux-image-generic ...'
IMPORTANT: Per a la plataforma i386 no existeix el nucli linux-server, el que s'utilitza és linux-generic-pae. PAE és el sistema que permet utilitzar memòries RAM de més de 4G amb sistemes de de 32 bits
Amb 64 bits i una iso de servidor m'ha funcionat correctament.
TODO: Falta provar amb 32 bits i una ISO
Sembla ser que no funciona:
base-installer/kernel/override-image
Des de les versions natty:
https://launchpad.net/ubuntu/precise/+source/natty/+changelog https://launchpad.net/ubuntu/precise/+source/base-installer/+changelog
Consulteu també kernel flavours
Només es poden canviar aquests paràmetres si esteu utilitzant un preseed amb initrd (o indicant-ho com a paràmetre). En un preseed de xarxa, cal contestar aquestes preguntes abans de tenir xarxa.
# El locale estableix la llengua i el país. d-i debian-installer/locale string ca_ES
# Keyboard selection. # Disable automatic (interactive) keymap detection. d-i console-setup/ask_detect boolean false #d-i console-setup/modelcode string pc105 d-i console-setup/layoutcode string es # To select a variant of the selected layout (if you leave this out, the # basic form of the layout will be used): d-i console-setup/variantcode string cat
IMPORTANT: Cal tenir en compte que a les últimes versions d'Ubuntu/Debian la configuració del teclat es fa amb el paquet nou keyboard-configuration i no pas amb console-setup. Aquest canvi és va fer al passar de la versió lucid a natty, al changelog:
console-setup (1.57ubuntu8) natty; urgency=low * Move keyboard detection templates from console-setup.templates to keyboard-configuration.templates. -- Colin Watson Mon, 28 Feb 2011 19:21:18 +0000
Un exemple:
keyboard-configuration keyboard-configuration/modelcode string pc105 keyboard-configuration keyboard-configuration/unsupported_config_options boolean true keyboard-configuration keyboard-configuration/unsupported_config_layout boolean true keyboard-configuration keyboard-configuration/toggle select No toggling keyboard-configuration keyboard-configuration/compose select No compose key keyboard-configuration keyboard-configuration/layout select Spanish keyboard-configuration keyboard-configuration/variant select Spanish - Catalan (Spain, with middle-dot L) keyboard-configuration keyboard-configuration/switch select No temporary switch keyboard-configuration keyboard-configuration/unsupported_options boolean true keyboard-configuration console-setup/detect detect-keyboard keyboard-configuration console-setup/detected note keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean false keyboard-configuration keyboard-configuration/unsupported_layout boolean true keyboard-configuration keyboard-configuration/variantcode string cat keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC keyboard-configuration console-setup/ask_detect boolean false keyboard-configuration keyboard-configuration/layoutcode string es keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true keyboard-configuration keyboard-configuration/optionscode string
NOTA: L'exemple anterior és el que té una Ubuntu Server instal·lada en català just després de ser instal·lada. Consultat amb:
$ sudo debconf-get-selections --install | grep keyboard-configuration
d-i localechooser/shortlist es d-i localechooser/shortlist seen true d-i debian-installer/locale string ca_ES.UTF-8 d-i debian-installer/splash boolean false d-i console-setup/ask_detect boolean false d-i console-setup/layoutcode string es d-i console-setup/variantcode string d-i netcfg/get_nameservers string d-i netcfg/get_ipaddress string d-i netcfg/get_netmask string 255.255.255.0 d-i netcfg/get_gateway string d-i netcfg/confirm_static boolean true d-i clock-setup/utc boolean true
# Static network configuration. d-i netcfg/get_nameservers string 192.168.1.1 d-i netcfg/get_ipaddress string 192.168.1.42 d-i netcfg/get_netmask string 255.255.255.0 d-i netcfg/get_gateway string 192.168.1.1 d-i netcfg/confirm_static boolean true
# If you want the preconfiguration file to work on systems both with and # without a dhcp server, uncomment these lines and the static network # configuration below. d-i netcfg/dhcp_failed note d-i netcfg/dhcp_options select Configure network manually # Static network configuration. d-i netcfg/get_nameservers string 192.168.1.1 d-i netcfg/get_ipaddress string 192.168.1.42 d-i netcfg/get_netmask string 255.255.255.0 d-i netcfg/get_gateway string 192.168.1.1 d-i netcfg/confirm_static boolean true
Es pot xifrar amb:
$ echo "PASSWORD" | mkpasswd -s -m md5
Un exemple:
# To create a normal user account. d-i passwd/user-fullname string uAlumne d-i passwd/username string alum-01 # Normal user's password, either in clear text #d-i passwd/user-password password insecure #d-i passwd/user-password-again password insecure # or encrypted using an MD5 hash. #Sense paraula de pas: $ echo "" | mkpasswd -s -H MD5 d-i passwd/user-password-crypted password $1$Mf6oFFt3$qikth6md0cMCaLq/t2OTz0 # Create the first user with the specified UID instead of the default. #d-i passwd/user-uid string 1010 # The installer will warn about weak passwords. If you are sure you know # what you're doing and want to override it, uncomment this. d-i user-setup/allow-password-weak boolean true # The user account will be added to some standard initial groups. To # override that, use this. d-i passwd/user-default-groups string adm dialout fax cdrom tape audio dip video plugdev fuse lpadmin netdev sambashare vboxusers
Us permet modificar el fitxer /etc/apt/sources.list del sistema que esteu instal·lant (target system).
# You can choose to install restricted and universe software, or to install # software from the backports repository. #d-i apt-setup/restricted boolean true #d-i apt-setup/universe boolean true #d-i apt-setup/backports boolean true # Uncomment this if you don't want to use a network mirror. #d-i apt-setup/use_mirror boolean false # Select which update services to use; define the mirrors to be used. # Values shown below are the normal defaults. #d-i apt-setup/services-select multiselect security #d-i apt-setup/security_host string security.ubuntu.com #d-i apt-setup/security_path string /ubuntu
Per afegir repositoris locals o altres (es recomana que tinguin clau):
# Additional repositories, local[0-9] available #d-i apt-setup/local0/repository string \ # http://local.server/ubuntu lucid main #d-i apt-setup/local0/comment string local server # Enable deb-src lines #d-i apt-setup/local0/source boolean true # URL to the public key of the local repository; you must provide a key or # apt will complain about the unauthenticated repository and so the # sources.list line will be left commented out #d-i apt-setup/local0/key string http://local.server/key
Seguretat:
# By default the installer requires that repositories be authenticated # using a known gpg key. This setting can be used to disable that # authentication. Warning: Insecure, not recommended. #d-i debian-installer/allow_unauthenticated string true
Vegem un exemple de com afegir VirtualBox:
# Additional repositories, local[0-9] available d-i apt-setup/local0/repository string \ http://download.virtualbox.org/virtualbox/debian maverick non-free d-i apt-setup/local0/comment string VirtualBox # URL to the public key of the local repository; you must provide a key or # apt will complain about the unauthenticated repository and so the # sources.list line will be left commented out d-i apt-setup/local0/key string http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
Exemple extret d'una Ubuntu server acabada d'instal·lar a on s'ha escolli durant la instal·lació instal·lar LAMP i SSH
$ sudo debconf-get-selections --install | grep tasksel tasksel tasksel/terminal terminal tasksel tasksel/first multiselect OpenSSH server, LAMP server tasksel tasksel/skip-tasks string tasksel tasksel/tasks multiselect Basic Ubuntu server, OpenSSH server, LAMP server tasksel tasksel/force-tasks string server tasksel tasksel/desktop multiselect gnome tasksel tasksel/limit-tasks string
Cal posar la línia:
tasksel tasksel/first multiselect ubuntu-desktop
Consulteu també: https://help.ubuntu.com/11.10/installation-guide/i386/preseed-contents.html#preseed-partman
Un exemple senzill (formata tot el disc, sense LVM i amb ext4):
#PARTMAN: ALL HD, ONE PARTITION, WITHOUT LVM, EXT4 d-i partman-auto/method string regular d-i partman-auto/disk string /dev/sda d-i partman-auto/select_disk string #d-i partman-lvm/device_remove_lvm boolean true #d-i partman-lvm/confirm boolean true d-i partman/confirm_write_new_label boolean true d-i partman/choose_partition select Finish partitioning and write changes to disk d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/default_filesystem string ext4
Exemple amb partició fixa:
#Step 4 d-i partman-auto/disk string /dev/sda d-i partman-auto/method string regular #simple receipe #d-i partman-auto/choose_recipe select home #individual receipe #the next line is one line ! d-i partman-auto/expert_recipe string seperate-home :: 500 10000 20000 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . 64 512 300% linux-swap method{ swap } format{ } . 100 10000 1000000000 ext4 method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /home } . d-i partman/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true
L'ajuda de com es formulen expert recipes la podeu trobar a:
/usr/share/doc/debian-installer/devel/partman-auto-recipe.txt
El contingut d'aquest fitxers és:
Contingut fitxer /usr/share/doc/debian-installer/devel/partman-auto-recipe.txt
IMPORTANT: Segons la documentació de las expert recipes (fitxer /usr/share/doc/debian-installer/devel/partman-auto-recipe.txt apartat LIMITATIONS) l'algorisme utilitzat obliga a que s'utilitzi tot l'espai i per tant i hagi com a mínim una partició que ocupi tot l'espai lliure
El següent és un exemple de fitxer de preseed que manté la partició de Windows ja existent:
# Ubuntu Server Quick Install # Original script: Dustin Kirkland <[email protected]> # Modified by Sergi Tur # * Original Documentation: http://bit.ly/uquick-doc # * Modified Documentation: http://acacha.org/mediawiki/index.php/Preseed d-i localechooser/shortlist es d-i localechooser/shortlist seen true d-i debian-installer/locale string ca_ES.UTF-8 d-i debian-installer/splash boolean false d-i console-setup/ask_detect boolean false d-i console-setup/layoutcode string es d-i console-setup/variantcode string d-i netcfg/get_nameservers string d-i netcfg/get_ipaddress string d-i netcfg/get_netmask string 255.255.255.0 d-i netcfg/get_gateway string d-i netcfg/confirm_static boolean true d-i clock-setup/utc boolean true d-i partman-auto/init_automatically_partition select biggest_free #d-i partman-auto/method string regular d-i partman-lvm/device_remove_lvm boolean true d-i partman-lvm/confirm boolean true d-i partman-md/device_remove_md boolean true # If not, you can put an entire recipe into the preconfiguration file in one # (logical) line. This example creates suitable swap, and uses the rest of #the space for the root partition: d-i partman-auto/expert_recipe string \ root :: \ 500 10000 32000 ext3 \ $primary{ } method{ format } format{ } \ use_filesystem{ } filesystem{ ext3 } \ mountpoint{ / } \ . \ 64 512 200% linux-swap \ $primary{ } method{ swap } format{ } \ . \ 100 1000 1000000000 ext3 \ $primary{ } method{ keep } \ . d-i partman-basicmethods/method_only boolean false d-i partman/confirm_write_new_label boolean true d-i partman/choose_partition select Finish partitioning and write changes to disk d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/default_filesystem string ext3 d-i clock-setup/utc boolean true d-i clock-setup/ntp boolean true d-i clock-setup/ntp-server string ntp.ubuntu.com d-i base-installer/kernel/image string linux-generic d-i passwd/root-login boolean false d-i passwd/make-user boolean true d-i passwd/user-fullname string ubuntu d-i passwd/username string ubuntu d-i passwd/user-password-crypted password $6$.1eHH0iY$ArGzKX2YeQ3G6U.mlOO3A.NaL22Ewgz8Fi4qqz.Ns7EMKjEJRIW2Pm/TikDptZpuu7I92frytmk5YeL.9fRY4. d-i passwd/user-uid string d-i user-setup/allow-password-weak boolean false d-i user-setup/encrypt-home boolean false d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare d-i mirror/country string manual d-i mirror/http/hostname string es.archive.ubuntu.com d-i mirror/http/directory string /ubuntu d-i mirror/http/proxy string d-i apt-setup/services-select multiselect security d-i apt-setup/security_host string security.ubuntu.com d-i apt-setup/security_path string /ubuntu # Additional repositories, local[0-9] available d-i apt-setup/local0/repository string http://download.virtualbox.org/virtualbox/debian natty contrib non-free d-i apt-setup/local0/comment string VirtualBox d-i apt-setup/local1/repository string http://archive.canonical.com/ natty partner d-i apt-setup/local1/comment string CanonicalJava # URL to the public key of the local repository; you must provide a key or # apt will complain about the unauthenticated repository and so the # sources.list line will be left commented out d-i apt-setup/local0/key string http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc d-i debian-installer/allow_unauthenticated string false d-i pkgsel/upgrade select safe-upgrade d-i pkgsel/language-packs multiselect d-i pkgsel/update-policy select none d-i pkgsel/updatedb boolean true tasksel tasksel/first multiselect ubuntu-desktop d-i grub-installer/skip boolean false d-i lilo-installer/skip boolean false d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i finish-install/keep-consoles boolean false d-i finish-install/reboot_in_progress note d-i cdrom-detect/eject boolean true d-i debian-installer/exit/halt boolean false d-i debian-installer/exit/poweroff boolean false sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note ldap-auth-config ldap-auth-config/dbrootlogin boolean false ldap-auth-config ldap-auth-config/pam_password select exop ldap-auth-config ldap-auth-config/move-to-debconf boolean true ldap-auth-config ldap-auth-config/ldapns/ldap-server string ldap://ldap.iesebre.com ldap-auth-config ldap-auth-config/ldapns/base-dn string ou=All,dc=iesebre,dc=com ldap-auth-config ldap-auth-config/ldapns/ldap_version select 3 ldap-auth-config ldap-auth-config/dblogin boolean false ldap-auth-config ldap-auth-config/override boolean true d-i pkgsel/include string byobu vim openssh-server joe ubuntu-restricted-extras samba smbfs ssh whois tcpdump traceroute ipcalc nmap dnstracer ssh ethtool joe geany gobby nfs-client whois inkscape gimp gimp-help-es audacity avidemux vlc filezilla language-pack-ca language-support-ca gparted ksnapshot kolourpaint4 gparted ldap-auth-config sun-java6-jdk virtualbox-4.1 #byobu byobu/launch-by-default boolean true d-i preseed/late_command string in-target chsh -s /bin/bash ; in-target wget http://www.iesebre.com/ubuntu/addusers.sh ; in-target bash addusers.sh ; \ in-target rm addusers.sh;in-target wget http://www.iesebre.com/ubuntu/modifyNsswitch.sh; in-target bash postinstall.sh; in-target rm postinstall.sh;
NOTA: L'última partició només la posem per la limitació, després no la utilitzem per a res.
https://help.ubuntu.com/8.04/installation-guide/i386/preseed-contents.html#preseed-account
Un exemple amb comentaris:
# Skip creation of a root account (normal user account will be able to # use sudo). The default is false; preseed this to true if you want to set # a root password. #d-i passwd/root-login boolean false # Alternatively, to skip creation of a normal user account. #d-i passwd/make-user boolean false # Root password, either in clear text #d-i passwd/root-password password r00tme #d-i passwd/root-password-again password r00tme # or encrypted using an MD5 hash. #d-i passwd/root-password-crypted password [MD5 hash] # To create a normal user account. #d-i passwd/user-fullname string Ubuntu User #d-i passwd/username string ubuntu # Normal user's password, either in clear text #d-i passwd/user-password password insecure #d-i passwd/user-password-again password insecure # or encrypted using an MD5 hash. #d-i passwd/user-password-crypted password [MD5 hash] # Create the first user with the specified UID instead of the default. #d-i passwd/user-uid string 1010 # The user account will be added to some standard initial groups. To # override that, use this. #d-i passwd/user-default-groups string audio cdrom video
Un exemple amb usuari root actiu i un altre usuari:
#USERS: ACTIVATE ROOT AND DEFAULT USER d-i passwd/root-login true d-i passwd/root-password-crypted password $6$Zx1lKcCN$1EdZbW26p84gHBHyW4U2RrfJ3eWuVIHN6/hz63Uwyc3XVoyHiHJKO /uDgTnqTJL9pEENVh0VTqQwjj5gJFW7B1 #d-i passwd/root-password password $6$Zx1lKcCN$1EdZbW26p84gHBHyW4U2RrfJ3eWuVIHN6/hz63Uwyc3XVoyHiHJKO /uDgTnqTJL9pEENVh0VTqQwjj5gJFW7B1 #d-i passwd/root-password-again password $6$Zx1lKcCN$1EdZbW26p84gHBHyW4U2RrfJ3eWuVIHN6/hz63Uwyc3XVoyHiHJKO/uDgTnqTJL9pEENVh0VTqQwjj5gJFW7B1 d-i passwd/make-user boolean true d-i passwd/user-fullname string Sergi Tur Badenas d-i passwd/username string sergi d-i passwd/user-password-crypted password $6$MHaRzedk$wzllNt3sfdHxQtP/VeSKXlqCZlNwA7J4EuCdclWLL5AzPlFiFK9cCX0hiRRHzgwNUN745Ad0RiSEaj/0aaMqN0 #d-i passwd/user-uid string d-i user-setup/allow-password-weak boolean false d-i user-setup/encrypt-home boolean false d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare admin
IMPORTANT: Si es marca d-i passwd/root-login true aleshores no es crea el grup admin i per tant el usuari que no es root no podrà fer sudo. Per arreglar-ho cal posar un script que crei el grup admin
Cal executar-ho en una màquina Debian acabada d'instal·lar
$ sudo apt-get install debconf-utils $ sudo debconf-get-selections --installer > somefile.txt $ sudo debconf-get-selections >> somefile.txt
NOTA: No funciona quan la instal·lació s'ha fet amb Ubiquity (Ubuntus Desktop). es pot fer amb l'Ubuntu Alternate
Exemple de fitxer obtingut:
# for internal use; can be preseeded partman-basicfilesystems partman/automount boolean false # Serveis a emprar: # Choices: actualitzacions de seguretat (des de security.ubuntu.com), actualitzacions volàtils (des de volatile.debian.org) apt-setup-udeb apt-setup/services-select multiselect security # Volum físic no existent partman-auto-lvm partman-auto-lvm/no_such_pv error # NFS mount failed d-i initrd-kickseed/nfs-mount-failed error # Keyboard layout: # Choices: Spain, Spain - Asturian variant with bottom-dot H and bottom-dot L, Spain - Catalan variant with middle-dot L, Spain - Dvorak, Spain - #Eliminate dead keys, Spain - Include dead tilde, Spain - Macintosh, Spain - Sun dead keys d-i console-setup/variant select Spain - Catalan variant with middle-dot L # Voleu comprovar la integritat d'un altre CD-ROM? d-i cdrom-checker/nextcd boolean false # Install GRUB? grub-installer grub-installer/grub_not_mature_on_this_platform boolean false # Active devices for the RAID array: # Choices: partman-md partman-md/raiddevs multiselect # S'ha iniciat el servidor web, però no hi ha xarxa d-i save-logs/no_network note # Error de Debootstrap bootstrap-base base-installer/debootstrap/error/invalidrel error # for internal use only d-i debian-installer/consoledisplay string console-setup # No s'ha pogut configurar el GRUB grub-installer grub-installer/sataraid-error error # Mòdul requerit per la vostra unitat de disc: # Choices: continuar sense cap unitat de disc, , cap de les anteriors disk-detect disk-detect/module_select select continue with no disk drive # Voleu utilitzar programari del component «universe»? apt-mirror-setup apt-setup/universe boolean true # for internal use; can be preseeded apt-setup-udeb apt-setup/security_path string /ubuntu # for internal use only # Choices: d-i debian-installer/fallbacklocale select ca_ES.UTF-8 # Activate Serial ATA RAID devices? disk-detect disk-detect/activate_dmraid boolean true # d-i debian-installer/shell-plugin terminal # for internal use; can be preseeded disk-detect disk-detect/multipath/enable boolean false # Voleu permetre les entrades com a root? user-setup-udeb passwd/root-login boolean false # Seleccioneu un país, territori, o àrea: # Choices: Andorra, Espanya, França, Itàlia, altre d-i localechooser/shortlist select ES # Punts de muntatge idèntics per a dos sistemes de fitxers partman-target partman-target/same_mountpoint error # Keep unsupported options ()? d-i console-setup/unsupported_options boolean true # Voleu utilitzar Ethernet FireWire? ethdetect ethdetect/use_firewire_ethernet boolean false # Voleu configurar la xarxa automàticament amb DHCP? netcfg netcfg/use_dhcp boolean true # Esquema de partició: # Choices: Tots els fitxers en una partició (recomanat per a nous usuaris), Partició /home separada, Particions /home\, /usr\, /var i /tmp separades partman-auto partman-auto/choose_recipe select /lib/partman/recipes/30atomic # Voleu tornar al menú i corregir els errors? partman-basicfilesystems partman-basicfilesystems/check_failed boolean # Tipus de clau de xifrat per a aquesta partició: # Choices: partman-crypto partman-crypto/keytype select # The size entered is invalid partman-partitioning partman-partitioning/bad_new_size error # Grup de volums a reduir: # Choices: partman-lvm partman-lvm/vgreduce_names select # No s'ha pogut crear un sistema de fitxers partman-reiserfs partman-reiserfs/create_failed error # Dispositius per al nou grup de volums: # Choices: partman-lvm partman-lvm/vgcreate_parts multiselect # No es pot instal·lar el sistema base bootstrap-base base-installer/cannot_install error # No s'ha pogut partir el disc seleccionat partman-auto partman-auto/autopartitioning_failed error # Voleu escriure els canvis anteriors als discs i continuar? partman-partitioning partman-partitioning/confirm_copy boolean # S'ha produït un error inesperat en crear el grup de volums partman-auto-lvm partman-auto-lvm/vg_create_error error # Nom: netcfg netcfg/get_hostname string ubuntu # for internal use; can be preseeded d-i preseed/include_command string # Seleccioneu una localització dins el vostre fus horari: # Choices: Lisbon, Madeira Islands, Azores, Select from worldwide list tzsetup-udeb tzsetup/country/PT select # S'ha produït un error en suprimir el grup de volums partman-lvm partman-lvm/vgdelete_error error # Voleu continuar amb la instal·lació dels components criptogràfics tot i que no hi ha suficient memòria? partman-crypto partman-crypto/install_udebs_low_mem boolean # Espai lliure no utilitzable partman-auto partman-auto/unusable_space error # És aquesta informació correcta? netcfg netcfg/confirm_static boolean true # Seleccioneu un país, territori, o àrea: # Choices: Canadà, Mèxic, Saint Pierre i Miquelon, Estats Units d-i localechooser/countrylist/North_America select # Choose a country, territory or area: # Choices: Greece, Cyprus, other d-i localechooser/shortlist/el select # El rellotge del sistema està establert a UTC? clock-setup clock-setup/utc boolean true # Algorisme de generació del vector d'inicialització per a aquesta partició: # Choices: partman-crypto partman-crypto/ivalgorithm select # Seleccioneu un país, territori, o àrea: # Choices: Algèria, Angola, Benín, Botswana, Burkina Faso, Burundi, Camerun, Cap Verd, República Centreafricana, Txad, Congo, República Democràtica #del Congo, Djibouti, Egipte, Guinea Equatorial, Eritrea, Etiòpia, Gabon, Gàmbia, Ghana, Guinea, Guinea Bissau, Kenya, Lesotho, Libèria, Libya, #Malawi , Mali, Mauritània, Marroc, Moçambic, Namíbia, Níger, Nigèria, Rwanda, Sao Tome i Príncipe, Senegal, Sierra Leone, Somàlia, Sudàfrica, Sudan, #Swazilàndia, Tanzània, Togo, Tunísia, Uganda, Sàhara Occidental, Zàmbia, Zimbabwe d-i localechooser/countrylist/Africa select # S'ha produït un error d'introducció de la frase de pas partman-crypto partman-crypto/passphrase-mismatch error # Voleu continuar amb la partició? partman-partitioning partman-partitioning/unknown_label boolean true # Nom d'usuari pel vostre compte: user-setup-udeb passwd/username string sergi # Manquen opcions de xifratge requerides partman-crypto partman-crypto/options_missing error # S'ha produït un error en crear un nou volum lògic partman-lvm partman-lvm/lvcreate_error error # Choose a country, territory or area: # Choices: Finland, Sweden, other d-i localechooser/shortlist/sv select # Ha fallat l'operació de redimensionat partman-partitioning partman-partitioning/new_size_commit_failed error # Choose a country, territory or area: # Choices: Cyprus, Turkey, other d-i localechooser/shortlist/tr select # Intèrpret d'ordres interactiu d-i di-utils-shell/do-shell note # # Choices: partman-base partman/exception_handler select # Voleu continuar amb la partició? partman-target partman-target/mount_failed boolean true # for internal use only # Choices: dapper, hardy, intrepid, jaunty, karmic d-i cdrom/suite select karmic # for internal use; can be preseeded partman-auto partman-auto/expert_recipe string # for internal use; relative boot directory for grub4dos grub-installer grub-installer/bootdev_directory string # Com utilitzar aquesta partició: # Choices: partman-target partman-target/choose_method select # Introduïu el directori de la rèplica de l'arxiu d'Ubuntu: choose-mirror-bin mirror/http/directory string /ubuntu/ # Nucli a instal·lar: # Choices: linux-generic,linux-image-generic,linux-image-2.6.31-14-generic, cap bootstrap-base base-installer/kernel/image select linux-generic # Mòdul requerit per la vostra targeta Ethernet: # Choices: cap targeta ethernet, , cap de les anteriors ethdetect ethdetect/module_select select no ethernet card # No s'ha pogut suprimir automàticament les dades LVM partman-lvm partman-lvm/device_remove_lvm_span error # Error en la configuració del xifrat partman-crypto partman-crypto/crypto_root_needs_boot error # Grup de volums: # Choices: partman-lvm partman-lvm/lvcreate_vgnames select # Seleccioneu una ciutat dins el vostre fus horari: # Choices: Jakarta, Pontianak, Makassar, Jayapura, Select from worldwide list tzsetup-udeb tzsetup/country/ID select # La supressió de les dades de ha fallat partman-crypto partman-crypto/erase_failed error # Voleu tornar al menú i continuar amb la partició? partman-efi partman-efi/no_efi boolean # Number of active devices for the RAID array: partman-md partman-md/raiddevcount string # Error de Debootstrap bootstrap-base base-installer/debootstrap/error/unknownrelsig error # Seleccioneu un pas de la instal·lació: # Choices: d-i debian-installer/missing-provide select ${DEFAULT} # Voleu comprovar la integritat del CD-ROM? d-i cdrom-checker/start boolean false # País de la rèplica de l'arxiu d'Ubuntu: # Choices: introdueix la informació manualment, Andorra, Unió dels Emirats Àrabs, Afganistan, Antigua i Barbuda, Anguilla, Albània, Armènia, Antilles Holandeses, Angola, Antàrtida, Argentina, Samoa Americana, Àustria, Austràlia, Aruba, AX, Azerbaitjan, Bòsnia i Hercegovina, Barbados, Bangla Desh, Bèlgica, Burkina Faso, Bulgària, Bahrain, Burundi, Benín, BL, Bermuda, Brunei (Negara Brunei Darussalam), Bolívia, Brasil, Bahames, Bhutan, Illa Bouvet, Botswana, Bielorússia, Belize, Canadà, Illes Cocos (Keeling), República Democràtica del Congo, República Centreafricana, Congo, Suïssa, CI, Illes Cook, Xile, Camerun, Xina, Colòmbia, Costa Rica, Cuba, Cap Verd, Illa Christmas, Xipre, República Txeca, Alemanya, Djibouti, Dinamarca, Dominica, República Dominicana, Algèria, Equador, Estònia, Egipte, Sàhara Occidental, Eritrea, Espanya, Etiòpia, Finlàndia, Fiji, Illes Malvines (Falkland), Micronèsia (Estats Federats), Illes Fèroe, França, Gabon, Regne Unit, Grenada, Geòrgia, Guaiana Francesa, Guernsey, Ghana, Gibraltar, Groenlàndia, Gàmbia, Guinea, Guadalupe, Guinea Equatorial, Grècia, Illes Geòrgia del Sud i Sandwich del Sud, Guatemala, Guam, Guinea Bissau, Guyana, Hong Kong, Illa Heard i Illes McDonald, Hondures, Croàcia, Haití, Hongria, Indonèsia, Irlanda, Israel, Illa de Man, Índia, Territori Britànic de l'Oceà Índic, Iraq, Iran, Islàndia, Itàlia, Jersey, Jamaica, Jordània, Japó, Kenya, Kirguizistan, Cambodja, Kiribati, Comores, Saint Christopher i Nevis, Corea del Nord, Corea del Sud, Kuwait, Illes Caiman, Kazakhstan, República Democràtica Popular de Laos, Líban, Saint Lucia, Liechtenstein, Sri Lanka, Libèria, Lesotho, Lituània, Luxemburg, Letònia, LY, Marroc, Mònaco, Moldàvia, Montenegro, Saint-Martin (zona francesa), Madagascar, Illes Marshall, Macedònia\, República de, Mali, Myanmar, Mongòlia, Macau, Illes Marianes del Nord, Martinica, Mauritània, Montserrat, Malta, Maurici, Maldives, Malawi, Mèxic, Malàisia, Moçambic, Namíbia, Nova Caledònia, Níger, Illa Norfolk, Nigèria, Nicaragua, Països Baixos (Holanda), Noruega, Nepal, Nauru, Niue, Nova Zelanda, Oman, Panamà, Perú, Polinèsia francesa, Papua Nova Guinea, Filipines, Pakistan, Polònia, Saint Pierre i Miquelon, Pitcairn, Puerto Rico, Palestina (territori ocupat), Portugal, Palau, Paraguai, Qatar, Reunion, Romania, Sèrbia, Federació Russa, Rwanda, Aràbia Saudita, Illes Salomó, Seychelles, Sudan, Suècia, Singapur, Saint Helena, Eslovènia, Svalbard i Jan Mayen, Eslovàquia, Sierra Leone, San Marino, Senegal, Somàlia, Surinam, Sao Tome i Príncipe, El Salvador, República Àrab Síria, Swazilàndia, Illes Turks i Caicos, Txad, Territoris Francesos del Sud, Togo, Tailàndia, Tadjikistan, Tokelau, Timor Oriental, Turkmenistan, Tunísia, Tonga, Turquia, Trinitat i Tobago, Tuvalu, Taiwan, Tanzània, Ucraïna, Uganda, Illes Perifèriques Menors dels EUA, Estats Units, Uruguai, Uzbekistan, Santa Seu (Estat del Vaticà), Saint Vincent i les Grenadines, Veneçuela, Illes Verges (Britàniques), Illes Verges (Americanes), Vietnam, Vanuatu, Wallis i Futuna, Samoa, Iemen, Mayotte, Sudàfrica, Zàmbia, Zimbabwe choose-mirror-bin mirror/http/countries select ES # for internal use only user-setup-udeb passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare # Seleccioneu una localització dins el vostre fus horari: # Choices: Guayaquil, Galapagos, Select from worldwide list tzsetup-udeb tzsetup/country/EC select # No s'instal·larà en un objectiu brut base-installer base-installer/unclean_target_cancel error # No s'ha trobat cap partició per a xifrar partman-crypto partman-crypto/nothing_to_setup note # Nova mida per a la partició: partman-partitioning partman-partitioning/new_partition_size string some number # No s'ha pogut obtindre el fitxer de preconfiguració d-i preseed/retrieve_error error # Directori on desar els registres de depuració: d-i save-logs/directory string /mnt # La configuració automàtica de la xarxa ha fallat netcfg netcfg/dhcp_failed note # for internal use only d-i debconf/showold boolean false # No s'ha pogut obrir el fitxer de sumes de comprovació d-i cdrom-checker/md5file_failed error # Informació sobre el servidor intermediari d'FTP (en blanc per a cap): choose-mirror-bin mirror/ftp/proxy string # Really delete this software RAID device? partman-md partman-md/deleteverify boolean false # Encrypted volumes to delete: # Choices: partman-crypto partman-crypto/delete/names multiselect # for internal use; can be preseeded bootstrap-base base-installer/kernel/linux/initramfs-generators string initramfs-tools yaird # Nova mida per a la partició: partman-partitioning partman-partitioning/new_size string some number # Seleccioneu un país, territori, o àrea: # Choices: Andorra, Espanya, França, Itàlia, altre d-i localechooser/shortlist/ca select # ESSID wireless per a : netcfg netcfg/wireless_essid string # Volum lògic: # Choices: partman-lvm partman-lvm/lvdelete_lvnames select # No s'ha pogut instal·lar el nucli seleccionat bootstrap-base base-installer/kernel/failed-install error # No s'ha pogut configurar el GRUB grub-installer grub-installer/update-grub-failed error # No s'ha pogut crear un sistema de fitxers partman-ext3 partman-ext3/create_failed error # Opcions del rang de recursos de PCMCIA: d-i hw-detect/pcmcia_resources string # for internal use; can be preseeded # Choices: none, safe-upgrade, full-upgrade pkgsel pkgsel/upgrade select safe-upgrade # Passarel·la inaccessible netcfg netcfg/gateway_unreachable error # for internal use; can be preseeded grub-installer grub-installer/skip boolean false # for internal use; can be preseeded bootstrap-base base-installer/kernel/linux/extra-packages string # No RAID partitions available partman-md partman-md/noparts error # Active devices for the RAID0 array: # Choices: partman-md partman-md/raid0devs multiselect # for internal use d-i console-setup/modelcode string pc105 # Grup de volums a estendre: # Choices: partman-lvm partman-lvm/vgextend_names select # S'estan establint les variables del microprogramari per a l'arrencada automàtica nobootloader nobootloader/confirmation_powerpc_chrp_pegasos note # No s'ha pogut muntar el disquet d-i save-logs/floppy_mount_failed error # for internal use; can be preseeded apt-setup-udeb apt-setup/volatile_host string volatile.debian.org # for internal use only d-i debconf/language string ca # Servidor NTP a emprar: clock-setup clock-setup/ntp-server string ntp.ubuntu.com # No s'ha definit cap volum físic al grup de volums partman-auto-lvm partman-auto-lvm/no_pv_in_vg error # Choose a country, territory or area: # Choices: China, Taiwan, Singapore, Hong Kong, other d-i localechooser/shortlist/zh_TW select # for internal use; can be preseeded d-i oem-config/enable boolean false # Adreces dels servidors de noms: netcfg netcfg/get_nameservers string # Dummy template for preseeding unavailable questions d-i debian-installer/dummy string # Paràmetres addicionals per al mòdul : d-i hw-detect/retry_params string # Voleu tornar al menú i corregir aquest problema? partman-ext3 partman-ext3/boot_not_ext2_or_ext3 boolean # for internal use only user-setup-udeb user-setup/allow-password-empty boolean false # S'ha detectat un CD-ROM incorrecte d-i cdrom-detect/wrong-cd error # Error en la configuració del xifrat partman-crypto partman-crypto/crypto_boot_not_possible error # Interfície de xarxa principal: # Choices: netcfg netcfg/choose_interface select # Problema de configuració d'apt apt-cdrom-setup apt-setup/cdrom/failed error # for internal use; can be preseeded d-i cdrom-detect/eject boolean true # No s'ha pogut baixar els components del xifratge partman-crypto partman-crypto/install_udebs_failure error # for internal use only user-setup-udeb passwd/user-uid string # Choose a country, territory or area: # Choices: Argentina, Bolivia, Chile, Colombia, Costa Rica, Ecuador, El Salvador, Spain, United States, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, Puerto Rico, Dominican Republic, Uruguay, Venezuela, othe r d-i localechooser/shortlist/es select # Error a la configuració del RAID partman-md partman-md/commit_failed error # for internal use; can be preseeded d-i preseed/run string # No es poden desar els registres de depuració d-i save-logs/bad_directory error # Choose a country, territory or area: # Choices: Belgium, Canada, France, Luxembourg, Switzerland, other d-i localechooser/shortlist/fr select # No s'ha detectat cap partició d'arrencada elilo-installer elilo-installer/no-bootpart error # Encryption configuration actions # Choices: Create encrypted volumes, Finish partman-crypto partman-crypto/mainmenu select # Error de Debootstrap bootstrap-base base-installer/debootstrap/fallback-error error # for internal use; can be preseeded apt-setup-udeb apt-setup/security_host string security.ubuntu.com # Insufficient memory d-i lowmem/insufficient error # El dispositiu ja està en ús partman-base partman-base/devicelocked error # No s'ha detectat cap volum físic partman-lvm partman-lvm/vgreduce_nosel error # No s'ha pogut muntar /target/proc nobootloader nobootloader/mounterr error # Seleccioneu un disc a partir: # Choices: SCSI1 (0\,0\,0) (sda) - 8.6 GB ATA VBOX HARDDISK partman-auto partman-auto/select_disk select /var/lib/partman/devices/=dev=sda # for internal use d-i console-setup/fontsize string 16 # Ubuntu version to install: # Choices: dapper, hardy, intrepid, jaunty, karmic choose-mirror-bin mirror/suite select karmic # Choose a country, territory or area: # Choices: China, Taiwan, Singapore, Hong Kong, other d-i localechooser/shortlist/zh_CN select # Seleccioneu el vostre fus horari: # Choices: Eastern, Central, Mountain, Pacific, Alaska, Hawaii, Arizona, East Indiana, Samoa, Select from worldwide list ...
Amb isomaster podeu modificar un fitxer iso per tal d'afegir una entrada del menú d'instal·lació que sigui instal·lació desatesa. Amb un CD d'Ubuntu Alternate posar al lector de CDs:
$ sudo apt-get install isomaster $ dd if=/dev/sr0 of=ubuntu-9.10-alternate-i386.iso $ isomaster ubuntu-9.10-alternate-i386.iso
Al menú eines>Opcions podeu especificar el vostre editor preferit (per exemple gedit):
El fitxer que cal modificar és:
isolinux/text.cfg
Per afegir un preseed per xarxa:
default unattended label unattended menu label ^Unattended Installation Network kernel /casper/vmlinuz append preseed/url=http://mywebserver.mydomain.tld/preseed/ubuntu-9.04.seed debian-installer/locale=ca_ES netcfg/choose_interface=auto initrd=/casper/initrd.lz boot=casper priority=critical --
Per afegir un preseed al mateix CD:
label unattendedCD menu label ^Unattended Installation CD kernel /casper/vmlinuz append preseed/file=/cdrom/preseed/example-preseed_ca.txt debian-installer/locale=ca_ES netcfg/choose_interface=auto initrd=/casper/initrd.lz boot=casper priority=critical --
El fitxer preseed pot estar a Internet/Xarxa:
append preseed/url=http://mywebserver.mydomain.tld/preseed/ubuntu-9.04.seed
https://help.ubuntu.com/11.04/installation-guide/example-preseed.txt
http://www.debian.org/releases/stable/example-preseed.txt
#### Contents of the preconfiguration file (for &releasename;) ### Localization # Locale sets language and country. d-i debian-installer/locale string ca_ES.UTF-8 # Keyboard selection. # Disable automatic (interactive) keymap detection. d-i console-setup/ask_detect boolean false #d-i console-setup/modelcode string pc105 d-i console-setup/layoutcode string es # To select a variant of the selected layout (if you leave this out, the # basic form of the layout will be used): d-i console-setup/variantcode string cat ### Network configuration # netcfg will choose an interface that has link if possible. This makes it # skip displaying a list if there is more than one interface. d-i netcfg/choose_interface select auto # To pick a particular interface instead: #d-i netcfg/choose_interface select eth1 # If you have a slow dhcp server and the installer times out waiting for # it, this might be useful. #d-i netcfg/dhcp_timeout string 60 # If you prefer to configure the network manually, uncomment this line and # the static network configuration below. #d-i netcfg/disable_dhcp boolean true # If you want the preconfiguration file to work on systems both with and # without a dhcp server, uncomment these lines and the static network # configuration below. #d-i netcfg/dhcp_failed note #d-i netcfg/dhcp_options select Configure network manually # Static network configuration. #d-i netcfg/get_nameservers string 192.168.1.1 #d-i netcfg/get_ipaddress string 192.168.1.42 #d-i netcfg/get_netmask string 255.255.255.0 #d-i netcfg/get_gateway string 192.168.1.1 #d-i netcfg/confirm_static boolean true # Any hostname and domain names assigned from dhcp take precedence over # values set here. However, setting the values still prevents the questions # from being shown, even if values come from dhcp. d-i netcfg/get_hostname string unassigned-hostname-iesebre d-i netcfg/get_domain string unassigned-domain-iesebre # Disable that annoying WEP key dialog. d-i netcfg/wireless_wep string # The wacky dhcp hostname that some ISPs use as a password of sorts. #d-i netcfg/dhcp_hostname string radish # If non-free firmware is needed for the network or other hardware, you can # configure the installer to always try to load it, without prompting. Or # change to false to disable asking. #d-i hw-detect/load_firmware boolean true ### Mirror settings # If you select ftp, the mirror/country string does not need to be set. #d-i mirror/protocol string ftp #d-i mirror/country string manual #d-i mirror/http/hostname string http.us.debian.org #d-i mirror/http/directory string /ubuntu d-i mirror/http/proxy string # Alternatively: by default, the installer uses CC.archive.ubuntu.com where # CC is the ISO-3166-2 code for the selected country. You can preseed this # so that it does so without asking. d-i mirror/http/mirror select es.archive.ubuntu.com # Suite to install. #d-i mirror/suite string &releasename; # Suite to use for loading installer components (optional). #d-i mirror/udeb/suite string &releasename; # Components to use for loading installer components (optional). #d-i mirror/udeb/components multiselect main, restricted, universe, multiverse ### Clock and time zone setup # Controls whether or not the hardware clock is set to UTC. d-i clock-setup/utc boolean true # You may set this to any valid setting for $TZ; see the contents of # /usr/share/zoneinfo/ for valid values. d-i time/zone string Europe/Madrid # Controls whether to use NTP to set the clock during the install d-i clock-setup/ntp boolean true # NTP server to use. The default is almost always fine here. #d-i clock-setup/ntp-server string ntp.example.com ### Partitioning # If the system has free space you can choose to only partition that space. # Alternatives: custom, some_device, some_device_crypto, some_device_lvm. #d-i partman-auto/init_automatically_partition select biggest_free # Alternatively, you can specify a disk to partition. The device name must # be given in traditional non-devfs format. # Note: A disk must be specified, unless the system has only one disk. # For example, to use the first SCSI/SATA hard disk: d-i partman-auto/disk string /dev/sda # In addition, you'll need to specify the method to use. # The presently available methods are: "regular", "lvm" and "crypto" d-i partman-auto/method string regular # If one of the disks that are going to be automatically partitioned # contains an old LVM configuration, the user will normally receive a # warning. This can be preseeded away... #d-i partman-lvm/device_remove_lvm boolean true # The same applies to pre-existing software RAID array: #d-i partman-md/device_remove_md boolean true # And the same goes for the confirmation to write the lvm partitions. #d-i partman-lvm/confirm boolean true # For LVM partitioning, you can select how much of the volume group to use # for logical volumes. #d-i partman-auto-lvm/guided_size string max #d-i partman-auto-lvm/guided_size string 10GB #d-i partman-auto-lvm/guided_size string 50% # You can choose one of the three predefined partitioning recipes: # - atomic: all files in one partition # - home: separate /home partition # - multi: separate /home, /usr, /var, and /tmp partitions #d-i partman-auto/choose_recipe select atomic # Or provide a recipe of your own... # The recipe format is documented in the file devel/partman-auto-recipe.txt. # If you have a way to get a recipe file into the d-i environment, you can # just point at it. #d-i partman-auto/expert_recipe_file string /hd-media/recipe # If not, you can put an entire recipe into the preconfiguration file in one # (logical) line. This example creates a small /boot partition, suitable # swap, and uses the rest of the space for the root partition: #d-i partman-auto/expert_recipe string \ # boot-root :: \ # 40 50 100 ext3 \ # $primary{ } $bootable{ } \ # method{ format } format{ } \ # use_filesystem{ } filesystem{ ext3 } \ # mountpoint{ /boot } \ # . \ # 500 10000 1000000000 ext3 \ # method{ format } format{ } \ # use_filesystem{ } filesystem{ ext3 } \ # mountpoint{ / } \ # . \ # 64 512 300% linux-swap \ # method{ swap } format{ } \ # . d-i partman-auto/expert_recipe string \ boot-root :: \ 30000 10000p 30000 ntfs \ $primary{ } $bootable{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ntfs } \ . \ 30000 10000 30000 ext3 \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext3 } \ mountpoint{ / } \ . \ 64 512 200% linux-swap \ method{ swap } format{ } \ . # If you just want to change the default filesystem from ext3 to something # else, you can do that without providing a full recipe. d-i partman/default_filesystem string ext3 # This makes partman automatically partition without confirmation, provided # that you told it what to do using one of the methods above. d-i partman/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true ### Controlling how partitions are mounted # The default is to mount by UUID, but you can also choose "traditional" to # use traditional device names, or "label" to try filesystem labels before # falling back to UUIDs. d-i partman/mount_style select uuid ### Base system installation # Select the initramfs generator used to generate the initrd for 2.6 kernels. #d-i base-installer/kernel/linux/initramfs-generators string yaird # The kernel image (meta) package to be installed; "none" can be used if no # kernel is to be installed. #d-i base-installer/kernel/image string linux-generic ### Account setup # Skip creation of a root account (normal user account will be able to # use sudo). The default is false; preseed this to true if you want to set # a root password. #d-i passwd/root-login boolean false # Alternatively, to skip creation of a normal user account. #d-i passwd/make-user boolean false # Root password, either in clear text #d-i passwd/root-password password r00tme #d-i passwd/root-password-again password r00tme # or encrypted using an MD5 hash. d-i passwd/root-password-crypted password $1$uiQ0c5UW$ucFpGC/vMaibdqyhZ4dyw0 # To create a normal user account. d-i passwd/user-fullname string uAlumne d-i passwd/username string alum-01 # Normal user's password, either in clear text #d-i passwd/user-password password insecure #d-i passwd/user-password-again password insecure # or encrypted using an MD5 hash. #Sense paraula de pas: $ echo "" | mkpasswd -s -H MD5 d-i passwd/user-password-crypted password $1$Mf6oFFt3$qikth6md0cMCaLq/t2OTz0 # Create the first user with the specified UID instead of the default . #d-i passwd/user-uid string 1010 # The installer will warn about weak passwords. If you are sure you know # what you're doing and want to override it, uncomment this. d-i user-setup/allow-password-weak boolean true # The user account will be added to some standar d initial groups. To # override that, use this. d-i passwd/user-default-groups string adm dialout fax cdrom tape audio dip video plugdev fuse lpadmin netdev sambashare vboxusers # Set to true if you want to encrypt the first user's home directory. d-i user-setup/encrypt-home boolean false ### Apt setup # You can choose to install restricted and universe software, or to install # software from the backports repository. d-i apt-setup/restricted boolean true d-i apt-setup/universe boolean true d-i apt-setup/multiverse boolean true #d-i apt-setup/backports boolean true # Uncomment this if you don't want to use a network mirror. #d-i apt-setup/use_mirror boolean false # Select which update services to use; define the mirrors to be used. # Values shown below are the normal defaults. #d-i apt-setup/services-select multiselect security #d-i apt-setup/security_host string security.ubuntu.com #d-i apt-setup/security_path string /ubuntu #Afegir Virtual Box # Additional repositories, local[0-9] available #d-i apt-setup/local0/repository string http://download.virtualbox.org/virtualbox/debian &releasename; non-free #No va releasename! d-i apt-setup/local0/repository string http://download.virtualbox.org/virtualbox/debian karmic non-free #d-i apt-setup/local0/repository string http://192.168.0.40/virtualbox/debian &releasename; non-free d-i apt-setup/local0/comment string Virtual Box # Enable deb-src lines #d-i apt-setup/local0/source boolean true # URL to the public key of the local repository; you must provide a key or # apt will complain about the unauthenticated repository and so the # sources.list line will be left commented out #d-i apt-setup/local0/key string http://192.168.0.40/virtualbox/debian/sun_vbox.asc d-i apt-setup/local0/key string http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc # By default the installer requires that repositories be authenticated # using a known gpg key. This setting can be used to disable that # authentication. Warning: Insecure, not recommended. #d-i debian-installer/allow_unauthenticated string true ### Package selection tasksel tasksel/first multiselect ubuntu-desktop #tasksel tasksel/first multiselect lamp-server, print-server #tasksel tasksel/first multiselect kubuntu-desktop # Individual additional packages to install #d-i pkgsel/include string openssh-server build-essential #Paquets escollits pel centre: d-i pkgsel/include string openssh-server ubuntu-restricted-extras joe # Whether to upgrade packages after debootstrap. # Allowed values: none, safe-upgrade, full-upgrade d-i pkgsel/upgrade select full-upgrade # Language pack selection d-i pkgsel/language-packs multiselect ca #Instal·lar per defecte el support complet per a la llengua d-i pkgsel/install-language-support boolean true # Policy for applying updates. May be "none" (no automatic updates), # "unattended-upgrades" (install security updates automatically), or # "landscape" (manage system with Landscape). #d-i pkgsel/update-policy select none # Some versions of the installer can report back on what software you have # installed, and what software you use. The default is not to report back, # but sending reports helps the project determine what software is most # popular and include it on CDs. #popularity-contest popularity-contest/participate boolean false # By default, the system's locate database will be updated after the # installer has finished installing most packages. This may take a while, so # if you don't want it, you can set this to "false" to turn it off. #d-i pkgsel/updatedb boolean true
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note
xserver-xorg xserver-xorg/autodetect_monitor boolean true
xserver-xorg xserver-xorg/config/monitor/selection-method \
select medium
xserver-xorg xserver-xorg/config/monitor/mode-list \
select 1024x768 @ 60 Hz
http://hands.com/d-i/ Provar: DEBCONF_DEBUG=5 --Ok. Serveix per obtenir més informació
Podeu provar de fer una instal·lació de Ubuntu Server sense que us faci cap pregunta (tot automatitzat) seguint els següents passos. Poseu un LIVE CD de Ubuntu Server i arranqueu
IMPORTANT: No escolliu cap idioma al menú inicial de idioma! Si ho feu aleshores no serà tot automàtic, us preguntarà pel país.
Cal posar a les opcions (F6 del menú inicial):
auto=true priority=critical url=http://SERVIDOR/FITXERPRESEED
Per exemple la URL podeu utilitzar:
http://acacha.org/preseed
o un altre exemple (am petites diferencies, és l'original en que em vaig basar)
https://bit.ly/uquick http://people.canonical.com/~kirkland/nqa
NOTA: Si us pregunta dades de xarxa com el servidor de DNS mireu que tingueu correctament la configuració de xarxa per DHCP i que no tingueu cap firewall
La configuració del preseed de l'exemple és:
Comentaris:
NOTA: Sembla ser que una de les últimes modificacions de localechooser (http://pkgs.org/ubuntu-11.04/ubuntu-main-i386/localechooser-data_2.34ubuntu4_all.deb.html) cancela el preseeding si el usuari canvia el idioma al menú inicial:
2011-04-10 - Colin Watson <[email protected]> localechooser (2.34ubuntu4) natty; urgency=low * Cancel any locale preseeding if the user changes the language (LP: #741304). https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/741304
Recursos
Dades generals:
Que cal?:
http://www.iesebre.com/ubuntu/custom.seed http://www.iesebre.com/ubuntu/custom1.seed http://www.iesebre.com/ubuntu/custom2.seed
NOTA: Utilitzem múltiples fitxers per tal de poder fer proves sens haver de canvia el CD (que té 3 opcions per provar amb qualsevol dels 3 fitxers de preconfiguració)
TODO: Poder instal·lar des de l'arrancada de xarxa --> No cal CD
Quines preconfiguracions s'estableixen a la imatge?
byobu vim openssh-server joe ubuntu-restricted-extras startupmanager samba smbfs ssh whois tcpdump traceroute ipcalc nmap dnstracer ssh ethtool joe geany gobby nfs-client whois inkscape gimp gimp-help-es audacity avidemux vlc filezilla language-pack-ca language-support-ca gparted ksnapshot kolourpaint4
TODO. Que estaria bé poder preconfigurar?
# d-i preseeding is inherently not secure. Nothing in the installer checks # for attempts at buffer overflows or other exploits of the values of a # preconfiguration file like this one. Only use preconfiguration files from # trusted locations! To drive that home, and because it's generally useful, # here's a way to run any shell command you'd like inside the installer, # automatically. # This first command is run as early as possible, just after # preseeding is read. #d-i preseed/early_command string anna-install some-udeb # This command is run just before the install finishes, but when there is # still a usable /target directory. You can chroot to /target and use it # directly, or use the apt-install and in-target commands to easily install # packages and run commands in the target system. #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
Si voleu executar un script propi abans l'haureu de baixar d'Internet:
d-i preseed/late_command string \ in-target chsh -s /bin/bash ; \ in-target wget http://[some_IP]/testscript.sh ; \ in-target sh testscript.sh ; in-target rm testscript.sh ;
Per exemple, per afegir usuaris extres al final de la instal·lació:
d-i preseed/late_command string \ in-target chsh -s /bin/bash ; \ in-target wget http://www.iesebre.com/ubuntu/addusers.sh ; \ in-target bash addusers.sh ; in-target rm addusers.sh ;
On el fitxer addusers.sh conté:
#!/bin/bash # Add users: /usr/sbin/groupadd alumne sudo /usr/sbin/useradd -m -s /bin/bash -g alumne -G adm,dialout,fax,cdrom,floppy,tape,dip,video,plugdev,fuse -c "Alumne" alumne /usr/sbin/groupadd profe sudo /usr/sbin/useradd -m -s /bin/bash -g profe -G adm,dialout,fax,cdrom,floppy,tape,dip,video,plugdev,fuse -c "Profesor" profe /usr/sbin/chpasswd <<EOF alumne:alumne profe:profe EOF
http://www.iesebre.com/subversion/projectes/ubuntucustom/addusers.sh
#!/bin/bash SERVER="your_server" CONFIG_STORE="$SERVER:/root/inventory/baseline" echo starting reproduction script echo make sure we have the tools and have an up to date system to start with apt-get update apt-get upgrade apt-get dist-upgrade apt-get -y install perl debconf debconf-utils rsync echo;echo collecting files from server. echo when prompted, enter root password on remote server cd /tmp scp -r $CONFIG_STORE/* /tmp echo;echo replacing files in /etc echo a copy of /etc is saved as /etc.old for recovery mkdir /etc.old cp -R /etc/* /etc.old echo;echo synchronising files in /etc # we could rsync directly with the files on the remote server as well, but # the files have been copied anyway because we used a wildcard # this way, we do not have to authenticate with the remote server multiple times # rsync i.s.o. cp because it creates directories if needed, before copying files rsync -r /tmp/etc/ /etc # resetting the debian-installer selections echo;echo resetting package options apt-get update debconf-set-selections installeroptions debconf-set-selections packageoptions apt-get -y dselect-upgrade apt-get check # do apt install from package list echo installing packages apt-get update for pkg in $(cat install_packages.list); do echo; echo processing package $pkg apt-get -y install --force-yes $pkg done apt-get check ## asuming bash for root's shell and script started from /root/.bash_profile ## remove the call to my_post_install_tasks ## so it won't be executed again # rm /root/my_post_install_tasks # sed -e '@/root/[email protected]' /root/.bash_profile # depending on the situation, you may want to add statements to restore data here # (/home, /srv, maybe a selection from /var, ...) # finished echo echo if there were problems with package installation and configuration due to echo missing data directories, create/restore those directories and echo run apt-get install -f to fix things echo echo echo you've made considerable changes to the system configuration echo you might want to reboot to make sure all services / daemons / applications echo are executed with their new configuration exit
TODO
Depending on the installation method you use, a mirror may be used to download additional components of the installer, to install the base system, and to set up the /etc/apt/sources.list for the installed system.
The parameter mirror/suite determines the suite for the installed system.
The parameter mirror/udeb/suite determines the suite for additional components for the installer. It is only useful to set this if components are actually downloaded over the network and should match the suite that was used to build the initrd for the installation method used for the installation. By default the value for mirror/udeb/suite is the same as mirror/suite.
The parameter mirror/udeb/components determines the archive components from which additional installer components are fetched. It is only useful to set this if components are actually downloaded over the network. The default components are main and restricted.
# If you select ftp, the mirror/country string does not need to be set. #d-i mirror/protocol string ftp d-i mirror/country string manual d-i mirror/http/hostname string es.archive.ubuntu.com d-i mirror/http/directory string /ubuntu d-i mirror/http/proxy string
# Suite to install. #d-i mirror/suite string hardy # Suite to use for loading installer components (optional). #d-i mirror/udeb/suite string hardy # Components to use for loading installer components (optional). #d-i mirror/udeb/components multiselect main, restricted
Al fitxer /etc/dhcp3/dhcp.conf del servidor DHCP poseu:
if substring (option vendor-class-identifier, 0, 3) = "d-i" { filename "http://host/preseed.cfg"; }
noteu que aquest exemple només afecta al clients que s'identifiquen com a d-i, és a dir que no afecta als clients de DHCP normals, sinó només als instal·ladors Debian. També es pot limitar a una sola màquina.
El fitxer de log durant la instal·lació és:
/var/log/syslog
A la versió Alternate u Server d'Ubuntu podeu consultar aquest log a la terminal virtual F4.
Després de la instal·lació el log el trobareu a:
/var/log/installer/
Aquest fitxer conté el log del resultat de compilar/processar el fitxer de preseed. Si el fitxer té un format incorrecte us apareixerà un error durant la instal·lació que us dirà que podeu consultar aquest fitxers per a més informació.
Al sistema acabat d'instal·lar:
$ debconf-get-selections --installer
L'agafa de:
/var/log/installer/cdebconf
En el meu cas ha estat per culpa de tenir un DHCP amb una configuració rara que em donava un gateway que no tocava i el client deu comprovar la connexió als servidors DNS proporcionats per DHCP. Els servidors eren correctes però no anaven per culpa d'anar per un gateway que no tocava (capat per firewall).
Un altre problema possible és estar utilitzant màquines virtuals (p.ex. Virtual Box) amb NAT i que la configuració per DHCP no sigui l'esperada.
Sembla ser que s'ha programat l'aplicació localechooser de l'instal·lació de ubuntu per tal de ignorar els preseedings de l'idioma si l'usuari escull un idioma al menú principal de la instal·lació.
2011-04-10 - Colin Watson <[email protected]> localechooser (2.34ubuntu4) natty; urgency=low * Cancel any locale preseeding if the user changes the language (LP: #741304).
Vegeu l'exemple Preseed#Fitxer_de_preseed_per_a_Ubuntu_Server_11.04