Bug 4961 - Package installed onto initramfs images unintentionally
Summary: Package installed onto initramfs images unintentionally
Status: RESOLVED FIXED
Alias: None
Product: General Docs
Classification: Documentation
Component: docs-general (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 02 June 2014: IN PROGRESS REVIEW
Depends on:
Blocks:
 
Reported: 2013-07-31 02:44 UTC by Chen Qi
Modified: 2014-06-02 13:15 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Qi 2013-07-31 02:44:13 UTC
It's not unusual that we use IMAGE_INSTALL_append to add some packages into the final image.

For example, we use IMAGE_INSTALL_append = " util-linux" to add util-linux to our image.

However, when it comes to live images, this approach might become a problem, as the newly added package, such as util-linux in the above example, will also be silently installed onto the live image. And most of the time, we just don't notice it.

I think we should prevent this, as the core-image-minimal-initramfs is targeted to be a small workable initrd that could bring up the real image.

In other word, we need a way for users to add packages to the final image and not to the initramfs image.

//Chen Qi
Comment 1 Chen Qi 2013-08-02 09:27:27 UTC
Setting the 'Documentation change' section to 'Yes' as this is somewhat related to user habit. I think related document is needed.

The first step is to define clearly how the following variables should be used.
(There might be more to add to the list.)

IMAEG_INSTALL
PACKAGE_INSTALL
CORE_IMAGE_BASE_INSTALL
CORE_IMAGE_EXTRA_INSTALL

Maybe we should use a new variable for initramfs images.

//Chen Qi
Comment 2 Saul Wold 2013-08-12 23:53:42 UTC
I think this is probably a documentation bug, and we need to add Glossary 
entries and clarify that some of these are internal and not meant to be 
modified.

IMAGE_INSTALL affects initramfs, while the other should not, since they are not 
used by the initramfs recipe.

I do not think we should create a new variable for initramfs, since the image 
tooling uses the same IMAGE_INSTALL variable.

I will change to be owned by Scott R for docs.
Comment 3 Scott Rifenbark 2013-08-13 04:43:15 UTC
We have existing entries for three of the four variables mentioned for this bug:

http://www.yoctoproject.org/docs/1.5/ref-manual/ref-manual.html#var-IMAGE_INSTALL

http://www.yoctoproject.org/docs/1.5/ref-manual/ref-manual.html#var-PACKAGE_INSTALL

http://www.yoctoproject.org/docs/1.5/ref-manual/ref-manual.html#var-CORE_IMAGE_EXTRA_INSTALL

I don't have a variable for CORE_IMAGE_BASE_INSTALL.

Can you look at the existing descriptions and provide information about what is missing from the descriptions for these three variables?

Also, can you provide a basic description of the CORE_IMAGE_BASE_INSTALL variable from which I can work?

Thanks,
Scott
Comment 4 Chen Qi 2013-08-13 05:11:41 UTC
Hi Saul & Scott,

Below are some thoughts from me, any comment or suggest is really welcome.

1. Basic Info
What gets installed into an image is determined by the PACKAGE_INSTALL variable.
IMAGE_INSTALL, CORE_IMAGE_BASE_INSTALL and CORE_IMAGE_EXTRA_INSTALL have effect only when they are pulled into PACKAGE_INSTALL someway.

Currently, we have:
export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"
IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
CORE_IMAGE_BASE_INSTALL = '\
    packagegroup-core-boot \
    packagegroup-base-extended \
    ${CORE_IMAGE_EXTRA_INSTALL} \
    '

Note the '?=' in the variable assignment. It indicates that these variables could be overridden.

I think the document needs to inform users about this restriction.

2. IMAGE_INSTALL and live image
If we use IMAGE_INSTALL_append in conf/local.conf, the specified package also gets installed into the initramfs. So I would suggest, in our docs, we recommend the use of CORE_IMAGE_EXTRA_INSTALL in conf/local.conf and warn users about the use of IMAGE_INSTALL.

3. A new variable for initramfs images
We can use CORE_IMAGE_EXTRA_INSTALL to install a package into the target image and not into the initramfs image, but we do lack a variable to specify a list of packages which are intended to be installed into initramfs images and not into the target images.
I would recommend we use a new variable INITRAMFS_IMAGE_EXTRA_INSTALL to serve this purpose.

//Chen Qi
Comment 5 Scott Rifenbark 2013-09-17 23:37:46 UTC
Hi, 

I am pushing this bug out past 1.5.  The solution goes beyond quickly updating some variables in the glossary.  I would like to address it properly when I have more time.  I will revisit.

Scott13
Comment 6 Scott Rifenbark 2013-10-31 19:41:56 UTC
Can someone give me an explanation of CORE_IMAGE_BASE_INSTALL?  

Can someone explain what a live image is?  Is this only the *-initramfs type image (I only list one in our reference manual).
Comment 7 Chen Qi 2014-04-10 02:38:59 UTC
Hi Scott,

This bug has been fixed by Saul. See below for more details.

commit 8d13b43f16ea289afc93f14d5dfbff5d81520a01
Author: Saul Wold <sgw@linux.intel.com>
Date:   Wed Feb 26 18:21:02 2014 +0200

    core-image-minimal-initramfs: Use PACKAGE_INSTALL instead of IMAGE_INSTALL
    
    PACKAGE_INSTALL is set from the IMAGE_INSTALL variable with some additional
    items, since PACKAGE_INSTALL is intended to be more an internal variable, use
    it instead of the IMAGE_INSTALL which is recommeded for installing additional
    packages. This will allow the initramfs recipe to use a fixed set of packages
    and not be affected by IMAGE_INSTALL.
    
    [YOCTO #5791]
    
    (From OE-Core rev: abf40223d1412ee8f9d2b5269fad7c6aca6c2570)
    
    Signed-off-by: Saul Wold <sgw@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>


I think what we need for now is to suggest users to do the same, that is, use PACKAGE_INSTALL for initramfs images instead of IMAGE_INSTALL. And then we can close this bug.

The concept of our live image is the same with that of other distros like ubuntu. With a live image, users should be able to boot it up directly to try this linux distro out. He can also install it onto his own hard disk.

The live image in our project basically consists of two parts, an initramfs image and the real rootfs image. Before Saul's commit, IMAGE_INSTALL_append would have effect on both, which is really not intended as an initramfs image should only have the minimal set of packages to bring things up.

I'm changing the status to 'New'. If there's any other problem, please let me know.

//Chen Qi
Comment 8 Scott Rifenbark 2014-04-10 17:10:35 UTC
Hi, 

Thanks Chen for the additional information.  I have made three updates to the ref-manual to try and satisfy the documentation component for this bug.  Here are the changes:

http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#images-core-image-minimal-initramfs

http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-PACKAGE_INSTALL

http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-IMAGE_INSTALL

Please review these and see if they satisfy the doc requirement.

Thanks, 
Scott
Comment 9 Scott Rifenbark 2014-06-02 13:15:11 UTC
Hi, 

Setting this to RESOLVED and clicking the doc flag to "Done." The solution has been on review for a couple months now and no feedback.

Scott