debootstrap fails to install customized Ubuntu

Bug #1001131 reported by Imre Sándor
64
This bug affects 14 people
Affects Status Importance Assigned to Milestone
debootstrap (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When following the Install CD customization procedure (https://help.ubuntu.com/community/InstallCDCustomization) I fail to get an installable image.
Even with no changes in the CD tree, the created image fails to install. The same procedure worked before precise, I had success with natty and lucid.
The installation stops at installing base-files and base-passwd (see attached image).
If I go back to the installation menu and select Install the base system, then it succeds. Unfortunatelly, debootstrap.log gets deleted by this time, so I created a special debootstrap package with lots of debug messages. It turned out that both packages (base-files and base-passwd) got installed, but still, somehow the dpkg installing them failed.
It turned out, that base-passwd has a postinstall script that - during system installation - populates /etc/passwd and /etc/group copying the files from /usr/share/base-passwd

if [ ! -e /etc/passwd ] ; then
        cp /usr/share/base-passwd/passwd.master /etc/passwd
fi

if [ ! -e /etc/group ] ; then
        cp /usr/share/base-passwd/group.master /etc/group
fi

On the other hand, base-files also has a postinstall script changes the owner of /var/lib/dpkg
if [ ! -d /var/lib/dpkg ]; then
  mkdir -m 755 -p /var/lib/dpkg
  chown root:root /var/lib/dpkg
fi

In my log this shows as:
+ echo
+ chown: invalid user: `root:root'
dpkg: error processing base-files (--install):
 subprocess installed post-installation script returned error exit status 1
dpkg: base-passwd: dependency problems, but configuring anyway as you requested:
 base-passwd depends on libc6 (>= 2.8); however:
  Package libc6 is not installed.
Setting up base-passwd (3.5.24) ...
install base-files

which indicates that the /target/etc/passwd is not yet populated and chown cannot resolv root:root.

For some unknown reason, the postinstall script of base-files runs BEFORE the postinstall script of base-passwd in my installation, altough it does no such thing in the standard precise installation.
The code fragment that does this installation is:
  x_core_install base-files base-passwd
(in a debootstrap script called precise - a link to a long unchanged script called gutsy)

Modifying this script to have the two packages installed separatelly did the trick:
  x_core_install base-passwd
  x_core_install base-files

Now, I can install my customized distro.

I would like your opinion on what could have gone wrong about it:
Why the standard Ubuntu precise installs flawlessly while my reconstructed distro doesn't? How is it, that the same procedure used to create a custom distro suddenly went wrong with no apparent change in the components?
Ok, there might have been changes, but this area is very poorly documented so I had to trial and error to find out how things work (and I still might be wrong).

Revision history for this message
Imre Sándor (seniorsamu) wrote :
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in debootstrap (Ubuntu):
status: New → Confirmed
Revision history for this message
James Rice (jrice-77) wrote :

Have the exact same issue, and was on to the same solution. Not only does it only fail only when you customize the CD, but I have been customizing server since Hardy, and have not had this problem until Precise!

Revision history for this message
Tim Nowaczyk (zimage) wrote :

It looks to be a dupe of this debian bug.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601670

On the stock Ubuntu CD, base-files appears in /dists/precise/binary-i386/Packages before base-passwd. One time I built my custom CD and the order was backwards, causing the error. The next time, base-files was earlier than base-passwd and all went well.

Revision history for this message
Michael Barablin (madbox-mail) wrote :

Have the exact same issue too.

Revision history for this message
YunQiang Su (wzssyqa) wrote :

It didn't appear for me in the last month

While today it happens, ooooooooooooooooooooooooooooh.

I have no idea what makes it disappear and what make it appear again.

Revision history for this message
Autif Khan (autif-mlist) wrote :

It would help if someone could provide instructions to repackage debootstrap from deb to udeb or from source. Thanks!

Revision history for this message
Autif Khan (autif-mlist) wrote :

Repackaging is debootstrap is simple as follows:

1) Download debootstrap's source

wget http://us.archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.39_all.deb

2) Extract source

tar xf debootstrap_1.0.39.tar.gz

3) edit debootstrap-1.0.39/scripts/precise to replace

x_core_install base-files base-passwd

with

 x_core_install base-passwd
 x_core_install base-files

4) cd debootstrap-1.0.39/

5) dpkg-buildpackage -rfakeroot -m"Koko Deploy <email address hidden>" -k16B68D13

This builds the deb and udeb files, which can be replaced in pool/main/d/debootstrap from the CD

Needless to say, you still have to customize the disk as outlined in the article in the link below:

https://help.ubuntu.com/community/InstallCDCustomization#Modify_pool_structure_to_include_more_packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package debootstrap - 1.0.56

---------------
debootstrap (1.0.56) unstable; urgency=low

  [ Tollef Fog Heen ]
  * Install base-passwd and base-files in two calls rather than one to
    avoid problems with home-built media with different ordering in
    Packages. Thanks to Jo Shields for pointing this out and providing
    the workaround. Closes: #601670. LP: #1001131.

  [ Joey Hess ]
  * When deboostrapping Debian, and the debian-archive-keyring is not
    available, switch the default mirror to a https url. This way at
    least the CA level of security is available even for users who
    have no way to check gpg keys in the WoT. The https mirror is
    currently https://mirrors.kernel.org/debian.
  * Avoid writing https urls into sources.list, as apt does not support https.

 -- Christian Perrier <email address hidden> Mon, 30 Dec 2013 08:00:41 +0100

Changed in debootstrap (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.