mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Add no decompression flag to magiskboot split
This commit is contained in:
parent
7f6b5305ba
commit
991802ab82
@ -520,12 +520,12 @@ bool boot_img::verify(const char *cert) const {
|
|||||||
return rust::verify_boot_image(*this, cert);
|
return rust::verify_boot_image(*this, cert);
|
||||||
}
|
}
|
||||||
|
|
||||||
int split_image_dtb(const char *filename) {
|
int split_image_dtb(const char *filename, bool skip_decomp) {
|
||||||
mmap_data img(filename);
|
mmap_data img(filename);
|
||||||
|
|
||||||
if (int off = find_dtb_offset(img.buf(), img.sz()); off > 0) {
|
if (int off = find_dtb_offset(img.buf(), img.sz()); off > 0) {
|
||||||
format_t fmt = check_fmt_lg(img.buf(), img.sz());
|
format_t fmt = check_fmt_lg(img.buf(), img.sz());
|
||||||
if (COMPRESSED(fmt)) {
|
if (!skip_decomp && COMPRESSED(fmt)) {
|
||||||
int fd = creat(KERNEL_FILE, 0644);
|
int fd = creat(KERNEL_FILE, 0644);
|
||||||
decompress(fmt, fd, img.buf(), off);
|
decompress(fmt, fd, img.buf(), off);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
@ -18,7 +18,7 @@ int unpack(const char *image, bool skip_decomp = false, bool hdr = false);
|
|||||||
void repack(const char *src_img, const char *out_img, bool skip_comp = false);
|
void repack(const char *src_img, const char *out_img, bool skip_comp = false);
|
||||||
int verify(const char *image, const char *cert);
|
int verify(const char *image, const char *cert);
|
||||||
int sign(const char *image, const char *name, const char *cert, const char *key);
|
int sign(const char *image, const char *name, const char *cert, const char *key);
|
||||||
int split_image_dtb(const char *filename);
|
int split_image_dtb(const char *filename, bool skip_decomp = false);
|
||||||
int dtb_commands(int argc, char *argv[]);
|
int dtb_commands(int argc, char *argv[]);
|
||||||
|
|
||||||
static inline bool check_env(const char *name) {
|
static inline bool check_env(const char *name) {
|
||||||
|
@ -84,8 +84,10 @@ Supported actions:
|
|||||||
Do dtb related actions to <file>.
|
Do dtb related actions to <file>.
|
||||||
See "dtb --help" for supported actions.
|
See "dtb --help" for supported actions.
|
||||||
|
|
||||||
split <file>
|
split [-n] <file>
|
||||||
Split image.*-dtb into kernel + kernel_dtb
|
Split image.*-dtb into kernel + kernel_dtb.
|
||||||
|
If '-n' is provided, decompression operations will be skipped;
|
||||||
|
the kernel will remain untouched, split in its original format.
|
||||||
|
|
||||||
sha1 <file>
|
sha1 <file>
|
||||||
Print the SHA1 checksum for <file>
|
Print the SHA1 checksum for <file>
|
||||||
@ -150,7 +152,13 @@ int main(int argc, char *argv[]) {
|
|||||||
printf("%02x", i);
|
printf("%02x", i);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else if (argc > 2 && action == "split") {
|
} else if (argc > 2 && action == "split") {
|
||||||
|
if (argv[2] == "-n"sv) {
|
||||||
|
if (argc == 3)
|
||||||
|
usage(argv[0]);
|
||||||
|
return split_image_dtb(argv[3], true);
|
||||||
|
} else {
|
||||||
return split_image_dtb(argv[2]);
|
return split_image_dtb(argv[2]);
|
||||||
|
}
|
||||||
} else if (argc > 2 && action == "unpack") {
|
} else if (argc > 2 && action == "unpack") {
|
||||||
int idx = 2;
|
int idx = 2;
|
||||||
bool nodecomp = false;
|
bool nodecomp = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user