Skip to content

Commit fae3f91

Browse files
[DOCS] Update instructions for adding new RPM (open-edge-platform#439)
1 parent 607ecc9 commit fae3f91

File tree

1 file changed

+40
-31
lines changed

1 file changed

+40
-31
lines changed

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

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,24 @@ Before you can build OS images you need to build the toolchain and make sure to
3030
the entire toolchain.
3131

3232

33-
1. Clone the stable branch of the Edge Microvisor Toolkit repository.
33+
### Clone the Edge Microvisor Toolkit repository
3434

35-
Check the [tags](https://github.com/open-edge-platform/edge-microvisor-toolkit/tags) for
36-
the `<stable_tag_name>`.
35+
Checkout the stable branch of the repository. See the
36+
[tags](https://github.com/open-edge-platform/edge-microvisor-toolkit/tags) for
37+
`<stable_tag_name>`.
3738

38-
```bash
39-
git clone https://github.com/open-edge-platform/edge-microvisor-toolkit --branch=<stable_tag_name>
40-
```
41-
42-
2. Navigate to the `toolkit` subdirectory.
39+
```bash
40+
git clone https://github.com/open-edge-platform/edge-microvisor-toolkit --branch=<stable_tag_name>
41+
```
4342

44-
```bash
45-
cd edge-microvisor-toolkit/toolkit
46-
```
43+
### Build the tools
4744

48-
3. Build the tools.
45+
Navigate to the `edge-microvisor-toolkit/toolkit` directory and build the toolchain.
4946

50-
```bash
51-
sudo make toolchain REBUILD_TOOLS=y
52-
```
47+
```bash
48+
cd edge-microvisor-toolkit/toolkit
49+
sudo make toolchain REBUILD_TOOLS=y
50+
```
5351

5452
## Build the Edge Microvisor Toolkit Image
5553

@@ -188,7 +186,7 @@ sudo apt-get install rpm
188186
1. Manually create the necessary directories:
189187

190188
```bash
191-
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
189+
mkdir -p $HOME/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
192190
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
193191
```
194192

@@ -199,7 +197,7 @@ sudo apt-get install rpm
199197
touch helloworld.spec
200198
```
201199

202-
3. Open the spec file using the method of your choice, for example:
200+
3. Open the SPEC file using the method of your choice, for example:
203201

204202
```bash
205203
nano helloworld.spec
@@ -234,12 +232,8 @@ sudo apt-get install rpm
234232
mkdir -p %{buildroot}/usr/bin
235233
install -m 0755 helloworld.sh %{buildroot}/usr/bin/helloworld
236234

237-
mkdir -p %{buildroot}/usr/share/helloworld
238-
install -m 0644 helloworld.signature.json %{buildroot}/usr/share/helloworld/
239-
240235
%files
241236
/usr/bin/helloworld
242-
/usr/share/helloworld/helloworld.signature.json
243237

244238
%changelog
245239
* Wed May 01 2025 Your Name <you@example.com> - 1.0-1
@@ -276,10 +270,11 @@ sudo apt-get install rpm
276270
```bash
277271
tar -czf helloworld-1.0.tar.gz ./helloworld-1.0
278272
sum=$(sha256sum helloworld-1.0.tar.gz | awk '{print $1}')
279-
cat > helloworld-1.0.tar.gz.signature.json <<EOF
273+
cat > helloworld.signatures.json <<EOF
280274
{
281-
"file": "helloworld-1.0.tar.gz",
282-
"sha256": "$sum"
275+
"Signatures": {
276+
"helloworld-1.0.tar.gz": "$sum"
277+
}
283278
}
284279
EOF
285280
```
@@ -296,36 +291,50 @@ sudo apt-get install rpm
296291
297292
1. Create the `helloworld` folder in the `edge-microvisor-toolkit/SPECS` directory.
298293
294+
Make sure you use the [stable branch](#clone-the-edge-microvisor-toolkit-repository)
295+
of the Edge Microvisor Toolkit repository.
296+
299297
```bash
300298
mkdir ./edge-microvisor-toolkit/SPECS/helloworld
301299
```
302300
303-
2. Copy the `helloworld.spec` and `helloworld.signature.json` files to the
304-
`helloworld` folder.
301+
2. Copy the `helloworld.spec`, `helloworld.signature.json` and `helloworld-1.0.tar.gz` files
302+
to the `helloworld` folder.
305303
306304
```bash
307305
cp ./helloworld.spec ./edge-microvisor-toolkit/SPECS/helloworld
308306
cp ./helloworld-1.0/helloworld.signature.json ./edge-microvisor-toolkit/SPECS/helloworld
307+
cp helloworld-1.0.tar.gz ./edge-microvisor-toolkit/SPECS/helloworld
309308
```
310309
311310
3. Finally, update the `cgmanifest` by using the provided `python` script.
312311
313312
```bash
314-
cd ./edge-microvisor-toolkit/toolkit
315-
python3 -m pip install -r ./scripts/requirements.txt
316-
python3 ./scripts/update_cgmanifest.py first ../cgmanifest.json ../SPECS/helloworld.spec
313+
cd ./edge-microvisor-toolkit/toolkit
314+
python3 -m pip install -r ./scripts/requirements.txt
315+
python3 ./scripts/update_cgmanifest.py first ../cgmanifest.json ../SPECS/helloworld/helloworld.spec
317316
```
318317
319318
**Building the package and testing it locally**
320319
321320
1. Build your package by running the following command:
322321
323322
```bash
324-
make build-packages # to rebuild the packages
323+
sudo make -j8 build-packages REBUILD_TOOLS=y CONFIG_FILE= SRPM_PACK_LIST="helloworld" CONCURRENT_PACKAGE_BUILDS=8 VALIDATE_TOOLCHAIN_GPG=n
325324
```
326325
327-
2. Build the image containing the package by following the steps outlined in [Building the Edge Microvisor Toolkit Image](#build-the-edge-microvisor-toolkit-image), and pointing to your modified imageconfig file.
326+
> **NOTE:** The value of `SRPM_PACK_LIST` can be updated based on the
327+
> user-created SPEC file.
328+
329+
2. Build the image containing the package.
328330
331+
Follow the steps outlined in
332+
[Building the Edge Microvisor Toolkit Image](#build-the-edge-microvisor-toolkit-image),
333+
point to your modified imageconfig file, for example:
334+
335+
```bash
336+
sudo make image -j8 REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/edge-image.json
337+
```
329338
330339
### Example 3: Generating user passwords
331340

0 commit comments

Comments
 (0)