]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: no more AIX "support"
authorKarel Zak <kzak@redhat.com>
Tue, 12 Mar 2013 10:37:33 +0000 (11:37 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Mar 2013 10:37:33 +0000 (11:37 +0100)
The whole AIX support in fdisk has been limited to pretty poor AIX
magic string detection and warning that the AIX is unsupported. It's
too expensive to maintain such fdisk driver.

Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/Makemodule.am
fdisks/fdisk.c
fdisks/fdiskaixlabel.c [deleted file]
fdisks/fdiskaixlabel.h [deleted file]
fdisks/fdiskdoslabel.c
libfdisk/src/ask.c
libfdisk/src/context.c
libfdisk/src/fdiskP.h
libfdisk/src/libfdisk.h

index f9488c2211e89efb1f5bdbbe824fd41685b036d2..b17267ff4f7e09be80c44c165cc2d3a5ab22c8f2 100644 (file)
@@ -8,8 +8,6 @@ fdisk_SOURCES = \
        fdisks/fdisk.c \
        fdisks/fdisk.h \
        fdisks/fdisk-ask.c \
-       fdisks/fdiskaixlabel.c \
-       fdisks/fdiskaixlabel.h \
        fdisks/fdiskbsdlabel.c \
        fdisks/fdiskbsdlabel.h \
        fdisks/fdiskdoslabel.c \
index ade91a57c9461bd79a51ed318688cb27bd266341..1db4639e61fda37a575788c74468591c3fc2513e 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "fdisksunlabel.h"
 #include "fdisksgilabel.h"
-#include "fdiskaixlabel.h"
 #include "fdiskmaclabel.h"
 #include "fdiskdoslabel.h"
 #include "fdiskbsdlabel.h"
diff --git a/fdisks/fdiskaixlabel.c b/fdisks/fdiskaixlabel.c
deleted file mode 100644 (file)
index 3c2c637..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-  Changes:
-  Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
-       Internationalization
-*/
-#include <stdio.h>              /* stderr */
-#include <string.h>             /* strstr */
-#include <unistd.h>             /* write */
-
-#include <endian.h>
-
-#include "common.h"
-#include "fdisk.h"
-#include "fdiskaixlabel.h"
-#include "nls.h"
-
-static int     other_endian = 0;
-static  short  volumes=1;
-
-/*
- * in-memory fdisk AIX stuff
- */
-struct fdisk_aix_label {
-       struct fdisk_label      head;           /* generic part */
-};
-
-
-/*
- * only dealing with free blocks here
- */
-
-static void
-aix_info( void ) {
-    puts(
-       _("\n\tThere is a valid AIX label on this disk.\n"
-       "\tUnfortunately Linux cannot handle these\n"
-       "\tdisks at the moment.  Nevertheless some\n"
-       "\tadvice:\n"
-       "\t1. fdisk will destroy its contents on write.\n"
-       "\t2. Be sure that this disk is NOT a still vital\n"
-       "\t   part of a volume group. (Otherwise you may\n"
-       "\t   erase the other disks as well, if unmirrored.)\n"
-       "\t3. Before deleting this physical volume be sure\n"
-       "\t   to remove the disk logically from your AIX\n"
-       "\t   machine.  (Otherwise you become an AIXpert).")
-    );
-}
-
-static void aix_nolabel(struct fdisk_context *cxt)
-{
-    struct aix_partition *aixlabel = (struct aix_partition *) cxt->firstsector;
-
-    aixlabel->magic = 0;
-    fdisk_zeroize_firstsector(cxt);
-    return;
-}
-
-static int aix_probe_label(struct fdisk_context *cxt)
-{
-    struct aix_partition *aixlabel;
-
-    assert(cxt);
-    assert(cxt->label);
-    assert(fdisk_is_disklabel(cxt, AIX));
-
-    aixlabel = (struct aix_partition *) cxt->firstsector;
-
-    if (aixlabel->magic != AIX_LABEL_MAGIC &&
-       aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) {
-       other_endian = 0;
-       return 0;
-    }
-    other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
-    volumes = 15;
-    aix_info();
-    aix_nolabel(cxt);          /* %% */
-    return 1;
-}
-
-/* TODO: remove this, libfdisk has to return ENOSYS */
-static int aix_add_partition(
-               struct fdisk_context *cxt __attribute__((__unused__)),
-               size_t partnum __attribute__((__unused__)),
-               struct fdisk_parttype *t __attribute__((__unused__)))
-{
-       printf(_("\tSorry - this fdisk cannot handle AIX disk labels."
-                "\n\tIf you want to add DOS-type partitions, create"
-                "\n\ta new empty DOS partition table first. (Use o.)"
-                "\n\tWARNING: "
-                "This will destroy the present disk contents.\n"));
-
-       return -ENOSYS;
-}
-
-static const struct fdisk_label_operations aix_operations =
-{
-       .probe          = aix_probe_label,
-       .part_add       = aix_add_partition
-};
-
-
-/*
- * allocates AIX label driver
- */
-struct fdisk_label *fdisk_new_aix_label(struct fdisk_context *cxt)
-{
-       struct fdisk_label *lb;
-       struct fdisk_aix_label *aix;
-
-       assert(cxt);
-
-       aix = calloc(1, sizeof(*aix));
-       if (!aix)
-               return NULL;
-
-       /* initialize generic part of the driver */
-       lb = (struct fdisk_label *) aix;
-       lb->name = "aix";
-       lb->id = FDISK_DISKLABEL_AIX;
-       lb->op = &aix_operations;
-
-       return lb;
-}
diff --git a/fdisks/fdiskaixlabel.h b/fdisks/fdiskaixlabel.h
deleted file mode 100644 (file)
index d0818e7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef FDISK_AIX_LABEL_H
-#define FDISK_AIX_LABEL_H
-
-#include <stdint.h>
-/*
- * Copyright (C) Andreas Neuper, Sep 1998.
- *     This file may be redistributed under
- *     the terms of the GNU Public License.
- */
-
-struct aix_partition {
-       unsigned int   magic;        /* expect AIX_LABEL_MAGIC */
-       unsigned int   fillbytes1[124];
-       unsigned int   physical_volume_id;
-       unsigned int   fillbytes2[124];
-};
-
-#define        AIX_LABEL_MAGIC         0xc9c2d4c1
-#define        AIX_LABEL_MAGIC_SWAPPED 0xc1d4c2c9
-#define        AIX_INFO_MAGIC          0x00072959
-#define        AIX_INFO_MAGIC_SWAPPED  0x59290700
-
-#endif /* FDISK_AIX_LABEL_H */
index dc1d87b46b843be86f191519a2560aaf8c0dea86..34465ef327026d5c562a3fbe1dd7f1a90f4ee756 100644 (file)
@@ -1207,7 +1207,7 @@ int dos_list_table(struct fdisk_context *cxt,
 
        /* Is partition table in disk order? It need not be, but... */
        /* partition table entries are not checked for correct order if this
-          is a sgi, sun or aix labeled disk... */
+          is a sgi, sun labeled disk... */
        if (wrong_p_order(cxt, NULL))
                printf(_("\nPartition table entries are not in disk order\n"));
 
index 8ce9e5c340c40536aeae2cc9961c9bacde051f78..d2325d5fe07cbfa317c9e214ec115c3944c1599e 100644 (file)
@@ -531,7 +531,6 @@ int fdisk_warnx(struct fdisk_context *cxt, const char *fmt, ...)
 
 #ifdef TEST_PROGRAM
 struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt) { return NULL; }
-struct fdisk_label *fdisk_new_aix_label(struct fdisk_context *cxt) { return NULL; }
 struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt) { return NULL; }
 struct fdisk_label *fdisk_new_mac_label(struct fdisk_context *cxt) { return NULL; }
 struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt) { return NULL; }
index 814d84c4f2fb8535d800c4829f002278095abe7d..da2d5588aab0f5b6253bbab027ccf15a50309294 100644 (file)
@@ -20,7 +20,6 @@ struct fdisk_context *fdisk_new_context(void)
         */
        cxt->labels[ cxt->nlabels++ ] = fdisk_new_gpt_label(cxt);
        cxt->labels[ cxt->nlabels++ ] = fdisk_new_dos_label(cxt);
-       cxt->labels[ cxt->nlabels++ ] = fdisk_new_aix_label(cxt);
        cxt->labels[ cxt->nlabels++ ] = fdisk_new_bsd_label(cxt);
        cxt->labels[ cxt->nlabels++ ] = fdisk_new_mac_label(cxt);
        cxt->labels[ cxt->nlabels++ ] = fdisk_new_sgi_label(cxt);
index 89a96d964779616dbdd847e5f94ba45ae82e67ac..570108c93f1dbc482d2a7c84207018d150117c3c 100644 (file)
@@ -203,7 +203,6 @@ enum {
 /* label allocators */
 extern struct fdisk_label *fdisk_new_gpt_label(struct fdisk_context *cxt);
 extern struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt);
-extern struct fdisk_label *fdisk_new_aix_label(struct fdisk_context *cxt);
 extern struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt);
 extern struct fdisk_label *fdisk_new_mac_label(struct fdisk_context *cxt);
 extern struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt);
index a08a2afa55cb9fee2e8ed7923e0701b50342b9ae..0a23236ea163e51b14b3a9d82aa8165f84743775 100644 (file)
@@ -40,10 +40,9 @@ enum fdisk_labeltype {
        FDISK_DISKLABEL_DOS = 1,
        FDISK_DISKLABEL_SUN = 2,
        FDISK_DISKLABEL_SGI = 4,
-       FDISK_DISKLABEL_AIX = 8,
-       FDISK_DISKLABEL_OSF = 16,
-       FDISK_DISKLABEL_MAC = 32,
-       FDISK_DISKLABEL_GPT = 64,
+       FDISK_DISKLABEL_OSF = 8,
+       FDISK_DISKLABEL_MAC = 16,
+       FDISK_DISKLABEL_GPT = 32,
        FDISK_DISKLABEL_ANY = -1
 };