<br><br><div class="gmail_quote">On Wed, Aug 10, 2011 at 10:46 AM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Aug 10, 2011 at 09:42:10AM -0700, David Konerding wrote:<br>
> BTW, it's actually a list of ~8000 files (looks like all the unpacked files<br>
> from all the .debs that got downloadeD).<br>
><br>
> I stopped feboostrap during its download after it downloaded the .deb for<br>
> bash (there seems to be no option to force febootstrap to not clean up<br>
> /tmp/febootstrap* after running).<br>
><br>
> I see no reason why feboostrap wouldn't be able to read these files:<br>
> 2318338    4 drwxr-xr-x   2 dek      redacted          4096 Aug 10 09:39<br>
> /tmp/bashpkg/bin<br>
> 2318444    0 lrwxrwxrwx   1 dek      redacted             4 Aug 10 09:39<br>
> /tmp/bashpkg/bin/sh -> bash<br>
> 2318443    0 lrwxrwxrwx   1 dek      redacted             4 Aug 10 09:39<br>
> /tmp/bashpkg/bin/rbash -> bash<br>
> <a href="tel:2318339%20%20920" value="+12318339920">2318339  920</a> -rwxr-xr-x   1 dek      redacted        934336 Apr 18  2010<br>
> /tmp/bashpkg/bin/bash<br>
<br>
</div>I would agree this certainly looks like a bug in febootstrap.  I can't<br>
imagine what it would be that wouldn't also affect our builds on<br>
Ubuntu 11.04.<br>
<br>
Here is a way you could try reproducing the issue, in a smaller and<br>
more manageable context.<br>
<br>
You can run all of the commands below as non-root from /tmp or another<br>
temporary directory.<br>
<br>
First:<br>
<br>
$ febootstrap --verbose --names bash<br>
<br>
then examine the debug messages and the output files created in the<br>
current directory ('base.img' and 'hostfiles').<br>
<br></blockquote><div><br></div><div>This fetches bash, dash, and a number of other packages.  It reports:</div><div><div>1719 files and directories</div><div>febootstrap: warning: some host files are unreadable by non-root</div>
<div>febootstrap: warning: get your distro to fix these files:</div><div>        /bin/bash</div><div>        /bin/cat</div><div>        /bin/chgrp</div><div>        /bin/chmod</div></div><div>...</div><div><br></div><div>
There are 1361 files in the list.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If base.img and hostfiles look reasonable, try building an appliance<br>
from them:<br>
<br></blockquote><div><br></div><div>Looking at hostfiles, there is no /bin/bash, but there is /bin/sh and /bin/rbash (BTW, Ubuntu uses dash as the main /bin/sh, not bash, but I assume that's not relevant).  sh is a symlink to bash, as is rbash.</div>
<div><br></div><div>I extracted base.img, and it doesn't include any files in /bin.  It looks like all the files in that archive are text/config files or symlinks. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

$ febootstrap-supermin-helper -f ext2 -v \<br>
  base.img hostfiles $(uname -m) kernel initrd appliance<br>
<br>
(Note that 'kernel', 'initrd' and 'appliance' are all output files<br>
that will be created in the current directory).<br>
<br>
Now you've got a chicken-and-egg problem, but 'appliance' is an ext2<br>
disk image which can be examined using guestfish:<br>
<br>
$ guestfish --ro -a appliance -m /dev/sda<br>
<br></blockquote><div><br></div><div>Right.  I just mounted it as a loopback image instead... /bin contains only this:</div><div>$ ls -l  /mnt/appliance/bin</div><div>total 8</div><div>lrwxrwxrwx 1 root root 4 Sep 22  2010 rbash -> bash</div>
<div>lrwxrwxrwx 1 root root 9 Sep 22  2010 sh -> /bin/bash</div><div><br></div><div>Running strace on febootstrap, I see that it stats the /bin/bash in the unpacked bash deb pkg at least once successfully:</div><div><div>
7928  lstat("/tmp/febootstrape193191fefe36c245623bc48e5b150a2.tmp/bash_4.1-2ubuntu3_amd64.deb.d//bin/bash", {st_mode=S_IFREG|0750, st_size=934336, ...}) = 0</div><div>7928  write(2, "febootstrap: warning: some host files are unreadable by non-root\nfebootstrap: warning: get your distro to fix these files:\n\t/bin/bash\n", 134) = 134</div>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Welcome to guestfish, the libguestfs filesystem interactive shell for<br>
editing virtual machine filesystems.<br>
<br>
Type: 'help' for help on commands<br>
      'man' to read the manual<br>
      'quit' to quit the shell<br>
<br>
><fs> ll /bin/<br>
total 2668<br>
drwxr-xr-x  2 1000 1000   4096 Aug 10 17:40 .<br>
drwxr-xr-x 17 1000 1000   4096 Aug 10 17:41 ..<br>
-rwxr-xr-x  1    0    0 954896 Mar 31 21:20 bash<br>
-rwxr-xr-x  1    0    0  47696 Feb 23 14:24 cat<br>
-rwxr-xr-x  1    0    0  55864 Feb 23 14:24 chgrp<br>
-rwxr-xr-x  1    0    0  51704 Feb 23 14:24 chmod<br>
-rwxr-xr-x  1    0    0  55880 Feb 23 14:24 chown<br>
-rwxr-xr-x  1    0    0 117808 Feb 23 14:24 cp<br>
-rwxr-xr-x  1    0    0 109736 Nov 15  2010 dash<br>
-rwxr-xr-x  1    0    0  55832 Feb 23 14:24 date<br>
-rwxr-xr-x  1    0    0  51840 Feb 23 14:24 dd<br>
-rwxr-xr-x  1    0    0  64208 Feb 23 14:24 df<br>
-rwxr-xr-x  1    0    0 105776 Feb 23 14:24 dir<br>
-rwxr-xr-x  1    0    0  26968 Feb 23 14:24 echo<br>
-rwxr-xr-x  1    0    0  22856 Feb 23 14:24 false<br>
-rwxr-xr-x  1    0    0  47680 Feb 23 14:24 ln<br>
-rwxr-xr-x  1    0    0 105776 Feb 23 14:24 ls<br>
-rwxr-xr-x  1    0    0  47624 Feb 23 14:24 mkdir<br>
-rwxr-xr-x  1    0    0  31112 Feb 23 14:24 mknod<br>
-rwxr-xr-x  1    0    0  35352 Feb 23 14:24 mktemp<br>
-rwxr-xr-x  1    0    0 109584 Feb 23 14:24 mv<br>
-rwxr-xr-x  1    0    0  31200 Feb 23 14:24 pwd<br>
lrwxrwxrwx  1    0    0      4 Jul 20 21:19 rbash -> bash<br>
-rwxr-xr-x  1    0    0  35272 Feb 23 14:24 readlink<br>
-rwxr-xr-x  1    0    0  55872 Feb 23 14:24 rm<br>
-rwxr-xr-x  1    0    0  39320 Feb 23 14:24 rmdir<br>
-rwxr-xr-x  1    0    0  15048 Jan 20  2011 run-parts<br>
lrwxrwxrwx  1    0    0      4 Jul 20 21:19 sh -> dash<br>
-rwxr-xr-x  1    0    0  26984 Feb 23 14:24 sleep<br>
-rwxr-xr-x  1    0    0  63992 Feb 23 14:24 stty<br>
-rwxr-xr-x  1    0    0  22872 Feb 23 14:24 sync<br>
-rwxr-xr-x  1    0    0  10312 Jan 20  2011 tempfile<br>
-rwxr-xr-x  1    0    0  47640 Feb 23 14:24 touch<br>
-rwxr-xr-x  1    0    0  22856 Feb 23 14:24 true<br>
-rwxr-xr-x  1    0    0  27016 Feb 23 14:24 uname<br>
-rwxr-xr-x  1    0    0 105776 Feb 23 14:24 vdir<br>
-rwxr-xr-x  1    0    0    946 Jan 20  2011 which<br>
<br>
(The above output was from Ubuntu 11.04)<br>
<div class="im"><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" target="_blank">http://people.redhat.com/~rjones</a><br>
</div>libguestfs lets you edit virtual machines.  Supports shell scripting,<br>
bindings from many languages.  <a href="http://libguestfs.org" target="_blank">http://libguestfs.org</a><br>
</blockquote></div><br>