#!/bin/sh set -e #Set up the initial /src disk if [ -e /dev/disk/by-label/src ] then echo "Disk labelled src found" else echo "Disk labelled src not found. Initializing /dev/sdb as src" mkfs.btrfs -L src /dev/sdb fi #Ensure the /src directory exists mkdir -p /src #Add the /src disk to /etc/fstab if it doesn't exist grep "LABEL=src" /etc/fstab >/dev/null || echo 'LABEL=src /src btrfs defaults 0 2' >>/etc/fstab #Mount the disk so that it can be configured mount -a #Retrieve the staging-filler if [ -e /src/staging-filler ] then cd /src/staging-filler git pull origin master cd - else git clone ssh://git@trove.genivi.baserock.com/ct/genivi/genivi-staging-filler /src/staging-filler fi if [ -e /src/staging-filler/water-bomb-x86_64-filler.tar.gz ] then echo "Water bomb staging-filler already exists" else echo "Downloading water bomb staging-filler" wget -P /src/staging-filler http://download.baserock.org/baserock/water-bomb-x86_64-filler.tar.gz fi #Ensure the cache and temp directories exist mkdir -p /src/cache mkdir -p /src/tmp #Create morph.conf cat >/src/morph.conf <