severity 611188 wishlist
merge 611188 599056
quit

On Wed, 26 Jan 2011 16:26:55 +0100
Daniel Baumann <[email protected]> wrote:

> from looking at the sources i see you're moving start-stop-daemon and/or
> initctrl arround;

Only if configured to use chroot.sh (and the only configuration in
the multistrap sources which uses that is the cross-building chroot
stuff, meant to work with pbuilder).

Normally, multistrap does nothing about daemons.

> i wonder why you're not using the same approach as
> debian-live does through policy-d.rc, which looks much simpler to me:
> 
> http://live.debian.net/gitweb?p=live-build.git;a=blob;f=scripts/build/lb_chroot_sysv-rc;h=5829275539978a9dd781b3a9e60ac4923c8675b0;hb=HEAD#l49
> 
> look at line number 49ff.

Creating $dir/usr/sbin/policy-rc.d and making it executable does not
actually allow openssh-server to configure. The change makes no
difference compared to just using chroot.sh.

The intended support is this:

setupscript=/usr/share/multistrap/chroot.sh

(Not enabled by default because it is only necessary if the packages
list includes packages which need it.)

Using this version of the setupscript:

#!/bin/sh

set -e

# The script is called with the following arguments:

# $1 = $DIR  - the top directory of the debootstrapped system
# $2 = $ARCH - the specified architecture, already checked with 
# dpkg-architecture.

# setup.sh needs to be executable.
if [ -d $1 ]; then
mkdir -p $1/usr/sbin/
cat > $1/usr/sbin/policy-rc.d << EOF
#!/bin/sh
echo "All runlevel operations denied by policy" >&2
EOF
chmod a+x $1/usr/sbin/policy-rc.d
fi

... does not make any odds to openssh-server setup for Squeeze.

Setting up openssh-server (1:5.5p1-6) ...
Creating SSH2 RSA key; this may take some time ...PRNG is not seeded
dpkg: error processing openssh-server (--configure):
 subprocess installed post-installation script returned error exit
status 255

I suspect that some packages need to be configured in a more
"realistic" situation where things like /proc and /dev are mounted.
i.e. something more similar to a pbuilder login environment.
Unfortunately, multistrap cannot assume that it is safe to mount the
external /dev and /proc inside the multistrap environment, so this has
to be an optional step via setupscript.

Any setupscript specified in the config is executed before the packages
are configured for native multistraps. This could provide a way to do
the entire operation in the setupscript, leaving the multistrap
configuration step with nothing to do (which is fine).

#!/bin/sh
set -e
# $1 is the directory, so maybe mount proc in that location now
# probably mount dev too and if you're doing that, /dev/pts too.
# maybe write out $1/usr/sbin/policy-rc.d here
# export the debconf variables and LC* variables
# now run the dpkg --configure -a
# now do the umount

??

(completely untested but similar to how pbuilder works)

Multistrap was designed for cross / foreign bootstrapping and sometimes
this shows in how the native stuff is handled.

I may well use the $1/usr/sbin/policy-rc.d script instead of the
current behaviour of chroot.sh but I need to do some more testing first
and it will only be an optional setting via the setupscript field, not
an integral part of multistrap. (See
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599056#10 for my
reasoning on that.)

-- 


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

Attachment: pgpjNDNXJ0Z11.pgp
Description: PGP signature

Reply via email to