Skip to content

Add iso2lxc: convert TurnKey ISO to Proxmox LXC template#46

Open
marcos-mendez wants to merge 1 commit intoturnkeylinux-apps:masterfrom
popsolutions:master
Open

Add iso2lxc: convert TurnKey ISO to Proxmox LXC template#46
marcos-mendez wants to merge 1 commit intoturnkeylinux-apps:masterfrom
popsolutions:master

Conversation

@marcos-mendez
Copy link
Copy Markdown

Summary

Add iso2lxc utility to /usr/local/sbin/ for converting TurnKey product ISOs into Proxmox-compatible LXC container templates.

Usage

cd /turnkey/fab/products/moodle
make
iso2lxc
# Output: build/debian-13-turnkey-moodle_19.0-1_amd64.tar.gz

What it does

  • Extracts squashfs from product ISO
  • Removes device nodes, kernel modules, and mount points that break unprivileged LXC containers
  • Creates minimal /dev structure with symlinks (no mknod)
  • Masks kernel-dependent systemd services
  • Packages as .tar.gz following TKL naming convention
  • Auto-detects product name and version from changelog

Tested

Built and deployed Moodle v19 as unprivileged LXC on Proxmox 6.8.

Extracts squashfs from product ISO and repackages as a Proxmox-compatible
LXC container template (.tar.gz), following TKL naming convention.
Removes device nodes, kernel modules, and mount points that break
unprivileged containers. Masks kernel-dependent systemd services.

Usage: run 'iso2lxc' from any product directory after 'make'.
Output: build/debian-{VER}-turnkey-{APP}_{TKLVER}-{REV}_{ARCH}.tar.gz
@JedMeister
Copy link
Copy Markdown
Member

Thanks for your mate. But I'm guessing that you missed https://github.com/turnkeylinux/buildtasks? Explicitly bt-container . It's probably poorly named and would be better named bt-lxc or perhaps even bt-pve-lxc - but that's the script that we use to build the existing PVE templates.

FYI when we publish all apps, we use the top level bt-* tools in that buildtasks repo to do the release builds. They don't have the flexibility that your script provides as they're intended to be completely non-interactive for app batch builds, but it does the job.

The only caveat is that it expects an existing iso with our iso naming convention. E.g. turnkey-core-19.0-trixie-amd64.iso - although by default if it doesn't find one, it should build one. I.e. clones the build code (or pulls the latest commits if it exists already), builds to product.iso, renames it, generates the iso release files and then builds the proxmox template.

TBH that repo has accumulated a lot of cruft over the years and ideally I'd like to consolidate, clean and update it all; then package it, but it works...

I'm totally open to you building on those to make them more flexible for your needs, but I'd rather keep all the build stuff together.

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