align
dpkg_not_running
-reread_partition_table
vmware-detect
grml-runtty
-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
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
+++ /dev/null
-/*
- * 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 ****************************************************************/
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
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.
+++ /dev/null
-.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).