48 Commits

Author SHA1 Message Date
Kai Mäkisara
0c7307cc7a Add new density codes for IBM 3592 drives
Codes are added for the newer drives. The TS11xx names are added to
the desciptions of codes for non-encrypted tape.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2025-01-07 16:29:51 +01:00
Chris Dinneen
85738cedc1 Add 3480 too 2025-01-05 16:47:40 +01:00
Chris Dinneen
82d569b489 add 3490E to tape type for code 0x09 2025-01-05 16:47:40 +01:00
Chris Dinneen
547bc649a9 Add 9track Reels to tape struct densities table 2025-01-05 16:43:49 +01:00
Chris Dinneen
5ec6428297 Fix Typo comprssed -> compressed 2025-01-05 16:41:12 +01:00
Iustin Pop
7aa498640d Add source link in the actual comments 2025-01-05 16:39:16 +01:00
Chris Dinneen
ba594d1e78 Add abbreviation explainer for tape types in code comment 2025-01-05 16:39:16 +01:00
Kai Mäkisara
ff108770be mt: stinit: Add support for setting and clearing MT_ST_NOWAIT_EOF
Add code to set/clear the MT_ST_NO_WAIT option bit for MTSETDRVBUFFER.
The string used in the user interface is 'weof-no-wait'.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2025-01-05 14:54:06 +01:00
Kai Mäkisara
9c8f170d4a mt: Complain about write protection if write protected
Print the message if status bit is one, not zero.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2024-12-14 18:28:43 +01:00
Chris Dinneen
eadc992f2a Fix #26; Add LTO9 Density Code 2023-10-31 17:57:47 +01:00
Chris Dinneen
d7e60146d2 Add: 3590 B using same syntax as T10000A 2023-02-07 12:17:14 +08:00
Chris Dinneen
4fdbc29fed Add IBM 3590 E format to tape list 2023-01-09 11:35:11 +08:00
Iustin Pop
845f5e48d2 Add density code for LTO-7 formatted as M8
Still not able to find LTO-9/LTO-10 density codes, but at least this
one should be correct from internet resources.
2019-12-13 16:14:59 +01:00
Iustin Pop
1345189baf Remove left-shifting of negative values
Left-shifting of negative values is undefined behaviour according to
the C standard, because it depends on the exact representation. This
code, copied from the Linux kernel, is intended for 2's complement and
can be replaced by well-defined behaviour: ~(-1<<N) is equivalent
to (1<<N)-1.

Signed-off-by: Iustin Pop <iustin@k1024.org>
2019-02-23 23:16:33 +01:00
Iustin Pop
a15c02e572 More formatting fixes
Just another run of clang-format.
2019-02-16 14:13:02 +01:00
Gris Ge
874d58d952 Fix coverity scan warnings.
* Fix the leaking `fd`.
 * Fix the possible overflow of strcat().

Signed-off-by: Gris Ge <fge@redhat.com>
2019-02-16 14:08:35 +01:00
hrchu
0d1245dce0 Add lto-8 density code 2019-02-16 14:02:41 +01:00
Iustin Pop
a172976fd2 Remove obsolete calls to uname in do_show_options()
Commit b48a427 removed the actual kernel version checks, but forgot
the calls to populate the values themselves. Remove them as we don't
do anything with those values.
2016-05-06 22:05:57 +02:00
Iustin Pop
2299178287 mt: make usage() show default tape device
This is not unified with version(), and the quotes have been removed
(looks more standard).
2016-05-06 21:58:46 +02:00
Iustin Pop
8c47d73803 mt: move exit-after-usage() into usage()
This simplifies a bit the calls to usage().
2016-05-06 21:58:18 +02:00
Iustin Pop
14a9ca5df4 LARGE CHURN: reindent source code
The source code seems to have, over time, become less self-consistent
in style. In order to not have to keep this up manually, switch over
indenting to clang-format. A .clang-format file is provided to give
repeatable results.

The main difference is switching from tabs to non-tabs
usage. Otherwise the changes are mostly minor and leading to more
consistency. Contributions to the format style welcome!

Nota bene: this should have had no code impact. Any actual code
changes (beyond indenting) are bugs in the re-indent process.
2016-05-06 21:54:34 +02:00
Iustin Pop
a8252c4f91 Re-align structure initialization lists in mt.c
There are three "tables" with structure initialization lists in mt.c,
which look like they were intended to be nicely-aligned, but over time
they got out of alignment.

Redo the alignment by unwrapping the lines and using Emacs'
align-regex, even though this leads to an exception of ~130 line
length for the 'cmds' table, since it leads to a very readable table
(on large terminals). Also protect these regions from clang-format, in
preparation for full file re-indents.
2016-05-06 21:39:48 +02:00
Iustin Pop
faf3e9b3b7 Small naming change MULTIPLE_ARGS→MANY_ARGS
Will help with indenting the cmds[] array.
2016-05-06 18:19:18 +02:00
Iustin Pop
58a04729fa Add a few more unused-args annotations
There are no warnings now with -Wextra (which turns on -Wunused-…).
2016-05-01 04:19:19 +02:00
Alexey Svistunov
a0f5b83bd7 Code cleanup patch from SUSE package
This adds annotations for unused arguments to a few functions, and
cleans a bit the typedefs.

Closes #6.
2016-05-01 04:17:00 +02:00
Iustin Pop
75644f8ccd Allow configuring the default tape device at build time
Also adds displaying it in the version output, and moves this (the
show version code) into a separate function.
2016-05-01 03:00:32 +02:00
Iustin Pop
cbf6e618f7 Merge pull request #9: Add missing includes 2016-05-01 02:38:24 +02:00
Kai Mäkisara
6a00368c21 Allow negative argument for mkpartition
Allow negative argument for mtpartition to support kernels >= 4.6.
Update the mt man page.
2016-05-01 02:04:05 +02:00
Felix Janda
a844aeed7c mt.c: Include <sys/sysmacros.h> for minor()
We already do the same in stinit.c.

<sys/macros.h> is currently implicitly included by <sys/types.h>
but this might change in the future.
2016-04-22 18:17:51 +02:00
Kai Mäkisara
6edb9f2cc5 Remove the redundant stshowopt command definition
The added stshowoptions allows stshowopt (command parsing accepts
any unambiguous abbreviation).
2016-02-12 21:22:24 +01:00
Kai Mäkisara
dd5afc0eb6 Check for overflow when using k, M or G
Check that using a postfix (k, M, G) with repeat count does not cause
overflow in the int mtop.mt_count.
2016-02-12 21:01:35 +01:00
Kai Mäkisara
b48a42742f Remove obsolete test from do_show_options()
Remove from do_show_options() the now obsolete kernel
version test that has never worked correctly. Problem
reported by Emmanuel Florac.
2016-02-12 20:58:21 +01:00
Kai Mäkisara
ffd5dadee3 Add density codes
Add some density codes.
2016-02-12 20:58:13 +01:00
Iustin Pop
0ee3591e51 Rework the dist target and drop LSM file
Short of moving to autotools, this is the best that can be done:

- move the version from hardcoded in the .c files, to a
  dynamically-built `version.h` file so that we only declare the
  version in one place
- build a better dist file (.tar.gz) by explicitly selecting which
  files to copy, instead of unbounded recursion from the source
  directory
- ensure that the files being copied to the archive have a sane
  user/group and mode
- add a distcheck target that simply reuses the archive to build and
  run the programs, and then regenerate the archive from itself

autotools would solve all this by default, but still feels too
heavyweight for just two .c files.

Additionall, drop the .lsm file. It seems mostly useless these days;
I'll be happy to reinstate it however if anyone cares.
2016-02-07 20:38:27 +01:00
Iustin Pop
506424dc37 Update maintainership info in the remaining places
Also remove the 'last modified' entries as they're available from the VCS.
2016-02-07 18:21:29 +01:00
Iustin Pop
e4367cfb8c Recode all ISO8859-1 files in UTF-8
While looking at Fedora's build spec for mt-st, I saw that they recode
the README.stinit file to UTF-8; this makes a lot of sense, so let's
recode all non-UTF files in UTF-8.
2016-02-04 20:14:04 +01:00
Iustin Pop
f3f4d9d57d Add taoe density translation for LTO-7 2016-01-25 00:40:07 +01:00
Iustin Pop
4c0df9c184 Merge remote-tracking branch 'github/master' 2016-01-25 00:38:43 +01:00
David Sommerseth
d6e96c7172 Add tape density translation for LTO-5 and LTO-6
The codes used have been extracted from the mhvtl project.
2016-01-18 10:07:00 +01:00
Iustin Pop
ffb34b5ca9 Silence two further warnings
These two local variables seem unused, probably artifacts from some
older refactoring.
2015-05-29 10:57:59 +02:00
Ivo De Decker
e6a52fd9cf support stshowoptions command
The manpage lists the stshowoptions command, while the code has the
stshowopt command. This patch enables support for both.
2015-05-29 10:31:02 +02:00
Jan Christoph Nordholz
4d88fb7a01 Get rid of all those gcc warnings
For the stinit.c change, buflen is positive in all cases, so use a
cast. The other changes are straightforward.
2015-05-29 10:28:47 +02:00
Kai Mäkisara
80e1c3d17c Check that the default tape device is a chardev
When using the default tape device (no $TAPE env. var and no explicit
tape given), check that it is indeed a character device; this will
help with better error messages on systems using udev, where /dev/tape
is a directory instead.
2015-05-16 17:48:13 +02:00
Kai Mäkisara
f734645c0f Add a few new density codes 2015-05-16 17:48:13 +02:00
Kai Mäkisara
c232ed0dd2 Backdated import of mt-st version 1.1
This is an import of the mt-st upstream release 1.1 as it appeared in
the Debian archives and on ftp://ftp.ibiblio.org/pub/linux/system/backup.
2015-05-16 17:46:05 +02:00
Kai Mäkisara
be12266b61 Backdated import of mt-st version 0.9b
This is an import of the mt-st upstream release 0.9b as it appeared in
the Debian archives.
2015-05-16 17:39:25 +02:00
Kai Mäkisara
11875969cd Backdated import of mt-st version 0.8
This is an import of the mt-st upstream release 0.8 as it appeared in
the Debian archives.
2015-05-16 17:33:19 +02:00
Kai Mäkisara
fcb4fbe0d1 Backdated import of mt-st version 0.7
This is an import of the mt-st upstream release 0.7 as it appeared in
the Debian archives.
2015-05-16 17:26:03 +02:00