Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Startup Disk

Startup Disk
Thread Tools
macvillage.net
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 20, 2001, 09:22 PM
 
Anyone built a startup disk clone? I need something for OS X like the startup disk control panel was, just without the security lock so anyone can change the startup disk.
     
starfleetX
Mac Elite
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 21, 2001, 12:13 AM
 
Getting rid of the security lock, eh? Methinks it was put there for a reason.

Seriously, though, I think that setting the boot disk is something that simply HAS to be done as an admin. That's just the nature of OS X's (and other *nix's) permissions architecture. After all, you certainly can't really want EVERYONE to be able to change such core settings as that? If that's the case, just make everyone on your machine an admin... hmmmm...
The server made a boo boo. (403)
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 21, 2001, 02:29 AM
 
Yeah, only root has write privs to nvram.
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 21, 2001, 08:42 AM
 
I was thinking of maybe a script that would change the startup disk. I need some regular users to be able to do this.

Would it be possible for a user to launch a script that changed the startup disk settings?
     
Dalgo
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Jun 21, 2001, 09:00 AM
 
You need privileges in order to change the startup disk. Anyway, what you want is probably:

OSErr HGetVol (
StringPtr volName,
SInt16 *vRefNum,
SInt32 *dirID
);

To find out what the startup disk is and:

OSErr HSetVol (
ConstStr63Param volName,
SInt16 vRefNum,
SInt32 dirID
);

To set the startup disk. I'm not 100% sure of these functions because I have never used them but they are part of the Carbon file manager. Note: It's okay to mix most Carbon functions with Cocoa. I think that the only things that don't play well together are anything that draws to the screen. ie don't use any Carbon draw commands in a Cocoa app.
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 21, 2001, 09:04 AM
 
Dalgo

I haven't really messed with programming much, especially with OSX. Could you possibly explain a little more?
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 21, 2001, 02:03 PM
 
Uhm... You could probably create a shell script that manipulates the nvram via the nvram command, that is setuid so it runs as root... Would that do the trick?
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 22, 2001, 10:03 AM
 
Still lost. Anyone have some directions?
     
mccullocht
Fresh-Faced Recruit
Join Date: May 2001
Status: Offline
Reply With Quote
Jun 22, 2001, 11:10 AM
 
Well, if your OS X and OS 9 installations are on different partitions/disks, then you could just have people reboot and hold down the option key. That would give them little buttons for each startup disk. Then they could easily choose which one and be on their way.
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 22, 2001, 02:35 PM
 
Originally posted by mccullocht:
<STRONG>Well, if your OS X and OS 9 installations are on different partitions/disks, then you could just have people reboot and hold down the option key. That would give them little buttons for each startup disk. Then they could easily choose which one and be on their way.</STRONG>
Not all of us are on top-of-the-range NewWorld machines, you know!
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 22, 2001, 08:03 PM
 
Bingo!


So can anyone assist with this script? It would be really useful.
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 10, 2001, 03:01 PM
 
OK, I don't have a clue how to use the provided code. Can anyone provide some instructions?
     
macvillage.net  (op)
Addicted to MacNN
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 12, 2001, 08:43 AM
 
Last try, anyone care to explain?


(boy this server is really under a lot of load. I hope the new server is up and running quick.)
     
starfleetX
Mac Elite
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 12, 2001, 08:59 PM
 
Originally posted by macvillage.net:
<STRONG>Last try, anyone care to explain?


(boy this server is really under a lot of load. I hope the new server is up and running quick.)</STRONG>
Umm, what else is there to explain?

If you follow mccullocht's advice (is that why you said "Bingo!"? ), you don't have to write any sort of program. Just DO what he said. There's no code to write. That little "trick" is in Apple's OpenFirmware code, assuming you have a fairly new computer. Just try it and see for yourself.
The server made a boo boo. (403)
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:22 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,