Skip to content

Commit

Permalink
fix uninstall/reinstall breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
ezdiy committed Sep 30, 2020
1 parent 2c9dc33 commit eca261d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
22 changes: 16 additions & 6 deletions services-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion svc/etc/init.d/01-tzfix.sh
Original file line number Diff line number Diff line change
@@ -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

11 changes: 6 additions & 5 deletions svc/etc/init.d/02-usb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eca261d

Please sign in to comment.