};
I have the following patch:
From 741f980364f127643ad0de6e6a521246eb44bffa Mon Sep 17 00:00:00 2001
Date: Wed, 8 Oct 2025 12:35:39 +0000
Subject: [PATCH] Debug partition elements
---
parser/parser.c | 2 ++
1 file changed, 2 insertions(+)
Index: git/parser/parser.c
===================================================================
--- git.orig/parser/parser.c
+++ git/parser/parser.c
@@ -480,11 +480,13 @@ static int _parse_partitions(parsertype
return 0;
count = get_array_length(p, setting);
+ TRACE("setting array size: %d", count);
/*
* Parse in reverse order, so that the partitions are processed
* by LIST_HEAD() in the same order as they are found in sw-description
*/
for(i = (count - 1); i >= 0; --i) {
+ TRACE("processing element: %d", i);
elem = get_elem_from_idx(p, setting, i);
if (!elem)
@@ -518,6 +520,21 @@ static int _parse_partitions(parsertype
add_properties(p, elem, partition);
+ if (&partition->properties) {
+ TRACE("pre-embscript partition->properties exists");
+
+ if (LIST_EMPTY(&partition->properties)) {
+ TRACE("properties list is empty");
+ }
+
+ struct dict_entry *entry;
+ LIST_FOREACH(entry, &partition->properties, next) {
+ TRACE("key: %s", entry->key);
+ }
+ } else {
+ TRACE("partition->properties is NULL");
+ }
+
skip = run_embscript(p, elem, partition, L, swcfg->embscript);
if (skip < 0) {
free_image(partition);
@@ -528,6 +545,22 @@ static int _parse_partitions(parsertype
continue;
}
+ if (&partition->properties) {
+ TRACE("post-embscript partition->properties exists");
+
+ if (LIST_EMPTY(&partition->properties)) {
+ TRACE("properties list is empty");
+ }
+
+ struct dict_entry *entry;
+ LIST_FOREACH(entry, &partition->properties, next) {
+ TRACE("key: %s", entry->key);
+ }
+ } else {
+ TRACE("partition->properties is NULL");
+ }
+
+
if ((!strlen(partition->volname) && !strcmp(partition->type, "ubipartition")) ||
!strlen(partition->device)) {
ERROR("Partition incompleted in description file");
I see the following output:
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_thread] : Incoming network request: processing...
Jan 10 03:24:58 localhost
user.info swupdate: START Software Update started !
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_initializer] : Software update started
Jan 10 03:24:58 localhost user.debug swupdate: RUN [extract_file_to_tmp] : Found file
Jan 10 03:24:58 localhost user.debug swupdate: RUN [extract_file_to_tmp] : filename sw-description
Jan 10 03:24:58 localhost user.debug swupdate: RUN [extract_file_to_tmp] : size 1374
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parse_cfg] : Parsing config file /tmp/sw-description
Jan 10 03:24:58 localhost user.debug swupdate: RUN [get_common_fields] : Version 5.0.11
Jan 10 03:24:58 localhost user.debug swupdate: RUN [get_common_fields] : Description SWupdate rescue image for Skybase x86 platforms
Jan 10 03:24:58 localhost user.debug swupdate: RUN [get_common_fields] : Setting bootloader state marker: false
Jan 10 03:24:58 localhost user.debug swupdate: RUN [get_common_fields] : Setting bootloader transaction marker: false
Jan 10 03:24:58 localhost user.debug swupdate: RUN [get_common_fields] : reboot_required 0
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parser] : Getting script
Jan 10 03:24:58 localhost
user.info swupdate: RUN [lua_handlers_init] : External Lua handler(s) found and loaded.
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parser] : Found Lua Software: function file_exists(name) local f=io.open(name, 'r') if f~=nil then io.close(f) return true else
return false end end function detect_emmc(image) image.device = '/de
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parse_hw_compatibility] : Accepted Hw Revision : #RE:^X2:03
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : setting array size: 1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : processing element: 0
Jan 10 03:24:58 localhost user.warn swupdate: RUN [check_field_string] : Configuration Key 'device' is empty!
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties] : Found properties for :
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property labeltype: gpt
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property nolock: true
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property noinuse: true
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-1: size=32M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-1: name=efi
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-1: type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-1: fstype=vfat
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-1: start=2048
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-2: size=32M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-2: name=boot0
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-2: type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-2: fstype=vfat
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-3: size=32M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-3: name=boot1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-3: type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-3: fstype=vfat
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-4: size=1024M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-4: name=root0
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-4: type=B921B045-1DF0-41C3-AF44-4C6F280D3FAE
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-5: size=1024M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-5: name=root1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-5: type=B921B045-1DF0-41C3-AF44-4C6F280D3FAE
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-6: size=256M
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-6: name=data
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-6: type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
Jan 10 03:24:58 localhost user.debug swupdate: RUN [add_properties_cb] : Property partition-6: fstype=ext4
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : pre-embscript partition->properties exists
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-6
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-5
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-4
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-3
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-2
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: partition-1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: noinuse
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: nolock
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : key: labeltype
Jan 10 03:24:58 localhost user.debug swupdate: RUN [lua_parser_fn] : Prepared to run detect_emmc
Jan 10 03:24:58 localhost user.debug swupdate: RUN [lua_parser_fn] : Script returns 0
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : post-embscript partition->properties exists
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : properties list is empty
Jan 10 03:24:58 localhost user.debug swupdate: RUN [_parse_partitions] : Partition: /dev/mmcblk1 new size 0 bytes
Jan 10 03:24:58 localhost user.debug swupdate: RUN [compare_versions] : Comparing old-style versions '5.0.11' <-> '3.0.0'
Jan 10 03:24:58 localhost user.debug swupdate: RUN [compare_versions] : Parsed: '1407374884274176' <-> '844424930131968'
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parse] : Number of found artifacts: 1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parse] : Number of scripts: 0
Jan 10 03:24:58 localhost user.debug swupdate: RUN [parse] : Number of steps to be run: 1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [check_hw_compatibility] : Hardware industry Revision: X2:03
Jan 10 03:24:58 localhost user.debug swupdate: RUN [hwid_match] : hwrev X2:03 matched by regexp ^X2:03
Jan 10 03:24:58 localhost user.debug swupdate: RUN [check_hw_compatibility] : Hardware compatibility verified
Jan 10 03:24:58 localhost user.debug swupdate: RUN [preupdatecmd] : Running Pre-update command
Jan 10 03:24:58 localhost user.debug swupdate: RUN [extract_padding] : Expecting up to 512 padding bytes at end-of-file
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_initializer] : Note: Setting EFI Boot Guard's 'in_progress' environment variable cannot be disabled.
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_initializer] : Note: EFI Boot Guard environment transaction will not be auto-committed.
Jan 10 03:24:58 localhost user.warn swupdate: RUN [network_initializer] : EFI Boot Guard environment modifications will not be persisted.
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_initializer] : Valid image found: copying to FLASH
Jan 10 03:24:58 localhost
user.info swupdate: RUN Installation in progress
Jan 10 03:24:58 localhost user.debug swupdate: RUN [install_single_image] : Found installer for stream diskpart
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart] : handler_type: diskpart
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart] : device: /dev/mmcblk1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart] : is_partitioner: 1
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart] : img->properties exists
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart] : properties list is empty
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart_is_gpt] : diskpart_is_gpt: (null)
Jan 10 03:24:58 localhost user.debug swupdate: RUN [diskpart_is_dos] : diskpart_is_dos: (null)
Jan 10 03:24:58 localhost user.err swupdate: FAILURE ERROR diskpart_handler.c : diskpart : 1259 : Just GPT or DOS partition table are supported
Jan 10 03:24:58 localhost user.debug swupdate: RUN [install_single_image] : Installer for diskpart not successful !
Jan 10 03:24:58 localhost user.err swupdate: FATAL_FAILURE Installation failed !
Jan 10 03:24:58 localhost user.debug swupdate: RUN [network_initializer] : Main thread sleep again !
Jan 10 03:24:58 localhost
user.info swupdate: IDLE Waiting for requests..
If I adjust the sw-description file as follows:
software = {
version = "@@DISTRO_VERSION@@";
reboot = false;
bootloader_transaction_marker = false;
bootloader_state_marker = false;
hardware-compatibility: [
"#RE:^X2:03"
];
embedded-script = "
function detect_emmc(image)
image.device = '/dev/mmcblk1'
return true, image
end
";