From c07e10f95b370c9e59461f6e4369cf6c2eab395e Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 1 Jun 2018 16:59:48 +0200 Subject: [PATCH] Drop reread_partition_table binary 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 | 1 - compile/Makefile | 5 +-- compile/reread_partition_table.c | 68 --------------------------------------- debian/overrides | 1 - debian/rules | 1 - manpages/reread_partition_table.8 | 26 --------------- 6 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 compile/reread_partition_table.c delete mode 100644 manpages/reread_partition_table.8 diff --git a/compile/.gitignore b/compile/.gitignore index 7f9027d..5f8d282 100644 --- a/compile/.gitignore +++ b/compile/.gitignore @@ -1,5 +1,4 @@ align dpkg_not_running -reread_partition_table vmware-detect grml-runtty diff --git a/compile/Makefile b/compile/Makefile index 939d0d5..a5d42c3 100644 --- a/compile/Makefile +++ b/compile/Makefile @@ -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 index 90f83a2..0000000 --- a/compile/reread_partition_table.c +++ /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 - * 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 -#include -#include -#include -#include -#include -#include -#include - -void usage() -{ - printf("Usage: reread_partition_table \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 ****************************************************************/ diff --git a/debian/overrides b/debian/overrides index f541c13..1785ad1 100644 --- a/debian/overrides +++ b/debian/overrides @@ -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 diff --git a/debian/rules b/debian/rules index bba8a48..b5632fe 100755 --- a/debian/rules +++ b/debian/rules @@ -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 index 8428184..0000000 --- a/manpages/reread_partition_table.8 +++ /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 " " -.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 ' 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 -. -.PP -This manual page was written by Michael Prokop -for the grml project (but may be used by others). -- 2.1.4