Source-Changes-HG archive

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

[src/trunk]: src/share/examples/rump Remove some programs which live as atf t...



details:   https://anonhg.NetBSD.org/src/rev/a804ef4db8ae
branches:  trunk
changeset: 758641:a804ef4db8ae
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Nov 11 23:01:00 2010 +0000

description:
Remove some programs which live as atf tests now.

diffstat:

 share/examples/rump/Makefile                |     4 +-
 share/examples/rump/img2cgd/Makefile        |    14 -
 share/examples/rump/img2cgd/cgd.conf        |     8 -
 share/examples/rump/img2cgd/img2cgd.c       |   219 ----
 share/examples/rump/pad_nothai/Makefile     |    14 -
 share/examples/rump/pad_nothai/musa.c       |  1191 ---------------------------
 share/examples/rump/pad_nothai/pad_nothai.c |    80 -
 share/examples/rump/swwdog_arm/Makefile     |    14 -
 share/examples/rump/swwdog_arm/swwdog_arm.c |    91 --
 9 files changed, 2 insertions(+), 1633 deletions(-)

diffs (truncated from 1676 to 300 lines):

diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/Makefile
--- a/share/examples/rump/Makefile      Thu Nov 11 22:56:38 2010 +0000
+++ b/share/examples/rump/Makefile      Thu Nov 11 23:01:00 2010 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile,v 1.5 2010/05/01 23:31:01 pooka Exp $
+#      $NetBSD: Makefile,v 1.6 2010/11/11 23:01:00 pooka Exp $
 #
 
-SUBDIR=        btplay img2cgd pad_nothai sdread swwdog_arm tipsy ttyserv       \
+SUBDIR=        btplay sdread tipsy ttyserv     \
        ulptprint umserv ukbd_read ums_draw wirelessconf
 
 .include <bsd.subdir.mk>
diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/img2cgd/Makefile
--- a/share/examples/rump/img2cgd/Makefile      Thu Nov 11 22:56:38 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-PROG=  img2cgd
-SRCS=  img2cgd.c
-NOMAN=
-
-.include <bsd.own.mk>
-
-RUMP_ACTION=   #defined
-CPPFLAGS+=     -DCGDCONFIG_AS_LIB
-.include "${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig"
-
-DBG=   -g -O0
-WARNS= 3
-
-.include <bsd.prog.mk>
diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/img2cgd/cgd.conf
--- a/share/examples/rump/img2cgd/cgd.conf      Thu Nov 11 22:56:38 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-algorithm aes-cbc;
-iv-method encblkno1;
-keylength 128;
-verify_method none;
-keygen pkcs5_pbkdf2/sha1 {
-        iterations 42;
-        salt AAAAgGP2NZIYEnyKYALLRmdZdZc=;
-};
diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/img2cgd/img2cgd.c
--- a/share/examples/rump/img2cgd/img2cgd.c     Thu Nov 11 22:56:38 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*     $NetBSD: img2cgd.c,v 1.3 2009/10/20 02:05:45 pooka Exp $        */
-
-/*
- * Copyright (c) 2009 Antti Kantee.  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 ``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/types.h>
-#include <sys/param.h>
-
-#include <assert.h>
-#include <err.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rump/rump.h>
-#include <rump/rump_syscalls.h>
-
-#include "cgdconfig.h"
-
-/*
- * We really should use disklabel.  However, for the time being,
- * use a endian independent magic number at offset == 0 and a
- * 64bit size at offset == 8.
- */
-#define MYMAGIC 0x11000a00000a0011LL
-#define MAGOFF 0
-#define SIZEOFF        8
-
-#define SKIPLABEL 8192
-#define IMG_MINSIZE (120*1024) /* label/mbr/etc search looks here and there */
-
-static void
-usage(void)
-{
-
-       fprintf(stderr, "usage: %s read|write cgd_image file\n", getprogname());
-       exit(1);
-}
-
-typedef ssize_t (*readfn)(int, void *, size_t);
-typedef ssize_t (*writefn)(int, const void *, size_t);
-
-#define BLOCKSIZE 512
-#define BLKROUND(a) (((a)+(BLOCKSIZE-1)) & ~(BLOCKSIZE-1))
-
-static void
-doxfer(int fd_from, int fd_to, off_t nbytes, readfn rfn, writefn wfn,
-       int roundwrite)
-{
-       char buf[8192];
-       ssize_t n;
-
-       assert(sizeof(buf) % BLOCKSIZE == 0);
-       if (roundwrite)
-               nbytes = BLKROUND(nbytes);
-
-       memset(buf, 0, sizeof(buf));
-       while (nbytes) {
-               n = rfn(fd_from, buf, sizeof(buf));
-               if (n == -1)
-                       err(1, "read");
-               if (n == 0)
-                       break;
-               n = MIN(n, nbytes);
-               if (roundwrite)
-                       n = BLKROUND(n);
-               nbytes -= n;
-               if (wfn(fd_to, buf, n) == -1)
-                       err(1, "write");
-       }
-}
-
-#define RFLAGS (O_RDONLY)
-#define WFLAGS (O_WRONLY | O_CREAT | O_TRUNC)
-int
-main(int argc, char *argv[])
-{
-       char *the_argv[10];
-       const char *cgd_file, *img_file;
-       struct stat sb_cgd, sb_file;
-       off_t nbytes;
-       int error;
-       int fd, fd_r;
-       int readmode;
-
-       setprogname(argv[0]);
-
-       if (argc != 4)
-               usage();
-
-       if (strcmp(argv[1], "read") == 0)
-               readmode = 1;
-       else if (strcmp(argv[1], "write") == 0)
-               readmode = 0;
-       else
-               usage();
-
-       cgd_file = argv[2];
-       img_file = argv[3];
-
-       if (stat(img_file, &sb_file) == -1) {
-               if (!readmode)
-                       err(1, "cannot open file image %s", img_file);
-       } else {
-               if (!S_ISREG(sb_file.st_mode))
-                       errx(1, "%s is not a regular file", img_file);
-       }
-
-       if (stat(cgd_file, &sb_cgd) == -1) {
-               if (readmode)
-                       err(1, "cannot open cgd image %s", cgd_file);
-       } else {
-               if (!S_ISREG(sb_cgd.st_mode))
-                       errx(1, "%s is not a regular file", cgd_file);
-       }
-
-       /*
-        * Create a file big enough to hold the file we are encrypting.
-        * This is because cgd works on a device internally and does
-        * not know how to enlarge a device (surprisingly ...).
-        */
-       if (!readmode) {
-               uint64_t tmpval;
-
-               fd = open(cgd_file, WFLAGS, 0755);
-               if (fd == -1)
-                       err(1, "fd");
-               ftruncate(fd,
-                   MAX(IMG_MINSIZE, BLKROUND(sb_file.st_size)) + SKIPLABEL);
-
-               /* write magic info */
-               tmpval = MYMAGIC;
-               if (pwrite(fd, &tmpval, 8, MAGOFF) != 8)
-                       err(1, "magic write failed");
-               tmpval = htole64(sb_file.st_size);
-               if (pwrite(fd, &tmpval, 8, SIZEOFF) != 8)
-                       err(1, "size write failed");
-
-               close(fd);
-
-               nbytes = sb_file.st_size;
-       } else {
-               uint64_t tmpval;
-
-               fd = open(cgd_file, RFLAGS);
-               if (fd == -1)
-                       err(1, "image open failed");
-
-               if (pread(fd, &tmpval, 8, MAGOFF) != 8)
-                       err(1, "magic read failed");
-               if (tmpval != MYMAGIC)
-                       errx(1, "%s is not a valid image", cgd_file);
-               if (pread(fd, &tmpval, 8, SIZEOFF) != 8)
-                       errx(1, "size read failed");
-               close(fd);
-
-               nbytes = le64toh(tmpval);
-       }
-
-       rump_init();
-       if ((error = rump_pub_etfs_register("/cryptfile", cgd_file,
-           RUMP_ETFS_BLK)) != 0) {
-               printf("etfs: %d\n", error);
-               exit(1);
-       }
-
-       the_argv[0] = strdup("cgdconfig");
-       the_argv[1] = strdup("cgd0");
-       the_argv[2] = strdup("/cryptfile");
-       the_argv[3] = strdup("./cgd.conf");
-       the_argv[4] = NULL;
-       error = cgdconfig(4, the_argv);
-       if (error) {
-               fprintf(stderr, "cgdconfig failed: %d (%s)\n",
-                   error, strerror(error));
-               exit(1);
-       }
-
-       fd = open(img_file, readmode ? WFLAGS : RFLAGS, 0755);
-       if (fd == -1)
-               err(1, "fd");
-       fd_r = rump_sys_open("/dev/rcgd0d", O_RDWR, 0755);
-       if (fd_r == -1)
-               err(1, "fd_r");
-       if (rump_sys_lseek(fd_r, SKIPLABEL, SEEK_SET) == -1)
-               err(1, "rump lseek");
-
-       if (readmode) {
-               doxfer(fd_r, fd, nbytes, rump_sys_read, write, 0);
-       } else {
-               doxfer(fd, fd_r, sb_file.st_size, read, rump_sys_write, 1);
-       }
-
-       return 0;
-}
diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/pad_nothai/Makefile
--- a/share/examples/rump/pad_nothai/Makefile   Thu Nov 11 22:56:38 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#      $NetBSD: Makefile,v 1.1 2010/05/01 23:31:01 pooka Exp $
-#
-
-PROG=  pad_nothai
-
-LDADD+=        -lrumpdev_audio -lrumpdev_pad -lrumpdev -lrumpvfs
-LDADD+=        -lrump
-LDADD+=        -lrumpuser -lpthread
-
-DBG=   -g
-NOMAN= 
-WARNS= 4
-
-.include <bsd.prog.mk>
diff -r 1f27a2d12dcf -r a804ef4db8ae share/examples/rump/pad_nothai/musa.c
--- a/share/examples/rump/pad_nothai/musa.c     Thu Nov 11 22:56:38 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1191 +0,0 @@
-unsigned musa[] = {
-0x646e732e, 0x18000000, 0x586f0000, 0x1000000, 0x4c1f0000, 0x1000000,
-0xff674d45, 0x4554ded3, 0xd54d5c5d, 0x4e64cb5b, 0xe1d5c9dc, 0xffd04dd7,
-0x363cdecf, 0x3a314d63, 0x4fc24142, 0xc8d3be6a, 0xeae7ccc4, 0xc9e55fcf,
-0x52f54d58, 0xc958c662, 0x4f534bc3, 0x3ed34d4f, 0x5446ee63, 0x5f4e533e,
-0x48ce5153, 0xd9536056, 0x6bc1d7fb, 0x66f36ed5, 0xd94ec956, 0x6a55546d,
-0xdbcd4c53, 0x66cf4a64, 0xe53f5741, 0xe7695f4c, 0x5a3a59d7, 0x42414553,
-0x45d3d9d9, 0x5fffe4d2, 0x4d49d073, 0xefd74767, 0xdb45e7e7, 0x71bc5e5f,
-0x575a5c49, 0xd459e7e8, 0xcacdf042, 0xdc5945d0, 0x55d8c2d2, 0x584b5643,
-0x5c583c3c, 0xdbfd5863, 0xc15c4d4c, 0xc5bcbf4a, 0xc6db5c64, 0x5bcf4bc1,
-0xc23f4dcc, 0xc1e861c9, 0x5d41384c, 0x434159e3, 0x404b3e53, 0xbf7a7349,
-0x5bcdddda, 0xd05070d8, 0xea57d75d, 0x513fd6c5, 0xd37255dc, 0xdb5bcb53,



Home | Main Index | Thread Index | Old Index