Bug 5311

Summary: can't use PACKAGE_EXCLUDE with an ipk image based
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Alexandru Georgescu <alexandru.c.georgescu>
Component: coreAssignee: Paul Barker <paul>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: bluelightning, mark.hatle, meta.mr.watcher, meta.watcher, net147, paul, sgw
Version: 1.5   
Target Milestone: 1.5.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 4808    
Attachments:
Description Flags
log.do_rootfs.24553 none

Description Alexandru Georgescu 2013-10-03 13:30:03 UTC
Perform the followin changes in the local conf and build a core-image-minimal or core-image-sato:

MACHINE ??= "qemux86"
IMAGE_INSTALL_append = " man"
PACKAGE_EXCLUDE = "man"
PACKAGE_CLASSES ?= "package_ipk"


At do_rootfs I have the following err: 

Build Configuration:
BB_VERSION        = "1.20.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-13.10"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.5"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfroma02280f):a02280f99f05b1c21de2a78de9222a2f62a0dabc"



| Downloading file:/media/ubu/120/poky/build/tmp/deploy/ipk/i586/base-passwd_3.5.26-r2_i586.ipk.
| Building from feeds activated!
| Running intercept scripts:
| log_check: Using /media/ubu/120/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.24553 as logfile
| Logfile is clean
| makedevs: No entry for root in search list
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_rootfs (log file is located at /media/ubu/120/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.24553)
ERROR: Task 7 (/media/ubu/120/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1635 tasks of which 1634 didn't need to be rerun and 1 failed.
No currently running tasks (1634 of 1636)

Summary: 1 task failed:
  /media/ubu/120/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs
Summary: There were 2 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ubu@ubu-v:/media/ubu/120/poky/build$ 



I tested on Ubuntu 13.10 64bit but also on Fedora 19 64bit.
Comment 1 Mark Hatle 2013-10-03 14:34:17 UTC
The error: makedevs: No entry for root in search list
indicates that there was no passwd/group files installed on the filesystem.  Inspect the log file farther up, there may have been an error or something similar reported that will help determine why the passwd/group was not generated.
Comment 2 Alexandru Georgescu 2013-10-03 14:52:09 UTC
Created attachment 1546 [details]
log.do_rootfs.24553
Comment 3 Alexandru Georgescu 2013-10-03 14:53:00 UTC
(In reply to comment #1)
> The error: makedevs: No entry for root in search list
> indicates that there was no passwd/group files installed on the filesystem. 
> Inspect the log file farther up, there may have been an error or something
> similar reported that will help determine why the passwd/group was not
> generated.

Mark,
Is this log helpful?
Comment 4 Mark Hatle 2013-10-03 16:04:55 UTC
Downloading file:/media/ubu/120/poky/build/tmp/deploy/ipk/i586/base-passwd_3.5.26-r2_i586.ipk.
Building from feeds activated!
Running intercept scripts:
log_check: Using /media/ubu/120/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.24553 as logfile
Logfile is clean
makedevs: No entry for root in search list
WARNING: exit code 1 from a shell command.

So the base-passwd -package- was installed, but from the error, the passwd/group files were not.

The issue is most likely due to delayed (failed?) installs of the passwd/group file and the order things are running in.

You are going to have to look at the filesystem itself and look at the delayed install scripts as well as if /etc/passwd,group exist in the image.  (If they do exist.. we definitely have a bug in something makedevs, pseudo or the way it's being invoked..)

If they don't, we have an order issue where it's trying to use the passwd/group files before they're installed.
Comment 5 Alexandru Georgescu 2013-10-04 07:02:34 UTC
(In reply to comment #4)
> Downloading
> file:/media/ubu/120/poky/build/tmp/deploy/ipk/i586/base-passwd_3.5.26-
> r2_i586.ipk.
> Building from feeds activated!
> Running intercept scripts:
> log_check: Using
> /media/ubu/120/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-
> r0/temp/log.do_rootfs.24553 as logfile
> Logfile is clean
> makedevs: No entry for root in search list
> WARNING: exit code 1 from a shell command.
> 
> So the base-passwd -package- was installed, but from the error, the
> passwd/group files were not.
> 
> The issue is most likely due to delayed (failed?) installs of the
> passwd/group file and the order things are running in.
> 
> You are going to have to look at the filesystem itself and look at the
> delayed install scripts as well as if /etc/passwd,group exist in the image. 
> (If they do exist.. we definitely have a bug in something makedevs, pseudo
> or the way it's being invoked..)
> 
> If they don't, we have an order issue where it's trying to use the
> passwd/group files before they're installed.

I think we have the second issue. Here is what I have in etc/:

ubu@ubu-v:/media/ubu/120/poky/build$ ll  tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/
total 20
drwxr-xr-x 3 ubu ubu 4096 oct  3 16:27 ./
drwxr-xr-x 4 ubu ubu 4096 oct  3 16:27 ../
drwxr-xr-x 2 ubu ubu 4096 oct  3 16:27 default/
-rw-r--r-- 1 ubu ubu   13 oct  3 16:27 timestamp
-rw-r--r-- 1 ubu ubu   13 oct  3 16:27 version
ubu@ubu-v:/media/ubu/120/poky/build$
Comment 6 Saul Wold 2013-10-21 17:08:46 UTC
Paul is looking at the logs currently.
Comment 7 Paul Eggleton 2013-12-16 16:23:53 UTC
This is a pretty annoying problem, because there is no error of any kind to indicate what might have gone wrong. In my testing (prompted by a support request on IRC), looking at the logs it seems that if PACKAGE_EXCLUDE is set, opkg downloads all the packages and then just exits without doing any installation.
Comment 8 Paul Barker 2013-12-20 16:23:08 UTC
I finally spotted it. In the patch openembedded-core/meta/recipes-devtools/opkg/opkg/add-exclude.patch:

@@ -198,6 +200,17 @@ args_parse(int argc, char *argv[])
  }
  free(tuple);
  break;
+ case ARGS_OPT_ADD_EXCLUDE:
+ tuple = xstrdup(optarg);
+ if (!conf->exclude_list) {
+ conf->exclude_count = 1;
+ conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count);
+ conf->exclude_list[conf->exclude_count - 1] = tuple;
+ } else {
+ conf->exclude_count++;
+ conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) *
conf->exclude_count);
+ conf->exclude_list[conf->exclude_count - 1] = tuple;
+ }
  case ARGS_OPT_NOACTION:
  conf->noaction = 1;
  break;

There needs to be a break at the end of that case. It falls through to
the noaction case as it currently stands.

I'm too busy to address this now myself. Mark Hatle has said he'll look at it.
Comment 9 Paul Barker 2014-02-20 15:28:33 UTC
The fix has been tested and has gone into oe-core as commit id c269cea3117d7fa120c02bdb47d1adf18a1bcba1.