Getting started on Windows
Set up your development environment with the prerequisite tools and repositories you need to quickly start building AutoSD images in either a preconfigured container or a virtual machine (VM).
Prerequisites
- A machine running 64-bit Windows 8.1 or later
pacmanpackage manager from MSYM2- A local clone of the AutoSD sample-images repository
Quick start: Building AutoSD images using a preconfigured development container
You can use the preconfigured AutoSD development container as a lightweight base development environment if you want to
build an AutoSD image without launching and configuring a development VM.
This container includes systemd, the AutoSD container orchestration tool bluechi, automotive-image-builder, and other development tools.
Procedure
-
Install Podman 5:
$ pacman -S mingw-w64-podman -
From the
sample-imagesdirectory, launch theautomotive-image-buildercontainer by specifying$PWD:/hostto mount thesample-imagesdirectory in the/hostdirectory inside the container:$ cd sample-images$ sudo podman run -it -v /dev:/dev -v /root:/root -v $PWD:/host --rm --privileged --pull=newer \
--security-opt label=type:unconfined_t quay.io/centos-sig-automotive/automotive-image-builder -
Copy the
sample-imagesrepository on the host to the container:# cp -r /host /root -
Run
automotive-image-builderfrom a container using either the shell script or your local application.-
To quickly run
automotive-image-builderfrom a container without installing or configuring any other dependencies, run the following shell script from thesample-images/directory within your local clone of the AutoSD sample-images repository:$ sudo automotive-image-builder build --target qemu --mode image \
--distro autosd9 --arch x86_64 --export ````<file_type>```` images/`````<manifest-name>`````.mpp.yml ````<my-image>````.````<file_type>```` -
To have the build pull a containerized version of OSBuild, run your locally installed and configured
automotive-image-builder.$ sudo automotive-image-builder build --mode image --target qemu \
--export ````<file_type>```` ../images/`````<manifest-name>`````.mpp.yml ````<my-image>````.````<file_type>````
-
-
Change to the
/root/host/sample-images/automotive-image-builderdirectory:$ cd /root/host/sample-images/automotive-image-builder -
Move your image file from
/root/host/automotive-image-builderto the/hostdirectory, so that you can access it in thesample-imagesdirectory outside of the container:$ mv ````<my-image>````.````<file_type>```` /host -
Exit the container:
$ exit
Quick start: Booting prebuilt AutoSD images in a QEMU VM
A virtualized AutoSD development environment is similar to a AutoSD production environment. The virtualized platform is useful for building and testing applications intended to run on a AutoSD system or to build new AutoSD images that you can flash onto automotive hardware or use on other systems.
Download and uncompress a prebuilt AutoSD operating system (OS) image, and then launch a VM from the image. This VM is your development environment, where you can customize and build your own AutoSD images.
All prebuilt AutoSD images can be found in the nightly repo. For more information, see Sample OS images. To explore the sample images, see sample images.
In this example, use the developer image for either x86 or aarch64. The developer image has extra storage compared to other images.
Procedure
-
$ pacman -S mingw-w64-ucrt-x86_64-qemu
$ pacman -S ming-w64-x86_64-xz -
Identify the name of the latest nightly image for your host architecture, and store the value in a variable called
AUTOSD_IMAGE_NAME.!!! note
The Automotive SIG uploads images every day using unique build IDs, which causes the name of the image to change frequently. For more information about available nightly images, their purposes, and their naming conventions, see Sample OS images.
- If your host machine has an
x86_64CPU, retrieve the name of the latestx86_64image:
$ export AUTOSD_IMAGE_NAME="$(curl https://autosd.sig.centos.org/AutoSD-9/nightly/sample-images/ | \
grep -oE 'auto-osbuild-qemu-autosd9-developer-regular-x86_64-([0-9]+)\.([A-Za-z0-9]+)\.qcow2\.xz' | \
head -n 1)"- If your host machine has an
aarch64SoC, retrieve the name of the latestaarch64image:
$ export AUTOSD_IMAGE_NAME="$(curl https://autosd.sig.centos.org/AutoSD-9/nightly/sample-images/ | \
grep -oE 'auto-osbuild-qemu-autosd9-developer-regular-aarch64-([0-9]+)\.([A-Za-z0-9]+)\.qcow2\.xz' | \
head -n 1)" - If your host machine has an
-
Download the image:
$ curl -o autosd9-developer-regular-x86_64.qcow2.xz https://autosd.sig.centos.org/AutoSD-9/nightly/sample-images/$AUTOSD_IMAGE_NAME -
Uncompress the compressed
.xzimage file:$ xz -d autosd9-developer-regular-x86_64.qcow2.xz -
To launch a VM from the image, run the
automotive-image-runnerscript from the theautomotive-image-builderdirectory of your local clone of the AutoSD sample-images repository:$ sudo automotive-image-runner ````<path>````/autosd9-developer-regular-x86_64.qcow2 -
Log in as the
rootuser with the default password,password.!!! NOTE To enable ssh access, you must set
PasswordAuthentication yesin/etc/ssh/sshd_config. Then you can access the machine withssh -p 2222 -o "UserKnownHostsFile=/dev/null" guest@localhost.
Quick start: Building customized AutoSD images in a QEMU VM
Repeat the procedure in
Quick start: Booting prebuilt AutoSD images in a QEMU VM,
to download and run the latest nightly developer image, which has extra storage compared to the other sample images. Then, expand
the disk size, so you can use the automotive-image-builder tool to create customized system images using your custom manifest .mpp.yml file.
For more information about the preconfigured manifest files the Automotive SIG provides as starter examples you can modify, see the Automotive Image Builder example manifests.
For more in-depth information about how to package your applications and embed them in a customized manifest you can then use to generate your customized OS image, see Packaging applications with RPM and Embedding RPM packages in the AutoSD image sections.
Prerequisites
- The latest nightly
autosd9-dev-reg-x86_64.qcow2image
Procedure
-
Extend the virtual disk of your
.qcow2development image, so that you have enough space to build your custom AutoSD images and facilitate your development work.-
On the host, resize your development image. In this example, set the disk size to
30G, which is 30GiB:$ qemu-img resize autosd9-dev-reg-x86_64.qcow2 30G -
Launch your virtual AutoSD development environment:
$ sudo automotive-image-runner autosd9-dev-reg-x86_64.qcow2 -
Log in with the
guestuser and the default passwordpassword. Therootuser password is alsopassword.
-
-
Install the
partedpartition management tool:$ dnf -y install parted-
Run
partedto extend the size of/dev/vda$ parted /dev/vda -
Resize the
/dev/vda3partition to fill the space available to that partition:$ resizepart 3 100% -
Enter
quitto exit thepartedtool.(parted) quit -
Enlarge the file system:
$ resize2fs /dev/vda3
-
-
In your development VM, create a custom automotive image builder manifest file you can configure according to your requirements:
-
Change to the
automotive-image-builderdirectory:$ cd sample-images/automotive-image-builder -
Create a custom automotive image builder manifest file:
$ touch ````<my-manifest>````.aib.yml -
Build the OS image from your custom
my-manifest.mpp.ymlin your preferred file format:$ sudo automotive-image-builder build --mode package --target qemu \
--export qcow2 ````<my-manifest>````.aib.yml ````<my-image>````.````<file_type>````
!!! NOTE For more information about the export file types
automotive-image-buildersupports, see Export formats in theautomotive-image-builderoptions section.For more information about image naming conventions, see AutoSD sample images.
!!! NOTE If you build multiple images, you must run
make cleananddnf clean allbetween builds to clear build artifacts and reset the DNF cache. -
-
Export the image file to the host.
-
On the host, launch a VM from your new image:
$ sudo automotive-image-runner ````<my-image>````.````<file_type>````
For more information about how to build your own customized AutoSD images, see Building and running your customized OS image.