Dtsh

Latest version: v0.2.2

Safety actively analyzes 632783 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.2.2

New and Noteworthy

Noteworthy changes bellow, besides a few minor bug fixes.

`board`

Simple new command to print board information:
- description from YAML
- board file (DTS)


/
> board
identifier: bbc_microbit
name: BBC Micro:Bit
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 16
testing:
ignore_tags:
- net
supported:
- ble
- i2c
- gpio
- pwm


Patched `edtlib` library

The `PropertySec.path` API in the python-devicetree library wrongly tells all properties originate from the top-level binding file, which causes the `cat` command to show misleading and confusing paths (see issue 5).

We've proposed a patch upstream, but its review clearly is not a priority (the underlying issue has no consequence on Zephyr use of the library).

We apply this patch here:
- will actually fix the `cat` command, and does not otherwise break DTSh
- can't break Zephyr in any way (will still use its own unpatched version of the python-devicetree library, see issue 2)

Full Changelog

**Full Changelog**: https://github.com/dottspina/dtsh/compare/v0.2.1...v0.2.2

0.2.1

New and Noteworthy

`cat`

The `ls`, `tree` and `find` commands all eventually *enumerate* nodes, and the `--format` option permits to select *columns* among a predefined set of properties.

The new `cat` built-in permits to access:
- the values of all defined node properties
- almost complete *contents* of node bindings and property specifications

It's simple while quite handy:

/
> cat &qspi/$* -l
Property Type Value
────────────────────────────────────────────────────────────────────────────────────────
interrupts array < 0x29 0x01 >
pinctrl-0 phandles < &qspi_default >
reg array < 0x40029000 0x1000 0x12000000 0x08000000 >
status string "okay"
compatible string-array "nordic,nrf-qspi"
reg-names string-array "qspi", "qspi_mm"
wakeup-source boolean false
zephyr,pm-device-runtime-auto boolean false
pinctrl-1 phandles < &qspi_sleep >
pinctrl-names string-array "default", "sleep"

/
> cat &qspi/mx25r6435f0$quad-enable-requirements -Bl
Name: quad-enable-requirements
From: nordic,qspi-nor.yaml
Type: string
Required: No
Deprecated: No
Enum: "NONE", "S2B1v1", "S1B6", "S2B7", "S2B1v4", "S2B1v5", "S2B1v6"
Const: Not a const
Default: "S1B6"
Specifier Space: No specifier space

/
> cat &led0 -lB
Compatible: This binding does not define a compatible string.
Bus: This binding neither provides nor depends on buses.
Child-Bindings: gpio-leds
└── GPIO LED child node

Property Type Description
────────────────────────────────────────────────────────────────────────────────────────
gpios phandle-array
label string Human readable string describing the LED. It can be used by an…


Batch mode

For scripting and automation, DTSh can now execute non-interactively:

- a series of commands passed as program arguments: ``dtsh -c CMD1 -c CMD2 ...``
- commands form a script file: `dtsh -f FILE`

The ``-i --interactive`` option then permits to enter the interactive loop after the batch commands have been executed, as desired.

The `-c` option is especially practical on POSIX shells, where you can define aliases, e.g.:

sh
An alias to export the devicetree to HTML without leaving the operating system shell.
alias dts2html='dtsh -c "tree --format NKiYcd > devicetree.html"'


Combined with the pager, scripts allow to create simple *presentations*:


First "slide"

Start with the tree of buses and connected devices: speaker will press "q" when done
find --with-bus * --OR --on-bus * --format NYcd -T --pager

Let's look at the Flash partitions.

1st, the controller: : speaker will press "q" when done
cat &flash_controller -A --pager
Then partitions with addresses and sizes: speaker will press "q" when done
tree &flash_controller --format NrC --pager

Etc.

If the script is run with "-i", DTSh will enter the interactive loop
after the last command: speaker can then navigate the command history
to re-open "slides" while answering questions.


Many thanks to pillo79 who pushed this forward and contributed to the implementation ([PR 4](https://github.com/dottspina/dtsh/pull/4)).


Updated output redirection policy

By default, DTSh does not permit to overwrite existing files when redirecting commands output.
While this is a welcome precaution, this also breaks *appending* (`>>`):


/
> ls > ls.txt

/
> ls >> ls.txt
dtsh: file exists: 'ls.txt'


The preference `pref_fs_no_overwrite` is still set by default, but now bypassed when appending commands output.

Set the new `pref_fs_no_overwrite_strict` preference to never overwrite existing files.

Full Changelog

https://github.com/dottspina/dtsh/compare/v0.2.0...v0.2.1

0.2.0

Freeze currently implemented features and API as 0.2.0 stable.

**Full Changelog**: https://github.com/dottspina/dtsh/compare/v0.2.0-rc1...v0.2.0

0.2.0rc1

Mirrors and packages [RFC - DTSh: DTS file viewer with a shell-like command line interface](https://github.com/zephyrproject-rtos/zephyr/pull/59863).

Should be compatible with Zephyr 3.5.x and 3.6.0-RC1.

Detailed documentation and examples: [DTSh User Guide](https://github.com/dottspina/dtsh/files/14217368/DTSh.pdf)

**This release is deprecated: if already installed please update to at least v0.2.0**

0.1.0b2

New and Noteworthy

Update the bundled python-devicetree library to Zephyr 3.5.0.

**Full Changelog**: https://github.com/dottspina/dtsh/compare/v0.1.0b1...v0.1.0b2

0.1.0b1

New and Noteworthy

Update the bundled python-devicetree library to Zephyr 3.4.0.

**Full Changelog**: https://github.com/dottspina/dtsh/compare/v0.1.0a6...v0.1.0b1

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.