summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStepan Kasal2007-05-15 21:57:10 +0200
committerKarel Zak2007-05-16 13:22:39 +0200
commit8ceadc24da05133dfbf2ad9ec1d520605e27f01c (patch)
tree961ebc0c2b5a997a4034ebbbb9be27872f53ea18
parentbuild-sys: add AC_GNU_SOURCE (diff)
downloadkernel-qcow2-util-linux-8ceadc24da05133dfbf2ad9ec1d520605e27f01c.tar.gz
kernel-qcow2-util-linux-8ceadc24da05133dfbf2ad9ec1d520605e27f01c.tar.xz
kernel-qcow2-util-linux-8ceadc24da05133dfbf2ad9ec1d520605e27f01c.zip
mount: kill mount_guess_rootdev
It's not used. Signed-off-by: Stepan Kasal <skasal@redhat.com>
-rw-r--r--mount/Makefile.am3
-rw-r--r--mount/mount.c1
-rw-r--r--mount/mount_guess_rootdev.c96
-rw-r--r--mount/mount_guess_rootdev.h1
-rw-r--r--po/POTFILES.in1
5 files changed, 1 insertions, 101 deletions
diff --git a/mount/Makefile.am b/mount/Makefile.am
index 96ecc3238..1808930de 100644
--- a/mount/Makefile.am
+++ b/mount/Makefile.am
@@ -9,8 +9,7 @@ man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
MNTHDRS = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \
mount_paths.h get_label_uuid.h lomount.h mount_blkid.h \
mount_guess_fstype.h realpath.h xmalloc.h \
- getusername.h loop.h mount_by_label.h mount_guess_rootdev.h \
- sundries.h
+ getusername.h loop.h mount_by_label.h sundries.h
mount_common = fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
lomount.c $(MNTHDRS) ../lib/env.c
diff --git a/mount/mount.c b/mount/mount.c
index 5058a7ec7..da210fb5b 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -38,7 +38,6 @@
#include "lomount.h"
#include "loop.h"
#include "linux_fs.h" /* for BLKGETSIZE */
-#include "mount_guess_rootdev.h"
#include "mount_guess_fstype.h"
#include "mount_by_label.h"
#include "getusername.h"
diff --git a/mount/mount_guess_rootdev.c b/mount/mount_guess_rootdev.c
deleted file mode 100644
index c0f0f5034..000000000
--- a/mount/mount_guess_rootdev.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Having the wrong rootdevice listed in mtab is slightly inconvenient.
- * Try to guess what it could be...
- * In case /proc/cmdline exists, and has the format
- * stuff root=R more stuff...
- * and we think we understand the number R, decode it as a root device.
- *
- * Another possibility:
- * Erik Andersen writes:
- * I did a similar find_real_root_device_name() in busybox some time back.
- * Basically, do a stat("/", &rootstat) then walk /dev stat'ing each file
- * and if (statbuf.st_rdev == rootstat.st_rdev) then you have a match.
- * Works fine.
- */
-#include <stdio.h>
-#include <string.h>
-#include "mount_guess_rootdev.h"
-
-#define PROC_CMDLINE "/proc/cmdline"
-
-static char *
-rootdev(char *p) {
- unsigned long devno;
- char *ep;
- char *type = "hd";
- char let;
- int ma, mi;
- char devname[32];
-
- devno = strtoul(p, &ep, 16);
- if ((ep == p+3 || ep == p+4) && (*ep == ' ' || *ep == 0)) {
- ma = (devno >> 8);
- mi = (devno & 0xff);
- switch(ma) {
- case 8:
- type = "sd";
- let = 'a'+(mi/16);
- mi = mi%16;
- break;
- case 3:
- let = 'a'; break;
- case 0x16:
- let = 'c'; break;
- case 0x21:
- let = 'e'; break;
- case 0x22:
- let = 'g'; break;
- case 0x38:
- let = 'i'; break;
- case 0x39:
- let = 'k'; break;
- default:
- return NULL;
- }
- if (mi & 0x40) {
- mi -= 0x40;
- let++;
- }
- if (mi == 0)
- sprintf(devname, "/dev/%s%c", type, let);
- else
- sprintf(devname, "/dev/%s%c%d", type, let, mi);
- return xstrdup(devname);
- }
- return NULL;
-}
-
-char *
-mount_guess_rootdev() {
- FILE *cf;
- char line[1024];
- char *p, *ret = NULL;
-
- cf = fopen(PROC_CMDLINE, "r");
- if (cf) {
- if (fgets(line, sizeof(line), cf)) {
- for (p = line; *p; p++) {
- if (!strncmp(p, " root=", 6)) {
- ret = rootdev(p+6);
- break;
- }
- }
- }
- fclose(cf);
- }
- return ret;
-}
-
-#if 0
-main(){
- char *p = mount_guess_rootdev();
- if (!p)
- p = "/dev/root";
- printf("%s\n", p);
-}
-#endif
diff --git a/mount/mount_guess_rootdev.h b/mount/mount_guess_rootdev.h
deleted file mode 100644
index 41b327037..000000000
--- a/mount/mount_guess_rootdev.h
+++ /dev/null
@@ -1 +0,0 @@
-extern char *mount_guess_rootdev(void);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6799f76a6..c26153d7f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -68,7 +68,6 @@ mount/mount_blkid.c
mount/mount_by_label.c
mount/mount.c
mount/mount_guess_fstype.c
-mount/mount_guess_rootdev.c
mount/mount_mntent.c
mount/pivot_root.c
mount/realpath.c