Minionguyjpro / android_device_Blackview_Tab11WiFi_NEU

0 stars 0 forks source link

Help with device tree #1

Open Minionguyjpro opened 3 months ago

Minionguyjpro commented 3 months ago

Hello @lopestom, Like I said this is another device tree. I feel like it's more complete and better organized than the other device tree was (although I'm very sure that changes can and may need to be made to it). I've seen some of your self made guides about creating a device tree for MediaTek devices and this device tree is for a tablet that has one.

Minionguyjpro commented 3 months ago

I will make some more changes according to your guide.

lopestom commented 3 months ago

Hello @lopestom, Like I said this is another device tree. I feel like it's more complete and better organized than the other device tree was (although I'm very sure that changes can and may need to be made to it). I've seen some of your self made guides about creating a device tree for MediaTek devices and this device tree is for a tablet that has one.

I have DT for MT8788 android_device_blackview_Tab_10_Pro. But that not all tested by users. The only warn is about recovery.img into \vendor\etc that need remove to have TWRP permanently. All is help to iamsj7 in the android_device_blackview_tab10pro_twrp.

Other device with same situation: twrp_device_oukitel_RT2 https://4pda.to/forum/dl/post/28464406/ksnip_20230623-104431.png

https://4pda.to/forum/index.php?showtopic=1054913&view=findpost&p=123493866

Minionguyjpro commented 3 months ago

Hello @lopestom, Like I said this is another device tree. I feel like it's more complete and better organized than the other device tree was (although I'm very sure that changes can and may need to be made to it). I've seen some of your self made guides about creating a device tree for MediaTek devices and this device tree is for a tablet that has one.

I have DT for MT8788 android_device_blackview_Tab_10_Pro. But that not all tested by users. The only warn is about recovery.img into \vendor\etc that need remove to have TWRP permanently. All is help to iamsj7 in the android_device_blackview_tab10pro_twrp.

Other device with same situation: twrp_device_oukitel_RT2 https://4pda.to/forum/dl/post/28464406/ksnip_20230623-104431.png

https://4pda.to/forum/index.php?showtopic=1054913&view=findpost&p=123493866

This one's a bit confusing. The SoC of the device is the MT8138 but in the dumped images and files most references are to the MT6771 and MT8788 (there is also one reference to the MT8138 in one of the prop files), but I assume they are cross compatible (both fstabs of the MT6771 and MT8788 are the exact same, I even confirmed with hashes) and since they all share the same CPU, the Cortex-A53.

EDIT: I have looked in the extracted vendor image although I haven't seen the recovery.img file in the etc folder there yet.

Minionguyjpro commented 3 months ago

@lopestom I've just made a lot of changes to the recovery's ramdisk root structure. I also have added the device.mk file and stuff like that, and changed the repository names and .mk configs accordingly. Some files which you had in the recovery's root were files that I weren't able to find. I left those, but added the same binaries and libraries as yours where possible (same SoC, so I assume the same things apply) and I made some changes, that are the case for my device. Such as, you refer in a guide to the ueventd.mxxx.rc (at recovery/root/vendor), but there's another, regular ueventd.rc (at recovery/root). For me are both called ueventd.rc, but I looked in the files and I were able to see that one of the rc files referenced to the other uevent.d file in the vendor ramdisk directory. This way I have found out some things. I'll try compiling it again soon.

lopestom commented 3 months ago

@lopestom I've just made a lot of changes to the recovery's ramdisk root structure. I also have added the device.mk file and stuff like that, and changed the repository names and .mk configs accordingly. Some files which you had in the recovery's root were files that I weren't able to find. I left those, but added the same binaries and libraries as yours where possible (same SoC, so I assume the same things apply) and I made some changes, that are the case for my device. Such as, you refer in a guide to the ueventd.mxxx.rc (at recovery/root/vendor), but there's another, regular ueventd.rc (at recovery/root). For me are both called ueventd.rc, but I looked in the files and I were able to see that one of the rc files referenced to the other uevent.d file in the vendor ramdisk directory. This way I have found out some things. I'll try compiling it again soon.

Some files like ueventd.rc is changed to ueventd.mtxxxx.rc so mtxxxx="your soc from ramdisk\init.recovery.mtxxxx.rc" from the stock recovery.img or boot.img file. Look, the ueventd.rc Soc from vendor.img \vendor* and not from \system\ or from recovery.img or boot.img file so more carreful. Never copy directly by other device any file so get from files by firmware!!

I haven't time this week to see or help just now. But after that I can look something. The important is looking vendor.img in the \vendor\etc\ if has recovery.img and DT compiling img file correctly!

lopestom commented 3 months ago

Hello @lopestom, Like I said this is another device tree. I feel like it's more complete and better organized than the other device tree was (although I'm very sure that changes can and may need to be made to it). I've seen some of your self made guides about creating a device tree for MediaTek devices and this device tree is for a tablet that has one.

I have DT for MT8788 android_device_blackview_Tab_10_Pro. But that not all tested by users. The only warn is about recovery.img into \vendor\etc that need remove to have TWRP permanently. All is help to iamsj7 in the android_device_blackview_tab10pro_twrp. Other device with same situation: twrp_device_oukitel_RT2 https://4pda.to/forum/dl/post/28464406/ksnip_20230623-104431.png https://4pda.to/forum/index.php?showtopic=1054913&view=findpost&p=123493866

This one's a bit confusing. The SoC of the device is the MT8138 but in the dumped images and files most references are to the MT6771 and MT8788 (there is also one reference to the MT8138 in one of the prop files), but I assume they are cross compatible (both fstabs of the MT6771 and MT8788 are the exact same, I even confirmed with hashes) and since they all share the same CPU, the Cortex-A53.

EDIT: I have looked in the extracted vendor image although I haven't seen the recovery.img file in the etc folder there yet.

Okay so that's good!

Minionguyjpro commented 3 months ago

Thanks! I'll try GitHub Actions again since my own container completely slows down when building and kills the building process eventually.

@lopestom I've just made a lot of changes to the recovery's ramdisk root structure. I also have added the device.mk file and stuff like that, and changed the repository names and .mk configs accordingly. Some files which you had in the recovery's root were files that I weren't able to find. I left those, but added the same binaries and libraries as yours where possible (same SoC, so I assume the same things apply) and I made some changes, that are the case for my device. Such as, you refer in a guide to the ueventd.mxxx.rc (at recovery/root/vendor), but there's another, regular ueventd.rc (at recovery/root). For me are both called ueventd.rc, but I looked in the files and I were able to see that one of the rc files referenced to the other uevent.d file in the vendor ramdisk directory. This way I have found out some things. I'll try compiling it again soon.

Some files like ueventd.rc is changed to ueventd.mtxxxx.rc so mtxxxx="your soc from ramdisk\init.recovery.mtxxxx.rc" from the stock recovery.img or boot.img file. Look, the ueventd.rc Soc from vendor.img \vendor* and not from \system\ or from recovery.img or boot.img file so more carreful. Never copy directly by other device any file so get from files by firmware!!

I haven't time this week to see or help just now. But after that I can look something. The important is looking vendor.img in the \vendor\etc\ if has recovery.img and DT compiling img file correctly!

I've put the init files as you said. The thing is, there are init.recovery.mtxxxx.rc files but for the ueventd image I only have a generic ueventd.rc file, so I guess I can just put that one (as stock also does it that way, looking at the ramdisk from it).

EDIT: I have also found the microtrust.rc file. Should I rename it to init.microtrust.rc or keep it as it would also be called on the stock recovery's ramdisk?

EDIT 2: I feel like I may not even need to add the init.usb.rc file, since the regular init rc files already include some sort of USB activation step. For the microtrust.rc, I'll leave it named like that for now.

lopestom commented 3 months ago

I've put the init files as you said. The thing is, there are init.recovery.mtxxxx.rc files but for the ueventd image I only have a generic ueventd.rc file, so I guess I can just put that one (as stock also does it that way, looking at the ramdisk from it).

Maybe you not undertood correctly. Yeah! in the vendor.img\vendor\etc or \vendor\ can have ueventd.rc so that's file is from vendor. You can copy directly to same folder in the DT or in the recovery/root/ renaming ueventd.rc to ueventd.mtxxxx.rc. Your choice!

EDIT: I have also found the microtrust.rc file. Should I rename it to init.microtrust.rc or keep it as it would also be called on the stock recovery's ramdisk? EDIT 2: I feel like I may not even need to add the init.usb.rc file, since the regular init rc files already include some sort of USB activation step. For the microtrust.rc, I'll leave it named like that for now.

If you symlinking that filename in the init.recovery.mtxxxx.rc so NP. The way is symlinking files so if you have filter.mt8788.rc and need that in the nit.recovery.mtxxxx.rc so put in that import /filter.mt8788.rc.

init.usb.rc -> that's depending of TWRP version and Soc. Like we know about MT8788 so maybe using any file from DT MT6771 is good or not. Maybe using other usb file from A12 DT so need tests.

Minionguyjpro commented 3 months ago

I've put the init files as you said. The thing is, there are init.recovery.mtxxxx.rc files but for the ueventd image I only have a generic ueventd.rc file, so I guess I can just put that one (as stock also does it that way, looking at the ramdisk from it).

Maybe you not undertood correctly. Yeah! in the vendor.img\vendor\etc or \vendor\ can have ueventd.rc so that's file is from vendor. You can copy directly to same folder in the DT or in the recovery/root/ renaming ueventd.rc to ueventd.mtxxxx.rc. Your choice!

EDIT: I have also found the microtrust.rc file. Should I rename it to init.microtrust.rc or keep it as it would also be called on the stock recovery's ramdisk? EDIT 2: I feel like I may not even need to add the init.usb.rc file, since the regular init rc files already include some sort of USB activation step. For the microtrust.rc, I'll leave it named like that for now.

If you symlinking that filename in the init.recovery.mtxxxx.rc so NP. The way is symlinking files so if you have filter.mt8788.rc and need that in the nit.recovery.mtxxxx.rc so put in that import /filter.mt8788.rc.

init.usb.rc -> that's depending of TWRP version and Soc. Like we know about MT8788 so maybe using any file from DT MT6771 is good or not. Maybe using other usb file from A12 DT so need tests.

I see. I'll try to make some more changes. However, I tried compiling this twice already and got this error:

FAILED: out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp
/bin/bash -c "(mkdir -p out/target/product/Tab11WiFi_NEU/recovery ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/sdcard out/target/product/Tab11WiFi_NEU/recovery/root/tmp ) && (rsync -a --exclude=sdcard --exclude=/root/sepolicy --exclude=/root/plat_file_contexts --exclude=/root/plat_property_contexts --exclude=/root/system_ext_file_contexts --exclude=/root/system_ext_property_contexts --exclude=/root/vendor_file_contexts --exclude=/root/vendor_property_contexts --exclude=/root/odm_file_contexts --exclude=/root/odm_property_contexts --exclude=/root/product_file_contexts --exclude=/root/product_property_contexts --exclude=cache out/target/product/Tab11WiFi_NEU/root out/target/product/Tab11WiFi_NEU/recovery ) && (ln -sf /system/bin/init out/target/product/Tab11WiFi_NEU/recovery/root/init ) && (find out/target/product/Tab11WiFi_NEU/recovery/root -maxdepth 1 -name 'init*.rc' -type f -not -name \"init.recovery.*.rc\" | xargs rm -f ) && (cp out/target/product/Tab11WiFi_NEU/root/init.recovery.*.rc out/target/product/Tab11WiFi_NEU/recovery/root/ 2> /dev/null || true ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (rm -rf out/target/product/Tab11WiFi_NEU/recovery/root/res/* ) && (cp -rf bootable/recovery/res-mdpi/* out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (true ) && (cp -f bootable/recovery/fonts/12x22.png out/target/product/Tab11WiFi_NEU/recovery/root/res/images/font.png ) && (cp -rf device/Blackview/Tab11WiFi_NEU/recovery/root out/target/product/Tab11WiFi_NEU/recovery/ ) && (ln -sf prop.default out/target/product/Tab11WiFi_NEU/recovery/root/default.prop ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && touch ramdisk-files.txt && touch ramdisk-files.sha256sum && find . | sed \"s/.\\///\" | sed \"/lib\\/modules\\//d\" > ramdisk-files.txt ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && find -type f | sed \"s/.\\/ramdisk-files.sha256sum//\" | sed \"/lib\\/modules/d\" | sed \"/prop.default/d\" | xargs sha256sum > ramdisk-files.sha256sum ) && (touch out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp )"
cannot delete non-empty directory: root/vendor
could not make way for new symlink: root/vendor
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1205) [sender=3.1.3]
ninja: build stopped: subcommand failed.
22:10:51 ninja failed with: exit status 1

Any ideas?

EDIT: seems like permissions with rsync are not well, not sure what to do about that here yet.

EDIT 2: seems like it has something with the /recovery/root/vendor folder, although not sure.

EDIT 3: I have actually no idea...

Minionguyjpro commented 3 months ago

Got it past (I guess) but now I get an error that the boot image is too big...

lopestom commented 3 months ago

I see. I'll try to make some more changes. However, I tried compiling this twice already and got this error:

FAILED: out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp
/bin/bash -c "(mkdir -p out/target/product/Tab11WiFi_NEU/recovery ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/sdcard out/target/product/Tab11WiFi_NEU/recovery/root/tmp ) && (rsync -a --exclude=sdcard --exclude=/root/sepolicy --exclude=/root/plat_file_contexts --exclude=/root/plat_property_contexts --exclude=/root/system_ext_file_contexts --exclude=/root/system_ext_property_contexts --exclude=/root/vendor_file_contexts --exclude=/root/vendor_property_contexts --exclude=/root/odm_file_contexts --exclude=/root/odm_property_contexts --exclude=/root/product_file_contexts --exclude=/root/product_property_contexts --exclude=cache out/target/product/Tab11WiFi_NEU/root out/target/product/Tab11WiFi_NEU/recovery ) && (ln -sf /system/bin/init out/target/product/Tab11WiFi_NEU/recovery/root/init ) && (find out/target/product/Tab11WiFi_NEU/recovery/root -maxdepth 1 -name 'init*.rc' -type f -not -name \"init.recovery.*.rc\" | xargs rm -f ) && (cp out/target/product/Tab11WiFi_NEU/root/init.recovery.*.rc out/target/product/Tab11WiFi_NEU/recovery/root/ 2> /dev/null || true ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (rm -rf out/target/product/Tab11WiFi_NEU/recovery/root/res/* ) && (cp -rf bootable/recovery/res-mdpi/* out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (true ) && (cp -f bootable/recovery/fonts/12x22.png out/target/product/Tab11WiFi_NEU/recovery/root/res/images/font.png ) && (cp -rf device/Blackview/Tab11WiFi_NEU/recovery/root out/target/product/Tab11WiFi_NEU/recovery/ ) && (ln -sf prop.default out/target/product/Tab11WiFi_NEU/recovery/root/default.prop ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && touch ramdisk-files.txt && touch ramdisk-files.sha256sum && find . | sed \"s/.\\///\" | sed \"/lib\\/modules\\//d\" > ramdisk-files.txt ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && find -type f | sed \"s/.\\/ramdisk-files.sha256sum//\" | sed \"/lib\\/modules/d\" | sed \"/prop.default/d\" | xargs sha256sum > ramdisk-files.sha256sum ) && (touch out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp )"
cannot delete non-empty directory: root/vendor
could not make way for new symlink: root/vendor
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1205) [sender=3.1.3]
ninja: build stopped: subcommand failed.
22:10:51 ninja failed with: exit status 1

Any ideas?

EDIT: seems like permissions with rsync are not well, not sure what to do about that here yet.

EDIT 2: seems like it has something with the /recovery/root/vendor folder, although not sure.

EDIT 3: I have actually no idea...

could not make way for new symlink: root/vendor

Got it past (I guess) but now I get an error that the boot image is too big...

Yes! in the A12 so ramdisk_recovery with 32MB and twrp-12.1 v3.7.1_12 is not good so no decrypt mode enable.

With 40MB so is need disable some tools. Read TWRP370_12 - Power Armor 14 Pro

Minionguyjpro commented 2 months ago

I see. I'll try to make some more changes. However, I tried compiling this twice already and got this error:

FAILED: out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp
/bin/bash -c "(mkdir -p out/target/product/Tab11WiFi_NEU/recovery ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/sdcard out/target/product/Tab11WiFi_NEU/recovery/root/tmp ) && (rsync -a --exclude=sdcard --exclude=/root/sepolicy --exclude=/root/plat_file_contexts --exclude=/root/plat_property_contexts --exclude=/root/system_ext_file_contexts --exclude=/root/system_ext_property_contexts --exclude=/root/vendor_file_contexts --exclude=/root/vendor_property_contexts --exclude=/root/odm_file_contexts --exclude=/root/odm_property_contexts --exclude=/root/product_file_contexts --exclude=/root/product_property_contexts --exclude=cache out/target/product/Tab11WiFi_NEU/root out/target/product/Tab11WiFi_NEU/recovery ) && (ln -sf /system/bin/init out/target/product/Tab11WiFi_NEU/recovery/root/init ) && (find out/target/product/Tab11WiFi_NEU/recovery/root -maxdepth 1 -name 'init*.rc' -type f -not -name \"init.recovery.*.rc\" | xargs rm -f ) && (cp out/target/product/Tab11WiFi_NEU/root/init.recovery.*.rc out/target/product/Tab11WiFi_NEU/recovery/root/ 2> /dev/null || true ) && (mkdir -p out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (rm -rf out/target/product/Tab11WiFi_NEU/recovery/root/res/* ) && (cp -rf bootable/recovery/res-mdpi/* out/target/product/Tab11WiFi_NEU/recovery/root/res ) && (true ) && (cp -f bootable/recovery/fonts/12x22.png out/target/product/Tab11WiFi_NEU/recovery/root/res/images/font.png ) && (cp -rf device/Blackview/Tab11WiFi_NEU/recovery/root out/target/product/Tab11WiFi_NEU/recovery/ ) && (ln -sf prop.default out/target/product/Tab11WiFi_NEU/recovery/root/default.prop ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && touch ramdisk-files.txt && touch ramdisk-files.sha256sum && find . | sed \"s/.\\///\" | sed \"/lib\\/modules\\//d\" > ramdisk-files.txt ) && (cd out/target/product/Tab11WiFi_NEU/recovery/root && find -type f | sed \"s/.\\/ramdisk-files.sha256sum//\" | sed \"/lib\\/modules/d\" | sed \"/prop.default/d\" | xargs sha256sum > ramdisk-files.sha256sum ) && (touch out/target/product/Tab11WiFi_NEU/obj/PACKAGING/recovery_intermediates/ramdisk_files-timestamp )"
cannot delete non-empty directory: root/vendor
could not make way for new symlink: root/vendor
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1205) [sender=3.1.3]
ninja: build stopped: subcommand failed.
22:10:51 ninja failed with: exit status 1

Any ideas? EDIT: seems like permissions with rsync are not well, not sure what to do about that here yet. EDIT 2: seems like it has something with the /recovery/root/vendor folder, although not sure. EDIT 3: I have actually no idea...

could not make way for new symlink: root/vendor

Got it past (I guess) but now I get an error that the boot image is too big...

Yes! in the A12 so ramdisk_recovery with 32MB and twrp-12.1 v3.7.1_12 is not good so no decrypt mode enable.

With 40MB so is need disable some tools. Read TWRP370_12 - Power Armor 14 Pro

I did those, but it's still 7MB too big (pretty big kernel is included, 22MB). I however added the ones above the once you referenced and will see... And I have no kernel sources, the company doesn't seem to like to provide them...

EDIT: yup, still too big: error: +out/target/product/Tab11WiFi_NEU/boot.img too large (47654912 > 40890368)

lopestom commented 2 months ago

I did those, but it's still 7MB too big (pretty big kernel is included, 22MB). I however added the ones above the once you referenced and will see... And I have no kernel sources, the company doesn't seem to like to provide them...

EDIT: yup, still too big: error: +out/target/product/Tab11WiFi_NEU/boot.img too large (47654912 > 40890368)

Time to look your DT and know about files.

UPD: Okay. Some questions and request: 1- Your device already has microtust and files is from original firmware?; 2- Somethings need change to A12; 3- Maybe need more files from \vendor\lib64\hw You not read my guide?? 3.3 Beanpod (microtrust)

4- hmmmmmmm no good kernel with 23MB!! As I wrote in https://github.com/Minionguyjpro/android_device_Blackview_Tab11WiFi_NEU/issues/1#issuecomment-2264434392, with v3.7.1_12 has more problems.

Now read slowly https://github.com/1ndev-ui/TWRP_CG65_device_tree/issues/6#issuecomment-2112984957

5- I not see TWEXCLUDES flags to attempt reduce img file as:

https://github.com/lopestom/twrp_device_ulefone_Power_Armor14_Pro/blob/ea438d326e1db6cb2f1e306e444a7ded29b0e6a3/BoardConfig.mk#L226-L233

# Attempt to reducing size img file compiled
# Exclude mode specific build flags
TW_EXCLUDE_PYTHON := true
TW_EXCLUDE_NANO := true
TW_EXCLUDE_TZDATA := true
TW_EXCLUDE_BASH := true
TW_EXCLUDE_LPTOOLS := true
TW_EXCLUDE_LPDUMP := true
lopestom commented 2 months ago

https://github.com/Minionguyjpro/android_device_Blackview_Tab11WiFi_NEU/blob/0d916a33e971c0949c25b5b27c32fe94977ae986/device.mk#L42-L46