$NetBSD: patch-functions,v 1.2 2015/03/22 01:52:06 tnn2 Exp $

--- functions.orig	2016-02-18 04:01:23.000000000 +0000
+++ functions
@@ -1020,6 +1020,11 @@ setup_proc () {
 			mount -t linprocfs proc $TARGET/proc
 		fi
 		;;
+	    netbsd)
+		umount_on_exit /dev
+		umount_on_exit /proc
+		mount -t procfs -o linux proc $TARGET/proc
+		;;
 	    hurd*)
 		# firmlink $TARGET/{dev,servers,proc} to the system ones.
 		settrans -a "$TARGET/dev" /hurd/firmlink /dev
@@ -1068,7 +1073,7 @@ setup_devices () {
 		if true; then
 			setup_devices_simple
 		elif [ -e "$DEVICES_TARGZ" ]; then
-			zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xf -)
+			zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xpf -)
 		else
 			error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
 		fi
