Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Finless 1.6 init.d support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Finless 1.6 init.d support

    Hi

    I am trying to add additional commands to init.d to switch the state of the USB ethernet adapter to try to solve the not working after restart bug (you have to disable and enable Ethernet for the adapter to work again after each restart).

    I added netcfg eth0 down and up to the wifi00 file in the init.d folder assuming that is already being executed since the WIFI speed is limited to 65mbps.

    But no matter what I do, the commands in the init.d wifi00 file do not appear to get executed - I tried to add a mkdir command so I would know if it was being run and surprise the folder I try to create (in the download folder so it has r/w access) does not work.

    Any hints/ideas where I am going wrong (bound to be me...!)

    Thanks

    #2
    Is this 1.6 for the MK808?

    Please check the following in the ROM for me to confirm I did not foget anything

    1) Open the init.rc file. At the bottom it should have this:
    # Init.d support by Finless
    service runparts /system/xbin/run-parts /system/etc/init.d
    class main
    oneshot

    2) Open /xbin folder and make sure run-parts binary is there.
    Also check permissions on this file to should be rwx r-x r-x

    3) Check permissions on /etc/init.d should be rwx r-x r-x

    4) Make sure your init.d script has this at the top
    #!/system/bin/sh

    5) If you look at init.rc after the run-parts is called the last part is calling a script whtest.sh
    I do not know why this script is there and in fact it appears to be some left over crap.
    In that whtest script it is remounting system and whats wierd it is remounting as ext3.
    mount -o rw,remount -t ext3 /dev/block/mtdblock8 /system
    In fact we have a ext4 system in this ROM.
    Why this is there I do not know. But lets see if that is causing a problem.
    rename whtest.sh to whtest.xx

    6) Finally lets see if busybox is the problem. Install the latest busybox from google play and try it again.

    Let me know what you find. I would test all this but I am in Jury duty so dont have time until probably next week. If none of the above works I will look into it next week.

    Bob
    "Pzebacz im, bo nie wiedzą, co czynią"
    "Прости им, они не ведают, что творят"
    "Perdona loro perché non sanno quello che fanno"
    "Vergib ihnen, denn sie wissen nicht, was sie tun"
    "Vergeef hen want ze weten niet wat ze doen"
    "Pardonne-leur car ils ne savent pas ce qu'ils font"
    "Perdónalos porque no saben que lo que hacen"
    "Oprosti im, jer ne znaju što čine"
    "Forgive them as they know not what they do"





    Comment


      #3
      Originally posted by Finless View Post
      Is this 1.6 for the MK808?

      Please check the following in the ROM for me to confirm I did not foget anything

      1) Open the init.rc file. At the bottom it should have this:
      # Init.d support by Finless
      service runparts /system/xbin/run-parts /system/etc/init.d
      class main
      oneshot

      2) Open /xbin folder and make sure run-parts binary is there.
      Also check permissions on this file to should be rwx r-x r-x

      3) Check permissions on /etc/init.d should be rwx r-x r-x

      4) Make sure your init.d script has this at the top
      #!/system/bin/sh

      5) If you look at init.rc after the run-parts is called the last part is calling a script whtest.sh
      I do not know why this script is there and in fact it appears to be some left over crap.
      In that whtest script it is remounting system and whats wierd it is remounting as ext3.
      mount -o rw,remount -t ext3 /dev/block/mtdblock8 /system
      In fact we have a ext4 system in this ROM.
      Why this is there I do not know. But lets see if that is causing a problem.
      rename whtest.sh to whtest.xx

      6) Finally lets see if busybox is the problem. Install the latest busybox from google play and try it again.

      Let me know what you find. I would test all this but I am in Jury duty so dont have time until probably next week. If none of the above works I will look into it next week.

      Bob
      Hi

      thanks for the reply, I checked it through and:

      1. Is fine
      2. Permissions on run-parts is actually rwxrwxrwx but its a sym link to busybox which is set as per your note
      3. Is fine
      4. Yep, I just bolted on 2 extra lines at the end of the script and if I test it with run-parts -t it is listed and if I run it with run-parts it works.
      5 Tried renaming it to xx, no longer runs but makes no difference
      6. Running the latest now 1.20.2-cm9

      I will keep playing with it and feedback if I manage to solve it, otherwise if you have chance to look next week that would be great.

      Good luck with the Jury service
      Andrew

      Comment


        #4
        Sorry, forgot to say it is the MK808

        Comment


          #5
          So your saying that if you exec run-parts from terminal it runs you script from init.d?

          Bob
          "Pzebacz im, bo nie wiedzą, co czynią"
          "Прости им, они не ведают, что творят"
          "Perdona loro perché non sanno quello che fanno"
          "Vergib ihnen, denn sie wissen nicht, was sie tun"
          "Vergeef hen want ze weten niet wat ze doen"
          "Pardonne-leur car ils ne savent pas ce qu'ils font"
          "Perdónalos porque no saben que lo que hacen"
          "Oprosti im, jer ne znaju što čine"
          "Forgive them as they know not what they do"





          Comment


            #6
            Yes exactly.

            I have the netcfg commands I added but I also added a dumb test line to the 00wifi script to create a dir as so:

            mkdir /sdcard/Download/test

            Executing it with run-parts /system/etc/init.d runs the script fine but despite being in initrc it is not run at boot time.

            The Mkdir command was to leave behind something I can check after reboot - -run the script as root in the terminal window and test is created, reboot and it isn't and of course my other commands are not executed.

            Comment


              #7
              Originally posted by agw9262 View Post
              Yes exactly.

              I have the netcfg commands I added but I also added a dumb test line to the 00wifi script to create a dir as so:

              mkdir /sdcard/Download/test

              Executing it with run-parts /system/etc/init.d runs the script fine but despite being in initrc it is not run at boot time.

              The Mkdir command was to leave behind something I can check after reboot - -run the script as root in the terminal window and test is created, reboot and it isn't and of course my other commands are not executed.
              Hmmm I think I might know what to try next. When I get home from Jury Duty I will make you a new boot.img and I will change class main to class root in the init.rc file for the run-parts call. You will not have to erase NAND and you will only flash boot.img. Which version of boot.img are you using? 720 or 1080?

              If you know how to take apart boot.img you can try it.

              Bob
              "Pzebacz im, bo nie wiedzą, co czynią"
              "Прости им, они не ведают, что творят"
              "Perdona loro perché non sanno quello che fanno"
              "Vergib ihnen, denn sie wissen nicht, was sie tun"
              "Vergeef hen want ze weten niet wat ze doen"
              "Pardonne-leur car ils ne savent pas ce qu'ils font"
              "Perdónalos porque no saben que lo que hacen"
              "Oprosti im, jer ne znaju što čine"
              "Forgive them as they know not what they do"





              Comment


                #8
                I am using the 720 img - I haven't taken one apart before so it will be great when you got time.

                Thanks

                Comment


                  #9
                  They are releasing us from court till 2:30. So give me about 20 minutes (I am only 5 minutes from the courthouse ) and I will have a new boot.img for you soon..

                  Bob
                  "Pzebacz im, bo nie wiedzą, co czynią"
                  "Прости им, они не ведают, что творят"
                  "Perdona loro perché non sanno quello che fanno"
                  "Vergib ihnen, denn sie wissen nicht, was sie tun"
                  "Vergeef hen want ze weten niet wat ze doen"
                  "Pardonne-leur car ils ne savent pas ce qu'ils font"
                  "Perdónalos porque no saben que lo que hacen"
                  "Oprosti im, jer ne znaju što čine"
                  "Forgive them as they know not what they do"





                  Comment


                    #10
                    Try this boot.img



                    1) Download this boot720.img
                    2) Open my ROM flash kit and open the FinlessROM folder. Rename boot720.img to boot720.old
                    3) Copy this new boot720.img to the FinlessROM folder
                    4) Run the flash tool
                    5) Uncheck everything in the list except boot720.img
                    6) Put the MK808 into flash mode using the reboot APP.
                    7) Flash boot.img and test init.d again

                    I made the following changes:

                    1) In init.rc I moved the call to run-parts just below the call for install-recovery.sh. It maybe possible this needs to run before other services.

                    2) I changed the call to this:
                    # Init.d support by Finless
                    service runparts /system/xbin/run-parts /system/etc/init.d
                    class main
                    user root
                    oneshot



                    Let me know how it goes,
                    Bob
                    "Pzebacz im, bo nie wiedzą, co czynią"
                    "Прости им, они не ведают, что творят"
                    "Perdona loro perché non sanno quello che fanno"
                    "Vergib ihnen, denn sie wissen nicht, was sie tun"
                    "Vergeef hen want ze weten niet wat ze doen"
                    "Pardonne-leur car ils ne savent pas ce qu'ils font"
                    "Perdónalos porque no saben que lo que hacen"
                    "Oprosti im, jer ne znaju što čine"
                    "Forgive them as they know not what they do"





                    Comment


                      #11
                      Sadly still no luck, I checked init.rc and can see the changes you have made are there.

                      The script in init.d is named 00wifi (delivered with the ROM):

                      #!/system/bin/sh

                      #sets the wlan0 to 65mbs
                      iwconfig wlan0 rate 65 fixed
                      #turns off power management.
                      iwconfig wlan0 power off
                      #toggle ethernet
                      netcfg eth0 down
                      sleep 2
                      netcfg eth0 up
                      #create false dir
                      mkdir /sdcard/Download/test

                      (Just so you can see exactly what should be executing).

                      Is there a way I can enable boot logging/trace so I can see what is run/fails?

                      Comment


                        #12
                        Googling around, I found this example of initrc:
                        # Run init.d scripts
                        service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
                        class main
                        user root
                        group shell
                        oneshot

                        is it possible that the group has some effect?

                        There is only that statement and the slight difference on the service statement

                        Comment


                          #13
                          Originally posted by agw9262 View Post
                          Googling around, I found this example of initrc:
                          # Run init.d scripts
                          service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
                          class main
                          user root
                          group shell
                          oneshot

                          is it possible that the group has some effect?

                          There is only that statement and the slight difference on the service statement
                          WHen I get home again I will try this approach. That did not work before for me which is the way most ROMs do it. It has to do with kernel support. So maybe this kernel has it.

                          In the mean time try this. Create a install-recovery.sh in /system/etc and set permissions. Edit this and put your script in it. Let's see if init.rc is processing this script at all as stated in init.rc like below:
                          service flash_recovery /system/etc/install-recovery.sh
                          class main
                          oneshot

                          See if your script runs in this script call.

                          Bob
                          "Pzebacz im, bo nie wiedzą, co czynią"
                          "Прости им, они не ведают, что творят"
                          "Perdona loro perché non sanno quello che fanno"
                          "Vergib ihnen, denn sie wissen nicht, was sie tun"
                          "Vergeef hen want ze weten niet wat ze doen"
                          "Pardonne-leur car ils ne savent pas ce qu'ils font"
                          "Perdónalos porque no saben que lo que hacen"
                          "Oprosti im, jer ne znaju što čine"
                          "Forgive them as they know not what they do"





                          Comment


                            #14
                            Originally posted by agw9262 View Post
                            Hi

                            I am trying to add additional commands to init.d to switch the state of the USB ethernet adapter to try to solve the not working after restart bug (you have to disable and enable Ethernet for the adapter to work again after each restart).
                            Hi agw9262,

                            I have ever tried to use Finless ROM V1.5 supported init.d feature to run "ifconfig eth0 up/down" on MK808B during boot for fixing ethernet adapter unable to load issue. Unfortunately, can't make it work as same as you have done.

                            However, it auto loads Ethernet beautifully if I switch plugging USB ethernet adapter from the OTG port to the general USB port on MK808B. So I don't try to fix init.d any more by now. BTW, I have mine MK808B static IP set.

                            Comment


                              #15
                              Originally posted by winson901 View Post
                              Hi agw9262,

                              I have ever tried to use Finless ROM V1.5 supported init.d feature to run "ifconfig eth0 up/down" on MK808B during boot for fixing ethernet adapter unable to load issue. Unfortunately, can't make it work as same as you have done.

                              However, it auto loads Ethernet beautifully if I switch plugging USB ethernet adapter from the OTG port to the general USB port on MK808B. So I don't try to fix init.d any more by now. BTW, I have mine MK808B static IP set.
                              Hi,

                              I have tried it on that port also but still get intermittent availability (I also have static IP config) - mine is the 808 though, not the 808B - not sure that really should matter but still.

                              So the init.d quest continues!

                              thanks for the input though
                              Andrew

                              Comment

                              Working...
                              X