Hi all,
I've been happily using live-helper for nearly a year now and this is probably the first problem I haven't been able to solve through mail list/debian live manual/google results browsing. As this is also my first email to the list, please excuse any formatting irregularity and the possibly over detailed description.
I'm trying to build a LiveCD that, among other software, includes cruisecontrol (a continuous integration tool see [0]). To that effect, I'm currently using the unofficial package provided by thoughtworks as part of their Buildix LiveCD (see [1]) as this is the most up to date Debian package I could find.
When installing, this package creates a user (using adduser) with cruise as username. During the live-helper chroot stage, this user is assigned the following uid : 1000.
When booting the resulting image (from either burnt CD or VirtualBox on WinXP), live-initramfs fails to add the Live User whose uid seem to conflict with that of the cruise user.
Extract from /var/log/live.log
Begin: Adding live session user ... The default user (user) is not present, setting default user to: cruise.
sh: /home/cruise/.su-to-rootrc: No such file or directory
mkdir: cannot create directory `/home/cruise': Permission denied
done.
What I've tried so far (to no avail) to workaround this problem :
- use a chroot hook to change (with sed) the hardcoded uid in /usr/share/initramfs-tools/scripts/live-bottom/10adduser (999 or 1000 with say 1666)
- place a manually edited version of that script in config/chroot_local-includes/...
- preseed both packages (cruisecontrol and live-initramfs)
- use a chroot hook to change (with sed) FIRST_UID in /usr/share/adduser/adduser.conf (realised it was useless since the hook is executed after the chroot_package-list stage)
What I haven't tried yet :
- use a chroot hook to change (with usermod) the uid (worried about it not changing the user's directories outside of its home directory)
- upgrade live-helper and/or live-initramfs to unstable (I'm using lenny)
- used buildix LiveCD (there's other software I need)
- whatever else you can can come up with
Should I consider the fact that the Live User's uid is hardcoded in live-initramfs' 10adduser script (unlike its username and full name) as a hint that it is not (yet) possible to set it or is this a bug?
As previously mentioned, I'm using the latest version of live-helper and live-initramfs available for lenny, ie :
- live-helper : 1.0.3-2
- live-initramfs : 1.156.1-1
Here's a way to reproduce (where [...] is some other path where I've put hereafter mentioned scripts and configuration files):
$ lh_clean --purge && [...]/lh_config.bare.sh && [...]/lh_buildix.sh
$ cp [...]/cruisecontrol config/chroot_local-preseed
$ cp [...]/live-user config/chroot_local-preseed
$ cp [...]/sun-java6-jdk config/chroot_local-preseed
$ cp [...]/02-cruise.chroot.sh config/chroot_local-hooks
$ cp [...]/04-adduser.chroot.sh config/chroot_local-hooks
$ lh_build
Here's the content of those files:
$ cat lh_config.bare.sh
#!/bin/sh
APT_RECOMMENDS="disabled"
BINARY_IMAGE_ISO="iso"
BINARY_IMAGE_USB="usb-hdd"
BYNARY_IMAGE=${BINARY_IMAGE_ISO}
BOOT_PARAMETERS="lang=fr keyb=fr locale=fr_FR.UTF-8"
DEBIAN_INSTALLER_LIVE="live"
DEBIAN_INSTALLER_CLASSIC="enabled"
DEBIAN_INSTALLER_NONE="disabled"
DEBIAN_INSTALLER=${DEBIAN_INSTALLER_LIVE}
DISTRIBUTION="lenny"
CATEGORIES="main contrib non-free"
MIRROR="http://localhost:3142/ftp.fr.debian.org/debian/"
SECURITY_MIRROR="http://localhost:3142/security.debian.org/"
BINARY_MIRROR="http://ftp.fr.debian.org/debian/"
SECURITY_BINARY_MIRROR="http://security.debian.org/"
PACKAGE="sun-java6-jdk subversion cruisecontrol"
lh_config --architecture i386 --apt-recommends ${APT_RECOMMENDS} --binary-images ${BINARY_IMAGE_ISO} --bootappend-install "${BOOT_PARAMETERS}" --bootappend-live "${BOOT_PARAMETERS}" --bootloader syslinux --categories "${CATEGORIES}" --debian-installer ${DEBIAN_INSTALLER} --debian-installer-distribution ${DISTRIBUTION} --distribution ${DISTRIBUTION} --language fr --linux-flavours "486" --mirror-bootstrap "${MIRROR}" --mirror-chroot "${MIRROR}" --mirror-chroot-security "${SECURITY_MIRROR}" --mirror-binary "${BINARY_MIRROR}" --mirror-binary-security "${SECURITY_BINARY_MIRROR}" --packages "${PACKAGE}"
---------
$ cat lh_buildix.sh
#!/bin/sh
CHROOT_SOURCE_DIR="config/chroot_sources"
mkdir -pm 777 "${CHROOT_SOURCE_DIR}" && echo "deb http://localhost:3142/buildix.thoughtworks.com/repos/debian buildix main" > "${CHROOT_SOURCE_DIR}/buildix.chroot" && wget "http://buildix.thoughtworks.com/repos/debian/buildix-key.gpg" -O "${CHROOT_SOURCE_DIR}/buildix.chroot.gpg"
---------
$ cat cruisecontrol
cruisecontrol passwd/make-user select true
cruisecontrol passwd/root-password-crypted select *
cruisecontrol passwd/user-password-crypted select 8Ab05sVQ4LLps
cruisecontrol passwd/user-fullname select Cruise Control User
cruisecontrol passwd/username select cruise
cruisecontrol passwd/user-uid select 1556
---------
$ cat live-user
live-initramfs passwd/make-user select true
live-initramfs passwd/root-password-crypted select *
live-initramfs passwd/user-password-crypted select 8Ab05sVQ4LLps
live-initramfs passwd/user-fullname select Live User
live-initramfs passwd/username select user
live-initramfs passwd/user-uid select 1667
---------
$ cat sun-java6-jdk
sun-java6-jdk shared/accepted-sun-dlj-v1-1 select true
sun-java6-jre shared/accepted-sun-dlj-v1-1 select true
sun-java6-bin shared/accepted-sun-dlj-v1-1 select true
---------
$ cat 02-cruise.chroot.sh
#!/bin/sh
LIVE_SCRIPT="/usr/share/initramfs-tools/scripts/live-bottom/10adduser"
LIVE_USERID=1666
sed "s/^\(set passwd\/user-uid \)[0-9]\+$/\1${LIVE_USERID}/1" -i $LIVE_SCRIPT
RC=$?
echo "Code retour adduser : ${RC}"
---------
$ cat 04-adduser.chroot.sh
#!/bin/sh
ADDUSER_SCRIPT="/usr/share/adduser/adduser.conf"
ADDUSER_USER_ID=1001
sed "s/^\(FIRST_UID=\)[0-9]\+$/\1${ADDUSER_USER_ID}/1" -i ${ADDUSER_SCRIPT}
RC=$?
echo "Code retour adduser : ${RC}"
---------
I should also mention that I've used a fresh cache for apt-cacher when last trying to build the image.
Thanks again for all the effort you put in Debian Live and sorry for the over detailed email
Séb.
References:
[0] http://cruisecontrol.sourceforge.net/index.html
[1] http://buildix.thoughtworks.com/