Bug 770075 - FEBOOTSTRAP_MODULES fails if modules directory is not under /lib
Summary: FEBOOTSTRAP_MODULES fails if modules directory is not under /lib
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-23 09:48 UTC by Richard W.M. Jones
Modified: 2021-04-19 10:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2011-12-23 09:48:35 UTC
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-24 03:41:08 UTC
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 09:33:02 UTC
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 09:38:37 UTC
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 10:00:43 UTC
(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 15:05:49 UTC
(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.