Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Revert version 1.111 of sysinst/disks.c, which caused sysins...
details: https://anonhg.NetBSD.org/src/rev/ce8496941619
branches: trunk
changeset: 330507:ce8496941619
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Jul 12 16:11:27 2014 +0000
description:
Revert version 1.111 of sysinst/disks.c, which caused sysinst to
create lfs fstab entries with fsck disabled, and instead patch
fsck_lfs to exit successfully without doing anything when given the -p
(bootup preen) option. If you really want to do fsck_lfs -p, you can
do fsck_lfs -f -p to make it go.
This has been sitting in my todo queue since February 2010 and was
ok'd by the committer at the time. The original commit was based on
this post:
http://mail-index.netbsd.org/tech-kern/2010/02/09/msg007306.html
and I remain unconvinced that it's the right thing, but we can at
least do it properly and not ship a sysinst with -7 that creates
permanently wrong fstab files.
Note that this may cause problems for anyone who's taken -p out of the
bootup fsck flags; but doing that is wrong, so don't.
diffstat:
distrib/utils/sysinst/disks.c | 7 ++-----
sbin/fsck_lfs/fsck_lfs.8 | 7 ++++---
sbin/fsck_lfs/main.c | 29 ++++++++++++++++++++++++++++-
3 files changed, 34 insertions(+), 9 deletions(-)
diffs (114 lines):
diff -r 02e356c4b9b9 -r ce8496941619 distrib/utils/sysinst/disks.c
--- a/distrib/utils/sysinst/disks.c Sat Jul 12 15:51:56 2014 +0000
+++ b/distrib/utils/sysinst/disks.c Sat Jul 12 16:11:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.130 2013/12/07 20:40:42 martin Exp $ */
+/* $NetBSD: disks.c,v 1.131 2014/07/12 16:11:27 dholland Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -772,10 +772,7 @@
if (!check_lfs_progs())
s = "# ";
fstype = "lfs";
- /* XXX fsck_lfs considered harmfull */
- fsck_pass = 0;
- dump_freq = 1;
- break;
+ /* FALLTHROUGH */
case FS_BSDFFS:
fsck_pass = (strcmp(mp, "/") == 0) ? 1 : 2;
dump_freq = 1;
diff -r 02e356c4b9b9 -r ce8496941619 sbin/fsck_lfs/fsck_lfs.8
--- a/sbin/fsck_lfs/fsck_lfs.8 Sat Jul 12 15:51:56 2014 +0000
+++ b/sbin/fsck_lfs/fsck_lfs.8 Sat Jul 12 16:11:27 2014 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: fsck_lfs.8,v 1.24 2014/03/18 18:20:38 riastradh Exp $
+.\" $NetBSD: fsck_lfs.8,v 1.25 2014/07/12 16:11:27 dholland Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
.\"
-.Dd October 9, 2008
+.Dd July 12, 2014
.Dt FSCK_LFS 8
.Os
.Sh NAME
@@ -134,7 +134,8 @@
mode.
Currently, in this mode
.Nm
-rolls forward from the older checkpoint, and performs no other action.
+does nothing.
+.\" rolls forward from the older checkpoint, and performs no other action.
.It Fl q
Quiet mode, do not output any messages for clean filesystems.
.It Fl U
diff -r 02e356c4b9b9 -r ce8496941619 sbin/fsck_lfs/main.c
--- a/sbin/fsck_lfs/main.c Sat Jul 12 15:51:56 2014 +0000
+++ b/sbin/fsck_lfs/main.c Sat Jul 12 16:11:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.45 2013/06/08 02:16:03 dholland Exp $ */
+/* $NetBSD: main.c,v 1.46 2014/07/12 16:11:27 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -35,6 +35,7 @@
#include <ufs/lfs/lfs.h>
#include <fstab.h>
+#include <stdbool.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -73,7 +74,9 @@
int ch;
int ret = FSCK_EXIT_OK;
const char *optstring = "b:dfi:m:npPqUy";
+ bool reallypreen;
+ reallypreen = false;
ckfinish = ckfini;
skipclean = 1;
exitonfail = 0;
@@ -95,6 +98,7 @@
break;
case 'f':
skipclean = 0;
+ reallypreen = true;
break;
case 'i':
idaddr = strtol(optarg, NULL, 0);
@@ -142,6 +146,29 @@
if (!argc)
usage();
+ /*
+ * Don't do anything in preen mode. This is a replacement for
+ * version 1.111 of src/distrib/utils/sysinst/disks.c, which
+ * disabled fsck on installer-generated lfs partitions. That
+ * isn't the right way to do it; better to run fsck but have
+ * it not do anything, so that when the issues in fsck get
+ * resolved it can be turned back on.
+ *
+ * If you really want to run fsck in preen mode you can do:
+ * fsck_lfs -p -f image
+ *
+ * This was prompted by
+ * http://mail-index.netbsd.org/tech-kern/2010/02/09/msg007306.html.
+ *
+ * It would be nice if someone prepared a more detailed report
+ * of the problems.
+ *
+ * XXX.
+ */
+ if (preen && !reallypreen) {
+ return ret;
+ }
+
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
(void) signal(SIGINT, catch);
if (preen)
Home |
Main Index |
Thread Index |
Old Index