1994-10-20 02:51:55 +00:00
|
|
|
/*
|
|
|
|
* ----------------------------------------------------------------------------
|
|
|
|
* "THE BEER-WARE LICENSE" (Revision 42):
|
|
|
|
* <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
|
|
|
|
* can do whatever you want with this stuff. If we meet some day, and you think
|
|
|
|
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
|
|
|
* ----------------------------------------------------------------------------
|
|
|
|
*
|
1994-10-26 02:53:15 +00:00
|
|
|
* $Id: stage3.c,v 1.4 1994/10/21 02:14:52 phk Exp $
|
1994-10-20 02:51:55 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <dialog.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
1994-10-26 02:53:15 +00:00
|
|
|
#include <fstab.h>
|
1994-10-20 02:51:55 +00:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
#include "sysinstall.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
stage3()
|
|
|
|
{
|
1994-10-26 02:53:15 +00:00
|
|
|
char pbuf[90],*p;
|
|
|
|
int mountflags;
|
|
|
|
struct fstab *fs;
|
1994-10-20 02:51:55 +00:00
|
|
|
|
|
|
|
/*
|
1994-10-26 02:53:15 +00:00
|
|
|
* Mount things in /etc/fstab we like.
|
1994-10-20 02:51:55 +00:00
|
|
|
*/
|
|
|
|
|
1994-10-26 02:53:15 +00:00
|
|
|
mountflags = MNT_UPDATE;
|
|
|
|
while((fs = getfsent()) != NULL) {
|
|
|
|
p = fs->fs_spec;
|
|
|
|
if (*p++ != '/') continue;
|
|
|
|
if (*p++ != 'd') continue;
|
|
|
|
if (*p++ != 'e') continue;
|
|
|
|
if (*p++ != 'v') continue;
|
|
|
|
if (*p++ != '/') continue;
|
1994-10-26 05:41:02 +00:00
|
|
|
|
|
|
|
if (!strcmp(fs->fs_type,"sw")) {
|
|
|
|
swapon(fs->fs_file);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(fs->fs_vfstype,"ufs")) continue;
|
|
|
|
|
1994-10-26 02:53:15 +00:00
|
|
|
if (!strcmp(fs->fs_type,"ro"))
|
|
|
|
mountflags |= MNT_RDONLY;
|
|
|
|
else if (!strcmp(fs->fs_type,"rw"))
|
|
|
|
;
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
strcpy(pbuf,"/dev/r");
|
|
|
|
strcat(pbuf,p);
|
|
|
|
TellEm("fsck -y %s",pbuf);
|
|
|
|
if (exec(0, "/stand/fsck",
|
|
|
|
"/stand/fsck", "-y", pbuf, 0) == -1)
|
|
|
|
Fatal(errmsg);
|
1994-10-21 02:14:54 +00:00
|
|
|
|
1994-10-26 02:53:15 +00:00
|
|
|
MountUfs(p,fs->fs_file,0,mountflags);
|
|
|
|
mountflags = 0;
|
1994-10-20 02:51:55 +00:00
|
|
|
}
|
1994-10-26 02:53:15 +00:00
|
|
|
endfsent();
|
1994-10-20 02:51:55 +00:00
|
|
|
}
|