Changeset 45616
- Timestamp:
- 11/15/21 09:31:19 (9 months ago)
- Location:
- titan
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/oealliance/var/etc/autostart/start.sh
r45497 r45616 203 203 startgui() 204 204 { 205 STARTDEFAULT="/usr/local/bin/titan /mnt/config/titan.cfg" 206 207 if [ -e "/var/etc/.checkdualboot" ] && [ -e "/usr/bin/enigma2" ] && [ -e "/usr/share/enigma2/skin.xml" ];then 208 # startbootlogo 209 (sleep 10; killall infobox) & 210 pid=$! 211 if [ -e "/mnt/config/dualboot" ];then 212 infobox -pos -1 75% GUI#2 "Aktiviere Auswahlmenu (TitanNit/Enigma2)" " Dualboot - nein" " Dualboot - ja" ; ret=$? 213 else 214 infobox -pos -1 75% GUI#1 "Aktiviere Auswahlmenu (TitanNit/Enigma2)" " Dualboot - nein" " Dualboot - ja" ; ret=$? 215 fi 216 kill -9 $pid 217 echo " " > /dev/vfd 218 219 if [ "$ret" = "2" ];then 220 infobox -pos -1 75% 2 "Dualboot" " an" & 221 echo enable dualboot 222 touch /mnt/config/dualboot 223 else 224 if [ "$ret" = "1" ];then 225 rm /mnt/config/dualboot 226 infobox -pos -1 75% 2 "Dualboot" " aus" & 227 else 228 if [ -e "/mnt/config/dualboot" ];then 229 infobox -pos -1 75% 2 "Dualboot" " an" & 230 else 231 infobox -pos -1 75% 2 "Dualboot" " aus" & 232 fi 233 fi 234 fi 235 echo "Starting" > /dev/vfd 236 echo remove checkdualboot flag 237 rm -f /var/etc/.checkdualboot 238 sync 239 sleep 10 240 # else 241 # rm -f /etc/rc2.d/* 242 # rm -f /etc/rc3.d/* 243 # rm -f /etc/rcS.d/* 244 fi 245 246 # kill webif 247 fuser -k 80/tcp 248 249 if [ -e /mnt/config/dualboot ] && [ -e "/usr/bin/enigma2" ] && [ -e "/usr/share/enigma2/skin.xml" ];then 250 if [ ! -e /mnt/config/dualboot.titan ] && [ ! -e /mnt/config/dualboot.enigma2 ] || [ -e /mnt/config/dualboot.titan ];then 251 252 (sleep 10; killall infobox) & 253 pid=$! 254 infobox -pos -1 75% GUI#1 "++ DualBoot-Auswahl ++" "---- TitanNit ----" "---- Enigma2 ----" ; ret=$? 255 kill -9 $pid 256 echo " " > /dev/vfd 257 258 case $ret in 259 2) 260 START="/usr/bin/enigma2" 261 rm -f /mnt/config/dualboot.titan 262 touch /mnt/config/dualboot.enigma2 263 $STARTDEFAULT;; 264 *) 265 START="/usr/local/bin/titan /mnt/config/titan.cfg" 266 rm -f /mnt/config/dualboot.enigma2 267 touch /mnt/config/dualboot.titan;; 268 esac 269 else 270 271 (sleep 10; killall infobox) & 272 pid=$! 273 infobox -pos -1 75% GUI#2 "++ DualBoot-Auswahl ++" "---- TitanNit ----" "---- Enigma2 ----" ; ret=$? 274 kill -9 $pid 275 echo " " > /dev/vfd 276 277 case $ret in 278 1) 279 START="/usr/local/bin/titan /mnt/config/titan.cfg" 280 rm -f /mnt/config/dualboot.enigma2 281 touch /mnt/config/dualboot.titan;; 282 *) 283 START="/usr/bin/enigma2" 284 rm -f /mnt/config/dualboot.titan 285 touch /mnt/config/dualboot.enigma2 286 $STARTDEFAULT;; 287 esac 288 fi 289 fi 290 291 # if [ "$START" = "/usr/bin/enigma2" ];then 292 # startInit3 293 # #/usr/bin/showiframe /usr/share/bootlogo.mvi 294 # startbootlogo 295 # fi 296 297 if [ -z "$START" ]; then START="$STARTDEFAULT"; fi 298 299 LD_PRELOAD=$LIBS $START 300 301 # titan exit codes: 302 # 303 # 1 - halt 304 # 2 - reboot 305 # 3 - restart enigma 306 # 307 # >128 signal 308 309 ret=$? 310 311 if [ "$ret" -ne "1" ]; then 312 if [ -e /proc/stb/info/boxtype ]; then 313 stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2` 314 if [ $stbcheck == "u5" ]; then 315 killall -9 showiframe; sleep 5 316 fi 317 stbcheck=`cat /proc/stb/info/boxtype` 318 if [ $stbcheck == "sf8008" ] || [ $stbcheck == "sf8008m" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ] ; then 319 killall -9 libreader; sleep 5 320 fi 321 fi 322 fi 323 324 case $ret in 325 1) 326 /sbin/halt 327 ;; 328 2) 329 if [ -f /proc/stb/fp/force_restart ]; then 330 echo 1 > /proc/stb/fp/force_restart 331 fi 332 /var/etc/autostart/start.sh reboot 333 /sbin/reboot 334 ;; 335 3) 336 rm -fR /home/root/.gstreamer-0.10 337 rm -f /tmp/.listen.camd.socket.ignore 338 ;; 339 4) 340 /sbin/rmmod lcd 341 /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log 342 sleep 1; 343 /sbin/rmmod fp 344 /sbin/modprobe fp 345 /sbin/reboot 346 ;; 347 16) 348 echo "rescue" > /proc/stb/fp/boot_mode 349 /sbin/reboot 350 ;; 351 42) 352 python /usr/lib/enigma2/python/upgrade.pyo 353 ;; 354 43) 355 init 1 356 ;; 357 44) 358 # little hack but it will be fixed soon in drivers 359 /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/bin/fbclear 360 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/wait.mvi 361 echo fpupload >/proc/vfd && sleep 3 && dd bs=256k if=/tmp/micom.bin of=/dev/mcu 362 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/reboot.mvi 363 # Wait forever for the user to power off 364 while(true) ; do sleep 60 ; done 365 ;; 366 45) 367 echo " " > /dev/lcd0 368 /usr/bin/gigablue_wol 369 ;; 370 *) 371 rm -f /tmp/.listen.camd.socket.ignore 372 ;; 373 esac 205 if [ ! -e /tmp/.update ];then 206 STARTDEFAULT="/usr/local/bin/titan /mnt/config/titan.cfg" 207 208 if [ -e "/var/etc/.checkdualboot" ] && [ -e "/usr/bin/enigma2" ] && [ -e "/usr/share/enigma2/skin.xml" ];then 209 # startbootlogo 210 (sleep 10; killall infobox) & 211 pid=$! 212 if [ -e "/mnt/config/dualboot" ];then 213 infobox -pos -1 75% GUI#2 "Aktiviere Auswahlmenu (TitanNit/Enigma2)" " Dualboot - nein" " Dualboot - ja" ; ret=$? 214 else 215 infobox -pos -1 75% GUI#1 "Aktiviere Auswahlmenu (TitanNit/Enigma2)" " Dualboot - nein" " Dualboot - ja" ; ret=$? 216 fi 217 kill -9 $pid 218 echo " " > /dev/vfd 219 220 if [ "$ret" = "2" ];then 221 infobox -pos -1 75% 2 "Dualboot" " an" & 222 echo enable dualboot 223 touch /mnt/config/dualboot 224 else 225 if [ "$ret" = "1" ];then 226 rm /mnt/config/dualboot 227 infobox -pos -1 75% 2 "Dualboot" " aus" & 228 else 229 if [ -e "/mnt/config/dualboot" ];then 230 infobox -pos -1 75% 2 "Dualboot" " an" & 231 else 232 infobox -pos -1 75% 2 "Dualboot" " aus" & 233 fi 234 fi 235 fi 236 echo "Starting" > /dev/vfd 237 echo remove checkdualboot flag 238 rm -f /var/etc/.checkdualboot 239 sync 240 sleep 10 241 # else 242 # rm -f /etc/rc2.d/* 243 # rm -f /etc/rc3.d/* 244 # rm -f /etc/rcS.d/* 245 fi 246 247 # kill webif 248 fuser -k 80/tcp 249 250 if [ -e /mnt/config/dualboot ] && [ -e "/usr/bin/enigma2" ] && [ -e "/usr/share/enigma2/skin.xml" ];then 251 if [ ! -e /mnt/config/dualboot.titan ] && [ ! -e /mnt/config/dualboot.enigma2 ] || [ -e /mnt/config/dualboot.titan ];then 252 253 (sleep 10; killall infobox) & 254 pid=$! 255 infobox -pos -1 75% GUI#1 "++ DualBoot-Auswahl ++" "---- TitanNit ----" "---- Enigma2 ----" ; ret=$? 256 kill -9 $pid 257 echo " " > /dev/vfd 258 259 case $ret in 260 2) 261 START="/usr/bin/enigma2" 262 rm -f /mnt/config/dualboot.titan 263 touch /mnt/config/dualboot.enigma2 264 $STARTDEFAULT;; 265 *) 266 START="/usr/local/bin/titan /mnt/config/titan.cfg" 267 rm -f /mnt/config/dualboot.enigma2 268 touch /mnt/config/dualboot.titan;; 269 esac 270 else 271 272 (sleep 10; killall infobox) & 273 pid=$! 274 infobox -pos -1 75% GUI#2 "++ DualBoot-Auswahl ++" "---- TitanNit ----" "---- Enigma2 ----" ; ret=$? 275 kill -9 $pid 276 echo " " > /dev/vfd 277 278 case $ret in 279 1) 280 START="/usr/local/bin/titan /mnt/config/titan.cfg" 281 rm -f /mnt/config/dualboot.enigma2 282 touch /mnt/config/dualboot.titan;; 283 *) 284 START="/usr/bin/enigma2" 285 rm -f /mnt/config/dualboot.titan 286 touch /mnt/config/dualboot.enigma2 287 $STARTDEFAULT;; 288 esac 289 fi 290 fi 291 292 # if [ "$START" = "/usr/bin/enigma2" ];then 293 # startInit3 294 # #/usr/bin/showiframe /usr/share/bootlogo.mvi 295 # startbootlogo 296 # fi 297 298 if [ -z "$START" ]; then START="$STARTDEFAULT"; fi 299 300 LD_PRELOAD=$LIBS $START 301 302 # titan exit codes: 303 # 304 # 1 - halt 305 # 2 - reboot 306 # 3 - restart enigma 307 # 308 # >128 signal 309 310 ret=$? 311 312 if [ "$ret" -ne "1" ]; then 313 if [ -e /proc/stb/info/boxtype ]; then 314 stbcheck=`cat /proc/stb/info/boxtype | cut -c1-2` 315 if [ $stbcheck == "u5" ]; then 316 killall -9 showiframe; sleep 5 317 fi 318 stbcheck=`cat /proc/stb/info/boxtype` 319 if [ $stbcheck == "sf8008" ] || [ $stbcheck == "sf8008m" ] || [ $stbcheck == "ustym4kpro" ] || [ $stbcheck == "cc1" ] ; then 320 killall -9 libreader; sleep 5 321 fi 322 fi 323 fi 324 325 case $ret in 326 1) 327 /sbin/halt 328 ;; 329 2) 330 if [ -f /proc/stb/fp/force_restart ]; then 331 echo 1 > /proc/stb/fp/force_restart 332 fi 333 /var/etc/autostart/start.sh reboot 334 /sbin/reboot 335 ;; 336 3) 337 rm -fR /home/root/.gstreamer-0.10 338 rm -f /tmp/.listen.camd.socket.ignore 339 ;; 340 4) 341 /sbin/rmmod lcd 342 /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log 343 sleep 1; 344 /sbin/rmmod fp 345 /sbin/modprobe fp 346 /sbin/reboot 347 ;; 348 16) 349 echo "rescue" > /proc/stb/fp/boot_mode 350 /sbin/reboot 351 ;; 352 42) 353 python /usr/lib/enigma2/python/upgrade.pyo 354 ;; 355 43) 356 init 1 357 ;; 358 44) 359 # little hack but it will be fixed soon in drivers 360 /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/bin/fbclear 361 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/wait.mvi 362 echo fpupload >/proc/vfd && sleep 3 && dd bs=256k if=/tmp/micom.bin of=/dev/mcu 363 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/SystemPlugins/MICOMUpgrade/reboot.mvi 364 # Wait forever for the user to power off 365 while(true) ; do sleep 60 ; done 366 ;; 367 45) 368 echo " " > /dev/lcd0 369 /usr/bin/gigablue_wol 370 ;; 371 *) 372 rm -f /tmp/.listen.camd.socket.ignore 373 ;; 374 esac 375 else 376 case $debug in on|full) echo "[$0] [$INPUT] startGui: skip and freez";; esac 377 sleep 200 378 fi 374 379 } 375 380 -
titan/titan/extensions.h
r43913 r45616 524 524 } 525 525 526 #ifdef OVBUILD 527 void screenfeed_ipk(int flag) 528 { 529 char* tmpstr = NULL, *line = NULL, *lastline = NULL; 530 char* pos = NULL; 531 532 tmpstr = readsys(getconfig("feed", NULL), 3); //line3 533 tmpstr = string_replace("src/gz secret http://", "", tmpstr, 1); 534 535 if(tmpstr != NULL) 536 pos = strchr(tmpstr, '/'); 537 if(pos != NULL) 538 pos[0] = '\0'; 539 540 if(tmpstr == NULL || ostrcmp(tmpstr, "") == 0 || ostrcmp(tmpstr, "\n") == 0) 541 tmpstr = ostrcat(tmpstr, "000.000.000.000", 1, 0); 542 543 lastline = numinput(_("Feed"), tmpstr, "000.000.000.000", 1); 544 545 //for devs, who have secret feed not in mind 546 if(ostrcmp("999.999.999.999", lastline) == 0) 547 { 548 free(lastline); lastline = NULL; 549 lastline = ostrcat("097.074.032.010", NULL, 0, 0); 550 } 551 552 if(lastline != NULL) 553 { 554 free(tmpstr); tmpstr = NULL; 555 tmpstr = fixip(lastline, 1); 556 free(lastline); lastline = tmpstr; 557 558 tmpstr = readsys(getconfig("feed", NULL), 1); //line1 559 if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0)) 560 line = ostrcat(line, "#", 1, 0); 561 else 562 line = ostrcat(line, tmpstr, 1, 0); 563 free(tmpstr); tmpstr = NULL; 564 565 if(line[strlen(line) - 1] != '\n') 566 line = ostrcat(line, "\n", 1, 0); 567 568 tmpstr = readsys(getconfig("feed", NULL), 2); //line2 569 if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0)) 570 line = ostrcat(line, "#\n", 1, 0); 571 else 572 line = ostrcat(line, tmpstr, 1, 0); 573 free(tmpstr); tmpstr = NULL; 574 575 if(line[strlen(line) - 1] == '\n') 576 tmpstr = ostrcat(line, "src/gz secret http://", 0, 0); 577 else 578 tmpstr = ostrcat(line, "\nsrc/gz secret http://", 0, 0); 579 580 if(strlen(lastline) == 0) 581 { 582 free(tmpstr); 583 tmpstr = ostrcat(line, NULL, 0, 0); 584 } 585 586 tmpstr = ostrcat(tmpstr, lastline, 1, 0); 587 tmpstr = ostrcat(tmpstr, "/svn/ipk/sh4/titan", 1, 0); 588 writesys(getconfig("feed", NULL), tmpstr, 0); 589 } 590 591 free(tmpstr); 592 free(line); 593 free(lastline); 594 } 595 596 void screenextensions_ipk(int mode, char* path, char* defentry, int first) 597 { 598 char* tmpstr = NULL, *tmpinfo = NULL; 599 struct menulist* mlist = NULL, *mbox = NULL; 600 struct menulist* mlist1 = NULL, *mbox1 = NULL; 601 struct skin* load = getscreen("loading"); 602 603 status.hangtime = 99999; 604 605 if(mode == 0) 606 { 607 drawscreen(load, 0, 0); 608 609 ipkg_update(); 610 ipkg_list(); 611 612 clearscreen(load); 613 614 mbox = ipkmenulist(mlist, NULL, _("Ipk Install - select section"), NULL, NULL, 1, defentry, 0); 615 616 if(mbox != NULL) 617 { 618 debug(130, "section: %s", mbox->name); 619 mbox1 = ipkmenulist(mlist1, "ipkinstall", "Ipk Install - select file", "/tmp/preview", mbox->name, 2, NULL, 1); 620 621 if(mbox1 != NULL) 622 { 623 debug(130, "file: %s", mbox1->name); 624 tmpstr = ostrcat("titan-plugin-", mbox->name, 0, 0); 625 tmpstr = ostrcat(tmpstr, "-", 1, 0); 626 tmpstr = ostrcat(tmpstr, mbox1->param, 1, 0); 627 628 tmpinfo = ostrcat(tmpinfo, _("Installing"), 1, 0); 629 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 630 tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); 631 tmpinfo = ostrcat(tmpinfo, "-", 1, 0); 632 tmpinfo = ostrcat(tmpinfo, mbox1->name, 1, 0); 633 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 634 tmpinfo = ostrcat(tmpinfo, _("started"), 1, 0); 635 tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); 636 637 if(textbox(_("Ipk Install Info"), _(tmpinfo), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1) 638 { 639 drawscreen(load, 0, 0); 640 resettvpic(); 641 char* log = NULL; 642 if(ipkg_install(tmpstr) == 0) 643 { 644 log = readfiletomem("/tmp/ipkg.log", 0); 645 if(log == NULL) log = ostrcat("Install success", NULL, 0, 0); 646 textbox(_("Ipk Install Info - Install OK"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); 647 } 648 else 649 { 650 log = readfiletomem("/tmp/ipkg.log", 0); 651 if(log == NULL) log = ostrcat("Install error", NULL, 0, 0); 652 textbox(_("Ipk Install Info - Install ERROR"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); 653 } 654 textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0); 655 loadplugin(); 656 free(log), log = NULL; 657 unlink("/tmp/ipkg.log"); 658 if(file_exist("/tmp/.ipkg_needs_reboot")) 659 { 660 textbox(_("Message"), _("IPK Install Done your system rebooting !"), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); 661 system("init 6"); 662 } 663 } 664 } 665 } 666 /* 667 freemenulist(mlist1, 1); mlist1 = NULL; 668 freemenulist(mlist, 1); mlist = NULL; 669 free(tmpstr); tmpstr = NULL; 670 free(tmpinfo); tmpinfo = NULL; 671 freeipkg(); 672 if(mbox != NULL) screenextensions_ipk(0, path); 673 */ 674 675 // free(installpath); installpath = NULL; 676 free(tmpstr); tmpstr = NULL; 677 freemenulist(mlist1, 0); mlist1 = NULL; 678 if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); 679 freemenulist(mlist, 0); mlist = NULL; 680 free(tmpinfo); tmpinfo = NULL; 681 freeipkg(); 682 if(mbox != NULL) screenextensions_ipk(0, path, tmpstr, 0); 683 free(tmpstr); tmpstr = NULL; 684 } 685 else if(mode == 1) 686 { 687 ipkg_list_installed(); 688 mbox = ipkmenulist(mlist, NULL, _("Ipk Remove - select file"), NULL, NULL, 1, defentry, 2); 689 690 if(mbox != NULL) 691 { 692 debug(130, "file: %s", mbox->name); 693 694 tmpstr = ostrcat("titan-plugin-", mbox->name, 0, 0); 695 696 tmpinfo = ostrcat(tmpinfo, _("Removeing"), 1, 0); 697 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 698 tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); 699 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 700 tmpinfo = ostrcat(tmpinfo, _("started"), 1, 0); 701 tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); 702 703 if(textbox(_("Ipk Remove Info"), _(tmpinfo), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1) 704 { 705 drawscreen(load, 0, 0); 706 resettvpic(); 707 char* log = NULL; 708 if(ipkg_remove(tmpstr, 1) == 0) 709 { 710 log = readfiletomem("/tmp/ipkg.log", 0); 711 if(log == NULL) log = ostrcat("Remove success", NULL, 0, 0); 712 textbox(_("Ipk Remove Info - Remove OK"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); 713 } 714 else 715 { 716 log = readfiletomem("/tmp/ipkg.log", 0); 717 if(log == NULL) log = ostrcat("Remove error", NULL, 0, 0); 718 textbox(_("Ipk Remove Info - Remove ERROR"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); 719 } 720 textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0); 721 free(log), log = NULL; 722 unlink("/tmp/ipkg.log"); 723 if(file_exist("/tmp/.ipkg_needs_reboot")) 724 { 725 textbox(_("Message"), _("IPK Remove Done your system rebooting !"), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); 726 system("init 6"); 727 } 728 } 729 } 730 /* 731 freemenulist(mlist, 1); mlist = NULL; 732 free(tmpstr); tmpstr = NULL; 733 free(tmpinfo); tmpinfo = NULL; 734 freeipkg(); 735 if(mbox != NULL) screenextensions_ipk(1, path); 736 */ 737 free(tmpstr); tmpstr = NULL; 738 freemenulist(mlist, 0); mlist = NULL; 739 if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); 740 free(tmpinfo); tmpinfo = NULL; 741 freeipkg(); 742 if(mbox != NULL) screenextensions_ipk(1, path, tmpstr, 0); 743 free(tmpstr); tmpstr = NULL; 744 } 745 else if(mode == 2) 746 { 747 char* text1 = "Ipk Tmp Install - select file"; 748 char* text2 = "Ipk Tmp Info"; 749 750 if(path == NULL) 751 tmpstr = get_ipk_tmplistinstall("/tmp"); 752 else 753 { 754 tmpstr = get_ipk_tmplistinstall(path); 755 text1 = "Ipk Media Install - select file"; 756 text2 = "Ipk Media Info"; 757 } 758 759 if(tmpstr == NULL || strlen(tmpstr) == 0) 760 { 761 textbox(_("Message"), _("No plugin found."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); 762 } 763 else 764 { 765 addmenulistall(&mlist, tmpstr, NULL, 0, defentry); 766 mbox = menulistbox(mlist, NULL, text1, NULL, NULL, "/skin/plugin.png", 1, 0); 767 } 768 769 free(tmpstr); tmpstr = NULL; 770 771 if(mbox != NULL) 772 { 773 debug(130, "file: %s", mbox->name); 774 775 tmpinfo = ostrcat(tmpinfo, _("Installing"), 1, 0); 776 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 777 tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); 778 tmpinfo = ostrcat(tmpinfo, " ", 1, 0); 779 tmpinfo = ostrcat(tmpinfo, _("started"), 1, 0); 780 tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); 781 782 if(textbox(_(text2), _(tmpinfo), "EXIT", getrcconfigint("rcexit", NULL), "OK", getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 2) 783 { 784 char* log = NULL; 785 drawscreen(load, 0, 0); 786 resettvpic(); 787 if(path == NULL) 788 log = get_ipk_tmpinstall("/tmp", mbox->name); 789 else 790 log = get_ipk_tmpinstall(path, mbox->name); 791 792 if(log == NULL) log = ostrcat("No output found !", NULL, 0, 0); 793 textbox(_(text2), log, "EXIT", getrcconfigint("rcexit", NULL), "OK", getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, 800, 600, 0, 0); 794 free(log); log = NULL; 795 textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); 796 loadplugin(); 797 if(file_exist("/tmp/.ipkg_needs_reboot")) 798 { 799 textbox(_("Message"), _("IPK Tmp Install Done your system rebooting !"), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); 800 system("init 6"); 801 } 802 } 803 } 804 /* 805 freemenulist(mlist, 1); mlist = NULL; 806 free(tmpstr); tmpstr = NULL; 807 free(tmpinfo); tmpinfo = NULL; 808 if(mbox != NULL) screenextensions_ipk(2, path); 809 */ 810 // free(installpath); installpath = NULL; 811 free(tmpstr); tmpstr = NULL; 812 freemenulist(mlist, 0); mlist = NULL; 813 if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); 814 free(tmpinfo); tmpinfo = NULL; 815 if(mbox != NULL) screenextensions_ipk(2, path, tmpstr, 0); 816 free(tmpstr); tmpstr = NULL; 817 } 818 else if(mode == 3) 819 { 820 drawscreen(load, 0, 0); 821 resettvpic(); 822 unlink("/tmp/ipkg.log"); 823 writesys("/tmp/.ipkg_upgrade_start", "0", 0); 824 ipkg_update(); 825 ipkg_upgrade(); 826 freeipkg(); 827 loadplugin(); 828 clearscreen(load); 829 drawscreen(skin, 0, 0); 830 831 if(file_exist("/tmp/.ipkg_needs_reboot")) 832 { 833 textbox(_("Message"), _("IPK Upgrade Done your system rebooting !"), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); 834 system("init 6"); 835 } 836 unlink("/tmp/.ipkg_upgrade_start"); 837 } 838 status.hangtime = getconfigint("hangtime", NULL); 839 } 840 841 //flag 0: without message 842 //flag 1: with message 843 void screenextensions_check_ipk(int flag) 844 { 845 int treffer = 0; 846 struct hdd *node = NULL; 847 char* tmpstr = NULL, *tmpstr1 = NULL; 848 849 if(status.security == 1) 850 { 851 addhddall(); 852 node = hdd; 853 854 while(node != NULL) 855 { 856 if(node->partition != 0) 857 { 858 tmpstr = ostrcat("/autofs/", node->device, 0, 0); 859 tmpstr1 = get_ipk_tmplistinstall(tmpstr); 860 861 if(tmpstr1 != NULL) 862 { 863 treffer = 1; 864 screenextensions_ipk(2, tmpstr, NULL, 1); 865 } 866 867 free(tmpstr); tmpstr = NULL; 868 free(tmpstr1); tmpstr1 = NULL; 869 } 870 node = node->next; 871 } 872 873 if(flag == 1 && treffer == 0) 874 textbox(_("Ipk Install Info"), _("No plugin found."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); 875 } 876 } 526 877 #endif 878 879 #endif -
titan/titan/header.h
r45606 r45616 263 263 void screenextensions_check(int flag); 264 264 char* gettpklog(char* installpath, int flag); 265 void screenfeed_ipk(int flag); 266 void screenextensions_ipk(int mode, char* path, char* defentry, int first); 267 void screenextensions_check_ipk(int flag); 265 268 266 269 //...port.h … … 472 475 void screennetwork_test(); 473 476 void screennetwork_wlan(); 474 void screennetwork_password();475 477 void screennetwork_password(); 476 478 … … 695 697 void setmenulistdefault(struct menulist* mlist, char* defaultentry); 696 698 void changemenulistparam(struct menulist* mlist, char* param, char* param1, char* param2, char* param3); 699 700 #ifdef OVBUILD 701 //ipkg.h 702 void freeipkg(); 703 int ipkg_update(void); 704 int ipkg_upgrade(void); 705 int ipkg_list(void); 706 int ipkg_install(const char* package); 707 int ipkg_remove(const char* package, int purge); 708 709 struct menulist* ipkmenulist(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* section, int showpng, char* defentry, int flag); 710 int ipkg_list_installed(void); 711 #endif 697 712 698 713 //skinfunc.h … … 1086 1101 #endif 1087 1102 1088 #ifdef OEBUILD1089 //ipkg.h1090 void freeipkg();1091 int ipkg_update(void);1092 int ipkg_upgrade(void);1093 int ipkg_list(void);1094 int ipkg_install(const char* package);1095 int ipkg_remove(const char* package, int purge);1096 struct menulist* ipkmenulist(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* section, int showpng, int flag);1097 int ipkg_list_installed(void);1098 1103 #endif 1099 1100 #endif -
titan/titan/ipkg.h
r45473 r45616 468 468 return sectionlist; 469 469 } 470 470 /* 471 use from tpk.h 471 472 int findsectiondone(char* section) 472 473 { … … 484 485 return 0; 485 486 } 486 487 */ 487 488 //flag 0: show section 488 489 //flag 1: show entrys 489 490 //flag 2: show entrys for remove 490 struct menulist* ipkmenulist(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* section, int showpng, int flag)491 struct menulist* ipkmenulist(struct menulist* mlist, char* paramskinname, char* skintitle, char* paramskinpath, char* section, int showpng, char* defentry, int flag) 491 492 { 492 493 int skip = 0; … … 586 587 587 588 tmpmlist = addmenulist(&mlist, tmpstr, tmpinfo, tmppic, 0, 0); 588 changemenulistparam(tmpmlist, node->showname, NULL); 589 // changemenulistparam(tmpmlist, node->name, node->titanname, NULL, NULL); 590 changemenulistparam(tmpmlist, node->name, node->name, NULL, NULL); 591 589 592 free(tmpstr); tmpstr = NULL; 590 593 free(tmpinfo); tmpinfo = NULL; … … 603 606 } 604 607 605 return menulistbox(mlist, paramskinname, skintitle, paramskinpath, "/skin/plugin.png", showpng, 0); 608 setmenulistdefault(mlist, defentry); 609 return menulistbox(mlist, paramskinname, skintitle, NULL, paramskinpath, "/skin/plugin.png", showpng, 0); 606 610 } 607 611 -
titan/titan/menu.h
r45391 r45616 837 837 screenextensions_check(1); 838 838 } 839 else if(ostrcmp("feed_ipk", menuentry->name) == 0) 840 { 841 if(check == 1) return 0; 842 screenfeed_ipk(0); 843 } 844 else if(ostrcmp("extensions_ipkinstall", menuentry->name) == 0) 845 { 846 if(check == 1) return 0; 847 screenextensions_ipk(0, NULL, NULL, 1); 848 } 849 else if(ostrcmp("extensions_ipkremove", menuentry->name) == 0) 850 { 851 if(check == 1) return 0; 852 screenextensions_ipk(1, NULL, NULL, 1); 853 } 854 else if(ostrcmp("extensions_imptpkinstall", menuentry->name) == 0) 855 { 856 if(check == 1) return 0; 857 screenextensions_ipk(2, NULL, NULL, 1); 858 } 859 else if(ostrcmp("extensions_ipkupgrade", menuentry->name) == 0) 860 { 861 if(check == 1) return 0; 862 screenextensions_ipk(3, NULL, NULL, 1); 863 } 864 else if(ostrcmp("extensions_mediatikinstall", menuentry->name) == 0) 865 { 866 if(check == 1) return 0; 867 screenextensions_check_ipk(1); 868 } 839 869 else if(ostrcmp("system_update_flash_online", menuentry->name) == 0) 840 870 { -
titan/titan/network.h
r45606 r45616 1014 1014 } 1015 1015 1016 void screennetwork_ipsec()1017 {1018 int rcret = 0;1019 char* tmpstr = NULL;1020 char* ret = NULL;1021 char* cmd = NULL;1022 char* user = NULL;1023 char* pass = NULL;1024 char* dyndns = NULL;1025 char* rekey = NULL;1026 char* psk = NULL;1027 char* name = NULL;1028 char* id = NULL;1029 1030 struct skin* ipsec = getscreen("ipsecsettings");1031 struct skin* listbox = getscreennode(ipsec, "listbox");1032 struct skin* skin_name = getscreennode(ipsec, "name");1033 struct skin* skin_user = getscreennode(ipsec, "user");1034 struct skin* skin_pass = getscreennode(ipsec, "pass");1035 struct skin* skin_psk = getscreennode(ipsec, "psk");1036 struct skin* skin_dyndns = getscreennode(ipsec, "dyndns");1037 struct skin* skin_id = getscreennode(ipsec, "id");1038 struct skin* skin_rekey = getscreennode(ipsec, "rekey");1039 struct skin* tmp = NULL;1040 1041 if(!file_exist("/mnt/network/ipsec.conf"))1042 system("cp /etc/titan.restore/mnt/network/ipsec.conf /mnt/network/ipsec.conf");1043 1044 if(!file_exist("/mnt/network/ipsec.secret"))1045 system("cp /etc/titan.restore/mnt/network/ipsec.secret /mnt/network/ipsec.secret");1046 1047 name = string_newline(command("cat /mnt/network/ipsec.conf | grep -v '^#' | grep -v %default | sed -nr 's/.*conn ([^ ]+).*/\\1/p'"));1048 user = string_newline(command("cat /mnt/network/ipsec.conf | grep -v '^#' | sed -nr 's/.*xauth_identity=([^=]+).*/\\1/p'"));1049 pass = string_newline(command("cat /mnt/network/ipsec.secrets | grep -v '^#' | sed -nr 's/.*: XAUTH \"([^\"]+)\".*/\\1/p'"));1050 dyndns = string_newline(command("cat /mnt/network/ipsec.conf | grep -v '^#' | sed -nr 's/.*right=([^=]+).*/\\1/p'"));1051 rekey = string_newline(command("cat /mnt/network/ipsec.conf | grep -v '^#' | sed -nr 's/.*rekey=([^=]+).*/\\1/p'"));1052 psk = string_newline(command("cat /mnt/network/ipsec.secrets | grep -v '^#' | sed -nr 's/.*%any : PSK \"([^\"]+)\".*/\\1/p'"));1053 id = string_newline(command("cat /mnt/network/ipsec.conf | grep -v '^#' | sed -nr 's/.*leftid=keyid:([^:]+).*/\\1/p'"));1054 1055 printf("name: %s\n", name);1056 printf("user: %s\n", user);1057 printf("pass: %s\n", pass);1058 printf("dyndns: %s\n", dyndns);1059 printf("rekey: %s\n", rekey);1060 printf("psk: %s\n", psk);1061 printf("id: %s\n", id);1062 1063 changemask(skin_name, "abcdefghijklmnopqrstuvwxyz");1064 changeinput(skin_name, name);1065 1066 changemask(skin_user, "abcdefghijklmnopqrstuvwxyz");1067 changeinput(skin_user, user);1068 1069 changemask(skin_pass, "abcdefghijklmnopqrstuvwxyz");1070 changeinput(skin_pass, pass);1071 1072 changemask(skin_dyndns, "abcdefghijklmnopqrstuvwxyz");1073 changeinput(skin_dyndns, dyndns);1074 1075 changemask(skin_psk, "abcdefghijklmnopqrstuvwxyz");1076 changeinput(skin_psk, psk);1077 1078 changemask(skin_id, "abcdefghijklmnopqrstuvwxyz");1079 changeinput(skin_id, id);1080 1081 addchoicebox(skin_rekey, "no", _("no"));1082 addchoicebox(skin_rekey, "yes", _("yes"));1083 setchoiceboxselection(skin_rekey, rekey);1084 1085 drawscreen(ipsec, 0, 0);1086 addscreenrc(ipsec, listbox);1087 1088 tmp = listbox->select;1089 while(1)1090 {1091 addscreenrc(ipsec, tmp);1092 rcret = waitrc(ipsec, 0, 0);1093 tmp = listbox->select;1094 1095 if(rcret == getrcconfigint("rcexit", NULL)) break;1096 if(rcret == getrcconfigint("rcok", NULL))1097 {1098 if(skin_name->ret != NULL)1099 {1100 cmd = ostrcat("cat /mnt/network/ipsec.conf | sed 's/.*conn $%.*/conn ", skin_name->ret, 0, 0);1101 cmd = ostrcat(cmd,"/'", 1, 0);1102 printf("cmd: %s\n", cmd);1103 system(cmd);1104 free(cmd), cmd = NULL;1105 }1106 1107 if(skin_user->ret != NULL)1108 {1109 cmd = ostrcat("cat /mnt/network/ipsec.conf | sed 's/.*xauth_identity=.*/xauth_identity=", skin_user->ret, 0, 0);1110 cmd = ostrcat(cmd,"/'", 1, 0);1111 printf("cmd: %s\n", cmd);1112 system(cmd);1113 free(cmd), cmd = NULL;1114 }1115 1116 if(skin_id->ret != NULL)1117 {1118 cmd = ostrcat("cat /mnt/network/ipsec.conf | sed 's/.*leftid=keyid:.*/leftid=keyid:", skin_id->ret, 0, 0);1119 cmd = ostrcat(cmd,"/'", 1, 0);1120 printf("cmd: %s\n", cmd);1121 system(cmd);1122 free(cmd), cmd = NULL;1123 }1124 1125 if(skin_dyndns->ret != NULL)1126 {1127 cmd = ostrcat("cat /mnt/network/ipsec.conf | sed 's/.*right=.*/right=", skin_dyndns->ret, 0, 0);1128 cmd = ostrcat(cmd,"/'", 1, 0);1129 printf("cmd: %s\n", cmd);1130 system(cmd);1131 free(cmd), cmd = NULL;1132 }1133 1134 if(skin_rekey->ret != NULL)1135 {1136 cmd = ostrcat("cat /mnt/network/ipsec.conf | sed 's/.*rekey=.*/rekey=", skin_rekey->ret, 0, 0);1137 cmd = ostrcat(cmd,"/'", 1, 0);1138 printf("cmd: %s\n", cmd);1139 system(cmd);1140 free(cmd), cmd = NULL;1141 }1142 1143 if(skin_pass->ret != NULL)1144 {1145 cmd = ostrcat("cat /mnt/network/ipsec.secrets | sed 's/.*: XAUTH \".*/: XAUTH \"", skin_pass->ret, 0, 0);1146 cmd = ostrcat(cmd,"\"/'", 1, 0);1147 printf("cmd: %s\n", cmd);1148 system(cmd);1149 free(cmd), cmd = NULL;1150 }1151 1152 if(skin_psk->ret != NULL)1153 {1154 cmd = ostrcat("cat /mnt/network/ipsec.secrets | sed 's/%any : PSK \".*/%any : PSK \"", skin_psk->ret, 0, 0);1155 cmd = ostrcat(cmd,"\"/'", 1, 0);1156 printf("cmd: %s\n", cmd);1157 system(cmd);1158 free(cmd), cmd = NULL;1159 }1160 1161 if(skin_user->ret != NULL)1162 {1163 cmd = ostrcat("cat /mnt/network/ipsec.secrets | sed 's/.* : XAUTH/", skin_user->ret, 0, 0);1164 cmd = ostrcat(cmd," : XAUTH/'", 1, 0);1165 printf("cmd: %s\n", cmd);1166 system(cmd);1167 free(cmd), cmd = NULL;1168 }1169 1170 debug(99, "name: %s", skin_name->ret);1171 debug(99, "user: %s", skin_user->ret);1172 debug(99, "pass: %s", skin_pass->ret);1173 debug(99, "dyndns: %s", skin_dyndns->ret);1174 debug(99, "psk: %s", skin_psk->ret);1175 debug(99, "id: %s", skin_id->ret);1176 debug(99, "rekey: %s", skin_rekey->ret);1177 1178 break;1179 }1180 }1181 delownerrc(ipsec);1182 clearscreen(ipsec);1183 }1184 1185 1016 #endif -
titan/titan/struct.h
r45517 r45616 122 122 #endif 123 123 124 #define DRIVER " - -"124 #define DRIVER "" 125 125 #define OVERSION "1.97" 126 126 #define PROGNAME "titan" -
titan/titan/system_update.h
r45473 r45616 203 203 #ifdef OEBUILD 204 204 if(node->imgtype == 1) 205 cmd = ostrcat(cmd, " dev openaaf.dyndns.tv", 1, 0);205 cmd = ostrcat(cmd, " dev beta.dyndns.tv", 1, 0); 206 206 else 207 207 cmd = ostrcat(cmd, " release openaaf.dyndns.tv", 1, 0); … … 252 252 #ifdef OEBUILD 253 253 if(node->imgtype == 1) 254 cmd = ostrcat(cmd, " dev openaaf.dyndns.tv", 1, 0);254 cmd = ostrcat(cmd, " dev beta.dyndns.tv", 1, 0); 255 255 else 256 256 cmd = ostrcat(cmd, " release openaaf.dyndns.tv", 1, 0); … … 327 327 #ifdef OEBUILD 328 328 if(node->imgtype == 1) 329 cmd = ostrcat(cmd, " dev openaaf.dyndns.tv", 1, 0);329 cmd = ostrcat(cmd, " dev beta.dyndns.tv", 1, 0); 330 330 else 331 331 cmd = ostrcat(cmd, " release openaaf.dyndns.tv", 1, 0); … … 438 438 system(cmd); 439 439 #ifdef OEBUILD 440 sleep(3); 440 if(!file_exist("/tmp/.update")) 441 sleep(200); 442 else 443 sleep(3); 441 444 textbox(_("Message"), _("Multiboot installation completed successfully\nActivate your new startup"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0); 442 445 #else -
titan/titan/titan.c
r45523 r45616 10 10 #define SYSCODE 0UL 11 11 #define HTTPAUTH "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=" 12 13 #ifdef OVBUILD 14 #define IPKG_LIB 15 #include "../libipkg/config.h" 16 #include "../libipkg/libipkg.h" 17 #include "../libipkg/args.h" 18 #include "../libipkg/ipkg_cmd.h" 19 #endif 12 20 13 21 struct clist *config[LISTHASHSIZE] = {NULL}; … … 89 97 #include "oldentry.h" 90 98 #include "tpk.h" 99 #ifdef OVBUILD 100 #include "ipkg.h" 101 #endif 91 102 #include "queue.h" 92 103 #include "channelcache.h" … … 271 282 #endif 272 283 273 #define TIMECODE "1 543512105"284 #define TIMECODE "1636829031" 274 285 #if !defined(HAVE_HISILICON_ACCEL) 275 286 // mipsel start
Note: See TracChangeset
for help on using the changeset viewer.