version 1.8, 1997/11/02 08:20:42 |
version 1.9, 1997/11/03 00:04:53 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <fcntl.h> |
|
#include <util.h> |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <ufs/ufs/dinode.h> |
#include <ufs/ufs/dinode.h> |
|
|
/* Local prototypes */ |
/* Local prototypes */ |
static void get_disks (void); |
static void get_disks (void); |
static void foundffs (struct data *list, int num); |
static void foundffs (struct data *list, int num); |
|
static void |
|
do_ffs_newfs(const char *partname, int part, const char *mountpoint); |
|
|
|
|
static void get_disks(void) |
static void get_disks(void) |
Line 172 void disp_cur_fspart (int disp, int show |
|
Line 175 void disp_cur_fspart (int disp, int show |
|
|
|
if (disp < 0) { |
if (disp < 0) { |
start = 0; |
start = 0; |
stop = 8; |
stop = getmaxpartitions(); |
} else { |
} else { |
start = disp; |
start = disp; |
stop = disp+1; |
stop = disp+1; |
Line 270 void write_disklabel (void) |
|
Line 273 void write_disklabel (void) |
|
|
|
|
|
|
|
|
|
void make_filesystems (void) |
void make_filesystems (void) |
{ |
{ |
int i; |
int i; |
|
char partname[STRSIZE]; |
|
|
/* Making new file systems and mounting them*/ |
/* Making new file systems and mounting them*/ |
printf ("%s", msg_string (MSG_donewfs)); |
printf ("%s", msg_string (MSG_donewfs)); |
for (i=0; i<8; i++) |
for (i=0; i<getmaxpartitions(); i++) { |
if (bsdlabel[i][D_FSTYPE] == T_42BSD) { |
/* |
run_prog_or_continue ("/sbin/newfs /dev/r%s%c", |
* newfs and mount. For now, process only BSD filesystems. |
diskdev, 'a'+i); |
* but if this is the mounted-on root, don't touch it! |
if (*fsmount[i]) { |
*/ |
if (i > 0) { |
snprintf(partname, STRSIZE, "%s%c", diskdev, 'a'+i); |
make_target_dir(fsmount[i]); |
if (bsdlabel[i][D_FSTYPE] == T_42BSD && |
run_prog_or_continue ("/sbin/mount -v /dev/%s%c" |
!is_active_rootpart(partname)) { |
" /mnt%s", |
do_ffs_newfs(partname, i, fsmount[i]); |
diskdev, 'a'+i, |
|
fsmount[i]); |
|
} else |
|
run_prog_or_continue ("/sbin/mount -v /dev/%s%c" |
|
" /mnt", diskdev, 'a'+i); |
|
} |
|
} |
} |
|
} |
|
} |
|
|
|
|
|
/* newfs and mount an ffs filesystem. */ |
|
static void |
|
do_ffs_newfs(const char *partname, int partno, const char *mountpoint) |
|
{ |
|
run_prog_or_continue ("/sbin/newfs /dev/r%s", partname); |
|
if (*mountpoint) { |
|
if (partno > 0) { |
|
make_target_dir(mountpoint); |
|
run_prog_or_continue ("/sbin/mount -v /dev/%s /mnt%s", |
|
partname, mountpoint); |
|
} else |
|
run_prog_or_continue ("/sbin/mount -v /dev/%s%c" |
|
" /mnt", partname); |
|
} |
} |
} |
|
|
void make_fstab (void) |
void make_fstab (void) |
Line 314 void make_fstab (void) |
|
Line 328 void make_fstab (void) |
|
} |
} |
(void)fprintf (f, "/dev/%sa / ffs rw 1 1\n", diskdev); |
(void)fprintf (f, "/dev/%sa / ffs rw 1 1\n", diskdev); |
(void)fprintf (f, "/dev/%sb none swap sw 0 0\n", diskdev); |
(void)fprintf (f, "/dev/%sb none swap sw 0 0\n", diskdev); |
for (i=4; i<8; i++) |
for (i=4; i<getmaxpartitions(); i++) |
if (bsdlabel[i][D_FSTYPE] == T_42BSD) |
if (bsdlabel[i][D_FSTYPE] == T_42BSD) |
(void)fprintf (f, "/dev/%s%c %s ffs rw 1 2\n", |
(void)fprintf (f, "/dev/%s%c %s ffs rw 1 2\n", |
diskdev, 'a'+i, fsmount[i]); |
diskdev, 'a'+i, fsmount[i]); |