Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k/stand/boot Enable and add ls command for ufs.



details:   https://anonhg.NetBSD.org/src/rev/0fab8c7ad593
branches:  trunk
changeset: 784050:0fab8c7ad593
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Jan 16 15:15:01 2013 +0000

description:
Enable and add ls command for ufs.

diffstat:

 sys/arch/luna68k/stand/boot/Makefile    |   6 ++-
 sys/arch/luna68k/stand/boot/ls.c        |  53 +++++++++++++++++++++++++++++++++
 sys/arch/luna68k/stand/boot/parse.c     |   3 +-
 sys/arch/luna68k/stand/boot/samachdep.h |   5 ++-
 4 files changed, 63 insertions(+), 4 deletions(-)

diffs (127 lines):

diff -r 45a141bb1f45 -r 0fab8c7ad593 sys/arch/luna68k/stand/boot/Makefile
--- a/sys/arch/luna68k/stand/boot/Makefile      Wed Jan 16 08:28:44 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/Makefile      Wed Jan 16 15:15:01 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.5 2013/01/13 14:10:55 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.6 2013/01/16 15:15:01 tsutsui Exp $
 #      @(#)Makefile    8.2 (Berkeley) 8/15/93
 
 NOMAN= # defined
@@ -18,6 +18,7 @@
 CPPFLAGS+=     -DSUPPORT_DHCP -DSUPPORT_BOOTP
 #CPPFLAGS+=    -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
 #CPPFLAGS+=    -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
+CPPFLAGS+=     -DLIBSA_ENABLE_LS_OP
 CPPFLAGS+=     -DLIBSA_PRINTF_WIDTH_SUPPORT
 
 CFLAGS=                -Os -msoft-float
@@ -46,6 +47,7 @@
 SRCS+= disklabel.c
 #SRCS+=        fsdump.c
 SRCS+= ufs_disksubr.c
+SRCS+= ls.c
 
 # netboot support
 SRCS+= if_le.c lance.c getsecs.c
@@ -69,7 +71,7 @@
 
 ### find out what to use for libsa
 SA_AS=         library
-SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
+SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes SA_ENABLE_LS_OP=yes
 .include "${S}/lib/libsa/Makefile.inc"
 
 LIBS=  ${SALIB} ${ZLIB} ${KERNLIB}
diff -r 45a141bb1f45 -r 0fab8c7ad593 sys/arch/luna68k/stand/boot/ls.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/luna68k/stand/boot/ls.c  Wed Jan 16 15:15:01 2013 +0000
@@ -0,0 +1,53 @@
+/*     $NetBSD: ls.c,v 1.1 2013/01/16 15:15:01 tsutsui Exp $   */
+
+/*
+ * Copyright (c) 2001 Minoura Makoto
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+
+#include <lib/libsa/stand.h>
+#include <lib/libkern/libkern.h>
+
+#include <luna68k/stand/boot/samachdep.h>
+#include <luna68k/stand/boot/status.h>
+
+int
+cmd_ls(int argc, char *argv[])
+{
+       char filename[80];
+
+       if (argc == 1) {
+               strcpy(filename, default_file);
+               strcpy(strchr(filename, ')')+1, "/");
+       } else {
+               strcpy(filename, argv[1]);
+               if (*(strchr(argv[1], ')') + 1) == 0)
+                       strcat(filename, "/");
+       }
+       ls(filename);
+
+       return ST_NORMAL;
+}
diff -r 45a141bb1f45 -r 0fab8c7ad593 sys/arch/luna68k/stand/boot/parse.c
--- a/sys/arch/luna68k/stand/boot/parse.c       Wed Jan 16 08:28:44 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/parse.c       Wed Jan 16 15:15:01 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $        */
+/*     $NetBSD: parse.c,v 1.2 2013/01/16 15:15:01 tsutsui Exp $        */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -112,6 +112,7 @@
        { "fsrestore",  fsrestore    },
 #endif
        { "howto",      how_to_boot  },
+       { "ls",         cmd_ls       },
        { "screen",     screen       },
 #ifdef notyet
        { "tape",       tape         },
diff -r 45a141bb1f45 -r 0fab8c7ad593 sys/arch/luna68k/stand/boot/samachdep.h
--- a/sys/arch/luna68k/stand/boot/samachdep.h   Wed Jan 16 08:28:44 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/samachdep.h   Wed Jan 16 15:15:01 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: samachdep.h,v 1.4 2013/01/14 01:37:57 tsutsui Exp $    */
+/*     $NetBSD: samachdep.h,v 1.5 2013/01/16 15:15:01 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -144,6 +144,9 @@
 int spl5(void);
 int spl6(void);
 
+/* ls.c */
+int cmd_ls(int, char **);
+
 /* machdep.c */
 void straytrap(int);
 int badaddr(volatile void *);



Home | Main Index | Thread Index | Old Index