Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimised sh Scripts: build-berryboot.sh, rebuild-berryboot.sh, rebuild-kernel.sh #752

Open
wants to merge 1 commit into
base: berryboot2018
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions build-berryboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ EXTERNAL="$PWD/external"

cd $BUILDROOT

if [ -n "$1" ]; then
if [ ! -e "../configs/$1" ]; then
echo configs/$1 does not exist
[ -n "$1" ] && {
[ ! -e "../configs/$1" ] && {
echo configs/$1 does not exist &&
exit 1
fi
}

support/kconfig/merge_config.sh -m ../configs/berryboot_defconfig ../configs/$1
support/kconfig/merge_config.sh -m ../configs/berryboot_defconfig ../configs/"$1"
make BR2_EXTERNAL=$EXTERNAL olddefconfig
fi
}

if [ ! -e .config ]; then
echo No target device selected yet
[ ! -e .config ] && {
echo No target device selected yet
echo
echo Run: $0 \<device\>
echo -n "Supported devices: "
(cd ../configs ; ls device*)
echo
exit 1
fi
}

# Let buildroot build everything
make BR2_EXTERNAL=$EXTERNAL
make BR2_EXTERNAL="$EXTERNAL"

cd ..
cp -n LICENSE.berryboot output
#cp -f $BUILDROOT/output/images/rootfs.cpio.uboot output/berryboot.img
cp -f $BUILDROOT/output/images/rootfs.cpio.lzo output/berryboot.img
cp -f $BUILDROOT/output/images/bbloader.img output/
cp -f $BUILDROOT/output/images/kernel*.img $BUILDROOT/output/images/shared.img output || true
cp -f "$BUILDROOT/output/images/rootfs.cpio.lzo" output/berryboot.img
cp -f "$BUILDROOT/output/images/bbloader.img" output/
cp -f "$BUILDROOT/output/images/kernel*".img "$BUILDROOT/output/images/shared.img" output || true

if [ -e $BUILDROOT/output/images/rpi-firmware ]; then
cp -rf $BUILDROOT/output/images/rpi-firmware/* output
for f in $BUILDROOT/output/images/bcm27*.dtb $BUILDROOT/output/images/broadcom/bcm27*.dtb; do
if [ -e "$BUILDROOT/output/images/rpi-firmware" ]; then
cp -rf "$BUILDROOT/output/images/rpi-firmware/"* output
for f in "$BUILDROOT/output/images/bcm27"*.dtb "$BUILDROOT/output/images/broadcom/bcm27"*.dtb; do
[ -f "$f" ] && cp -f "$f" output
done
cp -rf $BUILDROOT/output/images/overlays output
cp -rf "$BUILDROOT/output/images/overlays" output
rm -f output/start_db.elf output/start4db.elf output/fixup_db.dat output/fixup4db.dat
fi

Expand Down
4 changes: 1 addition & 3 deletions rebuild-berryboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ set -e
BUILDROOT=buildroot-2018.08

# Force rebuild of BerrybootGUI
if [ -e $BUILDROOT/output/build/berrybootgui2-1.0 ]; then
make -C $BUILDROOT berrybootgui2-dirclean
fi
[ -e $BUILDROOT/output/build/berrybootgui2-1.0 ] && make -C $BUILDROOT berrybootgui2-dirclean

./build-berryboot.sh "$@"