Skip to content

Commit

Permalink
some polishing :)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-langenmaier committed Apr 28, 2017
1 parent 6924a4d commit cdb43c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
11 changes: 4 additions & 7 deletions package-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion template/cubox-i/rootfs/container-specific-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions template/cubox-i/rootfs/etc/portage/make.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

1 change: 1 addition & 0 deletions update-gentoo-base-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit cdb43c0

Please sign in to comment.