commit e7bad1176496d212a70e8235f800f988619c4a0a
parent 905a2a8672395f3d2f7e4051946b319111c7e84e
Author: parazyd <parazyd@dyne.org>
Date: Sun, 8 May 2016 12:43:52 +0200
custom script support
Diffstat:
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/arm/extra/scrinclude/README b/arm/extra/scrinclude/README
@@ -0,0 +1,4 @@
+include scripts here you wish to execute in the third-stage, after finishing the
+system installation. the scripts will be sourced so call what you need.
+
+the naming scheme should be `foo.sh`
diff --git a/arm/profiles/common-devuan b/arm/profiles/common-devuan
@@ -151,10 +151,23 @@ copy-pkginclude() {
}
}
+copy-cust() {
+ fn copy-cust
+
+ sudo mkdir ${writebase}/cust
+ scrincludes=`find $R/arm/extra/scrinclude -type f -name "*.sh"`
+ [[ -z $scrincludes ]] || {
+ for i in ${scrincludes}; do
+ sudo cp -v ${i} ${writebase}/cust/
+ done
+ }
+}
+
write-third-stage() {
fn write-third-stage
copy-pkginclude
+ copy-cust
cat <<EOF | sudo tee ${writebase}/third-stage
#!/bin/bash
@@ -183,6 +196,7 @@ apt-get --yes --force-yes install ${extra_packages}
apt-get --yes --force-yes dist-upgrade
for package in `find /pkginclude`; do
+ # TODO: check resolution of deps
dpkg -i $package
done
@@ -196,7 +210,12 @@ rm -fv /usr/sbin/policy-rc.d
rm -fv /usr/sbin/invoke-rc.d
dpkg-divert --remove --rename /usr/sbin/invoke-rc.d
+for script in `find /cust`; do
+ source $script
+done
+
rm -rfv /pkginclude/
+rm -rfv /cust/
rm -fv /third-stage
EOF
sudo chmod +x $writebase/third-stage