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

make LIVE_PKG=<pkg> live #3842

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,22 @@ The current process uses the control knob `PLATFORM` in the following places in
* As the first argument to [prepare-platform.sh](../tools/prepare-platform.sh) in the Makefile targets for `live.*`, `installer.*` and `verification.*`, which, in turn, uses it to add specific files to the build and output directories prior to making the final image.
* In the final eve image `lf-edge/eve`, specifically the entrypoint [runme.sh](../pkg/eve/runme.sh), where the platform is passed as `-p` argument when calling `docker run`, and is used to modify the final layout.

### Note for a developer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think "Notes for developers" sounds better...


`make live` typically requires a significant amount of time, approximately 3 minutes, to generate a tarball and the resulting squashfs image. This delay can be frustrating during daily development cycles of code compilation, live testing, and iteration. For developers who are less patient, optimizing the live image build process is essential. This optimization entails a few adjustments to the build procedure:

1. Creating a live image with an EXT4 root filesystem. The live command also supports the EXT4 format for the root filesystem, resulting in a larger image size. However, this format allows for a mutable root filesystem, enabling it to be remounted with read-write (RW) options. This flexibility provides greater freedom during EVE runtime as well as during the live image creation, facilitating on-the-fly modifications to the image instead of requiring a complete rebuild from scratch. First you need to create a live image with EXT4 as the following:

`make ROOTFS_FORMAT=ext4 live`

1. To streamline the generation of an up-to-date live image, especially during iterative development cycles, you can patch the EXT4 partition with only the necessary package, such as `pkg/pillar`. This approach minimizes the time required for generating the live image. Below is the command for patching the EXT4 live image generated by the previous command:

`make LIVE_PKG=pkg/pillar live`

The command generates the rootfs tarball consisting only from the `pkg/pillar` and patches the live image using the `guestfish` one-liner (check the main Makefile for details).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

.... and patches the live image using the guestfish one-liner tool (which must be installed in the system, check the Makefile for details).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, will this work if run on a cloud provider? AWS for example doesn't support nested virtualization; doesn't guestfish spin up a VM?


This approach reduces creation of the resulting live image from 3 minutes to 20 seconds (approximately).

### Generating any yml

Note that the process above can be used to generate any yml file, not just `rootfs-$(HV).yml`. As long as
Expand Down
Loading