I'm trying to build aosp for my galaxy tab 10.1 wifi (p4wifi). I've included the relevant device and vendor projects, as well as an updated bionic with tegra2 support for libc. It successfully builds, but flashing the resulting otapackage (using twrp) or the img files (using heimdall) results in empty boot and system directories on the device.
The system directory within the otapackage isn't empty, and the img files aren't as well. The updater-script extracts the system directory as normal.
Edit (Solved):
The partitions weren't being mounted in recovery, but I believe they are mounted normally. "mount /system" mounted the partition and it contains the expected files. Still not booting properly, but at least I know this isn't my issue.
Related
This is about command line program.
Since I moved form JB to KK-based Carbon ROM, I can no longer compress files using "tar z", because I get "Segmentation fault" error.
It still works without z parameter (compressing with gzip), but I need those files to be compressed.
I have a strange problem with tar gz compression.
I used to have SD card mounted as a fat32 partition. However, now I changed it so that external sdcard is being mounted under /data/media/0 and is formated to ext4 (or f2fs - makes no difference, because this error happens on either).
In the old setup, I could run
Code:
tar cvzf
on a folder in this partition without any issue.
However, in this new setup if I run it, I get
Code:
tar cvzf
Segmentation fault.
I discovered, that if I remove the z parameter, it proceeds just fine. But he resulting tar file is not gz-compressed and hence unfit to my applications.
I confirmed this behaviour on two different ROMs so far: CarbonRom JB 4.3.1 and CarbonRom KK 4.4.4.
Does anyone have any idea what could be amiss here? Is android unable to tar.gz files on non-fat32 partitions?
Updated details.
I still have no idea what is causing the problem. However, I did find a solution / workaround, which does the same thing:
Instead of directly calling gzip from tar like so:
Code:
tar cvzf
I pipe tar's output to gzip like so:
Code:
tar -cv directory/ | gzip > archive.tar.gz
and the segmentation fault is circumvented.
hello'
1- LG L3 stack on logo even after recovery.
I managed to install TWRP through SRKTOLLS2.1.
When I try to install a ROM ZIP file I'm having post:
unable to mount the Internal Storage, system, cache and data.
ADB interface device I manage to see the folders and system files.
*/ SDCARD is empty and there is no file.
/BOOT is empty and there is no file
/cache & /data folders contain folders in the name of lost + found,
/dev contains several directories,
/etc contains files: fstab, mtab, recovery.fstab and to more,
and the other system folders'
I can explorer them via TWRP file manager a and see the contents of folders, copy files or move files.
TNX :good:
Hi, I'd like to ask a general question about device boot. I'd like to mount /system, /data, and /cache partitions in selected locations based on detection of sdcard in the device.
How could I add an if ... then ... else statement to init.rc before that /system, /data, and /cache partitions are mounted? Any ideas?
Solved
I've found a way to perform this task. It's possible to place if ... then ... else statement into a shell script and put the shell script into ramdisk root directory of boot.img. Then, just run the script by busybox ash command from init.rc (with busybox located into ramdisk root directory).
cristian_c said:
I've found a way to perform this task. It's possible to place if ... then ... else statement into a shell script and put the shell script into ramdisk root directory of boot.img. Then, just run the script by busybox ash command from init.rc (with busybox located into ramdisk root directory).
Click to expand...
Click to collapse
Hey... I managed to mount /dev/block/mmcblk1p2 as my /data partition by editing my boot.img ramdisk(the 3. fstab files and the .rc files... i replaced [email protected] with dev/block/mmcblk1p2 wherever i saw them)
So i was trying to use an if statement in some of the .rc files to check if /dev/block/mmcblk1p2 was mounted on /data and if not then mount /dev/block/mmcblk0p9 (my usrdata partition) on /data... Soon i realised that this isn't exactly bash...
Please explain how you managed to get a .sh to run from your .rc files( or do you only need it in the init.rc, and remove all the /data mounting lines from them and do it all from the script???)
I don't always have access to a pc so if my sdcard somehow dies i want my phone to boot using the internal /data partition otherwise i will bootloop until i flash the original boot.img
nullbyte001 said:
Hey... I managed to mount /dev/block/mmcblk1p2 as my /data partition by editing my boot.img ramdisk(the 3. fstab files and the .rc files... i replaced [email protected] with dev/block/mmcblk1p2 wherever i saw them)
So i was trying to use an if statement in some of the .rc files to check if /dev/block/mmcblk1p2 was mounted on /data and if not then mount /dev/block/mmcblk0p9 (my usrdata partition) on /data... Soon i realised that this isn't exactly bash...
Please explain how you managed to get a .sh to run from your .rc files( or do you only need it in the init.rc, and remove all the /data mounting lines from them and do it all from the script???)
I don't always have access to a pc so if my sdcard somehow dies i want my phone to boot using the internal /data partition otherwise i will bootloop until i flash the original boot.img
Click to expand...
Click to collapse
I've found on fs_property:ro.mount.fs=EXT4 in init.rc. In that section, I've added the following iine:
Code:
exec /busybox ash /mount_partitions.sh
[of course, I've placed busybox arm compiled binary (the version provided by busybox android app should work) and a mount_partitions.sh script (created by myself) into boot image ramdisk (I mean / main directory, the same where init.rc is located) ]
You could also need to give permissions to busybox and to .sh script. You could also need to remount / in read-write mode, in case of issues with the above command.
Hi guys. Does any of you know how to push su.d directory into su folder? I mean I need radio.sh script in su/su.d to get root call sms manager working. Every time I try it disappears after reboot.
Rooted rom 34.3.A.0.217 with TWRP.
Anyone?
It's late though, but for the guidance of other noobs like me. /su/su.d/ can't be flashed in recovery because this isn't available. For system-less roots, binaries/libraries required to start supersu daemon and to manage root permissions, don't reside in /system/bin but in /data/su.img while (at least) two files reside in boot.img i.e. boot.img/ramdisk/init.supersu.rc and boot.img/ramdisk/sbin/.*daemonsu*.sh. When ROM boots, init.supersu.rc mounts /data/su.img on /su directory and calls /sbin/*daemonsu*.sh for initial setup which starts /su/bin/daemonsu and other se-linux related stuff and then executes any scripts found in /su/su.d/ and /system/su.d.
You can find this:
Code:
mido:/ # mount | grep loop
/dev/block/loop0 on /su type ext4 (rw,seclabel,noatime,data=ordered)
So, the init.d scripts placed in /su/su.d actually reside in /data/su.img which isn't mounted in recovery mode and anything flashed to /su/su.d goes to volatile rootfs which is gone on reboot. Either mount su.img in recovery, or place this script while ROM is running or instead flash to /system/su.d which is permanent filesystem unlike rootfs (which lives in RAM). And finally don't forget to set permissions to 0700 as advised here. Another thing, mostly init.d scripts don't work with .sh extension. Avoid this too.
Strange problem - "/sdcard" becoming read-only during file copy - Please help!
Hello all, I am trying to load LineageOS on a Samsung Tab 3 (SM-T217S, aka "lt02ltespr") and I am having a very strange issue that I am really hoping someone can help me with. Specifically, when I'm trying to push the Lineage installer with adb, it starts copying normally, but 20-80MB into the copy it fails out as the /sdcard partition has suddenly become "read-only." If I copy significantly smaller files they copy over without error, but even then immediately after the copy the filesystem is read-only as before.
For reference, here's what I've done:
* I have wiped the stock OS
* I have loaded TWRP v3.1.0-0 on the tablet, but I previously had TWRP 2.7.0 on it and had the exact same problem.
* adb seems to be fully functional, other commands work as normal
* There is plenty of space available in /sdcard/, something like 11GB
* If I push the files to other locations (e.g. /tmp) they copy over just fine. But if I then try to move or copy the files from there to /sdcard the same problem happens
* /sdcard is definitely not read-only before the attempt to copy to it
* Problem occurs with other files as well, so not specific to the Lineage installer
My current attempted process is as follows:
* Boot into "recovery mode", aka TWRP
* Go in to mount and "Disable MTP" to make ADB functional
* Attempt to push Lineage installer (although same problem happens with other files) with the command:
* adb push lineage-14.1-20171221-nightly-lt02ltespr-signed.zip /sdcard/
It starts copying, but after a while the following happens:
adb: error: failed to copy 'lineage-14.1-20171221-nightly-lt02ltespr-signed.zip' to '/sdcard/lineage-14.1-20171221-nightly-lt02ltespr-signed.zip': remote write failed: Read-only file system
lineage-14.1-20171221-nightly-lt02ltespr-signed.zip: 0 files pushed. 6.1 MB/s (36499096 bytes in 5.700s)
Once this happens, i can't fix/change the /sdcard/ partition (even trying to remount it read-write doesn't work), and i need to reboot the phone back into TWRP again to delete the partially written file or make any other changes.
Any help here would be hugely appreciated, thanks!
Well after all that i fixed it. Needed an fsck.
In case anyone else experiences this problem, here was the fix:
# mount
...
/dev/block/mmcblk0p25 on /data type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/mmcblk0p25 on /sdcard type ext4 (rw,seclabel,relatime,data=ordered)
# umount /data
# umount /sdcard
# e2fsck -pcfv /dev/block/mmcblk0p25
When that finished I rebooted the device, and after that the file copies worked just fine.