I suggest a new icon for dual boot companion app, it looks better:
I suggest a new icon for dual boot companion app, it looks better:
Hi mate,I suggest a new icon for dual boot companion app, it looks better:
Great, then the letters should be green or red to match the main application icon, I also suggest adding an additional menu: Reboot and Reboot bootloaderThe Idea is to higlight the A or B letter of DUALBOOT word to identify the active slot
If training suggestions, an option to get links in the power menu of Android 11 would be awesome. (I had this set up with tasker)
haha that got me lol. wiped beta2 right out. I had a twrp backup so no losses. Oxy10.3.8 is out and I'm making fastboots of them all. but they have the messedup versioin so I really did loose half my work I guess. Ohh well ****t happens Actually think I can just add modded boots to the modded fastboot OTAs
What partitions exactally dose this recovery edit for fstabs. I want a fastboot flasher to unbrick quickly with no real lost of data.
It b4icked me yesterday i installed oxy10 right on top on beta 2. And bricked. So theis should downgrade easy and upgrade to. I got an easy way to make them. The stock copies flast with the allinonetools err what ever program to. And you can opt out of wiping the data by the program. One you get the bootswitcher down maybe make it a independent installer. I like that it doesn't pute boot.ctl in system/bin like the one I swiped and had to manually install in twrp. Heres what ive been working with lol. Hey some times in twrp thiers a /system/system and others its just /system in root while in orangefox. Hows that happen. Slot a and slot b stuff. Hey have a good day I gotta work.
# Patch vendor fstabs
ui_print " Patching vendor fstabs"
FSTABS="$(find /system_root /vendor/etc /odm/etc -maxdepth 1 -type f -name "fstab.qcom" | sed 's|^./|/|')"
[ "$FSTABS" ] && patch_fstabs
(...)
patch_fstabs() {
ui_print " Patching fstabs:"
echo -e "$(date +"%Y-%m-%d %H:%M:%S.%3N") - Patching fstabs" >> $LOGFILE 2>&1
for i in $FSTABS; do
[ -f $i ] || continue
ui_print " $i"
local perm="$(ls -Z $i | awk '{print $1}')"
sed -ri "
s/,verifyatboot|verifyatboot,|verifyatboot\b//g
s/,verify|verify,|verify\b//g
s/,avb_keys|avb_keys,|avb_keys\b//g
s/,avb|avb,|avb\b//g
s/,support_scfs|support_scfs,|support_scfs\b//g
s/,fsverity|fsverity,|fsverity\b//g
" "$i"
ui_print " - KeepEnforceEncrypt: $KEEPFORCEENCRYPT"
$KEEPFORCEENCRYPT || sed -i "s/fileencryption=/=/g" $i
sed -i "/data2/d" $i
sed -ri "/name\/userdata |name\/metadata / s/wait,slotselect/wait/" $i
local fst = "$(ls -laZ $i | awk '{print $1}')"
#ui_print " - Change fstab context $perm"
chcon $perm $i
#echo -e "$(date +"%Y-%m-%d %H:%M:%S.%3N") - Context changed" >> $LOGFILE 2>&1
while true; do
echo -e "$(date +"%Y-%m-%d %H:%M:%S.%3N") - * $(tail -n1 $i) *" >> $LOGFILE 2>&1
[ "$(tail -n1 $i)" ] && { echo >> $i; break; } || sed -i '$d' $i
done
ui_print " - Checking Layout: $layout"
[ "$layout" == "stock" ] || sed -ri "/name\/userdata |name\/metadata / s/wait,/wait,slotselect,/" $i
done
ui_print " $i - Done"
}
Is there any way to install this if I'm already on Beta 2 rooted, without wiping data?
I checked it, everything works, thanks.
Good point
Android 10 works
Android 10 works
Android 11 Error: Unable to open the file/folder System_B
OnePlus7Pro:/ $ su
OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/
total 8
drwxrwx--- 2 root everybody u:object_r:fuse:s0 4096 2021-03-06 14:57 SDcard_b
drwxr-xr-x 24 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 System_b
OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/System_b
ls: /sdcard/DualBoot/System_b: Permission denied
1|OnePlus7Pro:/ #
OnePlus7Pro:/ # setenforce 0
OnePlus7Pro:/ # getenforce
Permissive
OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/System_b
ls: /sdcard/DualBoot/System_b/product: Function not implemented
ls: /sdcard/DualBoot/System_b/d: Function not implemented
ls: /sdcard/DualBoot/System_b/bin: Function not implemented
ls: /sdcard/DualBoot/System_b/sdcard: Function not implemented
ls: /sdcard/DualBoot/System_b/charger: Function not implemented
ls: /sdcard/DualBoot/System_b/init: Function not implemented
ls: /sdcard/DualBoot/System_b/cache: Function not implemented
ls: /sdcard/DualBoot/System_b/etc: Function not implemented
ls: /sdcard/DualBoot/System_b/product_services: Function not implemented
ls: /sdcard/DualBoot/System_b/bugreports: Function not implemented
ls: /sdcard/DualBoot/System_b/default.prop: Function not implemented
ls: /sdcard/DualBoot/System_b/charger_log: Function not implemented
total 188
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 acct
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 apex
dr-xr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 config
drwxrwx--x 2 system system u:object_r:fuse:s0 4096 2009-01-01 02:00 data
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 debug_ramdisk
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 dev
-rwxr-x--- 1 root shell u:object_r:fuse:s0 2383 2009-01-01 02:00 init.environ.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 136 2009-01-01 02:00 init.oem_ftm.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 37596 2009-01-01 02:00 init.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 3171 2009-01-01 02:00 init.recovery.qcom.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 12922 2009-01-01 02:00 init.usb.configfs.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 6906 2009-01-01 02:00 init.usb.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 563 2009-01-01 02:00 init.zygote32.rc
-rwxr-x--- 1 root shell u:object_r:fuse:s0 981 2009-01-01 02:00 init.zygote64_32.rc
drwx------ 2 root root u:object_r:fuse:s0 16384 2009-01-01 02:00 lost+found
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 metadata
drwxr-xr-x 2 root system u:object_r:fuse:s0 4096 2009-01-01 02:00 mnt
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 odm
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 oem
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 oneplus
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 op1
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 op2
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 postinstall
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 proc
drwxr-xr-x 3 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 res
drwxr-x--- 2 root shell u:object_r:fuse:s0 4096 2009-01-01 02:00 sbin
drwxr-x--x 2 root sdcard_r u:object_r:fuse:s0 4096 2009-01-01 02:00 storage
drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 sys
drwxr-xr-x 18 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 system
-rw-r--r-- 1 root root u:object_r:fuse:s0 2608 2009-01-01 02:00 ueventd.rc
drwxr-xr-x 2 root shell u:object_r:fuse:s0 4096 2009-01-01 02:00 vendor
1|OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/
total 8
drwxrwx--- 2 root everybody u:object_r:fuse:s0 4096 2021-03-06 14:57 SDcard_b
drwxr-xr-x 24 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 System_b
OnePlus7Pro:/ #
Code:OnePlus7Pro:/ $ su OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/ total 8 drwxrwx--- 2 root everybody u:object_r:fuse:s0 4096 2021-03-06 14:57 SDcard_b drwxr-xr-x 24 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 System_b OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/System_b ls: /sdcard/DualBoot/System_b: Permission denied 1|OnePlus7Pro:/ #
Code:OnePlus7Pro:/ # setenforce 0 OnePlus7Pro:/ # getenforce Permissive OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/System_b ls: /sdcard/DualBoot/System_b/product: Function not implemented ls: /sdcard/DualBoot/System_b/d: Function not implemented ls: /sdcard/DualBoot/System_b/bin: Function not implemented ls: /sdcard/DualBoot/System_b/sdcard: Function not implemented ls: /sdcard/DualBoot/System_b/charger: Function not implemented ls: /sdcard/DualBoot/System_b/init: Function not implemented ls: /sdcard/DualBoot/System_b/cache: Function not implemented ls: /sdcard/DualBoot/System_b/etc: Function not implemented ls: /sdcard/DualBoot/System_b/product_services: Function not implemented ls: /sdcard/DualBoot/System_b/bugreports: Function not implemented ls: /sdcard/DualBoot/System_b/default.prop: Function not implemented ls: /sdcard/DualBoot/System_b/charger_log: Function not implemented total 188 drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 acct drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 apex dr-xr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 config drwxrwx--x 2 system system u:object_r:fuse:s0 4096 2009-01-01 02:00 data drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 debug_ramdisk drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 dev -rwxr-x--- 1 root shell u:object_r:fuse:s0 2383 2009-01-01 02:00 init.environ.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 136 2009-01-01 02:00 init.oem_ftm.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 37596 2009-01-01 02:00 init.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 3171 2009-01-01 02:00 init.recovery.qcom.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 12922 2009-01-01 02:00 init.usb.configfs.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 6906 2009-01-01 02:00 init.usb.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 563 2009-01-01 02:00 init.zygote32.rc -rwxr-x--- 1 root shell u:object_r:fuse:s0 981 2009-01-01 02:00 init.zygote64_32.rc drwx------ 2 root root u:object_r:fuse:s0 16384 2009-01-01 02:00 lost+found drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 metadata drwxr-xr-x 2 root system u:object_r:fuse:s0 4096 2009-01-01 02:00 mnt drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 odm drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 oem drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 oneplus drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 op1 drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 op2 drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 postinstall drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 proc drwxr-xr-x 3 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 res drwxr-x--- 2 root shell u:object_r:fuse:s0 4096 2009-01-01 02:00 sbin drwxr-x--x 2 root sdcard_r u:object_r:fuse:s0 4096 2009-01-01 02:00 storage drwxr-xr-x 2 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 sys drwxr-xr-x 18 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 system -rw-r--r-- 1 root root u:object_r:fuse:s0 2608 2009-01-01 02:00 ueventd.rc drwxr-xr-x 2 root shell u:object_r:fuse:s0 4096 2009-01-01 02:00 vendor 1|OnePlus7Pro:/ # ls -laZ /sdcard/DualBoot/ total 8 drwxrwx--- 2 root everybody u:object_r:fuse:s0 4096 2021-03-06 14:57 SDcard_b drwxr-xr-x 24 root root u:object_r:fuse:s0 4096 2009-01-01 02:00 System_b OnePlus7Pro:/ #
When switching Permissive everything works.
#include <std_disclaimer.h>
/*
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
- I am not responsible for anything bad that happens to your device. Only experienced users should be using this mod
- This is no walk in the park mod. Although I have extensively tested it, there is always the possibility of a brick with anything that involves repartitioning. Make sure you have a backup and know how to reparititon your phone back to stock (there's a guide at the end of this readme with the basics)
YOU'VE BEEN WARNED - Use at your own risk
mke2fs -t ext4 -b 4096 /dev/block/sda$metadata_partnum
Music
Pictures
ViPER4AndroidFX
- Usually this is because you switched roms without formatting data first. This should be flashing 101 but we all forget sometimes. Plus this slot stuff can get confusing
- If it only happens with a/b/c and not any other layout, there's a good chance it's selinux related. Try setting selinux to permissive at kernel level with this mod (source here).
How to Manually Repartition Back to Stock
- In the event any step in the repartioning fails, the entire installer aborts. The good news is that this prevents a potential brick. The bad is that you need to manually revert back
- Boot into twrp. If sgdisk is not present in sbin, grab it from this zip (in tools) and adb push it to /sbin and chmod +x it
- sgdisk /dev/block/sda --print Note that /dev/block/sda is the block that userdata and metadata are stored on - no other block is touched by this mod. This will show up the current partition scheme. Stock looks something like this (on OP7 Pro):
You may have different size userdata - mine is 256gb - depending on your device but that doesn't matter. You just need to see where they're locatedPHP:Number Start (sector) End (sector) Size Code Name 1 6 7 8.0 KiB FFFF ssd 2 8 8199 32.0 MiB FFFF persist 3 8200 8455 1024.0 KiB FFFF misc 4 8456 8711 1024.0 KiB FFFF param 5 8712 8839 512.0 KiB FFFF keystore 6 8840 8967 512.0 KiB FFFF frp 7 8968 74503 256.0 MiB FFFF op2 8 74504 77063 10.0 MiB FFFF oem_dycnvbk 9 77064 79623 10.0 MiB FFFF oem_stanvbk 10 79624 79879 1024.0 KiB FFFF mdm_oem_dycnvbk 11 79880 80135 1024.0 KiB FFFF mdm_oem_stanvbk 12 80136 80263 512.0 KiB FFFF config 13 80264 969095 3.4 GiB FFFF system_a 14 969096 1857927 3.4 GiB FFFF system_b 15 1857928 1883527 100.0 MiB FFFF odm_a 16 1883528 1909127 100.0 MiB FFFF odm_b 17 1909128 1913223 16.0 MiB FFFF metadata 18 1913224 1945991 128.0 MiB FFFF rawdump 19 1945992 61409274 226.8 GiB FFFF userdata
Take note of the number (I'll call userdata_num for the sake of this tutorial) and start sector (userdata_start) for the first partition AFTER rawdump, and the end sector (userdata_end) of the last parititon on sda
- sgdisk /dev/block/sda --change-name=17:metadata - renames metadata partition back to non-ab stock
- sgdisk /dev/block/sda --delete=19 - this deletes the entire partition - use this command for each user/metadata partition after rawdump (ones generated by this zip)
- sgdisk /dev/block/sda --new=$userdata_num:$userdata_start:$userdata_end --change-name=$userdata_num:userdata - this creates the new userdata partition
- Final step is to format the new userdata partition: mke2fs -t ext4 -b 4096 /dev/block/sda$userdata_num $userdata_size - where userdata_size can be calculated with this shell command: sgdisk /dev/block/sda --print | grep "^ *$userdata_num" | awk '{print $3-$2+1}'
- MAKE SURE YOU VERIFY ALL VARIABLES HERE ARE SET PROPERLY - if you mess this up, you could format all of sda resulting in a brick
- Run sgdisk /dev/block/sda --print again to make sure everything is correct and then reboot back into twrp
Changelog
21/03/2021 - V1.8
05/03/2021 - V1.6
- Updated companion app to 2.8.7
13/02/2021- V1.5
- Updated init.mount_datacommon.sh to support the application sharing
- Updated the dual boot companion app V2.6 BETA
- Added mounting inactive system to sdcard/DualBoot/
- Added mounting inactive SDcard to sdcard/DualBoot/
- EXPERIMENTAL - Added application sharing between ROMs (Only A/B/C Layout)
- Localizations update
- Minor bugfix here and there.
06/02/2021- V1.3
- Updated the dual boot companion app V1.7.2
- Updated Orangefox recovery to latest git
05/02/2021- V1.1
- Updated the dual boot companion app
- Fixed the Orangefox full screen bug on OP7 pro
20/01/2021- V1.0
- Added the dual boot companion app
- Fixed the OOS11 flashing bug
19/11/2020 - A11-0.4
- It works with OxygenOS 11 ( WARNING: --- Stay unencrypted! --)
- Magisk 21.4 updated
- New version of Orangefox recovery (R11) - 20-01-2021 update
- Know bug: Flashing from OOS11 slot can overwrite the same slot.
21/10/2020 - A11-0.4
- Fixed root install for Android 11
- Minor improvement
Android 11: please install Magisk 20422 and MagiskManager 297
- Root not installed if Android 11 - Please do it manually.
- CommonData mount fix in Android 11
- Minor improvement
16/10/2020 - A11-0.2
- Changed to OrangeFox Recovery
- Added check to get the right initrc (Android 11 compliant)
16/10/2020 - A11-0.1
- Initial release
Download
GitHub
Telegram support chat: https://t.me/OrangeFoxDualBootRebornOnePlus7
XDA:DevDB Information
Orangefox-DualBoot-Unified, Tool/Utility for the OnePlus 7
Contributors
invernomut0
if you like my work, send me a beer
![]()
Is it possible to get this recovery as an image file which can be used with 'fastboot boot recovery.img'?
The reason I am asking is because the official magisk doesn't work if a recovery is installed and I prefer to use the official magisk then a version of which the source is unknown and which does not get updated.
Also the provided magisk isn't stable on my rom while the official one is.
I now have oos with recovery on slot A with dualboot recovery and magisk and elemental x (a11) on slot B without dualboot recovery and official magisk.
I can boot to slot A if I need recovery, but if i need it on slot be is need to flash it first again (which deletes my original magisk installation) and after that flash back the magisk patched boot image and setup all my modules from scratch again (i'll try if i can backup and restore the data/adb folder).
And I will always need a10 on 1 slot for this to work.