Skip to content

Instantly share code, notes, and snippets.

@therealromster
Created October 8, 2021 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealromster/e090153f3a2984428f0d60a63d58ac07 to your computer and use it in GitHub Desktop.
Save therealromster/e090153f3a2984428f0d60a63d58ac07 to your computer and use it in GitHub Desktop.
CRUX lxc container
# download crux iso image, mount and cd to it then run this to make a LXC container.
fakeroot -- /bin/bash - << 'EOF'
VERSION="$(cat crux-media)"
mkdir -p rootfs/var/lib/pkg
touch rootfs/var/lib/pkg/db
for pkg in crux/core/*.pkg.tar.xz
do
pkgadd -r rootfs "$pkg"
done
cat > metadata.yaml << EOF2
architecture: x86_64
creation_date: $(date +%s)
properties:
description: CRUX Linux $VERSION
os: CRUX
release: $VERSION
EOF2
tar -c -f - rootfs/ metadata.yaml | xz -9 > "crux-$VERSION.tar.xz"
EOF
VERSION=`cat crux-media`
lxc image import "crux-$VERSION.tar.xz" --alias "crux-$VERSION"
lxc launch crux-$VERSION crux-36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment