build-sys: rename fdisk -> fdisks/, convert to module
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
ac73480a34
commit
50ea679509
|
@ -28,7 +28,6 @@ MAN_DIRS = man/ru
|
|||
|
||||
SUBDIRS = \
|
||||
$(MAN_DIRS) \
|
||||
fdisk \
|
||||
po
|
||||
|
||||
RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
|
||||
|
@ -58,6 +57,7 @@ include mount-deprecated/Makemodule.am
|
|||
include sys-utils/Makemodule.am
|
||||
include misc-utils/Makemodule.am
|
||||
include disk-utils/Makemodule.am
|
||||
include fdisks/Makemodule.am
|
||||
|
||||
include tests/Makemodule.am
|
||||
|
||||
|
|
24
configure.ac
24
configure.ac
|
@ -610,27 +610,32 @@ AC_ARG_WITH([slang],
|
|||
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],
|
||||
|
@ -1290,7 +1295,6 @@ AC_CONFIG_HEADERS(config.h)
|
|||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
fdisk/Makefile
|
||||
libblkid/blkid.pc
|
||||
libblkid/docs/Makefile
|
||||
libblkid/docs/version.xml
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
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
|
|
@ -0,0 +1,94 @@
|
|||
|
||||
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
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
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 */
|
|
@ -2,10 +2,10 @@
|
|||
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:
|
||||
|
@ -16,12 +16,12 @@
|
|||
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
|
||||
|
@ -364,13 +364,13 @@ xbsd_print_disklabel (struct fdisk_context *cxt, int show_all) {
|
|||
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;
|
||||
|
@ -435,7 +435,7 @@ edit_int (int def, char *mesg)
|
|||
}
|
||||
while (!isdigit (*line_ptr));
|
||||
return atoi (line_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xbsd_edit_disklabel (void)
|
||||
|
@ -624,7 +624,7 @@ static unsigned short
|
|||
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)
|
||||
|
@ -693,7 +693,7 @@ xbsd_initlabel (struct fdisk_context *cxt, struct partition *p, struct xbsd_disk
|
|||
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;
|
||||
|
@ -730,7 +730,7 @@ xbsd_readlabel (struct fdisk_context *cxt, struct partition *p, struct xbsd_disk
|
|||
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)
|
||||
|
@ -837,7 +837,7 @@ alpha_bootblock_checksum (char *boot)
|
|||
{
|
||||
u_int64_t *dp, sum;
|
||||
int i;
|
||||
|
||||
|
||||
dp = (u_int64_t *)boot;
|
||||
sum = 0;
|
||||
for (i = 0; i < 63; i++)
|
|
@ -69,7 +69,7 @@ struct xbsd_disklabel {
|
|||
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 */
|
|
@ -80,4 +80,3 @@ IS_MAC:
|
|||
mac_nolabel(cxt); /* %% */
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -36,4 +36,3 @@ extern void mac_nolabel(struct fdisk_context *cxt);
|
|||
extern int check_mac_label(struct fdisk_context *cxt);
|
||||
|
||||
#endif /* FDISK_MAC_LABEL_H */
|
||||
|
|
@ -202,7 +202,7 @@ sgi_list_table(struct fdisk_context *cxt, int xtra) {
|
|||
/* 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"));
|
||||
|
@ -334,7 +334,7 @@ void
|
|||
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);
|
||||
|
@ -705,8 +705,8 @@ sgi_add_partition(struct fdisk_context *cxt, int n, int sys)
|
|||
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"
|
|
@ -344,8 +344,8 @@ void verify_sun(struct fdisk_context *cxt)
|
|||
(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]])
|
||||
|
@ -367,7 +367,7 @@ void add_sun_partition(struct fdisk_context *cxt, int n, int sys)
|
|||
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;
|
||||
|
@ -377,8 +377,9 @@ void add_sun_partition(struct fdisk_context *cxt, int n, int sys)
|
|||
"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;
|
|
@ -5,4 +5,3 @@ extern int gpt_probe_signature_fd(int fd);
|
|||
extern int gpt_probe_signature_devname(char *devname);
|
||||
|
||||
#endif /* FDISK_GPT_H */
|
||||
|
|
@ -46,4 +46,3 @@ partname(char *dev, int pno, int lth) {
|
|||
}
|
||||
return bufp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue