From 830d863fa666a6b56fca117850f91a437b64d246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Mon, 20 Jul 2020 16:59:39 +0200 Subject: [PATCH] Change simple-cdd configuration to have full installer work offline We move the default preseed to the kali profile so that the default preseed can actually again enable simple-cdd-profiles that we need because we want the other profiles to have their preseed and postinst working (and they work through the script run when simple-cdd-profiles is installed). We add an offline profile that disables the network mirror (but not the networking!) and we add a "postinst" script that is run in the finish-install step to actually configure /etc/apt/sources.list that is empty due to the preseed. --- simple-cdd/profiles/default.preseed | 4 +++- simple-cdd/profiles/default.udebs | 3 +-- simple-cdd/profiles/kali.postinst | 17 +++++++++++++++++ simple-cdd/profiles/kali.preseed | 1 + simple-cdd/profiles/offline.preseed | 3 +++ simple-cdd/simple-cdd.conf | 11 ++++++++++- 6 files changed, 35 insertions(+), 4 deletions(-) mode change 120000 => 100644 simple-cdd/profiles/default.preseed create mode 100755 simple-cdd/profiles/kali.postinst create mode 120000 simple-cdd/profiles/kali.preseed create mode 100644 simple-cdd/profiles/offline.preseed diff --git a/simple-cdd/profiles/default.preseed b/simple-cdd/profiles/default.preseed deleted file mode 120000 index 26deeec..0000000 --- a/simple-cdd/profiles/default.preseed +++ /dev/null @@ -1 +0,0 @@ -../../kali-config/common/includes.installer/preseed.cfg \ No newline at end of file diff --git a/simple-cdd/profiles/default.preseed b/simple-cdd/profiles/default.preseed new file mode 100644 index 0000000..75bff77 --- /dev/null +++ b/simple-cdd/profiles/default.preseed @@ -0,0 +1,3 @@ +# loads the simple-cdd-profiles udeb to which asks for which profiles to use, +# load the debconf preseeding and queue packages for installation. +d-i preseed/early_command string anna-install simple-cdd-profiles diff --git a/simple-cdd/profiles/default.udebs b/simple-cdd/profiles/default.udebs index a437f75..ee104d8 100644 --- a/simple-cdd/profiles/default.udebs +++ b/simple-cdd/profiles/default.udebs @@ -1,2 +1 @@ -# Disable default udebs from simple-cdd -# We don't want simple-cdd-profiles, we want to use tasksel +simple-cdd-profiles diff --git a/simple-cdd/profiles/kali.postinst b/simple-cdd/profiles/kali.postinst new file mode 100755 index 0000000..51e7a66 --- /dev/null +++ b/simple-cdd/profiles/kali.postinst @@ -0,0 +1,17 @@ +#!/bin/sh + +if grep -q '^deb ' /etc/apt/sources.list; then + echo "INFO: sources.list is configured, everything is fine" + exit 0 +fi + +echo "INFO: sources.list is empty, setting up a default one for Kali" + +cat >/etc/apt/sources.list <