Lines 275-280
Link Here
|
275 |
container_setup() { |
275 |
container_setup() { |
276 |
printf "##### container_setup(): starting container setup\n" |
276 |
printf "##### container_setup(): starting container setup\n" |
277 |
|
277 |
|
|
|
278 |
[ -z "${path}" ] || mkdir -p "${path}" || die 1 "Error: mkdir -p ${path} failed\n" |
279 |
|
278 |
#in most cases lxc-create should have provided a copy of default lxc.conf |
280 |
#in most cases lxc-create should have provided a copy of default lxc.conf |
279 |
#let's tag where template starts, or just create the files |
281 |
#let's tag where template starts, or just create the files |
280 |
echo '### lxc-gentoo template stuff starts here' >> "$path/config" |
282 |
echo '### lxc-gentoo template stuff starts here' >> "$path/config" |
Lines 307-313
Link Here
|
307 |
|
309 |
|
308 |
printf "###### container_setup(): container should be ready to start!\n" |
310 |
printf "###### container_setup(): container should be ready to start!\n" |
309 |
printf "\n\n" |
311 |
printf "\n\n" |
310 |
printf "You could now use you container with: lxc-start -n %s\n" "${name}" |
312 |
printf "You could now use you container with: lxc-start -n %s -f %s\n" "${name}" "${path}/config" |
311 |
printf "little things you should know about your container:\n" |
313 |
printf "little things you should know about your container:\n" |
312 |
printf "${user_message}" |
314 |
printf "${user_message}" |
313 |
return 0 |
315 |
return 0 |
Lines 338-343
Link Here
|
338 |
container_rootfs() |
340 |
container_rootfs() |
339 |
{ |
341 |
{ |
340 |
printf "#### container_rootfs(): copying rootfs %s from cache %s ...\n" "${rootfs}" "${cachefs}" |
342 |
printf "#### container_rootfs(): copying rootfs %s from cache %s ...\n" "${rootfs}" "${cachefs}" |
|
|
343 |
mkdir -p "${rootfs}" || die 1 "Error: mkdir -p ${rootfs} failed" |
341 |
tar -c -f - -C "${cachefs}" . | tar -x -p -f - -C "${rootfs}" || die 1 "Error: cache copy to rootfs failed" |
344 |
tar -c -f - -C "${cachefs}" . | tar -x -p -f - -C "${rootfs}" || die 1 "Error: cache copy to rootfs failed" |
342 |
|
345 |
|
343 |
printf "chroot test..." |
346 |
printf "chroot test..." |
Lines 703-712
Link Here
|
703 |
|
706 |
|
704 |
usage() |
707 |
usage() |
705 |
{ |
708 |
{ |
|
|
709 |
pp=$(basename $1) |
706 |
cat <<EOF |
710 |
cat <<EOF |
707 |
$1 -h|--help [-a|--arch <arch>] [-v|--variant <variant>] [-P|--private-portage] [--portage-dir <protagedir>] [-t|--tarball <stage3file>] |
711 |
|
|
|
712 |
$pp -h|--help [-a|--arch <arch>] [-v|--variant <variant>] [-P|--private-portage] [--portage-dir <protagedir>] [-t|--tarball <stage3file>] |
708 |
[-F|--flush-cache] [-c|--cache-only] [-u|--user <username>] [-w|--password <password>] [--autologin] [-S|--auth-key <keyfile>] |
713 |
[-F|--flush-cache] [-c|--cache-only] [-u|--user <username>] [-w|--password <password>] [--autologin] [-S|--auth-key <keyfile>] |
709 |
[-s|--settings <name>] [-m|--mirror <gentoomirror>] [--tty <number>] |
714 |
[-s|--settings <name>] [-m|--mirror <gentoomirror>] [--tty <number>] [--rootfs <path> ] [-p|--path <path> ] --name <name> |
|
|
715 |
|
716 |
name: Name of LXC container |
717 |
|
718 |
rootfs: path to LXC root FS, default /rootfs |
719 |
|
720 |
path: path to LXC config file, default / |
710 |
|
721 |
|
711 |
arch: the container architecture (e.g. amd64): defaults to host arch (currently: '${arch}') |
722 |
arch: the container architecture (e.g. amd64): defaults to host arch (currently: '${arch}') |
712 |
If you choose one that needs emulation |
723 |
If you choose one that needs emulation |
Lines 746-752
Link Here
|
746 |
settings: choose common configuration (currently: '${settings}') |
757 |
settings: choose common configuration (currently: '${settings}') |
747 |
see ${LXC_TEMPLATE_CONFIG}/gentoo.*.conf |
758 |
see ${LXC_TEMPLATE_CONFIG}/gentoo.*.conf |
748 |
Available settings: |
759 |
Available settings: |
749 |
$(ls -1 ${LXC_TEMPLATE_CONFIG}/gentoo.*.conf | xargs basename -a -s .conf | sed 's/^gentoo.//') |
760 |
$(ls -1 ${LXC_TEMPLATE_CONFIG}/gentoo.*.conf | xargs basename -a -s .conf | sed 's/^gentoo.//') |
750 |
|
761 |
|
751 |
mirror: gentoo mirror for download (currently: '${mirror}') |
762 |
mirror: gentoo mirror for download (currently: '${mirror}') |
752 |
|
763 |
|
Lines 793-798
Link Here
|
793 |
esac |
804 |
esac |
794 |
done |
805 |
done |
795 |
|
806 |
|
|
|
807 |
[ -z "${name}" ] && die 8 "Error: --name mandatory\n" |
808 |
|
796 |
cacheroot="/var/cache/lxc/gentoo" |
809 |
cacheroot="/var/cache/lxc/gentoo" |
797 |
portage_cache="${cacheroot}/portage.tbz" |
810 |
portage_cache="${cacheroot}/portage.tbz" |
798 |
cachefs="${cacheroot}/rootfs-${arch}-${variant}" |
811 |
cachefs="${cacheroot}/rootfs-${arch}-${variant}" |