@@ -45,9 +45,11 @@ func init() {
4545 mountCmd .Flags ().StringP ("key" , "k" , "" , "DMG key" )
4646 mountCmd .Flags ().Bool ("lookup" , false , "Lookup DMG keys on theapplewiki.com" )
4747 mountCmd .Flags ().String ("pem-db" , "" , "AEA pem DB JSON file" )
48+ mountCmd .Flags ().StringP ("mount-point" , "m" , "" , "Custom mount point (default: /tmp/<dmg>.mount)" )
4849 viper .BindPFlag ("mount.key" , mountCmd .Flags ().Lookup ("key" ))
4950 viper .BindPFlag ("mount.lookup" , mountCmd .Flags ().Lookup ("lookup" ))
5051 viper .BindPFlag ("mount.pem-db" , mountCmd .Flags ().Lookup ("pem-db" ))
52+ viper .BindPFlag ("mount.mount-point" , mountCmd .Flags ().Lookup ("mount-point" ))
5153}
5254
5355// mountCmd represents the mount command
@@ -69,6 +71,9 @@ var mountCmd = &cobra.Command{
6971
7072 # Mount dyld shared cache (exc) DMG with AEA pem DB
7173 $ ipsw mount exc iPhone.ipsw --pem-db /path/to/pem.json
74+
75+ # Mount to a custom mount point
76+ $ ipsw mount fs iPhone.ipsw --mount-point /mnt/ios-filesystem
7277 ` ),
7378 ValidArgsFunction : func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
7479 if len (args ) == 0 {
@@ -86,6 +91,7 @@ var mountCmd = &cobra.Command{
8691 key := viper .GetString ("mount.key" )
8792 lookupKeys := viper .GetBool ("mount.lookup" )
8893 pemDB := viper .GetString ("mount.pem-db" )
94+ mountPoint := viper .GetString ("mount.mount-point" )
8995 // validate flags
9096 if len (key ) > 0 && lookupKeys {
9197 return fmt .Errorf ("cannot use --key AND --lookup flags together" )
@@ -129,7 +135,7 @@ var mountCmd = &cobra.Command{
129135 keys = key
130136 }
131137
132- mctx , err := mount .DmgInIPSW (args [1 ], args [0 ], pemDB , keys )
138+ mctx , err := mount .DmgInIPSW (args [1 ], args [0 ], pemDB , keys , mountPoint )
133139 if err != nil {
134140 return fmt .Errorf ("failed to mount %s DMG: %v" , args [0 ], err )
135141 }
0 commit comments