allow for multiple scripts in chroot-script

This commit is contained in:
parazyd 2016-12-18 14:47:23 +01:00
parent 420ba85a32
commit 8550bd6072
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
4 changed files with 25 additions and 20 deletions

2
config
View File

@ -24,7 +24,7 @@ arrs+=(core_packages base_packages purge_packages blend_packages)
os="devuan"
release="jessie"
version="1.0.0-beta2.rc1"
version="1.0.0-beta2"
mirror="http://auto.mirror.devuan.org/merged"
section="main"

View File

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
libdevuansdk_version="0.2"
libdevuansdk_version="0.3"
LIBPATH=${LIBPATH:-`dirname $0`}
source $LIBPATH/config

View File

@ -70,8 +70,7 @@ bootstrap_complete_base() {
devprocsys mount $strapdir || zerr
chroot-script -d thirdstage || zerr
chroot-script -d cleanup || zerr
chroot-script -d thirdstage cleanup || zerr
sleep 1
devprocsys umount $strapdir || zerr
@ -90,7 +89,7 @@ rm -f /thirdstage
rm -f /etc/ssh/*_key
rm -f /etc/ssh/*.pub
rm -f /root/.bash_history
rm -f /usr/bin/qemu-arm-static
#rm -f /usr/bin/qemu-arm-static
## our file for which we check the bootstrap is complete
echo "1" > .done
rm -f /cleanup

View File

@ -249,23 +249,29 @@ EOF
chroot-script() {
fn chroot-script "$@"
notice "chrooting for script $@"
case "x$1" in
x-d)
shift 1
local scripts="$@"
if [[ "$1" == "-d" ]]; then
shift 1
local _script="$1"
dpkgdivert on $strapdir
sudo chmod +x $strapdir/$_script
sudo -E chroot $strapdir /$_script
dpkgdivert off $strapdir
else
local _script="$1"
sudo chmod +x $strapdir/$_script
sudo -E chroot $strapdir /$_script
fi
dpkgdivert on $strapdir
for i in $scripts; do
notice "chrooting to execute $i..."
sudo chmod +x $strapdir/$i
sudo -E chroot $strapdir /$i
done
dpkgdivert off $strapdir
;;
*)
local scripts="$@"
for i in $scripts; do
notice "chrooting to execute $i..."
sudo chmod +x $strapdir/$i
sudo -E chroot $strapdir /$i
done
;;
esac
}
silly() {