How to pass dbus type="as" argument to gdbus/dbus-send?

120 views
Skip to first unread message

Ted

unread,
Feb 9, 2023, 2:54:08 AM2/9/23
to ChromiumOS Development
I want to reappear dbus event: 

And the below is what I want to reappear exactly (captured in CROS by dbus-monitor).

method call time=1675906347.661521 sender=:1.31 -> destination=org.chromium.CrosDisks serial=4557 path=/org/chromium/CrosDisks; interface=org.chromium.CrosDisks; member=Mount string "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/host1/target1:0:0/1:0:0:0/block/sdb/sdb1" string "" array [ string "rw" string "mountlabel=MY-STORAGE" ]

So I tried gdbus like below.

gdbus call --system --dest org.chromium.CrosDisks --object-path /org/chromium/CrosDisks --method org.chromium.CrosDisks.Mount "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/host1/target1:0:0/1:0:0:0/block/sdb/sdb1" “” [“rw” "mountlabel=MY-STORAGE"]

But I got errors.

(gdbus call:12863): GLib-CRITICAL **: 23:37:56.454: g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed [Invalid UTF-8] Error parsing parameter 2: expected value: \xe2\x80 ^ (gdbus call:12863): GLib-CRITICAL **: 23:37:56.455: g_error_free: assertion 'error != NULL' failed 

I think my expression for the [“rw” "mountlabel=MY-STORAGE"] (type="as" ) part is wrong. May I ask help to fix it exactly?

Ted

unread,
Feb 9, 2023, 8:48:17 PM2/9/23
to ChromiumOS Development, Ted

I found the answer.

"['rw', 'mountlabel=MY-STORAGE']"

thanks.
Reply all
Reply to author
Forward
0 new messages