Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian: adapt the XML scanning logic to the new layout #2

Open
wants to merge 1 commit into
base: 6688-Add-Debianization-support-preliminary
Choose a base branch
from

Conversation

junjiemao1
Copy link

ACRN's next-gen configurator takes a path to users "work folder" and
generates all files (including the board XML and the scenario XML) of a
scenario under that folder. As a result, users maintaining multiple
scenarios for multiple boards are recommended to organize their config
files using the following layout. Note that the board and scenario XMLs
will have unified names, and the name of the folder is used as the name of
the scenario.

.
├── cfl-k700-i7
│   ├── hybrid_launch_2user_vm
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── hybrid_rt
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── partitioned
│   │   ...
│   └── shared_launch_6user_vm
│   ...
├── generic_board
│   ├── hybrid_launch_2user_vm
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── hybrid_rt
│   | ...
│   ├── ...
├── nuc11tnbi5
│   ├── ...
└── ...

This patch adjusts the XML scanning logic (namely the get-xml-data macro)
in debian/rules so that it can scan BOTH the current layout AND the
recommended one above. Some recent changes are also taken into
consideration:

  • Scenario XMLs no longer have the board and scenario attribute at
    its root node. The new scanning logic infers as follows.

    • If a scenario XML contains a board attribute, it will be used. Otherwise
      other XML files under the same directory will be scanned for that board
      attribute and the first found will be used, assuming new scenario XMLs for
      different boards are not placed under the same directory.

    • The scenario name is the file name (without the .xml suffix) if it is not
      "scenario". Otherwise the work folder name will be used.

  • Symbolic links are ignored to avoid duplicate builds.

  • Launch XMLs are now merged into scenario XMLs. So it is no longer
    necessary to distinguish scenario XMLs from launch ones.

Signed-off-by: Junjie Mao [email protected]

junjiemao1 referenced this pull request Apr 18, 2022
ACRN's next-gen configurator takes a path to users "work folder" and
generates all files (including the board XML and the scenario XML) of a
scenario under that folder. As a result, users maintaining multiple
scenarios for multiple boards are recommended to organize their config
files using the following layout. Note that the board and scenario XMLs
will have unified names, and the name of the folder is used as the name of
the scenario.

.
├── cfl-k700-i7
│   ├── hybrid_launch_2user_vm
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── hybrid_rt
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── partitioned
│   │   ...
│   └── shared_launch_6user_vm
│       ...
├── generic_board
│   ├── hybrid_launch_2user_vm
│   │   ├── board.xml
│   │   └── scenario.xml
│   ├── hybrid_rt
│   |   ...
│   ├── ...
├── nuc11tnbi5
│   ├── ...
└── ...

This patch adjusts the XML scanning logic (namely the `get-xml-data` macro)
in debian/rules so that it can scan BOTH the current layout AND the
recommended one above. Some recent changes are also taken into
consideration:

  * Scenario XMLs no longer have the `board` and `scenario` attribute at
    its root node. The new scanning logic infers as follows.

    - If a scenario XML contains a `board` attribute, it will be used. Otherwise
      other XML files under the same directory will be scanned for that `board`
      attribute and the first found will be used, assuming new scenario XMLs for
      different boards are not placed under the same directory.

    - The scenario name is the file name (without the .xml suffix) if it is not
      "scenario". Otherwise the work folder name will be used.

  * Symbolic links are ignored to avoid duplicate builds.

  * Launch XMLs are now merged into scenario XMLs. So it is no longer
    necessary to distinguish scenario XMLs from launch ones.

Signed-off-by: Junjie Mao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant