My FP3 is on /e/OS 1.8. For some reason magisk ceased to work. I patched the respective boot.img and flashed it, using TWRP, and the FP3 was rooted again. When it short after that unrooted again, I flashed the patched boot.img again, but to no avail, and worse, ending up in a bootloop.
I am able to decrypt the device, allowing me to save previously unsaved files to the extSDcard. But every time I boot the device into TWRP using fastboot, TWRP displays the error message “Failed to mount ‘/product’ (invalid argument)”.
I have tried to flash the patched boot.img and the unpatched one, both using TWRP and fastboot, but to no avail, leaving the device in a bootloop.
Is there anything else I can do before I restore a TWRP backup or even reinstall everything?
when mount outputs ‘invalid argument’ it’s mostly due to the filesystem or the filesystems specific mount options. Is there anything magisk alters on the product partition? I don’t know if the error message is relevant for the bootloop. If you have a product.img around from stockrom, you can flash that to the partition just to be sure it’s vanilla
I am having a hard time understanding your comment. What I understand is:
I don’t find any product.img in /e/ custom roms. Hence there isn’t any product.img installed and I wonder why TWRP asks for it
Yes, I have found a “product.img” in FPOS 10/Q.
No, I havn’t found any “product.img” in FPOS11/R: it has “super_product.img”
I am actually clueless as to how to go about to flash that product.img (FPOS 10) to the actual /e/OS11 without messing everything up:
Using fastboot? (How should be the commands?)
Using TWRP?
I’d really appreciate any hint that would save me installing everything from scratch.
as said, maybe twrps message is not the sole issue.
Usually the shell script that Fairphones stockrom images includes explains what has to go where. I’d only flash the partition that fits your Major /e/ version and ignore the partitions that /e/ images itself provides (bar boot partition for your custom kernel).
Are you sure what state is on each partition A/B slot? as in: maybe you’re on the slot that has inconsistencies.
Sorry for my ideas not being a guide, it’s only ideas, I haven’t been in your situation exactly.
Do you think it’s worth trying to flash “product.img” (extracted from FPOS) only into the existing /e/OS10?
there have to be inconstencies on both slots, as bootloops occur on both slots. I’ve switched the slots multiple times.
Provided that flashing product.img doesn’t do the trick, what would be the necessary steps to restore an image of the same phone, but with /e/OS10/Q? Now the phone is on /e/OS11/R.
Would I need to erase everything and install FPOS 10, wipe everything again, install /e/OS10 and then restore the TWRP image? I believe the tricky thing is to set the partitions right.
Or can I directly proceed to restoring the TWRP image?
at that point I’d have already nuked the userdata and started up fresh, redoing the whole twrp partition image experiment.
what would be the necessary steps to restore an image of the same phone
I think just flashing /e/OS on one slot in any version should be enough to get things working again. You can leave userdata untouched (edit the shell script), but use the official boot.img to at least get it booting, then do the magisk edit?
sorry, I didn’t address your 2nd action point: yes, try your twrp partition images. If you never restored from them it’s a good test anyway.
My thought was: userdata is the only partition that matters (beyond the ones holding imsi/imei etc) - you can install /e/ of the version you had when things failed to one slot, but not format userdata. Holding off on magisk to check if this boots - I think this should work.
I’d probably do this first before the twrp restore.
Abort the script (and wait for a key to be pressed).
abort_now() {
echo “”
read -rp “ERROR: Aborting now (press Enter to terminate).” a
exit 1
}
Check for connected phone
find_device() {
echo “INFO: Looking for connected device(s)…”
DEVICE_FOUND=“false”
while [ ${DEVICE_FOUND} = “false” ]
do
serial_numbers=
for sn in $(${FASTBOOT_BIN} devices | grep fastboot | grep -oE '^[[:alnum:]]+')
do
# Checking the product ID
PRODUCT_STRING=$(${FASTBOOT_BIN} -s "${sn}" getvar product 2>&1)
# Add serial, if product matches
if [[ ${PRODUCT_STRING} == *"${PRODUCT_ID}"* ]] || [[ ${PRODUCT_STRING} == *"${PRODUCT_ID_OLD}"* ]]
then
serial_numbers="${serial_numbers} $sn"
fi
done
case $(echo "${serial_numbers}" | wc -w | grep -oE '[0-9]+') in
0)
echo ""
echo "WARNING: No ${PRODUCT} found in fastboot mode."
echo "WARNING: Make sure that a ${PRODUCT} is connected."
;;
1)
echo "INFO: One ${PRODUCT} in fastboot mode found (serial number: ${sn})."
DEVICE_FOUND="true"
break
;;
*)
echo ""
echo "WARNING: Several ${PRODUCT}'s in fastboot mode connected."
echo "WARNING: Please connect only one ${PRODUCT}."
;;
esac
echo ""
while true
do
read -rp "Do you want to look for a ${PRODUCT} again? [(Y)es/(n)o]: " a
if [ -z "${a}" ] || [ "${a}" = 'y' ] || [ "${a}" = 'Y' ]
then
break
elif [ "${a}" = 'n' ] || [ "${a}" = 'N' ]
then
exit 0
fi
done
echo “INFO: Locking bootloader”
“${FASTBOOT_BIN}” -s “${sn}” oem lock
echo
echo “****** READ CAREFULLY ******”
echo “”
echo “INFO: The device is waiting for you to lock the bootloader.”
echo " You can do so on the device itself. Use the volume buttons"
echo " to choose the correct option, then the power button to select."
echo " The device will then reboot."
read -rp " Press any key to close this script." a
exit 0
if [ “${retval}” -ne 0 ]
then
echo “”
echo “ERROR: Could not flash the ${2} partition on device ${1}.”
echo “”
echo “ERROR: Please unplug the phone, take the battery out, boot the device into”
echo “ERROR: fastboot mode, and start this script again.”
echo “ERROR: (To get to fastboot mode, press Volume-Down and plug in the USB-C)”
echo “ERROR: (cable until the fastboot menu appears.)”
abort_now
fi
}
Flash an image to both A and B slot of partition. Abort on failure.
os_checks() {
case “$(uname -s 2> /dev/null)” in
Linux|GNU/Linux)
echo “INFO: You are using a Linux distribution.”
FASTBOOT_BIN=“${ROOT_DIR}/bin-linux-x86/fastboot”
;;
msys|MINGW*)
echo “INFO: You are using MinGW on Windows”
FASTBOOT_BIN=“${ROOT_DIR}/bin-msys/fastboot.exe”
;;
*)
echo “ERROR: Unsupported operating system (${OSTYPE}).”
echo “ERROR: Only GNU/Linux, and MinGW on Windows are currently supported.”
abort_now
;;
esac
}
echo “”
echo “*** ${PRODUCT} flashing script ***”
echo “”
echo “INFO: The procedure will start soon. Please wait…”
echo “Note that this will detect and flash only on FP3 or FP3+ devices.”
sleep 2
Begin with some OS checks and variable definition
os_checks
Call function to look for device(s)
If only one device is found $sn will store its serial number
(triple backticks for code formatting - but anyway)
just ctrl+f for “userdata”, outcomment/delete that line, and within the function “flash_image_ab_or_abort()” (search for parantheses) delete one of the lines - let’s say the last, then it will flash _a
To make sure that I have understood you:
in order to restrict flashing “boot.img” to the boot partition on slot “B”, the line in the script would change from:
flash_image_ab_or_abort “${sn}” boot “${IMAGES_DIR}/boot.img” to
flash_image_b_or_abort “${sn}” boot “${IMAGES_DIR}/boot.img”,
no, you need to keep the function name to have a valid reference to the function - and edit the inside of the function itself where it is defined - not where it is called:
flash_image_ab_or_abort() {
flash_image_or_abort “${1}” “${2}_a” “${3}”
flash_image_or_abort “${1}” “${2}_b” “${3}” # remove or outcomment this line -> no flash to slot_b will occur
}
In order to keep the userdata, is it accurate to just outcomment the following line? flash_image_or_abort "${sn}" userdata "${IMAGES_DIR}/userdata.img"
leaving it like this: # flash_image_or_abort "${sn}" userdata "${IMAGES_DIR}/userdata.img"
Thank you. I’ve run the install script for /e/1.4 as discussed:
I ran it with the restriction to slot B and leave userdata alone - consequence: total bust - /e/ recovery appeared with 2 options only: “Try again” and “Factory data reset”
I ran it leaving userdata alone - /e/ recovery appeared with 2 options only: “Try again” and “Factory data reset”
Boot with TWRP works, though.
I wonder whether there is any means to keep the userdata.
At least there is now nothing left in “/storage” (viewed with the TWRP file manager); /data/data is encrypted.
I guess that, having come from /e/1.8, I need to scour clean the partitions or just the data partition, in order to run the install script for /e/1.4 and have a clean install of 1.4? As mentioned, my goal is to restore a TWRP image made of 1.4.