Drop reread_partition_table binary
authorMichael Prokop <mika@grml.org>
Fri, 1 Jun 2018 14:59:48 +0000 (16:59 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 1 Jun 2018 14:59:48 +0000 (16:59 +0200)
Fails to build against recent fs.h versions:

| In file included from reread_partition_table.c:12:0:
| /usr/include/linux/fs.h:366:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__kernel_rwf_t'
|  typedef int __bitwise __kernel_rwf_t;
|                        ^~~~~~~~~~~~~~
| make[1]: *** [Makefile:24: reread_partition_table] Error 1

It's not worth any further work, partprobe(8) does the
job as well and is maintained.

compile/.gitignore
compile/Makefile
compile/reread_partition_table.c [deleted file]
debian/overrides
debian/rules
manpages/reread_partition_table.8 [deleted file]

index 7f9027d..5f8d282 100644 (file)
@@ -1,5 +1,4 @@
 align
 dpkg_not_running
-reread_partition_table
 vmware-detect
 grml-runtty
index 939d0d5..a5d42c3 100644 (file)
@@ -1,4 +1,4 @@
-PROGS = vmware-detect dpkg_not_running reread_partition_table grml-runtty
+PROGS = vmware-detect dpkg_not_running grml-runtty
 
 #ifndef CFLAGS
 CFLAGS = -O2 -Wall -s
@@ -20,9 +20,6 @@ vmware-detect: vmware-detect.c
 dpkg_not_running: dpkg_not_running.c
        diet $(CC) $(CFLAGS) -o $@ $^
 
-reread_partition_table: reread_partition_table.c
-       diet $(CC) $(CFLAGS) -o $@ $^
-
 grml-runtty: grml-runtty.c
        diet $(CC) $(CFLAGS) -o $@ $^ -lcompat
 
diff --git a/compile/reread_partition_table.c b/compile/reread_partition_table.c
deleted file mode 100644 (file)
index 90f83a2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Filename:      reread_partition_table.c
- * Purpose:       re-read partition table on Linux
- * Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
- * Bug-Reports:   see http://grml.org/bugs/
- * License:       This file is licensed under the GPL v2.
- *******************************************************************************/
-
-// diet gcc -s -Os -o reread_partition_table reread_partition_table.c
-
-#include <fcntl.h>
-#include <linux/fs.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-void usage()
-{
-  printf("Usage: reread_partition_table <device>\n");
-}
-
-int reread_partition_table(char *dev)
-{
-  int fd;
-
-  sync();
-
-  if ((fd = open(dev, O_RDONLY)) < 0) {
-    perror("error opening device");
-    return(1);
-  }
-
-  if (ioctl(fd, BLKRRPART) < 0) {
-    perror("unable to reload partition table");
-    return(1);
-  }
-  else {
-    printf("successfully reread partition table\n");
-    return(0);
-  }
-}
-
-int main(int argc, char** argv)
-{
-  if (getuid() != 0){
-    printf("Error: reread_partition_table requires root permissions\n");
-    exit(1);
-  }
-
-  if (argc < 2) {
-    usage();
-    exit(1);
-  }
-  else {
-    if (strncmp(argv[1], "/dev/", 5) != 0) {
-      printf("Invalid argument.\n");
-      usage();
-      exit(1);
-    }
-    reread_partition_table(argv[1]);
-  }
-  return EXIT_SUCCESS;
-}
-
-/* END OF FILE ****************************************************************/
index f541c13..1785ad1 100644 (file)
@@ -1,4 +1,3 @@
 grml-scripts: script-with-language-extension usr/bin/notifyd.py
 grml-scripts: statically-linked-binary usr/bin/vmware-detect
 grml-scripts: statically-linked-binary usr/sbin/dpkg_not_running
-grml-scripts: statically-linked-binary usr/sbin/reread_partition_table
index bba8a48..b5632fe 100755 (executable)
@@ -41,7 +41,6 @@ install: build
        cp -a usr_share/*       debian/grml-scripts/usr/share/grml-scripts/
        install -m 755 compile/vmware-detect          debian/grml-scripts/usr/bin/vmware-detect
        install -m 755 compile/dpkg_not_running       debian/grml-scripts/usr/sbin/dpkg_not_running
-       install -m 755 compile/reread_partition_table debian/grml-scripts/usr/sbin/reread_partition_table
        install -m 755 compile/grml-runtty            debian/grml-scripts/sbin/grml-runtty
 
 # Build architecture-independent files here.
diff --git a/manpages/reread_partition_table.8 b/manpages/reread_partition_table.8
deleted file mode 100644 (file)
index 8428184..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH reread_partition_table 8
-.SH "NAME"
-reread_partition_table \- re-read partition table on Linux
-.SH SYNOPSIS
-.B reread_partition_table
-.RI " <partition> "
-.SH DESCRIPTION
-This manual page documents briefly the
-.B reread_partition_table
-command. reread_partition_table uses the BLKRRPART ioctl()
-to re-read a partition table on Linux. It is the same as
-running 'blockdev \-\-rereadpt <device>' or 'partprobe'.
-.SH OPTIONS
-This program does not support any options.
-.SH USAGE EXAMPLE
-.TP
-.B reread_partition_table /dev/hda
-Reread partition table for disk /dev/hda.
-.SH SEE ALSO
-.BR cfdisk (8).
-.SH AUTHOR
-reread_partition_table was written by Michael Prokop
-<mika@grml.org>.
-.PP
-This manual page was written by Michael Prokop <mika@grml.org>
-for the grml project (but may be used by others).