It’s easy to get lulled into a false sense of security. I bricked my Wileyfox Swift trying to install Lineage: with hindsight, should have tried harder to ensure I had a backout.
- I’d have tried using ‘dd’ to back up the ‘system’ partition, as the usual toolset (TWRP, adb, fastboot etc) don’t seem to be able to cope with squashfs.
- I could use a SD card for this; if you’re doing it on internal storage, ensure you don’t wipe the storage that the backup is on.
Contrary to the blog title, ext4 vs. squashfs isn’t the actual issue.
Three things I think I’ve learnt.
- Wileyfox switched from Cyanogen to Android, and when they did that, it seems that upgraded a component of booting the phone. Flashing to a Cyanogen stock image proved I could unbrick it. Found this reddit post later which seems to confirm this, and aside from downgrading to Cyanogen first, there’s a alternative kernel that apparently works as well.
- Search for your device on Reddit, sort by ‘new’, and then find a recent post from someone who’s already been there.
- Reformat the system partition before flashing a new OS. I’ve now got it working with an oldish Lineage build, but prior to doing this, I reformatted system. TWRP told me that there was very little free space there before; I suspect my issues getting it to boot were caused by stuff being left behind by previous images.
I have a Wileyfox Swift and want to flash it with Lineage it because
- Last update was January 2018; Wileyfox went under, and stopped updating their phones.
- They’d replaced the dialler with Truecaller. I’d migrated to an iPhone so its limitations were not bothering me any more, but it’d taken to spitting out notifications encouraging me to upgrade. That *really* pisses me off!
- It was otherwise a perfectly good phone: I had a second battery for it, and the screen was pristine because I’d left the protective shipping film on it while it was my main phone. (I only found out after I switched to the iPhone, and noticed the cutouts!)
I knew the broad process from flashing Nexus 7 (2012) tablets.
However, fairly soon I noticed some problems – I couldn’t back up the existing OS. The procedures I had were
- via ADB, as follows (or without the -apk) – it backed up a few kb of stuff only.
I was running it without the quotes and that worked even worse; googling tipped me off to that.
I assume these are parameters for ‘backup’ and not ‘adb’ or something. Wierd way to design a tool.
sudo adb backup "-apk -shared -all -f /tmp/backup.ab"
- via TWRP. I think it generated an error about /system.
Having unlocked the bootloader, which wipes the phone, I decided to push ahead without a backup. I didn’t really want it anyway.
lineage-15.1-20190115-nightly-crackling-signed.zip open_gapps-arm64-8.1-nano-20190206.zip twrp-3.2.3-0-crackling.img
The flashing process under TWRP didn’t work either. The relevant errors as follows:
Updating partition details... Failed to mount '/system' (no such device) ...done [...] detected filesystem squashfs for /dev/block/bootdevice/by-name/system mount: Failed to mount /dev/block/bootdevice/by-name/system at /system: No such device
So, I had a look around using the terminal.
- The specified target device is present; it’s a symbolic link to /dev/block/mmcblk0p25
- /dev/block/mmcblk0p25 is present, and fdisk -l /dev/block/mmcblk0 shows it as well.
I ended up watching a video that suggested a fix – https://www.youtube.com/watch?v=T-7neHzSIvc
Summary: reformatting the partition. This was after digging for quite a while for a saner fix.
The video only showed wiping the /data partition. Wiping /system is a one way trip. You’re counting on there being a return ticket when you get there, particularly without a backup.
Hey ho ..
- TWRP front menu: wipe
- select: Advanced wipe
- tick ‘system’
- select: Repair or Change file System
It summarises the filesystem, and shows it as squashfs (as indicated in the output above) and size: 0
So, I selected ‘change filesystem’ and selected EXT4. No need to flip to FAT like in the video, as it’s not EXT4 already.
Yay. Flashing worked!
But, it doesn’t boot.
I tried this a second time, after following the instructions very carefully – all the things that needed wiping, got wiped. The only thing I didn’t do either time was sideload the files, as I couldn’t get it to work – I installed them the conventional way having popped them onto an SD card. Having looked into what sideloading does, I don’t see it making any difference.
At this time, I would guess that the phone is ‘hard coded’ to expect a squashfs ‘system’ partition, and ext4 won’t do.
What would I do differently next time?
I’d back up that partition using ‘dd’ – assuming it’s installed, using the removable SD card as a target.
I’d be able to recover the entire ‘system’ device – filesystem and all – that way.
Hopefully, combined with a backup of the bits that were readable .. who knows.
Another Lineage build.
I tried applying lineage-15.1-20190206-nightly-crackling-signed.zip over the top of the January image.
That wouldn’t boot either.
I couldn’t find a backup of the Android build that Wileyfox pushed out. Or, it didn’t look trustworthy.
I did find an original Cyanogen 13.1.5 image.
That worked – it booted. Subsequent checking confirmed that the system filesystem is still ext4, so it’s not that.
I then reapplied the February build, and that at least attempts to boot – though it doesn’t complete successfully. At some point it gives up and reboots to recovery.
In my hunt for builds, I downloaded a Crackling build of Android Go. The Cyanogen 13 bootloader copes which this as well, and it boots.
- It’s very cut back. Interesting.
- I can’t seem to select a WIFI network, and so I can’t install anything. Settings seems to come from what appears to be a google search bar, but it crashes.
- There’s no settings facility, so no developer mode .. it’s a relief that TWRP is still there.