mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-15 18:02:20 +00:00
Precise free space calculation for magisk.img
1. Introduce new applet: imgtool for better separation from the main program 2. Actually mount the image and check statvfs for free space in the image This shall eliminate any possible module installation failure from image resizing issues.
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
|
||||
extern char *argv0; /* For changing process name */
|
||||
|
||||
#define applet ((char *[]) { "su", "resetprop", "magiskhide", NULL })
|
||||
#define applet ((char *[]) { "su", "resetprop", "magiskhide", "imgtool", NULL })
|
||||
#define init_applet ((char *[]) { "magiskpolicy", "supolicy", NULL })
|
||||
|
||||
extern int (*applet_main[]) (int, char *[]), (*init_applet_main[]) (int, char *[]);
|
||||
@@ -66,5 +66,6 @@ int magiskhide_main(int argc, char *argv[]);
|
||||
int magiskpolicy_main(int argc, char *argv[]);
|
||||
int su_client_main(int argc, char *argv[]);
|
||||
int resetprop_main(int argc, char *argv[]);
|
||||
int imgtool_main(int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
|
@@ -134,16 +134,15 @@ void write_zero(int fd, size_t size);
|
||||
// img.c
|
||||
|
||||
#define round_size(a) ((((a) / 32) + 2) * 32)
|
||||
#define SOURCE_TMP "/dev/source"
|
||||
#define TARGET_TMP "/dev/target"
|
||||
#define SOURCE_TMP "/dev/.img_src"
|
||||
#define TARGET_TMP "/dev/.img_tgt"
|
||||
|
||||
int create_img(const char *img, int size);
|
||||
int get_img_size(const char *img, int *used, int *total);
|
||||
int resize_img(const char *img, int size);
|
||||
int resize_img(const char *img, int size, int enforce);
|
||||
char *mount_image(const char *img, const char *target);
|
||||
void umount_image(const char *target, const char *device);
|
||||
int umount_image(const char *target, const char *device);
|
||||
int merge_img(const char *source, const char *target);
|
||||
void trim_img(const char *img);
|
||||
int trim_img(const char *img, const char *mount, char *loop);
|
||||
|
||||
// pattern.c
|
||||
|
||||
|
Reference in New Issue
Block a user