mk_usb_installer.sh documentation

Note

This script uses sudo to write to the USB key, so you may be prompted for a sudo password.

Usage

The mk_usb_installer.sh script has two parameters:

usb-device: path to the usb device (for example: /dev/sdb).

config-filename: (optional) configuration file containing the settings to build the machine and run ansible.

You can call it this way:

$ ./mk_usb_installer.sh usb-device config-filename

Configuration File

hostname: (bare). Hostname of the target machine. (key to ansible)

url: (video-setup.debian.net). The location of the http server hosting the preseed configuration and additional files. See hosting_files below.

distro: (debian) debian or ubuntu

suite: (buster). Distribution suite to use.

debian_ver: (9.9.0). Release version. See point_release below.

arch: (amd64). Architecture of the target machine.

archive_mirror: (http://deb.debian.org) Where to get installer image.

cdimage_mirror: (https://cdimage.debian.org) URL to the directory containing the ISO file.

load_firmware: (false). Boolean. When true, d-i will prompt the user to provide non-free firmware blobs.

more_appends: (blank). Additional configuration to be appended to the kernel command line.

About Ubuntu

Ubuntu support is here for anyone that wants it, but don’t expect it to always just work. The URL patterns, hd-media fs type, free space and ISO size don’t always fit, the d-i preseed options are slightly different, etc. It is a handy platform for testing things in Launchpad PPAs, or simply testing on Ubuntu.

Hosting Files

The installer needs to get configuration files from somewhere. There are many simple solutions, but they all have their downsides and your lan setup may make some easy or impossible. This section describes a few of the solutions. For more details see the Debian preseed page.

You will know you are having problems when the installer says:
Failed to retrieve the preconfigureation file

There are 2 parts: where to host the files, and how the installer will reference them.

The default is is to use video-setup.debian.net which redirects to the video-team git repo on salsa. This makes Quick Start easy, but isn’t practical for production.

For R&D or production, you can use a box on your lan by cloning the repo and http_server.sh after mk_usb_installer.sh and set url=($hostname:8007) to the installer. This will work if the installer can resolve hostname.domain and wget the files from it.

If it can’t resolve, it may be the domain. Try .local Or use the IP address: url=1.2.3.4:8007

You can also host the files on some other server, using some other protocol, or put the files on the usb stick (this will requires editing some scripts to replace wget with cp.)

Point Release

debian_ver Needs to be the current point release, older ones are removed from the mirrors which causes the script to error. If you see:

./hd-media/boot.img.gz: OK
+ wget -N https://cdimage.debian.org/...
HTTP request sent, awaiting response... 404 Not Found

it is likely a new version has come out and the script’s default debian_ver needs to be updated. The easy fix is add it to the config file you are using:

debian_ver=9.10.0