Skip to content

Instantly share code, notes, and snippets.

@chihchun
Forked from vicamo/overlay.sh
Last active May 23, 2016 15:34
Show Gist options
  • Save chihchun/2970c74d3280cbe8207e32e571da5b98 to your computer and use it in GitHub Desktop.
Save chihchun/2970c74d3280cbe8207e32e571da5b98 to your computer and use it in GitHub Desktop.
script to create ubuntu rootfs overlay for silos
#!/bin/sh
if [ -z $1 ] ; then echo "$0: silo_number [release] [team] [arch]" && exit 1 ; fi
SILO=$1
RELEASE=${2:-"vivid"}
TEAM=${3:-"ci-train-ppa-service"}
ARCH=${4:-"armhf"}
PACKAGES_URL="http://ppa.launchpad.net/${TEAM}/landing-${SILO}/ubuntu/dists/${RELEASE}/main/binary-${ARCH}/Packages.gz"
PACKAGES=$(curl -s ${PACKAGES_URL} | gzip -cd | grep ^Package: | grep -v -- -dev\$ | cut -d: -f2)
if [ -z "$PACKAGES" ] ; then echo "http://ppa.launchpad.net/${TEAM}/landing-${SILO}/ubuntu/dists/${RELEASE}/main/binary-${ARCH}/Packages.gz" "package found not\n" ; exit 2 ; fi
set -e
if [ ! -d overlay ] ; then mkdir overlay ; fi
for PACKAGE in ${PACKAGES} ; do
build/tools/pull-lp-bin.py -a ${ARCH} -t ${TEAM} -p landing-${SILO} ${PACKAGE} ${RELEASE} -o overlay
done
for d in overlay/*.deb ; do
dpkg-deb -x $d overlay
done
rm -rf overlay/*.deb overlay/usr/share/doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment