Skip to content

Commit

Permalink
Fix create fakefs immediately after restore
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfugil committed Jul 23, 2024
1 parent f1f8b20 commit df3bc1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Binary file removed main
Binary file not shown.
4 changes: 4 additions & 0 deletions src/payload/loader/setup_fakefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ int copyfile_fakefs_cb(int what, int __unused stage, copyfile_state_t __unused s

int setup_fakefs(uint32_t __unused payload_options, struct paleinfo* pinfo_p) {
CHECK_ERROR(runCommand((char*[]){ "/sbin/fsck", "-qL", NULL }), 1, "fsck failed");
CHECK_ERROR(runCommand((char*[]){ "/sbin/mount", "-P", "1", NULL }), 1, "mount-phase-1 failed");
CHECK_ERROR(runCommand((char*[]){ "/usr/libexec/init_data_protection", NULL }), 1, "init_data_protection failed");
CHECK_ERROR(runCommand((char*[]){ "/sbin/mount", "-P", "2", NULL }), 1, "mount-phase-2 failed"); // needed to make sure overprovisioning volume is made on iPadOS 18

struct statfs rootfs_st;
CHECK_ERROR(statfs("/", &rootfs_st), 1, "statfs / failed");
Expand Down Expand Up @@ -233,6 +236,7 @@ int setup_fakefs(uint32_t __unused payload_options, struct paleinfo* pinfo_p) {

unmount("/cores/fs/real", MNT_FORCE);
unmount("/cores/fs/fake", MNT_FORCE);
runCommand((char*[]){ "/usr/libexec/seputil", "--gigalocker-shutdown", NULL });

if (access("/sbin/umount", F_OK) == 0)
runCommand((char*[]){ "/sbin/umount", "-a", NULL });
Expand Down

0 comments on commit df3bc1f

Please sign in to comment.