The officially official Devuan Forum!

You are not logged in.

#1 2018-01-28 05:38:39

shimo
Member
Registered: 2017-08-08
Posts: 4  

Automated install: How to config preseed to prevent desktop install?

I was using a preseed.cfg file to automate Devuan Jessie installation. Base image is amd64 DVD, and I used UNetbootin to create the USB installer. I specified this answer on the preseed file based on what I'm seeing from debconf-get-selections (I only wanted to pre-install standard components and SSH server, I don't want a desktop environment or other utilities):

d-i tasksel/first multiselect SSH server, standard system utilities

However, the installation did include the XFCE desktop with lightdm. Am I doing this wrong? Does anyone have experience doing preseeding for Devuan?

I'll try perhaps following Debian Jessie's preseed and check if these settings would work:

tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server

Offline

#2 2018-04-15 02:29:20

shimo
Member
Registered: 2017-08-08
Posts: 4  

Re: Automated install: How to config preseed to prevent desktop install?

As I am pressed for time, I wasn't able to finish troubleshooting the issue. However, I do believe the issue may be caused by tasksel packaging specific for Devuan. Most of the Debian d-i documentation still applies and you can find below the preseed file I'm using to setup Devuan Jessie via netinstaller on a 32GB SSD for a kiosk/vending machine. Here are the workarounds that I have implemented:

1. In preseed.cfg: run my post-installation script that contains the workarounds and my customizations (other packages I want to install, setting up users and keys)

# Post install
d-i preseed/late_command string                                         \
    cd /target;                                                         \
    mkdir ./var/blackhills;                                             \
    cp -R /cdrom/blackhills/* ./var/blackhills;                         \
    chmod +x ./var/blackhills/post_install.sh;                          \
    chroot ./ ./var/blackhills/post_install.sh;                         \
    reboot

2. In post_install.sh: remove the desktop environment and print-server that Devuan installs but not controllable via d-i

# purge unecessary install pending fix on tasksel
tasksel remove print-server xfce-desktop xfce-desktop

3. post_install.sh: manually ensure that standard packages are installed

# install standard packages
yes | aptitude install ~pstandard ~pimportant ~prequired
# ensure ssh server installed
tasksel install ssh-server
# ensure sudo installed
apt-get install -y sudo

Here is my preseed file:

#_preseed_V1

# 1. Choose language
# ==================

d-i debian-installer/language string en
d-i debian-installer/country string US
d-i localechooser/supported-locales multiselect en_US.UTF-8, en_DK.UTF-8
d-i debian-installer/locale select en_US.UTF-8

# 2. Configure the keyboard
# =========================

d-i keyboard-configuration/xkb-keymap select us

# 3. Detect and mount CD-ROM
# ==========================

d-i cdrom-detect/load_media boolean true

# 4. Load installer components from CD

# 5. Detect network hardware

#
d-i hw-detect/load_media boolean false
d-i hw-detect/load_firmware boolean true

# 6. Configure the network
# ========================

# Auto-configure networking?
d-i netcfg/use_autoconfig boolean true

# Waiting time (in seconds) for link detection:
d-i netcfg/link_wait_timeout string 10

d-i netcfg/dhcp_timeout string 60
d-i netcfg/dhcpv6_timeout string 60
d-i netcfg/choose_interface select auto

# Hostname:
d-i netcfg/get_hostname string blackhills-null
d-i netcfg/hostname blackhills-null

# Domain name:
d-i netcfg/get_domain string local

#
d-i netcfg/wireless_wep string

# 7. Setup users and passwords
# ============================

# Enable shadow passwords?
d-i passwd/shadow boolean true

# Allow login as root?
d-i passwd/root-login boolean true

# Root password:
d-i passwd/root-password-crypted password $6$rounds=1000000$mJQfdK23$73slO0O7Jk3tpAIly63ou/.RVwDYRntzCvX/M.GEtqHpIBMFFMwQhE2858UM0kPq5CTE8Pig2JiAyt1qPU37P/

# Create a normal account now?
d-i passwd/make-user boolean false

# 8. Configure the clock
# ======================

# Set the clock using NTP?
d-i clock-setup/ntp boolean true

# NTP server to use:
d-i clock-setup/ntp-server string us.pool.ntp.org

# Select your timezone:
d-i time/zone string Etc/UTC

# 9. Detect disks

# 10. Partition disks
# ===================

# purge existing LVM volumes
d-i partman/early_command string vgs --separator=: --noheadings | cut -f1 -d: | while read vg ; do vgchange -an $vg ; done ; pvs --separator=: --noheadings | cut -f1 -d: | while read pv ; do pvremove -ff -y $pv ; done
d-i partman-auto/disk string /dev/sda
d-i partman/alignment string optimal
d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman/choose_partition select Finish
d-i partman/confirm_write_new_label boolean true
d-i partman-auto/method string lvm
d-i partman-basicfilesystems/choose_label string gpt
d-i partman-basicfilesystems/default_label string gpt
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt
d-i partman/choose_label string gpt
d-i partman/default_label string gpt
d-i partman-auto/choose_recipe select gkhdd
d-i partman-auto/expert_recipe string                                   \
    gkhdd ::                                                            \
    1 1 1 free                                                          \
        device{ /dev/sda }                                              \
        $gptonly{ }                                                     \
        $primary{ }                                                     \
        $bios_boot{ }                                                   \
        method{ biosgrub }                                              \
    .                                                                   \
    512 512 1280 ext3                                                   \
        device{ /dev/sda }                                              \
        $gptonly{ }                                                     \
        $primary{ }                                                     \
        $bootable{ }                                                    \
        method{ format }                                                \
        format{ }                                                       \
        use_filesystem{ }                                               \
        filesystem{ ext3 }                                              \
        mountpoint{ /boot }                                             \
    .                                                                   \
    30720 1000000000 -1 ext4                                            \
        device{ /dev/sda }                                              \
        $defaultignore{ }                                               \
        $gptonly{ }                                                     \
        $primary{ }                                                     \
        method{ lvm }                                                   \
        vg_name{ lvgruppe }                                             \
    .                                                                   \
    512 512 100% linux-swap                                             \
        $lvmok{ }                                                       \
        method{ swap }                                                  \
        format{ }                                                       \
        in_vg{ lvgruppe }                                               \
        lv_name{ swap }                                                 \
    .                                                                   \
    8192 8192 16384 ext4                                                \
        $lvmok{ }                                                       \
        method{ format }                                                \
        format{ }                                                       \
        use_filesystem{ }                                               \
        filesystem{ ext4 }                                              \
        mountpoint{ /var }                                              \
        options/relatime{ relatime }                                    \
        in_vg{ lvgruppe }                                               \
        lv_name{ var }                                                  \
    .                                                                   \
    8192 8192 8192 ext4                                                 \
        $lvmok{ }                                                       \
        method{ format }                                                \
        format{ }                                                       \
        use_filesystem{ }                                               \
        filesystem{ ext4 }                                              \
        mountpoint{ /tmp }                                              \
        options/relatime{ relatime }                                    \
        in_vg{ lvgruppe }                                               \
        lv_name{ tmp }                                                  \
    .                                                                   \
    10240 1000000000 -1 ext4                                            \
        $lvmok{ }                                                       \
        method{ format }                                                \
        format{ }                                                       \
        use_filesystem{ }                                               \
        filesystem{ ext4 }                                              \
        mountpoint{ / }                                                 \
        options/noatime{ noatime }                                      \
        in_vg{ lvgruppe }                                               \
        lv_name{ root }                                                 \
    .
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman-md/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/mount_style select uuid

# 11. Install the base system
# ===========================

# Kernel to install:
d-i base-installer/kernel/image string linux-image-amd64

# Drivers to include in the initrd:

#
d-i base-installer/install-recommends boolean false

# 12. Configure the package manager
# =================================

# Use a network mirror?
d-i apt-setup/use_mirror boolean true

# Protocol for file downloads:
d-i mirror/protocol string http

# Devuan archive mirror country:
d-i mirror/country string manual

# Devuan archive mirror:
d-i mirror/http/hostname string us.mirror.devuan.org

# HTTP proxy information (blank for none):
d-i mirror/http/proxy string

#
d-i mirror/http/directory string /merged/
d-i mirror/suite string jessie

# Use non-free software?
d-i apt-setup/non-free boolean true

# Enable source repositories in APT?
d-i apt-setup/enable-source-repositories boolean false

# Services to use:
d-i apt-setup/services-select multiselect security updates, release updates, backported software

#
d-i apt-setup/contrib boolean false
d-i apt-setup/disable-cdrom-entries boolean true

# 13. Select and install software
# ===============================

# Participate in the package usage survey?
popularity-contest popularity-contest/participate boolean false

# Choose software to install:
tasksel tasksel/first multiselect standard, ssh-server

#
d-i pkgsel/include string openssh-server build-essential sudo screen
d-i pkgsel/upgrade select none

# 14. Install the GRUB boot loader on a hard disk
# ===============================================

# Install the GRUB boot loader to the master boot record?
d-i grub-installer/with_other_os boolean true

#
d-i grub-installer/only_debian boolean true
d-i grub-installer/grub2_instead_of_grub_legacy boolean true

# Device for boot loader installation:
d-i grub-installer/bootdev string /dev/sda
d-i grub-installer/choose_bootdev select /dev/sda

# Force GRUB installation to the EFI removable media path?
grub-installer grub-installer/force-efi-extra-removable boolean false

# 15. Finish the installation
# ===========================

# Is the system clock set to UTC?
d-i clock-setup/utc boolean true

# Post install
d-i preseed/late_command string                                         \
    cd /target;                                                         \
    mkdir ./var/blackhills;                                             \
    cp -R /cdrom/blackhills/* ./var/blackhills;                         \
    chmod +x ./var/blackhills/post_install.sh;                          \
    chroot ./ ./var/blackhills/post_install.sh;                         \
    reboot

#
d-i finish-install/reboot_in_progress note
d-i cdrom-detect/eject boolean true

Offline

#3 2019-05-09 06:17:04

little
Member
Registered: 2017-06-08
Posts: 26  

Re: Automated install: How to config preseed to prevent desktop install?

While I didn't need to remove the desktop environment, I have a preseed file I will share here for anyone looking for a similar example (Although, in ascii it boots up without any desktop).

Note that here, it is for i386, and it requires confirmation on partitioning so that you don't overwrite the hdd.

#

# 1. Choose language
# ==================

d-i debian-installer/language string en
d-i debian-installer/country string US
d-i localechooser/supported-locales multiselect en_US.UTF-8, en_DK.UTF-8
d-i debian-installer/locale select en_US.UTF-8

# 2. Configure the keyboard
# =========================

d-i keyboard-configuration/xkb-keymap select us

# 3. Detect and mount CD-ROM
# ==========================

d-i cdrom-detect/load_media boolean true

# 4. Load installer components from CD

# 5. Detect network hardware

#
d-i hw-detect/load_media boolean false
d-i hw-detect/load_firmware boolean false

# 6. Configure the network
# ========================

# Auto-configure networking?
d-i netcfg/use_autoconfig boolean true

# Waiting time (in seconds) for link detection:
d-i netcfg/link_wait_timeout string 10

d-i netcfg/dhcp_timeout string 60
d-i netcfg/dhcpv6_timeout string 60
d-i netcfg/choose_interface select auto

# Hostname:
d-i netcfg/get_hostname string devuan_host
d-i netcfg/hostname devuan_host

# Domain name:
d-i netcfg/get_domain string local

#
d-i netcfg/wireless_wep string

# 7. Setup users and passwords
# ============================

# Enable shadow passwords?
d-i passwd/shadow boolean true

# Allow login as root?
d-i passwd/root-login boolean true

# Root password:
d-i passwd/root-password password defpass123

# Create a normal account now?
d-i passwd/make-user boolean false

# 8. Configure the clock
# ======================

# Set the clock using NTP?
d-i clock-setup/ntp boolean true

# NTP server to use:
d-i clock-setup/ntp-server string pool.ntp.org

# Select your timezone:
d-i time/zone string America/New_York

# 9. Detect disks

# 10. Partition disks
# ===================

d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular

# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic

#NOTE: it may warn you before partitioning. This is a safety check and can be omitted if desired.

# 11. Install the base system
# ===========================

#NOTE: i386 here##################################################

# Kernel to install:
d-i base-installer/kernel/image string linux-image-i386

# Drivers to include in the initrd:

#
d-i base-installer/install-recommends boolean true

# 12. Configure the package manager
# =================================

# Use a network mirror?
d-i apt-setup/use_mirror boolean true

# Protocol for file downloads:
d-i mirror/protocol string http

# Devuan archive mirror country:
d-i mirror/country string manual

# Devuan archive mirror:
d-i mirror/http/hostname string deb.devuan.org

# HTTP proxy information (blank for none):
d-i mirror/http/proxy string

#
d-i mirror/http/directory string /merged/
d-i mirror/suite string ascii

# Use non-free software?
d-i apt-setup/non-free boolean false

# Enable source repositories in APT?
d-i apt-setup/enable-source-repositories boolean false

# Services to use:
d-i apt-setup/services-select multiselect security updates, release updates, backported software

#
d-i apt-setup/contrib boolean false
d-i apt-setup/disable-cdrom-entries boolean true

# 13. Select and install software
# ===============================

# Participate in the package usage survey?
popularity-contest popularity-contest/participate boolean false

# Choose software to install:
tasksel tasksel/first multiselect standard, ssh-server

#
d-i pkgsel/include string openssh-server build-essential sudo screen
d-i pkgsel/upgrade select none

# 14. Install the GRUB boot loader on a hard disk
# ===============================================

# Install the GRUB boot loader to the master boot record?
d-i grub-installer/with_other_os boolean true

#
d-i grub-installer/only_debian boolean true
d-i grub-installer/grub2_instead_of_grub_legacy boolean true

# Device for boot loader installation:
d-i grub-installer/bootdev string /dev/sda
d-i grub-installer/choose_bootdev select /dev/sda

# Force GRUB installation to the EFI removable media path?
grub-installer grub-installer/force-efi-extra-removable boolean false

# 15. Finish the installation
# ===========================

# Is the system clock set to UTC?
d-i clock-setup/utc boolean true

#
d-i finish-install/reboot_in_progress note
d-i cdrom-detect/eject boolean true

give a man an init, he takes an os

Offline

#4 2019-10-30 20:28:48

Ozi
Member
From: Melbourne, Australia
Registered: 2017-03-15
Posts: 105  
Website

Re: Automated install: How to config preseed to prevent desktop install?

Offline

Board footer