tag 580687 + pending
retitle 580687 multistrap should report parsing errors in config files
quit

On Fri, 07 May 2010 22:07:24 +0200
Hector Oron <zu...@debian.org> wrote:

> $ multistrap -f efika-config
> em_multistrap 2.0.9 using efika-config
> em_multistrap: No sources defined for a foreign multistrap.
>       Using your existing apt sources. To use different sources,
>       list them with aptsources= in 'efika-config'.
> Use of uninitialized value $dir in concatenation (.) or string
> at /usr/sbin/em_multistrap line 156. Unable to use directory ''
> Defaulting architecture to native: i386
> 
> While efika-config has been taken from example at wiki page
> http://wiki.debian.org/Multistrap

OK, that config file was bad and multistrap needs to be more careful
about how such things are reported. (The real bug is multistrap
handling of broken config rather than failing to start or the config
file itself.)

The version of multistrap in experimental supports a --simulate option
which shows that the supplied config file isn't going to be much use:

$ sudo multistrap -f /home/neil/580687.conf  --simulate
Bootstrap: 
Apt sources: 
Includes: 
Sources: 
Packages: 
Suites: 
Components: 
Use of uninitialized value $arch in concatenation (.) or string
at /usr/sbin/multistrap line 952. arch: 
Use of uninitialized value $dir in concatenation (.) or string
at /usr/sbin/multistrap line 953. dir: 
unpack: true

I'll enhance that simulate option to complain loudly when the supplied
config file generates such a useless data set and drop the misleading
perl messages.

The current output for the given file is:

$ sudo ./multistrap -f /home/neil/580687.conf  

The supplied configuration file '/home/neil/580687.conf' cannot be
parsed correctly.
Bootstrap: 
Apt sources: 
Includes: 
Sources: 
Packages: 
Suites: 
Components: 
unpack: true

Cannot determine architecture from '/home/neil/580687.conf'.
Cannot determine directory from '/home/neil/580687.conf'.

I've updated the example config on the wiki page, but to show what
happened:

> [General]
> # arch and directory can be specified on the command line.
> arch=armel
> directory=/home/zumbi/mnt/
> # same as --tidy-up option if set to true
> cleanup=true
> # retain the sources outside the rootfs for distribution
> # specify a directory to which all the .debs can be moved.
> # or override with the --source-dir option.
> retainsources=
> # same as --no-auth option if set to true
> # keyring packages listed in each debootstrap will
> # still be installed.
> noauth=true
> # retries not needed.
> #retries=5

'retries' is a bootstrap hang-over and is simply ignored. Note that
multistrap ignores any unrecognised options in the config file - this
allows for backwards-compatible behaviour as well as overloading the
multistrap config files to support other tools (like pbuilder).

> # extract all downloaded archives
> unpack=true
> # the order of sections is no longer important.
> # debootstrap determines which repository is used to
> # calculate the list of Priority: required packages
> debootstrap=Grip

For clarity, this option is being changed to 'bootstrap' although both
names will be recognised by multistrap.

> # the order of sections is no longer important.
> # aptsources is a list of sections to be listed
> # in the /etc/apt/sources.list.d/multistrap.sources.list
>  of the target.
> aptsources="Grip Updates Debian"

Problem 1: The long comment line has wrapped in the Wiki formatting and
now misses out the comment marker '#'.

# the order of sections is no longer important.
# aptsources is a list of sections to be listed
# in the /etc/apt/sources.list.d/multistrap.sources.list
  of the target.
aptsources="Grip Updates Debian"

Should be:

# the order of sections is no longer important.
# aptsources is a list of sections to be listed
# in the /etc/apt/sources.list.d/multistrap.sources.list
-  of the target.
+#  of the target.
aptsources="Grip Updates Debian"

Problem 2: The distinction between bootstrap and aptsources is unclear
and the updated manpage multistrap 2.1.4 tries to clarify this:

      "aptsources" lists the sections which should be used to create
the /etc/apt/sources.list.d/multistrap.list apt sources in the final
system. Not all "aptsources" have to appear in the "bootstrap" section
if you have some internal or local sources which are not accessible to
the installed root filesystem.

       "bootstrap" lists the sections which will be used to create the
multistrap itself. Only packages listed in "bootstrap" will be
downloaded and unpacked by multistrap.

Previous versions of multistrap confused the two and led to
configurations that were impossible to resolve or which led to the
wrong packages being selected. (e.g. when preparing a cross-building
chroot using a multistrap configuration, as in pdebuild-cross).

> [Trx850]
> # space separated package list
> packages=sl40-platform-debian balloon3-config
> source=http://trx850/debian
> suite=goats

That's just plain wrong for a general purpose example like the one on
the wiki. However, as long as TRX850 is not included (case insensitive)
in the 'bootstrap' configuration, this *is* correct for a local
configuration file. It doesn't matter if that section is omitted from
aptsources too (it is just then bloat in the configuration file). If
aptsources lists the section, then devices which use the multistrap
filesystem would need access to the listed repository - i.e. would need
to be able to find a machine on their local network with that DNS name
or apt-get update would complain.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

Attachment: pgpFBQg3PHzTQ.pgp
Description: PGP signature

Reply via email to