sorry
Announcement
Collapse
No announcement yet.
Announcement
Collapse
No announcement yet.
Android 9 partition repack tool!
Collapse
X
-
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.
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.
Comment
-
@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>
Comment
-
Hou to fix that?
img is https://drive.google.com/file/d/1F5Q...pEp80rdpR/view
android 9
sistem is ubuntu 18.04
ubuntu:~/afck$ sudo make mod-product
mkdir -p "bc-tool/stamp"
cd bc-tool/product && ./build
check source folder...
ok
product/lost+found is already removed!
previous build doesn't exist
dtb check ok!
calculate IMG size
Error at '/partitions/product': FDT_ERR_BADMAGIC
size: 0
building...
mkdir: cannot create directory ‘out’: File exists
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
Comment
-
Originally posted by klobes View Posthi the file are on link
https://filebin.net/pksw1st3wz13gm4r
Comment
-
Originally posted by klobes View Postwhen do mod-unpack after that not get DTB partitioon , and after make mod-product it generate by self.
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..
Comment
-
Link of the link is : https://drive.google.com/file/d/1F5Q...pEp80rdpR/view
The DTB is singel file and format is gz
in post is the link of img
The android is A95x_f3_air
procesor is s905x3
Ram 2gb
Rom 16Gb
Comment
-
I've been having an issue when I use make mod-system, this comes up:
mkdir -p "bc-tool/stamp"
cd bc-tool/system && ./build
check source folder...
ok
remove system/lost+found
previous build doesn't exist
multi-dtb detected...
92+0 records in
92+0 records out
188416 bytes (188 kB, 184 KiB) copied, 0.00121957 s, 154 MB/s
calculate IMG size
size: -524288
building...
create ext4 fs...
#################
dd: invalid number: ‘-524288’
check uuid hash
tune2fs: No such file or directory while trying to open out/system.PARTITION
Couldn't find valid filesystem superblock.
Filesystem UUID:
Directory Hash Seed:
set android_sparse flag...
##################
contrib/mke2fs: invalid option -- '5'
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
[-i bytes-per-inode] [-I inode-size] [-J journal-options]
[-G flex-group-size] [-N number-of-inodes] [-d root-directory]
[-m reserved-blocks-percentage] [-o creator-os]
[-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
[-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
[-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file]
[-jnqvDFSV] device [blocks-count]
generate fs_config
compile file_contexts.bin
create a sparse img...
##################
./build: line 109: 13724 Segmentation fault sudo contrib/e2fsdroid -T $TIME -C out/$FSC -B out/$PART.map -S out/$SLCB -f $PART -a / out/$OUT
make: *** [build/mod.mak:62: bc-tool/stamp/.stamp.mod-system] Error 1
I have no clue where it's getting this negative number as its image size. I'm using the stock GT King ROM:
I have no issues when I use make mod-vendor though.
Comment
-
SteampunkJedi
Install this update on the pre-installed bc-tool..
download:
update_part_size_fix.tar.xz
install update:
Code:tar xvJf update_part_size_fix.tar.xz -C ~/afck
Last edited by bumerc; 01-14-2021, 22:13.
Comment
-
bumerc
???????download:
update_part_size_fix.tar.xz
The link is not working, can you re-upload it? I have the same problem with the negative image file size.
Thank you
Comment
What's Going On
Collapse
There are currently 2206 users online. 12 members and 2194 guests.
Most users ever online was 16,134 at 08:28 on 08-11-2023.
Comment