autoinst

scripts to make automated installations of debian easy
git clone git://deadbeef.fr/autoinst.git
Log | Files | Refs | README | LICENSE

README (4918B)


      1 This repo aims to build a small personnal distro based on
      2 Debian.
      3 
      4 It targets powerusers. If you don't know how to script,
      5 don't use this, it's safer and easier to just use the debian
      6 installer.
      7 
      8 = DISCLAIMER
      9 
     10 THIS SCRIPT IS VERY, VERY LIKELY TO DAMAGE YOUR COMPUTER IF
     11 NOT USED CORRECTLY. DO *NOT* USE IT ON A SYSTEM WHERE THERE
     12 ARE ACTUAL DATA.
     13 YOU ARE THE ONLY RESPONSIBLE OF ANY DAMAGE CAUSED BY THE
     14 USE OF THIS CODE!
     15 
     16 This being said, let's talk about serious things.
     17 
     18 = Generalities
     19 
     20 == Main goals
     21 
     22 * based on runit-init + busybox;
     23 * code maintainable by a small group of persons;
     24 * release-based, stable core with the possibility of having
     25 	a more volatile user environment (for desktops);
     26 * use of POSIX portable binaries as much as possible;
     27 * read-only root;
     28 
     29 == Non goals
     30 
     31 * package everything;
     32 * being generic;
     33 * being lightweight (but simplicity might result in that);
     34 
     35 == Installer dependencies
     36 
     37 * busybox
     38 * debootstrap
     39 * xorriso (if willing to build an iso)
     40 
     41 TODO:
     42 * fakechroot, to allow installing without being root
     43 
     44 == Usage
     45 
     46 ./install.sh [TARGET] [SOURCE]
     47 
     48 TARGET: file where the installation will be done. Must
     49 either be an existing file (block file or normal file with
     50 fixed allocated size) or non-existing folder.
     51 If TARGET does not exists, a folder will be created, and
     52 installation will proceed in it.
     53 
     54 SOURCE: folder where instructions to build the system will
     55 be found.
     56 
     57 = A more in-depth view
     58 
     59 == Resulting system
     60 
     61 This script is mostly tested to generate systems which have
     62 those caracteristics, but should work with other setups too:
     63 
     64 * syslinux is used for boot management;
     65 * a GPT partition system is used;
     66 * the boot partition have the partition label "BOOTLOADER";
     67 * "BOOTLOADER" will be a vfat partition;
     68 * the resulting system is encrypted;
     69 
     70 == Modifying defaults
     71 
     72 The script is built to make changes easy while being able
     73 to perform a full installation.
     74 It works mostly by the use of a template $TARGET/root/etc
     75 folder containing the traditional UNIX folder and files
     76 hierarchy, which are parsed to guess the what the resulting
     77 installation should looks like.
     78 
     79 Unfortunately, everything can not be guessed from those
     80 files, so there are additional ones:
     81 
     82 * partitions: a file read by sfdisk to partition $TARGET if
     83 	$TARGET is a file (block or normal).
     84 * "syslinux/*": a folder containing syslinux's configuration
     85 	to boot TARGET after installation;
     86 	MULTIPLE BOOTS SUPPORT NOT IMPLEMENTED!
     87 * fsboot: a file describing the partition where and how
     88 	syslinux will be installed (formated after fstab done).
     89 	Format: "PARTITION FSTYPE SUBFOLDER";
     90 * "*.key": when encryption is required (presence of
     91 	TARGET/etc/crypttab, all encrypted partitions with the
     92 	"none" keyfile must have a file named MAPPED_DEVICE.key
     93 	to initialize the encryption;
     94 * "packages/*.list": a folder with files containing the
     95 	list of packages to install on target system;
     96 * proxy: an optional file containing proxy parameters (to
     97 	speed up installations);
     98 * name: a file containing the of the distribution to install;
     99 * users/users: a file containing informations for user
    100 	creation. Format: "USER:PASSWORD"
    101 
    102 === Limitations
    103 
    104 The script have several limitations, for various reasons.
    105 Some of them are listed here:
    106 
    107 * in /etc/fstab, lines will be considered listing a special
    108 	filesystem if it *does not* match this regex: "^[#^ =/]+".
    109 	If the 1st field does not match, the script *will* try to
    110 	format the partition to correct filesystem type.
    111 	This means comments are not supported (for now).
    112 	This also means that those names *must exist* before
    113 	formating.
    114 * in /etc/cryptab, the format supported is the one supported
    115 	by Debian 10 "Buster", for initramfs and SysVinit (*not*
    116 	the specific crap systemd *again* reimplement).
    117 	Also, the last field is modified by adding '--' before
    118 	option names and replacing ',' with ' '.
    119 	Finally, only LUKS is supported.
    120 * the name of the distribution to install must be known by
    121 	the debootstrap program.
    122 * syslinux is not automatically adjusted with luks
    123 	parameters.
    124 * syslinux will not automatically install on TARGET, this
    125 	is voluntary: it is not needed for the system to boot.
    126 * UEFI secure boot is not supported (by this script, but
    127 	you can do it manually. How to do so or patches welcome).
    128 * if you want the script to install a bootloader (e.g.
    129 	syslinux), then you *MUST* use all of :"label: gpt",
    130 	named-fields format and partlabels ('name='). This
    131 	*does not* imply you must use UEFI booting mechanism.
    132 * if you want the script to install a bootloader (e.g.
    133 	syslinux), then you *MUST* indicate on which partition the
    134 	bootloader will be installed with the "bootable" flag in
    135 	"partitions". The booting mechanism (UEFI/Legacy) will be
    136 	choosen by considering if the 'type=' field contains the
    137 	correct value for UEFI boots.
    138 	If 'attrs=LegacyBIOSBootable' is found, then _both_
    139 	mechanisms will be installed.
    140 	The "bootable" flag *MUST* only be present *once*.