Long-time UNIX guy here, but relatively new to the world of Android.
I have recently purchased an Asus MemoPAD (ME103K) ; I then became root, and took a `dd` image of the read-only `system` partition to the external SD card:
Code:
$ su
# dd if=/dev/block/platform/msm_sdcc.1/by-name/system \
of=/storage/MicroSD/system.img bs=1M
# ls -l /storage/MicroSD/system.img
-rw-r--r-- 1 root root 2147483648 Sep 27 13:15 system.img
The size (exactly 2GiB) was a bit suspicious - could it be that this was because of the FAT32 partition on the SD card?
No, it was not - `tune2fs -l` revealed that this was indeed, a valid EXT4 image, exactly sized at 2GiB, which passed `fsck -f` with no errors at all.
And `fastboot` (from the linux machine attached to the tablet) concurred, after an `adb reboot bootloader`:
Code:
linuxbox# fastboot getvar all
(bootloader) version-bootloader: 3.03
(bootloader) version-hardware: rev_c
(bootloader) variant: LEOPARDCAT 16G
(bootloader) version-baseband: H00_0.16.F_0521
(bootloader) serialno: 0a3dXXXX
...
(bootloader) partition-type:system: ext4
(bootloader) partition-size:system: 0x0000000080000000
That size, is indeed 2GB:
Code:
linuxbox# python2 -c 'print 0x0000000080000000'
2147483648
So, all is good - I have a backup of the image. Now to test restoring it.
I try to flash the system.img back to the tablet - to make sure I can recover from anything, the sort of bullet-proof backup we do in the Unix world (*e.g. restore contents of a drive via `dd if=backup.image of=/dev/sdXXX`*).
Everything related to `adb` and `fastboot` work flawlessly - so I try...
Code:
linux_box# fastboot devices
0a3dXXXX fastboot
linux_box# mount /dev/sdcard /mnt/sdcard
linux_box# cp /mnt/sdcard/system.img .
linux_box# fastboot flash system system.img
error: cannot load 'system.img'
Hmm. I download and build the `android-tools-5.1.1` of my distribution from sources, adding debug information - and step in the debugger, to see this failure:
Code:
# gdb --args fastboot flash system system.img
...
(sorry, can't paste links yet - see this image: http i stack imgur com 9bIEM.png
Interesting - even though I am in a 64bit machine, apparently there are issues that turn the file size "negative" (in a 32bit world, the file size of my image, 2^31, is indeed considered negative - to be exact, `-2147483648`.
OK, fine - how do they flash large image files in Android?
Googling, searching - turns out they use this `make_ext4fs` tool, that creates flashable images. In fact it is part of what I just compiled, so I might as well use it:
Code:
# mkdir /system
# mount -o loop,ro system.img /system
# ls -l /system
total 208
drwxr-xr-x 106 root root 8192 Sep 17 22:24 app
drwxr-xr-x 3 root 2000 8192 Sep 26 21:08 bin
-rw-r--r-- 1 root root 6847 Sep 12 16:59 build.prop
drwxr-xr-x 19 root root 4096 Sep 26 21:08 etc
drwxr-xr-x 2 root root 4096 Aug 11 22:27 fonts
drwxr-xr-x 4 root root 4096 Sep 12 16:56 framework
drwxr-xr-x 10 root root 16384 Sep 12 16:59 lib
drwxr-xr-x 2 root root 4096 Jan 1 1970 lost+found
drwxr-xr-x 3 root root 4096 Aug 11 22:18 media
drwxr-xr-x 59 root root 4096 Aug 11 22:29 priv-app
-rw-r--r-- 1 root root 126951 Aug 1 2008 recovery-from-boot.p
drwxr-xr-x 3 root root 4096 Aug 11 21:02 scripts
drwxr-xr-x 3 root root 4096 Aug 11 21:02 tts
drwxr-xr-x 11 root root 4096 Sep 26 21:08 usr
drwxr-xr-x 8 root 2000 4096 Aug 11 22:29 vendor
drwxr-xr-x 2 root 2000 4096 Sep 26 21:09 xbin
# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 2048M new_system.img /system
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label:
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 2666/131072 inodes and 375014/524288 blocks
Cool - so I can apparently build system images from plain old folders. The sky will be my limit - I'll be able to add anything I want to this image.
Let's burn it...
Code:
# fastboot flash system new_system.img
erasing 'system'...
OKAY [ 0.064s]
sending 'system' (2088960 KB)...
^C
I waited for 1h before hitting that Ctrl-C. And had to power-cycle the tablet, which booted back in fastboot mode.
This is not looking good.
What if I build a smaller image? Maybe the 2GB are somehow an issue, and this partition is not used to full capacity - it has free space:
Code:
# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 1536M new_system.img /system
# ./fastboot flash system system.img
erasing 'system'...
OKAY [ 0.065s]
sending 'system' (1572864 KB)...
OKAY [ 51.039s]
writing 'system'...
OKAY [235.080s]
finished. total time: 286.183s
OK, this looks very promising (and only took 5 min). I guess I can now reboot back and everything should be normal, yes?
No
(sorry, can't paste links yet - see this image: http i stack imgur com U7wiX.png
I don't mind a temporarily bricked device, as long as I **do** get to control it in the end (machines that I am not a master of, are machines I don't care to operate
Any ideas on what I did wrong and what I can do to fix this?
Thanks in advance.
P.S. I checked the Asus support page for my tablet - they only provide the sources for the kernel, and the Over-the-air .zip file. That in turn contains a file-system level backup from the root - i.e. the `system` folder exists in there as just a folder, not an image, not a `system.img` that I can flash - so that doesn't really help me.
[SOLVED] Booted from external sd.
I documented how I solved it in android stack exchange, article 124344 (can't post links - the url is formed from .... http android.stackexchange.com questions 124344 trying-to-flash-a-system-img-i-took-with-dd-failing )
Executive summary - I edited my custom boot image /fstab.qcom to point /system to the external SD card, and dd-ed my image there.
Related
Hi,
I have a HTC One X that I'm trying to restore to stock - it seems pretty borked at the moment, /sdcard won't mount in recovery (CWM), wifi/mobile aren't working etc.
I've also tried partitioning the SDCard through CWM, and I think I may have used the wrong options (1024 Mb, and 128Mb swap?). I have no idea how to restore partition layouts on HTC phones? (Do they use a .PIT file?).
Anyhow, on bootup, it shows the following:
Code:
*** UNLOCKED ***
ENDEAVORU PVT SHIP S-ON RL
HBOOT-1.36.0000
CPLD-None
RADIO-5.1204.162.29
eMMC-bootmode: disabled
CPU-bootmode: disabled
HW SEcure boot: enabled
MODEM PATH : OFF
Nov 16 2012,18:32:39
FASTBOOT USB
...
My fastboot variables:
Code:
(bootloader) version: 0.5a
(bootloader) version-bootloader: 1.36.0000
(bootloader) version-baseband: 5.1204.162.29
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main: 3.14.980.27
(bootloader) product: endeavoru
(bootloader) platform: HBOOT-T30S
(bootloader) modelid: PJ4610000
(bootloader) cidnum: OPTUS001
(bootloader) battery-status: good
(bootloader) battery-voltage: 4008mV
(bootloader) devpower: 92
(bootloader) partition-layout: None
(bootloader) security: on
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: None
(bootloader) hbootpreupdate: 2
(bootloader) gencheckpt: 0
all: Done!
If I'm reading the above correctly, it's on HBoot 1.36, with a Optus CID, so I tried looking for a RUU here
http://www.androidruu.com/index.php?developer=Endeavor
and unfortunately couldn't find anything matching it - the newest is 1.29 for Optus.
I'm then thought I'd try following the instructions here for restoring from Nandroid:
http://forum.xda-developers.com/showthread.php?t=1975140
I downloaded the Nandroid backup from here:
Nandroid Backup / Mirror 3.14.980.27 CID OPTUS001 thanks to mafia187
http://uploaded.net/file/bvcpzcgl
The RAR file from this download doesn't contain a zipfile, however, it does contain a folder with the following:
nandroid.md5
cache.ext4.tar
data.ext4.tar
system.ext4.tar
boot.img
recovery.img
I tried flashing this with adb restore as a folder, and also compressing it to a zipfile, and flashing it, and it didn't seem to do anything, but simply returned right away both times with:
Code:
192-168-1-102:platform-tools victorhooi$ ./adb restore ~/Downloads/Stock\ JB\ Optus\ Australia\ 3.14.980.27/2012-12-19.21.27.47
2012-12-19.21.27.47/ 2012-12-19.21.27.47.zip
192-168-1-102:platform-tools victorhooi$ ./adb restore ~/Downloads/Stock\ JB\ Optus\ Australia\ 3.14.980.27/2012-12-19.21.27.47.zip
Now unlock your device and confirm the restore operation.
I then thought I'd try to erase/flash the partitions manually.
When I try to erase them I get a "remote: not allowed" error:
Code:
192-168-1-102:platform-tools victorhooi$ ./fastboot erase system
erasing 'system'...
FAILED (remote: not allowed)
finished. total time: 0.136s
When I try to flash, I get a "heap not enough" error:
Code:
192-168-1-102:platform-tools victorhooi$ ./fastboot flash system ~/Downloads/Stock\ JB\ Optus\ Australia\ 3.14.980.27/2012-12-19.21.27.47/system.ext4.tar
sending 'system' (1100991 KB)...
FAILED (remote: Heap not enough)
finished. total time: 0.098s
I thought maybe the bootloader was still locked (I was actually a bit confused, as it says UNLOCKED at the top, but it says S-ON for getvar?).
I tried to following the official unlock procedure on the HTCDev site.
Code:
192-168-1-102:platform-tools victorhooi$ ./fastboot flash unlocktoken ~/Downloads/Unlock_code.bin
sending 'unlocktoken' (0 KB)...
OKAY [ 0.141s]
writing 'unlocktoken'...
(bootloader) unlock token check successfully
OKAY [ 0.222s]
finished. total time: 0.364s
and I don't get the unlock screen, as they mention in the HTC instructions?
What are your thoughts on what to try next? Any help at all greatly appreciated.
Cheers,
Victor
You're in the wrong forum, this is the HTC One XL / AT&T One X forum. You need to ask in the HTC One X forum.
Sent from my Evita
Cheers on the size of your post though
Sent from my HTC One XL
Oh by the way, you really should edit out your IMEI above. Never post your IMEI publicly. Also I've reported this thread to be moved to the correct device forum.
Sent from my Evita
Hi,
@timmaaa - Aha, thanks for moving the post and sanitising the IMEI number =). Appreciate that.
Let me know if there's any other details you need me to provide.
Cheers,
Victor
Unfortunately nobody here can help you because we're not familiar with your device. Once your thread is moved to the right forum the folks there should be able to assist though. Good luck.
Sent from my Evita
1. Unlock bootloader using normal method (if not already unlocked)
2. Flash latest clockworkmod recovery
3. go to recovery -> mount usb storage
4.Place contents of RAR file inside sdcard/clockworkmod/backup folder,
5. go to recovery and restore from that folder you created.
btw, there ARE instructions on the nanodroid backup page, follow those and you'll be all good.
Hi,
@tomascus - When I try to mount USB storage, it doesn't seem to work - it can't seem to access /sdcard (see first post). When I get home, I can paste the exact error message.
Cheers,
Victor
victorhooi said:
Hi,
@tomascus - When I try to mount USB storage, it doesn't seem to work - it can't seem to access /sdcard (see first post). When I get home, I can paste the exact error message.
Cheers,
Victor
Click to expand...
Click to collapse
What is your recovery ????
Hi,
@virgolib: My recovery is ClockworkMod Recovery v5.8.4.0.
@tomascus: If I go into Mounts and Storage, then "mount USB storage", then on my OSX, I get:
Code:
The disk you inserted was not readable by this computer.
Initialize... / Ignore / Eject
If I go into Mounts and Storage, then "mount /sdcard", on the phone I get:
Code:
Error mounting /sdcard!
If I try to use "Mounts and Storage menu", then "format /sdcard", I get:
Code:
Formatting /sdcard...
Error mounting /sdcard!
Skipping format...
Done.
My output from cat /proc/partitions:
Code:
~ # cat /proc/partitions
major minor #blocks name
179 0 30535680 mmcblk0
179 1 6144 mmcblk0p1
179 2 2048 mmcblk0p2
179 3 6144 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 16384 mmcblk0p6
179 7 16384 mmcblk0p7
179 8 16384 mmcblk0p8
179 9 4096 mmcblk0p9
179 10 4096 mmcblk0p10
179 11 28672 mmcblk0p11
179 12 1310720 mmcblk0p12
179 13 327680 mmcblk0p13
179 14 26476544 mmcblk0p14
179 15 2248704 mmcblk0p15
179 16 2048 mmcblk0p16
179 17 2048 mmcblk0p17
179 18 6144 mmcblk0p18
179 19 22528 mmcblk0p19
179 20 2048 mmcblk0p20
And from mount:
Code:
~ # mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mmcblk0p13 on /cache type ext4 (rw,nodev,noatime,nodiratime,user_xattr,acl,barrier=1,data=ordered)
Does the above look right?
And is the bootloader actually unlocked correctly?
Cheers,
Victor
victorhooi said:
Hi,
@virgolib: My recovery is ClockworkMod Recovery v5.8.4.0.
@tomascus: If I go into Mounts and Storage, then "mount USB storage", then on my OSX, I get:
Code:
The disk you inserted was not readable by this computer.
Initialize... / Ignore / Eject
If I go into Mounts and Storage, then "mount /sdcard", on the phone I get:
Code:
Error mounting /sdcard!
If I try to use "Mounts and Storage menu", then "format /sdcard", I get:
Code:
Formatting /sdcard...
Error mounting /sdcard!
Skipping format...
Done.
My output from cat /proc/partitions:
Code:
~ # cat /proc/partitions
major minor #blocks name
179 0 30535680 mmcblk0
179 1 6144 mmcblk0p1
179 2 2048 mmcblk0p2
179 3 6144 mmcblk0p3
179 4 8192 mmcblk0p4
179 5 8192 mmcblk0p5
179 6 16384 mmcblk0p6
179 7 16384 mmcblk0p7
179 8 16384 mmcblk0p8
179 9 4096 mmcblk0p9
179 10 4096 mmcblk0p10
179 11 28672 mmcblk0p11
179 12 1310720 mmcblk0p12
179 13 327680 mmcblk0p13
179 14 26476544 mmcblk0p14
179 15 2248704 mmcblk0p15
179 16 2048 mmcblk0p16
179 17 2048 mmcblk0p17
179 18 6144 mmcblk0p18
179 19 22528 mmcblk0p19
179 20 2048 mmcblk0p20
And from mount:
Code:
~ # mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mmcblk0p13 on /cache type ext4 (rw,nodev,noatime,nodiratime,user_xattr,acl,barrier=1,data=ordered)
Does the above look right?
And is the bootloader actually unlocked correctly?
Cheers,
Victor
Click to expand...
Click to collapse
Just try with Philz_Touch recovery ... http://d-h.st/users/philz_touch/?fld_id=16046#files
You have to wait about 3minutes for mounting USB storage.
Hi,
@virgolib - I was able to flash with PhilZ Touch Recovery 5.15.9-endeavoru, as suggested
I started it up in recovery mode, and selected "format /sdcard"
It then gave me a prompt asking to select the filesystem type (the or) - I chose vfat.
After this, I was able to ./adb push files onto /sdcard/clockworkmod/restore, and then do a Nandroid restore via PhilZ Touch recovery.
At this point I was returned to stock - I booted it up, and checked that it could boot, and wifi was working.
I then flashed a CM10.2 nightly based on the instructions here - http://wiki.cyanogenmod.org/w/Install_CM_for_endeavoru
Basically - flash the image and Gapps via PhilZ touch recovery, then use flashboot to flash the boot.img (kernel) - I'm assuming that step is still needed these days?
Also - I'm curious though - what's the difference between ClockworkMod and PhilZ Touch recovery? As in, why was PhilZ Touch recovery able to format the /sdcard successfully? Should I flash back ClockworkMod or leave Philz Touch recovery? And why is PhilZ touch recovery not more commonly known about? (To be honest, this was the first I'd even heard of it, I only knew CWM and TWRP).
Also, I checked my partitions just now:
Code:
[email protected]:/ $ df
Filesystem Size Used Free Blksize
/dev 485.9M 64.0K 485.9M 4096
/mnt/secure 485.9M 0.0K 485.9M 4096
/mnt/asec 485.9M 0.0K 485.9M 4096
/mnt/obb 485.9M 0.0K 485.9M 4096
/mnt/fuse 485.9M 0.0K 485.9M 4096
/system 1.2G 473.6M 786.3M 4096
/cache 315.0M 5.2M 309.7M 4096
/rca 5.9M 4.2M 1.7M 4096
/rfs 5.9M 4.0M 1.9M 4096
/devlog 21.6M 10.9M 10.7M 4096
/data 2.1G 307.2M 1.8G 4096
/storage/sdcard0 25.2G 1.6G 23.7G 16384
/mnt/secure/asec: Permission denied
/mnt/asec/com.grofsoft.tripview-1 5.0M 4.0M 1.0M 4096
The /sdcard one seems to be 25.2 Gb - which I assume is the correct size. When I went in before via ClockworkMod, and chose to partition it as 1024 Mb - did that simply not take? Or did the subsequent Nandroid restore, or flashing CM10.2 change it?
Cheers,
Victor
You have to install cm10.2 & gapps via recovery then flash boot.img of cm10.2. I'm just a user only not expertise so cannot answers by specify, Philz recovery is the most compatible at the moment. You seemed to be OK now and do as you wish restore or install cm rom.
Hello,
I compiled aosp for my nexus 7 2013 works fine, but i wanted to add apps and tweak things like bootanimation.zip and remove things like email app, i don't use it why waste space. I use the the follow to allow edits
simg2img system.img system.img.raw
mkdir system
sudo mount -t ext4 -o loop system.img.raw system/
I add my edits and than use this but get and error
[email protected]:~/Downloads/imagedisassemble$ sudo ./make_ext4fs -s -l 512M -a system mesystem.img system/
Creating filesystem with parameters:
Size: 536870912
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 2048
Label:
Blocks: 131072
Block groups: 4
Reserved block group size: 31
error: do_inode_allocate_extents: Failed to allocate 3 blocks
I have tried to change 512M to 600M it will finish without error, however when I flash with fastboot flash system system.img, I get stuck on the Google screen and have to force off with power and get into bootloader to try again.
Any help would be great
Thanks
Tony
Hi,
I am stuck in the bootloop after flashing data.img on Pixel C device.
I have done the following steps and have serached around in 100s of forums before posting this. Please bear with me.
My bootloader is unlocked and I have flashed my boot partition with dragon-boot-encryptable-rooted-01092016-1.img so that the data is not encrypted by default.
I have a freshly booted up (new setup) device with default apps installed. I installed one app so that the /data partition contains something. I am firing all commands as root on Ubuntu 14
I then flashboot into TWRP recovery so that I can access root shell through adb. This is not flashing the TWRP recovery, just booting into it.
#adb reboot bootloader
#fastboot boot twrp-3.0.0-0-dragon-ryu-02112016-1.img
#adb shell
~ # whoami
root
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1420244 20 1420224 0% /dev
tmpfs 1420244 20 1420224 0% /tmp
/dev/block/mmcblk0p6 396744 452 388100 0% /cache
/dev/block/mmcblk0p7 55453060 304032 55132644 1% /data
/dev/block/mmcblk0p7 55453060 304032 55132644 1% /sdcard
Now, I am interested only in taking image backup of my /data partition which is at /dev/block/mmcblk0p7. I confirmed this by:
/dev/block/platform/700b0600.sdhci/by-name # ls -l
...
lrwxrwxrwx 1 root root 20 Oct 16 07:38 UDA -> /dev/block/mmcblk0p7
...
Now, I fire the make_ext4fs command to create the image.
~#umount /sdcard (optional)
~ # make_ext4fs -s -l 55453060K -a data mydata.img /data
SELinux: Loaded file_contexts contexts from /file_contexts.
Creating filesystem with parameters:
Size: 56783933440
Block size: 4096
Blocks per group: 32768
Inodes per group: 8176
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 13863265
Block groups: 424
Reserved block group size: 1024
Created filesystem with 11/3466624 inodes and 263660/13863265 blocks
mydata.img is created. I do an adb pull on my Ubuntu and fetch the mydata.img and /file_contexts
#adb pull /file_contexts
#adb pull /mydata.img
# du *
20 file_contexts
140888 mydata.img
Now, I convert the mydata.img into raw image file with simg2img.
#./simg2img mydata.img mydata.img.raw
#ls -lrt
-rw-r--r-- 1 root root 17261 Oct 16 13:17 file_contexts
-rw-r--r-- 1 root root 144267780 Oct 16 13:18 mydata.img
-rw-r--r-- 1 root root 56783933440 Oct 16 13:21 mydata.img.raw
Now, I create a directory and mount my raw image into that directory.
#mkdir phonedata
#mount -t ext4 mydata.img.raw phonedata/
I navigate into phonedata and verify the contents. I can see that the app I installed in avaialable under /data/data.
Then, I re-create the image from phonedata mount using make_ext4fs, or I can use the mydata.img fetch by adb pull too.
If I re-create the image, I give file_contexts(fetched) as the -S option to make_ext4fs. One doubt here, if I am re-creating the sparse image, what value should be passed to -l paramtere now?
I got to fastboot and fire these commands.
#fastboot format userdata
#fastboot format data
#fastboot format cache
#fastboot flash data mydata.img { I am confused between data and userdata, which is the correct one. This is mydata.img from adb pull }
#fastboot flash vendor vendor.img { I read in one forum that vendor should be flashed again on a nexus device }
#fastboot reboot
All things take smoothly. When the tab reboot, it shows Google logo, then android flash animation, then it shows 'Android is starting', and then goes back to flash animation. That is, it's stuck in bootloop.
Kindly let me know if there is something with these steps. Or is there is any alternate way to do the same thing. My problem statement is, I need a flashable data.img. I can create TWRP backup and recovery fine, but that's not my requirement.
Thanks!
Edit 1:
I should add, at this point, if I hard boot to fastboot and do a fastboot format userdata followed by fastboot reboot, I am able to boot to device and perform new device setup.
I can also flash system,boot,vendor,recovery and cache.img and perform new device setup normally. This should mean my fastboot/adb are working fine.
Ummmmm
Did you try with smaller sparse image size ?
make_ext4fs -s -l 30000M -a data mydata.img /data
The sparse will grow until max partition size.
Did you play with "img2simg" as well ? (not simg2img)
img2simg mydata.img.raw mydata.img
TWRP final guide with EXACTLY what to do;
preparations:
wileyfox swift with cable (original, or high quality cable),
as swift plug is recessed quite deeply not like samsungs ect....
working ADB drivers or platform tools, and access into it from your PC,
latest TWRP for this phone,
first step is locating where your platform tools or ADB is actually installed,
you need to see the actual files like fastboot.exe,ect1.tool.exe,and adb.exe
copy into (platform tools) this folder TWRP.img, (renaming helps here), rename it to
TWRP.img from crackling xxxxxx.img
now make sure USB debugging is enabled in developer options, (press 7 times on build
number to see the developer options)
while in developer options switch on advanced reboot so you see bootloader option
plug in USB cable firmly
reboot your phone, while selecting "reboot", "go into bootloader option"
should get to a screen showing statistics such as
product name- crackling
variant QRD eMMC
Boootloader version- crackling-N-gef75ac3
serial number-XXXXXXXXX
secure boot-enabled
Device state-locked/unlocked
if the last one says locked, make sure you have backups, as continuing from this point
WILL wipe your device, no whatsapp, SMS messages, phone contacts ect..... please make sure
your backup is 100% current before continuing as once unlocked your phone will be factory reset
on your pc inside the platform tools folder, open a command window inside the folder
itself,(hold down SHIFT key , then right click on empty white area to get option "open command
window here).
now you should get a CMD window with the folder name where the platform tools already
populated,
now a quick test to see if everything working,
type fastboot devices and then enter,
should get a printout saying, xxxxxxx Fastboot
where XXXXX is your serial number shown on the screen
if you get nothing checck your cables,drivers ect.....
-----------Optional, if your bootloader is locked,
type fastboot OEM unlock to unlock your bootloader, see warning above........
-----------Optional
now for the meat of the process:
type fastboot flash recovery twrp.img
should get something similar to this:
target reported max download size of 268435456 bytes
sending 'recovery' (16888 KB)...
OKAY [ 0.563s]
writing 'recovery'...
OKAY [ 0.297s]
finished. total time: 0.859s
great, it flashed,
now the tricky bit..... its requires very precise timing, and flexibility as the buttons
are all in one row, and its hard to do everything properly.
UNPLUG the USB cable at this point,
remove the back cover off the phone,
physically remove the battery from the phone,
with the cover still off,
press and hold vol down and power button, and insert the battery into the phone
phone will vibrate, wait till you see wileyfox logo, then ONLY release power button
keep holding vol down button,
eventually TWRP logo appears,
TWRP is now installed, as far as I can make out its only temporary, as at the next reboot
it will flash the standard recovery once more,
hope this help others,
happy customizing....
Hello,
Where you able to mount /system with this method?
If so, what version of TWRP did you use?
Thanks
Cheers eg789123,
"
press and hold vol down and power button, and insert the battery into the phone
phone will vibrate, wait till you see wileyfox logo, then ONLY release power button
keep holding vol down button,
eventually TWRP logo appears, "
Roughly how long was eventually?
Currently typing one-handed...
Jim
This will lead to fail if you have a stock 7.1.1 firmware or old Cyanogen. It should be mentioned that you should flash a compatible bootloader first.
jim13243 said:
Cheers eg789123,
"
press and hold vol down and power button, and insert the battery into the phone
phone will vibrate, wait till you see wileyfox logo, then ONLY release power button
keep holding vol down button,
eventually TWRP logo appears, "
Roughly how long was eventually?
Currently typing one-handed...
Jim
Click to expand...
Click to collapse
quite quickly as soon as it vibrates, will show wileyfox logo, will vibrate again then show TWRP once more,
SlippyMcSlip said:
Hello,
Where you able to mount /system with this method?
If so, what version of TWRP did you use?
Thanks
Click to expand...
Click to collapse
used latest version, 3.1.1.0 TWRP,
I did have to flash eventually my folders to Vfat in order to get my Rom to install, otherwise I kept getting errors when flashing,
found this out by experimenting and flashing different versions until one allowed me to flash.
Thanks for this guide - still useful after years.
Here's my experience with my 2 Swifts with some additions for future reference. (If your phone's side buttons are as crappy as mine, keep reading, there is a way to get to recovery without needing the side buttons at all:)
background:
I'm following this LineageOS 17.1 install guide, specifically the "Installing the correct firmware". I first need to sideload an older Cyanogen 13 via recovery because.. reasons.. (see guide).
To do this I need to first be in Recovery, but not stock recovery because that one would not allow me to sideload either Cyanogen 13 or the new LineageOS. So either TWRP or the LineageOS recovery image for crackling would do - If I could reach it before the phone replaced it with the stock recovery again. So this is where this guide comes in:
Phone #1: This one is a half-decent condition still with the side buttons working most of the time 1st try.
Only thing was the timing of the "tricky bit" where you reinsert the battery while holding down power and volume down. I had the rest of my stuff ready, upon reaching flashed recovery immediately sideloaded the Cyanogen 13 (which replaces the bootloader) and from there on you can reach any flashed recovery also through the new/old/better bootloader's menu. Success!
Phone #2: The side buttons on this one have become very unreliable to the point where it's even hard to navigate the bootloader menu.
I just couldn't get it to work. The side buttons have degraded too much, I couldn't tell if they were actually pressed or not, let alone time it correctly. However I know from #1 I only need to reach recovery once to make it work.
Here's what I did without needing the side buttons at all:
Boot to bootloader, e.g:
Boot normally (fortunately still possible)
Connect usb debugging
Code:
adb reboot bootloader
In bad bootlooder
Do not flash recovery, boot recovery:
Code:
fastboot boot twrp-3.5.2_9-0-crackling.img
(I tried to boot from LineageOS crackling img but that failed. See command log in next post)
In TWRP
Do a factory reset
Code:
adb sideload SW27-WF-CRACKLING-CM-13.1.5-ZNH2KAS7EB-RECOVERY_v2.zip
Via menu reboot, reboot to bootloader
in good bootloader now
flash recovery:
Code:
fastboot flash recovery twrp-3.5.2_9-0-crackling.img
(this can also be the LineageOS img)
Reboot to recovery using the menu (now this works)
use recovery as you like.
So from here on out I followed the guide including installation of GApps.
I also resized the system partition using parted in TWRP with as detailed in this excellent post, otherwise OpenGApps wouldn't fit.
In the next post is the adb/fastboot command line log where you can see the entire process, hopefully this is useful for anyone with issues with their phone regardless of type.
Code:
###
### Below is a dump of commands to go stock updated Wileyfox Swift (crackling) Android N to LineageOS 17.1 with OpenGapps nano.
### ANYTHING STARTING WITH ### IS NOT A COMMAND BUT DESCRIBES THE PROCESS
### /Downloads contains .imgs for recovery and .zips for sideload, downloaded from LineageOS and OpenGapps.
### /Downloads/parted_gdisk_fdisk_mkfs.ext4-AARCH64 contains parted and mkfs.ext4 to increase system partition size,
### from http://illitrateman.blogspot.com/2020/06/how-to-create-system-partition-in.html
###
### Start, attached USB
Microsoft Windows [Version 10.0.19043.1083]
(c) Microsoft Corporation. All rights reserved.
C:\Users\hbrowser>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
e76fce6c device
### Found out OEM wasn't unlocked. Booted normally and allowed OEM unlock from settings in Android
### Back to bootloader without using volume buttons and such:
C:\Users\hbrowser>adb reboot bootloader
C:\Users\hbrowser>fastboot devices
e76fce6c fastboot
C:\Users\hbrowser>fastboot oem unlock
...
(bootloader) Follow the instructions on screen
OKAY [ 0.037s]
finished. total time: 0.037s
### Had to go through android setup because of OEM unlock - useless but needed to avoid volume buttons
### Back to bootloader again
C:\Users\hbrowser>adb reboot bootloader
error: device '(null)' not found
C:\Users\hbrowser>adb devices
List of devices attached
C:\Users\hbrowser> adb reboot bootloader
error: device '(null)' not found
### Needed to enable USB debug on phone
C:\Users\hbrowser>adb devices
List of devices attached
e76fce6c device
C:\Users\hbrowser>adb reboot bootloader
C:\Users\hbrowser>fastboot devices
e76fce6c fastboot
### Ready to try flash recovery
C:\Users\hbrowser>cd Downloads
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.826s]
writing 'recovery'...
OKAY [ 1.449s]
finished. total time: 2.277s
### Tried to boot flashed recovery using volume+power buttons, failing miserably:
C:\Users\hbrowser\Downloads>adb devices
List of devices attached
e76fce6c device
C:\Users\hbrowser\Downloads>adb reboot recovery
C:\Users\hbrowser\Downloads>fastboot devices
e76fce6c fastboot
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.828s]
writing 'recovery'...
OKAY [ 1.792s]
finished. total time: 2.620s
C:\Users\hbrowser\Downloads>adb reboot recovery
C:\Users\hbrowser\Downloads>fastboot devices
e76fce6c fastboot
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.826s]
writing 'recovery'...
OKAY [ 2.475s]
finished. total time: 3.303s
C:\Users\hbrowser\Downloads>fastboot devices
e76fce6c fastboot
C:\Users\hbrowser\Downloads>fastboot boot recovery lineage-17.1-20210710-recovery-crackling.img
cannot load 'recovery': No such file or directory
### Found out about "fastboot boot"
### Tried it out w/ Lineage 17.1 recovery:
C:\Users\hbrowser\Downloads>fastboot boot lineage-17.1-20210710-recovery-crackling.img
downloading 'boot.img'...
OKAY [ 0.826s]
booting...
FAILED (remote: dtb not found)
finished. total time: 0.869s
### No luck, tried some more using side buttons:
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.828s]
writing 'recovery'...
OKAY [ 1.825s]
finished. total time: 2.652s
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.825s]
writing 'recovery'...
OKAY [ 0.459s]
finished. total time: 1.286s
C:\Users\hbrowser\Downloads>fastboot flash recovery lineage-17.1-20210710-recovery-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (26224 KB)...
OKAY [ 0.826s]
writing 'recovery'...
OKAY [ 0.455s]
finished. total time: 1.282s
### Gave up on side buttons
C:\Users\hbrowser\Downloads>adb reboot recovery
C:\Users\hbrowser\Downloads>adb reboot bootloader
error: device '(null)' not found
###
### Tried fastboot boot w/ TWRP img:
C:\Users\hbrowser\Downloads>fastboot boot twrp-3.5.2_9-0-crackling.img
downloading 'boot.img'...
OKAY [ 0.584s]
booting...
OKAY [ 0.675s]
finished. total time: 1.259s
### Success: we/re in TWRP here:
C:\Users\hbrowser\Downloads>adb devices
List of devices attached
e76fce6c sideload
### Doing something I hoped would work but wasn't in any guide I had seen: sideloading from a fastboot boot-ed recovery, not a flash-ed one
C:\Users\hbrowser\Downloads>adb sideload SW27-WF-CRACKLING-CM-13.1.5-ZNH2KAS7EB-RECOVERY_v2.zip
serving: 'SW27-WF-CRACKLING-CM-13.1.5-ZNH2KAS7EB-RECOVERY_v2.zip' (~45%) * failed to read command: No error
### Crossed fingers and rebooted to recovery from TWRP menu.
### After reboot:
C:\Users\hbrowser\Downloads>adb devices
List of devices attached
e76fce6c sideload
### It worked, we're inside Cyanogen 13 recovery here:
C:\Users\hbrowser\Downloads>adb reboot bootloader
error: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
### OK no adb but no problem, used the CM13 recovery menu to get back to bootloader
### Now actually flashing TWRP recovery:
C:\Users\hbrowser\Downloads>fastboot flash recovery twrp-3.5.2_9-0-crackling.img
target reported max download size of 268435456 bytes
sending 'recovery' (18540 KB)...
OKAY [ 0.587s]
writing 'recovery'...
OKAY [ 1.506s]
finished. total time: 2.094s
### Rebooted phone to recovery again here
### Phone is now running flashed TWRP!
### From here on following this post to increase system partition size
### https://forum.xda-developers.com/t/rom-10-0-official-lineageos-17-1-for-wileyfox-swift.4119901/post-84990507
C:\Users\hbrowser\Downloads>cd parted_gdisk_fdisk_mkfs.ext4-AARCH64
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb push parted /sbin
6093 KB/s (470788 bytes in 0.075s)
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb push mkfs.ext4 /sbin
6704 KB/s (422068 bytes in 0.061s)
### adb shell stuff; disregard the weird ←[6n characters, this is apparently how Windows command shows the adb shell when in recovery mode
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb shell
~ # ←[6nchmod 755 /sbin/parted
~ # ←[6nchmod 755 /sbin/mkfs.ext4
~ # ←[6nparted /dev/block/mmcblk0
GNU Parted 3.2
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) p
Model: MMC R821MB (sd/mmc)
Disk /dev/block/mmcblk0: 30535680s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 131072s 132095s 1024s sbl1
2 132096s 133119s 1024s sbl1bak msftdata
3 133120s 135167s 2048s aboot
4 135168s 137215s 2048s abootbak msftdata
5 137216s 138239s 1024s rpm
6 138240s 139263s 1024s rpmbak msftdata
7 139264s 140287s 1024s tz
8 140288s 141311s 1024s tzbak msftdata
9 141312s 142335s 1024s hyp
10 142336s 143359s 1024s hypbak msftdata
11 143360s 143367s 8s devinfo
12 262144s 265215s 3072s modemst1
13 265216s 268287s 3072s modemst2
14 268288s 270335s 2048s misc
15 270336s 270337s 2s fsc
16 270344s 270359s 16s ssd
17 270360s 290839s 20480s splash
18 290840s 291863s 1024s keystore
19 393216s 524287s 131072s oem
20 524288s 524351s 64s DDR
21 524352s 655423s 131072s fat16 modem msftdata
22 655424s 658495s 3072s fsg
23 658496s 658527s 32s sec
24 658528s 724063s 65536s boot
25 724064s 3869791s 3145728s ext4 system msftdata
26 3869792s 3935327s 65536s recovery
27 3935328s 4066399s 131072s odm msftdata
28 4194304s 4259839s 65536s ext4 persist msftdata
29 4259840s 4567039s 307200s ext4 cache msftdata
30 4567040s 4568063s 1024s frp msftdata
31 4568064s 30535646s 25967583s ext4 userdata msftdata
(parted) quit
~ # ←[6ncd /data
/data # ←[6ndd if=/dev/block/mmcblk0p26 of=/sdcard1/recovery.part bs=1k
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb devices
List of devices attached
e76fce6c recovery
### prepare folder b for backups on physical SD card at /sdcard1
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb shell
~ # ←[6ncd /sdcard1
/sdcard1 # ←[6nls -a
. Android LOST.DIR Notifications Ringtones
.. DCIM Movies Pictures
Alarms Download Music Podcasts
/sdcard1 # ←[6nmd b
/sbin/sh: md: not found
/sdcard1 # ←[6nmkdir b
/sdcard1 # ←[6ncd b
/sdcard1/b # ←[6nls
/sdcard1/b # ←[6ncd ..
/sdcard1 # ←[6nexit
### Copy some files needed for partitioning to /sbin
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb push parted /sbin
3559 KB/s (470788 bytes in 0.129s)
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb push mkfs.ext4 /sbin
7496 KB/s (422068 bytes in 0.054s)
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb shell
~ # ←[6nchmod 755 /sbin/parted
~ # ←[6nchmod 755 /sbin/mkfs.ext4
### Make some backups to /sdcard1
~ # ←[6ncd /data
/data # ←[6ntar cvpf /sdcard1/b/data.tar .
./
./lost+found/
./misc/
./misc/vold/
./media/
./media/obb/
./media/0/
./media/0/Music/
./media/0/Podcasts/
./media/0/Ringtones/
./media/0/Alarms/
./media/0/Notifications/
./media/0/Pictures/
./media/0/Movies/
./media/0/Download/
./media/0/DCIM/
./media/0/Android/
./media/0/Android/data/
./media/0/Android/data/.nomedia
./media/0/Android/data/com.google.android.tts/
./media/0/Android/data/com.google.android.tts/files/
./media/0/Android/data/com.google.android.tts/files/download_cache/
./media/0/Android/data/com.google.android.gms/
./media/0/Android/data/com.google.android.gms/files/
./media/0/Android/data/com.google.android.apps.docs/
./media/0/Android/data/com.google.android.apps.docs/files/
./media/0/Android/data/com.google.android.apps.docs/files/pinned_docs_files_do_not_edit/
./media/0/Android/data/com.google.android.apps.docs/cache/
./media/0/Android/data/com.google.android.youtube/
./media/0/Android/data/com.google.android.youtube/files/
./media/0/Android/data/com.google.android.youtube/cache/
./media/0/Android/data/com.google.android.youtube/cache/exo/
./media/0/Android/data/com.google.android.youtube/cache/cronet_media_cache/
./media/0/Android/data/com.google.android.music/
./media/0/Android/data/com.google.android.music/files/
./media/0/Android/data/com.google.android.music/files/._playmusicid
./media/0/Android/data/com.google.android.apps.maps/
./media/0/Android/data/com.google.android.apps.maps/files/
./media/0/Android/data/com.google.android.apps.maps/testdata/
./media/0/Android/data/com.google.android.apps.maps/cache/
./media/0/Android/data/com.google.android.apps.maps/cache/cache_r.m
./media/0/Android/data/com.google.android.videos/
./media/0/Android/data/com.google.android.videos/files/
./media/0/Android/data/com.google.android.videos/files/Movies/
./media/0/Android/data/com.google.android.googlequicksearchbox/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/download_cache/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/pending_blobs/
./media/0/Android/data/com.wileyfox.foxhole/
./media/0/Android/data/com.wileyfox.foxhole/cache/
./media/0/Android/data/com.wileyfox.foxhole/cache/.nomedia
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/journal
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/6b252795ac295a4a7cda47dca043156f.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/16ab8a84275fa5f118fba2b6de18dd2a.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/f3c9aa681e0a1bfd4fa4610dcf452878.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/e1d8fa457c200344ee15b29ba08ade16.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/a33f7db12173ef67560cfd72104fa5bd.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/161e5dbfa3c4b7a15067a954dc745205.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/410fbd46ba9d9bf2e386b0c8d1ecbdf1.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/0693488ee7728289efbb3e05c12c3ff5.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/fd066a3d7c69f45743c3b97f6838ff9b.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/33090faed4ae2d43a360a28fcafc15ba.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/6e1f2f8d84d153151594bb46455a1606.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/bdaee8dd07727c6cc0b1cc1e1ba5b7ed.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/7e19b0b4ada70ee784b12e8e2beb1540.0
./media/0/Android/data/com.google.android.gm/
./media/0/Android/data/com.google.android.gm/cache/
./media/0/Android/data/com.android.vending/
./media/0/Android/data/com.android.vending/files/
./media/0/Android/data/com.android.vending/files/installer/
./media/0/TWRP/
./media/0/TWRP/.twrps
./.layout_version
/data # ←[6ncd /
~ # ←[6numount /data
~ # ←[6numount /cache
~ # ←[6numount /sdcard
~ # ←[6ndd if=/dev/block/mmcblk0p25 of=/sdcard1/b/system.part bs=1k
1572864+0 records in
1572864+0 records out
1610612736 bytes (1.5GB) copied, 104.228577 seconds, 14.7MB/s
~ # ←[6ndd if=/dev/block/mmcblk0p26 of=/sdcard1/b/recovery.part bs=1k
32768+0 records in
32768+0 records out
33554432 bytes (32.0MB) copied, 0.438195 seconds, 73.0MB/s
~ # ←[6ndd if=/dev/block/mmcblk0p27 of=/sdcard1/b/odm.part bs=1k
65536+0 records in
65536+0 records out
67108864 bytes (64.0MB) copied, 0.691368 seconds, 92.6MB/s
~ # ←[6ndd if=/dev/block/mmcblk0p28 of=/sdcard1/b/persist.part bs=1k
32768+0 records in
32768+0 records out
33554432 bytes (32.0MB) copied, 0.406862 seconds, 78.7MB/s
~ # ←[6ndd if=/dev/block/mmcblk0p29 of=/sdcard1/b/cache.part bs=1k
153600+0 records in
153600+0 records out
157286400 bytes (150.0MB) copied, 7.381452 seconds, 20.3MB/s
~ # ←[6ndd if=/dev/block/mmcblk0p30 of=/sdcard1/b/frp.part bs=1k
512+0 records in
512+0 records out
524288 bytes (512.0KB) copied, 0.041657 seconds, 12.0MB/s
~ # ←[6nparted /dev/b←[Jlock/mmcblk0
GNU Parted 3.2
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) quit
~ # ←[6ncd /sdcard1
/sdcard1 # ←[6ncd b
/sdcard1/b # ←[6nls
cache.part frp.part persist.part system.part
data.tar odm.part recovery.part
/sdcard1/b # ←[6ncd /
### Here I added the parameter
### -a minimal
### to parted because of some warnings it gave earlier about sector boundaries.
### not sure whether this actually has any effect but warnings are gone and android works fine afterwards
~ # parted /dev/block/mmcblk0 -a minimal
GNU Parted 3.2
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) p
Model: MMC R821MB (sd/mmc)
Disk /dev/block/mmcblk0: 30535680s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 131072s 132095s 1024s sbl1
2 132096s 133119s 1024s sbl1bak msftdata
3 133120s 135167s 2048s aboot
4 135168s 137215s 2048s abootbak msftdata
5 137216s 138239s 1024s rpm
6 138240s 139263s 1024s rpmbak msftdata
7 139264s 140287s 1024s tz
8 140288s 141311s 1024s tzbak msftdata
9 141312s 142335s 1024s hyp
10 142336s 143359s 1024s hypbak msftdata
11 143360s 143367s 8s devinfo
12 262144s 265215s 3072s modemst1
13 265216s 268287s 3072s modemst2
14 268288s 270335s 2048s misc
15 270336s 270337s 2s fsc
16 270344s 270359s 16s ssd
17 270360s 290839s 20480s splash
18 290840s 291863s 1024s keystore
19 393216s 524287s 131072s oem
20 524288s 524351s 64s DDR
21 524352s 655423s 131072s fat16 modem msftdata
22 655424s 658495s 3072s fsg
23 658496s 658527s 32s sec
24 658528s 724063s 65536s boot
25 724064s 3869791s 3145728s ext4 system msftdata
26 3869792s 3935327s 65536s recovery
27 3935328s 4066399s 131072s odm msftdata
28 4194304s 4259839s 65536s ext4 persist msftdata
29 4259840s 4567039s 307200s ext4 cache msftdata
30 4567040s 4568063s 1024s frp msftdata
31 4568064s 30535646s 25967583s ext4 userdata msftdata
### ### Point of no return! ### ###
(parted) rm 31
(parted) rm 30
(parted) rm 29
(parted) rm 28
(parted) rm 27
(parted) rm 26
(parted) rm 25
(parted) mkpart 25 ext2 724064 5442655
(parted) name 25 system
(parted) mkpart 26 5442656 5508191
(parted) name 26 recovery
(parted) mkpart 27 5508192 5639263
(parted) name 27 odm
(parted) mkpart 28 ext4 5767168 5832703
(parted) name 28 persist
(parted) mkpart 29 ext4 5832704 6139903
(parted) name 29 cache
(parted) mkpart 30 6139904 6140927
(parted) name 30 frp
(parted) mkpart 31 ext4 6140928 30535646
(parted) name 31 userdata
(parted) quit
Information: You may need to update /etc/fstab.
~ # ←[6ne2fsck -f /dev/block/mmcblk0p25
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
system: 2606/98304 files (0.0% non-contiguous), 376124/393215 blocks
~ # ←[6nresize2fs /dev/block/mmcblk0p25
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p25' first.
### The warning above threw me off so I ran both commands once more:
~ # ←[6ne2fsck -f /dev/block/mmcblk0p25
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
system: 2606/98304 files (0.0% non-contiguous), 376124/393215 blocks
~ # ←[6nresize2fs /dev/block/mmcblk0p25
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p25' first.
### No change, so just continued making filesystems on partitions where needed:
~ # ←[6nmkfs.ext4 /dev/block/mmcblk0p28
mke2fs 1.44.1 (24-Mar-2018)
Warning: the fs_type small is not defined in mke2fs.conf
Discarding device blocks: done
Creating filesystem with 8192 4k blocks and 2048 inodes
Allocating group tables: done
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
~ # ←[6nmkfs.ext4 /dev/block/mmcblk0p29
mke2fs 1.44.1 (24-Mar-2018)
Warning: the fs_type small is not defined in mke2fs.conf
Discarding device blocks: done
Creating filesystem with 38400 4k blocks and 9600 inodes
Filesystem UUID: dac5a678-08b8-4d48-aee7-56c37b897905
Superblock backups stored on blocks:
32768
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
~ # ←[6nmkfs.ext4 /dev/block/mmcblk0p31
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done
Creating filesystem with 3049339 4k blocks and 762528 inodes
Filesystem UUID: c6de72c1-7a7c-4a19-89ef-8d31a25c9e6f
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
### Restoring backups from /sdcard
~ # ←[6ndd if=/sdcard1/b/recovery.part of=/dev/block/mmcblk0p26 bs=1k
32768+0 records in
32768+0 records out
33554432 bytes (32.0MB) copied, 6.745916 seconds, 4.7MB/s
~ # ←[6ndd if=/sdcard1/b/odm.part of=/dev/block/mmcblk0p27 bs=1k
65536+0 records in
65536+0 records out
67108864 bytes (64.0MB) copied, 13.897083 seconds, 4.6MB/s
~ # ←[6ndd if=/sdcard1/b/persist.part of=/dev/block/mmcblk0p28 bs=1k
32768+0 records in
32768+0 records out
33554432 bytes (32.0MB) copied, 7.680875 seconds, 4.2MB/s
~ # ←[6ndd if=/sdcard1/b/cache.part of=/dev/block/mmcblk0p29 bs=1k
153600+0 records in
153600+0 records out
157286400 bytes (150.0MB) copied, 31.555507 seconds, 4.8MB/s
~ # ←[6ndd if=/sdcard1/b/frp.part of=/dev/block/mmcblk0p30 bs=1k
512+0 records in
512+0 records out
524288 bytes (512.0KB) copied, 0.104642 seconds, 4.8MB/s
~ # ←[6nmount /dev/block/mmcblk0p31 /data
~ # ←[6ncd /data
/data # ←[6ntar xvpf /sdcard1/b/data.tar .
./
./lost+found/
./misc/
./misc/vold/
./media/
./media/obb/
./media/0/
./media/0/Music/
./media/0/Podcasts/
./media/0/Ringtones/
./media/0/Alarms/
./media/0/Notifications/
./media/0/Pictures/
./media/0/Movies/
./media/0/Download/
./media/0/DCIM/
./media/0/Android/
./media/0/Android/data/
./media/0/Android/data/.nomedia
./media/0/Android/data/com.google.android.tts/
./media/0/Android/data/com.google.android.tts/files/
./media/0/Android/data/com.google.android.tts/files/download_cache/
./media/0/Android/data/com.google.android.gms/
./media/0/Android/data/com.google.android.gms/files/
./media/0/Android/data/com.google.android.apps.docs/
./media/0/Android/data/com.google.android.apps.docs/files/
./media/0/Android/data/com.google.android.apps.docs/files/pinned_docs_files_do_not_edit/
./media/0/Android/data/com.google.android.apps.docs/cache/
./media/0/Android/data/com.google.android.youtube/
./media/0/Android/data/com.google.android.youtube/files/
./media/0/Android/data/com.google.android.youtube/cache/
./media/0/Android/data/com.google.android.youtube/cache/exo/
./media/0/Android/data/com.google.android.youtube/cache/cronet_media_cache/
./media/0/Android/data/com.google.android.music/
./media/0/Android/data/com.google.android.music/files/
./media/0/Android/data/com.google.android.music/files/._playmusicid
./media/0/Android/data/com.google.android.apps.maps/
./media/0/Android/data/com.google.android.apps.maps/files/
./media/0/Android/data/com.google.android.apps.maps/testdata/
./media/0/Android/data/com.google.android.apps.maps/cache/
./media/0/Android/data/com.google.android.apps.maps/cache/cache_r.m
./media/0/Android/data/com.google.android.videos/
./media/0/Android/data/com.google.android.videos/files/
./media/0/Android/data/com.google.android.videos/files/Movies/
./media/0/Android/data/com.google.android.googlequicksearchbox/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/download_cache/
./media/0/Android/data/com.google.android.googlequicksearchbox/files/pending_blobs/
./media/0/Android/data/com.wileyfox.foxhole/
./media/0/Android/data/com.wileyfox.foxhole/cache/
./media/0/Android/data/com.wileyfox.foxhole/cache/.nomedia
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/journal
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/6b252795ac295a4a7cda47dca043156f.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/16ab8a84275fa5f118fba2b6de18dd2a.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/f3c9aa681e0a1bfd4fa4610dcf452878.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/e1d8fa457c200344ee15b29ba08ade16.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/a33f7db12173ef67560cfd72104fa5bd.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/161e5dbfa3c4b7a15067a954dc745205.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/410fbd46ba9d9bf2e386b0c8d1ecbdf1.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/0693488ee7728289efbb3e05c12c3ff5.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/fd066a3d7c69f45743c3b97f6838ff9b.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/33090faed4ae2d43a360a28fcafc15ba.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/6e1f2f8d84d153151594bb46455a1606.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/bdaee8dd07727c6cc0b1cc1e1ba5b7ed.0
./media/0/Android/data/com.wileyfox.foxhole/cache/zenkit/FeedImageLoader/7e19b0b4ada70ee784b12e8e2beb1540.0
./media/0/Android/data/com.google.android.gm/
./media/0/Android/data/com.google.android.gm/cache/
./media/0/Android/data/com.android.vending/
./media/0/Android/data/com.android.vending/files/
./media/0/Android/data/com.android.vending/files/installer/
./media/0/TWRP/
./media/0/TWRP/.twrps
./.layout_version
/data # ←[6nqu←[←[←[Jexit
### Ready to see if partition resize worked out
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>adb reboot recovery
### Back in TWRP
C:\Users\hbrowser\Downloads\parted_gdisk_fdisk_mkfs.ext4-AARCH64>cd ..
C:\Users\hbrowser\Downloads>adb sideload lineage-17.1-20210710-nightly-crackling-signed.zip
serving: 'lineage-17.1-20210710-nightly-crackling-signed.zip' (~47%) * failed to read command: No error
C:\Users\hbrowser\Downloads>adb shell
~ # ←[6ncd /
### Not sure what happened here but at some point I ran into space issues again.
### Used Advanced wipe and filesystem repair, resize in TWRP without effect.
### Rebooted to recovery from TWRP menu again hoping that would make it recognize the added space.
### After reboot correct system partition size became visible in Advanced Wipe.
### Continued:
C:\Users\hbrowser\Downloads>adb sideload lineage-17.1-20210710-nightly-crackling-signed.zip
serving: 'lineage-17.1-20210710-nightly-crackling-signed.zip' (~47%) * failed to read command: No error
### OpenGapps still failed but expected
C:\Users\hbrowser\Downloads>adb sideload open_gapps-arm64-10.0-nano-20210710.zip
serving: 'open_gapps-arm64-10.0-nano-20210710.zip' (~6%) * failed to read command: No error
### Now In TWRP: Resize System partition in Wipe - Advanced
### If error: run again
### This fixes the problem:
C:\Users\hbrowser\Downloads>adb sideload open_gapps-arm64-10.0-nano-20210710.zip
serving: 'open_gapps-arm64-10.0-nano-20210710.zip' (~54%) * failed to read command: No error
C:\Users\hbrowser\Downloads>
### The End
Hey folks, I'm new here obviously and whilst i've managed to do this on a Samsung S5 before (showing my age) - i've been really struggling to get fastboot devices to show my Wileyfox Swift 2.
< waiting for device >
Click to expand...
Click to collapse
So far i've downloaded the Google Drivers from Android Studio, and the phone is listed via adb. Could anyone give any information, that would be truly appreciated.
EDIT:
I tried it on Linux and the drivers were detected straight away - Windows 11 is poo.
EDIT I FIGURED IT OUT, after some head scratching and studying of magisk 15.3 zip.
Below is how I was able to edit the init.rc:
Required:
Magisk-v15.3.zip
- Magisk-v15.3/arm64/magiskboot
- Magisk-v15.3/chromeos/futility
- Magisk-v15.3/chromeos/kernel.keyblock
- Magisk-v15.3/chromeos/kernel_data_key.vbprivk
*I have to sudo adb, not sure how to have the permissions by default.*
Code:
adb push futility /sdcard/
adb push magiskboot /sdcard/
cp /sdcard/futility /system/bin/
chmod u+x /system/bin/futility
cp magiskboot /system/bin/
chmod u+x /system/bin/magiskboot
mkdir -p /sdcard/initrc
adb push kernel_data_key.vbprivk /sdcard/initrc/
adb push kernel.keyblock /sdcard/initrc/
Old guides on the interwebs tell you that lnx is the partition to unpack / repack flash however if you peek at Magisk-v15.3/common/util_functions.sh
Code:
find_boot_image() {
...
for BLOCK in boot_a kern-a android_boot kernel boot lnx bootimg; do
BOOTIMAGE=`find /dev/block -iname $BLOCK | head -n 1` 2>/dev/null
Because there's a kern-a that's the one you need to use. The above command gets me:
/dev/block/platform/700b0600.sdhci/by-name/KERN-A
The above command also is used to display: "Found boot image: /dev/block/mmcblk0p1" (cat /proc/partitions) during Magisk installation.
Now that I've figured out the boot partition, I'll use magiskboot to unpack it.
Code:
cd /sdcard/initrc
magiskboot --unpack /dev/block/platform/700b0600.sdhci/by-name/KERN-A
MagiskBoot v15.3(1531) (by topjohnwu) - Boot Image Modification Tool
Parsing boot image: [/dev/block/platform/700b0600.sdhci/by-name/KERN-A]
KERNEL [5481552] @ 0x10008000
RAMDISK [1876886] @ 0x11000000
SECOND [0] @ 0x10f00000
EXTRA [0] @ 0x10000100
PAGESIZE [2048]
OS_VERSION [8.1.0]
PATCH_LEVEL [2018-03]
NAME []
CMDLINE [buildvariant=userdebug]
DTB [5481552]
KERNEL_FMT [dtb]
RAMDISK_FMT [gzip]
The unpacking will create dtb, kernel, and ramdisk.cpio. I'll extract the ramdisk.cpio so I can add / edit files.
**NOTE** if you get a permission denied .backup / .subackup just run sudo
Code:
mkdir ramdisk
cd ramdisk
sudo cpio -i -d -m < ../ramdisk.cpio
I'm not sure how to fix this but I was getting:
cpio: bugreports: Operation not permitted
cpio: charger: Operation not permitted
cpio: d: Operation not permitted
cpio: etc: Operation not permitted
cpio: sbin/ueventd: Operation not permitted
cpio: sbin/watchdogd: Operation not permitted
cpio: sdcard: Operation not permitted
I was forced to copy ramdisk.cpio to my computer and extract it, update, and repack it there.
Once you're ready to repack and move the ramdisk back to the pixel c.
Code:
sudo find . | sudo cpio -R 0:0 -H newc -o > ../newramdisk.cpio
mv /sdcard/initrc/ramdisk.cpio /sdcard/initrc/ramdisk.cpio.orig
adb push newramdisk.cpio /sdcard/initrc/ramdisk.cpio
cd /sdcard/initrc && magiskboot --repack /dev/block/platform/700b0600.sdhci/by-name/KERN-A
MagiskBoot v15.3(1531) (by topjohnwu) - Boot Image Modification Tool
Parsing boot image: [/dev/block/platform/700b0600.sdhci/by-name/KERN-A]
KERNEL [5481552] @ 0x10008000
RAMDISK [1876886] @ 0x11000000
SECOND [0] @ 0x10f00000
EXTRA [0] @ 0x10000100
PAGESIZE [2048]
OS_VERSION [8.1.0]
PATCH_LEVEL [2018-03]
NAME []
CMDLINE [buildvariant=userdebug]
DTB [5481552]
KERNEL_FMT [dtb]
RAMDISK_FMT [gzip]
Repack to boot image: [new-boot.img]
KERNEL [5481552] @ 0x10008000
RAMDISK [1879383] @ 0x11000000
SECOND [0] @ 0x10f00000
EXTRA [0] @ 0x10000100
PAGESIZE [2048]
OS_VERSION [8.1.0]
PATCH_LEVEL [2018-03]
NAME []
CMDLINE [buildvariant=userdebug]
This will create "new-boot.img" file. Next we'll need to sign the image. If someone can explain why it's required that would be great.
Code:
cd /sdcard/initrc
echo > empty
futility vbutil_kernel --pack new-boot.img.signed --keyblock ./kernel.keyblock --signprivate ./kernel_data_key.vbprivk --version 1 --vmlinuz new-boot.img --config empty --arch arm --bootloader empty --flags 0x1
Finally flash the signed boot image and reboot
Code:
cat /sdcard/initrc/new-boot.img.signed | eval cat - | cat - /dev/zero 2>/dev/null | dd of=/dev/block/platform/700b0600.sdhci/by-name/KERN-A bs=4096
dd: /dev/block/platform/700b0600.sdhci/by-name/KERN-A: No space left on device
8193+0 records in
8192+0 records out
33554432 bytes transferred in 0.129 secs (260111875 bytes/sec)
---ORIGINAL POST---
Trying to edit init.rc (or anything really in the ramdisk) by unpacking / repacking and flashing but I get stuck in a TWRP 3.2.1-0 bootloop. I've been using the latest unofficial lineage March 8, 2018 from followmsi
I'm not sure if there's an easier way or I'm doing it wrong all the guides out there are from 2012-2014.
With github com/xiaolu/mkbootimg_tools was using the LNX partition but then noticed the SuperSu.zip when installing from TWRP was using KERN-A the mmcblk0p1.
Code:
Unpack & decompress ../boot.img to boot
kernel : kernel
ramdisk : ramdisk
page size : 2048
kernel size : 5463088
ramdisk size : 1594653
base : 0x10000000
kernel offset : 0x00008000
ramdisk offset : 0x01000000
tags offset : 0x00000100
cmd line : buildvariant=userdebug
ramdisk is gzip format.
Unpack completed.
When flashing either of them I get stuck in the bootloop. I've tried fastboot flash boot new_boot.img, dd and cat > when updating the repacked boot image. I also tried fastboot flash:raw boot <kernel> [ <ramdisk> [ <second> ] ] create bootimage and flash it.
When booting the image without flashing via sudo fastboot boot new_boot.img I get stuck on the lineageOS logo before it reboots to recovery TWRP then I have to reboot again to get back into the rom.
I've also tried many other unpacking / packing script tools with no success just bootloops or complaints about invalid boot.img
I don't understand how supersu and magisk zip can have zips run from twrp that are able to edit the ramdisk? Are they running a compiled c program like this? github com/TeamWin/Team-Win-Recovery-Project/blob/8373cfe28cf1b5ad758faa1d502e21787c3665e4/injecttwrp/injecttwrp.c
Probably not relevant (disclaimer couldn't hex edit my way out of a paper bag) but noticed sometimes when repacking with different tools and peeking at the new boot image with ghex that the first line in the original boot was always CHROMEOS but the repacked would say ANDROID! and be just 5-7mb when the boot image backup would be 36mb in size.
Code:
APP -> /dev/block/mmcblk0p4
CAC -> /dev/block/mmcblk0p6
KERN-A -> /dev/block/mmcblk0p1
KERN-B -> /dev/block/mmcblk0p2
LNX -> /dev/block/mmcblk0p9
MD1 -> /dev/block/mmcblk0p8
MSC -> /dev/block/mmcblk0p10
PST -> /dev/block/mmcblk0p11
UDA -> /dev/block/mmcblk0p7
VNR -> /dev/block/mmcblk0p5
recovery -> /dev/block/mmcblk0p3
cat /proc/partitions
Code:
7 0 98304 loop0
254 0 520912 zram0
179 0 61071360 mmcblk0
179 1 32768 mmcblk0p1
179 2 32768 mmcblk0p2
179 3 32768 mmcblk0p3
179 4 3670016 mmcblk0p4
179 5 311296 mmcblk0p5
179 6 409600 mmcblk0p6
179 7 56470528 mmcblk0p7
179 8 65536 mmcblk0p8
179 9 32768 mmcblk0p9
179 10 4096 mmcblk0p10
179 11 512 mmcblk0p11
179 96 4096 mmcblk0rpmb
179 64 4096 mmcblk0boot1
179 32 4096 mmcblk0boot0
253 0 56470528 dm-0