~pcwiz
Mar 8 2008, 12:16 AM
UPDATE This is the latest version 1.1 of this program. If you downloaded before March 12 2008 please download again as this new version has major improvements
I have created a kernel installer application that will automatically install Mac OS X kernels for you. Just run the Kernel Installer application program included in the zip file (download below) and it will guide you through a user friendly, interactive wizard to back up your existing kernel and to install a new one.
CHANGELOG (v1.0 to 1.1) - The kernel can be selected from anywhere rather than just the desktop
- You can specify the name of the file that you want mach_kernel to be backed up to
- You can install to a different target drive than the drive you are running it from
The NEW 113KB zip file is
attached. Also included is a ReadMe file for more information..
I hope this helps!

P.S. Just in case you were wondering, I have tested this and it works
daclothe
Mar 8 2008, 12:39 AM
are you running netkas kernel right now or vanilla pcwiz?
~pcwiz
Mar 8 2008, 12:39 AM
netkas kernel
I guess I should update my sig

P.S. Does anyone know how I would go about creating a GUI front end for this and make it a .app instead of a script? It would be nicer, I don't want to spend too much effort on it, but if anyone knows an easy way
Headrush69
Mar 8 2008, 02:32 AM
Use Applescript.
stroke
Mar 8 2008, 02:32 AM
Well it's a bit more complicated, you'd have to either run the shell script as an NSTask, or use AppleScript Studio and 'do shell script().' The latter would be easier, but the former is the best method. Even better if you used NSFileManager.
~pcwiz
Mar 8 2008, 03:35 AM
I just created a GUI version of this app using Platypus and CocoaDialog. I'll post pics soon

EDIT: Heres a screen:
Click to view attachmentLike it? It took a while to learn the CocoaDialog syntax and all but its fully working in .APP format. I'll post it up tomorrow

EDIT2: I couldn't wait and I posted it up today
~pcwiz
Mar 8 2008, 04:20 AM
The only thing I can think of that would make this perfect is the ability to drag and drop a kernel from anywhere and install it...The only way to do that would be to implement drag and drop in some form
Headrush69,
I thought of AppleScript too, but wouldn't that mean that I would have to recode the entire thing in a different language? AppleScript isn't the same as bash is it? Or could I insert my bash code into AppleScript raw?
EDIT: Since I have nothing better to do, I will tell you how I did this:
First of all, as you know, the original version (released today evening) was just a bash script to run in Terminal. What I wanted to do was make it user friendly, so I researched a long time and tried to find a way where I could just convert the bash script into a GUI app. I finally came across the solution with an open source app called
Platypus. What Platypus does is it puts a GUI wrapper around shell scripts, apple scripts, and some others. So I imported my script and changed the interpreter from "sh" to "bash". Then I set the output mode to text window, made admin priveleges required, and I set it not to shut down once finished running. Then I created my app. It ran the backup, but then it came to the part where you had to type "y" or "n" to confirm kernel installation. This is where I came across my first problem. Platypus apps don't let you import text.
Then I came across the solution for that problem in the form of a little app called
CocoaDialog. What it does is it lets you put in dialog boxes, so I planned to switch the text prompts to clickable dialog boxes. Then I found
instructions on how to integrate PlatyPus and CocoaDialog together. Then I was all set.
After a few long hours of reading CocoaDialog documentation and about 20 copies of the app later, I got one that actually worked. Then I refined it more and voila, the GUI edtion was born!!
Deviant0ne
Mar 8 2008, 04:28 AM
Great tool!
~pcwiz
Mar 8 2008, 04:34 AM
Thanks Deviant0ne!
EDIT: Lol I just noticed something. The app is "Universal" so it works with PPC and Intel. Genius! Platypus is a wonderful app I must say, maybe not by itself, but with the addition of things like CocoaDialog, it ROCKS
Colonel
Mar 8 2008, 04:48 AM
I know copying mach_kernel to your HDD is a seriously difficult task that needs a custom application to accomplish...
Deviant0ne
Mar 8 2008, 05:28 AM
I really wish this was around when I was new to OS X. Again, kudos.
~pcwiz
Mar 8 2008, 05:38 AM
Thanks again Deviant0ne.

Colonel,
You'd be surprised how many people (AKA newbs) can't install a kernel
Headrush69
Mar 8 2008, 11:17 AM
QUOTE(~pcwiz @ Mar 7 2008, 11:20 PM)

Headrush69,
I thought of AppleScript too, but wouldn't that mean that I would have to recode the entire thing in a different language? AppleScript isn't the same as bash is it? Or could I insert my bash code into AppleScript raw?
Depends. Since this is such an easy scrpt you could re-write it in Applescript. Applescript is really simple and learning it would prove useful for other things too.
You could also just have the Applescript execute the BASH script passing the "dropped" file.
All these procedural computer languages aren't terribly different once you know one. Sure their syntaxes might have differences but it shouldn't a problem.
QUOTE(~pcwiz @ Mar 7 2008, 11:20 PM)

EDIT: Since I have nothing better to do, I will tell you how I did this:
You need a girlfriend!

P.S. I emailed you an Applescript Primer ebook for future reference if you want to take a look.
~pcwiz
Mar 8 2008, 04:09 PM
Yeah I'll take a look at the ebook
~pcwiz
Mar 8 2008, 05:54 PM
Headrush,
I read over that tutorial you emailed me but theres nothing in there regarding copying and moving files and drag and drop
SticMAC™
Mar 8 2008, 06:05 PM
PcWizzzzzzz....
Don't you wanna make us a kext installer that you can set the "target" drive, ie, if I want to add kexts on my 10.4.11 drive while I'm in 10.5.2!
Kext helper B7 ONLY does install on the active drive and that is a real PAIN!
Also if your kernel installer can do the same as MOST of the problems is getting a kernel onto a problematic HDD which most of the time is not the one, one is currently working from!?
SticMAN
Colonel,
with the utmost respect, sometimes it is JUST the convenience of NOT having to go through the whole chmod,chown thing!
SticMAN
QUOTE(Colonel @ Mar 8 2008, 05:48 AM)

I know copying mach_kernel to your HDD is a seriously difficult task that needs a custom application to accomplish...

~pcwiz
Mar 8 2008, 06:07 PM
Thats what I'm trying to do SticMAN...
My programming skills aren't great, but I'll work on it
SticMAC™
Mar 8 2008, 06:10 PM
Thao
Mar 8 2008, 06:12 PM
Great idea, installing Kernels is kind of a scary process, even when you know how to do it, because if you mess it up, there goes your system.
~pcwiz
Mar 8 2008, 06:25 PM
I believe I know how to make a version where you can SELECT the mach_kernel file you wish to install instead of just installing it from the desktop.
The only problem is that I want to make it so that you can ONLY install mach_kernel files and nothing else. The only way to to this would be to limit extensions, but the problem is that mach_kernel has no extension!
Does anyone know what the file extension for mach_kernel is?
~pcwiz
Mar 8 2008, 07:05 PM
Never mind above, in the end I had to remove the extension limitations.
I have suceeded in creating a version where you can select the file you want to install, however.
Does anyone want to beta test the new version for me?EDIT: Well actually I think I messed the new version up a bit. Let me just recode it from scratch, its pretty messy. But that won't take too long, I know how to do it
~pcwiz
Mar 9 2008, 04:53 AM
Sorry for triple post everyone, but I am making a new version tomorrow of this that adds 2 features:
* The ability to choose the kernel from anywhere on your system instead of it just being on the desktop
* The ability for you to name the backed up kernel yourself, instead of it being mach_kernel.backup by default
Enjoy

EDIT: Okay, progress check. I've done the part where you can select the kernel yourself using a file browser and that part works fine. The part where it lets you specify a name for the backed up kernel is proving to be challenging. The code for the inputbox is written in Perl so I'll have to translate it into bash...Hopefully I can do it
Sabr
Mar 9 2008, 01:20 PM
Fantastic work pcwiz. Definitely going to help a lot of people round here.
pnlrogue1
Mar 9 2008, 01:26 PM
Hey guys. I'm new to OSX86, though am a fairly advanced computer user and I was just wondering if someone could answer a quick query for me?
I've got Uphuck 10.4.9 on my AMD system but I wanted to run iWork and iLife '08 and I need 10.4.10 for it. I got Zephyroth 10.5.2 working but it was painfully slow for some reason so rolled back intending to update to 10.4.10 or 10.4.11. Trouble is that after running the PascalW Delta, my system just crashes.
I was thinking of using this to install PascalW's manual update Kernel but wasn't sure if this would work or not (would I need other Kext's etc).
Final thought: The install guide I used went in to detail on how to restore things through the terminal if it went wrong by rolling back to previous Kext's but when I booted with –v, it didn't appear to be a Kext causing the problems
Any advice would be massively appreciated!
AMD Athlon X2 x64 4200+ (SSE3)
Foxconn NF4 Motherboard
1.5gb RAM
ATA Hard Disc
Update:
Just used it to install new Kernel (working) but still reporting as 10.4.9 - what else do I do to get to 10.4.10?!
Should I just use the JSN1 System Version Changer to trick it?
Thanks
geekdad
Mar 9 2008, 02:13 PM
Great work pcwiz. Thanks for all of your efforts!
~pcwiz
Mar 9 2008, 04:20 PM
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
frank3
Mar 10 2008, 10:37 AM
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
Headrush69
Mar 10 2008, 11:08 AM
QUOTE(~pcwiz @ Mar 9 2008, 12:20 PM)

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)
Chrismo
Mar 10 2008, 06:13 PM
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
stroke
Mar 10 2008, 07:31 PM
pcwiz, after thinking about it, there's no real need to convert the perl script to bash script. As long as the user has perl installed, it can still be executed just as a shell script would.
~pcwiz
Mar 10 2008, 08:08 PM
Headrush,
OK Here is the Perl:
CODE
#!/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

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
stroke
Mar 10 2008, 11:33 PM
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.
~pcwiz
Mar 10 2008, 11:48 PM
OK well heres what the dev of CocoaDialog suggested using with bash for the inputbox:
CODE
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?
stroke
Mar 11 2008, 01:07 AM
Well if the developer gave it to you, then go for it.
~pcwiz
Mar 11 2008, 01:13 AM
SWEET! I tried it and it works perfectly!! Expect a new version soon
Headrush69
Mar 11 2008, 01:29 AM
~pcwiz, FYI, that first line in the script with the #! tells the OS what interpreter to use for the script.
So you can see how /bin/bash and /usr/bin/perl are set to each respectively.
~pcwiz
Mar 11 2008, 02:57 AM
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

Headrush69,
Yeah I got that
Headrush69
Mar 11 2008, 11:00 AM
QUOTE(~pcwiz @ Mar 10 2008, 10:57 PM)

Headrush69,
Yeah I got that

If that's true, why would you ask if both perl and BASH could run in the same script?
~pcwiz
Mar 11 2008, 11:05 PM
~pcwiz
Mar 12 2008, 12:44 AM
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?
Headrush69
Mar 12 2008, 01:27 AM
~pcwiz
Mar 12 2008, 01:42 AM
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?
Headrush69
Mar 12 2008, 01:48 AM
Applescript uses a different path separator than BASH, hence why the : is an issue. (Think you need the POSIX option, but I'll have to look up, been a while)
For running as admin add with administrator privileges at the end of the do script line.
~pcwiz
Mar 12 2008, 01:51 AM
OK so whats the solution for the : problem? Is there any way to fix it?
Headrush69
Mar 12 2008, 01:52 AM
QUOTE(~pcwiz @ Mar 11 2008, 09:51 PM)

OK so whats the solution for the : problem? Is there any way to fix it?
Here's what you need:
http://docs.info.apple.com/article.html?pa...1/fr/as208.html
~pcwiz
Mar 12 2008, 02:35 AM
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?
Headrush69
Mar 12 2008, 02:43 AM
QUOTE(~pcwiz @ Mar 11 2008, 10:35 PM)

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.htmlP.S. A reference to Applescript and all the commands:
http://developer.apple.com/documentation/a...ASLR_intro.html
~pcwiz
Mar 12 2008, 04:21 AM
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:
CODE
display dialog "Welcome to the PCWiz Kernel Installer by pcwizcomputer.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.
~pcwiz
Mar 12 2008, 05:03 AM
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
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.
Jackobyte
Mar 12 2008, 12:59 PM
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.