This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 770075 - FEBOOTSTRAP_MODULES fails if modules directory is not under /lib
FEBOOTSTRAP_MODULES fails if modules directory is not under /lib
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-23 04:48 EST by Richard W.M. Jones
Modified: 2011-12-27 10:05 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2011-12-23 04:48:35 EST
Description of problem:

If, say, FEBOOTSTRAP_MODULES=/tmp/modules, then the build of
the appliance fails because /tmp/modules doesn't exist.  What
should happen is that the path is written to appear under /lib
in the appliance.

Version-Release number of selected component (if applicable):

libguestfs 1.15.13
febootstrap 3.12

How reproducible:

100%

Steps to Reproduce:
1. Copy a /lib/modules/* directory to somewhere under /tmp
2. Set FEBOOTSTRAP_KERNEL and FEBOOTSTRAP_MODULES
3. Run any libguestfs tool
  
Actual results:

febootstrap-supermin-helper: ext2: parent directory not found: /tmp/modules: File not found by ext2_lookup
Fatal error: exception Guestfs.Error("external command failed, see earlier error messages")
libguestfs: closing guestfs handle 0xa5f2a0 (state 0)

Expected results:


Additional info:
Comment 1 Wanlong Gao 2011-12-23 22:41:08 EST
Yeah, I can see the same problem:
febootstrap-supermin-helper: ext2: parent directory not found: /home/allen/modules: File not found by ext2_lookup
Comment 2 Wanlong Gao 2011-12-24 04:33:02 EST
I installed the upstream febootstrap, then this problem is disappeared.

febootstrap-supermin-helper: using environment variable(s) FEBOOTSTRAP_* to
select kernel /tmp/p and module path /tmp/3.1.6-1.fc16.x86_64
supermin helper [00000ms] finished creating kernel
supermin helper [00887ms] finished mke2fs
supermin helper [00887ms] visiting /usr/local/lib/guestfs/supermin.d
supermin helper [00887ms] visiting /usr/local/lib/guestfs/supermin.d/base.img
supermin helper [02515ms] visiting /usr/local/lib/guestfs/supermin.d/daemon.img
supermin helper [02517ms] visiting /usr/local/lib/guestfs/supermin.d/hostfiles
supermin helper [04056ms] visiting /usr/local/lib/guestfs/supermin.d/init.img
supermin helper [04057ms] adding kernel modules
supermin helper [05620ms] closing ext2 filesystem
Comment 3 Wanlong Gao 2011-12-24 04:38:37 EST
Then I noticed that if I moved the modules to /tmp/3.1.6-1.fc16.x86_64, it can boot successfully, but can't when moved to /tmp/modules/3.1.6-1.fc16.x86_64.
Comment 4 Richard W.M. Jones 2011-12-24 05:00:43 EST
(In reply to comment #3)
> Then I noticed that if I moved the modules to /tmp/3.1.6-1.fc16.x86_64, it can
> boot successfully, but can't when moved to /tmp/modules/3.1.6-1.fc16.x86_64.

The specific problem is that it tries to create the modules
directory in the same directory as on the host.  If that
directory is /tmp/modules/XXX then it fails because /tmp/modules
doesn't exist when it comes to building the root appliance
(because febootstrap requires that all parent directories are
created before their contents).

In any case, it's all wrong ... it should be mapping the host
pathnames to /lib/modules.
Comment 5 Wanlong Gao 2011-12-27 10:05:49 EST
(In reply to comment #4)
> (In reply to comment #3)
> > Then I noticed that if I moved the modules to /tmp/3.1.6-1.fc16.x86_64, it can
> > boot successfully, but can't when moved to /tmp/modules/3.1.6-1.fc16.x86_64.
> 
> The specific problem is that it tries to create the modules
> directory in the same directory as on the host.  If that
> directory is /tmp/modules/XXX then it fails because /tmp/modules
> doesn't exist when it comes to building the root appliance
> (because febootstrap requires that all parent directories are
> created before their contents).
> 
> In any case, it's all wrong ... it should be mapping the host
> pathnames to /lib/modules.

Yeah, I looked into this and found that this is a febootstrap's bug, but I haven't got a good idea to fix this, because if we change the behaviour of ext2_file_stat, it will be effected with the other host files.

I tried to pass another argument to the ext2_file_stat to divide the modules' behaviour, but it seems not a good idea, either.

Do you have any good ideas about this?

Thanks
-Wanlong Gao

Note You need to log in before you can comment on or make changes to this bug.