Convert tabs to spaces
Replace all tabs with 4 spaces, and re-enable bashate warnings E002 and E003. Change-Id: I11f3a9ca9b910555e1b1477c52288493f9bb0244
This commit is contained in:
parent
bba826c7c8
commit
6f370f0608
@ -2,4 +2,4 @@ default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/bzImage
|
||||
append root=/dev/vda1 console=tty0 console=ttyS0,115200n8 clocksource=kvm-clock
|
||||
append root=/dev/vda1 console=tty0 console=ttyS0,115200n8 clocksource=kvm-clock
|
||||
|
@ -1,35 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
check_net() {
|
||||
url="http://169.254.169.254/2009-04-04/meta-data"
|
||||
(
|
||||
wget -q -O - -T 10 $url/public-keys 2> /dev/null || exit 1
|
||||
echo
|
||||
) | (
|
||||
while read line
|
||||
do
|
||||
key=$(echo $line | sed 's/\([0-9]\+\)=.*/\1/')
|
||||
key_url=$url/public-keys/$key/openssh-key
|
||||
wget -q -O - -T 10 $key_url 2> /dev/null || exit 1
|
||||
done
|
||||
) >> authorized_keys
|
||||
url="http://169.254.169.254/2009-04-04/meta-data"
|
||||
(
|
||||
wget -q -O - -T 10 $url/public-keys 2> /dev/null || exit 1
|
||||
echo
|
||||
) | (
|
||||
while read line
|
||||
do
|
||||
key=$(echo $line | sed 's/\([0-9]\+\)=.*/\1/')
|
||||
key_url=$url/public-keys/$key/openssh-key
|
||||
wget -q -O - -T 10 $key_url 2> /dev/null || exit 1
|
||||
done
|
||||
) >> authorized_keys
|
||||
}
|
||||
|
||||
json_metadata() {
|
||||
F=$1/ec2/2009-04-04/meta-data.json
|
||||
[ -f $F ] || return
|
||||
JSON.sh < $F | sed -n 's/^\["public-keys","[0-9]\+","openssh-key"\]\t"\(.*\)\\n"$/\1/p'
|
||||
F=$1/ec2/2009-04-04/meta-data.json
|
||||
[ -f $F ] || return
|
||||
JSON.sh < $F | sed -n 's/^\["public-keys","[0-9]\+","openssh-key"\]\t"\(.*\)\\n"$/\1/p'
|
||||
}
|
||||
|
||||
check_cd() {
|
||||
[ -b /dev/sr0 ] || return
|
||||
mkdir /tmp/cd
|
||||
if mount /dev/sr0 /tmp/cd
|
||||
then
|
||||
json_metadata /tmp/cd >> authorized_keys
|
||||
umount /tmp/cd
|
||||
fi
|
||||
rmdir /tmp/cd
|
||||
[ -b /dev/sr0 ] || return
|
||||
mkdir /tmp/cd
|
||||
if mount /dev/sr0 /tmp/cd
|
||||
then
|
||||
json_metadata /tmp/cd >> authorized_keys
|
||||
umount /tmp/cd
|
||||
fi
|
||||
rmdir /tmp/cd
|
||||
}
|
||||
|
||||
mkdir -p /root/.ssh
|
||||
|
@ -6,5 +6,5 @@ auto eth0
|
||||
iface eth0 inet dhcp
|
||||
|
||||
iface eth0 inet6 manual
|
||||
up dhcpcd -b -6 eth0
|
||||
down kill `cat /var/run/dhcpcd-eth0-6.pid` 2>/dev/null
|
||||
up dhcpcd -b -6 eth0
|
||||
down kill `cat /var/run/dhcpcd-eth0-6.pid` 2>/dev/null
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
if which lsb_release 2> /dev/null && [ $(lsb_release -i -s) = "Ubuntu" ]
|
||||
then
|
||||
sudo apt-get -y install curl unzip bc python quilt parted qemu-utils \
|
||||
build-essential gcc-multilib
|
||||
sudo apt-get -y install curl unzip bc python quilt parted qemu-utils \
|
||||
build-essential gcc-multilib
|
||||
fi
|
||||
|
||||
VERSION=2016.02
|
||||
@ -19,20 +19,20 @@ FILENAME=buildroot-${VERSION}.tar.bz2
|
||||
# Download buildroot if we don't have it already
|
||||
if [ ! -f download/$FILENAME ]
|
||||
then
|
||||
wget -P download http://buildroot.org/downloads/$FILENAME
|
||||
wget -P download http://buildroot.org/downloads/$FILENAME
|
||||
fi
|
||||
|
||||
# Untar buildroot if it's not already there
|
||||
if [ ! -d buildroot ]
|
||||
then
|
||||
mkdir buildroot
|
||||
tar -C buildroot -xf download/$FILENAME --strip 1
|
||||
mkdir buildroot
|
||||
tar -C buildroot -xf download/$FILENAME --strip 1
|
||||
fi
|
||||
|
||||
# Apply patches to buildroot if we haven't done so before
|
||||
PATCH_FLAG_FILE=buildroot/.manila-patches-applied
|
||||
if [ ! -f $PATCH_FLAG_FILE ]
|
||||
then
|
||||
( cd buildroot ; QUILT_PATCHES=../patches quilt push -a )
|
||||
touch $PATCH_FLAG_FILE
|
||||
( cd buildroot ; QUILT_PATCHES=../patches quilt push -a )
|
||||
touch $PATCH_FLAG_FILE
|
||||
fi
|
||||
|
@ -12,8 +12,8 @@ BR_OUTPUT=output-$1
|
||||
|
||||
if [ -z "$DISK_NAME" ]
|
||||
then
|
||||
echo Specify disk name
|
||||
exit 2
|
||||
echo Specify disk name
|
||||
exit 2
|
||||
fi
|
||||
|
||||
SIZE=120m
|
||||
@ -54,11 +54,11 @@ sudo $BR_OUTPUT/host/sbin/extlinux -z --install $MOUNT/boot
|
||||
|
||||
if [ $DISK_NAME = server ]
|
||||
then
|
||||
echo Creating share dir
|
||||
SHARE_DIR=$MOUNT/share
|
||||
sudo mkdir -p $SHARE_DIR
|
||||
sudo chmod 770 $SHARE_DIR
|
||||
sudo chown 99:99 $SHARE_DIR
|
||||
echo Creating share dir
|
||||
SHARE_DIR=$MOUNT/share
|
||||
sudo mkdir -p $SHARE_DIR
|
||||
sudo chmod 770 $SHARE_DIR
|
||||
sudo chown 99:99 $SHARE_DIR
|
||||
fi
|
||||
|
||||
echo Unmounting filesystem
|
||||
|
@ -14,25 +14,25 @@ JSON_VERS=e05e69a0debdba68125a33ac786726cb860b2e7b
|
||||
JSON_SH=https://raw.githubusercontent.com/dominictarr/JSON.sh/$JSON_VERS/JSON.sh
|
||||
if [ ! -x download/JSON.sh ]
|
||||
then
|
||||
curl -s $JSON_SH > download/JSON.sh
|
||||
chmod +x download/JSON.sh
|
||||
curl -s $JSON_SH > download/JSON.sh
|
||||
chmod +x download/JSON.sh
|
||||
fi
|
||||
|
||||
# Create the filesystem overlays
|
||||
if [ ! -d overlay-client ]
|
||||
then
|
||||
mkdir overlay-client
|
||||
cp -a common-files/* overlay-client
|
||||
mkdir -p overlay-client/usr/bin
|
||||
cp download/JSON.sh overlay-server/usr/bin
|
||||
mkdir overlay-client
|
||||
cp -a common-files/* overlay-client
|
||||
mkdir -p overlay-client/usr/bin
|
||||
cp download/JSON.sh overlay-server/usr/bin
|
||||
fi
|
||||
if [ ! -d overlay-server ]
|
||||
then
|
||||
mkdir overlay-server
|
||||
cp -a common-files/* overlay-server
|
||||
cp -a server-files/* overlay-server
|
||||
mkdir -p overlay-server/usr/bin
|
||||
cp download/JSON.sh overlay-server/usr/bin
|
||||
mkdir overlay-server
|
||||
cp -a common-files/* overlay-server
|
||||
cp -a server-files/* overlay-server
|
||||
mkdir -p overlay-server/usr/bin
|
||||
cp download/JSON.sh overlay-server/usr/bin
|
||||
fi
|
||||
|
||||
# Copy the config files where they need to go (temporarily)
|
||||
@ -46,7 +46,7 @@ BUILD_IMAGES="client server"
|
||||
# Setup the build directories with their configs
|
||||
for IMAGE in $BUILD_IMAGES
|
||||
do
|
||||
make O=../output-${IMAGE} manila_${IMAGE}_defconfig
|
||||
make O=../output-${IMAGE} manila_${IMAGE}_defconfig
|
||||
done
|
||||
|
||||
# Remove the temporary configs
|
||||
@ -55,6 +55,6 @@ rm configs/manila_*_defconfig
|
||||
# Do the builds
|
||||
for IMAGE in $BUILD_IMAGES
|
||||
do
|
||||
make O=../output-${IMAGE} all
|
||||
( cd .. ; ./make-bootable-disk.sh $IMAGE )
|
||||
make O=../output-${IMAGE} all
|
||||
( cd .. ; ./make-bootable-disk.sh $IMAGE )
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user