diff options
author | Brandon Low <lostlogic@gentoo.org> | 2004-02-12 22:10:28 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@gentoo.org> | 2004-02-12 22:10:28 +0000 |
commit | cab55a5d90a398060b61437ea330150458cdd443 (patch) | |
tree | 3deb18a31f575db8e3ff41a3b266fec7b97bdd56 /sys-fs/reiserfsprogs | |
parent | added missing deps (diff) | |
download | historical-cab55a5d90a398060b61437ea330150458cdd443.tar.gz historical-cab55a5d90a398060b61437ea330150458cdd443.tar.bz2 historical-cab55a5d90a398060b61437ea330150458cdd443.zip |
Fix unable to boot due to reiserfsprogs misfiguring the ro/rw status of /
Diffstat (limited to 'sys-fs/reiserfsprogs')
-rw-r--r-- | sys-fs/reiserfsprogs/ChangeLog | 10 | ||||
-rw-r--r-- | sys-fs/reiserfsprogs/Manifest | 5 | ||||
-rw-r--r-- | sys-fs/reiserfsprogs/files/digest-reiserfsprogs-3.6.12-r1 | 1 | ||||
-rw-r--r-- | sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.12-check_root-bug | 231 | ||||
-rw-r--r-- | sys-fs/reiserfsprogs/reiserfsprogs-3.6.12-r1.ebuild | 34 |
5 files changed, 279 insertions, 2 deletions
diff --git a/sys-fs/reiserfsprogs/ChangeLog b/sys-fs/reiserfsprogs/ChangeLog index fc2caf6f5ef0..81f9e066ac28 100644 --- a/sys-fs/reiserfsprogs/ChangeLog +++ b/sys-fs/reiserfsprogs/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-fs/reiserfsprogs # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/reiserfsprogs/ChangeLog,v 1.9 2004/02/10 20:02:32 lostlogic Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/reiserfsprogs/ChangeLog,v 1.10 2004/02/12 22:10:28 lostlogic Exp $ + +*reiserfsprogs-3.6.12-r1 (12 Feb 2004) + + 12 Feb 2004; Brandon Low <lostlogic@gentoo.org> + reiserfsprogs-3.6.12-r1.ebuild, files/reiserfsprogs-3.6.12-check_root-bug: + Add a patch from Vitaly Fertman of the namesys team which properly checks the + mounted status of drives. My thanks to him for working with me on it, and to + Henning Westerholt for helping Vitaly test and whatnot *reiserfsprogs-3.6.12 (10 Feb 2004) diff --git a/sys-fs/reiserfsprogs/Manifest b/sys-fs/reiserfsprogs/Manifest index 503bb0e00ffb..02e3f9e8cef4 100644 --- a/sys-fs/reiserfsprogs/Manifest +++ b/sys-fs/reiserfsprogs/Manifest @@ -1,11 +1,12 @@ MD5 7c8a37bf85245fcf45221a98060d44d0 reiserfsprogs-3.6.12.ebuild 793 MD5 b4570aedce9a96d0a4d56b5c3862cd39 reiserfsprogs-3.6.9.ebuild 806 MD5 332831ecaa175074e761e64e7a280562 reiserfsprogs-3.6.4-r1.ebuild 1345 +MD5 60ea8fdd992c1d75aa6e904eefe27913 reiserfsprogs-3.6.12-r1.ebuild 883 MD5 4bef3863abd4e25f922f95b91d48f8a5 reiserfsprogs-3.6.11.ebuild 835 MD5 181aa987f6c90780d9db0a1a1d863c7c reiserfsprogs-3.6.8.ebuild 791 MD5 dff576738dba0df38c3f4a1716b8e23b reiserfsprogs-3.6.11-r1.ebuild 1073 MD5 6fb4588a5c08ad3418e6e49cb5aea242 reiserfsprogs-3.6.10.ebuild 796 -MD5 5e3138e9cce881a4cb2c8d2200ec4816 ChangeLog 5658 +MD5 83db94727829bebf1ffbddf94a5fa2c2 ChangeLog 6043 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 MD5 7895b3d698cdc1cc5b4aecdfc2c49e30 files/digest-reiserfsprogs-3.6.4-r1 71 MD5 b4eeb93b06e335142e6fd3984030f841 files/blk_size.patch 1254 @@ -15,6 +16,8 @@ MD5 b629f9fda4c59bc96a8606649751964b files/digest-reiserfsprogs-3.6.9 71 MD5 69ece3a13ceb67d23ad84f8578b83dff files/reiserfsprogs-3.6.11-2.6.patch 574 MD5 989813ab05fd2ad4954bf998811d9a29 files/reiserfsprogs-3.6.4-bitops.patch 1278 MD5 c29a2b313930bcc6a2c0fba4354c0520 files/digest-reiserfsprogs-3.6.11-r1 72 +MD5 232aa13ef642676a3979b9d794536e41 files/digest-reiserfsprogs-3.6.12-r1 72 MD5 5e0eb61e5ed2aacbd317342fc3acfb7b files/digest-reiserfsprogs-3.6.10 72 MD5 c29a2b313930bcc6a2c0fba4354c0520 files/digest-reiserfsprogs-3.6.11 72 MD5 232aa13ef642676a3979b9d794536e41 files/digest-reiserfsprogs-3.6.12 72 +MD5 617a3648008a53096dc4eec756d9facd files/reiserfsprogs-3.6.12-check_root-bug 7949 diff --git a/sys-fs/reiserfsprogs/files/digest-reiserfsprogs-3.6.12-r1 b/sys-fs/reiserfsprogs/files/digest-reiserfsprogs-3.6.12-r1 new file mode 100644 index 000000000000..b9f10eaf5659 --- /dev/null +++ b/sys-fs/reiserfsprogs/files/digest-reiserfsprogs-3.6.12-r1 @@ -0,0 +1 @@ +MD5 8b7ea8ac43626aaf8d1deec2863732ba reiserfsprogs-3.6.12.tar.gz 373074 diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.12-check_root-bug b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.12-check_root-bug new file mode 100644 index 000000000000..4f2f7a024e3e --- /dev/null +++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.12-check_root-bug @@ -0,0 +1,231 @@ +# This is a BitKeeper generated diff -Nru style patch. +# +# ChangeSet +# 2004/02/12 23:28:01+03:00 vitaly@bitstream.namesys.com +# a few bugs were fixed in the mount entry detection code. +# +# reiserfsprogs/tune/tune.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +1 -1 +# +# reiserfsprogs/resize_reiserfs/resize_reiserfs.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +2 -2 +# +# reiserfsprogs/reiserfscore/reiserfslib.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +1 -1 +# +# reiserfsprogs/lib/misc.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +6 -29 +# +# reiserfsprogs/include/misc.h +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +4 -4 +# +# reiserfsprogs/fsck/main.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +11 -9 +# +# reiserfsprogs/fsck/fsck.h +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +1 -0 +# +# reiserfsprogs/debugreiserfs/unpack.c +# 2004/02/12 23:27:42+03:00 vitaly@bitstream.namesys.com +1 -1 +# +diff -Nru a/reiserfsprogs/debugreiserfs/unpack.c b/reiserfsprogs/debugreiserfs/unpack.c +--- a/reiserfsprogs/debugreiserfs/unpack.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/debugreiserfs/unpack.c Thu Feb 12 23:29:27 2004 +@@ -616,7 +616,7 @@ + /* only one non-option argument is permitted */ + print_usage_and_exit(); + +- if (misc_device_mounted(argv[optind], 0)) ++ if (misc_device_mounted(argv[optind]) > 0) + reiserfs_panic ("%s seems mounted, umount it first\n", argv[optind]); + + fd = open (argv[optind], O_RDWR | O_LARGEFILE); +diff -Nru a/reiserfsprogs/fsck/fsck.h b/reiserfsprogs/fsck/fsck.h +--- a/reiserfsprogs/fsck/fsck.h Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/fsck/fsck.h Thu Feb 12 23:29:27 2004 +@@ -408,6 +408,7 @@ + struct fsck_data { + unsigned short mode; /* check, rebuild, etc*/ + unsigned long options; ++ unsigned long mounted; + + struct rebuild_info rebuild; + struct check_info check; +diff -Nru a/reiserfsprogs/fsck/main.c b/reiserfsprogs/fsck/main.c +--- a/reiserfsprogs/fsck/main.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/fsck/main.c Thu Feb 12 23:29:27 2004 +@@ -746,10 +746,10 @@ + + mark_filesystem_consistent (fs); + clear_buffer_do_not_flush (fs->fs_super_bh); +- +- if (misc_device_mounted(fs->fs_file_name, MF_RO)) { +- reiserfs_warning(stderr, "\nThe partition is mounted ro. It is better " +- "to umount and mount it again.\n\n"); ++ ++ if (fsck_data(fs)->mounted == MF_RO) { ++ reiserfs_warning(stderr, "\nThe partition is mounted ro. It " ++ "is better to umount and mount it again.\n\n"); + ret = EXIT_REBOOT; + } + +@@ -764,18 +764,20 @@ + } + + /* check umounted or read-only mounted filesystems only */ +-void prepare_fs_for_check(reiserfs_filsys_t * fs) { ++static void prepare_fs_for_check(reiserfs_filsys_t * fs) { + /* The method could be called from auto_check already. */ + if (fs->fs_flags == O_RDWR) + return; + + reiserfs_reopen (fs, O_RDWR); + +- if (misc_device_mounted(fs->fs_file_name, 0)) { +- if (!misc_device_mounted(fs->fs_file_name, MF_RO)) { ++ fsck_data(fs)->mounted = misc_device_mounted(fs->fs_file_name); ++ ++ if (fsck_data(fs)->mounted > 0) { ++ if (fsck_data(fs)->mounted == MF_RW) { + fsck_progress ("Partition %s is mounted with write permissions, " + "cannot check it\n", fs->fs_file_name); +- reiserfs_close (fs); ++ reiserfs_close(fs); + exit(EXIT_USER); + } + +@@ -1093,7 +1095,7 @@ + stage_report (5, fs); + + if (fsck_mode(fs) != FSCK_CHECK) { +- if (misc_device_mounted(fs->fs_file_name, MF_RO)) { ++ if (misc_device_mounted(fs->fs_file_name) == MF_RO) { + reiserfs_warning(stderr, "\nThe partition is mounted ro. It is better " + "to umount and mount it again.\n\n"); + retval = EXIT_REBOOT; +diff -Nru a/reiserfsprogs/include/misc.h b/reiserfsprogs/include/misc.h +--- a/reiserfsprogs/include/misc.h Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/include/misc.h Thu Feb 12 23:29:27 2004 +@@ -35,9 +35,9 @@ + char * kdevname (int dev); + + typedef enum mount_flags { +- MF_MOUNTED = 0x1, +- MF_RO = 0x2, +- MF_RW = 0x4 ++ MF_NOT_MOUNTED = 0x0, ++ MF_RO = 0x1, ++ MF_RW = 0x2 + } mount_flags_t; + + typedef struct mount_hint { +@@ -47,7 +47,7 @@ + } mount_hint_t; + + struct mntent *misc_mntent(char *device); +-int misc_device_mounted(char *device, __u32 options); ++int misc_device_mounted(char *device); + + void misc_print_credit(FILE *out); + +diff -Nru a/reiserfsprogs/lib/misc.c b/reiserfsprogs/lib/misc.c +--- a/reiserfsprogs/lib/misc.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/lib/misc.c Thu Feb 12 23:29:27 2004 +@@ -328,46 +328,23 @@ + return (!proc && !path) ? INVAL_PTR : NULL; + } + +-static int callback_misc_mounted(char *device, __u32 options) { +- fprintf(stderr, "Could not figure out, is '%s' '%s' mounted?", +- device, options & MF_RO ? "RO" : options & MF_RW ? "RW" : ""); +- return (user_confirmed (stderr, " (Yes)", "Yes\n")); +-} +- +-int misc_device_mounted(char *device, __u32 options) { ++int misc_device_mounted(char *device) { + struct mntent *mnt; + + /* Check for the "/" first to avoid any possible problem with + reflecting the root fs info in mtab files. */ +- if (misc_root_mounted(device)) { +- if (options & MF_RO) +- return misc_file_ro(device); +- +- if (options & MF_RW) +- return !misc_file_ro(device); +- +- return 1; ++ if (misc_root_mounted(device) == 1) { ++ return misc_file_ro("/") ? MF_RO : MF_RW; + } + + /* Lookup the mount entry. */ + if ((mnt = misc_mntent(device)) == NULL) { +- return 0; ++ return MF_NOT_MOUNTED; + } else if (mnt == INVAL_PTR) { +- goto error; ++ return 0; + } + +- if (options & MF_RO) +- return hasmntopt(mnt, MNTOPT_RO) != 0; +- +- if (options & MF_RW) +- return hasmntopt(mnt, MNTOPT_RW) != 0; +- +- return 1; +- +- error: +- /* Failed to lookup in /proc/mounts and /etc/mtab. +- Check if the "/" first and ask the user then. */ +- return callback_misc_mounted(device, options); ++ return hasmntopt(mnt, MNTOPT_RO) ? MF_RO : MF_RW; + } + + char buf1 [100]; +diff -Nru a/reiserfsprogs/reiserfscore/reiserfslib.c b/reiserfsprogs/reiserfscore/reiserfslib.c +--- a/reiserfsprogs/reiserfscore/reiserfslib.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/reiserfscore/reiserfslib.c Thu Feb 12 23:29:27 2004 +@@ -1197,7 +1197,7 @@ + dev_t rdev; + + +- if (misc_device_mounted(device_name, 0)) { ++ if (misc_device_mounted(device_name) > 0) { + /* device looks mounted */ + reiserfs_warning (stderr, "'%s' looks mounted.", device_name); + check_forcing_ask_confirmation (force); +diff -Nru a/reiserfsprogs/resize_reiserfs/resize_reiserfs.c b/reiserfsprogs/resize_reiserfs/resize_reiserfs.c +--- a/reiserfsprogs/resize_reiserfs/resize_reiserfs.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/resize_reiserfs/resize_reiserfs.c Thu Feb 12 23:29:27 2004 +@@ -152,7 +152,7 @@ + } + + if (new_size < get_sb_block_count(fs->fs_ondisk_sb)) { +- if (misc_device_mounted(fs->fs_file_name, 0)) { ++ if (misc_device_mounted(fs->fs_file_name) > 0) { + reiserfs_warning (stderr, "Can't shrink filesystem on-line.\n\n"); + return 1; + } +@@ -276,7 +276,7 @@ + if (resizer_check_fs_size(fs, block_count_new)) + return 1; + +- if (misc_device_mounted(devname, 0)) { ++ if (misc_device_mounted(devname) > 0) { + reiserfs_close(fs); + error = resize_fs_online(devname, block_count_new); + reiserfs_warning(stderr, "\n\nresize_reiserfs: On-line resizing %s.\n\n", +diff -Nru a/reiserfsprogs/tune/tune.c b/reiserfsprogs/tune/tune.c +--- a/reiserfsprogs/tune/tune.c Thu Feb 12 23:29:27 2004 ++++ b/reiserfsprogs/tune/tune.c Thu Feb 12 23:29:27 2004 +@@ -467,7 +467,7 @@ + --no-journal-available has been specified by user */ + + /* make sure filesystem is not mounted */ +- if (misc_device_mounted(fs->fs_file_name, 0)) { ++ if (misc_device_mounted(fs->fs_file_name) > 0) { + /* fixme: it can not be mounted, btw */ + message ("Reiserfstune is not allowed to be run on mounted filesystem."); + reiserfs_close (fs); diff --git a/sys-fs/reiserfsprogs/reiserfsprogs-3.6.12-r1.ebuild b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.12-r1.ebuild new file mode 100644 index 000000000000..1b85fe9f2982 --- /dev/null +++ b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.12-r1.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/reiserfsprogs/reiserfsprogs-3.6.12-r1.ebuild,v 1.1 2004/02/12 22:10:28 lostlogic Exp $ + +inherit flag-o-matic eutils + +DESCRIPTION="Reiserfs Utilities" +HOMEPAGE="http://www.namesys.com/" +SRC_URI="http://www.namesys.com/pub/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64 ~mips ~ppc ~ppc64 ~arm ~sparc ~ia64 ~hppa" + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${P}-check_root-bug || die +} + +src_compile() { + filter-flags -fPIC + econf --prefix=/ || die "Failed to configure" + emake || die "Failed to compile" +} + +src_install() { + make DESTDIR="${D}" install || die "Failed to install" + dodir /usr/share + dodoc COPYING ChangeLog INSTALL README + + cd ${D} + dosym /sbin/reiserfsck /sbin/fsck.reiserfs +} |