From owner-FreeBSD-users-jp@jp.freebsd.org  Thu Feb 17 16:29:14 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id QAA73429;
	Thu, 17 Feb 2000 16:29:14 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from rins.st.ryukoku.ac.jp (rins.st.ryukoku.ac.jp [133.83.4.1])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id QAA73420
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 17 Feb 2000 16:29:12 +0900 (JST)
	(envelope-from kjm@ideon.st.ryukoku.ac.jp)
Received: from ideon.st.ryukoku.ac.jp (ideon.st.ryukoku.ac.jp [133.83.36.5])
	by rins.st.ryukoku.ac.jp (8.9.3+3.2W/3.7W/RINS-1.9.6-NOSPAM) with ESMTP id QAA06546
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 17 Feb 2000 16:29:11 +0900 (JST)
Received: from ideon.st.ryukoku.ac.jp (kjm@localhost [127.0.0.1])
	by ideon.st.ryukoku.ac.jp (8.9.3/3.7W/kjm-19990628) with ESMTP id QAA11029
	for <FreeBSD-users-jp@jp.freebsd.org>; Thu, 17 Feb 2000 16:29:11 +0900 (JST)
From: kjm@rins.ryukoku.ac.jp (KOJIMA Hajime /
    =?ISO-2022-JP?B?GyRCPi5FZ0glGyhC?=)
To: FreeBSD-users-jp@jp.freebsd.org
In-reply-to: Your message of "16 Feb 2000 15:56:50 JST."
	<85itzp7hzh.fsf@meadow.scphys.kyoto-u.ac.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
Date: Thu, 17 Feb 2000 16:29:11 +0900
Message-ID: <11025.950772551@ideon.st.ryukoku.ac.jp>
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: FreeBSD-users-jp 49819
Subject: [FreeBSD-users-jp 49819] Re: FreeBSD(98) 2.2-stable (?) make buildworld
 =?ISO-2022-JP?B?GyRCPDpHVBsoQg==?= 
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: kjm@ideon.st.ryukoku.ac.jp

<85itzp7hzh.fsf@meadow.scphys.kyoto-u.ac.jp>$B$K$*$$$F(B
Akio Morita $B$5$s$,$*$C$7$c$k$K$O(B:
| $B?9ED!w5~Bg$G$9(B
 
  $B$465<x$"$j$,$H$&$4$6$$$^$9!#(B 
 
| KOJIMA Hajime /    $B>.EgH%(B(kjm@rins.ryukoku.ac.jp)$B$5$s$O!"(B
| Wed, 16 Feb 2000 15:00:53 +0900$B$K(B
| $B!V(B[FreeBSD-users-jp 49809] FreeBSD(98) 2.2-stable (?) make buildworld $B<:GT!W$N(BMessage
$B$G=q$-$^$7$?(B
| 
| $B!d(B
| $B!d(B  FreeBSD(98) 2.2.8-RELEASE-Rev02 $B$+$i(B 2.2-stable $BAjEv$N(B FreeBSD(98)
| $B!d(B  $B$K0\9T$7$h$&$H$7$F$$$k$N$G$9$,!"$&$^$/$$$-$^$;$s!#(B
| $B!d(B
| $B!d$d$C$?$3$H(B
| $B!d(B----------
| $B!d(B
| $B!d(B1.  cvsup $B$G(B FreeBSD 2.2-stable $B$rF~<j!#(B
| $B!d(B2.  $B$3$l$K(B FreeBSD(98) 2.2.8R-Rev03 $B$N(B 98src/ $B$r>e=q$-%$%s%9%H!<%k!#(B
| $B!d(B3.  make buildworld $B$9$k$H(B /usr/obj/usr/src/lkm/pcic/pcic.o $B$N:n@.$K<:GT!#(B
| $B!d(B4.  /usr/src/sys/pccard/ $B$K(B /usr/src/sys/i386/isa/pcic.h $B$X$N(B symbolic
| $B!d(B    link $B$r:n@.$9$k!#$9$k$H!"(Bpcic.o $B$O:n@.$G$-$k$,!":#EY$O(B
| $B!d(B    /usr/obj/usr/src/lkm/pcic/pcic_mod.o $B$N:n@.$K<:GT$9$k!#(B
| $B!d(B
| sys/pccard/pcic.c$B$r8+$l$PJ,$j$^$9$,!"5a$a$i$l$F$$$k(B pcic.h$B$O(B
| config(8)$B$,@8@.$9$k$b$N$G(B kernel$B9=C[;~$K(B NPCIC$BDj?t$rD4$Y$k$N$K(B
| $B;H$&$b$N$G$9!#(BLKM$B9=C[;~$K$O!"%=!<%9$r6&M-$9$k$?$a$K(B dummy$B$N(B
| pcic.h$B$r@8@.$9$kI,MW$,$"$j$^$9(B
| 
| Fix$B$G$9$,!"(B"#define NPCIC 1"$B$r4^$`(B pcic.h$B$r@8@.$9$k$,@52r(B
| Makefile$B$N=q$-J}$O(B src/lkm/atapi/Makefile$B$J$I$r;29M$9$Y$7(B
 
  $B$=$&$@$C$?$N$G$9$+!#$3$&$7$^$7$?(B:

--- lkm/pcic/Makefile.back	Thu Feb 17 15:13:55 2000
+++ lkm/pcic/Makefile	Thu Feb 17 15:14:53 2000
@@ -7,4 +7,7 @@
 PSEUDO_LKM=
 CFLAGS+= -DLKM
 
+pcic.h:
+	echo "#define NPCIC 1" > pcic.h
+
 .include <bsd.kmod.mk>

| $B$"$H!"0l1~3NG'$G$9$,!"(BLKM$B$N(B pcic_mod$B$,I,MW$J$N$G$7$g$&$+(B?
| LKM$B$,I,MW$J$$$J$i0J2<$NA*Br$,$"$j$^$9(B
| 1. pcic$B$OI,MW$J$$(B
|    src/sys/lkm/Makefile$B$+$i(B pcic$B$r=|30$9$k(B
| 2. pcic$B$N5!G=$,I,MW(B
|    LKM$B$G$O$J$/(B kernel$B$KAH$_9~$`(B
 
  $B$=$&$$$&<j$b$"$k$o$1$G$9$+!#$J$k$[$I$G$9!#(B
 
| $B$D$$$G$K(B 2.2 Branch$B$K8B$i$:(B FreeBSD(98)$B$G(B Branch$B$rDI$$3]$1$k>l9g$N(B
| $B0lHLO@$G$9$,!"4pK\E*$K(B 98src$B$r>e=q$-$7$F$O9T$1$^$;$s!*(B
$B!D!D(B
| cvsup$B$7$?%=!<%9%D%j!<$K(B 98src/patches.tar.gz$B$rE83+$7$F0l$D0l$D(B patch$B$r(B
| $BEv$F$k$N$,@52r$G$9(B

  $B$d$C$F$_$^$7$?!#:rF|(B (2000.02.16) $B;~E@$N(B 2.2-stable $B$KBP$7$F$N7k2L$G$9!#(B

* base.diff

  $BLdBj$J$7!#(B

* contrib.diff

  contrib/cvs/contrib/log.pl $B$H(B contrib/cvs/contrib/sccs2rcs.csh $B$KBP(B
  $B$9$k(B patch $B$O$9$G$KE,MQ$5$l$F$$$k$N$G(B 
  
Patching file xxx using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y] 

  $B$H8@$o$l$k!#(Bn $B$GEz$($F(B

Apply anyway? [n] 

  $B$b(B n $B$GEz$($F(B ignore $B$5$;$k!#(B.rej $B%U%!%$%k$,$G$-$k$,L5;k$7$F$h$$!#(B

* etc.diff

  $BLdBj$J$7!#(B

* lib.diff

  lib/libc/gen/fts.c.rej $B$,$G$-$k$,L5;k$7$F$$$$!#(B

* lkm.diff

  $BLdBj$J$7!#(B

* gnu.diff

  $BEv$F$J$/$F$$$$!#(B

* release.diff

    release/sysinstall/install.c.rej
    release/sysinstall/installUpgrade.c.rej
    release/sysinstall/menus.c.rej
    release/texts/HARDWARE.TXT.rej
    release/texts/RELNOTES.TXT.rej
    release/doFS.sh.rej

  $B$,$G$-$k!#$3$N$&$A!"(BHARDWARE.TXT.rej $B$H(B RELNOTES.TXT.rej $B$OL5;k$7$F(B
  $B$$$$!#(Brelease/sysinstall/install.c,
  release/sysinstall/installUpgrade.c, release/sysinstall/menus.c,
  release/doFS.sh $B$K$D$$$F$O<!$N(B patch $B$rE,MQ$9$k(B ($BCm0U(B: patch $B%U%!%$%k(B
  $B$N4A;z%3!<%I$OF|K\8l(B EUC $B$H$9$k$3$H(B)$B!#(B

--- ./release/sysinstall/install.c.back	Thu Feb 17 14:48:53 2000
+++ ./release/sysinstall/install.c	Thu Feb 17 14:49:11 2000
@@ -419,22 +419,30 @@
     args.fspec = mediaDevice->devname;
 
     while (1) {
-	msgConfirm("Please insert a writable fixit floppy and press return");
+	KANJI_MESSAGE("$B=q$-9~$_2DG=$J(B fixit $B%U%m%C%T!<$rF~$l$F%j%?!<%s$r2!$7$F2<$5$$(B.");
+	msgConfirm(KM("Please insert a writable fixit floppy and press return"));
 	mediaDevice->private = "/mnt2";
 	if (!mediaDevice->init(mediaDevice)) {
-	    if (msgYesNo("The attempt to mount the fixit floppy failed, bad floppy\n"
-			 "or unclean filesystem.  Do you want to try again?"))
+	    KANJI_MESSAGE(
+	    "fixit $B%U%m%C%T!<$N%^%&%s%H$K<:GT$7$^$7$?(B. $B%U%m%C%T!<$NITNI$+%U%!%$%k(B\n"
+	    "$B%7%9%F%`$,%/%j!<%s$J>uBV$G$O$J$$$N$G$7$g$&(B. $B$b$&0lEY;n$_$^$9$+(B?");
+	    if (msgYesNo(KM("The attempt to mount the fixit floppy failed, bad floppy\n"
+			 "or unclean filesystem.  Do you want to try again?")))
 		return DITEM_FAILURE;
 	}
 	else
 	    break;
     }
+
     if (!directory_exists("/tmp"))
 	(void)symlink("/mnt2/tmp", "/tmp");
+
     fixit_common();
+
     mediaDevice->shutdown(mediaDevice);
     mediaDevice = NULL;
-    msgConfirm("Please remove the fixit floppy now.");
+    KANJI_MESSAGE("fixit $B%U%m%C%T!<$rH4$$$F2<$5$$(B.");
+    msgConfirm(KM("Please remove the fixit floppy now."));
     return DITEM_SUCCESS;
 }
 
--- ./release/sysinstall/installUpgrade.c.back	Thu Feb 17 14:49:50 2000
+++ ./release/sysinstall/installUpgrade.c	Thu Feb 17 14:50:12 2000
@@ -166,6 +166,9 @@
 {
     char saved_etc[FILENAME_MAX];
     Boolean extractingBin = TRUE;
+#ifdef PC98
+    Boolean extracting98Bin = TRUE;
+#endif
 
     if (variable_get(VAR_NONINTERACTIVE))
 	return installUpgradeNonInteractive(self);
@@ -175,17 +178,25 @@
     dialog_clear_norefresh();
 
     if (!Dists) {
-	msgConfirm("First, you must select some distribution components.  The upgrade procedure\n"
-		   "will only upgrade the distributions you select in the next set of menus.");
+	KANJI_MESSAGE(
+	"$B:G=i$K(B, $BG[I[%3%s%]!<%M%s%H$rA*$s$G$/$@$5$$(B. $B%"%C%W%0%l!<%I$N>l9g$O(B\n"
+	"$B<!$N%a%K%e!<%;%C%H$G;XDj$5$l$?G[I[$N$_$,%"%C%W%0%l!<%I$5$l$^$9(B.");
+	msgConfirm(KM("First, you must select some distribution components.  The upgrade procedure\n"
+		   "will only upgrade the distributions you select in the next set of menus."));
 	if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists)
 	    return DITEM_FAILURE | DITEM_RESTORE;
 	dialog_clear_norefresh();
     }
     else if (!(Dists & DIST_BIN)) {	    /* No bin selected?  Not much of an upgrade.. */
-	if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
+	KANJI_MESSAGE(
+	"$BFI$_9~$`%U%!%$%k$H$7$FG[I[%U%!%$%k(B bin $B$rA*Br$7$F$$$^$;$s(B. $B$3$l$O(B\n"
+	"$B3N<B$K%"%C%W%0%l!<%I$9$k$N$KHs>o$K=EMW$J%U%!%$%k$G$9(B. $BK\Ev$K(B bin\n"
+	"$BG[I[%U%!%$%k$J$7$K%"%C%W%0%l!<%I$7$F$b$$$$$N$G$9$+(B? $B$b$7G[I[%U%!%$(B\n"
+	"$B%k$NA*Br%a%K%e!<$K:F$SLa$k>l9g$O(B No $B$rA*Br$7$F2<$5$$(B.");
+	if (msgYesNo(KM("You didn't select the bin distribution as one of the distributons to load.\n"
 		     "This one is pretty vital to a successful upgrade.  Are you SURE you don't\n"
 		     "want to select the bin distribution?  Chose No to bring up the Distributions\n"
-		     "menu again.") != 0) {
+		     "menu again.")) != 0) {
 	    if (!dmenuOpenSimple(&MenuDistributions, FALSE))
 		return DITEM_FAILURE | DITEM_RESTORE;
 	    dialog_clear_norefresh();
@@ -193,10 +204,15 @@
     }
 
     /* Still?!  OK!  They must know what they're doing.. */
+#ifdef PC98
+    if (!(Dists & DIST_98BIN))
+	extracting98Bin = FALSE;
+#endif
     if (!(Dists & DIST_BIN))
 	extractingBin = FALSE;
 
-    if (msgYesNo("Last chance, are you sure you want to proceed with this upgrade?") != 0)
+    KANJI_MESSAGE("$B:G8e$N%A%c%s%9$G$9(B, $B$=$l$G$bK\Ev$K%"%C%W%0%l!<%I$r<B9T$7$^$9$M(B?");
+    if (msgYesNo(KM("Last chance, are you sure you want to proceed with this upgrade?")) != 0)
 	return DITEM_FAILURE | DITEM_RESTORE;
 
     if (RunningAsInit) {
--- ./release/sysinstall/menus.c.back	Thu Feb 17 14:51:39 2000
+++ ./release/sysinstall/menus.c	Thu Feb 17 14:51:44 2000
@@ -993,8 +993,16 @@
 	dmenuFlagCheck,	dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES },
       { "catman",	"Preformatted system manual pages",
 	dmenuFlagCheck,	dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_CATPAGES },
+#ifdef JMAN
+      { "jcatman",	"Japanease Preformatted system manual pages",
+        dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_JCATPAGES },
+#endif
       { "proflibs",	"Profiled versions of the libraries",
 	dmenuFlagCheck,	dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PROFLIBS },
+#if defined(PC98) && defined(PC98SRC)
+      { "98src",	"PC98 sources for everything",
+	src98FlagCheck,	distSet98Src },
+#endif /* defined(PC98) && defined(PC98SRC) */
       { "src",		"Sources for everything but DES",
 	srcFlagCheck,	distSetSrc },
       { "ports",	"The FreeBSD Ports collection",
@@ -1085,6 +1093,69 @@
 	checkTrue,	dmenuExit, NULL, NULL, '<', '<', '<' },
       { NULL } },
 };
+
+#if defined(PC98) && defined(PC98SRC)
+DMenu Menu98SrcDistributions = {
+    DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS ,
+    "Select the sub-components of 98src you wish to install.",
+    "Please check off those portions of the FreeBSD(98) source tree\n"
+    "you wish to install.",
+    NULL,
+    NULL,
+    {
+      { "base",		"top-level files in /usr/src",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_BASE },
+      { "contrib",	"/usr/src/contrib (contributed software)",
+	dmenuFlagCheck,	dmenuSetFlag,	NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_CONTRIB },
+#if 0
+      { "gnu",		"/usr/src/gnu (software from the GNU Project)",
+	dmenuFlagCheck,	dmenuSetFlag,	NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_GNU },
+#endif
+      { "etc",		"/usr/src/etc (miscellaneous system files)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_ETC },
+#if 0
+      { "games",	"/usr/src/games (the obvious!)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_GAMES },
+      { "include",	"/usr/src/include (header files)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_INCLUDE },
+#endif
+      { "lib",		"/usr/src/lib (system libraries)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_LIB },
+#if 0
+      { "libexec",	"/usr/src/libexec (system programs)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_LIBEXEC },
+#endif
+      { "lkm",		"/usr/src/lkm (Loadable Kernel Modules)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_LKM	},
+      { "release",	"/usr/src/release (release-generation tools)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_RELEASE },
+#if 0
+      { "bin",		"/usr/src/bin (system binaries)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_BIN },
+#endif
+      { "sbin",		"/usr/src/sbin (system binaries)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_SBIN },
+      { "share",	"/usr/src/share (documents and shared files)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_SHARE },
+      { "sys",		"/usr/src/sys (FreeBSD(98) kernel)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_SYS },
+      { "ubin",		"/usr/src/usr.bin (user binaries)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_UBIN },
+      { "usbin",	"/usr/src/usr.sbin (aux system binaries)",
+	dmenuFlagCheck,	dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_USBIN },
+#if 0
+      { "smailcf",	"/usr/src/usr.sbin (sendmail config macros)",
+	dmenuFlagCheck, dmenuSetFlag, NULL, &Src98Dists, '[', 'X', ']', DIST_SRC_SMAILCF },
+#endif
+      { "All",		"Select all of the above",
+	NULL,		set98Src, NULL, NULL, ' ', ' ', ' ' },
+      { "Clear",	"Reset all of the above",
+	NULL,		clear98Src, NULL, NULL, ' ', ' ', ' ' },
+      { "Exit",		"Exit this menu (returning to previous)",
+	checkTrue,	dmenuExit, NULL, NULL, '<', '<', '<' },
+      { NULL } },
+};
+#endif /* defined(PC98) && defined(PC98SRC) */
 
 DMenu MenuXF86Select = {
     DMENU_NORMAL_TYPE,
--- ./release/doFS.sh.back	Thu Feb 17 14:51:04 2000
+++ ./release/doFS.sh	Thu Feb 17 14:51:09 2000
@@ -34,16 +34,32 @@
 	awk 'BEGIN {printf "%c%c", 85, 170}' |\
 	    dd of=fs-image obs=1 seek=510 conv=notrunc 2>/dev/null
 
-	vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
+#	vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
+	vnconfig -r labels -c /dev/r${VNDEVICE} fs-image
 
-	disklabel -Brw \
-		-b ${RD}/trees/bin/usr/mdec/fdboot \
-		-s ${RD}/trees/bin/usr/mdec/bootfd \
+	sed '/^minimum:/,$d' /etc/disktab > /etc/disktab.tmp
+	cat /etc/disktab.tmp > /etc/disktab
+	rm -f /etc/disktab.tmp
+	(
+	a=`expr ${FSSIZE} \* 2`
+	echo 
+	echo "minimum:ty=mfs:se#512:nt#1:rm#300:\\"
+	#echo "	:ns#$a:nc#1:\\"
+	echo "	:ns#$a:nc#1:sb#512:\\"
+	echo "	:pa#$a:oa#0:ba#4096:fa#512:\\"
+	echo "	:pc#$a:oc#0:bc#4096:fc#512:"
+	echo
+	) >> /etc/disktab
+
+	disklabel -w -r -B \
+		-b ${RD}/trees/98bin/usr/mdec/fdboot \
+		-s ${RD}/trees/98bin/usr/mdec/bootfd \
 		/dev/r${VNDEVICE} minimum
 
-	newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum -o space /dev/r${VNDEVICE}c
+	#newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum -o space /dev/r${VNDEVICE}c
+	newfs -u 0 -t 0 -i ${FSINODE} -m 0 -p 0 -x 0 -T minimum -o space /dev/r${VNDEVICE}a
 
-	mount /dev/${VNDEVICE}c ${MNT}
+	mount /dev/${VNDEVICE}a ${MNT}
 
 	( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} )
 
@@ -53,7 +69,7 @@
 
 	umount ${MNT}
 
-	fsck -p /dev/r${VNDEVICE}c < /dev/null
+	fsck -p /dev/r${VNDEVICE}a < /dev/null
 
 	vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
 
* sbin.diff

  sbin/shutdown/shutdown.c.rej $B$,$G$-$k$,L5;k$7$F$$$$!#(B

* share.diff

  $BLdBj$J$7!#(B

* usr.sbin.diff

  usr.sbin/adduser/adduser.perl, usr.sbin/amd/amd/xutil.c,
  usr.sbin/cron/lib/misc.c, usr.sbin/xntpd/parse/util/dcfd.c $B$X$N(B
  patch $B$O$9$G$KE,MQ$5$l$F$$$k$N$G(B

Patching file xxx using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y] 

  $B$H8@$o$l$k!#(Bn $B$GEz$($F(B

Apply anyway? [n] 

  $B$b(B n $B$GEz$($F(B ignore $B$5$;$k!#(B.rej $B%U%!%$%k$,$G$-$k$,L5;k$7$F$h$$!#(B

  usr.sbin/apm/apm.c.rej $B$,$G$-$k!#$3$l$K$D$$$F$O<!$N(B patch $B$rE,MQ$9$k!#(B 

--- ./usr.sbin/apm/apm.c.back	Thu Feb 17 14:59:28 2000
+++ ./usr.sbin/apm/apm.c	Thu Feb 17 14:59:36 2000
@@ -13,78 +13,251 @@
  * Sep., 1994	Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
  */
 
-#ifndef lint
-static const char rcsid[] =
-  "$FreeBSD: src/usr.sbin/apm/apm.c,v 1.6.2.3 1999/09/05 11:40:03 peter Exp $";
-#endif /* not lint */
-
-#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
-#include <unistd.h>
 #include <machine/apm_bios.h>
+#include <time.h>
 
 #define APMDEV	"/dev/apm"
 
-void
-usage()
+#define xh(a)	(((a) & 0xff00) >> 8)
+#define xl(a)	((a) & 0xff)
+#define APMERR(a) xh(a)
+
+int cmos_wall = 0;	/* True when wall time is in cmos clock, else UTC */
+
+int     main_argc;
+char  **main_argv;
+
+int
+bcd2int(int bcd)
 {
-	fprintf(stderr, "%s\n%s\n",
-		"usage: apm [-ablsz] [-d 1|0]",
-		"       zzz");
-	exit(1);
+	int retval = 0;
+
+	if (bcd > 0x9999)
+		return -1;
+
+	while (bcd) {
+		retval = retval * 10 + ((bcd & 0xf000) >> 12);
+		bcd = (bcd & 0xfff) << 4;
+	}
+	return retval;
 }
 
 void 
 apm_suspend(int fd)
 {
-	if (ioctl(fd, APMIO_SUSPEND, NULL) == -1)
+	if (ioctl(fd, APMIO_SUSPEND, NULL) == -1) {
+		perror(main_argv[0]);
+		exit(1);
+	}
+}
+
+void 
+apm_standby(int fd)
+{
+	if (ioctl(fd, APMIO_STANDBY, NULL) == -1)
 		err(1, NULL);
 }
 
 void 
 apm_getinfo(int fd, apm_info_t aip)
 {
-	if (ioctl(fd, APMIO_GETINFO, aip) == -1)
-		err(1, NULL);
+	if (ioctl(fd, APMIO_GETINFO, aip) == -1) {
+		perror(main_argv[0]);
+		exit(1);
+	}
 }
 
 void 
-print_all_info(apm_info_t aip)
+print_all_info(int fd, apm_info_t aip)
 {
+	struct apm_bios_arg args;
+	int apmerr, i;
+#ifdef PC98
+	u_int n, stat, batt;
+	static char bn[][9] = { "[1st] ", "  [2nd] " };
+#endif
+
 	printf("APM version: %d.%d\n", aip->ai_major, aip->ai_minor);
 	printf("APM Managment: %s\n", (aip->ai_status ? "Enabled" : "Disabled"));
 	printf("AC Line status: ");
-	if (aip->ai_acline == 255)
+	if (aip->ai_acline == 255) {
 		printf("unknown");
-	else if (aip->ai_acline > 1)
-		printf("invalid value (0x%x)", aip->ai_acline);
-	else {
-		char messages[][10] = {"off-line", "on-line"};
-		printf("%s", messages[aip->ai_acline]);
+	} else {
+		if (aip->ai_acline > 1) {
+			printf("invalid value (0x%x)", aip->ai_acline);
+		} else {
+			static char messages[][10] = {"off-line", "on-line"};
+			printf("%s", messages[aip->ai_acline]);
+		}
 	}
 	printf("\n");
 	printf("Battery status: ");
-	if (aip->ai_batt_stat == 255)
+#ifndef PC98
+	if (aip->ai_batt_stat == 255) {
 		printf("unknown");
-	else if (aip->ai_batt_stat > 3)
+	} else {
+		if (aip->ai_batt_stat > 3) {
 			printf("invalid value (0x%x)", aip->ai_batt_stat);
-	else {
-		char messages[][10] = {"high", "low", "critical", "charging"};
-		printf("%s", messages[aip->ai_batt_stat]);
+		} else {
+			static char messages[][10] = {"high", "low", "critical", "charging"};
+			printf("%s", messages[aip->ai_batt_stat]);
+		}
 	}
+#else /** PC98 **/
+	for (n = 0; n < 2; n++) {
+		printf("%s", bn[n]);
+		stat = (aip->ai_spare[0] >> (8 * n)) & 0xff;
+		if (stat > 4 && stat != 255) {
+			printf("invalid value (0x%x)", stat);
+		} else {
+			static char messages[][10] =
+			{ "valid", "none", "charge", "abnormal", "available" };
+			printf("%s", stat == 255 ? "unknown" : messages[stat]);
+		}
+	}
+#endif
 	printf("\n");
 	printf("Remaining battery life: ");
-	if (aip->ai_batt_life == 255)
+#ifndef PC98
+	if (aip->ai_batt_life == 255) {
 		printf("unknown");
-	else if (aip->ai_batt_life <= 100)
+	} else {
+		if (aip->ai_batt_life <= 100) {
 			printf("%d%%", aip->ai_batt_life);
-	else
-		printf("invalid value (0x%x)", aip->ai_batt_life);
+		} else {
+			printf("invalid value (0x%x)", aip->ai_batt_life);
+		}
+	}
+#else /** PC98 **/
+	for (n = 0; n < 2; n++) { 
+		printf("%s", bn[n]);
+		batt = (aip->ai_spare[1] >> (8 * n)) & 0xff;
+		if (batt == 255) {
+			printf("unknown");
+		} else if (batt <= 100) {
+			printf("%d%%", batt);
+		} else {
+			printf("invalid value (0x%x)", batt);
+		}
+	}
+#endif
 	printf("\n");
+	printf("Remaining battery time: ");
+	if (aip->ai_batt_time == -1)
+		printf("unknown");
+	else if (aip->ai_batt_time >= 0) {
+		int t, h, m, s;
+
+		t = aip->ai_batt_time;
+		s = t % 60;
+		t /= 60;
+		m = t % 60;
+		t /= 60;
+		h = t;
+		printf("%2d:%02d:%02d", h, m, s);
+	} else
+		printf("invarid value (0x%x)", aip->ai_batt_time);
+	printf("\n");
+	if (aip->ai_infoversion >= 1) {
+		printf("Number of batteries: ");
+		if (aip->ai_batteries == (u_int) -1)
+			printf("unknown\n");
+		else
+			printf("%d\n", aip->ai_batteries);
+	}
+
+	if (aip->ai_major > 1 ||
+#ifndef PC98
+	    (aip->ai_major == 1 && aip->ai_minor >= 2)) {
+#else /** PC98 */
+	    (aip->ai_major == 1 && aip->ai_minor >= 12)) {
+#endif
+		/*
+		 * try to get the suspend timer
+		 */
+		bzero(&args, sizeof(args));
+		args.eax = (APM_BIOS) << 8 | APM_RESUMETIMER;
+		args.ebx = PMDV_APMBIOS;
+		args.ecx = 0x0001;
+		if (ioctl(fd, APMIO_BIOS, &args)) {
+			err(1,"Get resume timer");
+		} else {
+			apmerr = APMERR(args.eax);
+			if (apmerr == 0x0d || apmerr == 0x86)
+				printf("Resume timer: disabled\n");
+			else if (apmerr)
+				fprintf(stderr, 
+					"Failed to get the resume timer: APM error0x%x\n",
+					apmerr);
+			else {
+				/*
+				 * OK.  We have the time (all bcd).
+				 * CH - seconds
+				 * DH - hours
+				 * DL - minutes
+				 * xh(SI) - month (1-12)
+				 * xl(SI) - day of month (1-31)
+				 * DI - year
+				 */
+				struct tm tm;
+				char buf[1024];
+				time_t t;
+
+				tm.tm_sec = bcd2int(xh(args.ecx));
+				tm.tm_min = bcd2int(xl(args.edx));
+				tm.tm_hour = bcd2int(xh(args.edx));
+				tm.tm_mday = bcd2int(xl(args.esi));
+				tm.tm_mon = bcd2int(xh(args.esi)) - 1;
+				tm.tm_year = bcd2int(args.edi) - 1900;
+				if (cmos_wall)
+					t = mktime(&tm);
+				else
+					t = timegm(&tm);
+				tm = *localtime(&t);
+				strftime(buf, sizeof(buf), "%c", &tm);
+				printf("Resume timer: %s\n", buf);
+			}
+		}
+
+		/*
+		 * Get the ring indicator resume state
+		 */
+		bzero(&args, sizeof(args));
+		args.eax  = (APM_BIOS) << 8 | APM_RESUMEONRING;
+		args.ebx = PMDV_APMBIOS;
+		args.ecx = 0x0002;
+		if (ioctl(fd, APMIO_BIOS, &args) == 0) {
+			printf("Resume on ring indicator: %sabled\n",
+			       args.ecx ? "en" : "dis");
+		}
+	}
+
+	if (aip->ai_infoversion >= 1) {
+		printf("APM Capacities:\n", aip->ai_capabilities);
+		if (aip->ai_capabilities == 0xff00)
+			printf("\tunknown\n");
+		if (aip->ai_capabilities & 0x01)
+			printf("\tglobal standby state\n");
+		if (aip->ai_capabilities & 0x02)
+			printf("\tglobal suspend state\n");
+		if (aip->ai_capabilities & 0x04)
+			printf("\tresume timer from standby\n");
+		if (aip->ai_capabilities & 0x08)
+			printf("\tresume timer from suspend\n");
+		if (aip->ai_capabilities & 0x10)
+			printf("\tRI resume from standby\n");
+		if (aip->ai_capabilities & 0x20)
+			printf("\tRI resume from suspend\n");
+		if (aip->ai_capabilities & 0x40)
+			printf("\tPCMCIA RI resume from standby\n");
+		if (aip->ai_capabilities & 0x80)
+			printf("\tPCMCIA RI resume from suspend\n");
+	}
 }
 
  $B$?$@$$$^(B make buildworld $BCf!D!D(B
----
// $BLZ2<@'M:!VM}2J7O$N:nJ85;=Q!WCf8x?7=q(B 624 $B$rFI$b$&(B!!

$B>.Eg(B $BH%(B - KOJIMA Hajime
[Office] kjm@rins.ryukoku.ac.jp, http://www.st.ryukoku.ac.jp/~kjm/
         Phone: 077-543-7414  Fax: 077-543-0706
