CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun May 3 21:02:24 UTC 2020 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.h Log Message: Avoid common symbol declarations. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/boot.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/zaurus/stand/zboot/boot.h diff -u src/sys/arch/zaurus/stand/zboot/boot.h:1.3 src/sys/arch/zaurus/stand/zboot/boot.h:1.4 --- src/sys/arch/zaurus/stand/zboot/boot.h:1.3 Sat Jun 28 09:16:18 2014 +++ src/sys/arch/zaurus/stand/zboot/boot.h Sun May 3 21:02:24 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.h,v 1.3 2014/06/28 09:16:18 rtr Exp $ */ +/* $NetBSD: boot.h,v 1.4 2020/05/03 21:02:24 joerg Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -37,9 +37,9 @@ extern int debug; /* boot.c */ -char *default_devname; -uint default_unit, default_partition; -const char *default_filename; +extern char *default_devname; +extern uint default_unit, default_partition; +extern const char *default_filename; extern int default_timeout; void boot(dev_t);
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: dholland Date: Sat Jun 11 06:58:42 UTC 2016 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c bootmenu.c Log Message: PR 51200 gets in libsa considered harmful: use kgets To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zboot/bootmenu.c 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/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.7 src/sys/arch/zaurus/stand/zboot/boot.c:1.8 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.7 Tue May 31 04:13:26 2016 +++ src/sys/arch/zaurus/stand/zboot/boot.c Sat Jun 11 06:58:42 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.7 2016/05/31 04:13:26 dholland Exp $ */ +/* $NetBSD: boot.c,v 1.8 2016/06/11 06:58:42 dholland Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro@@ -416,7 +416,7 @@ bootmenu(void) input[0] = '\0'; printf("> "); - gets(input); + kgets(input, sizeof(input)); /* * Skip leading whitespace. Index: src/sys/arch/zaurus/stand/zboot/bootmenu.c diff -u src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.4 src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.5 --- src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.4 Sun Aug 10 07:40:50 2014 +++ src/sys/arch/zaurus/stand/zboot/bootmenu.c Sat Jun 11 06:58:42 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.4 2014/08/10 07:40:50 isaki Exp $ */ +/* $NetBSD: bootmenu.c,v 1.5 2016/06/11 06:58:42 dholland Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -99,7 +99,7 @@ doboottypemenu(void) printf("\nOption: [%d]:", bootcfg_info.def + 1); - gets(input); + kgets(input, sizeof(input)); choice = getchoicefrominput(input, bootcfg_info.def); } else if (bootcfg_info.timeout == 0) choice = bootcfg_info.def;
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: dholland Date: Tue May 31 04:13:26 UTC 2016 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c Log Message: PR 51195 David Binderman: simplify redundant conditional. XXX: there are too many copies of this function floating around ("gettrailer") To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/zaurus/stand/zboot/boot.c 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/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.6 src/sys/arch/zaurus/stand/zboot/boot.c:1.7 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.6 Sat Jun 28 09:16:18 2014 +++ src/sys/arch/zaurus/stand/zboot/boot.c Tue May 31 04:13:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.6 2014/06/28 09:16:18 rtr Exp $ */ +/* $NetBSD: boot.c,v 1.7 2016/05/31 04:13:26 dholland Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro@@ -445,7 +445,7 @@ gettrailer(char *arg) *options++ = '\0'; /* trim leading blanks */ - while (*options && *options == ' ') + while (*options == ' ') options++; return options;
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: matt Date: Wed Aug 27 03:17:21 UTC 2014 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Don't use ${MACHINE} but zaurus instead. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/zaurus/stand/zboot/Makefile 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/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.16 src/sys/arch/zaurus/stand/zboot/Makefile:1.17 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.16 Sun Jan 12 15:26:31 2014 +++ src/sys/arch/zaurus/stand/zboot/Makefile Wed Aug 27 03:17:21 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2014/01/12 15:26:31 tsutsui Exp $ +# $NetBSD: Makefile,v 1.17 2014/08/27 03:17:21 matt Exp $ PROG= zboot @@ -61,7 +61,7 @@ LIBSA= ${SALIB} ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} ${_MKTARGET_LINK} ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == yes :?:-D} \ - ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} + ${VERSIONFILE} zaurus ${NEWVERSWHAT} ${CC} ${CFLAGS} ${CPPFLAGS} -c vers.c ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Wed Mar 26 08:02:38 UTC 2014 Modified Files: src/sys/arch/zaurus/stand/zboot: unixcons.c Log Message: use snprintf To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/unixcons.c 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/zaurus/stand/zboot/unixcons.c diff -u src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 src/sys/arch/zaurus/stand/zboot/unixcons.c:1.3 --- src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 Sat Nov 30 21:54:53 2013 +++ src/sys/arch/zaurus/stand/zboot/unixcons.c Wed Mar 26 04:02:38 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $ */ +/* $NetBSD: unixcons.c,v 1.3 2014/03/26 08:02:38 christos Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro non...@netbsd.org @@ -170,8 +170,7 @@ awaitkey(int timeout, int tell) char numbuf[20]; int len, j; - sprintf(numbuf, %d , i); - len = strlen(numbuf); + len = snprintf(numbuf, sizeof(numbuf), %d , i); for (j = 0; j len; j++) numbuf[len + j] = '\b'; numbuf[len + j] = '\0';
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun Dec 1 02:54:53 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: unixcons.c Log Message: Use format string. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/unixcons.c 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/zaurus/stand/zboot/unixcons.c diff -u src/sys/arch/zaurus/stand/zboot/unixcons.c:1.1 src/sys/arch/zaurus/stand/zboot/unixcons.c:1.2 --- src/sys/arch/zaurus/stand/zboot/unixcons.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/unixcons.c Sun Dec 1 02:54:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: unixcons.c,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro non...@netbsd.org @@ -175,7 +175,7 @@ awaitkey(int timeout, int tell) for (j = 0; j len; j++) numbuf[len + j] = '\b'; numbuf[len + j] = '\0'; - printf(numbuf); + printf(%s, numbuf); } c = common_getc(infd, 1); if (c == 0)
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Mon Nov 4 21:30:16 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: fix more -mno-thumb. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/zaurus/stand/zboot/Makefile 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/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.12 src/sys/arch/zaurus/stand/zboot/Makefile:1.13 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.12 Thu Aug 15 17:41:09 2013 +++ src/sys/arch/zaurus/stand/zboot/Makefile Mon Nov 4 16:30:16 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2013/08/15 21:41:09 matt Exp $ +# $NetBSD: Makefile,v 1.13 2013/11/04 21:30:16 christos Exp $ PROG= zboot @@ -22,7 +22,11 @@ CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -mabi=apcs-gnu -mfloat-abi=soft -mcpu=xscale +.if ${HAVE_GCC} 48 CPPFLAGS+= -mno-thumb -mno-thumb-interwork +.else +CPPFLAGS+= -marm +.endif CPUFLAGS= AFLAGS+= -D_LOCORE LDFLAGS+= -nostdlib -Bstatic
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: christos Date: Mon Nov 4 21:59:15 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: unixdev.c Log Message: fix unused variables To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/zaurus/stand/zboot/unixdev.c 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/zaurus/stand/zboot/unixdev.c diff -u src/sys/arch/zaurus/stand/zboot/unixdev.c:1.3 src/sys/arch/zaurus/stand/zboot/unixdev.c:1.4 --- src/sys/arch/zaurus/stand/zboot/unixdev.c:1.3 Wed Jan 18 18:12:21 2012 +++ src/sys/arch/zaurus/stand/zboot/unixdev.c Mon Nov 4 16:59:15 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: unixdev.c,v 1.3 2012/01/18 23:12:21 nonaka Exp $ */ +/* $NetBSD: unixdev.c,v 1.4 2013/11/04 21:59:15 christos Exp $ */ /* $OpenBSD: unixdev.c,v 1.6 2007/06/16 00:26:33 deraadt Exp $ */ /* @@ -86,6 +86,8 @@ unixopen(struct open_file *f, ...) #ifdef UNIX_DEBUG printf(%s: devname=%s, unit=%d, partition=%d, fname=%s\n, __func__, devname, unit, partition, fname); +#else + __USE(fname); #endif f-f_devdata = NULL; @@ -146,6 +148,8 @@ unixpathopen(struct open_file *f, ...) #ifdef UNIX_DEBUG printf(%s: devname=%s, unit=%d, partition=%d, fname=%s\n, __func__, devname, unit, partition, fname); +#else + __USE(devname); __USE(partition); __USE(unit); #endif if (fname == NULL || fname[0] == '\0')
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: matt Date: Mon Aug 12 22:50:51 UTC 2013 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Add -fno-unwind-tables To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/zaurus/stand/zboot/Makefile 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/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.10 src/sys/arch/zaurus/stand/zboot/Makefile:1.11 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.10 Thu May 2 03:56:42 2013 +++ src/sys/arch/zaurus/stand/zboot/Makefile Mon Aug 12 22:50:51 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2013/05/02 03:56:42 matt Exp $ +# $NetBSD: Makefile,v 1.11 2013/08/12 22:50:51 matt Exp $ PROG= zboot @@ -17,6 +17,7 @@ NOMAN= # defined CFLAGS+= -Wall -Wno-main CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CFLAGS+= -fno-stack-protector -fno-builtin -ffreestanding +CFLAGS+= -fno-unwind-tables CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: nonaka Date: Wed Jan 18 23:12:22 UTC 2012 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile boot.c boot.h bootmenu.c conf.c devopen.c diskprobe.c pathnames.h unixdev.c unixdev.h version Added Files: src/sys/arch/zaurus/stand/zboot: pathfs.c pathfs.h Log Message: Support to read the kernel from local file system. ex. boot path:/mnt/card/netbsd To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/zaurus/stand/zboot/Makefile cvs rdiff -u -r1.4 -r1.5 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/boot.h \ src/sys/arch/zaurus/stand/zboot/bootmenu.c \ src/sys/arch/zaurus/stand/zboot/conf.c \ src/sys/arch/zaurus/stand/zboot/devopen.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/diskprobe.c \ src/sys/arch/zaurus/stand/zboot/pathnames.h \ src/sys/arch/zaurus/stand/zboot/unixdev.c \ src/sys/arch/zaurus/stand/zboot/unixdev.h \ src/sys/arch/zaurus/stand/zboot/version cvs rdiff -u -r0 -r1.1 src/sys/arch/zaurus/stand/zboot/pathfs.c \ src/sys/arch/zaurus/stand/zboot/pathfs.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/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.7 src/sys/arch/zaurus/stand/zboot/Makefile:1.8 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.7 Sun Dec 25 06:09:10 2011 +++ src/sys/arch/zaurus/stand/zboot/Makefile Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2011/12/25 06:09:10 tsutsui Exp $ +# $NetBSD: Makefile,v 1.8 2012/01/18 23:12:21 nonaka Exp $ PROG= zboot @@ -8,6 +8,7 @@ SRCS= crt0.c SRCS+= boot.c bootinfo.c bootmenu.c conf.c devopen.c diskprobe.c SRCS+= loadfile_zboot.c SRCS+= getsecs.c termios.c unixcons.c unixdev.c unixsys.S +SRCS+= pathfs.c NOMAN= # defined @@ -33,7 +34,7 @@ NEWVERSWHAT?= Boot VERSIONFILE?= ${.CURDIR}/version ### find out what to use for libkern -KERN_AS= library +KERN_AS= library .include ${S}/lib/libkern/Makefile.inc LIBKERN= ${KERNLIB} @@ -48,7 +49,7 @@ SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE .include ${S}/lib/libsa/Makefile.inc LIBSA= ${SALIB} -${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} +${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${VERSIONFILE} ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == yes :?:-D} \ ${VERSIONFILE} ${MACHINE} ${NEWVERSWHAT} ${CC} -c vers.c Index: src/sys/arch/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.4 src/sys/arch/zaurus/stand/zboot/boot.c:1.5 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.4 Sun Dec 25 06:09:10 2011 +++ src/sys/arch/zaurus/stand/zboot/boot.c Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.4 2011/12/25 06:09:10 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.5 2012/01/18 23:12:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro non...@netbsd.org @@ -53,6 +53,7 @@ const char *default_filename; int default_timeout = 5; static char probed_disks[256]; +static char bootconfpath[1024]; static void bootcmd_help(char *); static void bootcmd_ls(char *); @@ -196,7 +197,10 @@ boot(dev_t bootdev) diskprobe(probed_disks, sizeof(probed_disks)); - parsebootconf(_PATH_BOOTCONF); + snprintf(bootconfpath, sizeof(bootconfpath), %s%d%c:%s, + default_devname, default_unit, 'a' + default_partition, + _PATH_BOOTCONF); + parsebootconf(bootconfpath); #ifdef SUPPORT_CONSDEV /* @@ -296,8 +300,9 @@ bootcmd_help(char *arg) { printf(commands are:\n - boot [xdNx:][filename] [-acdqsv]\n - (ex. \hd0a:netbsd.old -s\\n + boot [xdNx:][filename] [-1acdqsv]\n + (ex. \boot hd0a:netbsd.old -s\)\n + (ex. \boot path:/mnt/card/netbsd -1\)\n ls [path]\n #ifdef SUPPORT_CONSDEV consdev {glass|com [speed]}\n Index: src/sys/arch/zaurus/stand/zboot/boot.h diff -u src/sys/arch/zaurus/stand/zboot/boot.h:1.1 src/sys/arch/zaurus/stand/zboot/boot.h:1.2 --- src/sys/arch/zaurus/stand/zboot/boot.h:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/boot.h Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.h,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: boot.h,v 1.2 2012/01/18 23:12:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro @@ -52,6 +52,7 @@ void bootmenu(void); /* conf.c */ extern char devname_hd[]; extern char devname_mmcd[]; +extern char devname_path[]; /* loadfile_zboot.c */ int loadfile_zboot(const char *fname, u_long *marks, int flags); Index: src/sys/arch/zaurus/stand/zboot/bootmenu.c diff -u src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.1 src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.2 --- src/sys/arch/zaurus/stand/zboot/bootmenu.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/bootmenu.c Wed Jan 18 23:12:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.1
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: nonaka Date: Mon Jun 20 12:39:21 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zboot: boot.c compat_linux.h diskprobe.c pathnames.h unixdev.h unixsys.S version Log Message: support SL-C1000. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/zaurus/stand/zboot/boot.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/zaurus/stand/zboot/compat_linux.h \ src/sys/arch/zaurus/stand/zboot/diskprobe.c \ src/sys/arch/zaurus/stand/zboot/pathnames.h \ src/sys/arch/zaurus/stand/zboot/unixdev.h \ src/sys/arch/zaurus/stand/zboot/unixsys.S \ src/sys/arch/zaurus/stand/zboot/version 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/zaurus/stand/zboot/boot.c diff -u src/sys/arch/zaurus/stand/zboot/boot.c:1.2 src/sys/arch/zaurus/stand/zboot/boot.c:1.3 --- src/sys/arch/zaurus/stand/zboot/boot.c:1.2 Sat Jan 22 19:19:25 2011 +++ src/sys/arch/zaurus/stand/zboot/boot.c Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.2 2011/01/22 19:19:25 joerg Exp $ */ +/* $NetBSD: boot.c,v 1.3 2011/06/20 12:39:21 nonaka Exp $ */ /* * Copyright (c) 2009 NONAKA Kimihiro non...@netbsd.org @@ -128,7 +128,7 @@ } while (isnum(fname[i])); } -#define isvalidpart(c) ((c) = 'a' (c) = 'a' + MAXPARTITIONS) +#define isvalidpart(c) ((c) = 'a' (c) 'a' + MAXPARTITIONS) if (i devlen) { if (!isvalidpart(fname[i])) return (EPART); Index: src/sys/arch/zaurus/stand/zboot/compat_linux.h diff -u src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.1 src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.2 --- src/sys/arch/zaurus/stand/zboot/compat_linux.h:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/compat_linux.h Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_linux.h,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: compat_linux.h,v 1.2 2011/06/20 12:39:21 nonaka Exp $ */ /* $OpenBSD: compat_linux.h,v 1.8 2007/06/16 00:26:33 deraadt Exp $ */ /* @@ -60,6 +60,7 @@ #define __NR_ioctl (__NR_SYSCALL_BASE + LINUX_SYS_ioctl) #define __NR_select (__NR_SYSCALL_BASE + LINUX_SYS_select) #define __NR_stat (__NR_SYSCALL_BASE + LINUX_SYS_stat) +#define __NR_fstat (__NR_SYSCALL_BASE + LINUX_SYS_fstat) #define __NR_syscall (__NR_SYSCALL_BASE + 113) #undef SYS_select Index: src/sys/arch/zaurus/stand/zboot/diskprobe.c diff -u src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.1 src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.2 --- src/sys/arch/zaurus/stand/zboot/diskprobe.c:1.1 Mon Mar 2 09:33:02 2009 +++ src/sys/arch/zaurus/stand/zboot/diskprobe.c Mon Jun 20 12:39:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: diskprobe.c,v 1.1 2009/03/02 09:33:02 nonaka Exp $ */ +/* $NetBSD: diskprobe.c,v 1.2 2011/06/20 12:39:21 nonaka Exp $ */ /* $OpenBSD: diskprobe.c,v 1.3 2006/10/13 00:00:55 krw Exp $ */ /* @@ -40,14 +40,20 @@ #include boot.h #include disk.h #include unixdev.h +#include pathnames.h #include compat_linux.h +/* All the info on /proc/partitions */ +struct partinfo { + char devname[MAXDEVNAME]; + TAILQ_ENTRY(partinfo) list; +}; +TAILQ_HEAD(partlist_lh, partinfo); +struct partlist_lh partlist; + /* Disk spin-up wait timeout. */ static u_int timeout = 10; -/* Local Prototypes */ -static void hardprobe(char *buf, size_t bufsiz); - /* List of disk devices we found/probed */ struct disklist_lh disklist; @@ -129,11 +135,130 @@ strlcat(buf, none..., bufsiz); } +static void +getpartitions(void) +{ + struct linux_stat sb; + struct partinfo *pip; + char *bc, *top, *next, *p, *q; + int fd, off, len; + + fd = uopen(_PATH_PARTITIONS, LINUX_O_RDONLY); + if (fd == -1) + return; + + if (ufstat(fd, sb) 0) { + uclose(fd); + return; + } + + bc = alloc(sb.lst_size + 1); + if (bc == NULL) { + printf(Could not allocate memory for %s\n, _PATH_PARTITIONS); + uclose(fd); + return; + } + + off = 0; + do { + len = uread(fd, bc + off, 1024); + if (len = 0) + break; + off += len; + } while (len 0); + bc[off] = '\0'; + + uclose(fd); + + /* bc now contains the whole /proc/partitions */ + for (p = bc; *p != '\0'; p = next) { + top = p; + + /* readline */ + for (; *p != '\0' *p != '\r' *p != '\n'; p++) + continue; + if (*p == '\r') { + *p++ = '\0'; + if (*p == '\n') +*p++ = '\0'; + } else if (*p == '\n') + *p++ = '\0'; + next = p; + + /* + * /proc/partitions format: + * major minor #blocks name + * + * %d%d %d %s + * + * e.g.: + * major minor #blocks name + * + * 22 07962192 hdc + * 22 1 10079 hdc1 + * 60 0 965120 mmcda + * 60 1 43312 mmcda1 + */ + + /* trailing space */ + for (p = top; *p == ' ' || *p == '\t'; p++) + continue; + + /* major */ + for (; isdigit(*p); p++) + continue; + if (*p != ' ' *p != '\t') + continue; /* next line */ + for (; *p == ' ' || *p == '\t'; p++) +
CVS commit: src/sys/arch/zaurus/stand/zboot
Module Name:src Committed By: joerg Date: Sun Jan 23 13:17:02 UTC 2011 Modified Files: src/sys/arch/zaurus/stand/zboot: Makefile Log Message: Defer bsd.own.mk include after NOMAN. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/zaurus/stand/zboot/Makefile 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/zaurus/stand/zboot/Makefile diff -u src/sys/arch/zaurus/stand/zboot/Makefile:1.5 src/sys/arch/zaurus/stand/zboot/Makefile:1.6 --- src/sys/arch/zaurus/stand/zboot/Makefile:1.5 Sat Jan 22 19:19:25 2011 +++ src/sys/arch/zaurus/stand/zboot/Makefile Sun Jan 23 13:17:02 2011 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2011/01/22 19:19:25 joerg Exp $ - -.include bsd.own.mk +# $NetBSD: Makefile,v 1.6 2011/01/23 13:17:02 joerg Exp $ PROG= zboot @@ -13,6 +11,8 @@ NOMAN= # defined +.include bsd.own.mk + CFLAGS+= -Wall -Wno-main CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CFLAGS+= -fno-stack-protector -fno-builtin -ffreestanding