├── sharch_body.sh ├── cook-bits.sh ├── README.md └── ubuntu-preseed.cfg /sharch_body.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright (C) 2019 Luke Williams 5 | # 6 | # SPDX-License-Identifier: GPL-2.0 7 | # 8 | 9 | # 10 | # Shell archive template 11 | # 12 | # Strings of the form %%VAR%% are replaced during construction. 13 | # 14 | 15 | echo -n "Verifying image checksum ..." 16 | sha1=$(sed -e '1,/^exit_marker$/d' "$0" | sha1sum | awk '{ print $1 }') 17 | 18 | payload_sha1=%%IMAGE_SHA1%% 19 | 20 | if [ "$sha1" != "$payload_sha1" ] ; then 21 | echo 22 | echo "ERROR: Unable to verify archive checksum" 23 | echo "Expected: $payload_sha1" 24 | echo "Found : $sha1" 25 | exit 1 26 | fi 27 | 28 | echo " OK." 29 | 30 | tmp_dir= 31 | clean_up() { 32 | if [ "$(id -u)" = "0" ] ; then 33 | umount $tmp_dir > /dev/null 2>&1 34 | fi 35 | rm -rf $tmp_dir 36 | exit $1 37 | } 38 | 39 | # Untar and launch install script in a tmpfs 40 | cur_wd=$(pwd) 41 | archive_path=$(realpath "$0") 42 | tmp_dir=$(mktemp -d) 43 | if [ "$(id -u)" = "0" ] ; then 44 | mount -t tmpfs tmpfs-installer $tmp_dir || clean_up 1 45 | fi 46 | cd $tmp_dir 47 | echo -n "Preparing image archive ..." 48 | sed -e '1,/^exit_marker$/d' $archive_path | tar xf - || clean_up 1 49 | echo " OK." 50 | cd $cur_wd 51 | 52 | extract=no 53 | args=":x" 54 | while getopts "$args" a ; do 55 | case $a in 56 | x) 57 | extract=yes 58 | ;; 59 | *) 60 | ;; 61 | esac 62 | done 63 | 64 | if [ "$extract" = "yes" ] ; then 65 | # stop here 66 | echo "Image extracted to: $tmp_dir" 67 | if [ "$(id -u)" = "0" ] ; then 68 | echo "To un-mount the tmpfs when finished type: umount $tmp_dir" 69 | fi 70 | exit 0 71 | fi 72 | 73 | $tmp_dir/installer/install.sh "$@" 74 | rc="$?" 75 | 76 | clean_up $rc 77 | 78 | exit_marker 79 | -------------------------------------------------------------------------------- /cook-bits.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright (C) 2019 Luke Williams 5 | # 6 | # SPDX-License-Identifier: GPL-2.0 7 | # 8 | 9 | # goal: Make an ONIE installer from Ubuntu's Bionic mini.iso 10 | # 11 | # inputs: ubuntu-bionic.iso 12 | # output: ONIE compatible installer 13 | 14 | #!/bin/sh 15 | 16 | set -e 17 | 18 | IN=./input 19 | OUT=./output 20 | rm -rf $OUT 21 | mkdir -p $OUT 22 | 23 | WORKDIR=./work 24 | EXTRACTDIR="$WORKDIR/extract" 25 | INSTALLDIR="$WORKDIR/installer" 26 | 27 | IN_IMAGE="ubuntu-bionic-amd64-mini" 28 | ISO="${IN}/${IN_IMAGE}.iso" 29 | 30 | # Download the mini.iso if necessary 31 | [ -r "$ISO" ] || { 32 | echo "Downloading Ubuntu Bionic mini.iso ..." 33 | rm -rf $IN 34 | mkdir -p $IN 35 | URL="http://ftp.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso" 36 | echo "Using URL: $URL" 37 | wget -O $ISO $URL 38 | } 39 | 40 | output_file="${OUT}/${IN_IMAGE}-ONIE.bin" 41 | 42 | echo -n "Creating $output_file: ." 43 | 44 | # prepare workspace 45 | [ -d $EXTRACTDIR ] && chmod +w -R $EXTRACTDIR 46 | rm -rf $WORKDIR 47 | mkdir -p $EXTRACTDIR 48 | mkdir -p $INSTALLDIR 49 | 50 | # extract ISO 51 | xorriso \ 52 | -indev $ISO \ 53 | -osirrox on \ 54 | -extract / $EXTRACTDIR 55 | echo -n "." 56 | 57 | # based on isolinux.cfg, load save kernel and initramfs: 58 | # default install 59 | # label install 60 | # menu label ^Install 61 | # menu default 62 | # kernel linux 63 | # append vga=788 initrd=initrd.gz --- quiet 64 | 65 | KERNEL=linux 66 | IN_KERNEL=$EXTRACTDIR/$KERNEL 67 | [ -r $IN_KERNEL ] || { 68 | echo "ERROR: Unable to find kernel in ISO: $IN_KERNEL" 69 | exit 1 70 | } 71 | INITRD=initrd.gz 72 | IN_INITRD=$EXTRACTDIR/$INITRD 73 | [ -r $IN_INITRD ] || { 74 | echo "ERROR: Unable to find initrd in ISO: $IN_INITRD" 75 | exit 1 76 | } 77 | 78 | # Note: specify kernel args you want the Debian installer to 79 | # automatically append by putting them after the special marker "---". 80 | # Here we want the Deb installer to auto include the serial console 81 | # parameters. 82 | KERNEL_ARGS="--- console=tty0 console=ttyS0,115200n8" 83 | 84 | # To debug DI preseed file add these args 85 | # DI_DEBUG_ARGS="DEBCONF_DEBUG=5 dbg/flags=all-x" 86 | 87 | # Debian installer args 88 | DI_ARGS="auto=true priority=critical $DI_DEBUG_ARGS" 89 | 90 | cp $IN_KERNEL $IN_INITRD $INSTALLDIR 91 | 92 | # Create custom install.sh script 93 | touch $INSTALLDIR/install.sh 94 | chmod +x $INSTALLDIR/install.sh 95 | 96 | (cat < /dev/null 2&>1 104 | done 105 | 106 | # bonk out on errors 107 | set -e 108 | 109 | # use the onie_exec_url to find the preseed file 110 | base_url="\${onie_exec_url%/*}" 111 | preseed_url="\${base_url}/./ubuntu-preseed.cfg" 112 | 113 | echo "Loading new kernel ..." 114 | kexec --load --initrd=$INITRD --append="$DI_ARGS url=\$preseed_url $KERNEL_ARGS" $KERNEL 115 | kexec --exec 116 | 117 | EOF 118 | ) >> $INSTALLDIR/install.sh 119 | echo -n "." 120 | 121 | # Repackage $INSTALLDIR into a self-extracting installer image 122 | sharch="$WORKDIR/sharch.tar" 123 | tar -C $WORKDIR -cf $sharch installer || { 124 | echo "Error: Problems creating $sharch archive" 125 | exit 1 126 | } 127 | 128 | [ -f "$sharch" ] || { 129 | echo "Error: $sharch not found" 130 | exit 1 131 | } 132 | echo -n "." 133 | 134 | sha1=$(cat $sharch | sha1sum | awk '{print $1}') 135 | echo -n "." 136 | 137 | cp sharch_body.sh $output_file || { 138 | echo "Error: Problems copying sharch_body.sh" 139 | exit 1 140 | } 141 | 142 | # Replace variables in the sharch template 143 | sed -i -e "s/%%IMAGE_SHA1%%/$sha1/" $output_file 144 | echo -n "." 145 | cat $sharch >> $output_file 146 | rm -rf $tmp_dir 147 | echo " Done." 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installing Ubuntu on a ONIE System 2 | 3 | This example demonstrates how to create an ONIE compatible installer 4 | image from a Ubuntu Bionic .ISO file. This README covers: 5 | 6 | * Building the ONIE installer 7 | * Using a Ubuntu preseed.cfg file to automate installation in an ONIE environment 8 | 9 | ## Building the Ubuntu ONIE installer 10 | 11 | Before building the installer make sure you have `wget` and `xorriso` 12 | installed on your system. On a Ubuntu based system the following is 13 | sufficient: 14 | 15 | ``` 16 | build-host:~$ sudo apt-get update 17 | build-host:~$ sudo apt-get install wget xorriso 18 | ``` 19 | 20 | To build the Ubuntu ONIE installer change directories to `ubuntu-iso` 21 | and type the following: 22 | 23 | ``` 24 | build-host:~$ cd /ubuntu-iso 25 | build-host:~/ubuntu-iso$ ./cook-bits.sh 26 | Downloading Ubuntu Bionic mini.iso ... 27 | ... 28 | Saving to: `./input/ubuntu-bionic-amd64-mini.iso' 29 | 30 | 100%[==================================================================================================>] 29,360,128 3.11M/s in 8.6s 31 | 32 | 2015-10-09 10:15:12 (3.25 MB/s) - `./input/ubuntu-bionic-amd64-mini.iso' saved [29360128/29360128] 33 | 34 | Creating ./output/ubuntu-bionic-amd64-mini-ONIE.bin: .xorriso 1.2.2 : RockRidge filesystem manipulator, libburnia project. 35 | 36 | xorriso : NOTE : Loading ISO image tree from LBA 0 37 | xorriso : UPDATE : 280 nodes read in 1 seconds 38 | xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded 39 | Drive current: -indev './input/ubuntu-bionic-amd64-mini.iso' 40 | Media current: stdio file, overwriteable 41 | Media status : is written , is appendable 42 | Boot record : El Torito , ISOLINUX boot image capable of isohybrid 43 | Media summary: 1 session, 11098 data blocks, 21.7m data, 1210g free 44 | Volume id : 'ISOIMAGE' 45 | Copying of file objects from ISO image to disk filesystem is: Enabled 46 | xorriso : UPDATE : 280 files restored ( 21495k) in 1 seconds = 15.9xD 47 | ..... Done. 48 | ``` 49 | 50 | The resulting ONIE installer file is available in the `output` directory: 51 | 52 | ``` 53 | build-host:~/ubuntu-iso$ ls -l output/ 54 | total 17812 55 | -rw-r--r-- 1 user user 18238940 Oct 9 10:15 ubuntu-bionic-amd64-mini-ONIE.bin 56 | ``` 57 | 58 | ## Preparing the HTTP image server 59 | 60 | The example assumes you are running an HTTP server on the same machine 61 | as the virtual machine. Using local qemu networking the HTTP server 62 | will be availabe within the VM using IP address 10.0.2.2. 63 | 64 | Put the `ubuntu-bionic-amd64-mini-ONIE.bin` file and 65 | `ubuntu-preseed.txt` file into the document root of the HTTP server: 66 | 67 | ``` 68 | build-host:~/ubuntu-iso$ sudo cp output/ubuntu-bionic-amd64-mini-ONIE.bin ubuntu-preseed.cfg /var/www/html/ 69 | ``` 70 | 71 | ## Installing the Ubuntu installer from ONIE 72 | 73 | Back in ONIE. First double check that the network is working 74 | correctly: 75 | 76 | ``` 77 | ONIE:/ # ping 10.0.2.2 78 | PING 10.0.2.2 (10.0.2.2): 56 data bytes 79 | 64 bytes from 10.0.2.2: seq=0 ttl=255 time=0.237 ms 80 | 64 bytes from 10.0.2.2: seq=1 ttl=255 time=0.179 ms 81 | ^C 82 | --- 10.0.2.2 ping statistics --- 83 | 2 packets transmitted, 2 packets received, 0% packet loss 84 | ``` 85 | 86 | Next verify the HTTP server is accessible: 87 | 88 | ``` 89 | ONIE:/ # wget http://10.0.2.2/ubuntu-preseed.txt 90 | ``` 91 | 92 | If either of those is not working figure out why before proceeding. 93 | 94 | Now proceed with installing the ONIE compatible Ubuntu installer: 95 | 96 | ``` 97 | ONIE:/ # onie-nos-install http://10.0.2.2/ubuntu-bionic-amd64-mini-ONIE.bin 98 | discover: Rescue mode detected. No discover stopped. 99 | Info: Fetching http://10.0.2.2/ubuntu-bionic-amd64-mini-ONIE.bin ... 100 | Connecting to 10.0.2.2 (10.0.2.2:80) 101 | installer 100% |*******************************| 17811k 0:00:00 ETA 102 | ONIE: Executing installer: http://10.0.2.2/ubuntu-bionic-amd64-mini-ONIE.bin 103 | Verifying image checksum ... OK. 104 | Preparing image archive ... OK. 105 | Loading new kernel ... 106 | kexec: Starting new kernel 107 | ... 108 | ``` 109 | 110 | The Ubuntu installer kernel will now kexec and you are off to the 111 | races. The Ubuntu installer will pull down the preseed.cfg file and 112 | continue the install process. 113 | 114 | ## Poking around Ubuntu after the install 115 | 116 | When complete the Ubuntu system will have the following: 117 | 118 | - a sudo-enabled user called `ubuntu` with the login password of `ubuntu` 119 | - GRUB menu entries for ONIE, from /etc/grub.d/50_onie_grub 120 | 121 | The GRUB menu looks like: 122 | 123 | ``` 124 | GNU GRUB version 2.02~beta2-22 125 | 126 | +----------------------------------------------------------------------------+ 127 | | Ubuntu GNU/Linux | 128 | |*Advanced options for Ubuntu GNU/Linux | 129 | | ONIE | 130 | | | 131 | ``` 132 | -------------------------------------------------------------------------------- /ubuntu-preseed.cfg: -------------------------------------------------------------------------------- 1 | #### Contents of the preconfiguration file 2 | ### Localization 3 | # Preseeding only locale sets language, country and locale. 4 | d-i debian-installer/locale string en_US 5 | 6 | # The values can also be preseeded individually for greater flexibility. 7 | #d-i debian-installer/language string en 8 | #d-i debian-installer/country string NL 9 | #d-i debian-installer/locale string en_GB.UTF-8 10 | # Optionally specify additional locales to be generated. 11 | #d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 12 | 13 | # Keyboard selection. 14 | d-i keyboard-configuration/xkb-keymap select us 15 | # d-i keyboard-configuration/toggle select No toggling 16 | 17 | ### Network configuration 18 | # Disable network configuration entirely. This is useful for cdrom 19 | # installations on non-networked devices where the network questions, 20 | # warning and long timeouts are a nuisance. 21 | #d-i netcfg/enable boolean false 22 | 23 | # netcfg will choose an interface that has link if possible. This makes it 24 | # skip displaying a list if there is more than one interface. 25 | d-i netcfg/choose_interface select auto 26 | 27 | # To pick a particular interface instead: 28 | #d-i netcfg/choose_interface select eth1 29 | 30 | # To set a different link detection timeout (default is 3 seconds). 31 | # Values are interpreted as seconds. 32 | #d-i netcfg/link_wait_timeout string 10 33 | 34 | # If you have a slow dhcp server and the installer times out waiting for 35 | # it, this might be useful. 36 | #d-i netcfg/dhcp_timeout string 60 37 | #d-i netcfg/dhcpv6_timeout string 60 38 | 39 | # If you prefer to configure the network manually, uncomment this line and 40 | # the static network configuration below. 41 | #d-i netcfg/disable_autoconfig boolean true 42 | 43 | # If you want the preconfiguration file to work on systems both with and 44 | # without a dhcp server, uncomment these lines and the static network 45 | # configuration below. 46 | #d-i netcfg/dhcp_failed note 47 | #d-i netcfg/dhcp_options select Configure network manually 48 | 49 | # Static network configuration. 50 | # 51 | # IPv4 example 52 | #d-i netcfg/get_ipaddress string 192.168.1.42 53 | #d-i netcfg/get_netmask string 255.255.255.0 54 | #d-i netcfg/get_gateway string 192.168.1.1 55 | #d-i netcfg/get_nameservers string 192.168.1.1 56 | #d-i netcfg/confirm_static boolean true 57 | # 58 | # IPv6 example 59 | #d-i netcfg/get_ipaddress string fc00::2 60 | #d-i netcfg/get_netmask string ffff:ffff:ffff:ffff:: 61 | #d-i netcfg/get_gateway string fc00::1 62 | #d-i netcfg/get_nameservers string fc00::1 63 | #d-i netcfg/confirm_static boolean true 64 | 65 | # Any hostname and domain names assigned from dhcp take precedence over 66 | # values set here. However, setting the values still prevents the questions 67 | # from being shown, even if values come from dhcp. 68 | d-i netcfg/get_hostname string unassigned-hostname 69 | d-i netcfg/get_domain string unassigned-domain 70 | 71 | # If you want to force a hostname, regardless of what either the DHCP 72 | # server returns or what the reverse DNS entry for the IP is, uncomment 73 | # and adjust the following line. 74 | #d-i netcfg/hostname string somehost 75 | 76 | # Disable that annoying WEP key dialog. 77 | d-i netcfg/wireless_wep string 78 | # The wacky dhcp hostname that some ISPs use as a password of sorts. 79 | #d-i netcfg/dhcp_hostname string radish 80 | 81 | # If non-free firmware is needed for the network or other hardware, you can 82 | # configure the installer to always try to load it, without prompting. Or 83 | # change to false to disable asking. 84 | #d-i hw-detect/load_firmware boolean true 85 | 86 | ### Network console 87 | # Use the following settings if you wish to make use of the network-console 88 | # component for remote installation over SSH. This only makes sense if you 89 | # intend to perform the remainder of the installation manually. 90 | #d-i anna/choose_modules string network-console 91 | #d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key 92 | #d-i network-console/password password r00tme 93 | #d-i network-console/password-again password r00tme 94 | 95 | ### Mirror settings 96 | # If you select ftp, the mirror/country string does not need to be set. 97 | #d-i mirror/protocol string ftp 98 | d-i mirror/country string manual 99 | d-i mirror/http/hostname string mirrors.linux.iu.edu 100 | d-i mirror/http/directory string /linux/debian 101 | d-i mirror/http/proxy string 102 | 103 | # Suite to install. 104 | #d-i mirror/suite string testing 105 | # Suite to use for loading installer components (optional). 106 | #d-i mirror/udeb/suite string testing 107 | 108 | ### Account setup 109 | # Skip creation of a root account (normal user account will be able to 110 | # use sudo). 111 | d-i passwd/root-login boolean false 112 | # Alternatively, to skip creation of a normal user account. 113 | d-i passwd/make-user boolean true 114 | 115 | # Root password, either in clear text 116 | #d-i passwd/root-password password r00tme 117 | #d-i passwd/root-password-again password r00tme 118 | # or encrypted using an MD5 hash. 119 | #d-i passwd/root-password-crypted password [MD5 hash] 120 | 121 | # To create a normal user account. 122 | d-i passwd/user-fullname string ONIE 123 | d-i passwd/username string ubuntu 124 | # Normal user's password, either in clear text 125 | d-i passwd/user-password password ubuntu 126 | d-i passwd/user-password-again password onie 127 | # or encrypted using an MD5 hash. 128 | #d-i passwd/user-password-crypted password [MD5 hash] 129 | # Create the first user with the specified UID instead of the default. 130 | #d-i passwd/user-uid string 1010 131 | 132 | # The user account will be added to some standard initial groups. To 133 | # override that, use this. 134 | d-i passwd/user-default-groups string audio cdrom video sudo 135 | 136 | ### Clock and time zone setup 137 | # Controls whether or not the hardware clock is set to UTC. 138 | d-i clock-setup/utc boolean true 139 | 140 | # You may set this to any valid setting for $TZ; see the contents of 141 | # /usr/share/zoneinfo/ for valid values. 142 | d-i time/zone string US/Pacific 143 | 144 | # Controls whether to use NTP to set the clock during the install 145 | d-i clock-setup/ntp boolean true 146 | # NTP server to use. The default is almost always fine here. 147 | #d-i clock-setup/ntp-server string ntp.example.com 148 | 149 | ### Partitioning 150 | ## Partitioning example 151 | # If the system has free space you can choose to only partition that space. 152 | # This is only honoured if partman-auto/method (below) is not set. 153 | d-i partman-auto/init_automatically_partition select biggest_free 154 | 155 | # Alternatively, you may specify a disk to partition. If the system has only 156 | # one disk the installer will default to using that, but otherwise the device 157 | # name must be given in traditional, non-devfs format (so e.g. /dev/sda 158 | # and not e.g. /dev/discs/disc0/disc). 159 | # For example, to use the first SCSI/SATA hard disk: 160 | #d-i partman-auto/disk string /dev/sda 161 | # In addition, you'll need to specify the method to use. 162 | # The presently available methods are: 163 | # - regular: use the usual partition types for your architecture 164 | # - lvm: use LVM to partition the disk 165 | # - crypto: use LVM within an encrypted partition 166 | # d-i partman-auto/method string lvm 167 | 168 | # If one of the disks that are going to be automatically partitioned 169 | # contains an old LVM configuration, the user will normally receive a 170 | # warning. This can be preseeded away... 171 | d-i partman-lvm/device_remove_lvm boolean true 172 | # The same applies to pre-existing software RAID array: 173 | d-i partman-md/device_remove_md boolean true 174 | # And the same goes for the confirmation to write the lvm partitions. 175 | d-i partman-lvm/confirm boolean true 176 | d-i partman-lvm/confirm_nooverwrite boolean true 177 | 178 | # You can choose one of the three predefined partitioning recipes: 179 | # - atomic: all files in one partition 180 | # - home: separate /home partition 181 | # - multi: separate /home, /var, and /tmp partitions 182 | d-i partman-auto/choose_recipe select atomic 183 | 184 | # Or provide a recipe of your own... 185 | # If you have a way to get a recipe file into the d-i environment, you can 186 | # just point at it. 187 | #d-i partman-auto/expert_recipe_file string /hd-media/recipe 188 | 189 | # If not, you can put an entire recipe into the preconfiguration file in one 190 | # (logical) line. This example creates a small /boot partition, suitable 191 | # swap, and uses the rest of the space for the root partition: 192 | #d-i partman-auto/expert_recipe string \ 193 | # boot-root :: \ 194 | # 40 50 100 ext3 \ 195 | # $primary{ } $bootable{ } \ 196 | # method{ format } format{ } \ 197 | # use_filesystem{ } filesystem{ ext3 } \ 198 | # mountpoint{ /boot } \ 199 | # . \ 200 | # 500 10000 1000000000 ext3 \ 201 | # method{ format } format{ } \ 202 | # use_filesystem{ } filesystem{ ext3 } \ 203 | # mountpoint{ / } \ 204 | # . \ 205 | # 64 512 300% linux-swap \ 206 | # method{ swap } format{ } \ 207 | # . 208 | 209 | # The full recipe format is documented in the file partman-auto-recipe.txt 210 | # included in the 'debian-installer' package or available from D-I source 211 | # repository. This also documents how to specify settings such as file 212 | # system labels, volume group names and which physical devices to include 213 | # in a volume group. 214 | 215 | # This makes partman automatically partition without confirmation, provided 216 | # that you told it what to do using one of the methods above. 217 | d-i partman-partitioning/confirm_write_new_label boolean true 218 | d-i partman/choose_partition select finish 219 | d-i partman/confirm boolean true 220 | d-i partman/confirm_nooverwrite boolean true 221 | 222 | ## Partitioning using RAID 223 | # The method should be set to "raid". 224 | #d-i partman-auto/method string raid 225 | # Specify the disks to be partitioned. They will all get the same layout, 226 | # so this will only work if the disks are the same size. 227 | #d-i partman-auto/disk string /dev/sda /dev/sdb 228 | 229 | # Next you need to specify the physical partitions that will be used. 230 | #d-i partman-auto/expert_recipe string \ 231 | # multiraid :: \ 232 | # 1000 5000 4000 raid \ 233 | # $primary{ } method{ raid } \ 234 | # . \ 235 | # 64 512 300% raid \ 236 | # method{ raid } \ 237 | # . \ 238 | # 500 10000 1000000000 raid \ 239 | # method{ raid } \ 240 | # . 241 | 242 | # Last you need to specify how the previously defined partitions will be 243 | # used in the RAID setup. Remember to use the correct partition numbers 244 | # for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported; 245 | # devices are separated using "#". 246 | # Parameters are: 247 | # \ 248 | # 249 | 250 | #d-i partman-auto-raid/recipe string \ 251 | # 1 2 0 ext3 / \ 252 | # /dev/sda1#/dev/sdb1 \ 253 | # . \ 254 | # 1 2 0 swap - \ 255 | # /dev/sda5#/dev/sdb5 \ 256 | # . \ 257 | # 0 2 0 ext3 /home \ 258 | # /dev/sda6#/dev/sdb6 \ 259 | # . 260 | 261 | # For additional information see the file partman-auto-raid-recipe.txt 262 | # included in the 'debian-installer' package or available from D-I source 263 | # repository. 264 | 265 | # This makes partman automatically partition without confirmation. 266 | d-i partman-md/confirm boolean true 267 | d-i partman-partitioning/confirm_write_new_label boolean true 268 | d-i partman/choose_partition select finish 269 | d-i partman/confirm boolean true 270 | d-i partman/confirm_nooverwrite boolean true 271 | 272 | ## Controlling how partitions are mounted 273 | # The default is to mount by UUID, but you can also choose "traditional" to 274 | # use traditional device names, or "label" to try filesystem labels before 275 | # falling back to UUIDs. 276 | #d-i partman/mount_style select uuid 277 | 278 | ### Base system installation 279 | # Configure APT to not install recommended packages by default. Use of this 280 | # option can result in an incomplete system and should only be used by very 281 | # experienced users. 282 | #d-i base-installer/install-recommends boolean false 283 | 284 | # The kernel image (meta) package to be installed; "none" can be used if no 285 | # kernel is to be installed. 286 | #d-i base-installer/kernel/image string linux-image-586 287 | 288 | ### Apt setup 289 | # You can choose to install non-free and contrib software. 290 | #d-i apt-setup/non-free boolean true 291 | #d-i apt-setup/contrib boolean true 292 | # Uncomment this if you don't want to use a network mirror. 293 | #d-i apt-setup/use_mirror boolean false 294 | # Select which update services to use; define the mirrors to be used. 295 | # Values shown below are the normal defaults. 296 | #d-i apt-setup/services-select multiselect security, updates 297 | #d-i apt-setup/security_host string security.debian.org 298 | 299 | # Additional repositories, local[0-9] available 300 | #d-i apt-setup/local0/repository string \ 301 | # http://local.server/debian stable main 302 | #d-i apt-setup/local0/comment string local server 303 | # Enable deb-src lines 304 | #d-i apt-setup/local0/source boolean true 305 | # URL to the public key of the local repository; you must provide a key or 306 | # apt will complain about the unauthenticated repository and so the 307 | # sources.list line will be left commented out 308 | #d-i apt-setup/local0/key string http://local.server/key 309 | 310 | # By default the installer requires that repositories be authenticated 311 | # using a known gpg key. This setting can be used to disable that 312 | # authentication. Warning: Insecure, not recommended. 313 | #d-i debian-installer/allow_unauthenticated boolean true 314 | 315 | # Uncomment this to add multiarch configuration for i386 316 | #d-i apt-setup/multiarch string i386 317 | 318 | 319 | ### Package selection 320 | #tasksel tasksel/first multiselect standard, web-server, kde-desktop 321 | tasksel tasksel/first multiselect standard, ssh-server 322 | 323 | # Individual additional packages to install 324 | #d-i pkgsel/include string openssh-server build-essential 325 | # Whether to upgrade packages after debootstrap. 326 | # Allowed values: none, safe-upgrade, full-upgrade 327 | d-i pkgsel/upgrade select none 328 | 329 | # Some versions of the installer can report back on what software you have 330 | # installed, and what software you use. The default is not to report back, 331 | # but sending reports helps the project determine what software is most 332 | # popular and include it on CDs. 333 | #popularity-contest popularity-contest/participate boolean false 334 | 335 | ### Boot loader installation 336 | # Grub is the default boot loader (for x86). If you want lilo installed 337 | # instead, uncomment this: 338 | #d-i grub-installer/skip boolean true 339 | # To also skip installing lilo, and install no bootloader, uncomment this 340 | # too: 341 | #d-i lilo-installer/skip boolean true 342 | 343 | 344 | # This is fairly safe to set, it makes grub install automatically to the MBR 345 | # if no other operating system is detected on the machine. 346 | d-i grub-installer/only_debian boolean true 347 | 348 | # This one makes grub-installer install to the MBR if it also finds some other 349 | # OS, which is less safe as it might not be able to boot that other OS. 350 | d-i grub-installer/with_other_os boolean true 351 | 352 | # Due notably to potential USB sticks, the location of the MBR can not be 353 | # determined safely in general, so this needs to be specified: 354 | #d-i grub-installer/bootdev string /dev/sda 355 | # To install to the first device (assuming it is not a USB stick): 356 | d-i grub-installer/bootdev string default 357 | 358 | # Alternatively, if you want to install to a location other than the mbr, 359 | # uncomment and edit these lines: 360 | #d-i grub-installer/only_debian boolean false 361 | #d-i grub-installer/with_other_os boolean false 362 | #d-i grub-installer/bootdev string (hd0,1) 363 | # To install grub to multiple disks: 364 | #d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) 365 | 366 | # Optional password for grub, either in clear text 367 | #d-i grub-installer/password password r00tme 368 | #d-i grub-installer/password-again password r00tme 369 | # or encrypted using an MD5 hash, see grub-md5-crypt(8). 370 | #d-i grub-installer/password-crypted password [MD5 hash] 371 | 372 | # Use the following option to add additional boot parameters for the 373 | # installed system (if supported by the bootloader installer). 374 | # Note: options passed to the installer will be added automatically. 375 | #d-i debian-installer/add-kernel-opts string nousb 376 | 377 | ### Finishing up the installation 378 | # During installations from serial console, the regular virtual consoles 379 | # (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next 380 | # line to prevent this. 381 | #d-i finish-install/keep-consoles boolean true 382 | 383 | # Avoid that last message about the install being complete. 384 | d-i finish-install/reboot_in_progress note 385 | 386 | # This will prevent the installer from ejecting the CD during the reboot, 387 | # which is useful in some situations. 388 | #d-i cdrom-detect/eject boolean false 389 | 390 | # This is how to make the installer shutdown when finished, but not 391 | # reboot into the installed system. 392 | #d-i debian-installer/exit/halt boolean true 393 | # This will power off the machine instead of just halting it. 394 | #d-i debian-installer/exit/poweroff boolean true 395 | 396 | ### Preseeding other packages 397 | # Depending on what software you choose to install, or if things go wrong 398 | # during the installation process, it's possible that other questions may 399 | # be asked. You can preseed those too, of course. To get a list of every 400 | # possible question that could be asked during an install, do an 401 | # installation, and then run these commands: 402 | # debconf-get-selections --installer > file 403 | # debconf-get-selections >> file 404 | 405 | 406 | #### Advanced options 407 | ### Running custom commands during the installation 408 | # d-i preseeding is inherently not secure. Nothing in the installer checks 409 | # for attempts at buffer overflows or other exploits of the values of a 410 | # preconfiguration file like this one. Only use preconfiguration files from 411 | # trusted locations! To drive that home, and because it's generally useful, 412 | # here's a way to run any shell command you'd like inside the installer, 413 | # automatically. 414 | 415 | # This first command is run as early as possible, just after 416 | # preseeding is read. 417 | #d-i preseed/early_command string anna-install some-udeb 418 | 419 | # This command is run immediately before the partitioner starts. It may be 420 | # useful to apply dynamic partitioner preseeding that depends on the state 421 | # of the disks (which may not be visible when preseed/early_command runs). 422 | #d-i partman/early_command \ 423 | # string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" 424 | 425 | # This command is run just before the install finishes, but when there is 426 | # still a usable /target directory. You can chroot to /target and use it 427 | # directly, or use the apt-install and in-target commands to easily install 428 | # packages and run commands in the target system. 429 | #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh 430 | 431 | # Add ONIE GRUB menu entries 432 | d-i preseed/late_command string \ 433 | echo "Adding ONIE grub menu entires ..." ; \ 434 | mkdir /mnt/onie ; \ 435 | mount /dev/vda2 /mnt/onie ; \ 436 | echo "df output:" ; df ; \ 437 | echo "/mnt/onie contents:" ; find /mnt/onie ; \ 438 | cp /mnt/onie/onie/grub.d/50_onie_grub /target/etc/grub.d ; \ 439 | umount /mnt/onie ; \ 440 | rmdir /mnt/onie ; \ 441 | in-target update-grub 442 | --------------------------------------------------------------------------------