Commit graph

564 commits

Author SHA1 Message Date
Tom Gundersen
2e0deff629 submodule: bump to current head
Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-28 14:14:09 +01:00
Tom Gundersen
18934d4249 tools/image-info: add support for naked partitions
In case there is no partition table, we assume the whole image is
one big partition and treat is as such.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-25 11:46:25 +02:00
Lars Karlitski
329964f2ab image-info: add test
Add two kinds of tests, with one case each:

1. Run image-info against an osbuild pipeline. Uses osbuild
from a submodule to make an image from the pipeline.

2. Run image-info against an existing image, fetched from the internet.
2019-10-05 14:47:35 +02:00
Lars Karlitski
2854b2938e image-info: don't use rpm --verify with --root
RPM uses the host's passwd instead of that in the target to get uid
and gid mappings.

Run it in a chroot to work around this bug.
2019-10-05 14:47:35 +02:00
Lars Karlitski
5040e6b427 image-info: sort bootmenu entries
The order doesn't matter, but should be the same between different runs
of image-info.
2019-10-04 01:51:07 +02:00
Tom Gundersen
41c6f5dd0b image-info: include partition table id
Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-03 12:35:51 +02:00
Lars Karlitski
b170ea036c image-info: include output from rpm --verify
This shows the changes an image has relative to what its rpm database
thinks is installed. Output is:

    "rpm-verify": {
        "missing": [ <missing files> ],
        "changed": { <map from filename to rpm attribute octet > }
    }

Alas, this makes running image-info slower.
2019-10-01 17:05:10 +02:00
Lars Karlitski
01b7402ce2 image-info: include partition label and uuid 2019-09-30 22:28:28 +02:00
Lars Karlitski
9867846ff4 tools/image-info: consistent use of - over _
And remove a stray comment and whitespace.
2019-09-30 22:28:28 +02:00
Tom Gundersen
e43955a4c5 image-info: include the image format
Use qemu-img to query the image format and include that in the report.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-09-30 15:15:14 +02:00
Lars Karlitski
bf3d7fcdca image-info: add basic support for multiple partitions
For each partition, find out if its the root or boot partition and
gather only the relevant information. Make sure that we don't get
information from /boot twice.
2019-09-30 13:32:53 +02:00
Lars Karlitski
172a23bdb2 image-info: bootloader=unknown instead of creashing 2019-09-30 13:32:53 +02:00
Lars Karlitski
457f5f697e image-info: assume bootable=False if key is not present
sfdisk doesn't include the "bootable" key in its output when a partition
is not marked as bootable.
2019-09-30 13:32:53 +02:00
Lars Karlitski
5fbc734a15 tools: add image-info
Rough draft of image-info, a tool that extracts high-level information
about an os image. It prints this information in JSON form on stdout.
Run it like this:

  $ tools/image-info <image>

It supports all images that qemu-ndb supports.
2019-09-29 13:44:56 +02:00