Remastering Precise fails on resolv.conf

Bug #946480 reported by Pascal de Bruijn on 2012-03-04
224
This bug affects 51 people
Affects Status Importance Assigned to Milestone
Ubuntu Customization Kit
High
Unassigned
uck (Ubuntu)
Undecided
Unassigned

Bug Description

The current UCK version fails on resolv.conf when remastering Precise Beta1.

As /etc/resolv.conf is a symlink to ../run/resolvconf/resolv.conf on Precise.

Since /run is bind-mounted from the host OS, the source and destination resolv.conf are the same files, thus cp returns an error code, making uck fail.

Since /run is bind-mounted it makes the entire copy of resolv.conf superfluous, so it can be removed:

diff -Nurpd a/remaster-live-cd.sh b/remaster-live-cd.sh
--- a/remaster-live-cd.sh 2012-03-04 16:32:00.299733023 +0100
+++ b/remaster-live-cd.sh 2012-03-04 16:43:05.375030941 +0100
@@ -354,10 +354,6 @@ function prepare_rootfs_for_chroot()
 {
  mount_pseudofilesystems

- echo "Copying resolv.conf..."
- cp -f /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
- failure "Failed to copy resolv.conf, error=$?"
-
  echo "Copying fstab/mtab..."
  if [ -f "$REMASTER_DIR/etc/fstab" ] ; then
   mv "$REMASTER_DIR/etc/fstab" "$REMASTER_DIR/etc/fstab.uck" ||

Though this might make uck fail for other Ubuntu versions. I only tested with Precise.

Related branches

Launchpad Janitor (janitor) wrote :

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

Changed in uck (Ubuntu):
status: New → Confirmed
Greg Faith (gregfaith) wrote :

Same problem trying to remaster lubuntu-precise-desktop i386 .

Changed in uck:
status: New → Confirmed

Thanks Pascal for the report. I have tried uck in my own system and is also failing. Could you please run

apport-collect 946480

to attach the information of your system to the report?

Also: I tried your patch but it did not work on my system. It could be good in any case to attach it as a patch (the diff file) to the bug report so that it can be checked by the developers.

Pascal de Bruijn (pmjdebruijn) wrote :

Are you sure you are having the same issue? Because the patch removes the problematic copy action, after which it simply can't be a problem any more... Right?

Pascal, please note I had the problem much earlier and have not tried the
patch as yet.
In fact Lubuntu precise i386 now has a non-pae kernel by default and I have
not tired the
remastersys since.

On Thu, Mar 22, 2012 at 11:17 AM, Pascal de Bruijn <email address hidden>wrote:

> Are you sure you are having the same issue? Because the patch removes
> the problematic copy action, after which it simply can't be a problem
> any more... Right?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/946480
>
> Title:
> Remastering Precise fails on resolv.conf
>
> Status in Ubuntu Customization Kit:
> Confirmed
> Status in “uck” package in Ubuntu:
> Confirmed
>
> Bug description:
> The current UCK version fails on resolv.conf when remastering Precise
> Beta1.
>
> As /etc/resolv.conf is a symlink to ../run/resolvconf/resolv.conf on
> Precise.
>
> Since /run is bind-mounted from the host OS, the source and
> destination resolv.conf are the same files, thus cp returns an error
> code, making uck fail.
>
> Since /run is bind-mounted it makes the entire copy of resolv.conf
> superfluous, so it can be removed:
>
> diff -Nurpd a/remaster-live-cd.sh b/remaster-live-cd.sh
> --- a/remaster-live-cd.sh 2012-03-04 16:32:00.299733023 +0100
> +++ b/remaster-live-cd.sh 2012-03-04 16:43:05.375030941 +0100
> @@ -354,10 +354,6 @@ function prepare_rootfs_for_chroot()
> {
> mount_pseudofilesystems
>
> - echo "Copying resolv.conf..."
> - cp -f /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
> - failure "Failed to copy resolv.conf, error=$?"
> -
> echo "Copying fstab/mtab..."
> if [ -f "$REMASTER_DIR/etc/fstab" ] ; then
> mv "$REMASTER_DIR/etc/fstab" "$REMASTER_DIR/etc/fstab.uck"
> ||
>
> Though this might make uck fail for other Ubuntu versions. I only
> tested with Precise.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/uck/+bug/946480/+subscriptions
>

Changed in uck:
assignee: nobody → Fabrizio Balliano (fabrizio-balliano)
importance: Undecided → High
status: Confirmed → Fix Committed
Sasa Paporovic (melchiaros) wrote :

Have runned in the same.

I have closed my report as duplicate of this.

Vibhav Pant (vibhavp) on 2012-03-30
Changed in uck (Ubuntu):
assignee: nobody → Vibhav Pant (vibhavp)
Ari Constancio (ari-constancio) wrote :

Hello,

Is this bug solved? I see the status as 'Fix Commited' and tried the bzr branch at rev. 368.
The error is still present:

"Unpacking ISO image...
Unmounting ISO image...
Mounting SquashFS image...
mount: warning: /home/ari/tmp/remaster-root-mount seems to be mounted read-only.
Unpacking SquashFS image...
Unmounting SquashFS image...
Creating root home...
Mounting /proc
Mounting /sys
Mounting /dev/pts
Mounting /tmp
Mounting /home/ari/tmp/remaster-root-home
Mounting /home/ari/tmp/remaster-apt-cache
Mounting /run
Mounting /home/ari/tmp/customization-scripts
Copying resolv.conf...
cp: not writing through dangling symlink `/home/ari/tmp/remaster-root/etc/resolv.conf'
Unmounting /home/ari/tmp/remaster-root/var/cache/apt...
Unmounting /home/ari/tmp/remaster-root/tmp/customization-scripts...
Unmounting /home/ari/tmp/remaster-root/tmp...
Unmounting /home/ari/tmp/remaster-root/sys...
Unmounting /home/ari/tmp/remaster-root/run...
Unmounting /home/ari/tmp/remaster-root/root...
Unmounting /home/ari/tmp/remaster-root/proc...
Unmounting /home/ari/tmp/remaster-root/dev/pts...
Failed to copy resolv.conf, error=1
Build ended at 2012-04-16 11:41:23"

Thanks,
Ari Constancio

uck's source are not on bazaar, but on sourceforge's SVN

Ari Constancio (ari-constancio) wrote :

Fabrizio, thanks for replying.

I tried also checking out from the SVN repo, but the result is the same (BTW, I'm trying to build Xubuntu-12.04-beta2).
Can you point me to the specific fix committed to solve this bug?

Thanks again,
Ari Constancio

Actually I could overcome the problem adding --remove-destination to cp:

Index: libraries/remaster-live-cd.sh
===================================================================
--- libraries/remaster-live-cd.sh (revisão 463)
+++ libraries/remaster-live-cd.sh (cópia de trabalho)
@@ -356,7 +356,7 @@

  if [ ! -e "$REMASTER_DIR/etc/resolv.conf" ] ; then
   echo "Copying resolv.conf..."
- cp -f /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
+ cp -f --remove-destination /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
    failure "Failed to copy resolv.conf, error=$?"
  fi

Not sure, thought, if this hack is useful for everyone else.

futurefx (force) wrote :

is that fix commited to 12.04 now?

it will be in 2.4.6 but we need zenity to fix their bugs before we can
release, anyway 2.4.6 svn is working fine for me.

On Thu, Apr 26, 2012 at 19:20, futurefx <email address hidden> wrote:
> is that fix commited to 12.04 now?
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/946480
>
> Title:
>  Remastering Precise fails on resolv.conf
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/uck/+bug/946480/+subscriptions

--
Fabrizio Balliano
Senior web engineer, open source specialist and Linux expert
web: http://fabrizioballiano.it - http://fabrizioballiano.net
e-mail: <email address hidden> - mobile: (+39) 329.35.14.110

futurefx (force) wrote :

Thanks, i really hope UCK becomes more robust to future releases too. Does 2.4.6 appear on official ppa too or they leave broken version in? (then i know which location to use for update)

UCK is 1-st reason for me why i like Ubuntu, currently friends will wait too when i can get my version of Ubuntu done.

> Thanks, i really hope UCK becomes more robust to future releases too.

I'm sorry but it's not a bug concerning uck if zenity goes segfault

> Does 2.4.6 appear on official ppa too or they leave broken version in?

not yet, check it out using svn on sourceforge
bye
fabrizio

Changed in uck:
status: Fix Committed → Fix Released

Hey ALL!
I solved this problem just change cp -f /etc/resolve.conf on cp -d /etc/resolve.conf

#vi vi /usr/lib/uck/remaster-live-cd.sh

go to string 358 ( on vi editor just print :set number and press enter)

and change

358 cp -d /etc/resolv.conf "$REMASTER_DIR/etc/resolv.conf" ||
359 failure "Failed to copy resolv.conf, error=$?"

Alex Tasin (alextasin) wrote :

4 june 2012:
the big still exist.....

Vibhav Pant (vibhavp) on 2012-06-16
Changed in uck (Ubuntu):
assignee: Vibhav Pant (vibhavp) → nobody
kumquat (kumquat) wrote :

Thank you, I experienced the error and bug, but found the remedy.

sol (jean-christophe-sol) wrote :

hello,
I try to use uck on Xbuntu 12.04 ISO (on Ubuntu 11.04), and have always same error "Failed to copy resolv.conf, error=1".
Now i use uck version 2.4.6, but same message :

"Copying resolv.conf...
cp: not writing through dangling symlink `/home/jc/tmp/remaster-root/etc/resolv.conf'
Unmounting /home/jc/tmp/remaster-root/var/cache/apt...
Unmounting /home/jc/tmp/remaster-root/tmp/customization-scripts...
Unmounting /home/jc/tmp/remaster-root/tmp...
Unmounting /home/jc/tmp/remaster-root/sys...
Unmounting /home/jc/tmp/remaster-root/run...
Unmounting /home/jc/tmp/remaster-root/root...
Unmounting /home/jc/tmp/remaster-root/proc...
Unmounting /home/jc/tmp/remaster-root/dev/pts...
Failed to copy resolv.conf, error=1
Build ended at 2012-06-28 14:02:12"

:-( I'm surprised, the bug 946480 should be solved...

Mathew Oakes (mathew-oakes) wrote :

I've just spent a while battling with this on 12.04...

Using the stable ppa advertised here: http://fabrizioballiano.net/2010/09/02/ucks-ppas-now-available/
and version 2.4.6

Applying change mentioned in post 10 makes it work.

Build (/usr/bin/uck-gui --wait-before-exit) started at 2012-08-12 17:11:58
>> Ubuntu Customization Kit 2.4.5 on Ubuntu 12.10, 3.2.0-27-generic x86_64
Starting CD remastering on Sk Rgp 12 17:12:03 EEST 2012
Customization dir=/home/shinigami/tmp/customization-scripts
Mounting ISO image...
mount: warning: /home/shinigami/tmp/remaster-iso-mount seems to be mounted read-only.
Unpacking ISO image...
Unmounting ISO image...
Mounting SquashFS image...
mount: warning: /home/shinigami/tmp/remaster-root-mount seems to be mounted read-only.
Unpacking SquashFS image...
Unmounting SquashFS image...
Removing win32 files...
Creating apt cache...
Creating root home...
Mounting /proc
Mounting /sys
Mounting /dev/pts
Mounting /tmp
Mounting /home/shinigami/tmp/remaster-root-home
Mounting /home/shinigami/tmp/remaster-apt-cache
Mounting /run
Mounting /home/shinigami/tmp/customization-scripts
Copying resolv.conf...
cp: `/etc/resolv.conf' and `/home/shinigami/tmp/remaster-root/etc/resolv.conf' are the same file
Unmounting /home/shinigami/tmp/remaster-root/var/cache/apt...
Unmounting /home/shinigami/tmp/remaster-root/tmp/customization-scripts...
Unmounting /home/shinigami/tmp/remaster-root/tmp...
Unmounting /home/shinigami/tmp/remaster-root/sys...
Unmounting /home/shinigami/tmp/remaster-root/run...
Unmounting /home/shinigami/tmp/remaster-root/root...
Unmounting /home/shinigami/tmp/remaster-root/proc...
Unmounting /home/shinigami/tmp/remaster-root/dev/pts...
Failed to copy resolv.conf, error=1
Build ended at 2012-08-12 17:14:59

Pascal de Bruijn (pmjdebruijn) wrote :

You really need to use UCK from svn (not the packages), I still have another patch pending too.

Israel Dahl (israeldahl) wrote :

It is October, will this be at least fixed for Quantal? I wanted to remaster the Quantal Beta image... but I guess I wont unless post #10 or #15 work. It seems like the 'fix' released on 2012-05-04 must not have worked.

Israel Dahl (israeldahl) wrote :

https://bugs.launchpad.net/uck/+bug/946480/comments/10
does fix a problem... I can now make it past this bug.

Pascal de Bruijn (pmjdebruijn) wrote :

I have a PPA which has some of these fixes integrated:

https://launchpad.net/~pmjdebruijn/+archive/uck-testing

Israel Dahl (israeldahl) wrote :

Yeah, but that defeats the purpose of having the software center, if you can only install a broken package.

You should comment on that package with your ppa in the review so others can bypass the issue, or better yet commit the fix to the quantal package, and to the precise package (if that is possible). a broken package in the software center is not only inconvienient and silly, but it will turn potential users away from this really useful software.
1. it doesn't work
2. to make it work I have to install an 'untrusted' ppa, or
3. i have to do some hacker stuff to make my program work.

I don't mind doing this kind of stuff, and actually enjoy it sometimes. But I also enjoy programming and Beta testing. Most computer users want stuff to work. They don't want to manually edit shell scripts and change the letter 'f' to 'd'

these types of bugs NEED to be fixed, or the program should be discharged from the software center. why upload a broken program in the first place??

Pascal de Bruijn (pmjdebruijn) wrote :

The problem with UCK is that UCK can only be definitively tested/fixed for a ubuntu release once it has been released, at which point the repositories are frozen. Chicken. Egg.

Anyhow, there are a bunch of bugs still outstanding. So ideally we'd need a new upstream release of UCK, though I'm afraid the official developers seem strapped for time.

Israel Dahl (israeldahl) wrote :

I understand, however, how much time does it take to change those 2 little things? They have to repackage it anyway right? I'm not trying to be down on the developers, I am very greatful that they have made a great program, and as such I think it should 'just work'. Is the program still actively developed? Or is it a program that just gets repacked once every 6 months?

ale (l-s4ig-o) on 2012-11-09
Changed in uck:
assignee: Fabrizio Balliano (fabrizio-balliano) → nobody
Narcis Garcia (narcisgarcia) wrote :

I'm running Ubuntu 12.04 up-to-date, but the problem persists. Why the fix isn't uploaded to Ubuntu updates?

JNJ (louispeter11) on 2013-04-06
Changed in uck (Ubuntu):
status: Confirmed → Fix Released
JWDinKC (jwdinkc) wrote :

I just installed UCK today on Ubuntu 12.04. I got an error and the suggestion to check my build log. I searched the error on Google and wind up here - reading a string of comments that span over the course of a year and yet:
Starting CD remastering on Sat Apr 27 09:36:11 CDT 2013
Customization dir=/home/justin/tmp/customization-scripts
Mounting ISO image...
mount: warning: /home/justin/tmp/remaster-iso-mount seems to be mounted read-only.
Unpacking ISO image...
Unmounting ISO image...
Mounting SquashFS image...
mount: warning: /home/justin/tmp/remaster-root-mount seems to be mounted read-only.
Unpacking SquashFS image...
Unmounting SquashFS image...
Removing win32 files...
Creating apt cache...
Creating root home...
Mounting /proc
Mounting /sys
Mounting /dev/pts
Mounting /tmp
Mounting /home/justin/tmp/remaster-root-home
Mounting /home/justin/tmp/remaster-apt-cache
Mounting /run
Mounting /home/justin/tmp/customization-scripts
Copying resolv.conf...
cp: `/etc/resolv.conf' and `/home/justin/tmp/remaster-root/etc/resolv.conf' are the same file
Unmounting /home/justin/tmp/remaster-root/var/cache/apt...
Unmounting /home/justin/tmp/remaster-root/tmp/customization-scripts...
Unmounting /home/justin/tmp/remaster-root/tmp...
Unmounting /home/justin/tmp/remaster-root/sys...
Unmounting /home/justin/tmp/remaster-root/run...
Unmounting /home/justin/tmp/remaster-root/root...
Unmounting /home/justin/tmp/remaster-root/proc...
Unmounting /home/justin/tmp/remaster-root/dev/pts...
Failed to copy resolv.conf, error=1

Ubuntu needs to track the time-line of confirmed bugs and fixes. When the same bug is still rearing it's ugly head more than year from the first report they should remove it from the software center. I don't mind hacking away once in a while - but if I had to personally find or figure out a fix for every piece of software I try in the software center I would have no time left to do any actual living of my life.

Israel Dahl (israeldahl) wrote :

I have not been able to get it to work in 12.04 (even after some hacking around) The bug report says "fix released" so you might try it in 12.10 or 13.04. Getting a fix ported back to an LTS is called an SRU (https://wiki.ubuntu.com/StableReleaseUpdates). If you are interested in it you could contribute to the project and try to get this sponsered for an SRU.
I am in the process of getting a different program fixed in 12.04 via SRU. The best thing you can do though to contribute at this point is to confirm that it works upstream (meaning it works in Raring/Quantal). Then if it does you can read the page about SRU and have a bug supervisor target it to 12.04 (https://answers.launchpad.net/launchpad/+question/140509)...

uck is in the "universe" section, so it is offered NO support from Canonical or Ubuntu (as specified when you enabled it)
(http://packages.ubuntu.com/search?keywords=uck&searchon=names&suite=all&section=all)

I agree that quality control in the software center should be strictly observed. Programs that don't work should be fixed, or at worst.. removed. Software in the repositories not supported by Ubuntu are not their responsibility, the community takes care of this and a large portion of this is DEBIAN. Ubuntu inherits Debian's packages, and in some cases Ubuntu community will fix a package and upload it into the repos. The developers of this package *should* in theory take care of their own package... I hope this makes the situation a bit more transparent for you.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions