Skip to content

Commit 74493b2

Browse files
Updating the steps to run add_custom_packages.sh (#275)
* Updating the steps to run add_custom_packages.sh for Customizing an Image Updated the documentation on Customizing an Image: - Transitioned from manual steps to using the add_custom_packages.sh script for automation. - Included instructions on script usage and configuration file updates. * Update step 1 wording Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bash Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bash Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bash Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bullet Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bullet Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 1 bullet Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update step 2 Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com> * Update docs/developer-guide/get-started/emt-building-howto.md * Update emt-building-howto.md To resolve lint issues * Update docs/developer-guide/get-started/emt-building-howto.md --------- Co-authored-by: Sebastian Golebiewski <sebastianx.golebiewski@intel.com>
1 parent b5764b2 commit 74493b2

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

docs/developer-guide/get-started/emt-building-howto.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ RT build command: sudo make image -j8 REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_
9696

9797
## Customizing an Image
9898

99-
To add packages to the default image, you can define your own `packagelist.json` file,
100-
pointing to `rpms` that should be included in the image. The `edge-image.json` file points to
101-
multiple `packagelist` files, located under `imageconfigs/packagelists`. The same `rpms` may
102-
be included in an `imageconfig` file through the `packagelist` files.
99+
To add packages to the default image, you can define your own `packagelist.json` file, pointing to RPMs that should be included in the image.
100+
To streamline this process, you can use the `add_custom_packages.sh` script located in `toolkit/scripts`.
101+
This script helps generate a `custom-packages.json` file and updates an existing imageconfig JSON file.
102+
The `edge-image.json` file points to multiple `packagelist` files, located under `imageconfigs/packagelists`.
103+
The same `rpms` may be included in an `imageconfig` file through the `packagelist` files.
103104

104105
The resulting image will include the set of all `rpms` specified within the array of
105106
`packagelist` files from the `imageconfig`.
@@ -109,24 +110,24 @@ The resulting image will include the set of all `rpms` specified within the arra
109110
Note that you can only add the packages for which SPEC files exist. To add `nano` as an
110111
alternative text editor to the image:
111112

112-
1. Define a new JSON file.
113+
1. Use the script to create a custom package list file, for example `utilities.json`, and update an existing `imageconfig` JSON file, for example, `edge-image.json`.
113114

114115
```bash
115-
# Create a new packagelist called utilities.json
116-
cat <<EOF > ./imageconfigs/packagelists/utilities.json
117-
{
118-
"packages": [
119-
"nano"
120-
]
121-
}
122-
EOF
116+
# Refer to this usage format:
117+
# Usage: ./add_custom_packages.sh "<pkg1 pkg2 ...>" path/to/image.json [custom-packages.json]
118+
119+
# Run the script to add nano into the edge-image.json configuration.
120+
./add_custom_packages.sh "nano" ../imageconfigs/edge-image.json utilities.json
123121
```
124122

125-
2. Include it in an existing `imageconfig` JSON file, for example `edge-image.json`.
126-
You can also create a new file and add it to the `imageconfigs` folder.
123+
- `"<pkg1 pkg2 ...>"` - List names of packages to include. Keep them separated by spaces.
124+
- `path/to/image.json` - Specify the path to your `imageconfig` JSON file, for example, `../imageconfigs/edge-image.json`.
125+
- `[custom-packages.json]` - Optionally, provide a name for the custom package list file. If omitted, the default `custom-packages.json` name will be used.
126+
127+
2. After running the script, your `imageconfig` JSON file (e.g., `edge-image.json`) will include the custom package list you specified. You can also create a new file and add it to the `imageconfigs` folder. Before running `add_custom_packages.sh` to include your custom package list, make sure that the `PackageLists` section exists in the `imageconfig` JSON file.
127128

128129
```bash
129-
# Edit the edge-image.json file. Add the custom packagelist and default login account for testing.
130+
# Edit the edge-image.json file. Add the default login account for testing.
130131
...
131132
"PackageLists": [
132133
"packagelists/core-packages-image-systemd-boot.json",

0 commit comments

Comments
 (0)