decode-panic deal with kextload
authorDerrick Brashear <shadow@dementia.org>
Fri, 5 Feb 2010 20:01:31 +0000 (15:01 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Fri, 5 Feb 2010 20:15:55 +0000 (12:15 -0800)
kextload won't handle -arch. deal appropriately.

Change-Id: Iac7dac9b484e44b9610da028027aadbd94cfe151
Reviewed-on: http://gerrit.openafs.org/1246
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/packaging/MacOS/decode-panic

index cd7c874..42fc1bd 100755 (executable)
@@ -305,30 +305,53 @@ sub generate_symbol_files {
     my $kernel = shift;
     my $kext = shift;
 
-    if ($kernel eq "/mach_kernel") {
-       if ($option_verbose) {
-           print "$kextprog -k $kernel -s $temp_dir -arch $kextarch -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+    if ($kextprog eq $kextload) {
+       if ($kernel eq "/mach_kernel") {
+           if ($option_verbose) {
+               print "$kextprog -k $kernel -s $temp_dir -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+           }
+           system( $kextprog,
+                   "-k", $kernel,
+                   "-s", $temp_dir,
+                   "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+                   "-n", $kext );
+       } else {
+           if ($option_verbose) {
+               print "$kextprog -c -e -r $temp_dir -k $kernel -s $temp_dir -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+           }
+           system( $kextprog,
+                   "-c", "-e",
+                   "-r", $temp_dir,
+                   "-k", $kernel,
+                   "-s", $temp_dir,
+                   "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+                   "-n", $kext );
        }
-       system( $kextprog,
-               "-k", $kernel,
-               "-s", $temp_dir,
-               "-arch", $kextarch,
-               "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
-               "-n", $kext );
     } else {
-       if ($option_verbose) {
-           print "$kextprog -c -e -r $temp_dir -k $kernel -s $temp_dir -arch $kextarch -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+       if ($kernel eq "/mach_kernel") {
+           if ($option_verbose) {
+               print "$kextprog -k $kernel -s $temp_dir -arch $kextarch -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+           }
+           system( $kextprog,
+                   "-k", $kernel,
+                   "-s", $temp_dir,
+                   "-arch", $kextarch,
+                   "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+                   "-n", $kext );
+       } else {
+           if ($option_verbose) {
+               print "$kextprog -c -e -r $temp_dir -k $kernel -s $temp_dir -arch $kextarch -a org.openafs.filesystems.afs\@${kernel_address} -n $kext\n";
+           }
+           system( $kextprog,
+                   "-c", "-e",
+                   "-r", $temp_dir,
+                   "-k", $kernel,
+                   "-s", $temp_dir,
+                   "-arch", $kextarch,
+                   "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
+                   "-n", $kext );
        }
-       system( $kextprog,
-               "-c", "-e",
-               "-r", $temp_dir,
-               "-k", $kernel,
-               "-s", $temp_dir,
-               "-arch", $kextarch,
-               "-a", 'org.openafs.filesystems.afs@' . $kernel_address,
-               "-n", $kext );
-    }
-    
+    }    
     if ( $CHILD_ERROR ) {
         # error
         croak "kextload failed to run: $OS_ERROR\n";