ну наконец-то! так как вылизывать это можно бесконечно, нужно на чём-то остановиться и заняться наконец более важными вещами.

pxelinux

label debian-semiauto x86
menu label Debian semi-automatic x86
kernel debian-installer/i386/linux
append initrd=debian-installer/i386/initrd.gz vga=771 interface=auto priority=high auto=true hostname=new-host domain=<domain> url=<server>


preseed.cfg

#
# Automation
# ----------
#
d-i preseed/run string magic.sh

#
# Locale
# ------
d-i debian-installer/locale string ru_RU
d-i console-keymaps-at/keymap string ru

#
# Mirror
# ------
d-i mirror/country string manual
d-i mirror/http/hostname string <host>
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i mirror/suite string stable
d-i apt-setup/contrib boolean true
d-i apt-setup/non-free boolean true
d-i apt-setup/security_host string <host>
d-i apt-setup/volatile_host string <host>

#
# Clock
# -----
d-i clock-setup/utc boolean true
d-i time/zone string Europe/Moscow
d-i clock-setup/ntp boolean false

#
# Base installer
# --------------
#
# if bzip2 is included in this list, apt-setup will fetch .tar.bz2 instead of .tar.gz and somehow this will break the process
bootstrap-base base-installer/includes string less mc openssh-server openntpd telnet pciutils vlan sudo nmap resolvconf file openssl ca-certificates elinks make rsync bridge-utils smbclient smbfs
#
# libsasl2 seems to be a stray library
bootstrap-base base-installer/excludes string libsasl2
#
# skip the contest
d-i popularity-contest/participate boolean false

#
# Accounts
# --------
d-i passwd/make-user boolean false
d-i passwd/root-password-crypted password <md5>

#
# Preconfiguring packages
# -----------------------
#
# Console-cyrillic
console-cyrillic console-cyrillic/bootsetup boolean true
console-cyrillic console-cyrillic/encoding string UNICODE
console-cyrillic console-cyrillic/fontsize string 16
console-cyrillic console-cyrillic/kbdtype string Russian Winkeys
console-cyrillic console-cyrillic/switch string No temporary switch
console-cyrillic console-cyrillic/toggle string Control+Shift
console-cyrillic console-cyrillic/ttys string /dev/tty[1-6]
#
# for an unknown reason this does not work
# console-cyrillic console-cyrillic/fontstyle string Terminus Unicode Framebuffer

#
# Samba
samba-common samba-common/dhcp boolean false
samba-common samba-common/encrypt_passwords boolean true
samba-common samba-common/workgroup string <workgroup>


magic.sh

#!/bin/sh

# The constants.
#
ACTION=""
ACTION_PKGSEL="remove-pkgsel"
ACTION_FINISH="finish"
LANGUAGE_LIST="/usr/share/localechooser/languagelist"
DPKG_STATUS="/var/lib/dpkg/status"
DEBCONF="/etc/apt/apt.conf.d/70debconf"
MAGIC_INSTALLED="/root/magic.sh"
MAGIC_PKGSEL="/usr/lib/post-base-installer.d/01magic-$ACTION_PKGSEL.sh"
MAGIC_FINISH="/usr/lib/finish-install.d/90magic-$ACTION_FINISH.sh"

# Who am I anyway?
#
ME="$(basename $0)"
ME="${ME#*-}" # strip the prefix
ME="${ME%.*}" # strip the suffix

# The state machine. A kind of.
#
ACTION="$ME"
case "$ACTION" in
"$ACTION_PKGSEL"
# Patch the dpkg/status to exclude pkgsel out of there, so main-menu won't run it at all
#
sed -i '/^Package: pkgsel$/,/^$/d' $DPKG_STATUS
echo "[*] $DPKG_STATUS patched OK."
;;
"$ACTION_FINISH"
# Add some polish. Just an example currently.
#
# Low the default priority of dpkg-reconfigure
in-target [ -e $DEBCONF ] && in-target sed -i 's|--apt |--apt --priority=low |g' $DEBCONF
echo "[*] $DEBCONF patched OK."
;;
*)
# The default behavior: we don't know for sure under what name we will be called for the first time, so
#
if [ -e "$MAGIC_INSTALLED" ]; then
echo "[!] Unknown action, aborting." # already installed, not sure what to do
else
# Infiltrate the system
#
cp "$0" "$MAGIC_INSTALLED"
chown root:root "$MAGIC_INSTALLED"
chmod 0770 "$MAGIC_INSTALLED"
ln -s "$MAGIC_INSTALLED" "$MAGIC_PKGSEL"
ln -s "$MAGIC_INSTALLED" "$MAGIC_FINISH"
echo "[*] installed magic OK."
# Patch the languagelist so that the russian console is provided by console-cyrillic instead of console-setup
#
sed -i 's/console-setup/cyr/g' $LANGUAGE_LIST
echo "[*] $LANGUAGE_LIST patched OK."
fi
;;
esac


r3

URL записи