Skip to content

feat: Add option to build image file non-interactively#258

Open
readefries wants to merge 2 commits into
r0b0:masterfrom
readefries:feat/add-flags-to-make-image-script
Open

feat: Add option to build image file non-interactively#258
readefries wants to merge 2 commits into
r0b0:masterfrom
readefries:feat/add-flags-to-make-image-script

Conversation

@readefries
Copy link
Copy Markdown
Contributor

I wanted to be able to create disk images, so I updated the make_image.sh script to support creating an image as an option, in addition to writing directly to a USB disk.

This also includes an option to select which tasksel packages to install, so the installer can be non-interactive.

@readefries readefries force-pushed the feat/add-flags-to-make-image-script branch from 47e06ab to f74a536 Compare March 18, 2026 21:52
@readefries
Copy link
Copy Markdown
Contributor Author

readefries commented Mar 18, 2026

@r0b0 I seem to be running into an issue where the package ukify cannot be found in the backports. Did you see that happening with the images you built? Also, the firmware-qcom-soc is missing, but I was already facing that when building the image.

@readefries readefries force-pushed the feat/add-flags-to-make-image-script branch from f74a536 to 6208d50 Compare March 18, 2026 22:23
@r0b0
Copy link
Copy Markdown
Owner

r0b0 commented Mar 19, 2026

@r0b0 I seem to be running into an issue where the package ukify cannot be found in the backports. Did you see that happening with the images you built? Also, the firmware-qcom-soc is missing, but I was already facing that when building the image.

Hi, This might be bacause you switched from apt to apt-get. I find apt to be better at handling cases such as a package not yet available in the backports etc. I found firmware-qcom-soc in the backports, but not systemd-ukify

Comment thread installer.sh
cryptsetup luksUUID "${main_partition}" > luks.uuid
root_uuid=$(cat luks.uuid)
# Add LUKS parameters to kernel cmdline
kernel_params="rd.luks.uuid=${root_uuid} rd.luks.name=${root_uuid}=${luks_device_name} rd.luks.options=tpm2-device=auto root=${root_device} ${kernel_params}"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think you can leave rd.luks.uuid out when you use rd.luks.name. No biggie, just reduces the number of options.

Comment thread README.md Outdated
@@ -0,0 +1,3 @@
# Build full initramfs with all drivers instead of host-only
# This ensures the initramfs works across different hardware configurations
hostonly="no"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There already is a hostonly="no" in 90-odin.conf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was needed, as during my tests installing a new system it didn't work when this wasn't added

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

That is weird because your are not in fact copying your 10-no-hostonly.conf file to the actual image (using install_file()), are you?

@readefries
Copy link
Copy Markdown
Contributor Author

@r0b0 I seem to be running into an issue where the package ukify cannot be found in the backports. Did you see that happening with the images you built? Also, the firmware-qcom-soc is missing, but I was already facing that when building the image.

Hi, This might be bacause you switched from apt to apt-get. I find apt to be better at handling cases such as a package not yet available in the backports etc. I found firmware-qcom-soc in the backports, but not systemd-ukify

No, that doesn't change the result. The only reason I used apt-get, is that I now apt is not script safe. But I can just remove that.

@readefries readefries force-pushed the feat/add-flags-to-make-image-script branch 3 times, most recently from 1875cc1 to a8162b1 Compare April 2, 2026 09:26
…r the root file system, so the new kernel also boots
… with options to feed settings via environment variables

Signed-off-by: Hendrik Bruinsma <hbruinsma@xs4some.nl>
@readefries readefries force-pushed the feat/add-flags-to-make-image-script branch from a8162b1 to 42973db Compare April 2, 2026 09:29
Comment thread make_image.sh
# In containers, /dev/loopN nodes can be sparse (for example missing loop1).
# Try explicitly to attach using existing block devices.
for loop_dev in /dev/loop[0-9]*; do
if [[ "${loop_dev}" =~ p[0-9]+$ ]]; then
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I am sorry, what does this do?

Comment thread README.md

Build compiled components with:

./build-compiled-components.sh
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

./internal-tools/build-compiled-components.sh

Comment thread make_image.sh
exit 1
fi
DISK=${LOOP_DEVICE}
udevadm settle
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Maybe move this block after the install required packages block to make sure udevadm is actually installed at this point

Comment thread README.md
Minimal host/VM package set for `make_image.sh`:

sudo apt update
sudo apt install -y btrfs-progs debootstrap dosfstools golang-go kpartx npm systemd-repart udev uuid-runtime
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

No need to point this out for the user; the script will install these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants