a few UNIX questions

iknownotwhoiam

Registered
i just installed darwin 1.4.1 on my computer and i have a few simple questions about setting up my system.

1) how do i set up my network settings so i can connect to the internet? i need to set it up so it uses a DHCP server...

2) how do i make new users?

3) how do i change my boot disk so i can boot back into OS X?

i think that's it for now...
thanks.
axel.
 

lethe

Registered
to set up network settings, first static: the commands are

ifconfig en0 $IPnumber netmask netnumber up
route add default $Router

niutil -create . /locations/resolver
niutil -createprop . /locations/resolver nameserver $NameServer

these settings will only be in effect until you reboot. to make them permanent, put the IPnumber in /etc/iftab. i think you should put the route command in an rc script. the resolver commands will stay. i think /etc/resolv.conf will also work, but i m not sure.

if you want to use DHCP however, the commands are much simpler...

just put hostname automatic in /etc/hostconfig, and put automatic in iftab too. read man pages for more details.

to add a user, you need to use niutil:
mkdir /Users/$user_name
niutil -create . /users/$user_name
niutil -createprop . /users/$user_name uid 1001
niutil -createprop . /users/$user_name gid 0
niutil -createprop . /users/$user_name shell /bin/tcsh
niutil -createprop . /users/$user_name home /Users/$user_name
echo enter password for $user_name
passwd $user_name
chown -R $user_name /Users/$user_name
chown -R .wheel /Users/$user_name



you can also add the users to /etc/passwd according to traditional UNIX rules, and make their directories, then run this:
niload . passwd < /etc/passwd

finally, changing the boot disk. that s a tricky one. as far as i know, there is no command line utility to do this. there is however, a command line utility to edit the Open Firmware. so, first, figure out the partition map of the disk. i think pdisk will show you the map under darwin. there really isn t any way to do it under macos (x or otherwise), without the mac port of this unix program. anyway, let s say that you re macos partition is number 9 and darwin is number 8. (i think the mac os uses the first 6 partitions or so for drivers and stuff). then your boot device should be this for darwin: 'hd:8,\\:tbxi'

so to set this, nvram boot-device='hd:8,\\:tbxi'

replace the 8 with whatever is the partition number of the OS you want to boot, after you restart. if your boot partition isn t on the master internal hard drive, there are device aliases for the other disks as well. you can also figure out the full hardware pathnames, if you want to fool around in OF. you can boot from the cd this way too.

OK? let us know how it all works for you
 

vic

RRRrrrRRRrrrRRrrr
if you got this shit installed onto separeate partitions can't you hold option key on boot up and then you will have a menu describing the different os on each partition you ca boot from? i know that's just if you have separate partitions for each os, but maybe u do so that's a prety easy way to swith between them.
 

lethe

Registered
yes, that also works. it s just sometimes nice to be able to specify the boot disk before you reboot.

but your post reminds me of a question. i m not sure whether you can install Darwin on the same partition as MacOS, but let s consider the case where MacOS9 and OSX on the same partition. is there anyway to specify what OS to boot other than using the systems startup disk utility?

holding option doesn t work. neither does specifying the boot device with OF. i think that this is because the OF can only recognize one blessed folder per partition, and the startup disk utility with the OS can change which system folder it is, but once it is done, the '\\:tbxi' argument to boot, can only refer to the blessed folder.

i think the problem is identical with holding option. the system only recognizes one blessed folder at a time.

it is pretty annoying IMO. let s say your compupter is off, and you need to boot to OSX, but the last time when you shut down, you were under OS9, and you didn t go to startup disk and change it before you shutdown. now you have to boot twice before you can get what you need from the system. it s quite annoying, and a strong argument for not keeping the 2 OSes on the same partition. unless someone can tell me some OF command for changing the blessed folder.

so?
 

PismoMac

Registered
I want this information too. I want to use one partition on my powerbook, I want to use Darwin 1.4.1....NOT OSX, I don't care for OSX. Darwin is what I want to use, it is more similar to Linux that I use at work, then I can bring my work HOME.

If I have to, I will make 2 partitions. But I don't want to, and shouldn't have to.

Thanks.

Originally posted by lethe
yes, that also works. it s just sometimes nice to be able to specify the boot disk before you reboot.

but your post reminds me of a question. i m not sure whether you can install Darwin on the same partition as MacOS, but let s consider the case where MacOS9 and OSX on the same partition. is there anyway to specify what OS to boot other than using the systems startup disk utility?

holding option doesn t work. neither does specifying the boot device with OF. i think that this is because the OF can only recognize one blessed folder per partition, and the startup disk utility with the OS can change which system folder it is, but once it is done, the '\\:tbxi' argument to boot, can only refer to the blessed folder.

i think the problem is identical with holding option. the system only recognizes one blessed folder at a time.

it is pretty annoying IMO. let s say your compupter is off, and you need to boot to OSX, but the last time when you shut down, you were under OS9, and you didn t go to startup disk and change it before you shutdown. now you have to boot twice before you can get what you need from the system. it s quite annoying, and a strong argument for not keeping the 2 OSes on the same partition. unless someone can tell me some OF command for changing the blessed folder.

so?
 
Top