Module Name:    src
Committed By:   tsutsui
Date:           Wed Jan 16 15:15:02 UTC 2013

Modified Files:
        src/sys/arch/luna68k/stand/boot: Makefile parse.c samachdep.h
Added Files:
        src/sys/arch/luna68k/stand/boot: ls.c

Log Message:
Enable and add ls command for ufs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/stand/boot/ls.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/parse.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/samachdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/luna68k/stand/boot/Makefile
diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.5 src/sys/arch/luna68k/stand/boot/Makefile:1.6
--- src/sys/arch/luna68k/stand/boot/Makefile:1.5	Sun Jan 13 14:10:55 2013
+++ src/sys/arch/luna68k/stand/boot/Makefile	Wed Jan 16 15:15:01 2013
@@ -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_ETHERNET
 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+=	scsi.c sc.c sd.c
 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 @@ Z_AS=		library
 
 ### 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}

Index: src/sys/arch/luna68k/stand/boot/parse.c
diff -u src/sys/arch/luna68k/stand/boot/parse.c:1.1 src/sys/arch/luna68k/stand/boot/parse.c:1.2
--- src/sys/arch/luna68k/stand/boot/parse.c:1.1	Sat Jan  5 17:44:24 2013
+++ src/sys/arch/luna68k/stand/boot/parse.c	Wed Jan 16 15:15:01 2013
@@ -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 @@ struct command_entry entries[] = {
 	{ "fsrestore",	fsrestore    },
 #endif
 	{ "howto",	how_to_boot  },
+	{ "ls",		cmd_ls       },
 	{ "screen",	screen	     },
 #ifdef notyet
 	{ "tape",	tape	     },

Index: src/sys/arch/luna68k/stand/boot/samachdep.h
diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.4 src/sys/arch/luna68k/stand/boot/samachdep.h:1.5
--- src/sys/arch/luna68k/stand/boot/samachdep.h:1.4	Mon Jan 14 01:37:57 2013
+++ src/sys/arch/luna68k/stand/boot/samachdep.h	Wed Jan 16 15:15:01 2013
@@ -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 spl4(void);
 int spl5(void);
 int spl6(void);
 
+/* ls.c */
+int cmd_ls(int, char **);
+
 /* machdep.c */
 void straytrap(int);
 int badaddr(volatile void *);

Added files:

Index: src/sys/arch/luna68k/stand/boot/ls.c
diff -u /dev/null src/sys/arch/luna68k/stand/boot/ls.c:1.1
--- /dev/null	Wed Jan 16 15:15:02 2013
+++ src/sys/arch/luna68k/stand/boot/ls.c	Wed Jan 16 15:15:01 2013
@@ -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;
+}

Reply via email to