tcustom script support - arm-sdk - os build toolkit for various embedded devices HTML git clone https://git.parazyd.org/arm-sdk DIR Log DIR Files DIR Refs DIR Submodules DIR README DIR LICENSE --- DIR commit e7bad1176496d212a70e8235f800f988619c4a0a DIR parent 905a2a8672395f3d2f7e4051946b319111c7e84e HTML Author: parazyd <parazyd@dyne.org> Date: Sun, 8 May 2016 12:43:52 +0200 custom script support Diffstat: A arm/extra/scrinclude/README | 4 ++++ M arm/profiles/common-devuan | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-) --- DIR diff --git a/arm/extra/scrinclude/README b/arm/extra/scrinclude/README t@@ -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` DIR diff --git a/arm/profiles/common-devuan b/arm/profiles/common-devuan t@@ -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 t@@ -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 t@@ -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