Add handling for SUN partition tables
PATCH 21/21 Add handling for SUN partition tables
Not that I've come across one of these disks, but it's a nice testbed for the stacked partition handling. And might even be useful at one point.
Signed-off-by Hannes Reinecke <[email protected]>
--- kpartx/Makefile | 4 +- kpartx/kpartx.c | 8 +++- kpartx/kpartx.h | 1 + kpartx/sun.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 4 deletions(-)
kpartx/Makefile +2 -2
@@ -10,11 +10,11 @@ CFLAGS += -I. -D_LARGEFILE64_SOURCE ifeq ($(strip $(BUILD)),klibc) OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o gpt.o crc32.o \ - lopart.o xstrncpy.o devmapper.o dasd.o mac.o \ + lopart.o xstrncpy.o devmapper.o dasd.o mac.o sun.o \ $(MULTIPATHLIB)-$(BUILD).a $(libdm) else LDFLAGS = -ldevmapper - OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o \ + OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \ gpt.o mac.o crc32.o lopart.o xstrncpy.o devmapper.o endif
kpartx/kpartx.c +6 -2
@@ -79,6 +79,7 @@ initpts(void)addpts ("unixware" , read_unixware_pt);addpts ("dasd" , read_dasd_pt);addpts ("mac" , read_mac_pt); +addpts ("sun" , read_sun_pt); }static char short_opts[] ="ladgvnp:t:" ;
@@ -374,6 +375,9 @@ main(int argc, char **argv){ d = c;while (c) {for (j =0 ; j < n; j++) { +unsigned long start; +int k = slices[j].container -1 ; +if (slices[j].size ==0 )continue ;if (slices[j].minor >0 )
@@ -382,11 +386,11 @@ main(int argc, char **argv){continue ; slices[j].minor = m++; + start = slices[j].start - slices[k].start;printf ("%s%s%d : 0 %lu /dev/dm-%d %lu\n" , mapname, delim, j+1 , (unsigned long ) slices[j].size, - slices[j].minor, - (unsigned long ) slices[j].start); + slices[k].minor, start); c--; }/* Terminate loop if nothing more to resolve */
kpartx/kpartx.h +1 -0
@@ -36,6 +36,7 @@ extern ptreader read_unixware_pt;extern ptreader read_gpt_pt;extern ptreader read_dasd_pt;extern ptreader read_mac_pt; +extern ptreader read_sun_pt;char *getblock (int fd,unsigned int secnr);
kpartx/sun.c new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
1.4.3.4