initrd-flash.sh: check if serial number has letters or leading zeros#1913
initrd-flash.sh: check if serial number has letters or leading zeros#1913paroque28 wants to merge 1 commit intoOE4T:scarthgapfrom
Conversation
If serial number contains letters or leading zeros like: ABC0066978 this code prevents the bash script from failing and assigns a valid session_id Signed-off-by: Pablo Rodriguez Quesada <pablo.aarch64@gmail.com>
|
So you have a Jetson module that has a serial number starting with non-numeric characters? Is this something you did yourself, or did it come that way from the factory? Whatever is in this script needs to match the serial number used in the init-flash script. Maybe it would be simpler to just treat the serial number as a string and truncate it at 8 characters... that might depend on whether the USB ID_MODEL attribute is a numeric (hex) value or string, though. |
|
Let's wait a bit until we continue this PR. This was originally created because my But when I run: |
|
Ignore my previous comment. Unfortunately my serial_number has nothing to do with my Then I guess, I'll need to implement my own initrd_flash script |
|
@madisongh It seems that my problem was the Setting the bash -x makes it so that udisksctl runs after Without it I get: What would be the preferred fix? As for this PR: yes , my board has a peculiar serial number that is different from the standard NVIDIA format. we can either close the PR or fix it in case other people experience it. |
|
Thanks @paroque28
Does this mean meta-tegra/recipes-bsp/tegra-binaries/tegra-helper-scripts/initrd-flash.sh Lines 350 to 357 in e4379e5 but when the udisksctl command happens within I'm wondering if the logic at afce451, basically an additional check for Is this only reproducible on a specific host? I'm wondering why I don't see it with my scarthgap builds. |
|
Hey @dwalkes , |
|
@paroque28 sorry accidentally hit the comment button before I finished typing, I've updated the comment above. |
|
@dwalkes should we move this discussion to an issue or PR? I found this online: And I think this is exactly what is happening. I looked into gdbus and got this: $ gdbus monitor --system --dest org.freedesktop.UDisks2 --object-path /org/freedesktop/UDisks2
Monitoring signals on object /org/freedesktop/UDisks2 owned by org.freedesktop.UDisks2
The name org.freedesktop.UDisks2 is owned by :1.8
/org/freedesktop/UDisks2: org.freedesktop.DBus.ObjectManager.InterfacesAdded (objectpath '/org/freedesktop/UDisks2/drives/flashpkg_0_0', {'org.freedesktop.UDisks2.Drive': {'Vendor': <'flashpkg'>, 'Model': <'0'>, 'Revision': <'0001'>, 'Serial': <'0'>, 'WWN': <''>, 'Id': <'flashpkg-0-0'>, 'Configuration': <@a{sv} {}>, 'Media': <''>, 'MediaCompatibility': <@as []>, 'MediaRemovable': <true>, 'MediaAvailable': <true>, 'MediaChangeDetected': <true>, 'Size': <uint64 134217728>, 'TimeDetected': <uint64 1749546974735956>, 'TimeMediaDetected': <uint64 1749546974735956>, 'Optical': <false>, 'OpticalBlank': <false>, 'OpticalNumTracks': <uint32 0>, 'OpticalNumAudioTracks': <uint32 0>, 'OpticalNumDataTracks': <uint32 0>, 'OpticalNumSessions': <uint32 0>, 'RotationRate': <-1>, 'ConnectionBus': <'usb'>, 'Seat': <'seat0'>, 'Removable': <true>, 'Ejectable': <true>, 'SortKey': <'01hotplug/1749546974735956'>, 'CanPowerOff': <true>, 'SiblingId': <'/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.0'>}})
/org/freedesktop/UDisks2: org.freedesktop.DBus.ObjectManager.InterfacesAdded (objectpath '/org/freedesktop/UDisks2/block_devices/sdb', {'org.freedesktop.UDisks2.Block': {'Device': <b'/dev/sdb'>, 'PreferredDevice': <b'/dev/sdb'>, 'Symlinks': <[b'/dev/disk/by-id/usb-flashpkg_0_0-0:0', b'/dev/disk/by-path/pci-0000:00:14.0-usb-0:1.2:1.0-scsi-0:0:0:0', b'/dev/disk/by-uuid/8c9af423-a4cc-4fbe-b3b3-961eacd24c1d']>, 'DeviceNumber': <uint64 2064>, 'Id': <'by-uuid-8c9af423-a4cc-4fbe-b3b3-961eacd24c1d'>, 'Size': <uint64 134217728>, 'ReadOnly': <false>, 'Drive': <objectpath '/org/freedesktop/UDisks2/drives/flashpkg_0_0'>, 'MDRaid': <objectpath '/'>, 'MDRaidMember': <objectpath '/'>, 'IdUsage': <'filesystem'>, 'IdType': <'ext4'>, 'IdVersion': <'1.0'>, 'IdLabel': <''>, 'IdUUID': <'8c9af423-a4cc-4fbe-b3b3-961eacd24c1d'>, 'Configuration': <@a(sa{sv}) []>, 'CryptoBackingDevice': <objectpath '/'>, 'HintPartitionable': <true>, 'HintSystem': <false>, 'HintIgnore': <false>, 'HintAuto': <true>, 'HintName': <''>, 'HintIconName': <''>, 'HintSymbolicIconName': <''>, 'UserspaceMountOptions': <@as []>}, 'org.freedesktop.UDisks2.Filesystem': {'MountPoints': <@aay []>, 'Size': <uint64 134217728>}})It can give it a try |
|
Thanks @paroque28 that does look relevant:
I think it's already in a PR? You can probably just force push/repurpose it with any improvements you find here.
Do you mean incorporating |
|
Update on this PR: I am currently testing the following patch: I'll do a few more flashes (at least 10 more) , and then confirm that this behavior disappeared . Note, even if my serial number has letters, my |
If serial number contains letters or leading zeros like: ABC0066978 this code prevents the bash script from failing and assigns a valid session_id