<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>1894</bug_id>
          
          <creation_ts>2012-01-11 22:41:01 +0000</creation_ts>
          <short_desc>Incremental ipk image generation</short_desc>
          <delta_ts>2014-02-26 02:00:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(Test Case Ready)</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.6 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>hongxu.jia</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>18099</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2012-01-11 22:41:01 +0000</bug_when>
    <thetext>Please refer to http://bugzilla.pokylinux.org/show_bug.cgi?id=1651

we divide the 1651 into 3 part: the rpm, deb and ipk, the ipk and deb part
will be done in M3, this one is for ipk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18823</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2012-03-01 09:30:38 +0000</bug_when>
    <thetext>
I found that the following two tasks can&apos;t be done because of the
limitation of opkg-cl and apt-get utilities:

1894 Incremental IPK image generation (Developing)
1893 Incremental DEB image generation (May not do it in 1.2 as talked before)

If we want the incremental image generation, we need the following 3
types information:

1) which pkg would be newly installed
2) which pkg would be removed
3) which pkg has been changed since the last generation

To get the 3 types of information, we need to know the pkg list that has been
installed, and the pkg list that *to be* installed, for the rpm pkg, this is 
ok, (and the RPM part has been done in M2), but for the ipk or deb, we can&apos;t 
the integrity pkg list that would be installed, the opkg-cl or apt-get would
install the pkg according to the &quot;Depends&quot; and  &quot;Recommends&quot;, also maybe
the &quot;Suggests&quot; or &quot;Conflicts&quot; (Priority?), I tried to write a script to figure
out the pkg that to be installed, but the result is not what we need:

1) If I just grab the pkg from &quot;Depends&quot; area, then the result would be less
   than the pkgs that really installed.

2) If I grab the pkg from both the &quot;Depends&quot; and &quot;Recommends&quot; area, then the
   result(pkg_to_be) would be more than the pkgs that really installed
   (pkg_installed), and some pkg in pkg_installed is still not in pkg_to_be list

Things seems complicated than what I thought before, we may need re-implement
the algorithm of opkg-cl and apt-get, but this seems not worth. So I suggested
that we don&apos;t do it any more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29026</commentid>
    <comment_count>2</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-01-22 11:45:10 +0000</bug_when>
    <thetext>Support incremental ipk image generation, here is the design:
   1) Config opkg

   2) If build deb image from zero:
      1) Install packages: lingus, normal and attemptonly.

      2) Dump solution manifest for the next incremental image session.

   3) Else if ipk incremental generation is supported:
      1) Dump solution manifest which lists *to be installed* packages names

      2) Compare solution manifest with previous installed manifest to dump
         unused package names and remove them.

      3) Dump updated packages list and reinstall them.

      4) Attempt to correct broken dependencies which caused by remove.

   4) Change solution manifest to installed manifest for next image session.

   5) Back up opkg database for next image session.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36143</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-09-02 09:02:34 +0000</bug_when>
    <thetext>Move to 1.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40411</commentid>
    <comment_count>4</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-02-18 09:45:04 +0000</bug_when>
    <thetext>package_manager.py/ootfs.py: support ipk incremental image generation

Test Cases

---------------------------------------------
Case 1: Rebuild in place
1. Edit local.conf, enable multilib and ipk incremental image generation
...
 46 MACHINE ?= &quot;qemux86-64&quot;
254 require conf/multilib.conf
255 MULTILIBS = &quot;multilib:lib32&quot;
256 DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
257 
258 IMAGE_INSTALL_append = &quot; lib32-gzip&quot;
260 IMAGE_FEATURES_append = &quot; package-management ssh-server-dropbear &quot;
262 
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

2. Edit local.conf, add some spaces in IMAGE_INSTALL_append
vim local.conf
...
258 IMAGE_INSTALL_append = &quot; lib32-gzip &quot;
...

3. bb core-image-minimal, the image should not be rebuilt
vim log.do_rootfs:
...
 16 NOTE: Package packagegroup-core-ssh-dropbear (1.0-r1) installed in root is up to date.
 17 Package opkg-collateral (1.0-r2) installed in root is up to date.
 18 Package run-postinsts (1.0-r9) installed in root is up to date.
 19 Package packagegroup-core-boot (1.0-r11) installed in root is up to date.
 20 Package opkg (1:0.2.0-r0) installed in root is up to date.
 21 Package poky-feed-config-opkg (1.0-r2) installed in root is up to date.
 ...
 53 NOTE: Package lib32-gzip (1.6-r7) installed in root is up to date.
...

vim installed_pkgs.txt
...
lib32-gzip x86
...

4. runqemu qemux86-64, ssh could work and lib32-gzip is installed
On host:
runqemu qemux86-64
ssh root@192.168.7.2 and run &apos;opkg-cl list-installed&apos;
...
lib32-gzip - 1.6-r7
...

---------------------------------------------
Case 2: Decremental Rebuild
1. Edit local.conf, enable multilib and ipk incremental image generation
...
 46 MACHINE ?= &quot;qemux86-64&quot;
254 require conf/multilib.conf
255 MULTILIBS = &quot;multilib:lib32&quot;
256 DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
257 
258 IMAGE_INSTALL_append = &quot; lib32-gzip openssl&quot;
260 IMAGE_FEATURES_append = &quot; package-management ssh-server-dropbear &quot;
262 
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

2. Edit local.conf, remove &apos;lib32-gzip openssl&apos;
vim local.conf
...
258 # IMAGE_INSTALL_append = &quot; lib32-gzip openssl&quot;
...

3. bb core-image-minimal, lib32-gzip and openssl should be removed.
vim log.do_rootfs:
...
 20 NOTE: Removing package lib32-eglibc from root...
 21 Removing package lib32-gzip from root...
 22 Removing package lib32-update-alternatives-opkg from root...
 23 Removing package libcrypto1.0.0 from root...
 24 Removing package libssl1.0.0 from root...
 25 Removing package openssl from root...
 26 Removing package openssl-conf from root...
 ...
 31 Package opkg-collateral (1.0-r2) installed in root is up to date.
 32 Package run-postinsts (1.0-r9) installed in root is up to date.
 33 Package packagegroup-core-boot (1.0-r11) installed in root is up to date.
 34 Package opkg (1:0.2.0-r0) installed in root is up to date.
 35 Package poky-feed-config-opkg (1.0-r2) installed in root is up to date.
...

---------------------------------------------
Case 3: Incremental Rebuild
1. Edit local.conf, enable multilib and ipk incremental image generation
...
 46 MACHINE ?= &quot;qemux86-64&quot;
254 require conf/multilib.conf
255 MULTILIBS = &quot;multilib:lib32&quot;
256 DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
257 
258 # IMAGE_INSTALL_append = &quot; lib32-gzip openssl&quot;
260 IMAGE_FEATURES_append = &quot; package-management ssh-server-dropbear &quot;
262 
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

2. Edit local.conf, append &apos;lib32-gzip openssl&apos; to IMAGE_INSTALL
vim local.conf
...
258 IMAGE_INSTALL_append = &quot; lib32-gzip openssl&quot;
...

3. bb core-image-minimal, lib32-gzip and openssl should be added.
vim log.do_rootfs:
...
 20 NOTE: Package packagegroup-core-ssh-dropbear (1.0-r1) installed in root is up to date.
 21 Package opkg-collateral (1.0-r2) installed in root is up to date.
 22 Package run-postinsts (1.0-r9) installed in root is up to date.
 23 Installing openssl (1.0.1e-r15.0) to root...
 ...
 31 Package packagegroup-core-boot (1.0-r11) installed in root is up to date.
 32 Package opkg (1:0.2.0-r0) installed in root is up to date.
 33 Package poky-feed-config-opkg (1.0-r2) installed in root is up to date.
 ...
 54 NOTE: Installing the following packages: lib32-gzip
...

---------------------------------------------
Case 4: Rebuild in place and Upgrade package
1. Edit local.conf, enable ipk incremental image generation
...
258 IMAGE_INSTALL_append = &quot; gzip&quot;
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

2. Edit local.conf, upgrade gzip&apos;s PR
...
258 PR_pn-gzip = &quot;r1&quot;
...

3. bb core-image-minimal, gzip should be upgraded to r1
vim log.do_rootfs:
...
 21 NOTE: Package packagegroup-core-ssh-dropbear (1.0-r1) installed in root is up to date.
 22 Package opkg-collateral (1.0-r2) installed in root is up to date.
 23 Package run-postinsts (1.0-r9) installed in root is up to date.
 24 Package packagegroup-core-boot (1.0-r11) installed in root is up to date.
 25 Package opkg (1:0.2.0-r0) installed in root is up to date.
 26 Upgrading gzip on root from 1.6-r0 to 1.6-r1...
...

---------------------------------------------
Case 5: Test BAD_RECOMMENDATIONS
1. Edit local.conf, enable ipk incremental image generation
...
258 IMAGE_INSTALL_append = &quot; util-linux&quot;
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

The util-linux-fdisk is in util-linux&apos;s RRECOMMENDS
vim installed_pkgs.txt
...
41 util-linux-fdisk core2-64
...

2. Edit local.conf, add some spaces to IMAGE_INSTALL and add
util-linux-fdisk to core-image-minimal&apos;s BAD_RECOMMENDATIONS
...
260 IMAGE_INSTALL_append = &quot; util-linux  &quot;
265 BAD_RECOMMENDATIONS_pn-core-image-minimal += &quot;util-linux-fdisk&quot;
...

3. bb core-image-minimal, util-linux-fdisk should not be installed
vim log.do_rootfs:
...
34 NOTE: Requested ignored recommendation util-linux-fdisk is not a package
    ...
119 util-linux: ignoring recommendation for util-linux-fdisk at user request
120 util-linux: unsatisfied recommendation for util-linux-fdisk
...

The util-linux-fdisk doesn&apos;t exist in installed_pkgs.txt any more.

---------------------------------------------
Case 5: Test NO_RECOMMENDATIONS
1. Edit local.conf, enable ipk incremental image generation
...
258 IMAGE_INSTALL_append = &quot; util-linux&quot;
263 INC_IPK_IMAGE_GEN = &quot;1&quot;
...
bb core-image-minimal

The util-linux-fdisk util-linux-cfdisk util-linux-sfdisk
util-linux-mount util-linux-readprofile util-linux-mkfs are
in util-linux&apos;s RRECOMMENDS

vim installed_pkgs.txt
...
4 util-linux-mkfs core2-64
18 util-linux-sfdisk core2-64
20 util-linux-mount core2-64
38 util-linux-cfdisk core2-64
41 util-linux-fdisk core2-64
46 util-linux-readprofile core2-64
...

2. Edit local.conf, add some spaces to IMAGE_INSTALL and
   assign core-image-minimal&apos;s NO_RECOMMENDATIONS with 1
...
260 IMAGE_INSTALL_append = &quot; util-linux  &quot;
267 NO_RECOMMENDATIONS_pn-core-image-minimal = &quot;1&quot;
...

3. bb core-image-minimal, The six packages should not be installed
vim log.do_rootfs:
...
34 NOTE: Requested ignored recommendation util-linux-fdisk is not a package
    ...
113 util-linux: ignoring recommendation for util-linux-sfdisk at user request
114 util-linux: unsatisfied recommendation for util-linux-sfdisk
115 util-linux: ignoring recommendation for util-linux-cfdisk at user request
116 util-linux: unsatisfied recommendation for util-linux-cfdisk
117 util-linux: ignoring recommendation for util-linux-mount at user request
118 util-linux: unsatisfied recommendation for util-linux-mount
119 util-linux: ignoring recommendation for util-linux-fdisk at user request
120 util-linux: unsatisfied recommendation for util-linux-fdisk
121 util-linux: ignoring recommendation for util-linux-mkfs at user request
122 util-linux: unsatisfied recommendation for util-linux-mkfs
123 util-linux: ignoring recommendation for util-linux-readprofile at user request
124 util-linux: unsatisfied recommendation for util-linux-readprofile
...

They don&apos;t exist in installed_pkgs.txt any more.

//Hongxu</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40687</commentid>
    <comment_count>5</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2014-02-26 02:00:17 +0000</bug_when>
    <thetext>Merged into master:

commit 6ffc15655068f3da6032d8c782a8005a3f73aed9
Author: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Date:   Fri Feb 21 15:28:48 2014 +0800

    manifest.py: remove redundant import line</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>