summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2018-02-27 23:29:59 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2018-02-27 23:29:59 +0100
commit40bffd9fce4002b48149bf690b0275d2e7e0aca1 (patch)
tree63624399fef1d0fbd645646566094247f63a6f14
parentee39be73b3e59bcd89816e3b38f5bb99da324b12 (diff)
Include extra files and fix output option
-rwxr-xr-xbuild.sh8
-rwxr-xr-xbuild_rootfs.sh11
2 files changed, 13 insertions, 6 deletions
diff --git a/build.sh b/build.sh
index 793d079..9461f5c 100755
--- a/build.sh
+++ b/build.sh
@@ -8,11 +8,11 @@ ver=17.01.4
dist=lede
usage() {
- echo "Usage: $0 [-v|--version <version>] [-p|--packages <packages>] [--help]"
+ echo "Usage: $0 [-v|--version <version>] [-p|--packages <packages>] [-f|--files] [--help]"
exit 1
}
-temp=$(getopt -o "v:p:" -l "version:,packages:,help" -- "$@")
+temp=$(getopt -o "v:p:f:" -l "version:,packages:,files:,help" -- "$@")
eval set -- "$temp"
while true; do
case "$1" in
@@ -25,6 +25,8 @@ while true; do
fi;;
-p|--packages)
packages="$2"; shift 2;;
+ -f|--files)
+ files="$2"; shift 2;;
--help)
usage;;
--)
@@ -154,7 +156,7 @@ build_tarball() {
export SDK="$(pwd)/${sdk}"
export ARCH=${arch}
export SUBARCH=${subarch}
- fakeroot ./build_rootfs.sh $rootfs $metadata -o $lxc_tar --packages="${packages}"
+ fakeroot ./build_rootfs.sh $rootfs $metadata -o $lxc_tar --packages="${packages}" --files="${files}"
}
build_metadata() {
diff --git a/build_rootfs.sh b/build_rootfs.sh
index 4eb172a..2c1a7ce 100755
--- a/build_rootfs.sh
+++ b/build_rootfs.sh
@@ -3,20 +3,22 @@
set -e
usage() {
- echo "Usage: $0 [-o|--output <dst file>] <src tar> <metadata.yaml>"
+ echo "Usage: $0 [-o|--output <dst file>] [-p|--packages <packages>] [-f|--files <files>] <src tar> <metadata.yaml>"
exit 1
}
dst_file=/dev/stdout
-temp=$(getopt -o "o:p:" -l "output:,packages:,help" -- "$@")
+temp=$(getopt -o "o:p:f:" -l "output:,packages:,files:,help" -- "$@")
eval set -- "$temp"
while true; do
case "$1" in
-p|--packages)
packages="$2"; shift 2;;
- -o)
+ -o|--output)
dst_file="$2"; shift 2;;
+ -f|--files)
+ files="$2"; shift 2;;
--help)
usage;;
--)
@@ -117,6 +119,9 @@ install_packages() {
unpack
add_files $files_dir $instroot
+if test -n "$files"; then
+ add_files $files $instroot
+fi
add_file $metadata $metadata_dir $dir
add_files templates/ $dir/templates/
add_packages bin/packages/${ARCH}/${SUBARCH}