Skip to content

Commit

Permalink
oetree: add script
Browse files Browse the repository at this point in the history
as a replacement for dot2tree.
The new script is hundreds of times faster and much more flexible.

It includes now package size information and render tweaks,
so even larger tree can be printed in a still readable fashion.

The previously mandatory endnode is now optional, also
the order of the inputs was adjusted to have a more common
look and feel across the different modes

Signed-off-by: Konrad Weihmann <[email protected]>
  • Loading branch information
priv-kweihmann committed Jan 30, 2025
1 parent 705631b commit a974c48
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 279 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ A collection of build utils to be used with YOCTO
| ----------------- | ------------------------------------------------------------------- | ---------------------------------------- |
| bitbake-listflags | list all defined flgas of a bitbake variable | [docu](docs/scripts-bitbakelistflags.md) |
| bitbake-listvars | list all defined bitbake variable | [docu](docs/scripts-bitbakelistvars.md) |
| dot2tree | create filterable trees from recipe info | [docu](docs/scripts-dot2tree.md) |
| newlayercheck | check a layer for possible corruptions/changes of an existing stack | [docu](docs/scripts-newlayercheck.md) |
| oetree | create filterable trees from bitbake info | [docu](docs/scripts-oetree.md) |
| unused | identify unused recipes in a layer | [docu](docs/scripts-unused.md) |
71 changes: 0 additions & 71 deletions docs/scripts-dot2tree.md

This file was deleted.

112 changes: 112 additions & 0 deletions docs/scripts-oetree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# dot2tree

A scripts that converts graphs like task-depends.dot or package information into filterable tree printed to console.
For it to work you will need

- anytree installed (``pip install anytree``)
- a populated bitbake build
- **for task-depends**: a dot file of your target (``bitbake -g <target>``)

## Usage

```shell
usage: oetree [-h] [--mode {taskdepends,pkgdepend}] [--endnode ENDNODE] [--renderdepth RENDERDEPTH] input root

print nice trees out of bitbake information

positional arguments:
input Path to input files [depends on mode selected]
root Name of the root node or path to an image manifest

options:
-h, --help show this help message and exit
--mode {taskdepends,pkgdepend}
mode to operate in (default: taskdepends)
--endnode ENDNODE Stop tree at (default: None)
--renderdepth RENDERDEPTH
Limit render depth (default: 1000000000)
```

### Example output

`oetree --mode=taskdepends --endnode=kern-tools-native task-depends.dot core-image-minimal`

returns

```shell
core-image-minimal
└── busybox
└── kern-tools-native
```

`oetree --mode=pkgdepend /path/to/build-dir/tmp/pkgdata/<arch>/runtime-reverse/runtime-reverse ncurses-libtinfo`

returns

```shell
ncurses-libtinfo
├── glibc [4.2M - 5.2M]
│ └── ldconfig [949.0k - 949.0k]
└── ncurses-terminfo-base [25.8k - 25.8k]
```

**NOTE** the numbers in the brackets are the size of the package plus the summed up size of all packages required to be installed with it

`oetree --mode=pkgdepend --endnode=python3-core /path/to/build-dir/tmp/pkgdata/<arch>/runtime-reverse/runtime-reverse python3-math`

returns
```shell
python3-math
└── python3-core [5.6M - 11.5M]
└── python3-compression [232.3k - 5.8M]
└── python3-core [5.6M - 5.6M]
```

`oetree --mode=pkgdepend /path/to/build-dir/tmp/pkgdata/<arch>/runtime-reverse/runtime-reverse /path/to/build-dir/tmp/deploy/images/<arch>/<imagename>.rootfs.manifest`

returns

```shell
<imagename>.rootfs.manifest
├── base-files [4.0k - 4.0k]
├── base-passwd [0.0 - 0.0]
├── busybox [651.7k - 5.8M]
│ ├── busybox-udhcpc [2.7k - 2.7k]
│ ├── glibc [4.2M - 5.2M]
│ │ └── ldconfig [949.0k - 949.0k]
│ └── update-alternatives-opkg [4.6k - 4.6k]
├── busybox-hwclock [2.5k - 8.7k]
│ └── update-rc.d [6.2k - 6.2k]
├── busybox-syslog [4.2k - 5.8M]
│ ├── busybox [651.7k - 5.8M]
│ │ ├── busybox-udhcpc [2.7k - 2.7k]
│ │ ├── glibc [4.2M - 5.2M]
│ │ │ └── ldconfig [949.0k - 949.0k]
│ │ └── update-alternatives-opkg [4.6k - 4.6k]
...
```

`oetree --mode=pkgdepend --renderdepth=2 /path/to/build-dir/tmp/pkgdata/<arch>/runtime-reverse/runtime-reverse /path/to/build-dir/tmp/deploy/images/<arch>/<imagename>.rootfs.manifest`

returns

```shell
<imagename>.rootfs.manifest
├── bad-systemd [104.0 - 104.0]
├── base-files [4.0k - 4.0k]
├── base-passwd [0.0 - 0.0]
├── busybox [651.7k - 5.8M]
├── busybox-hwclock [2.5k - 8.7k]
├── busybox-syslog [4.2k - 5.8M]
├── dbus-1 [339.1k - 477.1M]
├── e2fsprogs-e2fsck [352.2k - 42.9M]
├── init-ifupdown [2.8k - 27.3k]
├── initscripts-functions [2.1k - 2.1k]
├── kbd [831.3k - 6.0M]
├── kbd-consolefonts [456.5k - 456.5k]
├── kbd-keymaps [554.9k - 556.9k]
├── kernel-6.12.8-yocto-tiny [62.8k - 62.8k]
├── kernel-image-6.12.8-yocto-tiny [0.0 - 0.0]
├── kernel-image-bzimage-6.12.8-yocto-tiny [3.8M - 3.8M]
...
```
Loading

0 comments on commit a974c48

Please sign in to comment.