system-image should not generate an empty 'removed' file

Bug #1437225 reported by James Hunt on 2015-03-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu system image
Undecided
Unassigned

Bug Description

Attempting to upgrade an amd64 snappy system at s-i level r345 failed. The cause was the upgrader barfing on the fact that one of the upgrade tars contained an invalid 'removed' file.

s-i version on the snappy system:

$ dpkg -l|grep system-image
ii system-image-cli 2.5-0ubuntu1+ppa22 all Ubuntu system image updater command line client
ii system-image-common 2.5-0ubuntu1+ppa22 all Ubuntu system image updater
ii system-image-dbus 2.5-0ubuntu1+ppa22 all Ubuntu system image updater command line client
ii ubuntu-core-snappy 0.2~ppa89 all Tool to manage the ubuntu-system-image

The system was running r345, but I faked a downgrade to r344 and attempted to upgrade to r345.

Files downloaded by s-i:

device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz
device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz.asc
image-master.tar.xz
image-master.tar.xz.asc
image-signing.tar.xz
image-signing.tar.xz.asc
ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz
ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz.asc
version-345.tar.xz
version-345.tar.xz.asc

The 'ubuntu_command' files contains:

load_keyring image-master.tar.xz image-master.tar.xz.asc
load_keyring image-signing.tar.xz image-signing.tar.xz.asc
mount system
update ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz.asc
update device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz.asc
update version-345.tar.xz version-345.tar.xz.asc
unmount system

The problematic update archive:

$ tar tvf device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz
-rw-r--r-- root/root 1 2015-03-26 14:55 removed
drwxr-xr-x root/root 0 2015-03-26 14:13 system/boot/
-rw------- root/root 3608220 2015-03-23 17:16 system/boot/System.map-3.19.0-10-generic
-rw-r--r-- root/root 1265400 2015-03-23 17:16 system/boot/abi-3.19.0-10-generic
-rw-r--r-- root/root 14443156 2015-03-26 14:13 system/boot/initrd.img-3.19.0-10-generic
-rw------- root/root 6610240 2015-03-23 17:16 system/boot/vmlinuz-3.19.0-10-generic
lrwxrwxrwx root/root 0 2015-03-26 14:11 system/initrd.img -> boot/initrd.img-3.19.0-10-generic
lrwxrwxrwx root/root 0 2015-03-26 14:11 system/vmlinuz -> boot/vmlinuz-3.19.0-10-generic

The erroneous 'removed' file from above contains:

$ od -xc removed
0000000 000a
         \n
0000001

Related branches

Stéphane Graber (stgraber) wrote :

I'm not sure why an empty removed file is considered invalid. If there's nothing to remove, the file should still be there (so it doesn't break the phone upgrader) and since there's nothing to iterate over, nothing gets removed.

Download full text (4.5 KiB)

it actually speeds up upgrader process, at least if 'removed' file is at
the beginning of the package. Otherwise phone upgrader scans through whole
package looking for the file.

On Fri, Mar 27, 2015 at 4:00 PM, Stéphane Graber <email address hidden>
wrote:

> I'm not sure why an empty removed file is considered invalid. If there's
> nothing to remove, the file should still be there (so it doesn't break
> the phone upgrader) and since there's nothing to iterate over, nothing
> gets removed.
>
> --
> You received this bug notification because you are a member of Ubuntu
> System Image team, which is subscribed to Ubuntu system image.
> https://bugs.launchpad.net/bugs/1437225
>
> Title:
> system-image should not generate an empty 'removed' file
>
> Status in Ubuntu system image (server/client/updater):
> New
>
> Bug description:
> Attempting to upgrade an amd64 snappy system at s-i level r345 failed.
> The cause was the upgrader barfing on the fact that one of the upgrade
> tars contained an invalid 'removed' file.
>
> s-i version on the snappy system:
>
> $ dpkg -l|grep system-image
> ii system-image-cli 2.5-0ubuntu1+ppa22
> all Ubuntu system image updater command line client
> ii system-image-common 2.5-0ubuntu1+ppa22
> all Ubuntu system image updater
> ii system-image-dbus 2.5-0ubuntu1+ppa22
> all Ubuntu system image updater command line client
> ii ubuntu-core-snappy 0.2~ppa89
> all Tool to manage the ubuntu-system-image
>
> The system was running r345, but I faked a downgrade to r344 and
> attempted to upgrade to r345.
>
> Files downloaded by s-i:
>
>
> device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz
>
> device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fca3a8b9081c210.tar.xz.asc
> image-master.tar.xz
> image-master.tar.xz.asc
> image-signing.tar.xz
> image-signing.tar.xz.asc
>
> ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz
>
> ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz.asc
> version-345.tar.xz
> version-345.tar.xz.asc
>
> The 'ubuntu_command' files contains:
>
> load_keyring image-master.tar.xz image-master.tar.xz.asc
> load_keyring image-signing.tar.xz image-signing.tar.xz.asc
> mount system
> update
> ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz
> ubuntu-ebd18b9957d83daf2397b190bc5f24809fbefdaacfc6958c8474815a648f9f6a.delta-ubuntu-e27d26cc35ecd217e69a5cb51ce07315c0b83ef15de4749c550e79cb0f39e5f6.tar.xz.asc
> update
> device-8918bd6cf1c704fd2172449c39494427009475aa5f64c2a4aa2cc5d23d0e14bb.delta-device-c33d31585412aeaf4a62ac6f1f415ff12971adfd0da644a88fc...

Read more...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers