I’m finally updating tpm2_library crates which provide near spec idiomatic naming balanced with Rust conventions, marshalling/unmarshalling, parsing displaying error codes with parameter numbers etc.
The protocol crate is aiming to be no_std style IO free crate. In fact I aim to polish it to the level that it would be equally useful and complete for both clients and TPM emulators to take advantage of and given the use purpose having super-conservative list of deps:
[dependencies] bitflags = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true }
The idea how naming goes is easiest to demostrate with TPM_CC type form TPM2 Structures specification. Let’s randomly pick TPM_CC_EvictControl, which is use for transient-persistent and persistent-evicted conversions.
EDIT: So, uhm, I’ll setting it up the project to Gitlab. Was doing too many things at once :-) I moved the repo away from Codeberg some weeks ago to get more CI quota basically but Github was not the right move. Gitlab is a better fit because I already do kernel CI there, keyutils is hosted in Gitlab and I’ve had less luck running actions locally with “act” than “gitlab-ci-local” (https://github.com/firecow/gitlab-ci-local).
I have already placeholder for it in Gitlab but it is probably better sleep first and do after (and make sure that everything works).
[*] https://github.com/ColinIanKing/tpm2-scripts Thanks for @colinianking again for preservation! It came for use now …
This is a fish function:
function cargo-registry --argument-names query
set -l r \
~/.cargo/registry/src/index.crates.io-*/
set -l c (
ls -d $r*/ 2>/dev/null \
| xargs -n 1 basename
)
if test -z "$query"
printf '%s\n' $c \
| sort
else
printf '%s\n' $c \
| grep -i "$query" \
| sort
end
end
And what it does is:
❯ cargo-registry|head
ab_glyph_rasterizer-0.1.9
ab_glyph-0.2.31
accesskit_consumer-0.28.0
accesskit_macos-0.20.0
accesskit_winit-0.27.0
accesskit-0.19.0
adler2-2.0.1
adler2-2.0.1
ahash-0.8.12
ahash-0.8.12
aho-corasick-1.1.3
allocator-api2-0.2.21
allocator-api2-0.2.21
anstream-0.6.19
anstream-0.6.19
anstyle-1.0.11
anstyle-1.0.11
anstyle-parse-0.2.7
anstyle-parse-0.2.7
anstyle-query-1.1.3
# ...
And also:
❯ cargo-registry egui
egui_glow-0.32.0
egui-0.32.0
egui-wgpu-0.32.0
egui-winit-0.32.0
This is as done as lsiommu can ever be, or at least as far as I’m concerned so it’s a release time:
https://github.com/puavo-org/lsiommu/releases/tag/1.0.0
I.e. I spent last night making it do less from the almost nothing it was doing already ;-) That’s the point of these tools…
That enumerated to:
This sums up to zero mallocs from the main application (while libudev probably does bunch of them when not compiled with make DISCOVER=sysfs).
Motivation to do was this shitty python script:
#!/usr/bin/env python3
#
# Copyright (c) 2022-2023 Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
import os
import sys
IOMMU_SYSFS = '/sys/kernel/iommu_groups'
IOMMU_GROUP_MAX = 128 # an arbitrary choice
def get_iommu_devices():
groups = [None for group in range(IOMMU_GROUP_MAX)]
with os.scandir(IOMMU_SYSFS) as group_it:
for group in group_it:
devices = []
group_sysfs = IOMMU_SYSFS + '/' + group.name + '/devices'
with os.scandir(group_sysfs) as device_it:
for device in device_it:
devices.append(device.name)
index = int(group.name)
if index >= IOMMU_GROUP_MAX:
print('Overflow')
sys.exit(1)
groups[index] = devices
return groups
if __name__ == "__main__":
groups = get_iommu_devices()
for i in range(len(groups)):
group = groups[i]
if group == None:
break
print('IOMMU Group %d' % (i))
group.sort()
for device in group:
# FIXME: Replace with pure Python code:
os.system('lspci -nns ' + device)
I’m using mutt so need to ask this before updating readme.
This what I have for mutt:
macro index F10 "<pipe-message>multidepart --browse\n" "View HTML in browser"
macro pager F10 "<pipe-message>multidepart --browse\n" "View HTML in browser"
This is what I presume would be correct for aerc (in ~/.config/aerc/binds.conf
):
[messages]
F10= :pipe -p multidepart --browse<Enter>
[view]
F10= :pipe -p multidepart --browse<Enter>
Does that look about right?