diff --git a/services-installer.sh b/services-installer.sh index d590570..7419af2 100644 --- a/services-installer.sh +++ b/services-installer.sh @@ -4,12 +4,25 @@ PKGVER=v4 iv2sh SetActiveTask `pidof bookshelf.app` 0 PVER=`cat /mnt/secure/.pkgver` -function uninstall() { +base=/mnt/ext1/system/config/settings +settings=$base/settings.json +rootset=$base/rootsettings.json +old=/ebrmain/config/settings/settings.json + +function do_uninstall() + umount /usr/share/terminfo + for n in ins_usbnet rm_usbnet ins_usb_mod rm_usb_mod usb_test; do + umount /lib/modules/$n.sh + done chattr -i /mnt/secure/runonce/*.sh rm -rf /mnt/secure/runonce/*.sh /mnt/secure/bin /mnt/secure/etc /mnt/secure/.pkgver - settings=/mnt/ext1/system/config/settings/settings.json rm -f $settings mv -f $settings.old $settings + # if settings is missing, will be copied from system +end + +function uninstall() { + do_uninstall dialog 2 "" "Services uninstalled, restart is needed." "Restart now" "Restart later" if [ $? == 1 ]; then sync @@ -27,6 +40,7 @@ if [ "$PVER" != "" ]; then elif [ $st == 2 ]; then exit 0 fi + do_uninstall else dialog 1 "" "Version $PVER already installed." "Cancel" "Uninstall" if [ $? == 2 ]; then @@ -62,10 +76,6 @@ if [ ! -e /mnt/secure/etc/passwd ]; then echo -n password=$PW > /mnt/ext1/rootpassword.txt fi -base=/mnt/ext1/system/config/settings -settings=$base/settings.json -rootset=$base/rootsettings.json -old=/ebrmain/config/settings/settings.json if [ -e $settings ] && ! grep rootsettings $settings> /dev/null; then old=$settings.old diff --git a/svc/etc/init.d/01-tzfix.sh b/svc/etc/init.d/01-tzfix.sh index 2de9abe..8686463 100755 --- a/svc/etc/init.d/01-tzfix.sh +++ b/svc/etc/init.d/01-tzfix.sh @@ -1,6 +1,7 @@ #!/bin/sh umount /etc/localtime cp -Lf /etc/localtime /var/tmp/localtime +cp -af /mnt/secure/etc/terminfo /var/tmp/terminfo mount -o bind /var/tmp/localtime /etc/localtime -mount -o bind /mnt/secure/etc/terminfo /usr/share/terminfo +mount -o bind /var/tmp/terminfo /usr/share/terminfo diff --git a/svc/etc/init.d/02-usb.sh b/svc/etc/init.d/02-usb.sh index c675051..75da2af 100755 --- a/svc/etc/init.d/02-usb.sh +++ b/svc/etc/init.d/02-usb.sh @@ -3,11 +3,12 @@ for n in ins_usbnet rm_usbnet ins_usb_mod rm_usb_mod usb_test; do umount /lib/modules/$n.sh done -mount -o bind /mnt/secure/bin/ins_usb_mod.sh /lib/modules/ins_usb_mod.sh -mount -o bind /mnt/secure/bin/rm_usb_mod.sh /lib/modules/rm_usb_mod.sh -mount -o bind /mnt/secure/bin/usb_test.sh /lib/modules/usb_test.sh -mount -o bind /mnt/secure/bin/empty.sh /lib/modules/ins_usbnet.sh -mount -o bind /mnt/secure/bin/empty.sh /lib/modules/rm_usbnet.sh +cp -af /mnt/secure/bin/*.sh /var/tmp/ +mount -o bind /var/tmp/ins_usb_mod.sh /lib/modules/ins_usb_mod.sh +mount -o bind /var/tmp/rm_usb_mod.sh /lib/modules/rm_usb_mod.sh +mount -o bind /var/tmp/usb_test.sh /lib/modules/usb_test.sh +mount -o bind /var/tmp/empty.sh /lib/modules/ins_usbnet.sh +mount -o bind /var/tmp/empty.sh /lib/modules/rm_usbnet.sh cd /sys/class/android_usb/android0 for t in 0 1 2; do echo 0 > enable