Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,810,319 Members 53,346 Now Online
XDA Developers Android and Mobile Development Forum

[MOD][KERNEL MODULE] wp_mod: disable system write protection

Tip us?
 
flar2
Old
#151  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 26,676
Posts: 5,374
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Quote:
Originally Posted by italyforever View Post
Flar u should put it in the op so people can find it.
I'm going to, next time I'm on xda with an actual computer instead of my phone
 
doublehp
Old
#152  
Senior Member
Thanks Meter 34
Posts: 210
Join Date: Jul 2009
I have:
BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary

Not having it installed in /system is not an issue. When in recovery, you can install it in /data/local/tmp/ , and add this folder in your PATH.

I can not test things ATM because I have stock recovery.

It is possible that I used an other fsck. I have installed Linux Installer (by Galoula); I cloned from my previous phone into my M8; and it is usable as is from recovery (TWRP). So, my Armel was installed in HTC Sensation with Android 2, copied to HTC M8 Android 4, and is usable under TWRP. It provides it's own fsck.

http://dl.free.fr/mKAhcIvEW

Upload to your phone, extract (/data is fine for me; make sure you do NOT have noexec and nodev flags. Extraction will use 310 MB), mount -o bind /proc /data/local/Linux/proc ... same for dev and sys. Then you can chroot in it: chroot /data/local/Linux /bin/bash ... and then you can fsck (you may need to define a classic PATH). It's a legacy Debian; so, anything you want, just aptitude it

There are so many ways to get fsck ... I forgot which one worked for me.

You can also clone your partition with dd (zip on the fly can help boosting), send to computer, use losetup to build a fake device, fsck on desktop, and send it back. If your recovery can support USB MASS STORAGE, there is a faster way (TWRP Does not).
HTC One M8, unpacked 2014-06-19 at 4PM; HTCDEV + SuperSU + S-Off + hone made random scripts at boot 2014-06-20 at 11:30PM .

HTC Sensation received July 27th 2011 (First HTC). Cracked Fre3vo 28th. Craked S-OFF via Revolutionary 30th with success on first attempt. LeeDrOiD 1.2.
The Following User Says Thank You to doublehp For This Useful Post: [ Click to Expand ]
 
Sn8kbordin
Old
#153  
Senior Member
Thanks Meter 6
Posts: 110
Join Date: Dec 2009
Location: Burbank, IL
Quote:
Originally Posted by flar2 View Post
You cannot get a proper installation of busybox without system write. You really need to restore your backup. Just restore /system and you should be fine.

When you have a fresh system, make absolutely, positively sure you don't try to make any change to /system before loading wp_mod. That's what caused your current problem.
Thank you.

Is there a way to tell when I restore my /system backup (which I think I did right past gaining root) that file system isn't already corrupted?
T-Mobile HTC One M8

Fixed apps' access to external SD card issue: http://forum.xda-developers.com/show...5&postcount=13
 
One-M8-Master
Old
#154  
One-M8-Master's Avatar
Senior Member
Thanks Meter 2,407
Posts: 6,901
Join Date: May 2012
Location: Hannover
Quote:
Originally Posted by Sn8kbordin View Post
Thank you.

Is there a way to tell when I restore my /system backup (which I think I did right past gaining root) that file system isn't already corrupted?
the modded twrp recovery by captain throwback has an Option in Mount menu to repair the filesystem...it should work with System too...try that if you t hink it's corrupted
Its simple read before asking and use the search button and always be thankful its FREE!!!

Devices : HTC HD2 (Sold/broken), HTC One X (has my sister now), HTC One M8 (current) (changing roms always after few weeks of use and testing)
The Following User Says Thank You to One-M8-Master For This Useful Post: [ Click to Expand ]
 
Sn8kbordin
Old
(Last edited by Sn8kbordin; 10th September 2014 at 05:47 PM.) Reason: ES File Explorer doesn't support that kind of archives.TGZ
#155  
Senior Member
Thanks Meter 6
Posts: 110
Join Date: Dec 2009
Location: Burbank, IL
Quote:
Originally Posted by doublehp View Post
I have:
BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary

Not having it installed in /system is not an issue. When in recovery, you can install it in /data/local/tmp/ , and add this folder in your PATH.

I can not test things ATM because I have stock recovery.

It is possible that I used an other fsck. I have installed Linux Installer (by Galoula); I cloned from my previous phone into my M8; and it is usable as is from recovery (TWRP). So, my Armel was installed in HTC Sensation with Android 2, copied to HTC M8 Android 4, and is usable under TWRP. It provides it's own fsck.

http://dl.free.fr/mKAhcIvEW

Upload to your phone, extract (/data is fine for me; make sure you do NOT have noexec and nodev flags. Extraction will use 310 MB), mount -o bind /proc /data/local/Linux/proc ... same for dev and sys. Then you can chroot in it: chroot /data/local/Linux /bin/bash ... and then you can fsck (you may need to define a classic PATH). It's a legacy Debian; so, anything you want, just aptitude it

There are so many ways to get fsck ... I forgot which one worked for me.

You can also clone your partition with dd (zip on the fly can help boosting), send to computer, use losetup to build a fake device, fsck on desktop, and send it back. If your recovery can support USB MASS STORAGE, there is a faster way (TWRP Does not).
I am extracting it on PC before copying to phone and WinRAR says this for two files:
Error when extracting
Is this normal? I think it might happen when I extract on the phone with ES File Explorer also. <--- EDIT: ES File Explorer doesn't support that kind of archives.
One file that WinRAR wanted to overwrite had 0 bytes so I overwritten it, this one is different.

Edit 2: Oh, Linux filenames are different when capitol letters or not are used in file names, while Windows thinks it is the same file.

---------- Post added at 11:44 AM ---------- Previous post was at 10:47 AM ----------

Quote:
Originally Posted by doublehp View Post
...snip...

http://dl.free.fr/mKAhcIvEW

Upload to your phone, extract (/data is fine for me; make sure you do NOT have noexec and nodev flags. Extraction will use 310 MB), mount -o bind /proc /data/local/Linux/proc ... same for dev and sys.
...snip...
Extracted with an app on the phone successfully.

Another issue highlighted in bold:
Code:
/data # ←[6nls /proc/data
ls /proc/data
/proc/data: No such file or directory
/data # ←[6nls
ls
Linux_1
OTPData.dat
app
app-asec
app-lib
app-private
audio
backup
bugreports
cam_socket1
cam_socket2
cam_socket3
connectivity
dalvik-cache
data
dontpanic
drm
fdAlbum
fota
hdcp
hostapd
local
lost+found
media
mediadrm
misc
nfc
preload
property
radio
resource-cache
secure
security
shared
ssh
system
time
tombstones
user
/data # ←[6nls Linux_1
ls Linux_1
acct
bin
boot
cache
custdata
data
dev
devlog
etc
fataldevlog
firmware
home
lib
media
mnt
opt
proc
root
run
sbin
selinux
srv
storage
sys
system
tmp
usr
var
/data # ←[6nmount -o bind /data/Linux_1/proc
mount -o bind /data/Linux_1/proc
mount: can't find /data/Linux_1/proc in /etc/fstab
/data # ←[6nmount -o bind /proc/data/local/Linux_1/proc
mount -o bind /proc/data/local/Linux_1/proc
mount: can't find /proc/data/local/Linux_1/proc in /etc/fstab
/data # ←[6n
T-Mobile HTC One M8

Fixed apps' access to external SD card issue: http://forum.xda-developers.com/show...5&postcount=13
 
Sn8kbordin
Old
#156  
Senior Member
Thanks Meter 6
Posts: 110
Join Date: Dec 2009
Location: Burbank, IL
Quote:
Originally Posted by One-M8-Master View Post
the modded twrp recovery by captain throwback has an Option in Mount menu to repair the filesystem...it should work with System too...try that if you t hink it's corrupted
FOund that recovery 2.7.1.1. The repair file system option is under "wipe", then "file system" tab.
It had an error on 1st repair, then it didn't and I can make chnages to /system partition.

THANK YOU!

For the future, what causes the corruption of /system?
When one should repair /system partition?
T-Mobile HTC One M8

Fixed apps' access to external SD card issue: http://forum.xda-developers.com/show...5&postcount=13
 
doublehp
Old
#157  
Senior Member
Thanks Meter 34
Posts: 210
Join Date: Jul 2009
Quote:
Originally Posted by Sn8kbordin View Post
Thank you.

Is there a way to tell when I restore my /system backup (which I think I did right past gaining root) that file system isn't already corrupted?

You need system write for a complete busybox installation, but you do not need a full busybox install to be able to use it. Extract it and install it anyplace where you can write, and add the path to $PATH.


Quote:
Originally Posted by Sn8kbordin View Post
I am extracting it on PC before copying to phone
Why the hell did you extract it on PC ? how do you want to store Linux folders on FAT or NTFS ? you are going to loose all perms, and won't even be able to extract the sockets. I don't have time to read the rest of your post. Just this step was wrong, and I don't need to read further.

Quote:
Originally Posted by Sn8kbordin View Post
For the future, what causes the corruption of /system?
When one should repair /system partition?
This is automatic on normal Linux. Android seems to have removed several sanity checks. On normal Linux it's done at boot time, for all disks in fstab. Android removed fstab, and does not even include fsck anyway. In short, Android is always assuming that all disks are sane, and fine. It never does fsck on SD, or USB storage (see OTG and MHL). Once corrupted, Android is unable to fix them.

The bug only occurs if you don't write properly to your system. I think that it's a sync issue. Android assumes that system is always RO, do, probably never need ot sync system.

To prevent the bug, you need to manually run sync very often while you are in RW, and always remount RO before reboot. Any accidental reboot during RW mode can produce a fault on the partition.

Android does not provide any way to fix it, and, does not have dedicated place to do it for system.

Android has to handle it for /data, but I don't understand where, ho, and when.

You can also add the sync flag when you remount RW; with sync flag on remount, your data are always find, but write will be about 3 times slower.
HTC One M8, unpacked 2014-06-19 at 4PM; HTCDEV + SuperSU + S-Off + hone made random scripts at boot 2014-06-20 at 11:30PM .

HTC Sensation received July 27th 2011 (First HTC). Cracked Fre3vo 28th. Craked S-OFF via Revolutionary 30th with success on first attempt. LeeDrOiD 1.2.
The Following User Says Thank You to doublehp For This Useful Post: [ Click to Expand ]
 
Sn8kbordin
Old
#158  
Senior Member
Thanks Meter 6
Posts: 110
Join Date: Dec 2009
Location: Burbank, IL
Quote:
Originally Posted by flar2 View Post
You need to runs fsck on your system partition, or just reinstall your rom.
I am using stock HTC ROM. I didn't flash any ROMs on this phone. I have back up of HTC ROM that I did right after rooting.

If I want to restore the backup, stock ROM (clock widget looks broken, I think /system is bad even after repair in TWRP), I have a back up of HTC ROM right after rooting, what do I need to wipe if anything?
I want to keep most/ all apps, apps data, phone settings.
T-Mobile HTC One M8

Fixed apps' access to external SD card issue: http://forum.xda-developers.com/show...5&postcount=13
 
flar2
Old
#159  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 26,676
Posts: 5,374
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Quote:
Originally Posted by Sn8kbordin View Post
I am using stock HTC ROM. I didn't flash any ROMs on this phone. I have back up of HTC ROM that I did right after rooting.

If I want to restore the backup, stock ROM (clock widget looks broken, I think /system is bad even after repair in TWRP), I have a back up of HTC ROM right after rooting, what do I need to wipe if anything?
I want to keep most/ all apps, apps data, phone settings.
Just restore /system and you won't lose your apps or settings.

Your apps and settings are in /data, so keep that.

Your photos, downloads, etc are in /sdcard/ (which is actually mounted at /data/media/, but this is not wiped if you were to wipe /data partition in recovery)

The Following User Says Thank You to flar2 For This Useful Post: [ Click to Expand ]
Thread Tools
Display Modes