Skip to content

Instantly share code, notes, and snippets.

@fenrig
Created March 11, 2019 10:32
Show Gist options
  • Save fenrig/9095e2968ae45150fe3d8de2cf00fa82 to your computer and use it in GitHub Desktop.
Save fenrig/9095e2968ae45150fe3d8de2cf00fa82 to your computer and use it in GitHub Desktop.
#! /bin/bash
ROOTFS_DIR="rootfs"
ROOTFS_TAR=""
METADATA_YAML="metadata.yaml"
METADATA_TAR=""
if [ -z "$METADATA_TAR" ]
then
echo "Generate METADATA_TAR"
METADATA_TAR="metadata.tar.xz"
tar -cJf $METADATA_TAR $METADATA_YAML
else
echo "Pre generated METADATA_TAR"
fi
if [ -z "$ROOTFS_TAR" ]
then
echo "Generate ROOTFS_TAR"
ROOTFS_TAR="rootfs.tar.xz"
tar -cJf $ROOTFS_TAR -C $ROOTFS_DIR .
else
echo "Pre generated ROOTFS_TAR"
fi
#lxc image import $METADATA_TAR $ROOTFS_TAR --alias lxc_domoticz_buildroot
lxc-create lxc_domoticz_buildroot -t local -- --fstree $ROOTFS_TAR --metadata $METADATA_TAR
exit 0
architecture: armv7
creation_date: 1552061064
properties:
description: buildroot domoticz
os: buildroot
release: domoticz
distribution: buildroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment