[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

support for non-interactive installs



Well with the latest release of base-config-1.33.4,
my trick of putting "db_set" statements in /root/dbootstrap_settings
is now broken, with base-config dying saying db_set command not found.
It worked fine in base-config-1.33.

So this is what my dbootstrap_setting would look like:

DEBIAN_FRONTEND=Noninteractive
SUITE=$SUITE

db_set apt-setup/mirror sunsite.cnlab-switch.ch
db_set apt-setup/country Switzerland
db_set apt-setup/uri_type http

db_set tzconfig/gmt true
db_set tzconfig/change_timezone Europe/Zurich
# may need to file a bug against tzconfig

db_set apt-setup/non-us true
db_set apt-setup/contrib true
db_set apt-setup/non-free true

db_set base-config/run-dselect false
db_set base-config/run-tasksel false

# done with template sed foo
#db_set passwd/md5 true
#db_set passwd/shadow true


And it would be nice if that worked.


So anyway, if this is not 'the way' to do it, what is ?

I change the inittab.install to have "env DEBIAN_FRONTEND=Noninteractive /usr/bin/termwrap base-config...."
 to make that work.
 The DEBIAN_FRONTEND can't be exported from dbootstrap_settings as I would try in the above example.

So please, what is the way to get the behaviour I want ?

What would you seasoned debian developers recommend ?

This is one alternative I have used for the passwd package:

# this template sed foo is done since we don't have a simple sweet way to load-templates, and db_register can't
# create a template
# HMM. busybox can't handle a <space> between addresses and 's' command.
echo Modifying $TARGET/var/lib/dpkg/into/passwd.templates to default md5
sed -e '/passwd\/md5/,/false/s/false/true/' \
  $TARGET/var/lib/dpkg/info/passwd.templates > $TARGET/var/lib/dpkg/info/passwd.templates-new || die "sed passwd template"

  mv $TARGET/var/lib/dpkg/info/passwd.templates-new $TARGET/var/lib/dpkg/info/passwd.templates || die "mv passwd template"




I do think a non-ineractive install is worth supporting.
I had it all working too.  Oh. and while I am on about it, there is a stupid "press return to continue"
in /usr/lib/dpkg/apt/methods/install that can't be gotten rid of.

In fact, here is some more snippet from my installer script:

# this suppresses the "Do you want to continue" prompt of /usr/lib/base-config/75apt-get
echo 'DSelect { Options "-y -f"; };' > $TARGET/etc/apt/apt.conf
# note that /usr/lib/dpkg/methods/apt/install looks for 'always' but man apt.conf says to use "clean" or "autoclean"
echo 'DSelect { Clean "always"; };' >> $TARGET/etc/apt/apt.conf
echo 'ACQUIRE { Retries "3"; };' >> $TARGET/etc/apt/apt.conf


This works nicely (worked until base-config-1.33.4 came out and broke my db_set stuff), but it can't get rid of:
     always)
       $APTGET "$APT_OPT0" "$APT_OPT1" clean &&
           echo "Press enter to continue." && read RES && exit 0;
       ;;



#################################33

That would be some 10 bug reports on different packages I guess.  Could we have a discussion about
the 'right' way to approach a non-interactive install.  I at least have a working script that tries
hard to use the clusterfu^H^H^H^H^H^^H^  beautiful apt tools in the way they were scrambled
together I mean designed. ;)

Kind regards and lots of harmless cynicism,

Peter



Reply to: