Bug#681261: live-build: please don't leave an empty fstab in chroot
On Sat, Jul 14, 2012 at 02:23:47AM +0100, Rui Bernardo wrote:
> On Fri, Jul 13, 2012 at 09:39:07PM +0200, Daniel Baumann wrote:
> > On 07/13/2012 07:16 AM, Rui Bernardo wrote:
> > > When removing fstab for live-installer also touch an empty file
> > > for it to avoid other packages failing on non-existing fstab.
> >
> > because otherwise e.g. update-initramfs goes nuts, which is why we
> > truncate it.
>
> I've never faced that error. I've patch live-build 3.0~a48 to remove
> that "touch fstab" line and I only see the usual warnings (not errors)
> about missing fstab while the chroot is built.
>
> > > in lb_chroot_hacks clearly creates an empty fstab. It _is_ this empty
> > > fstab that breaks live-installer, and by consequence, debian-installer.
> >
> > so send a patch, or wait until someone else fixes it.
> >
> > but please stop complaining, it is how it is in live-build and its on
> > purpose. we know that, and we'll adapt any other stuff at some point.
>
> Just trying to help and warn about a problem that arose, like everyone
> here, I think. I just didn't see (and still don't see) any reason to
> truncate fstab instead of making sure it's not included if not in
> includes.
>
> Anyway, while trying to follow the fstab.d hint inside live-installer I
> think I've found an incontournable problem. fstab.d only works in
> wheezy/sid. Trying to deal the truncated fstab in live-installer using
> fstab.d/ is not possible in squeeze. I don't see a solution for squeeze
> this way.
>
> So ATM, since live-build 3.0~a47-1, live-build 3.x breaks partman and/or
> live-installer in squeeze.
>
> I'm looking forward to help in this issue.
>
> > --
> > Address: Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
> > Email: daniel.baumann@progress-technologies.net
> > Internet: http://people.progress-technologies.net/~daniel.baumann/
Everything is possible. I was not considering an update in live-installer
in squeeze because stable releases only get bug-fixes and not new features.
To not exclude the possibility of live-installer in squeeze being updated
in the future as an exception; and if /etc/fstab can't be ommited by
live-build in the future; and live-installer in squeeze and wheezy will be
updated to deal with the new truncated fstab of live-build 3.x; then
live-installer would need to preserve the fstab that was created by
partman. Something like:
----------------------- debian/live-installer.postinst ------------------------
index 800038b..98cb7fe 100644
@@ -27,6 +27,14 @@ install_live_system () {
. $script
done
+ # preserve partman fstab to avoid being overwriten
+ # by moving it to /etc/fstab.d/ in /target/
+ if [ -e /target/etc/fstab ]
+ then
+ [ ! -d /target/etc/fstab.d/ ] && mkdir -p /target/etc/fstab.d
+ mv /target/etc/fstab /target/etc/fstab.d/fstab-partman
+ fi
+
for place in $PLACES; do
[ ! -e $place ] && continue
@@ -64,6 +72,23 @@ install_live_system () {
eval ${SUPPORT}_teardown
done
+ # fstab.d only works if /etc/fstab file exists,
+ # see tab_parse.c line 587 in util-linux.
+ # better make sure there is a /etc/fstab; this for
+ # the eventuallity that no fstab was provided in squashfs
+ # as in live-build before 3.0~a47-1.
+ if [ ! -e /target/etc/fstab ] && [ -e /target/etc/fstab.d/fstab-partman ]
+ then
+ if [ -e /target/run ]
+ # wheezy
+ touch /target/etc/fstab
+ else
+ # squeeze
+ mv /target/etc/fstab.d/fstab-partman /target/etc/fstab
+ rmdir /target/etc/fstab.d
+ endif
+ fi
+
if [ ${PLACE_FOUND} -eq 0 ]; then
error "Could not find any live images"
exit 1
------------------------------------------------------------------------------
The two snippets could be added to /lib/live-installer/ and
/usr/lib/live-installer.d/ and do this more cleanly.
Could you tell me if squeeze live-installer is to be updated? I'd like help
if it does.
Reply to: