Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone does not boots after init.d was created #3

Open
skyh opened this issue Aug 6, 2013 · 29 comments
Open

Phone does not boots after init.d was created #3

skyh opened this issue Aug 6, 2013 · 29 comments

Comments

@skyh
Copy link

skyh commented Aug 6, 2013

After enabling mounts2sd init.d, phone does not boots normally. Only recovery.

Config:
Motorola Droid (Milestone) A853
OpenRecovery 2ndboot
CyanogenMod 7
Steps to reproduce:
mounts2sd enable busybox -> reboot
mounts2sd enable init.d -> reboot = fail

No others ext-sd software was installed.

@dbergloev
Copy link
Member

The script has been tested on CM7, 9, 10.1, and 10.2 with success, so I will need a little more details. A logcat from the boot would be nice.

@skyh
Copy link
Author

skyh commented Aug 12, 2013

I can't run logcat because phone can't boot. Logcat in recovery contains only BATTD and usbd info messages. I have original 05mountsd script from init.d. Here it is:

#!/system/bin/sh
#
# mount ext partition from sd card

# skip mount if power-up reason is charge only
if grep -Fq "POWERUPREASON : 0x00000100" /proc/bootinfo
then
    setprop cm.mountsd.done 1;
    exit 0;
fi

BB="logwrapper busybox";

if [ "$SD_EXT_DIRECTORY" = "" ];
then
    SD_EXT_DIRECTORY=/sd-ext;
fi

# find SD Card
for MMC_NUM in `seq 0 9`;
do
    MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type`
    if [ "$MMC_TYPE" = "SD" ];
    then
        # 2nd partition of sdcard should be the sd-ext if exist
        SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2
        break
    fi
done

if [ -b "$SD_EXT_PART" ];
then
    log -p i -t mountsd "Checking filesystems..";

    # fsck the sdcard filesystem first
    if [ -x `which e2fsck` ];
    then
        e2fsck -y $SD_EXT_PART
        e2fsk_exitcode=$?
    else
        echo "executable e2fsck not found, assuming no filesystem errors"
        e2fsk_exitcode=0
    fi

    # set property with exit code in case an error occurs
    setprop cm.e2fsck.errors $e2fsk_exitcode;
    if [ "$e2fsk_exitcode" -lt 2 ];
    then
        # mount and set perms
        $BB mount -o noatime,nodiratime,barrier=1 -t auto $SD_EXT_PART $SD_EXT_DIRECTORY;
        if [ "$?" = 0 ];
        then
            $BB chown 1000:1000 $SD_EXT_DIRECTORY;
            $BB chmod 771 $SD_EXT_DIRECTORY;
            log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted";
        else
            log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!";
        fi
    else
        log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
    fi
fi
setprop cm.mountsd.done 1;

@dbergloev
Copy link
Member

This is not my script. So either you are not using Mounts2SD, or you have multiple sd-ext scripts installed. Install the Mounts2SD application (I would go with the Beta release, much better) and install the script from within the application settings. This will also auto remove any existing sd-ext script.

@skyh
Copy link
Author

skyh commented Aug 12, 2013

I use app. This was an example of default CM script. I will try to split your script and run slices separately.

@dbergloev
Copy link
Member

You could do something else instead. Just add an init.d script that is executed before M2SD which prints logcat to a file.

#!/system/bin/sh

(
    logcat > /data/log.txt
) & 

killall logwrapper

exit 0

Now just let it run for a minute or so, then reboot into recovery and grab /data/log.txt

@skyh
Copy link
Author

skyh commented Aug 12, 2013

OK, I will do it. There is another strange thing. I replaced 10mounts2sd with default script and phone still is dead %)

@skyh
Copy link
Author

skyh commented Aug 12, 2013

I replaced 10mounts2sd with default script and phone still is dead %)

Oh, I forgot about chmod+chown. Default script works fine

@skyh
Copy link
Author

skyh commented Aug 12, 2013

log.txt http://pastebin.com/bsANKN6D

@dbergloev
Copy link
Member

Great, but could you enable debug and try again. It will provide more log information

echo 1 > /data/property/m2sd.enable_debug

@skyh
Copy link
Author

skyh commented Aug 12, 2013

log.txt m2sd.enable_debug=1 https://gist.github.com/skyh/ddbaf1a190e8b06e1d53 (pastebin limits pastes over 500 kB)

@dbergloev
Copy link
Member

Is this an official CM7 ROM? Could you provide a listing of /data and /sd-ext so that I can see which files and folders are in these locations?

@skyh
Copy link
Author

skyh commented Aug 12, 2013

Go to IM? My skype is andrey.skyh.ivlev

@skyh
Copy link
Author

skyh commented Aug 12, 2013

or any other realtime messaging

@skyh
Copy link
Author

skyh commented Aug 12, 2013

/sd-ext (mounted as /sddata from recovery) https://gist.github.com/skyh/3b2b28cd05d45925e328
/data https://gist.github.com/skyh/037a290c030563c4ece4

@skyh
Copy link
Author

skyh commented Aug 15, 2013

Logs after re-partitioning SD-card and clean CM7 + Mounts2SD (from Google Play) installation. https://gist.github.com/skyh/44d83f66dcf9d8962f93

@dbergloev
Copy link
Member

That is strange, but could you try with the beta version instead? It's a new and different script. It's not that important if the old one works or not, as it is soon to be replaced.

@skyh
Copy link
Author

skyh commented Aug 15, 2013

@dbergloev
Copy link
Member

So one script hangs while the other create boot loop issues. I think this has to do with the init.d work-around for service implemented init.d methods. Both scripts uses different work-arounds.

Try enabling safe-mode

echo 0 > /data/property/m2sd.disable_safemode

This will disable the work-arounds

Or you could implement a proper init.d method with Init.d Injector

@skyh
Copy link
Author

skyh commented Aug 15, 2013

Safe mode does not helps. And I don't understand how to use init.d injector. I think it would be good to add a warning to Milestone users :)

@dbergloev
Copy link
Member

Could you provide a link to your ROM's XDA Thread? I would like to take a closer look on how this ROM is structured, because it should work.

EDIT:

Maybe you should try this version instead. I forgot that I have already had this issue once with a beta test user who helped me correct a lot of issues. However, these updates has not yet been uploaded to the XDA Thread, which I forgot. So the beta version on XDA is not the newest version. Sorry :)

@skyh
Copy link
Author

skyh commented Aug 16, 2013

XDA thread [ROM] CyanogenMod 7.2.4f (Android 2.3.7) http://forum.xda-developers.com/showthread.php?t=941346 I don't use APK from XDA, I use eclipse-builded StatusActivity.apk from github sources. I will try this 3.0.2_beta4 :)

@skyh
Copy link
Author

skyh commented Aug 16, 2013

Logcat from beta4, https://gist.github.com/skyh/0a2369ff2c47db657cd3. During boot process phone become very hot and used almost 100% of battery.

@dbergloev
Copy link
Member

Okay thanks. I will have a look at your ROM some time to day, and see if the answer is somewhere to be found. There must be some specific structure in that ROM that M2SD is not built to handle correctly.

@dbergloev
Copy link
Member

I have looked at your ROM, and the ROM in it self does not look any different than any other regular CM release. However, I can not find anything in your kernel which executes the init.d directory? Do you manually add this support in some way?

I think you should give init.d injector a go. You can download it from here. It quite simple to use.

  1. Reboot into recovery
  2. Choose to flash a zip from your sdcard
  3. Select the init.d injector zip package
  4. This will open an Aroma installer. From here, just select the first option to inject current boot.img
  5. Done. Just reboot your device and see if this will sort out your issue.

(And of cause, backup first)

@skyh
Copy link
Author

skyh commented Aug 20, 2013

No, I didn't. Just installed as described in CM manual.

Пользователь Daniel Bergløv [email protected] писал:

I have looked at your ROM, and the ROM in it self does not look any different than any other regular CM release. However, I can not find anything in your kernel which executes the init.d directory? Do you manually add this support in some way?


Reply to this email directly or view it on GitHub:
#3 (comment)

@dbergloev
Copy link
Member

Just strange that init.d is nowhere to be found, and still it get's executed. But still, init.d injector might be the answer.

@skyh
Copy link
Author

skyh commented Aug 20, 2013

There is error at step 4 after choosing "Inject boot partition" and pressing "Start Injector"

Starting injector v.0.2.1.4
/tmp/aroma-data/injector/injector.sh: line 38: /tmp/busybox: No such file or directory
Using /tmp/aroma-data/busybox as the toolbox for this script
[[: missing ]]
Using configuration file global.conf
[[: missing ]]
[[: missing ]]
[[: missing ]]
[: missing ]
[[: missing ]]
[[: missing ]]
/tmp/aroma-data/injector/injector.sh: line 188: inject-flash-current: command not found
/tmp/aroma-data/injector/injector.sh: line 188: inject-flash-current: command not found
Extracting the device boot.img
/tmp/aroma-data/injector/injector.sh: line 201: /tmp/aroma/injector/tools/bin/dump_image: No such file or directory
It was not possible to extract the boot.img from the device!
Cleaning up old files and directories

@dbergloev
Copy link
Member

Strange, Init.d Injector has worked on all sorts of devices. It has been a long time since anyone have had any issues with it. For you, it looks like it does not create any variables or is able to locate any binary in the package, except busybox.

I will have a look and see if I can spot something that would produce this.

@dbergloev
Copy link
Member

Still working in injector (decided to just rebuild it). However, there might be a chance that the latest release of M2SD will work for you. I have done a lot of compatibility fixes to ensure better compatibility with different devices and ROM's. It might have fixed your issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants