diff --git a/docs/palera1n.1 b/docs/palera1n.1 index a4387f1..703c6c4 100644 --- a/docs/palera1n.1 +++ b/docs/palera1n.1 @@ -113,6 +113,16 @@ This option currently does not work on iOS 16. When used with .Fl f , -fakefs , creates the new APFS volume required for rootful. Will fail if one already exists. +.It Fl C , -clean-fakefs +This reverts the fakefs to the +.Em orig-fs +snapshot that is created when the fakefs +is first created, then the device will continue to boot jailbroken. This option +allows resetting the rootful environment without deleting the entire fakefs. +Note that this option will not work if the fakefs is created in an older version +of palera1n that does not create the +.Em orig-fs +snapshot on the fakefs. .It Fl d , -demote Set the effective production fuse to 0, so as to enable hardware debugging features. .It Fl D , -dfuhelper diff --git a/include/kerninfo.h b/include/kerninfo.h index d35b006..60c6f41 100644 --- a/include/kerninfo.h +++ b/include/kerninfo.h @@ -65,6 +65,7 @@ // #define palerain_option_no_ssv (1 << 7) /* no signed system volume */ // #define palerain_option_force_fakefs (1 << 8) /* force fakefs, even without SSV */ // #define palerain_option_rootless (1 << 9) /* rootless jailbreak */ +#define palerain_option_clean_fakefs (1 << 10) /* clean fakefs, but does not delete it */ #ifdef DEV_BUILD #define palerain_option_test1 (1 << 29) diff --git a/src/optparse.c b/src/optparse.c index d9692cb..ad13d64 100644 --- a/src/optparse.c +++ b/src/optparse.c @@ -21,6 +21,7 @@ static bool force_use_verbose_boot = false; static struct option longopts[] = { {"setup-partial-fakefs", no_argument, NULL, 'B'}, {"setup-fakefs", no_argument, NULL, 'c'}, + {"clean-fakefs", no_argument, NULL, 'c'}, {"dfuhelper", no_argument, NULL, 'D'}, {"help", no_argument, NULL, 'h'}, {"pongo-shell", no_argument, NULL, 'p'}, @@ -64,7 +65,7 @@ static int usage(int e, char* prog_name) "12" #endif #ifdef ROOTFUL - "cfB" + "cCfB" #endif #ifdef TUI "t" @@ -81,6 +82,7 @@ static int usage(int e, char* prog_name) #ifdef ROOTFUL "\t-B, --setup-partial-fakefs\t\tSetup partial fakefs\n" "\t-c, --setup-fakefs\t\t\tSetup fakefs\n" + "\t-C, --clean-fakefs\t\t\tClean fakefs\n" #endif "\t-d, --demote\t\t\t\tDemote\n" "\t-D, --dfuhelper\t\t\t\tExit after entering DFU\n" @@ -126,7 +128,7 @@ int optparse(int argc, char* argv[]) { #ifdef DEV_BUILD "12" #endif - "fcB" + "fCcB" ,longopts, NULL)) != -1) { switch (opt) { @@ -139,6 +141,9 @@ int optparse(int argc, char* argv[]) { palerain_flags |= palerain_option_setup_rootful; kpf_flags |= checkrain_option_verbose_boot; break; + case 'C': + palerain_flags |= palerain_option_clean_fakefs; + break; case 'p': host_flags |= host_option_pongo_exit; break;