Verified Commit 9013da35 authored by Michal Hrusecky's avatar Michal Hrusecky 🦎

compile_fw: Support for minimalistic base.lua

parent c6c3a045
......@@ -182,19 +182,53 @@ if [ "$TARGET_BOARD" = turris ]; then
find -type l ! -exec test -r {} \; -delete
cd ../../..
elif [ "$TARGET_BOARD" = omnia ]; then
mv bin/mvebu-musl/openwrt-mvebu-Turris-Omnia-rootfs.tar.gz bin/mvebu-musl/omnia-medkit-`date +%Y%m%d%H%M`.tar.gz
mkdir bin/mvebu-musl/medkit
if [ -n "$BUILD_ALL" ]; then
MED_PATH="bin/mvebu-musl/medkit/full"
else
MED_PATH="bin/mvebu-musl/medkit/minimal"
fi
mkdir -p "$MED_PATH"
mv bin/mvebu-musl/openwrt-mvebu-Turris-Omnia-rootfs.tar.gz "$MED_PATH"/omnia-medkit-`date +%Y%m%d%H%M`.tar.gz
# Preserve the uncompressed image too
mv build_dir/target-arm_*/root-mvebu* bin/mvebu-musl/root
cd bin/mvebu-musl/root
pushd bin/mvebu-musl/root
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
popd
fi
# Clean
[ -d ./bin-nand ] && rm -rf ./bin-nand
mv ./bin ./bin-nand
[ -d ./tmp ] && rm -rf ./tmp
# Generate lists
PUB_BIN_DIR="`ls -1d bin/* | head -n1`"
PUB_BIN_DIR="`ls -1d bin-nand/* | head -n1`"
mkdir -p $PUB_BIN_DIR/lists
echo Install $(sed -n 's|Package: \(.*\)|"\1"|p' bin/*/root/usr/lib/opkg/status | egrep -v '"updater(|-deps|-conolidator)"') " { ignore = { 'missing' } }" >> base.lua
# On Omnia full build generate a minimal image as well and use it for base list
if [ -n "$BUILD_ALL" ] && [ "$TARGET_BOARD" = omnia ]; then
make dirclean
cat configs/common configs/$TARGET_BOARD | sed -e "s|@BOARD@|$TARGET_BOARD|" -e "s|@BRANCH@|$PKG_BRANCH|" > .config
echo CONFIG_ALL_KMODS=y >> .config
cat "lists/base.list" "lists/base.${TARGET_BOARD}" | sed 's|#.*||' 2> /dev/null | while read PKG; do
if expr "$PKG" : CONFIG_;then
echo "$PKG" >> .config
elif [ -n "$PKG" ]; then
echo "CONFIG_PACKAGE_$PKG=y" >> .config
fi
done
make_defconfig
make "$@" PKG_BRANCH=${PKG_BRANCH/-/}
mkdir -p bin-nand/mvebu-musl/medkit/minimal
mv bin/mvebu-musl/openwrt-mvebu-Turris-Omnia-rootfs.tar.gz bin-nand/mvebu-musl/medkit/minimal/omnia-medkit-`date +%Y%m%d%H%M`.tar.gz
OPKG_STATUS="`ls -1d build_dir/target-arm_*/root-mvebu*/usr/lib/opkg/status`"
else
OPKG_STATUS="`ls -1d bin-nand/*/root/usr/lib/opkg/status`"
fi
echo Install $(sed -n 's|Package: \(.*\)|"\1"|p' $OPKG_STATUS | egrep -v '"updater(|-deps|-conolidator)"') " { ignore = { 'missing' } }" >> base.lua
[ \! -f "lists/base_add" ] || echo Install $(cat "lists/base_add.$TARGET_BOARD" | sed 's|^\([^#]\+\)$|"\1"|') " { ignore = { 'missing' } }" >> base.lua
[ \! -f "lists/base_add.$TARGET_BOARD" ] || echo Install $(cat "lists/base_add.$TARGET_BOARD" | sed 's|^\([^#]\+\)$|"\1"|') " { ignore = { 'missing' } }" >> base.lua
mv base.lua $PUB_BIN_DIR/lists
......@@ -219,12 +253,6 @@ for i in lists/*.lua; do
fi
done
# Clean
[ -d ./bin-nand ] && rm -rf ./bin-nand
mv ./bin ./bin-nand
[ -d ./tmp ] && rm -rf ./tmp
if [ "$TARGET_BOARD" = turris ]; then
# Build NOR FW
cp configs/config-turris-nor .config
......@@ -260,5 +288,5 @@ elif [ "$TARGET_BOARD" = omnia ]; then
mkdir -p bin/mvebu-musl/x86-64
cp build_dir/host/uboot-turris-omnia*/turris-omnia-uboot/* bin/mvebu-musl/x86-64
mv bin bin-nor
rm -rf bin-nor/packages
rm -rf bin-nor/mvebu-musl/packages
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment