Skip to content

Compact device-tree source creates illegal .dts syntax #621

@gsmecher

Description

@gsmecher

The following device-tree source:

/dts-v1/;

/ {
    compact_label: compact_thing@0 { compatible = "baz"; };
};

causes lopper to generate illegal .dts when invoked as follows:

lopper --enhanced -f -i lopper/lops/lop-load.dts in.dts out.dts

Lopper bails with the following error message:

[ERROR]: unable to (force) compile ['/usr/bin/dtc', '-i', '.', '-o', '/tmp/tmpbld8b1e7/in.dts.dtb', '-I', 'dts', '-O', 'dtb', '/tmp/tmpbld8b1e7/in.dts.pp.enhanced', '-f']

         Error: in.dts:5.1-34 Properties must precede subnodes
         FATAL ERROR: Unable to parse input tree

The in.dts.pp.enhanced file contains:

/ {
    compact_label: compact_thing@0 { compatible = "baz"; };
lopper-label-1 = "compact_label";
};

The "lopper-label-1" label, here, is placed after the child node and not inside it. If I modify the device-tree source with an extra newline:

/dts-v1/;

/ {
    compact_label: compact_thing@0 {
	    compatible = "baz"; };
};

...everything is fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions