Files
linuxkit/licensing/license.sh
Ian Campbell eb221b4d4f Add VSOCK patches
These are WIP taken from git@github.com:stefanha/linux.git#vsock
(==4c9d2a6be1c6, using "cherry-pick -x") and correspond to RFC v5 of the
frontend patches posted in
http://thread.gmane.org/gmane.linux.kernel.virtualization/27455

There is no corresponding spec proposal update yet, but this set of patches
correspond (roughly) to addressing the feedback on v4 of the spec proposal
http://thread.gmane.org/gmane.comp.emulators.virtio.devel/1062.

kernel_config.arm modifications copied from x86, not tested.

Added /etc/kernel-patches/ directory to the image to be consumed by the
licensing.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-05 13:40:36 +01:00

76 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
fail() {
printf $1
printf "\n"
exit 1
}
cat /hostetc/issue | grep -q Moby || ( printf "You must run this script with -v /etc:/hostetc -v /lib:/lib\n" && exit 1 )
apk info | grep -q fuse || ( printf "You must run this script with -v /etc:/etc -v /lib:/lib\n" && exit 1 )
[ -f /hostetc/kernel-source-info ] || ( printf "Missing kernel source version info\n" && exit 1 )
. /hostetc/kernel-source-info
rm -rf /output/*
cd /aports
git pull
packages.lua | while read l
do
echo $l
APORT_PACKAGE=$(echo $l | sed 's/ .*//')
APORT_COMMIT=$(echo $l | sed 's/^.* //')
APORT_ORIGIN=$(apk search --origin -x -q ${APORT_PACKAGE})
(
cd /aports
[ ! -d main/${APORT_ORIGIN} ] && ( printf "Cannot find package ${APORT_ORIGIN} in aports\n" && exit 1 )
git checkout ${APORT_COMMIT} || ( printf "Cannot find commit ${APORT_COMMIT} for ${APORT_ORIGIN} in aports\n" && exit 1 )
export srcdir=/output
cd main/${APORT_ORIGIN}
. ./APKBUILD
if [ ! -d "$srcdir"/$pkgname-$pkgver ]
then
mkdir -p "$srcdir"/$pkgname-$pkgver
while read f
do
if [ -n "$(echo $f | tr -d '[[:space:]]')" ]
then
f=$(echo $f | sed 's/^.*:://')
printf "looking for source for: $f\n"
if [ -f $f ]
then
cp -a $f "$srcdir"/$pkgname-$pkgver/
else
cd "$srcdir"/$pkgname-$pkgver && \
wget $f || fail "Cannot retrieve $f" && \
cd -
fi
fi
done <<< "$source"
fi
)
done
mkdir -p /output/kernel
cd /output/kernel
cp /proc/config.gz .
wget ${KERNEL_SOURCE=} || ( printf "Failed to download kernel source\n" && exit 1 )
cp -r /hostetc/kernel-patches /output/kernel/patches
git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /output/kernel/aufs
cd /output/kernel/aufs
git checkout -q "$AUFS_COMMIT"
# to make it easier to check in the output of this script if necessary
rm -rf .git
git clone ${AUFS_TOOLS_REPO} /output/aufs-util
cd /output/aufs-util
git checkout "$AUFS_TOOLS_COMMIT"
rm -rf .git
printf "All source code now in output/ directory\n'