From 052c0cfcfff3fdd73636bffd77c2cc4fc07d7e47 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 22 Feb 2018 13:28:28 +0100 Subject: Add template sample --- build.sh | 8 ++++++++ build_rootfs.sh | 2 +- templates/hostname.tpl | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 templates/hostname.tpl diff --git a/build.sh b/build.sh index dff3be5..93783d0 100755 --- a/build.sh +++ b/build.sh @@ -30,6 +30,14 @@ properties: release: "$ver" templates: EOF + +## Add templates +# +# templates: +# /etc/hostname: +# when: +# - start +# template: hostname.tpl } build_image() { diff --git a/build_rootfs.sh b/build_rootfs.sh index fee62fc..91f7efe 100755 --- a/build_rootfs.sh +++ b/build_rootfs.sh @@ -40,7 +40,7 @@ add_file() { dst=$dst_dir/$file if test -d $src; then - test -d $dst || mkdir $dst + test -d $dst || mkdir -p $dst elif test -f $src; then cp $src $dst foo=$(dirname $file) diff --git a/templates/hostname.tpl b/templates/hostname.tpl new file mode 100644 index 0000000..69a84f1 --- /dev/null +++ b/templates/hostname.tpl @@ -0,0 +1 @@ +{{ container.name }} -- cgit v1.2.3