SUBDIRS = \
$(MAN_DIRS) \
- fdisk \
po
RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
include sys-utils/Makemodule.am
include misc-utils/Makemodule.am
include disk-utils/Makemodule.am
+include fdisks/Makemodule.am
include tests/Makemodule.am
AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),
[], with_slang=no
)
-
-have_tinfo=no
-AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
-AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
-
-use_slang=no
+have_slang=no
if test "x$with_slang" = xyes; then
AC_CHECK_HEADERS([slang.h slang/slang.h])
AC_CHECK_HEADERS([slcurses.h slang/slcurses.h],
- [use_slang=yes], [], [
+ [have_slang=yes], [], [
#ifdef HAVE_SLANG_H
#include <slang.h>
#elif defined(HAVE_SLANG_SLANG_H)
#include <slang/slang.h>
#endif
])
- if test "x$use_slang" = xno; then
+ if test "x$have_slang" = xno; then
AC_MSG_ERROR([slang selected but slcurses.h not found])
fi
fi
-AM_CONDITIONAL(USE_SLANG, test "x$use_slang" = xyes)
+AM_CONDITIONAL(HAVE_SLANG, test "x$have_slang" = xyes)
+
+
+if test "x$have_slang" = xyes -o "x$have_ncurses" = xyes; then
+ AM_CONDITIONAL(BUILD_CFDISK, true)
+fi
+
+
+have_tinfo=no
+AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
+AM_CONDITIONAL(HAVE_TINFO, test "x$have_tinfo" = xyes)
AC_ARG_WITH([utempter],
AC_CONFIG_FILES([
Makefile
-fdisk/Makefile
libblkid/blkid.pc
libblkid/docs/Makefile
libblkid/docs/version.xml
+++ /dev/null
-include $(top_srcdir)/config/include-Makefile.am
-
-fdisk_common = \
- common.h \
- gpt.c \
- gpt.h \
- i386_sys_types.c \
- $(top_srcdir)/lib/blkdev.c \
- $(top_srcdir)/lib/mbsalign.c \
- $(top_srcdir)/lib/strutils.c \
- $(top_srcdir)/lib/randutils.c \
- $(top_srcdir)/lib/wholedisk.c
-
-if LINUX
-fdisk_common += $(top_srcdir)/lib/linux_version.c
-endif
-
-if !ARCH_M68K
-
-sbin_PROGRAMS = fdisk
-dist_man_MANS = fdisk.8
-fdisk_SOURCES = \
- utils.c \
- fdisk.c \
- fdisk.h \
- fdiskaixlabel.c \
- fdiskaixlabel.h \
- fdiskbsdlabel.c \
- fdiskbsdlabel.h \
- fdiskmaclabel.c \
- fdiskmaclabel.h \
- fdisksgilabel.c \
- fdisksgilabel.h \
- fdisksunlabel.c \
- fdisksunlabel.h \
- fdiskdoslabel.c \
- fdiskdoslabel.h \
- partname.c \
- $(fdisk_common) \
- $(top_srcdir)/lib/canonicalize.c
-
-cflags_blkid = $(AM_CFLAGS)
-ldadd_blkid =
-
-if BUILD_LIBBLKID
-ldadd_blkid += $(ul_libblkid_la)
-cflags_blkid += -I$(ul_libblkid_incdir)
-endif
-
-if HAVE_STATIC_FDISK
-sbin_PROGRAMS += fdisk.static
-fdisk_static_SOURCES = $(fdisk_SOURCES)
-fdisk_static_LDFLAGS = -all-static
-fdisk_static_CFLAGS = $(cflags_blkid)
-fdisk_static_LDADD = $(ldadd_blkid)
-endif
-
-fdisk_CFLAGS = $(cflags_blkid)
-fdisk_LDADD = $(ldadd_blkid)
-
-if !ARCH_SPARC
-
-sbin_PROGRAMS += sfdisk
-dist_man_MANS += sfdisk.8
-sfdisk_SOURCES = \
- partname.c \
- sfdisk.c \
- $(fdisk_common) \
- $(top_srcdir)/lib/canonicalize.c
-
-if HAVE_STATIC_SFDISK
-sbin_PROGRAMS += sfdisk.static
-sfdisk_static_SOURCES = $(sfdisk_SOURCES)
-sfdisk_static_LDFLAGS = -all-static
-endif
-
-if USE_SLANG
-sbin_PROGRAMS += cfdisk
-dist_man_MANS += cfdisk.8
-cfdisk_SOURCES = cfdisk.c $(fdisk_common)
-cfdisk_CFLAGS = $(cflags_blkid)
-cfdisk_LDADD = -lslang $(ldadd_blkid)
-else
-if HAVE_NCURSES
-sbin_PROGRAMS += cfdisk
-dist_man_MANS += cfdisk.8
-cfdisk_SOURCES = cfdisk.c $(fdisk_common)
-cfdisk_CFLAGS = $(cflags_blkid)
-cfdisk_LDADD = @NCURSES_LIBS@ $(ldadd_blkid)
-endif
-endif
-
-endif # !ARCH_SPARC
-endif # !ARCH_M68K
--- /dev/null
+
+fdisk_common_sources = \
+ fdisks/common.h \
+ fdisks/gpt.c \
+ fdisks/gpt.h \
+ fdisks/i386_sys_types.c \
+ lib/blkdev.c \
+ lib/mbsalign.c \
+ lib/strutils.c \
+ lib/randutils.c \
+ lib/wholedisk.c
+
+if LINUX
+fdisk_common_sources += lib/linux_version.c
+endif
+
+if !ARCH_M68K
+
+sbin_PROGRAMS += fdisk
+dist_man_MANS += fdisks/fdisk.8
+fdisk_SOURCES = \
+ fdisks/utils.c \
+ fdisks/fdisk.c \
+ fdisks/fdisk.h \
+ fdisks/fdiskaixlabel.c \
+ fdisks/fdiskaixlabel.h \
+ fdisks/fdiskbsdlabel.c \
+ fdisks/fdiskbsdlabel.h \
+ fdisks/fdiskmaclabel.c \
+ fdisks/fdiskmaclabel.h \
+ fdisks/fdisksgilabel.c \
+ fdisks/fdisksgilabel.h \
+ fdisks/fdisksunlabel.c \
+ fdisks/fdisksunlabel.h \
+ fdisks/fdiskdoslabel.c \
+ fdisks/fdiskdoslabel.h \
+ fdisks/partname.c \
+ $(fdisk_common_sources) \
+ lib/canonicalize.c
+
+if BUILD_LIBBLKID
+fdisk_CFLAGS = -I$(ul_libblkid_incdir)
+fdisk_LDADD = libblkid.la
+endif
+
+if HAVE_STATIC_FDISK
+sbin_PROGRAMS += fdisk.static
+fdisk_static_SOURCES = $(fdisk_SOURCES)
+fdisk_static_LDFLAGS = -all-static
+fdisk_static_CFLAGS = $(fdisk_CFLAGS)
+fdisk_static_LDADD = $(fdisk_LDADD)
+endif
+
+
+if !ARCH_SPARC
+
+sbin_PROGRAMS += sfdisk
+dist_man_MANS += fdisks/sfdisk.8
+sfdisk_SOURCES = \
+ fdisks/partname.c \
+ fdisks/sfdisk.c \
+ $(fdisk_common_sources) \
+ lib/canonicalize.c
+
+if HAVE_STATIC_SFDISK
+sbin_PROGRAMS += sfdisk.static
+sfdisk_static_SOURCES = $(sfdisk_SOURCES)
+sfdisk_static_LDFLAGS = -all-static
+endif
+
+
+if BUILD_CFDISK
+sbin_PROGRAMS += cfdisk
+dist_man_MANS += fdisks/cfdisk.8
+cfdisk_SOURCES = fdisks/cfdisk.c $(fdisk_common_sources)
+cfdisk_CFLAGS =
+cfdisk_LDADD =
+
+if BUILD_LIBBLKID
+cfdisk_CFLAGS += -I$(ul_libblkid_incdir)
+cfdisk_LDADD += libblkid.la
+endif
+
+if HAVE_SLANG
+cfdisk_LDADD += -lslang
+else
+if HAVE_NCURSES
+cfdisk_LDADD += @NCURSES_LIBS@
+endif
+endif
+endif # BUILD_CFDISK
+
+endif # !ARCH_SPARC
+endif # !ARCH_M68K
/*
Changes:
Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- Internationalization
+ Internationalization
*/
#include <stdio.h> /* stderr */
#include <string.h> /* strstr */
NetBSD disklabel editor for Linux fdisk
Written by Bernhard Fastenrath (fasten@informatik.uni-bonn.de)
with code from the NetBSD disklabel command:
-
+
Copyright (c) 1987, 1988 Regents of the University of California.
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
- This product includes software developed by the University of
- California, Berkeley and its contributors.
+ This product includes software developed by the University of
+ California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
fprintf(f, " %5ld %5ld %5.5s ",
(long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag, "");
break;
-
+
case BSD_FS_BSDFFS:
fprintf(f, " %5ld %5ld %5d ",
(long) pp->p_fsize, (long) pp->p_fsize * pp->p_frag,
pp->p_cpg);
break;
-
+
default:
fprintf(f, "%22.22s", "");
break;
}
while (!isdigit (*line_ptr));
return atoi (line_ptr);
-}
+}
static void
xbsd_edit_disklabel (void)
xbsd_dkcksum (struct xbsd_disklabel *lp) {
unsigned short *start, *end;
unsigned short sum = 0;
-
+
start = (unsigned short *) lp;
end = (unsigned short *) &lp->d_partitions[lp->d_npartitions];
while (start < end)
the whole disk */
pp -> p_offset = 0;
pp -> p_size = d -> d_secperunit;
- pp -> p_fstype = BSD_FS_UNUSED;
+ pp -> p_fstype = BSD_FS_UNUSED;
#endif
return 1;
for (t = d -> d_npartitions; t < BSD_MAXPARTITIONS; t++) {
d -> d_partitions[t].p_size = 0;
d -> d_partitions[t].p_offset = 0;
- d -> d_partitions[t].p_fstype = BSD_FS_UNUSED;
+ d -> d_partitions[t].p_fstype = BSD_FS_UNUSED;
}
if (d -> d_npartitions > BSD_MAXPARTITIONS)
{
u_int64_t *dp, sum;
int i;
-
+
dp = (u_int64_t *)boot;
sum = 0;
for (i = 0; i < 63; i++)
int16_t d_type; /* drive type */
int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
- char d_packname[16]; /* pack identifier */
+ char d_packname[16]; /* pack identifier */
/* disk geometry: */
uint32_t d_secsize; /* # of bytes per sector */
uint32_t d_nsectors; /* # of data sectors per track */
mac_nolabel(cxt); /* %% */
return 1;
}
-
extern int check_mac_label(struct fdisk_context *cxt);
#endif /* FDISK_MAC_LABEL_H */
-
/* flags */ (sgi_get_bootpartition(cxt) == i) ? "boot" : " ",
/* start */ (long) scround(start),
/* end */ (long) scround(start+len)-1,
-/* no odd flag on end */ (long) len,
+/* no odd flag on end */ (long) len,
/* type id */ sgi_get_sysid(cxt, i),
/* type name */ (type = partition_type(sgi_get_sysid(cxt, i)))
? type : _("Unknown"));
sgi_write_table(struct fdisk_context *cxt) {
sgilabel->csum = 0;
sgilabel->csum = SSWAP32(two_s_complement_32bit_sum(
- (unsigned int*)sgilabel,
+ (unsigned int*)sgilabel,
sizeof(*sgilabel)));
assert(two_s_complement_32bit_sum(
(unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
last = read_int(cxt, scround(first), scround(last)-1, scround(last)-1,
scround(first), mesg)+1;
if (display_in_cyl_units)
- last *= units_per_sector;
- /*else
+ last *= units_per_sector;
+ /*else
last = last; * align to cylinder if You know how ... */
if ((sys == SGI_VOLUME) && (first != 0 || last != sgi_get_lastblock(cxt)))
printf(_("It is highly recommended that eleventh partition\n"
(int (*)(const void *,const void *)) verify_sun_cmp);
if (array[0] == -1) {
- printf(_("No partitions defined\n"));
- return;
+ printf(_("No partitions defined\n"));
+ return;
}
stop = cxt->geom.cylinders * cxt->geom.heads * cxt->geom.sectors;
if (starts[array[0]])
struct sun_tag_flag *tag = &sunlabel->part_tags[n];
uint32_t start, stop, stop2;
int whole_disk = 0;
-
+
char mesg[256];
int i;
unsigned int first, last;
"it before re-adding it.\n"), n + 1);
return;
}
-
+
fetch_sun(cxt, starts, lens, &start, &stop);
+
if (stop <= start) {
if (n == 2)
whole_disk = 1;
extern int gpt_probe_signature_devname(char *devname);
#endif /* FDISK_GPT_H */
-