Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to know how can I add this to preseeding via d-i early/command or d-i preseed/run to set my mirror inside preseed.cfg from /proc/cmdline argument.

If I do:

d-i preseed/run string ws/

     for x in `cat /proc/cmdline`; do
             case $x in RPHOST*)
                     eval $x

                     d-i mirror/http/hostname string ${RPHOST}
                     d-i mirror/http/mirror string ${RPHOST}
                     d-i apt-setup/security_host string ${RPHOST}

it fails.

It works well in the CentOS kickstart %pre section but i have no clue how to do it via debian/ubuntu preseeding.

share|improve this question
up vote 5 down vote accepted

after some research on debconf i came up with this solution:

in your preseed.cfg you call the script via:

d-i preseed/run string ws/    // subdir from preseed file location

content of

echo "Start runscript" >> /var/log/syslog
for x in `cat /proc/cmdline`; do
        case $x in RPHOST*)
                eval $x
                echo "d-i mirror/http/hostname string ${HOST}" > /tmp/mirror.cfg
                echo "d-i mirror/http/mirror string ${HOST}" >> /tmp/mirror.cfg
                echo "d-i apt-setup/security_host string ${HOST}" >> /tmp/mirror.cfg
// add´s values to /var/lib/cdebconf/question.dat
debconf-set-selections /tmp/mirror.cfg

works good @ 12.04.2 LTS !

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.