Subject: Re: sysinst install
To: Bill Studenmund <wrstuden@zembu.com>
From: Bob Nestor <rnestor@augustmail.com>
List: port-mac68k
Date: 08/09/2000 18:26:32
Bill Studenmund wrote:

>On Wed, 9 Aug 2000, Bob Nestor wrote:
>
>> I rewrote major sections of the code to fix some bugs that had been 
>> reported.  The new version works (somewhat), but I haven't submitted the 
>> code changes.  I did send a copy of them to Scott at his request.  I'd be 
>> happy to send-pr them or turn them over to you if you'd like.  There is 
>> one remaining problem with the sysinst proces though and that is getting 
>> the new disk label back in-core during the installation.  My previous 
>> method of doing this required a minor change to the kernel diskreadlabel 
>> code which almost everyone objected to. The suggestion I got to just use 
>> the IOCTL to update the in-core label doesn't appear to work on the 
>> mac68k port because it ends up going through the same commented out 
>> function in the kernel.  So unless someone comes up with another way of 
>> doing this or unless the disklabel code gets some type of modification we 
>> still have a problem.
>
>Which IOCTL in which function?

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?

-bob