allow for multiple scripts in chroot-script
This commit is contained in:
parent
420ba85a32
commit
8550bd6072
2
config
2
config
|
|
@ -24,7 +24,7 @@ arrs+=(core_packages base_packages purge_packages blend_packages)
|
||||||
|
|
||||||
os="devuan"
|
os="devuan"
|
||||||
release="jessie"
|
release="jessie"
|
||||||
version="1.0.0-beta2.rc1"
|
version="1.0.0-beta2"
|
||||||
mirror="http://auto.mirror.devuan.org/merged"
|
mirror="http://auto.mirror.devuan.org/merged"
|
||||||
section="main"
|
section="main"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# 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/>.
|
# 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`}
|
LIBPATH=${LIBPATH:-`dirname $0`}
|
||||||
|
|
||||||
source $LIBPATH/config
|
source $LIBPATH/config
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,7 @@ bootstrap_complete_base() {
|
||||||
|
|
||||||
devprocsys mount $strapdir || zerr
|
devprocsys mount $strapdir || zerr
|
||||||
|
|
||||||
chroot-script -d thirdstage || zerr
|
chroot-script -d thirdstage cleanup || zerr
|
||||||
chroot-script -d cleanup || zerr
|
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
devprocsys umount $strapdir || zerr
|
devprocsys umount $strapdir || zerr
|
||||||
|
|
@ -90,7 +89,7 @@ rm -f /thirdstage
|
||||||
rm -f /etc/ssh/*_key
|
rm -f /etc/ssh/*_key
|
||||||
rm -f /etc/ssh/*.pub
|
rm -f /etc/ssh/*.pub
|
||||||
rm -f /root/.bash_history
|
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
|
## our file for which we check the bootstrap is complete
|
||||||
echo "1" > .done
|
echo "1" > .done
|
||||||
rm -f /cleanup
|
rm -f /cleanup
|
||||||
|
|
|
||||||
|
|
@ -249,23 +249,29 @@ EOF
|
||||||
chroot-script() {
|
chroot-script() {
|
||||||
fn chroot-script "$@"
|
fn chroot-script "$@"
|
||||||
|
|
||||||
notice "chrooting for script $@"
|
case "x$1" in
|
||||||
|
x-d)
|
||||||
|
shift 1
|
||||||
|
local scripts="$@"
|
||||||
|
|
||||||
if [[ "$1" == "-d" ]]; then
|
dpkgdivert on $strapdir
|
||||||
shift 1
|
for i in $scripts; do
|
||||||
local _script="$1"
|
notice "chrooting to execute $i..."
|
||||||
|
sudo chmod +x $strapdir/$i
|
||||||
dpkgdivert on $strapdir
|
sudo -E chroot $strapdir /$i
|
||||||
sudo chmod +x $strapdir/$_script
|
done
|
||||||
sudo -E chroot $strapdir /$_script
|
dpkgdivert off $strapdir
|
||||||
dpkgdivert off $strapdir
|
;;
|
||||||
else
|
*)
|
||||||
local _script="$1"
|
local scripts="$@"
|
||||||
|
|
||||||
sudo chmod +x $strapdir/$_script
|
|
||||||
sudo -E chroot $strapdir /$_script
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
for i in $scripts; do
|
||||||
|
notice "chrooting to execute $i..."
|
||||||
|
sudo chmod +x $strapdir/$i
|
||||||
|
sudo -E chroot $strapdir /$i
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
silly() {
|
silly() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue