Package: acorn-fdisk
Severity: minor
Tags: patch
Hi,
this is the rest of my original patch split off from #552791 due
to being out of scope. Please apply it when you prepare the next
upload. As stated, I didn’t bump the Standards-Version but fixed
a number of other issues and wrote a rudimentary manual page.
I talked to: Russell King - ARM Linux <li...@arm.linux.org.uk>
He said he didn’t actively maintain it any longer but will take
patches for it, so I suggest you feed all Debian patches that
apply back there. I also pointed out a possible endianness is-
sue, there may be more though that is the one gcc4.4 found.
bye,
//mirabilos
--
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font. -- Rob Pike in "Notes on Programming in C"
diff -u acorn-fdisk-3.0.6/fdisk.c acorn-fdisk-3.0.6/fdisk.c
--- acorn-fdisk-3.0.6/fdisk.c
+++ acorn-fdisk-3.0.6/fdisk.c
@@ -58,7 +58,7 @@
#define is_extended(x) ((x) == ptyp_dos_extended || (x) == ptyp_linux_extended)
static prog_mode_t
-parse_args(int argc, const char *argv[])
+parse_args(int argc, char *argv[])
{
prog_mode_t mode = mode_partition;
int opt;
@@ -676,7 +676,7 @@
" n add a new partition\n"
" p print the partition table\n"
" q quit without saving changes\n"
- " r reopen partition, specifing type\n"
+ " r reopen partition, specifying type\n"
" t change a partition's system id\n"
" u change display/entry units\n"
// " v verify the partition table\n"
@@ -816,7 +816,7 @@
return 0;
}
-int main(int argc, const char *argv[])
+int main(int argc, char *argv[])
{
prog_mode_t mode;
u_int ret = 1;
@@ -859,7 +859,7 @@
case mode_list:
if (optind < argc)
- ret = print_part_tables(argc - optind, argv + optind);
+ ret = print_part_tables(argc - optind, (const char
**)argv + optind);
else
ret = print_part_tables(NR_DEVICES, part_devs);
break;
diff -u acorn-fdisk-3.0.6/debian/changelog acorn-fdisk-3.0.6/debian/changelog
--- acorn-fdisk-3.0.6/debian/changelog
+++ acorn-fdisk-3.0.6/debian/changelog
@@ -1,3 +1,24 @@
+acorn-fdisk (3.0.6-7) unstable; urgency=low
+
+ [ Thorsten Glaser ]
+ * fix compiler warnings:
+ - fdisk.c: passing … from incompatible pointer type
+ - lib/scheme/icside.c: dereferencing … does break strict-aliasing rules
+ XXX there might be an endianness issue left from the original code
+ - lib/scheme/pcbios.c: array subscript is above array bounds
+ - lib/scheme/pcbios.c: use of uninitialised value
+ * fix lintian warnings:
+ - debhelper-but-no-misc-depends
+ - debian-rules-ignores-make-clean-error
+ - spelling-error-in-binary
+ - unknown-section base
+ - package-contains-empty-directory
+ * debian/watch: new file (took me some time to track down upstream tho)
+ * debian/control: add Homepage (as close to one as I could find)
+ * debian/manpages, debian/acorn-fdisk.8: new files
+
+ -- Thorsten Glaser <t...@mirbsd.de> Sun, 03 Jan 2010 15:31:58 +0000
+
acorn-fdisk (3.0.6-6.3) unstable; urgency=low
* Non-maintainer upload.
diff -u acorn-fdisk-3.0.6/debian/rules acorn-fdisk-3.0.6/debian/rules
--- acorn-fdisk-3.0.6/debian/rules
+++ acorn-fdisk-3.0.6/debian/rules
@@ -25,7 +25,7 @@
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
- -$(MAKE) clean
+ $(MAKE) clean
dh_clean
@@ -37,6 +37,7 @@
# Add here commands to install the package into debian/acorn-fdisk.
$(MAKE) install DESTDIR=$(CURDIR)/debian/acorn-fdisk
+ find $(CURDIR)/debian/acorn-fdisk -type d -empty -delete
# Build architecture-independent files here.
diff -u acorn-fdisk-3.0.6/debian/control acorn-fdisk-3.0.6/debian/control
--- acorn-fdisk-3.0.6/debian/control
+++ acorn-fdisk-3.0.6/debian/control
@@ -1,13 +1,14 @@
Source: acorn-fdisk
-Section: base
+Section: admin
Priority: optional
Maintainer: Philip Blundell <p...@nexus.co.uk>
Build-Depends: debhelper (>> 5.0.0)
Standards-Version: 3.5.2
+Homepage: http://www.arm.linux.org.uk/machines/riscpc/stage-2/
Package: acorn-fdisk
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Partition editor for Acorn/RISC OS machines
Acorn-fdisk allows you to edit disk partitions on Acorn machines. It
understands a variety of the partition tables formats used under RISC OS,
only in patch2:
unchanged:
--- acorn-fdisk-3.0.6.orig/lib/scheme/icside.c
+++ acorn-fdisk-3.0.6/lib/scheme/icside.c
@@ -193,6 +193,7 @@
{
icside_pe_t sector;
u_int part_no, ret = 0;
+ unsigned long csum;
dbg_printf("icside_writeinfo()");
dbg_level_up();
@@ -234,7 +235,9 @@
assert(0);
}
}
- *(unsigned long *)§or.sector[508] = icside_checksum(sector.sector);
+ /* XXX possible endianness issue */
+ csum = icside_checksum(sector.sector);
+ memcpy(§or.sector[508], &csum, sizeof(csum));
#ifdef ICSIDE_DUMP
dbg_memdump(sector.sector, ICSIDE_SECTOR_SIZE);
only in patch2:
unchanged:
--- acorn-fdisk-3.0.6.orig/lib/scheme/pcbios.c
+++ acorn-fdisk-3.0.6/lib/scheme/pcbios.c
@@ -217,7 +217,12 @@
p = part->data.pcbios.pcboot_sector + 0x1be;
+#if 0
if (valid && chs.cylinder == 0) {
+ /* } chs is uninitialised here */
+#else
+ if (valid) {
+#endif
/*
* Attempt to calculate the size of one track
* track_size = (start_log / (cyl * head) - sector
@@ -572,7 +577,7 @@
if (types[i] == current)
break;
- if (types[i] == current) {
+ if (i < NR_TYPES && types[i] == current) {
i += dir;
if (i < 0)
only in patch2:
unchanged:
--- acorn-fdisk-3.0.6.orig/debian/watch
+++ acorn-fdisk-3.0.6/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://ftp.arm.linux.org.uk/pub/armlinux/source/other/arm-fdisk-(.*)\.tar\.gz
debian uupdate
only in patch2:
unchanged:
--- acorn-fdisk-3.0.6.orig/debian/acorn-fdisk.8
+++ acorn-fdisk-3.0.6/debian/acorn-fdisk.8
@@ -0,0 +1,101 @@
+.\" Copyright (c) 2009
+.\" Thorsten Glaser <t...@mirbsd.org>
+.\"
+.\" Provided that these terms and disclaimer and all copyright notices
+.\" are retained or reproduced in an accompanying document, permission
+.\" is granted to deal in this work without restriction, including un-
+.\" limited rights to use, publicly perform, distribute, sell, modify,
+.\" merge, give away, or sublicence.
+.\"
+.\" This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+.\" the utmost extent permitted by applicable law, neither express nor
+.\" implied; without malicious intent or gross negligence. In no event
+.\" may a licensor, author or contributor be held liable for indirect,
+.\" direct, other damage, loss, or other issues arising in any way out
+.\" of dealing in the work, even if advised of the possibility of such
+.\" damage or existence of a defect, except proven that it results out
+.\" of said person's immediate fault when using the work as intended.
+.\"-
+.Dd December 31, 2009
+.Dt FDISK 8
+.Os
+.Sh NAME
+.Nm acorn\-fdisk
+.Nd partition editor for Acorn/RISC OS machines
+.Sh SYNOPSIS
+.Nm
+.Fl \-help | Fl \-version
+.Pp
+.Nm
+.Fl l | Fl \-list
+.Op Fl \-type Ar scheme
+.Ar device ...
+.Pp
+.Nm
+.Op Fl \-type Ar scheme
+.Fl s | Fl \-size
+.Ar device
+.Pp
+.Nm
+.Op Fl \-type Ar scheme
+.Op Ar device
+.Sh DESCRIPTION
+The
+.Nm
+utility allows to display or interactively edit partition
+tables for Acorn/RISC OS machines in various formats.
+When no optional
+.Ar device
+is given, it defaults to
+.Pa /dev/hda
+or
+.Pa /dev/sda .
+.Pp
+The options are as follows:
+.Bl -tag -width xxtypexscheme
+.It Fl \-help
+Display a short usage and exit immediately.
+.It Fl l | Fl \-list
+Display the partition table(s) of all
+.Ar device Ns s .
+.It Fl s | Fl \-size
+Display the partition sizes of
+.Ar device .
+.It Fl \-type Ar scheme
+Select the partitioning scheme to use.
+Valid schemes are:
+.Bl -tag -width FilecorexRISCiX
+.It EESOX
+Eesox SCSI on the Acorn machines.
+.It ICSIDEFS
+ICS IDE.
+.It Filecore/Linux
+Linux on Filecore.
+This uses the non-ADFS descriptor to point to the start of the disc to
+be partitioned.
+The first two sectors contain a partition table to
+identify the Linux partitions contained within.
+.It PC/BIOS
+PC/BIOS partitioning scheme.
+This consists of a partition table in the first sector of the disk which
+contains both CHS and LBA values for the partitions.
+There can be up to four entries in the primary partition table.
+One of these can be an extended partition containing up to four extra
+partitions.
+.It PowerTec
+PowerTec SCSI on the Acorn machines.
+.It Filecore/RISCiX
+RiscIX on Filecore.
+.El
+.It Fl \-version
+Display the version of
+.Nm
+and exit immediately.
+.El
+.Sh AUTHORS
+.Nm arm\-fdisk
+was written by
+.An Russell King Aq r...@arm.uk.linux.org .
+.Pp
+This manual page was written for the Debian system by
+.An Thorsten Glaser Aq t...@mirbsd.org .
only in patch2:
unchanged:
--- acorn-fdisk-3.0.6.orig/debian/manpages
+++ acorn-fdisk-3.0.6/debian/manpages
@@ -0,0 +1 @@
+debian/acorn-fdisk.8