Skip to content

Instantly share code, notes, and snippets.

View nonakap's full-sized avatar

Kimihiro Nonaka nonakap

View GitHub Profile
@nonakap
nonakap / nbsd-sdhc-intel-emmc-hw-reset.diff
Created June 23, 2016 23:33
sdhc(4): Add hardware reset support for Intel eMMC controller.
diff --git a/sys/dev/acpi/sdhc_acpi.c b/sys/dev/acpi/sdhc_acpi.c
index 8b1b741..e91bfd0 100644
--- a/sys/dev/acpi/sdhc_acpi.c
+++ b/sys/dev/acpi/sdhc_acpi.c
@@ -50,6 +50,9 @@ static bool sdhc_acpi_resume(device_t, const pmf_qual_t *);
struct sdhc_acpi_softc {
struct sdhc_softc sc;
+ bus_space_tag_t sc_memt;
+ bus_space_handle_t sc_memh;
@nonakap
nonakap / nbsd-ftp-fetch.c.diff
Created December 15, 2016 04:11
ftp(1): handle proxy authentication correctly.
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 7b030d9f176..291e157c1c4 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -855,8 +855,7 @@ print_connect(FETCH *fin, const struct urlinfo *ui)
#define C_OK 0
#define C_CLEANUP 1
#define C_IMPROPER 2
-#define C_PROXY 3
-#define C_NOPROXY 4
@nonakap
nonakap / nbsd-efiboot-consdev.diff
Created May 1, 2017 09:31
efiboot: implemented consdev command, but only pass console parameters to kernel.
index 22c54e35a4d..1db2836059d 100644
--- a/sys/arch/i386/stand/efiboot/boot.c
+++ b/sys/arch/i386/stand/efiboot/boot.c
@@ -30,6 +30,7 @@
#include <sys/bootblock.h>
#include <sys/boot_flag.h>
+#include <machine/limits.h>
#include "bootcfg.h"
@nonakap
nonakap / patch-sha1dc_sha1.c
Created June 7, 2017 06:20
pkgsrc/devel/git-base 2.13.1: misdetection big endian on NetBSD 7.1_STABLE/amd64
--- sha1dc/sha1.c.orig 2017-06-05 01:08:11.000000000 +0000
+++ sha1dc/sha1.c 2017-06-07 06:09:44.000000000 +0000
@@ -38,7 +38,7 @@
#if (!defined SHA1DC_FORCE_LITTLEENDIAN) && \
((defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
(defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) || \
- defined(_BIG_ENDIAN) || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
+ ((defined(sun) || defined(__sun)) && defined(_BIG_ENDIAN)) || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) || defined(SHA1DC_FORCE_BIGENDIAN))
diff --exclude=CVS -uNrp jq/Makefile jq.new/Makefile
--- jq/Makefile 2017-07-31 07:32:14.000000000 +0900
+++ jq.new/Makefile 2017-08-02 12:49:45.000000000 +0900
@@ -15,9 +15,13 @@ LICENSE= mit
USE_LANGUAGES= c99
USE_LIBTOOL= yes
USE_TOOLS+= bison flex gmake
+USE_TOOLS+= aclocal autoconf automake autoreconf
GNU_CONFIGURE= yes
@nonakap
nonakap / x86-single-cpu-ddb.diff
Created September 5, 2017 00:59
NetBSD/x86: avoid panic when UP
diff --git a/sys/arch/amd64/amd64/db_interface.c b/sys/arch/amd64/amd64/db_interface.c
index 5b07bf197f3..df64670046f 100644
--- a/sys/arch/amd64/amd64/db_interface.c
+++ b/sys/arch/amd64/amd64/db_interface.c
@@ -131,11 +131,25 @@ db_suspend_others(void)
win = (ddb_cpu == cpu_me);
__cpu_simple_unlock(&db_lock);
if (win) {
+ CPU_INFO_ITERATOR cii;
+ struct cpu_info *ci, *self = curcpu();
>> NetBSD/i386 BIOS Boot, Revision 3.3
>> ([email protected], Tue Oct 10 10:03:01 JST 2017)
>> Memory: 635/2043700 k
Press return to boot now, any other key for boot menu
booting hd0a:seilfirm.img - starting in 0
FIRMWARE-TYPE: SEIL/X86
firmware checksum ok
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
@nonakap
nonakap / pkgsrc-net-samba4_use-devel-talloc-package-instead-of-bundled-library.diff
Last active February 28, 2018 03:25
pkgsrc/net/samba4: use devel/talloc package instead of bundled library.
net/samba4: use devel/talloc package instead of bundled library.
I'd like to install net/samba4 and net/freeradius on the same server.
But devel/talloc on which net/freeradius depends conflicts bundled talloc used in net/samba.
Please net/samba use devel/talloc package.
Index: net/samba4/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/samba4/Makefile,v
retrieving revision 1.38
@nonakap
nonakap / pkgsrc-devel-talloc-conflict-above-samba-4.6.8nb3.diff
Created February 28, 2018 04:35
pkgsrc/devel/talloc: resolve conflict with samba-4.6.8nb4.
devel/talloc: resolve conflict with samba-4.6.8nb4.
Bump PKGREVISION.
Index: devel/talloc/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/talloc/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- devel/talloc/Makefile 28 Jan 2018 16:41:33 -0000 1.23
@nonakap
nonakap / gist:c733ed395e8207f96584d3f4ca314404
Created March 10, 2018 02:18
NetBSD/amd64 on Hyper-V Gen.2 VM dmesg: stall at cpu0 attach
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
2018 The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 8.99.12 (GENERIC) #0: Sat Mar 10 01:52:11 JST 2018
nonaka@ubuntu-hv2:/home/snapshot/NetBSD/HEAD-20180309/obj.Linux-x86_64/amd64/sys/arch/amd64/compile/GENERIC
total memory = 2047 MB
avail memory = 1964 MB