Jump to content

PCWiz OS X Kernel Installer


~pcwiz
 Share

78 posts in this topic

Recommended Posts

Sabr and geekdad,

 

Thanks ;)

 

pnlrogue1,

 

This is not the place to ask questions, please use the correct forum :)

 

EDIT: I'm having some real trouble converting this Perl script for an inputbox to enter the mach_kernel backup name to bash/shell. If anyone would like to help with this, PM me or reply to this thread :)

Link to comment
Share on other sites

Hallo everybody,

 

Is this kernel going to help me with my problem?

 

I am dutch and new at this site and new in installing my already downloaded version of OSX 4.7.

I hope someone can help me along dealing with the installation.

A grey screen appears when the apple logo is shown, it slides like a curtain from the top of the screen down and displays a messages in 4 languages saying that i should restart the computer.

Trying to install using -V is not an option since the installation freezes with a complicated displayed screen.

 

Who encountered this problem before and what can i do about it.

And is installation with my AMD 1800+ and A7V333 motherboard possible?

 

Please help me along!

 

Frank3

Link to comment
Share on other sites

EDIT: I'm having some real trouble converting this Perl script for an inputbox to enter the mach_kernel backup name to bash/shell. If anyone would like to help with this, PM me or reply to this thread :)

~pcwiz, I got the PM I've just been too busy to convert it to BASH. (Yes, really that busy and heading out the door again.)

 

Just post the perl code and someone else can show you the BASH equivalent. I don't think you want to wait on me until after the weekend. :)

(Just make sure to explain that you are calling GUI function like inputbox using Platypus)

Link to comment
Share on other sites

PCWiz or anybody:

Although I've spent 30+ hours reading and installing, I have newbie question.

What is the difference between a mach_kernel, a kernel, and a kext?

I assume they are not, or this program would be the same as Kext Helper b7. No?

 

Is it better to set permissions with chmod in terminal, instead of just doing it in the finder (via OSX's get info dialog)?

 

 

I've just been using a Kalywya MBR install.

I'm building another install on another Drive. So, like someone said earlier, I'd like it if the program asked which drive to install into.

Chris

Link to comment
Share on other sites

Headrush,

 

OK Here is the Perl:

 

#!/usr/bin/perl -w
use strict;

our $CD = "$ENV{HOME}/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog";

my $rv = `$CD standard-inputbox --title "Your Name" --no-newline \\
--informative-text "Enter your name"`;

my ($button_rv, $name) = split /\n/, $rv, 2;
if ($button_rv == 1) {
print "Hello $name\n";
} elsif ($button_rv == 2) {
print "No name given\n";
}

 

Its really not that complicated, also, I got in contact with the dev of CocoaDialog and he has given me some shell script to try out :)

 

Chrismo,

 

mach_kernel and kernel are the same thing. Kernel is the name for it in general, and mach_kernel is the actual filename. A kext is a kernel extension, that goes in the /System/Library/Extension folder, that is usually a driver of some sort. Kexts can be installed using Kext Helper.

 

To install kernels you use my program, kernels can't be installed with kext helper. I'll see if I can figure out a way to do it :(

 

stroke,

 

Thats interesting. So in theory I could just use bash and perl in the same script and variables set in perl could be used by bash? That would be excellent. PM me about it :D

 

Everyone,

 

Like I said in other posts, I have perfected a version where you can select the kernel to install using a file select dialog rather than just installing it from the desktop. The feature I am trying to concentrate now is a way for you to be able to name the backed up kernel instead of it defaulting to mach_kernel.backup.

 

Choosing a destination for the kernel is next on the list. I believe I can accomplish that using another inputbox, so if I get the mach kernel backup feature working, I can do this just as easy :)

Link to comment
Share on other sites

They can't be used interchangeably, so you can't have bash in a perl script and vice versa.

The problem with converting that script to bash is the split function; there's no real equivalent in bash. There's sed, but variable assignment doesn't work as it does in Perl.

Link to comment
Share on other sites

OK well heres what the dev of CocoaDialog suggested using with bash for the inputbox:

 

IFS=$'\n'
rv=(`$CD and the cocoadialog options here`)
button=${rv[0]}
text=${rv[1]}
newpath="/$text/" #
cp -r /mach_kernel $newpath

 

Does that make sense stroke?

Link to comment
Share on other sites

Well I implemented the 2 new features (mach_kernel backup naming and ability to select kernel destination) and both are working--partially. There are still too many little bugs in it to be completely usable, but I'm sure I'll be able to figure out something :blink:

 

Headrush69,

 

Yeah I got that ;):P

Link to comment
Share on other sites

Well after I lot of research, I've decided to attempt to rewrite it all in applescript :( If it goes well, you'll see a new release :(

 

OK, the mach kernel backup part is done. Now for the actual kernel installation, does anyone know how to display a file selection dialog in AppleScript?

Link to comment
Share on other sites

Yep, I got that so heres the little bit I added to my script:

 

set theFile to choose file with prompt "Choose a document:"

do shell script "cp " & theFile & " ~/Desktop"

 

So I choose a file and I get this error:

 

cp: Leopard:p35:netkas:speedstep:mach_kernel: No such file or directory

 

Leopard/p35/netkas/speedstep/mach_kernel was the path of the file I chose. What do I do to fix the error? Also, how do I set it to ask for admin priveleges before starting?

Link to comment
Share on other sites

Thanks a ton Headrush. Works perfectly. Now I just need to get the select destination part. Is there any special code for a select destination box or will I have to improvise? :)

You mean: http://docs.info.apple.com/article.html?pa...1/en/as307.html

 

P.S. A reference to Applescript and all the commands: http://developer.apple.com/documentation/a...ASLR_intro.html

Link to comment
Share on other sites

Thanks! I think I have it just about wrapped up. Just one minor bug, but I think I can fix it :(

 

Should be released tomorrow if all goes well :)

 

EDIT: OK well nearly all of it is working except the last bit where it installs the kernel. Heres the code:

 

display dialog "Welcome to the PCWiz Kernel Installer by ######.com. Please follow the directions to back up your existing kernel and install a new one. Clicking Cancel at any time will quit this application."
set backuppath to ""
set string1 to "Backing up current kernel. Please enter the filename that you would like the kernel to be backed up to (e.g. mach_kernel.backup). Any existing files will be overwritten."
display dialog string1 buttons {"OK", "Cancel"} default button "OK" default answer backuppath
set backuppath to text returned of the result
do shell script "cp -R /mach_kernel /" & backuppath with administrator privileges
set theFile to choose file with prompt "Please choose the mach_kernel file you wish to install. DO NOT select any other file!" without invisibles
set theFile1 to POSIX path of theFile
set dl to "/"
set theFolder to choose folder with prompt "Please choose the volume (from Devices List) to install kernel to. DO NOT select a folder." default location dl without invisibles
set theFolder1 to POSIX path of theFolder
do shell script "cp -R " & theFile1 & theFolder1 with administrator privileges

 

All the stuff works till the last line. Then I get a cp usage error...

 

EDIT2: FIXED IT!! I just had to add a " " after the second & sign.

Link to comment
Share on other sites

OK well, I've finished and everything is working beautifully. Here is the final list of features and every feature that has been requested so far has been added:

 

* Basic kernel installation functions of course :(

* The ability to specify the exact name you want your backed up kernel to be

* The ability to select the destination to install to

 

All features have been thoroughly tested and are working :thumbsup_anim:

 

I have one question though,

 

I saved the script as an application, and when I launched it was slow, laggy, and I got alias errors. Then I tried saving it as an Application bundle and everything worked speedy and good. Whats the difference between an Application and an Application bundle?

 

I'll release the new version tomorrow!!

 

P.S. The old version that used Platypus and CocoaDialog with a shell script was 1.2MB in size. This new one, with even more goodness packed inside, is only around 300KB. Woot!! Lol just zipped it and its 4KB with the readme.

Link to comment
Share on other sites

Looking forward to the final version. They won't be moaning about a 4k zipped attachment on here.... :-) You should also get the OSx86 installer releasers to integrate this into their installers in the Utility folder, I am sure another 4k wouldn't matter to them too much.

Link to comment
Share on other sites

 Share

×
×
  • Create New...