summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2018-02-22 14:34:31 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2018-02-22 14:34:31 +0100
commit7892a82d9a2379fc1b7f185eaf736ba87816568f (patch)
tree47f532767e180a17afeb75779cc6ae094cf7cec9
parentd1bbed8fd5ec86002390288a4d2e00cc8bad7f40 (diff)
Refactor rootfs variable
-rwxr-xr-xbuild_rootfs.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/build_rootfs.sh b/build_rootfs.sh
index 91f7efe..ff5a6a6 100755
--- a/build_rootfs.sh
+++ b/build_rootfs.sh
@@ -14,11 +14,12 @@ dst_file=$3
base=`basename $src_tar`
dir=/tmp/build.$$
files_dir=files/
-export IPKG_INSTROOT=$dir/rootfs
+instroot=$dir/rootfs
+export IPKG_INSTROOT=$instroot
unpack() {
- mkdir -p $dir/rootfs
- cat $src_tar | (cd $dir/rootfs && tar -xz)
+ mkdir -p $instroot
+ cat $src_tar | (cd $instroot && tar -xz)
}
pack() {
@@ -47,7 +48,7 @@ add_file() {
if [ "$foo" = "./etc/init.d" ]; then
echo Enabling $file
set +e
- sh $dir/rootfs/etc/rc.common $src enable
+ sh $instroot/etc/rc.common $src enable
set -e
fi
fi
@@ -63,7 +64,7 @@ add_files() {
}
unpack
-add_files $files_dir $dir/rootfs/
+add_files $files_dir $instroot
add_file $metadata $metadata_dir $dir
add_files templates/ $dir/templates/
pack