#
PKG_MAJOR=1
PKG_MINOR=3
-PKG_REVISION=15
+PKG_REVISION=16
PKG_BUILD=0
dbread.h debug.h dir.h dir2.h dir2sf.h dirshort.h dquot.h echo.h \
faddr.h field.h flist.h fprint.h frag.h freesp.h hash.h help.h \
init.h inobt.h inode.h input.h io.h malloc.h mount.h output.h \
- print.h quit.h sb.h uuid.h sig.h strvec.h type.h write.h
+ print.h quit.h sb.h sig.h strvec.h text.h type.h uuid.h write.h
CFILES = $(HFILES:.h=.c) main.c
LSRCFILES = xfs_admin.sh xfs_check.sh xfs_ncheck.sh
LLDLIBS = $(LIBXFS) $(LIBUUID)
#include "mount.h"
#include "sig.h"
#include "output.h"
+#include "malloc.h"
char *fsdevice;
+char **cmdline;
+int ncmdline;
static void
usage(void)
void
init(
- int argc,
- char **argv)
+ int argc,
+ char **argv)
{
- int c;
- FILE *cfile = NULL;
+ int c;
progname = basename(argv[0]);
while ((c = getopt(argc, argv, "c:fip:rxVl:")) != EOF) {
switch (c) {
case 'c':
- if (!cfile)
- cfile = tmpfile();
- if (!cfile) {
- perror("tmpfile");
- exit(1);
- }
- if (fprintf(cfile, "%s\n", optarg) < 0) {
- perror("fprintf(tmpfile)");
- dbprintf("%s: error writing temporary file\n",
- progname);
- exit(1);
- }
+ cmdline = xrealloc(cmdline, (ncmdline+1)*sizeof(char*));
+ cmdline[ncmdline++] = optarg;
break;
case 'f':
xfsargs.disfile = 1;
push_cur();
init_commands();
init_sig();
- if (cfile) {
- if (fprintf(cfile, "q\n")<0) {
- perror("fprintf(tmpfile)");
- dbprintf("%s: error writing temporary file\n", progname);
- exit(1);
- }
- if (fflush(cfile)<0) {
- perror("fflush(tmpfile)");
- dbprintf("%s: error writing temporary file\n", progname);
- exit(1);
- }
- rewind(cfile);
- pushfile(cfile);
- }
}
*/
extern char *fsdevice;
+extern char **cmdline;
+extern int ncmdline;
extern void init(int argc, char **argv);
#include "data.h"
#include "init.h"
#include "input.h"
+#include "malloc.h"
int
main(
int argc,
char **argv)
{
- int c;
- int done;
+ int c, i, done = 0;
char *input;
char **v;
pushfile(stdin);
init(argc, argv);
- done = 0;
+
+ for (i = 0; !done && i < ncmdline; i++) {
+ v = breakline(cmdline[i], &c);
+ if (c)
+ done = command(c, v);
+ xfree(v);
+ }
+ if (cmdline) {
+ xfree(cmdline);
+ return exitcode;
+ }
+
while (!done) {
if ((input = fetchline()) == NULL)
break;
--- /dev/null
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include <libxfs.h>
+#include <ctype.h>
+#include "block.h"
+#include "bmap.h"
+#include "command.h"
+#include "data.h"
+#include "type.h"
+#include "faddr.h"
+#include "fprint.h"
+#include "field.h"
+#include "inode.h"
+#include "io.h"
+#include "output.h"
+#include "mount.h"
+
+static void print_rawtext(void *data, int len);
+
+void
+print_text(
+ const field_t *fields,
+ int argc,
+ char **argv)
+{
+ print_rawtext(iocur_top->data, iocur_top->len);
+}
+
+static void
+print_rawtext(
+ void *data,
+ int len)
+{
+ int i;
+ int j;
+ int lastaddr;
+ int offchars;
+ unsigned char *p;
+
+ lastaddr = (len - 1) & ~(16 - 1);
+ if (lastaddr < 0x10)
+ offchars = 1;
+ else if (lastaddr < 0x100)
+ offchars = 2;
+ else if (lastaddr < 0x1000)
+ offchars = 3;
+ else
+ offchars = 4;
+
+ for (i = 0, p = data; i < len; i += 16) {
+ unsigned char *s = p;
+
+ dbprintf("%-0*.*x: ", offchars, offchars, i);
+
+ for (j = 0; j < 16 && i + j < len; j++, p++) {
+ dbprintf("%02x ", *p);
+ }
+
+ dbprintf(" ");
+
+ for (j = 0; j < 16 && i + j < len; j++, s++) {
+ if (isalnum(*s))
+ dbprintf("%c", *s);
+ else
+ dbprintf(".", *s);
+ }
+
+ dbprintf("\n");
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+extern void print_text(const struct field *fields, int argc, char **argv);
#include "attr.h"
#include "dquot.h"
#include "dir2.h"
+#include "text.h"
static const typ_t *findtyp(char *name);
static int type_f(int argc, char **argv);
{ TYP_RTSUMMARY, "rtsummary", NULL, NULL },
{ TYP_SB, "sb", handle_struct, sb_hfld },
{ TYP_SYMLINK, "symlink", handle_string, NULL },
+ { TYP_TEXT, "text", handle_text, NULL },
{ TYP_NONE, NULL }
};
else
print_block(fields, argc, argv);
}
+
+void
+handle_text(
+ int action,
+ const field_t *fields,
+ int argc,
+ char **argv)
+{
+ if (action != DB_WRITE)
+ print_text(fields, argc, argv);
+}
+
TYP_BMAPBTD, TYP_BNOBT, TYP_CNTBT, TYP_DATA, TYP_DIR,
TYP_DIR2, TYP_DQBLK, TYP_INOBT, TYP_INODATA, TYP_INODE,
TYP_LOG, TYP_RTBITMAP, TYP_RTSUMMARY, TYP_SB, TYP_SYMLINK,
- TYP_NONE
+ TYP_TEXT, TYP_NONE
} typnm_t;
#define DB_WRITE 1
char **argv);
extern void handle_struct(int action, const struct field *fields, int argc,
char **argv);
+extern void handle_text(int action, const struct field *fields, int argc,
+ char **argv);
+xfsprogs (1.3.16-1) unstable, urgency=low
+
+ * Remove temporary file use in xfs_db
+ * Add "type text" command into xfs_db
+
+ -- Nathan Scott <nathans@debian.org> Mon, 17 Dec 2001 12:17:54 +1100
+
xfsprogs (1.3.15-1) unstable; urgency=low
* Fix minor package version numbering issue (closes: #117545)
+xfsprogs-1.3.16 (17 December 2001)
+ - added text dump type to xfs_db (mkp)
+ - removed use of a temporary file in xfs_db when processing
+ commands on the command line - allows xfs_check to be run
+ on read-only root filesystems
+
xfsprogs-1.3.15 (12 December 2001)
- reenable the use of the BLKBSZSET ioctl, its baaack
- sync recent XFS kernel source changes back into libxfs
\f3agf\f1, \f3agfl\f1, \f3agi\f1, \f3attr\f1, \f3bmapbta\f1, \f3bmapbtd\f1,
\f3bnobt\f1, \f3cntbt\f1, \f3data\f1, \f3dir\f1, \f3dir2\f1, \f3dqblk\f1,
\f3inobt\f1, \f3inode\f1, \f3log\f1, \f3rtbitmap\f1, \f3rtsummary\f1,
-\f3sb\f1, and \f3symlink\f1.
+\f3sb\f1, \f3symlink\f1, and \f3text\f1.
See the TYPES section below for more information on these data types.
.TP
\f3uuid\f1 [ \f2uuid\f1 or \f2generate\f1 or \f2rewrite\f1 ]
not fit inside the inode.
The block content is just the string value.
Bytes past the logical end of the symbolic link value have arbitrary values.
+.TP
+\f3text\f1
+User file blocks, and other blocks whose type is unknown,
+have this type for display purposes in \f2xfs_db\f1.
+The block data is displayed in two columns: Hexadecimal format
+and printable ASCII chars.
.SH DIAGNOSTICS
Many messages can come from the \f3check\f1 (\f3blockget\f1) command;
these are documented in \f2xfs_check\f1(8).