Subject: Re: sysinst install
To: Bob Nestor <rnestor@augustmail.com>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-mac68k
Date: 08/09/2000 16:48:41
On Wed, 9 Aug 2000, Bob Nestor wrote:
> This is the code I have now and it still doesn't work:
>
> /*
> * Now we need to set the in-core label. The mac68k port doesn't do
> * disk labels and right now there's no way to get the on-disk
> * label in-core without rebooting, but we'll try anyway. Actually
> * if the disk was previously unlabeled this will work.
> */
> writeable = 1;
> ioctl(fd, DIOCWLABEL, (char *)&writeable); /* Make label writeable
> */
> if (ioctl(fd, DIOCWDINFO, &bsdlabel) != 0)
> ioctl(fd, DIOCSDINFO, &bsdlabel);
> writeable = 0;
> ioctl(fd, DIOCWLABEL, (char *)&writeable); /* Make it R/O now */
> fsync(fd);
> /*
> * Well, if we get here the dirty deed has been done.
> */
> close (fd);
> /*
> * Force the system to flush the disk buffers to disk
> */
> sync();
>
> Any ideas?
Oh, yes, that won't work.
You definitly don't want to do DIOCWDINFO as there's no clean way to go
from a disklabel structure to what needs to be on disk.
I thought when this last came up, the concensus was to write the on-disk
label (the apple partition map), and then either load a label into the
kernel, or have the kernel reload the label off disk.
I think re-reading would be the cleanest.
Scott, weren't you going to make a new ioctl to do that?
Take care,
Bill