arm-sdk

os build toolkit for various embedded devices
git clone https://git.parazyd.org/arm-sdk
Log | Files | Refs | Submodules | README | LICENSE

commit 81cdfb4af4432a32f3f5a76f58d668368643f650
parent 18b120a4b78636483a0d7d66d1e071e0903ec633
Author: parazyd <parazyd@dyne.org>
Date:   Thu, 13 Oct 2016 10:03:06 +0200

remove rdate, add postbuild-clean, add missing boards to hashmap

Diffstat:
Mlib/helpers | 33+++++++++++++++++++++++++++------
Msdk | 29+++++++++++++++--------------
2 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/lib/helpers b/lib/helpers @@ -118,12 +118,33 @@ proc /proc proc nodev,noexec,nosuid 0 0 EOF } -rdate-to-rclocal() { - fn rdate-to-rclocal - req=(strapdir) +postbuild-clean() { + fn postbuild-clean + req=(qemu_bin strapdir) ckreq || return 1 - notice "adding rdate to rc.local" - sed -i -e "s/exit 0/rdate -s pool.ntp.org &/" $strapdir/etc/rc.local - print "exit 0" | sudo tee -a $strapdir/etc/rc.local ${TEEVERBOSE} + cat <<EOF | sudo tee ${strapdir}/postbuild +#!/bin/sh +dpkg-divert --add --local \ + --divert /usr/sbin/invoke-rc.d.chroot \ + --rename /usr/sbin/invoke-rc.d +cp /bin/true /usr/sbin/invoke-rc.d +echo -e "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d +chmod +x /usr/sbin/policy-rc.d + +apt-get update +apt-get --yes --force-yes upgrade +apt-get --yes --force-yes autoremove +apt-get clean + +rm -f /usr/sbin/policy-rc.d +rm -f /usr/sbin/invoke-rc.d +dpkg-divert --remove --rename /usr/sbin/invoke-rc.d + +rm -f postbuild +rm -f ${qemu_bin} + +EOF + sudo chmod +x $strapdir/postbuild || zerr + sudo chroot $strapdir /postbuild || zerr } diff --git a/sdk b/sdk @@ -17,27 +17,23 @@ # 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/>. -armsdk_version="1.0-dev" +armsdk_version="1.0" -## setup zsh options -setopt pushdsilent R=${ARM_SDK:-$PWD} -DEBUG=1 +DEBUG=0 QUIET=0 [[ $DEBUG = 1 ]] && { - ## add -v to cp calls CPVERBOSE="-v" - TEEVERBOSE="" + LOG="armsdk.log" } || [[ $DEBUG = 0 ]] && { CPVERBOSE="" - TEEVERBOSE=">/dev/null" + setopt pushdsilent } - source lib/zuper/zuper ## global vars @@ -46,6 +42,9 @@ vars+=(R workdir strapdir) vars+=(os boardlib oslib) vars+=(MAKEOPTS) +## global arrs +arrs+=(extra_packages) + ## global maps maps+=(board_map os_map) @@ -74,15 +73,16 @@ load() { board_map=( "bananapi" "$R/boards/bananapi.sh" "bananapro" "$R/boards/bananapro.sh" - "bbb" "$R/boards/beaglebone-black.sh" + "beagleboneblack" "$R/boards/beaglebone-black.sh" "chromeacer" "$R/boards/chromebook-acer.sh" "chromeveyron" "$R/boards/chromebook-veyron.sh" "cubieboard2" "$R/boards/cubieboard2.sh" "cubietruck" "$R/boards/cubietruck.sh" + "n900" "$R/boards/nokia-n900.sh" "odroidxu" "$R/boards/odroid-xu.sh" "ouya" "$R/boards/ouya.sh" - "raspi" "$R/boards/raspberry-pi.sh" - "n900" "$R/boards/nokia-n900.sh" + "raspi2" "$R/boards/raspberry-pi2.sh" + "raspi3" "$R/boards/raspberry-pi3.sh" ) os_map=( @@ -92,10 +92,11 @@ load() { boardlib="${board_map[$dev]}" oslib="${os_map[$os]}" - [[ -f $boardlib ]] || die "no valid board specified" - [[ -f $oslib ]] || die "no valid distro specified" + [[ -f $boardlib ]] || { die "no valid boards specified"; exit 1 } + [[ -f $oslib ]] || { die "no valid distro specified"; exit 1 } - source $boardlib + source $boardlib && act "$device_name build script loaded" + export OS=$os source $oslib workdir="$R/tmp/${device_name}-build"