Let noexec, nodev and nosuid be written to /ets fstab entries

Always use 1023 cylinders in mbr for large disks
This commit is contained in:
dsl 2003-08-10 14:51:48 +00:00
parent 7a1600bb14
commit b2fa78b58e
5 changed files with 42 additions and 26 deletions

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.102 2003/08/09 21:36:26 dsl Exp $ */
/* $NetBSD: defs.h,v 1.103 2003/08/10 14:51:48 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -143,14 +143,17 @@ typedef struct _partinfo {
char pi_mount[20];
uint pi_isize; /* bytes per inode */
uint pi_flags;
#define PIF_NEWFS 0x001 /* need to 'newfs' partition */
#define PIF_MOUNT 0x002 /* need to mount partition */
#define PIF_ASYNC 0x010 /* mount -o async */
#define PIF_NOATIME 0x020 /* mount -o noatime */
#define PIF_NODEVMTIME 0x040 /* mount -o nodevmtime */
#define PIF_SOFTDEP 0x080 /* mount -o softdep */
#define PIF_MOUNT_OPTS 0x0f0 /* all above mount flags */
#define PIF_RESET 0x100 /* internal - restore previous values */
#define PIF_NEWFS 0x0001 /* need to 'newfs' partition */
#define PIF_MOUNT 0x0002 /* need to mount partition */
#define PIF_ASYNC 0x0010 /* mount -o async */
#define PIF_NOATIME 0x0020 /* mount -o noatime */
#define PIF_NODEV 0x0040 /* mount -o nodev */
#define PIF_NODEVMTIME 0x0080 /* mount -o nodevmtime */
#define PIF_NOEXEC 0x0100 /* mount -o noexec */
#define PIF_NOSUID 0x0200 /* mount -o nosuid */
#define PIF_SOFTDEP 0x0400 /* mount -o softdep */
#define PIF_MOUNT_OPTS 0x0ff0 /* all above mount flags */
#define PIF_RESET 0x1000 /* internal - restore previous values */
} partinfo; /* Single partition from a disklabel */

@ -1,4 +1,4 @@
/* $NetBSD: disks.c,v 1.70 2003/08/09 21:36:27 dsl Exp $ */
/* $NetBSD: disks.c,v 1.71 2003/08/10 14:51:48 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -428,12 +428,15 @@ make_fstab(void)
s = "# ";
break;
}
scripting_fprintf(f, "%s/dev/%s%c %s %s rw%s%s%s%s%s %d %d\n",
scripting_fprintf(f, "%s/dev/%s%c %s %s rw%s%s%s%s%s%s%s%s %d %d\n",
s, diskdev, 'a' + i, mp, fstype,
bsdlabel[i].pi_flags & PIF_MOUNT ? "" : ",noauto",
bsdlabel[i].pi_flags & PIF_ASYNC ? ",async" : "",
bsdlabel[i].pi_flags & PIF_NOATIME ? ",noatime" : "",
bsdlabel[i].pi_flags & PIF_NODEV ? ",nodev" : "",
bsdlabel[i].pi_flags & PIF_NODEVMTIME ? ",nodevmtime" : "",
bsdlabel[i].pi_flags & PIF_NOEXEC ? ",noexec" : "",
bsdlabel[i].pi_flags & PIF_NOSUID ? ",nosuid" : "",
bsdlabel[i].pi_flags & PIF_SOFTDEP ? ",softdep" : "",
dump_freq, fsck_pass);
}

@ -1,4 +1,4 @@
/* $NetBSD: label.c,v 1.39 2003/08/09 21:36:27 dsl Exp $ */
/* $NetBSD: label.c,v 1.40 2003/08/10 14:51:49 dsl Exp $ */
/*
* Copyright 1997 Jonathan Stone
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: label.c,v 1.39 2003/08/09 21:36:27 dsl Exp $");
__RCSID("$NetBSD: label.c,v 1.40 2003/08/10 14:51:49 dsl Exp $");
#endif
#include <sys/types.h>
@ -471,8 +471,14 @@ set_ptn_label(menudesc *m, int opt, void *arg)
wprintw(m->mw, "async ");
if (p->pi_flags & PIF_NOATIME)
wprintw(m->mw, "noatime ");
if (p->pi_flags & PIF_NODEV)
wprintw(m->mw, "nodev ");
if (p->pi_flags & PIF_NODEVMTIME)
wprintw(m->mw, "nodevmtime ");
if (p->pi_flags & PIF_NOEXEC)
wprintw(m->mw, "noexec ");
if (p->pi_flags & PIF_NOSUID)
wprintw(m->mw, "nosuid ");
if (p->pi_flags & PIF_SOFTDEP)
wprintw(m->mw, "softdep ");
break;

@ -1,4 +1,4 @@
/* $NetBSD: mbr.c,v 1.50 2003/07/27 07:45:08 dsl Exp $ */
/* $NetBSD: mbr.c,v 1.51 2003/08/10 14:51:49 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -83,6 +83,10 @@
#define NO_BOOTMENU (-0x100)
#define MAXCYL 1023 /* Possibly 1024 */
#define MAXHEAD 255 /* Possibly 256 */
#define MAXSECTOR 63
struct part_id {
int id;
const char *name;
@ -1461,17 +1465,15 @@ convert_mbr_chs(int cyl, int head, int sec,
{
unsigned int tcyl, temp, thead, tsec;
temp = cyl * head * sec - 1;
if (relsecs >= temp)
relsecs = temp;
temp = head * sec;
tcyl = relsecs / temp;
relsecs -= tcyl * temp;
relsecs %= temp;
thead = relsecs / sec;
tsec = relsecs - thead * sec + 1;
tsec = (relsecs % sec) + 1;
if (tcyl > MAXCYL)
tcyl = MAXCYL;
*cylp = MBR_PUT_LSCYL(tcyl);
*headp = thead;
@ -1488,10 +1490,6 @@ convert_mbr_chs(int cyl, int head, int sec,
* device.
*/
#define MAXCYL 1023 /* Possibly 1024 */
#define MAXHEAD 255 /* Possibly 256 */
#define MAXSECTOR 63
int
guess_biosgeom_from_mbr(mbr_info_t *mbri, int *cyl, int *head, int *sec)
{

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi,v 1.11 2003/08/05 13:35:27 dsl Exp $ */
/* $NetBSD: menus.mi,v 1.12 2003/08/10 14:51:49 dsl Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -119,13 +119,19 @@ menu selfsize, title MSG_Select_file_system_fragment_size, y=11, x=40;
option "16384", exit, action { set_fsize(arg, 16384); };
option "32768", exit, action { set_fsize(arg, 32768); };
menu mountoptions, title MSG_toggle, y=6, x= 20, exitstring MSG_unchanged;
menu mountoptions, title MSG_toggle, y=5, x=30, exitstring MSG_unchanged;
option "async", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_ASYNC; };
option "noatime", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_NOATIME; };
option "nodev", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_NODEV; };
option "nodevmtime", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_NODEVMTIME; };
option "noexec", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_NOEXEC; };
option "nosuid", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_NOSUID; };
option "softdep", exit, action
{ ((partinfo *)arg)->pi_flags ^= PIF_SOFTDEP; };