--- sshpty.c
+++ sshpty.c
@@ -398,15 +398,19 @@
 
 	if ((st.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != mode) {
 		if (chmod(tty_name, mode) < 0) {
+#ifndef DB_NONFREETZ
 			if (errno == EROFS &&
 			    (st.st_mode & (S_IRGRP | S_IROTH)) == 0) {
+#endif
 				dropbear_log(LOG_ERR,
 					"chmod(%.100s, 0%o) failed: %.100s",
 					tty_name, mode, strerror(errno));
+#ifndef DB_NONFREETZ
 			} else {
 				dropbear_exit("chmod(%.100s, 0%o) failed: %.100s",
 				    tty_name, mode, strerror(errno));
 			}
+#endif
 		}
 	}
 }
--- localoptions.h
+++ localoptions.h
@@ -1,13 +1,25 @@
 #ifndef DROPBEAR_LOCALOPTIONS_H_
 #define DROPBEAR_LOCALOPTIONS_H_
 
+#ifndef DB_NONFREETZ
 #define DSS_PRIV_FILENAME "/mod/etc/ssh/dss_host_key.dropbear"
 #define RSA_PRIV_FILENAME "/mod/etc/ssh/rsa_host_key.dropbear"
 #define ECDSA_PRIV_FILENAME "/mod/etc/ssh/ecdsa_host_key.dropbear"
 #define ED25519_PRIV_FILENAME "/mod/etc/ssh/ed25519_host_key.dropbear"
+#else
+#define DSS_PRIV_FILENAME "/var/tmp/dss_host_key"
+#define RSA_PRIV_FILENAME "/var/tmp/rsa_host_key"
+#define ECDSA_PRIV_FILENAME "/var/tmp/ecdsa_host_key"
+#define ED25519_PRIV_FILENAME "/var/tmp/ed25519_host_key"
+#endif
 
 #define SFTPSERVER_PATH "/usr/lib/sftp-server"
 
+#ifndef DB_NONFREETZ
 #define DROPBEAR_PATH_SSH_PROGRAM "/usr/bin/ssh"
+#else
+/* ssh is expected to be in PATH */
+#define DROPBEAR_PATH_SSH_PROGRAM "ssh"
+#endif
 
 #endif
