Skip to content

Commit

Permalink
rootfs: build the toolchain
Browse files Browse the repository at this point in the history
Signed-off-by: Fengguang Wu <[email protected]>
  • Loading branch information
Fengguang Wu committed Aug 31, 2016
1 parent 2c49d73 commit 828e149
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
17 changes: 17 additions & 0 deletions distro/common
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,20 @@ check_shared_package()

return 0
}

show_deps_list()
{
local blacklist="^pack-deps$
-dev$
-whitelist$"

ls $LKP_SRC/distro/depends/ | grep -v "$blacklist"
}

show_pack_list()
{
ls $LKP_SRC/pack |
grep -x -F -f <(find $LKP_SRC/{monitors,setup,tests,daemon} -type f -or -type l|sed 's:.*/::') |
grep -v -e '^0day-'
}

15 changes: 11 additions & 4 deletions rootfs/create-cpio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ cpio -o -H newc | gzip -n -9 > ../$cpio_file || exit

cd ..

echo
echo "To deploy the rootfs:"
echo "cp $cpio_file $INITRD_ROOT/$cpio_file"
echo "ln -fs $cpio_file $INITRD_ROOT/${distro}.cgz"
cat <<EOF
To deploy the rootfs:
mount -o remount,rw /osimage
cp -a $cpio_file $INITRD_ROOT/$cpio_file
ln -fs $cpio_file $INITRD_ROOT/latest
build-packages $cpio_file
ln -fs $cpio_file $INITRD_ROOT/${distro}.cgz
EOF

# tuning tips:
# deborphan -sz
Expand Down
19 changes: 19 additions & 0 deletions tools/build-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

[ -n "$LKP_SRC" ] || LKP_SRC=$(dirname $(dirname $(readlink -e -v $0)))

rootfs=$1
[[ $rootfs ]] || rootfs=$(readlink -e /osimage/debian/latest)
[[ $rootfs ]] || {
echo "What rootfs should I build packages for?"
exit 1
}

. $LKP_SRC/distro/common

# create cgz for the below jobs first, to avoid circular dependency
$LKP_SRC/sbin/pack-deps $rootfs pack-deps || exit
$LKP_SRC/sbin/pack-deps $rootfs pack || exit

queue pack-deps.yaml rootfs=$rootfs benchmark="$(show_deps_list)"
queue pack.yaml rootfs=$rootfs benchmark="$(show_pack_list)"

0 comments on commit 828e149

Please sign in to comment.