Browse Source

docker: simplified output, now uses archives not sandbox.

master
Nagy Károly Gábriel 7 years ago
parent
commit
5232c84900
1 changed files with 8 additions and 40 deletions
  1. +8
    -40
      target/share/docker/build.sh

+ 8
- 40
target/share/docker/build.sh

@ -13,53 +13,21 @@
# --- SDE-COPYRIGHT-NOTE-END ---
#Description: Build an archived rootfs for docker images
set -e
. $base/target/share/functions.in
dockerdir="$build_toolchain/docker"
imagelocation="$build_toolchain/rootfs" # where the roofs is prepared and compress.
rm -rf $dockerdir
rm -rf $imagelocation
mkdir -p $dockerdir
mkdir -p $imagelocation ; cd $imagelocation
# just in case it is still there from the last run
(umount proc ; umount dev) 2>/dev/null
echo "Creating root file-system file lists ..."
pkg_skip=" ccache distcc "
for pkg in `grep '^X ' $base/config/$config/packages | cut -d ' ' -f 5`; do
# include the package?
if [ "${pkg_skip/ $pkg /}" == "$pkg_skip" ] ; then
cut -d ' ' -f 2 $build_root/var/adm/flists/$pkg || true
fi
done | (
# quick and dirty filter
grep -v -e 'lib/[^/]*\.a$'
) | sort -u > ../files-wanted
# for rsync with --delete we can not use file lists, since rsync does not
# delete in that mode - instead we need to generate a negative list
time find $build_root -mount -wholename $build_root/TOOLCHAIN -prune -o -printf '%P\n' |
sort -u > ../files-all
# the difference
diff -u ../files-all ../files-wanted |
sed -n -e '/var\/adm\/olist/d' -e '/var\/adm\/logs/d' \
-e '/var\/adm\/dep-debug/d' -e '/var\/adm\/cache/d' -e 's/^-//p' > ../files-exclude
echo "proc/*
dev/*
*/share/doc/*
var/adm/olist
var/adm/logs
var/adm/dep-debug
var/adm/cache" >> ../files-exclude
echo "Syncing root file-system (this may take some time) ..."
[ -e $imagelocation/bin ] && v="-v" || v=
time rsync -artH $v --delete --exclude-from ../files-exclude \
--exclude TOOLCHAIN --delete-excluded $build_root/ $imagelocation/
rm ../files-{wanted,all,exclude}
mkdir -p $imagelocation
cd $build_toolchain/pkgs
for pack in *.bz2; do
tar -xjvf $pack -C $imagelocation
done
echo "Creating root file-system (this may take some time) ..."
cd $dockerdir
time tar -cjvf rootfs.tar.bz2 -C $imagelocation .

Loading…
Cancel
Save