[ discussion ] booting to recovery during boot animation with init.d script - LG V30 Guides, News, & Discussion

I wonder if it's possible to make an int.d script to boot to recovery when volume up is pressed during boot animation.
I'm not an experienced coder but I'm just throwing out some ideas in hopes of someone being able to make it work.
Here's my idea of a script:
BOOT_COMPLETE=0
KEY_PRESSED=0
while [ ! $BOOT_COMPLETE = 1 ] || [ ! $KEY_PRESSED == KEY_VOLUMEUP ]; do
KEY_PRESSED=`getevent -l -c 1 | grep KEY | awk '{print $3}'`
BOOT_COMPLETE=`getprop sys.boot_completed`
done
if [ ! $BOOT_COMPLETE = 1 ]; then reboot recovery; fi;

We can boot to recovery easily already, from the OS -- if you are rooted.
In the WTF instructions is link to Advanced Power Menu app.
Or this if for some other scenario?

ChazzMatt said:
We can boot to recovery easily already, from the OS -- if you are rooted.
In the WTF instructions is link to Advanced Power Menu app.
Or this if for some other scenario?
Click to expand...
Click to collapse
Yes, in case you have boot loop (from crash/file corruption/magisk module), would be nice to be able to get to recovery easily without a pc on hand.

Related

[Q] Installing package thru script

Hi Guys
I'm knocking my head over the wall since one week. I'm trying to write a sh script that could install apk from a folder located on sdcard.
Writing the script seems simple, but running it doesn't give me the attended result.
Here is my script :
Code:
!/system/bin/sh
if [ -f /data/200notrestored ]
then
if ! cat /proc/mounts | grep /mnt/sdcard
then
mount /dev/block/mmcblk0p1 /mnt/sdcard;
fi;
if ! cat /proc/mounts | grep /data
then
mount /data;
fi;
test=""
while [ "$test" == "" ]
do
sleep 3;
test=`busybox ps | grep systemui | grep -v "$(echo grep systemui)"`
done
for app in /sdcard/.apps/toinstall/*.apk
do
pm install -r $app;
done;
busybox rm -f /data/200notrestored
fi;
this script is located in /system/etc/init.d fodler and is then supposed to run during the boot.
I've seen that it is run, but not fully.
The command line
Code:
pm install -r $app;
seems to be not working at all.
I tried to replace this command by "cp" and then the package is well copied.
Why do I need to use "pm" command... simply because someapk does't support the "cp" command, and need a proper install to be run.
So here is my question :
has someone succeed in writing a script (run during boot) that install an apk ?
If yes , how ?
I know for example that the script works well on a DHD... why not on a Desire ?
Any help appreciate.
thx
Just for information
Running the script thru Termianl emulator works fine.
What can be the issue when the file is run at boot (put in init.d folder) ? What is the difference from runnihbgit at boot and in terminal ?
any idea ?
thx

[Script] Flash recovery from Terminal v1.0 [2012_0513]

I have create a script file that will flash a recovery from the terminal in the Galaxy Nexus.
I got the command from xda but I could not remember it when I wanted to flash a recovery,
so I wrote a script to do it.
AS WITH ANY FLASHING OR MODDING OF "YOUR" PHONE, I AM NOT RESPONSIBLE FOR ANY DAMAGES YOU MAY CAUSE!
I have tested this on my:
Unlocked Galaxy Nexus 4.1.1 takju (flashed from yakju)
Sprint Galaxy Nexus 4.0.4
Thanks to -viperboy- for help.
Code:
Created by Smurph82 2012_0512 (c) v1.0
flashr [-h] [-r] [-m] [-s s] -- Flash a recovery
to the Galaxy Nexus.
where:
-h show this help text
-r will reboot after flashing is complete.
-m image is in the root of the sdcard
-s source of the recovery image (/sdcard/recovery.img).
To use the script:
Download and Flash the script file from your current recovery
Or download the zip file and move the flashr file in the /system/bin folder to /system/bin with RootExplorer
or other root level file manager.
If you manually add the file you must
Code:
chmod 0755 /system/bin/flashr
or change the permissions from RootExplorer
Then open Terminal and type
Code:
su
first, yes you have to be rooted to do this!
Next type
Code:
flashr
or
Code:
flashr -h
to get the help
If you want to flash a recovery you must have the recovery.img
somewhere on your device that you can remember. Like the root of the sdcard.
To flash a recovery type
Code:
flashr -s /sdcard/recovery.img
or if the recovery is in the root of the sdcard type
Code:
flashr -ms recovery.img
If you want to reboot after the flashing is complete next use
Code:
flashr -mrs recovery.img
In the code examples above I used recovery.img as an example.
This should be "what ever you named the recovery".img it does not have to be recovery.
Reserved
Change Log:
v1 - Initial Release
i know you might think that im trolling, but im really not. what id like to know is what makes that better than just flashing the recovery, via the terminal, the old-fashioned way..
su(press enter)
flash_image recovery /sdcard/recovery.img(press enter)
reboot recovery(press enter, if you want to go to the recovery)
providing ithe file is on the main fs in the sd storage.
flash_image does not work with ics, that I have found. So I wrote my own. If there is a new flash_image that works with the galaxy nexus then I could not find it. Maybe it is because I'm still using the stock rom and kernel. I took the flash_image out of cm9 but it didn't work for me.
Sent from my Galaxy Nexus using XDA Premium HD app
Would you be willing to share the sources for this? It would be interesting to know how this works, since it may be useful also for other purposes than flashing recovery images. Or not?
I will post the source later today. It really is not much.
Sent from my Transformer Prime TF201 using XDA Premium HD app
E:V:A said:
Would you be willing to share the sources for this? It would be interesting to know how this works, since it may be useful also for other purposes than flashing recovery images. Or not?
Click to expand...
Click to collapse
Hope that this is helpful to someone.
Code:
#!/system/bin/sh
usage="Created by Smurph82 2012_0512 (c) v1.0
flashr [-h] [-r] [-m] [-s s] -- Flash a recovery
to the Galaxy Nexus.
where:
-h show this help text
-r will reboot after flashing is complete.
-m image is in the root of the sdcard
-s source of the recovery image (/sdcard/recovery.img)."
# Read in the options turn off verbose and require -s to have input
while getopts :hrms: opt; do
case $opt in
h) echo "$usage"
echo
exit;;
m) sdroot="/sdcard/";;
s) sourcedir=$OPTARG;;
r) reboot="t";;
*) echo
echo
echo "Invalid option: -$OPTARG" >&2
echo "$usage"
echo
exit;;
esac
done
shift $(($OPTIND - 1))
# This was for testing
#echo
#echo "Vars: m $sdroot: s $sourcedir: r $reboot: dir $sdroot$sourcedir"
#echo
# Check to make sure somthing was typed if not show help
if [ "$sourcedir" == "" ]; then
echo "$usage"
echo
exit
else
# Check that something is in that location if not dont flash
if [ -s $sdroot$sourcedir ]; then
echo "Flashing image from: $sdroot$sourcedir"
cat $sdroot$sourcedir > /dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
else
echo "File not found at $sdroot$sourcedir"
exit
fi
fi
# Early in the morning I was getting cute
if [ "$reboot" == "t" ]; then
echo "Rebooting in 5.."
sleep 1
echo "Rebooting in 4.."
sleep 1
echo "Rebooting in 3.."
sleep 1
echo "Rebooting in 2.."
sleep 1
echo "Rebooting in 1.."
sleep 1
reboot recovery
fi
thank u very much for this! so easy now!!
It is just as easily done in a terminal by the following (assuming you downloaded the recovery you want to /sdcard and named it recovery.img):
su
dd if=/sdcard/recovery.img of=dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
efrant said:
It is just as easily done in a terminal by the following (assuming you downloaded the recovery you want to /sdcard and named it recovery.img):
su
dd if=/sdcard/recovery.img of=dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
Click to expand...
Click to collapse
Yes I know that but who wants to type all of that out. I just made it shorter more
or else. If you want to type the whole command then by all means have at it. I just
think that "flashr -mrs twrp.img" is a whole lot easier. Just my thoughts.
Hi
Nice enough script.
Although I feel I should warn people that it looks like this script will write anything you tell it. making no effort to verify that the file is a valid or correct for your phone. so be careful not to specify the wrong file.
fastboot flash recovery $file is much safer.
That is true if you are connected to a computer but this script is run on the phone from the terminal. If someone knows a way to check a file from the terminal running on the phone please tell me and I will update the script. I understand that there is currently no verification of the file that is being written so please make sure that you are writing the right file.
Sent from my Galaxy Nexus using XDA Premium HD app

[HOW TO] Extract rom.zip from RUU.exe

Hi,
I'm trying to port One V rom to the Desire (my first rom cooking experience).
So I made a small bash script to extract rom.zip file from RUU.exe.
Code:
#!/bin/bash
DEST_DIR=./
WINE_DIR=~/.wine/drive_c/users/*/Temp
ROM=""
PID=0
function usage {
echo "Extract RUU 0.2 of 25 June 2012, by Luc Chante"
echo ""
echo "Usage: extract-ruu [OPTION]... RUU"
echo "Options: "
echo " -d DIR|FILE where to extract the file rom.zip"
echo " ./ by default"
echo " -w DIR directory for wine temporary files"
echo " ~/.wine/drive_c/users/*/Temp by default"
exit 1
}
[ $# -gt 0 ] || usage
while [ $# -gt 1 ]; do
if [ $1 = "-d" ]; then
[ $# -gt 0 ] || usage
shift
DEST_DIR=$1
elif [ $1 = "-w" ]; then
[ $# -gt 0 ] || usage
shift
WINE_DIR=$1
fi
shift
done
[ $# -gt 0 ] || usage
if [ ! -d $WINE_DIR ]; then ls -d $WINE_DIR; exit 1; fi
wine $1 &
PID=$!
TMP=`mktemp`
while [ ${#ROM} -eq 0 ]; do
ROM=`find $WINE_DIR -type f -cnewer $TMP -name rom.zip`
done
kill -9 $PID
if [ -f $ROM ]; then
cp -i $ROM $DEST_DIR
echo "Rom extracted"
else
echo "Rom not found"
fi
Put these lines into a file named extract-ruu, make it executable and juste do :
./extract-ruu RUU_XXXXXXXXXXXXXXX.exe
Wait for a while ... and it's over
don't ever execute with super-user rights !!! (because of kill -9 $PID)
[edit]: version 0.2
- correction of a bug (DEST & DEST_DIR)
- test with a recent file to force 'find' to find the most recent rom.zip file
!!!
I couldn't get the old OpenRUU script to extract my RUU, but this did its job perfectly! props.
Dude you can do it easy with no script, just run the RUU.exe, when the screen pops up with the picture of the device go to the start menu (Windows 7) and type in search *temp* and press enter. When the folder opens search it for ROM.zip and there you go.
CdTDroiD said:
Dude you can do it easy with no script, just run the RUU.exe, when the screen pops up with the picture of the device go to the start menu (Windows 7) and type in search *temp* and press enter. When the folder opens search it for ROM.zip and there you go.
Click to expand...
Click to collapse
The RUU I was using wasn't starting in Vista (I've had too many phone flashing troubles with 7), so I figured I'd just extract it out in Ubuntu. So when I tried that without any script, it decided to crash (which it was going to do anyway since it was missing DLLs) before I could grab the rom.zip out of temp files.
I was tired of it so I just used this so I could just fastboot it and be done.
CdTDroiD said:
Dude you can do it easy with no script, just run the RUU.exe, when the screen pops up with the picture of the device go to the start menu (Windows 7) and type in search *temp* and press enter. When the folder opens search it for ROM.zip and there you go.
Click to expand...
Click to collapse
What about XP?
GrandMstrBud said:
What about XP?
Click to expand...
Click to collapse
Same procedure but you need to go to temp folder in windows XP. Then search for ROM.zip
Sent from my HTC Desire using xda premium
Why you don't port from desire v?
Sent from my HTC Desire using xda premium
rommanager said:
Why you don't port from desire v?
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
because its desire v
Sent from my HTC Desire
rommanager said:
Why you don't port from desire v?
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
I abandoned the job ...
Desire V seems to be unportable onto the Desire.
And by the way, I'm a linux user, so I don't have Windows 7 "start menu". I made this script under linux.
Maybe the Desire VT328w...
Hey! I was excited to find this thread, because the RUU I'm trying to use will not run or give me the zip in Windows 7, but I am having problems with your script in ubuntu as well. After running ./extract_ruu, I get this:
wine: cannot find L"C:\\windows\\system32\\RUU_PRIMO_C_ICS_40A_Sprint_WWE_VM_1.08.652.6_Radio_1.00.00.0521_2_NV_VM_3.46_0503_PRL61008_release_262414_signed.exe"
dankstahz said:
Hey! I was excited to find this thread, because the RUU I'm trying to use will not run or give me the zip in Windows 7, but I am having problems with your script in ubuntu as well. After running ./extract_ruu, I get this:
wine: cannot find L"C:\\windows\\system32\\RUU_PRIMO_C_ICS_40A_Sprint_WWE_VM_1.08.652.6_Radio_1.00.00.0521_2_NV_VM_3.46_0503_PRL61008_release_262414_signed.exe"
Click to expand...
Click to collapse
Just run it like I said before
Sent from my Galaxy Nexus using Tapatalk 2
The way you said isn't working for me, It be nice if a script was available to extract the rom.zip.
CdTDroiD said:
Just run it like I said before
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
dankstahz said:
Hey! I was excited to find this thread, because the RUU I'm trying to use will not run or give me the zip in Windows 7, but I am having problems with your script in ubuntu as well. After running ./extract_ruu, I get this:
wine: cannot find L"C:\\windows\\system32\\RUU_PRIMO_C_ICS_40A_Sprint_WWE_VM_1.08.652.6_Radio_1.00.00.0521_2_NV_VM_3.46_0503_PRL61008_release_262414_signed.exe"
Click to expand...
Click to collapse
Hi, sorry to answer so late.
Have you a fully functional wine install ?
Because it works just fine for me :
$ extract-ruu RUU_PRIMO_U_ICS_40A_HTC_Europe_1.56.401.2_Radio_20.66.30.0831U_3831.15.00.19_M_release_254696_signed.exe
fixme:storage:create_storagefile Storage share mode not implemented.
/home/luc/.local/bin/extract-ruu : ligne 53 : 5971 Processus arrêté wine $1
Rom extracted
idem with
$ extract-ruu -d test RUU_PRIMO_U_ICS_40A_HTC_Europe_1.56.401.2_Radio_20.66.30.0831U_3831.15.00.19_M_release_254696_signed.exe
Just in case, I'm using archlinux.
[edit]: I also tried with RUU_PRIMO_U_ICS_40A_HTC_Europe_2.22.401.1_Radio_20.76.30.0835U_3831.19.00.120_release_273801_signed.exe succesfully.
How hard is it for someone to use VirtualBox on Linux?
Sent from my Nexus One using Tapatalk 2
eLukas said:
Hi,
Put these lines into a file named extract-ruu, make it executable and juste do :
./extract-ruu RUU_XXXXXXXXXXXXXXX.exe
Wait for a while ... and it's over
don't ever execute with super-user rights !!! (because of kill -9 $PID)
[edit]: version 0.2
- correction of a bug (DEST & DEST_DIR)
- test with a recent file to force 'find' to find the most recent rom.zip file
Click to expand...
Click to collapse
DUDE, you ROCK, your script so saved me and my One X..... Thanks
Thanks, your script saved my one V. Now giving it for repairs. Thank you very much.
anybody any more didn't meet
It says that I can't run this on my 64 bit windows.. is there anything I can do?
eLukas said:
Hi,
I'm trying to port One V rom to the Desire (my first rom cooking experience).
So I made a small bash script to extract rom.zip file from RUU.exe.
Code:
#!/bin/bash
DEST_DIR=./
WINE_DIR=~/.wine/drive_c/users/*/Temp
ROM=""
PID=0
function usage {
echo "Extract RUU 0.2 of 25 June 2012, by Luc Chante"
echo ""
echo "Usage: extract-ruu [OPTION]... RUU"
echo "Options: "
echo " -d DIR|FILE where to extract the file rom.zip"
echo " ./ by default"
echo " -w DIR directory for wine temporary files"
echo " ~/.wine/drive_c/users/*/Temp by default"
exit 1
}
[ $# -gt 0 ] || usage
while [ $# -gt 1 ]; do
if [ $1 = "-d" ]; then
[ $# -gt 0 ] || usage
shift
DEST_DIR=$1
elif [ $1 = "-w" ]; then
[ $# -gt 0 ] || usage
shift
WINE_DIR=$1
fi
shift
done
[ $# -gt 0 ] || usage
if [ ! -d $WINE_DIR ]; then ls -d $WINE_DIR; exit 1; fi
wine $1 &
PID=$!
TMP=`mktemp`
while [ ${#ROM} -eq 0 ]; do
ROM=`find $WINE_DIR -type f -cnewer $TMP -name rom.zip`
done
kill -9 $PID
if [ -f $ROM ]; then
cp -i $ROM $DEST_DIR
echo "Rom extracted"
else
echo "Rom not found"
fi
Put these lines into a file named extract-ruu, make it executable and juste do :
./extract-ruu RUU_XXXXXXXXXXXXXXX.exe
Wait for a while ... and it's over
don't ever execute with super-user rights !!! (because of kill -9 $PID)
[edit]: version 0.2
- correction of a bug (DEST & DEST_DIR)
- test with a recent file to force 'find' to find the most recent rom.zip file
Click to expand...
Click to collapse
This is what i've done: (WIN8x64)
Created a file. Download from the attachments
Place them in C:/cygwin (yes, you need cygwin)
open cygwin, type cd C:/cygwin
Then, ./ruuextract *RUUNAME*
Worked
CdTDroiD said:
Dude you can do it easy with no script, just run the RUU.exe, when the screen pops up with the picture of the device go to the start menu (Windows 7) and type in search *temp* and press enter. When the folder opens search it for ROM.zip and there you go.
Click to expand...
Click to collapse
I tried that with Wildfire S and when I flash it in CWM it says E:Can't open /sdcard/rom.zip (Bad) at the begging.

[TIP] Running random scripts at boot

HTC One M8.
I have done HTCdev with http://htc-one.wonderhowto.com/how-to/unlock-bootloader-root-your-htc-one-m8-0154444/
then rooted
Then did S-OFF with http://firewater-soff.com/instructions/
Then, to be able to write to /system, you need more steps. From recovery, it works easily. From live running system, the default stock ROM has a write protection. This WP can be removed easily by loading a kernel module:
http://forum.xda-developers.com/showthread.php?t=2701816
then:
Code:
insmod /mnt/sdcard/Download/wp_mod_m8.ko
mount -o remount,rw /system
Now, I want to run random scripts.
First, check if the stock ROM has the same issue as my previous phone:
Code:
[email protected]_m8:/ # echo $PATH
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/vendor/bin
[email protected]_m8:/ # ls -l /system/sbin
/system/sbin: No such file or directory
1|[email protected]_m8:/ #
That's exactly what we need: a folder that is in PATH, that does not exist, and should exist somewhere we can create it. So:
Code:
insmod /mnt/sdcard/Download/wp_mod_m8.ko
mount -o remount,rw /system
mkdir /data/local/bin
ln -s /data/local/bin/ /system/sbin
Then, create two small scripts in there: do vi /system/sbin/vibrate , then i to enter insert mode, paste this code, esc, :x ... or use any other editor if you want:
Code:
#!/system/xbin/ash
#
i="$1"
[ "$i" = "" ] && i=400
# default value for voltage_level at boot is 3100 mV.
v=3100
vmin=1200
[ $i -gt 0 ] 2>/dev/null || {
echo "Invalid argument '$i'; should be a number below 9999 ms."
exit 1
}
[ $i -gt 9999 ] && {
echo "Invalid argument '$i'; should be below 9999 ms."
exit 1
}
[ "$2" != "" ] && {
[ $2 -ge $vmin ] 2>/dev/null || {
echo "Invalid argument '$2'; should be a number between $vmin and ${v} mV."
exit 1
}
[ $2 -gt $v ] && {
echo "Invalid argument '$2'; should be below ${v} mV."
exit 1
}
}
[ "$i" = "" ] && { echo "Provide argument: time in ms." ; exit 1 ; }
[ "$2" = "" ] && {
echo "Voltage not provided. Using default $v mV."
} || {
v=$2
echo "Using voltage argument $v mV."
}
echo $v > /sys/devices/virtual/timed_output/vibrator/voltage_level
echo "$i" > /sys/devices/virtual/timed_output/vibrator/enable
It was an old code for HTC Sensation; voltage does not work anymore, but duration does.
A shorter script for flash, and create the init script:
Code:
echo "echo 255 > /sys/class/leds/flashlight/brightness" > /system/sbin/flashlight
echo "#!/system/bin/sh
# /system/etc/init.qcom.bt.sh
/data/local/bin/vibrate
/system/sbin/flashlight" > /data/local/bin/rc.init
chmod 755 /system/sbin/flashlight
chmod 755 /system/sbin/vibrate
chmod 755 /data/local/bin/rc.init
Now, the tricky part: make the init script run at boot. Edit /system/etc/init.qcom.bt.sh , and below the comment, insert this line:
Code:
/data/local/bin/rc.init &
Reboot, enjoy Your phone flashes and vibrates at boot. As is, this is almost useless. But, now you can create system scripts, and run them at boot ... you can do pretty much anything you do on a classic Linux machine.
Because scripts are put in a folder which is in the default system $PATH, all apps or widgets can run those scripts. This vibrate script can be called for example from a Tasker or ScriptManager widget.
I love vibrate, because it's a small noise; I tail it to any command that is likely to take more than 1mn to run. Having a ScriptManager widget running it also helps me check the system load. If phone seems slow, and vibration does not happen at once, then the phone has big load, and I shall wait for things to settle.
/system/etc/init.qcom.bt.sh was not a random choice. To understand why: open /init.target.rc , and now, search a script that is run ... at boot ... with user root ... and that lays in /system. Many scripts are run as user, or stored outside /system.
Now, it's up to you to create scripts that are usefull to you.
Hey thanks for the directions but I tried running the command mnt/sdcard/download/wp_mod.ko and I got a "failed exec format error"....
rgolnazarian said:
Hey thanks for the directions but I tried running the command mnt/sdcard/download/wp_mod.ko and I got a "failed exec format error"....
Click to expand...
Click to collapse
This is completely unrelated and offtopic. Either your file does not have exec bit, or wrong interpreter, or stored on partition that has noexec.
Hmmm ... why is the quoted message different from the one I received by email ???
Any way, even if you are in /, "mnt/sdcard/download/wp_mod.ko" is an invalid command. A module can not be executed, it must be inserted; see tutos about it.

Missing Options in Recovery

The instructions for Lineage OS don't seem to tally up with my Recovery menu (Team Win on the latest version 3.5.1_9-0) :
"2. Now, use the volume buttons to select “Advanced”, and then “Enable ADB”."
There's no option to enable ADB in the advanced menu,
"3. Now tap Factory Reset, then Format data / factory reset....."
There's no Factory Reset option
"5. On the device, select “Apply Update”...."
There is no apply update option.
Am I missing something simple?
replicon1 said:
The instructions for Lineage OS don't seem to tally up with my Recovery menu (Team Win on the latest version 3.5.1_9-0) :
"2. Now, use the volume buttons to select “Advanced”, and then “Enable ADB”."
There's no option to enable ADB in the advanced menu,
"3. Now tap Factory Reset, then Format data / factory reset....."
There's no Factory Reset option
"5. On the device, select “Apply Update”...."
There is no apply update option.
Am I missing something simple?
Click to expand...
Click to collapse
Yes you are. These are totally different recoveries so they look different.
TWRP menu vs Lineage menu.
2) If I'm not mistaken, adb should be turned on by default in twrp.
3) In twrp you find this on the "wipe" button
5) In twrp the apply update functionality should be under "advanced". Else, you could just adb push your file to your device and install via the "install" buttton.
User699 said:
Yes you are. These are totally different recoveries so they look different.
TWRP menu vs Lineage menu.
2) If I'm not mistaken, adb should be turned on by default in twrp.
3) In twrp you find this on the "wipe" button
5) In twrp the apply update functionality should be under "advanced". Else, you could just adb push your file to your device and install via the "install" buttton.
Click to expand...
Click to collapse
Thanks, I was starting to lose the will to live.
replicon1 said:
Thanks, I was starting to lose the will to live.
Click to expand...
Click to collapse
No need to. Hope you'll be fine!
Managed to get Lineage installed but I don't seem to be able to install MindTheGapps. Error states "Could not mount /mnt/system Aborting". I've tried searching for this issue but it I can't find a solution. Now it won't boot to Lineage. Should I wipe it and start again?
replicon1 said:
Managed to get Lineage installed but I don't seem to be able to install MindTheGapps. Error states "Could not mount /mnt/system Aborting". I've tried searching for this issue but it I can't find a solution. Now it won't boot to Lineage. Should I wipe it and start again?
Click to expand...
Click to collapse
You could try wiping it.
I didn't flash gapps, but as far as I know it should be flashed before booting into the OS for the first time.
replicon1 said:
Managed to get Lineage installed but I don't seem to be able to install MindTheGapps. Error states "Could not mount /mnt/system Aborting". I've tried searching for this issue but it I can't find a solution. Now it won't boot to Lineage. Should I wipe it and start again?
Click to expand...
Click to collapse
Any progress with installing MindTheGapps?
I got the same error message about not being able to mount system with my LG G2.
nexus212 said:
Any progress with installing MindTheGapps?
I got the same error message about not being able to mount system with my LG G2.
Click to expand...
Click to collapse
Do you have twrp or stock-lineageos-recovery installed?
If it cannot mount it, something isn't working as it's supposed to.
Can you try this from within your recovery?:
Code:
mkdir /tmp/system_b
Here I'm creating a mount point for my system_b (I have system a and b due to a a-b partitioned device) in the tmp folder.
Code:
mount /dev/block/by-name/system_b /tmp/system_b
I am mounting my system_b partition on the previously created mounting point.
Your system partition might be at a slightly different place somewhere in /dev/block/.
Code:
ls /tmp/system_b/
Just listing the content of system_b.
Spoiler: You should get an output similar to this one
Code:
acct default.prop init.zygote32.rc res
apex dev init.zygote64_32.rc sbin
bin dsp lost+found sdcard
bt_firmware etc mnt storage
bugreports firmware odm sys
cache init oem system
charger init.environ.rc persist tmp
config init.rc postinstall ueventd.rc
d init.recovery.qcom.rc proc vendor
data init.usb.configfs.rc product verity_key
debug_ramdisk init.usb.rc product_services
Code:
umount /tmp/system_b/
Unmount the system_b partition from that mounting point we created earlier, since it's not needed anymore.
Code:
rmdir /tymp/system_b/
Remove system_b directory we created at the beginning since we don't need it anymore.
Please note that I'm using 'rmdir' instead of 'rm -R' because 'rmdir' will fail if /tmp/system_b/ isn't empty (preventing you to accidentally delete your system partition).
If that works for you (especially the mounting part), then your recovery should be able to do it itself too.
Yes, I had(/have?) twrp installed and with that it didn't worked. Yesterday I pinned it down to the installation script not being able to find the system block by adding some additional ui_prints.
But today I followed upgrade instructions (https://wiki.lineageos.org/devices/d802/upgrade) again with installed LOS 18.1 image and somehow my device booted into lineageos-recovery instead of twrp and I was able to fully install LOS 18.1 (again, just to be save) and MTGapps.
Although my issue accidentally fixed itself, thank you for you attempt to help!
replicon1 said:
Managed to get Lineage installed but I don't seem to be able to install MindTheGapps. Error states "Could not mount /mnt/system Aborting". I've tried searching for this issue but it I can't find a solution. Now it won't boot to Lineage. Should I wipe it and start again?
Click to expand...
Click to collapse
try this twrp,it should be able to install MindTheGapps.
Any chance to get this modified twrp for herolte?
replicon1 said:
Managed to get Lineage installed but I don't seem to be able to install MindTheGapps. Error states "Could not mount /mnt/system Aborting". I've tried searching for this issue but it I can't find a solution. Now it won't boot to Lineage. Should I wipe it and start again?
Click to expand...
Click to collapse
I recently ran into this issue. In my case, it was due to /etc/recovery.fstab using tabs, while MindTheGapps was expecting spaces. I filed a merge request here, but you can try making the change yourself by editing META-INF/com/google/android/update-binary in the MindTheGapps zip file.
rkjnsn said:
I recently ran into this issue. In my case, it was due to /etc/recovery.fstab using tabs, while MindTheGapps was expecting spaces. I filed a merge request here, but you can try making the change yourself by editing META-INF/com/google/android/update-binary in the MindTheGapps zip file.
Click to expand...
Click to collapse
I got the same error. According to your hint, I tried to change the line in "update-binary": Unzipping all files, changing the file's content, zipping again, installing. Now I'm said the zip in invalid: "Invalid zip file format"
Can you please let me/us know how to zip a file TWRP accepts for installing?
was having issues installing gapps and searches brought me here, tomintpe i would avoid regenerating the zip file and just add the edited file back to the zip... Am working on that myself.... if i get it to work will attempt to attach the file
Okay, this was tested on a samsung galaxy s2 gt-i9100, this was going into the MindTheGapps-11.0.0-arm-20210412_124103 package for a lineage os 18.1 install. So, make sure this applies to you before you copy/paste anything ok?
The issue was the line "grep -v "^#" /etc/recovery.fstab | grep " $1 " | tail -n1 | tr -s ' ' | cut -d' ' -f1"
which i replaced with "grep -v "^#" /etc/fstab | grep "$1" | sed 's/ */!/g' | cut -d'!' -f1"
Am using sed to replace whitespace with !'s (unsure why cut -d' ' didn't work but, it didnt) and also looking at /etc/fstab instead of recovery although recovery would have probably worked fine.
Thanks for the answers so far.
When I want to update the original zip file with the edited "update.binary" I wonder how to get the file into the right directory in the zip file. A simple
Code:
zip MindTheGapps-11.0.0-arm64-20210412_124247.zip update-binary
just adds the new file to the archive's main directory.
How do I get the updated file where its belong to in the zip without newly building the zip file?
Ok, I found out myself how to update the zip file using the flag -u with the same directory structure.
But changing the "update-binary" 's line 44 into "grep -v "^#" /etc/fstab | grep "$1" | sed 's/ */!/g' | cut -d'!' -f1" or "grep -v "^#" /etc/recovery.fstab | grep "[[:blank:]]$1[[:blank:]]" | tail -n1 | tr -s [:blank:] ' ' | cut -d' ' -f1" does not help. I still get the TWRP error "Could not mount /mnt/system Aborting".
get_block_for_mount_point() {
#grep -v "^#" /etc/recovery.fstab | grep " $1 " | tail -n1 | tr -s ' ' | cut -d' ' -f1
grep -v "^#" /etc/recovery.fstab | grep "$1" | tail -n1 | rev | cut -f1 | rev
}
semellle said:
get_block_for_mount_point() {
#grep -v "^#" /etc/recovery.fstab | grep " $1 " | tail -n1 | tr -s ' ' | cut -d' ' -f1
grep -v "^#" /etc/recovery.fstab | grep "$1" | tail -n1 | rev | cut -f1 | rev
}
Click to expand...
Click to collapse
No, same error message.
You need to test the command with adb shell.
Can you send me the content of your : /etc/recovery.fstab
Or just past the result of this cmd:
grep system /etc/recovery.fstab

Categories

Resources