Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
fix: Fix install stock blobs script
Browse files Browse the repository at this point in the history
  • Loading branch information
robshape committed Jun 22, 2023
1 parent 539ec14 commit e31e0c5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,45 @@ if [ ! -f $FLAG_PATH ]; then
echo "backing up"
BAK_PATH=$TF1_PATH/bak
mkdir -p $BAK_PATH
cp /misc/modules/gpio_keys_polled.ko $BAK_PATH
cp /misc/boot_logo.bmp.gz $BAK_PATH
cp /misc/kernel.dtb $BAK_PATH
cp /misc/uImage $BAK_PATH
fi

was_updated() {
for FILE in /misc/* /misc/*/*; do
A_PATH=$FILE
A_NAME=$(busybox basename "$A_PATH")
B_PATH=$SYSTEM_PATH/dat/$A_NAME

if [[ "$A_NAME" == "boot_logo.bmp.gz" ]]; then
# we don't care if the user has changed their boot logo
continue
fi

if [ ! -f "$B_PATH" ]; then
continue
fi

A_SUM=$(busybox md5sum $A_PATH | busybox cut -d ' ' -f 1)
B_SUM=$(busybox md5sum $B_PATH | busybox cut -d ' ' -f 1)

if [[ "$A_SUM" != "$B_SUM" ]]; then
return 0
fi
done

return 1
}

if [ ! -f $FLAG_PATH ] || was_updated; then
echo "updating misc partition"
mount -o remount,rw /dev/block/actb /misc
rm -f /misc/uImage
cp $SYSTEM_PATH/dat/uImage /misc
cp $SYSTEM_PATH/dat/dmenu.bin /misc
if [ ! -f $FLAG_PATH ]; then
# only replace boot logo on install not update!
cp $SYSTEM_PATH/dat/boot_logo.bmp.gz /misc
fi
cp $SYSTEM_PATH/dat/kernel.dtb /misc
cp $SYSTEM_PATH/dat/gpio_keys_polled.ko /misc/modules
touch $FLAG_PATH
sync && reboot
fi

0 comments on commit e31e0c5

Please sign in to comment.