Skip to main content

Create ISO images to automate Debian installations, by appending a preseed file to Debian official images.

Project description

Debseed

Create ISO images to automate Debian installations, by appending a preseed file to Debian official images.

Prerequisites

This application must be run on Linux and requires python3, xorriso and isolinux. Example on Debian:

sudo apt install python3-pip xorriso isolinux

Installation

Install the application using pip:

pip3 install debseed

Or, if you wish to automatically publish the generated ISO files to a VMWare datastore, install the application with additional dependencies:

pip3 install debseed[vmware]

Usage examples

Download latest Debian ISO file and generate a custom ISO file from it, using the generic edition:

debseed update

Generate a custom ISO file from a specific image and preseed file:

debseed generate debian-11.5.0-amd64-netinst.iso path/to/preseed.cfg

To print full usage instructions, run:

debseed --help

Configuration

Configuration of Debseed is defined in the following files (by decreasing priority):

  • local.conf in current working directory
  • ~/.config/debseed/debseed.conf in home directory
  • C:/ProgramData/debseed/debseed.conf (Windows) or /etc/debseed/debseed.conf (Linux)

Configuration section [debseed] contains general-purpose application settings.

Specific sets of generation parameters, called editions, are configured in their own configuration section. For example, section named default is configured using configuration section [debseed:default].

See example.

Development

Create Python virtual environment (example on a Debian workstation):

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip wheel
pip install -r requirements_all.txt

Run commands:

python -m debseed --help

Clean repository:

find . \( -name __pycache__ -o -name build -o -name dist -o -name "*.egg-info" \) -not -path "./.venv/*" -exec rm -rf {} \;

Create Python redistribuable package:

pip wheel --no-deps -w dist .

Prepare Twine for package upload (if necessary):

pip install twine
$env:REQUESTS_CA_BUNDLE="...ca-certificates.crt"

Check package (in particular, verify version in file name):

twine check dist/...

Upload le paquet:

twine upload --repository ...  dist/...

Troubleshooting

Display information about an ISO file

Using command isoinfo from Debian package genisoimage:

isoinfo -d -i path.iso

Extract initial ramdisk

cd debseed.tmp/...
mkdir extracted-initrd
cd  extracted-initrd
cpio -idm < ../initrd

Update Debian signing GPG key

gpg --keyserver hkp://keyring.debian.org:80 --keyserver-options http-proxy=http://... --recv-keys DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg --output debseed/assets/debian-cd-signing.gpg --export DF9B9C49EAA9298432589D76DA87E80D6294BE9B

Create local NAT network 10.0.2.2/24 for Hyper-V VMs

To reproduces VirtualBox default networking, where 10.0.2.2 is the address of the host as seen from the VMs, configure an internal virtual switch in Hyper-V, using the following Powershell commands (with elevated privileges):

New-VMSwitch -Name "10.0.2 Switch" -SwitchType Internal -Notes "For VMs in network 10.0.2.2/24"
New-NetIPAddress -IPAddress 10.0.2.2 -PrefixLength 24 -InterfaceAlias "vEthernet (10.0.2 Switch)"
Get-NetNat | ? Name -Eq "10.0.2 Nat" | Remove-NetNat -Confirm:$False
New-NetNat -Name "10.0.2 Nat" -InternalIPInterfaceAddressPrefix 10.0.2.0/24

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

debseed-0.1.3-py3-none-any.whl (39.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page