From 7892a82d9a2379fc1b7f185eaf736ba87816568f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 22 Feb 2018 14:34:31 +0100 Subject: Refactor rootfs variable --- build_rootfs.sh | 11 ++++++----- 1 file 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 -- cgit v1.2.3