Running a Script Just Before Installation of Debian Finishes Using Preseed

Run script after Debian installation is complete

Surely the reason that it does not work when trying to execute is because the route has not been declared. You can use this failing that:

 
d-i preseed/late_command string cp /cdrom/files/jitsi/run.sh /target/root/; chmod +x /target/root/run.sh; in-target /bin/bash /root/run.sh

Bash scripting on debian installer not accepting user input on preseeding

Use debconf for that kind of configuration, it tackles exactly needs like yours.

Adapted example from the manual

Template file (debian/templates):

Template: your_package/select_option
Type: select
Choices: 1, 2, 3
Description: Which option?
Choose one of the options

Script (debian/config):

#!/bin/sh -e

# Source debconf library.
. /usr/share/debconf/confmodule

db_input medium your_package/select_option || true
db_go

# Check their answer.
db_get your_package/select_option
if [ "$RET" = "1" ]; then
# Do stuff
fi

passwordless sudo using ubuntu preseed and packer

The problem is that a preseed file can only have one preseed/late_command section, not multiple.

If you need to execute multiple commands, you can have them as a single late_command separated with ; e.g.

d-i preseed/late_command string \
in-target cmd1 args ... ; \
in-target cmd2 args ... ; \
...


Related Topics



Leave a reply



Submit