diff --git a/.gitignore b/.gitignore index 96b6ffe..7390613 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,9 @@ build/ cores/src cores/output -private/ -releases/ +private +releases +src/boot/output *.o *.so diff --git a/makefile b/makefile index 51e54c9..6d6016c 100644 --- a/makefile +++ b/makefile @@ -30,6 +30,7 @@ sys: cd ./src/keymon && make cd ./src/minarch && make cd ./src/minui && make + cd ./src/boot && ./build.sh all-cores: cd ./cores && make @@ -51,8 +52,10 @@ bundle: cd ./build && find . -type f -name '.keep' -delete cd ./build && find . -type f -name '*.meta' -delete + cp ./src/boot/output/dmenu.bin ./build/BASE + # populate system - cp ~/buildroot/output/images/rootfs.ext2 ./build/SYSTEM/rg35xx/ + cp ~/buildroot/output/images/rootfs.ext2 ./build/SYSTEM/rg35xx cp ./src/dts/kernel.dtb ./build/SYSTEM/rg35xx/dat cp ./src/libmsettings/libmsettings.so ./build/SYSTEM/rg35xx/lib cp ./src/keymon/keymon.elf ./build/SYSTEM/rg35xx/bin @@ -99,6 +102,7 @@ clean: cd ./src/keymon && make clean cd ./src/minui && make clean cd ./src/minarch && make clean + cd ./src/boot && rm -rf ./output cd ./cores && make clean cd ./src/clock && make clean cd ./other/DinguxCommander && make clean diff --git a/skeleton/BASE/dmenu.bin b/src/boot/boot.sh similarity index 85% rename from skeleton/BASE/dmenu.bin rename to src/boot/boot.sh index db19fb7..d1def6e 100755 --- a/skeleton/BASE/dmenu.bin +++ b/src/boot/boot.sh @@ -37,11 +37,20 @@ fi if [ -f $UPDATE_PATH ]; then FLAG_PATH=/misc/.minstalled if [ ! -f $FLAG_PATH ]; then - echo "INSTALL" + ACTION=installing else - echo "UPDATE" + ACTION=updating fi + # extract the zip file appended to the end of this script to tmp + # and display one of the two images it contains + CUT=$((`busybox grep -n '^BINARY' $0 | busybox cut -d ':' -f 1 | busybox tail -1` + 1)) + busybox tail -n +$CUT "$0" | busybox uudecode -o /tmp/data + busybox unzip -o /tmp/data -d /tmp + busybox fbset -g 640 480 640 480 16 + dd if=/tmp/$ACTION of=/dev/fb0 + sync + busybox unzip -o $UPDATE_PATH -d $SDCARD_PATH rm -f $UPDATE_PATH if [ ! -f $FLAG_PATH ]; then @@ -102,3 +111,6 @@ busybox chroot $ROOTFS_MOUNTPOINT $SYSTEM_PATH/paks/MinUI.pak/launch.sh &> $SYST umount $ROOTFS_MOUNTPOINT busybox losetup --detach $LOOPDEVICE sync && reboot -p + +exit 0 + diff --git a/src/boot/build.sh b/src/boot/build.sh new file mode 100755 index 0000000..4f9f43a --- /dev/null +++ b/src/boot/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +TARGET=dmenu.bin + +mkdir -p output +if [ ! -f output/installing ]; then + dd skip=64 iflag=skip_bytes if=installing.bmp of=output/installing +fi +if [ ! -f output/updating ]; then + dd skip=64 iflag=skip_bytes if=updating.bmp of=output/updating +fi + +cd output +if [ ! -f data ]; then + # tar -czvf data installing updating + zip -r data.zip installing updating + mv data.zip data +fi + +cat ../boot.sh > $TARGET +echo BINARY >> $TARGET +uuencode data data >> $TARGET +echo >> $TARGET diff --git a/src/boot/installing.bmp b/src/boot/installing.bmp new file mode 100644 index 0000000..9ee57b7 Binary files /dev/null and b/src/boot/installing.bmp differ diff --git a/src/boot/updating.bmp b/src/boot/updating.bmp new file mode 100644 index 0000000..66e86a7 Binary files /dev/null and b/src/boot/updating.bmp differ