If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I know some Linux but haven't done any mods before, so all the experts please bear with me. What I want to do is to modify the SLIMBOX firmware (https://forum.xda-developers.com/and...imbox-t4152049) and add a few apps of my own. I read README.md a few times (using Google Translate) and this is my understanding of what I need to do:
Place the firmware file as afck/ingredients/aml_upgrade_package.img.
Run 'make img-unpack' to extract the partition files.
Run 'make mod-unpack' to extract all files.
Add my apks to appropriate folders under system or vendor.
Run 'make mod-system' and/or 'make mod-vendor' to repack system and/or vendor partitions.
Run 'make ubt' to repack partitions into img.
For a test, I don't want to make any changes. I simply want to unpack and repack to see if the new img works properly. After running 'make img-unpack', I can see all the partition files created under afck/out/amlogic/device/1-2g/img-unpack, so so far so good. But after running 'make mod-unpack', I don't see the unpacked files. The last command 'rm -rf out/amlogic/device/1-2g/img-ubt/*' seemed to have deleted all the unpacked files under img-ubt. So I am now a bit lost on what to do next.
Using another tool, I was able to unpack the img into a file structure that includes system folder, vendor folder, file_contexts file, system_statfile.txt file, and vendor_statfile.txt file. If someone could point me in the right direction on how to repack the file structure back into an img file using the bc-tool, that would be great! Thank you all, and your help is much appreciated.
@Ic01
You are reading inattentively - step 2 is wrong and only applies to Android 8 project. Step 6 is wrong and only applies to Android 8 project. The img-ubt directory has nothing to do with the Android 9 project and is cleaned up after the image is extracted; all extracted partitions are located in bc-tool/<partition>
create ext4 fs...
#################
0+0 records in
0+0 records out
0 bytes copied, 0.000298639 s, 0.0 kB/s
mke2fs 1.43.3 (04-Sep-2016)
mke2fs: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
set android_sparse flag for e2fsdroid
#################
mke2fs 1.43.3 (04-Sep-2016)
mke2fs: invalid blocks '0' on device 'out/product.PARTITION'
compile file_contexts.bin
create a sparse img...
##################
./build: line 89: 8307 Segmentation fault sudo contrib/e2fsdroid -T $TIME -B out/$PART.map -S out/$SLCB -f $PART -a /$PART out/$OUT
build/mod.mak:61: recipe for target 'bc-tool/stamp/.stamp.mod-product' failed
make: *** [bc-tool/stamp/.stamp.mod-product] Error 1
when do mod-unpack after that not get DTB partitioon , and after make mod-product it generate by self.
1. After make mod-unpack the _aml_dtb.PARTITION is copied into the bc-tool directory as a DTB file (unchanged).
2. After make mod-<partition> the build script checks the DTB header and selects between 3 possible DTB variants - single-dtb, multi-dtb, single- or multi dtb gzipped.
In the case of a multi-dtb, the script cuts off the DTB header so that the information about the partition size can be extracted via ftdget.
The original/unchanged DTB file is saved during this process (regardless of the dtb variant) as a DT end file and is used as a template for fdtget.
Because of a faulty DTB file in your case, the fdtget outputs "FDT_ERR_BADMAGIC" because no valid dt_header_magic (0xedfe0dd0) was found.
Where did you download this Android ROM? Post the link..
klobes your dtb partition is encrypted, copy meson1.dtb (afck /out/amlogic/device/1-2g/img-unpack/meson1.dtb) to afck/bc-tool/ and rename this file to DTB, run make mod- <partition>. I will add support for this in the next update.
Comment