summaryrefslogtreecommitdiffstats
path: root/utils/nwztools/scripts
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-11-12 22:16:48 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-11-12 22:16:48 +0100
commit0c1a96101cdfc778dbffa7ceffea5765ffd4d1bd (patch)
tree9a90c1bff1e073b831d3091c4f27da06e9364cda /utils/nwztools/scripts
parent33856d9ceb6df817c4f40f42bfcf9ee9fa188848 (diff)
downloadrockbox-0c1a96101cdfc778dbffa7ceffea5765ffd4d1bd.tar.gz
rockbox-0c1a96101cdfc778dbffa7ceffea5765ffd4d1bd.tar.bz2
rockbox-0c1a96101cdfc778dbffa7ceffea5765ffd4d1bd.zip
nwztools: rework dualboot
The new code gets closer to an actual bootloader: - it provides a menu with three options: Sony, Rockox, tools with icons (and extracts the Sony logo from the NVP) - the dualboot install script now creates a symlink from /.rockbox to /contents/.rockox which is necessary to run rockbox - more text drawing / framebuffer functions In the long run, we will move this under bootloader/ and rbutil/ and also use firmware/ drawing facilities, at the moment we use OF display program which is slow and creates some flickering. The logo extraction/placement code was tested with resolution 240x320 and I guessed some reasonable values for 240x400, but those will probably need some tweaking. Change-Id: I0319be902d21a7d33c1dee0fffdb4797065dbf8a
Diffstat (limited to 'utils/nwztools/scripts')
-rw-r--r--utils/nwztools/scripts/install_dualboot.sh49
1 files changed, 29 insertions, 20 deletions
diff --git a/utils/nwztools/scripts/install_dualboot.sh b/utils/nwztools/scripts/install_dualboot.sh
index ece5b9e3a3..08c24b7b5f 100644
--- a/utils/nwztools/scripts/install_dualboot.sh
+++ b/utils/nwztools/scripts/install_dualboot.sh
@@ -10,7 +10,6 @@ nvpflag fup 0xFFFFFFFF
# FIXME document this
#
-
# go to /tmp
cd /tmp
@@ -30,6 +29,9 @@ if [ "$?" != 0 ]; then
exit 0
fi
+# redirect all output to a log file
+exec > "$CONTENTS/install_dualboot_log.txt" 2>&1
+
# import constants
. /install_script/constant.txt
_UPDATE_FN_=`nvpstr ufn`
@@ -66,6 +68,7 @@ fi
lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,9 "Install rockbox"
fwpchk -f /contents/$_UPDATE_FN_.UPG -c -1 $SPIDERAPP_PATH
if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: no file to extract"
sleep 3
exit 0
@@ -74,40 +77,45 @@ fi
# make it executable and change user/group
chmod 775 $SPIDERAPP_PATH
if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: cannot make it executable"
sleep 3
exit 0
fi
chown 500:500 $SPIDERAPP_PATH
if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: cannot change owner"
sleep 3
exit 0
fi
-# # change main application
-# lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,9 "Modify app list"
-# sed -i 's/Rockbox/SpiderApp/' $ROOTFS_TMP_DIR/etc/AppList.conf
-# if [ "$?" != 0 ]; then
-# lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,14 "ERROR: sed failed"
-# sleep 3
-# exit 0
-# fi
-# # and fix ownership
-# chown 500:500 $ROOTFS_TMP_DIR/etc/AppList.conf
-# if [ "$?" != 0 ]; then
-# lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,14 "ERROR: cannot change group"
-# sleep 3
-# exit 0
-# fi
-cat $ROOTFS_TMP_DIR/etc/AppList.conf >$CONTENTS/AppList.conf
-ls -l $ROOTFS_TMP_DIR/usr/local/bin/ >$CONTENTS/ls.txt
-ls -l $ROOTFS_TMP_DIR/etc/ >$CONTENTS/ls2.txt
+# create a symlink from /.rockbox to /contents/.rockbox (see dualboot code
+# for why)
+lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,10 "Create rockbox symlink"
+rm -f "$ROOTFS_TMP_DIR/.rockbox"
+ln -s "$CONTENTS/.rockbox" "$ROOTFS_TMP_DIR/.rockbox"
+if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
+ lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: cannot create rockbox symlink"
+ sleep 3
+ exit 0
+fi
+
+# change user/group
+chown -h 500:500 "$ROOTFS_TMP_DIR/.rockbox"
+if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
+ lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: cannot change symlink owner"
+ sleep 3
+ exit 0
+fi
# unmount root partition
-lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,10 "Unmount root filesystem"
+lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,11 "Unmount root filesystem"
sync
if [ "$?" != 0 ]; then
+ umount "$ROOTFS_TMP_DIR"
lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "ERROR: sync failed"
sleep 3
exit 0
@@ -125,5 +133,6 @@ lcdmsg -f /usr/local/bin/font_08x12.bmp -l 0,15 "Rebooting in 3 seconds."
sleep 3
sync
+echo "Installation successful"
# finish
exit 0