-
Notifications
You must be signed in to change notification settings - Fork 28
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
Implementing aarch64 image build capabilities #475
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,17 @@ set -euo pipefail | |
# | ||
# Guestfish Command Documentation: https://libguestfs.org/guestfish.1.html | ||
|
||
# In x86_64, the default root partition is the third partition | ||
ROOT_PART=/dev/sda3 | ||
|
||
# Make the necessarry adaptations for aarch64 | ||
if [[ $(uname -m) == "aarch64" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should use the variable that’s set to the arch in the image definition file and then template it in as it allows us to remove this if check and just rely on a single variable which is a little bit safer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I vote for doing this too - we should be able to simplify the script and move everything to Go code. |
||
if ! test -f /dev/kvm; then | ||
export LIBGUESTFS_BACKEND_SETTINGS=force_tcg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally believe that this should be the default behavior. Getting KVM to work in a container (in my experience) has been very error prone and while investigating the x86 EIB builds, I found that it resorts to “tcg” anyway so my opinion is that we just make use force_tcg as the default and avoid KVM. |
||
fi | ||
ROOT_PART=/dev/sda2 | ||
fi | ||
|
||
# Test the block size of the base image and adapt to suit either 512/4096 byte images | ||
BLOCKSIZE=512 | ||
if ! guestfish -i --blocksize=$BLOCKSIZE -a {{.ImagePath}} echo "[INFO] 512 byte sector check successful."; then | ||
|
@@ -26,7 +37,7 @@ fi | |
{{ if ne .DiskSize "" -}} | ||
truncate -r {{.ImagePath}} {{.ImagePath}}.expanded | ||
truncate -s {{.DiskSize}} {{.ImagePath}}.expanded | ||
virt-resize --expand /dev/sda3 {{.ImagePath}} {{.ImagePath}}.expanded | ||
virt-resize --expand $ROOT_PART {{.ImagePath}} {{.ImagePath}}.expanded | ||
cp {{.ImagePath}}.expanded {{.ImagePath}} | ||
rm -f {{.ImagePath}}.expanded | ||
{{ end }} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much space does this package take up? If it's trivial, it may make sense to go ahead and install the aarch64 emulator in the x86 image as well to make working on cross complications easier in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we already do in the downstream builds.