From cdb43c01a830a9cae7d5296167c942e0d93bdf68 Mon Sep 17 00:00:00 2001 From: Stefan Langenmaier Date: Fri, 28 Apr 2017 13:35:01 -0400 Subject: [PATCH] some polishing :) --- package-container.sh | 11 ++++------- template/cubox-i/rootfs/container-specific-setup.sh | 2 +- template/cubox-i/rootfs/etc/portage/make.conf | 4 ++++ update-gentoo-base-container.sh | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package-container.sh b/package-container.sh index 2c3baa5..5cdf322 100644 --- a/package-container.sh +++ b/package-container.sh @@ -5,11 +5,8 @@ set -eux CONTAINER_NAME=cubox-i mountpoint -q /mnt/full-root/ || mount /mnt/full-root -btrfs sub snap /mnt/full-root/vols/${CONTAINER_NAME} /mnt/full-root/vols/${CONTAINER_NAME}-temp -btrfs sub create /mnt/full-root/vols/${CONTAINER_NAME}-temp/newrootfs -mv /mnt/full-root/vols/${CONTAINER_NAME}-temp/rootfs/* /mnt/full-root/vols/${CONTAINER_NAME}-temp/newrootfs/ -btrfs property set -ts /mnt/full-root/vols/${CONTAINER_NAME}-temp/newrootfs ro true +btrfs sub snap /mnt/full-root/vols/${CONTAINER_NAME}/rootfs /mnt/full-root/vols/${CONTAINER_NAME}/rootfs-temp +btrfs property set -ts /mnt/full-root/vols/${CONTAINER_NAME}/rootfs-temp ro true mkdir -p .packaged-subvolumes -btrfs send -vvv /mnt/full-root/vols/${CONTAINER_NAME}-temp/newrootfs | xz > .packaged-subvolumes/${CONTAINER_NAME}.xz -btrfs sub delete /mnt/full-root/vols/${CONTAINER_NAME}-temp/newrootfs -btrfs sub delete /mnt/full-root/vols/${CONTAINER_NAME}-temp +btrfs send -vvv /mnt/full-root/vols/${CONTAINER_NAME}/rootfs-temp | xz > .packaged-subvolumes/${CONTAINER_NAME}.xz +btrfs sub delete /mnt/full-root/vols/${CONTAINER_NAME}/rootfs-temp diff --git a/template/cubox-i/rootfs/container-specific-setup.sh b/template/cubox-i/rootfs/container-specific-setup.sh index 64879f7..bbb2823 100644 --- a/template/cubox-i/rootfs/container-specific-setup.sh +++ b/template/cubox-i/rootfs/container-specific-setup.sh @@ -3,7 +3,7 @@ rc-update add sshd default rc-update add ntp-client default rc-update add ddclient default -rc-update add ddclient libvirtd default +rc-update add libvirtd default cd /etc/init.d && ln -s net.lo net.eth0 rc-update add net.eth0 boot diff --git a/template/cubox-i/rootfs/etc/portage/make.conf b/template/cubox-i/rootfs/etc/portage/make.conf index b31a7e1..55760cf 100644 --- a/template/cubox-i/rootfs/etc/portage/make.conf +++ b/template/cubox-i/rootfs/etc/portage/make.conf @@ -10,3 +10,7 @@ DISTDIR="${PORTDIR}/distfiles" VIDEO_CARDS="" FEATURES="binpkg-multi-instance buildpkg" + +# enable this to use built binary packages +EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --usepkg" + diff --git a/update-gentoo-base-container.sh b/update-gentoo-base-container.sh index c3a1045..2146938 100644 --- a/update-gentoo-base-container.sh +++ b/update-gentoo-base-container.sh @@ -3,6 +3,7 @@ set -eux CONTAINER_NAME=gentoo-base-container +#CONTAINER_NAME=cubox-i mountpoint -q /mnt/full-root/ || mount /mnt/full-root/ #|| die "Failed mounting full root" mountpoint -q /var/lib/lxc/${CONTAINER_NAME} || mount -o subvol=vols/${CONTAINER_NAME} /dev/mmcblk1p3 /var/lib/lxc/${CONTAINER_NAME}