Verified Commit e30180df authored by Michal Hrusecky's avatar Michal Hrusecky 🦎

compile_fw: Give up on base.lua and include everything

parent f0a8c14b
...@@ -61,8 +61,6 @@ echo CONFIG_ALL_KMODS=y >> .config ...@@ -61,8 +61,6 @@ echo CONFIG_ALL_KMODS=y >> .config
# Include important userlists # Include important userlists
# Base list generation # Base list generation
cp .config .config-wip
make_defconfig
cat > base.lua << EOF cat > base.lua << EOF
-- The basic repository -- The basic repository
Repository 'turris' 'https://api.turris.cz/openwrt-repo/${TARGET_BOARD}${PKG_BRANCH}/packages' { Repository 'turris' 'https://api.turris.cz/openwrt-repo/${TARGET_BOARD}${PKG_BRANCH}/packages' {
...@@ -86,12 +84,8 @@ Package 'opkg-trans' { replan = true } ...@@ -86,12 +84,8 @@ Package 'opkg-trans' { replan = true }
Install 'opkg-trans' 'updater-ng' Install 'opkg-trans' 'updater-ng'
Install 'userlists' { ignore = { 'missing' } } Install 'userlists' { ignore = { 'missing' } }
-- Some packages from the basic system. -- Install everything that was in the image
Install $(echo $(sed -n 's|^CONFIG_PACKAGE_\([^=]*\)=.*|"\1"|p' .config | grep -v -F -f not_packages))
EOF EOF
# Include stuff from defconfig and list
echo Install $(echo $(cat lists/base.list lists/base.${TARGET_BOARD} | grep -v CONFIG | sed -n 's|^\(..*\)$|"\1"|p')) >> base.lua
mv .config-wip .config
if [ -n "${PKG_BRANCH}" ]; then if [ -n "${PKG_BRANCH}" ]; then
echo 'Install "cznic-repo-keys-test"' >> base.lua echo 'Install "cznic-repo-keys-test"' >> base.lua
echo CONFIG_PACKAGE_cznic-repo-keys-test=y >> .config echo CONFIG_PACKAGE_cznic-repo-keys-test=y >> .config
...@@ -160,9 +154,35 @@ cat >> logs/junit.xml << EOF ...@@ -160,9 +154,35 @@ cat >> logs/junit.xml << EOF
EOF EOF
[ \! -d ./logs ] || mv ./logs ./logs-nand [ \! -d ./logs ] || mv ./logs ./logs-nand
if [ "$TARGET_BOARD" = turris ]; then
#Build initramfs
echo -e "CONFIG_TARGET_ROOTFS_INITRAMFS=y\nCONFIG_TARGET_INITRAMFS_COMPRESSION_XZ=y" >> .config
make_defconfig
make target/linux/compile "$@"
[ \! -d ./logs ] || mv ./logs ./logs-initram
cp build_dir/target-powerpc_*/linux-mpc85xx_p2020-nand/zImage-initramfs bin/mpc85xx/turris-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-powerpc_*/root-mpc85xx bin/mpc85xx/root
cd bin/mpc85xx/root
rm var
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
# Preserve the uncompressed image too
mv build_dir/target-arm_*/root-mvebu* bin/mvebu-musl/root
cd bin/mvebu-musl/root
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
fi
# Generate lists # Generate lists
PUB_BIN_DIR="`ls -1d bin/* | head -n1`" PUB_BIN_DIR="`ls -1d bin/* | head -n1`"
mkdir -p $PUB_BIN_DIR/lists mkdir -p $PUB_BIN_DIR/lists
echo Install $(sed -n 's|Package: \(.*\)|"\1"|p' bin/*/root/usr/lib/opkg/status) >> base.lua
mv base.lua $PUB_BIN_DIR/lists mv base.lua $PUB_BIN_DIR/lists
for i in lists/*.list; do for i in lists/*.list; do
[ "$i" = lists/base.list ] || rm -f $PUB_BIN_DIR/lists/$(basename $i .list).lua [ "$i" = lists/base.list ] || rm -f $PUB_BIN_DIR/lists/$(basename $i .list).lua
...@@ -185,30 +205,6 @@ for i in lists/*.lua; do ...@@ -185,30 +205,6 @@ for i in lists/*.lua; do
fi fi
done done
if [ "$TARGET_BOARD" = turris ]; then
#Build initramfs
echo -e "CONFIG_TARGET_ROOTFS_INITRAMFS=y\nCONFIG_TARGET_INITRAMFS_COMPRESSION_XZ=y" >> .config
make_defconfig
make target/linux/compile "$@"
[ \! -d ./logs ] || mv ./logs ./logs-initram
cp build_dir/target-powerpc_*/linux-mpc85xx_p2020-nand/zImage-initramfs bin/mpc85xx/turris-initramfs-zimage
# Preserve the uncompressed image too
mv build_dir/target-powerpc_*/root-mpc85xx bin/mpc85xx/root
cd bin/mpc85xx/root
rm var
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
# Preserve the uncompressed image too
mv build_dir/target-arm_*/root-mvebu* bin/mvebu-musl/root
cd bin/mvebu-musl/root
rm var
find -type l ! -exec test -r {} \; -delete
cd ../../..
fi
# Clean # Clean
[ -d ./bin-nand ] && rm -rf ./bin-nand [ -d ./bin-nand ] && rm -rf ./bin-nand
......
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