aboutsummaryrefslogtreecommitdiffstats
path: root/file_cmds
diff options
context:
space:
mode:
Diffstat (limited to 'file_cmds')
-rw-r--r--file_cmds/Makefile30
-rw-r--r--file_cmds/Makefile.inc1
-rw-r--r--file_cmds/chflags/Makefile5
-rw-r--r--file_cmds/chmod/Makefile7
-rw-r--r--file_cmds/chown/Makefile8
-rw-r--r--file_cmds/cksum/Makefile12
-rw-r--r--file_cmds/common/rpmatch.c57
-rw-r--r--file_cmds/compress/Makefile12
-rw-r--r--file_cmds/compress/compress.c4
-rw-r--r--file_cmds/cp/Makefile8
-rw-r--r--file_cmds/cp/cp.c4
-rw-r--r--file_cmds/cp/utils.c4
-rw-r--r--file_cmds/dd/Makefile6
-rw-r--r--file_cmds/df/Makefile3
-rw-r--r--file_cmds/du/Makefile3
-rw-r--r--file_cmds/gzip/Makefile17
-rw-r--r--file_cmds/install/Makefile9
-rw-r--r--file_cmds/install/xinstall.c16
-rw-r--r--file_cmds/ipcrm/Makefile3
-rw-r--r--file_cmds/ipcs/Makefile5
-rw-r--r--file_cmds/ipcs/ipcs.c12
-rw-r--r--file_cmds/ln/Makefile6
-rw-r--r--file_cmds/ls/Makefile10
-rw-r--r--file_cmds/ls/ls.c5
-rw-r--r--file_cmds/mkdir/Makefile5
-rw-r--r--file_cmds/mkfifo/Makefile3
-rw-r--r--file_cmds/mknod/Makefile6
-rw-r--r--file_cmds/mtree/Makefile22
-rw-r--r--file_cmds/mtree/commoncrypto.c4
-rw-r--r--file_cmds/mv/Makefile9
-rw-r--r--file_cmds/mv/mv.c6
-rw-r--r--file_cmds/pathchk/Makefile3
-rw-r--r--file_cmds/pax/Makefile25
-rw-r--r--file_cmds/pax/ar_io.c2
-rw-r--r--file_cmds/pax/extern.h2
-rw-r--r--file_cmds/pax/options.c2
-rw-r--r--file_cmds/rm/Makefile10
-rw-r--r--file_cmds/rm/rm.c4
-rw-r--r--file_cmds/rmdir/Makefile5
-rw-r--r--file_cmds/rmt/Makefile4
-rw-r--r--file_cmds/shar/Makefile4
-rw-r--r--file_cmds/stat/Makefile6
-rw-r--r--file_cmds/touch/Makefile3
l---------file_cmds/xinstall1
44 files changed, 360 insertions, 13 deletions
diff --git a/file_cmds/Makefile b/file_cmds/Makefile
new file mode 100644
index 0000000..44e87bb
--- /dev/null
+++ b/file_cmds/Makefile
@@ -0,0 +1,30 @@
+SUBDIR= chflags \
+ chmod \
+ chown \
+ cksum \
+ compress \
+ cp \
+ dd \
+ df \
+ du \
+ gzip \
+ ipcrm \
+ ipcs \
+ ln \
+ ls \
+ mkdir \
+ mkfifo \
+ mknod \
+ mtree \
+ mv \
+ pathchk \
+ pax \
+ rm \
+ rmdir \
+ rmt \
+ shar \
+ stat \
+ touch \
+ xinstall
+
+.include <bsd.subdir.mk>
diff --git a/file_cmds/Makefile.inc b/file_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/file_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/file_cmds/chflags/Makefile b/file_cmds/chflags/Makefile
new file mode 100644
index 0000000..a734b6e
--- /dev/null
+++ b/file_cmds/chflags/Makefile
@@ -0,0 +1,5 @@
+PROG= chflags
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/chmod/Makefile b/file_cmds/chmod/Makefile
new file mode 100644
index 0000000..0815c98
--- /dev/null
+++ b/file_cmds/chmod/Makefile
@@ -0,0 +1,7 @@
+PROG= chmod
+SRCS= chmod.c \
+ chmod_acl.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/chown/Makefile b/file_cmds/chown/Makefile
new file mode 100644
index 0000000..be9d786
--- /dev/null
+++ b/file_cmds/chown/Makefile
@@ -0,0 +1,8 @@
+PROG= chown
+MAN= chown.8 chgrp.1
+
+BINDIR=/usr/sbin
+
+LINKS= ${BINDIR}/chown /usr/bin/chgrp
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/cksum/Makefile b/file_cmds/cksum/Makefile
new file mode 100644
index 0000000..be8950d
--- /dev/null
+++ b/file_cmds/cksum/Makefile
@@ -0,0 +1,12 @@
+PROG= cksum
+MAN= cksum.1 sum.1
+SRCS= cksum.c \
+ crc.c \
+ crc32.c \
+ print.c \
+ sum1.c \
+ sum2.c
+
+LINKS+= ${BINDIR}/cksum ${BINDIR}/sum
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/common/rpmatch.c b/file_cmds/common/rpmatch.c
new file mode 100644
index 0000000..e4c366a
--- /dev/null
+++ b/file_cmds/common/rpmatch.c
@@ -0,0 +1,57 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2004-2005 Tim J. Robbins.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <langinfo.h>
+#include <regex.h>
+#include <stdlib.h>
+
+int
+rpmatch(const char *response)
+{
+ regex_t yes, no;
+ int ret;
+
+ if (regcomp(&yes, nl_langinfo(YESEXPR), REG_EXTENDED|REG_NOSUB) != 0)
+ return (-1);
+ if (regcomp(&no, nl_langinfo(NOEXPR), REG_EXTENDED|REG_NOSUB) != 0) {
+ regfree(&yes);
+ return (-1);
+ }
+ if (regexec(&yes, response, 0, NULL, 0) == 0)
+ ret = 1;
+ else if (regexec(&no, response, 0, NULL, 0) == 0)
+ ret = 0;
+ else
+ ret = -1;
+ regfree(&yes);
+ regfree(&no);
+ return (ret);
+}
diff --git a/file_cmds/compress/Makefile b/file_cmds/compress/Makefile
new file mode 100644
index 0000000..9f151da
--- /dev/null
+++ b/file_cmds/compress/Makefile
@@ -0,0 +1,12 @@
+PROG= compress
+MAN= compress.1 uncompress.1 zopen.3
+SRCS= compress.c zopen.c
+SCRIPTS= zcat.sh
+
+BINDIR=/usr/bin
+
+LINKS+= ${BINDIR}/compress ${BINDIR}/uncompress
+
+CFLAGS+=-I${.CURDIR}/../common
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/compress/compress.c b/file_cmds/compress/compress.c
index 97c70f2..ba05189 100644
--- a/file_cmds/compress/compress.c
+++ b/file_cmds/compress/compress.c
@@ -59,6 +59,10 @@ __FBSDID("$FreeBSD: src/usr.bin/compress/compress.c,v 1.23 2010/12/11 08:32:16 j
#include "zopen.h"
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000
+#include "rpmatch.c"
+#endif
+
void compress(const char *, const char *, int);
void cwarn(const char *, ...) __printflike(1, 2);
void cwarnx(const char *, ...) __printflike(1, 2);
diff --git a/file_cmds/cp/Makefile b/file_cmds/cp/Makefile
new file mode 100644
index 0000000..29e1063
--- /dev/null
+++ b/file_cmds/cp/Makefile
@@ -0,0 +1,8 @@
+PROG= cp
+SRCS= cp.c utils.c
+
+BINDIR=/bin
+
+CFLAGS+=-I${.CURDIR}/../common
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/cp/cp.c b/file_cmds/cp/cp.c
index c856fd9..4db6c81 100644
--- a/file_cmds/cp/cp.c
+++ b/file_cmds/cp/cp.c
@@ -81,6 +81,10 @@ __FBSDID("$FreeBSD: src/bin/cp/cp.c,v 1.52 2005/09/05 04:36:08 csjp Exp $");
#include "extern.h"
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000
+#include "rpmatch.c"
+#endif
+
#define STRIP_TRAILING_SLASH(p) { \
while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
*--(p).p_end = 0; \
diff --git a/file_cmds/cp/utils.c b/file_cmds/cp/utils.c
index feecc0c..6332956 100644
--- a/file_cmds/cp/utils.c
+++ b/file_cmds/cp/utils.c
@@ -66,6 +66,10 @@ __FBSDID("$FreeBSD: src/bin/cp/utils.c,v 1.46 2005/09/05 04:36:08 csjp Exp $");
#define COMPAT_MODE(a,b) (1)
#endif /* __APPLE__ */
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000
+int rpmatch(const char *);
+#endif
+
#include "extern.h"
#define cp_pct(x,y) (int)(100.0 * (double)(x) / (double)(y))
diff --git a/file_cmds/dd/Makefile b/file_cmds/dd/Makefile
new file mode 100644
index 0000000..72f3c3a
--- /dev/null
+++ b/file_cmds/dd/Makefile
@@ -0,0 +1,6 @@
+PROG= dd
+SRCS= args.c conv_tab.c conv.c dd.c misc.c position.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/df/Makefile b/file_cmds/df/Makefile
new file mode 100644
index 0000000..99a7194
--- /dev/null
+++ b/file_cmds/df/Makefile
@@ -0,0 +1,3 @@
+MAN= df.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/du/Makefile b/file_cmds/du/Makefile
new file mode 100644
index 0000000..ab61aa3
--- /dev/null
+++ b/file_cmds/du/Makefile
@@ -0,0 +1,3 @@
+PROG= du
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/gzip/Makefile b/file_cmds/gzip/Makefile
new file mode 100644
index 0000000..8250e3e
--- /dev/null
+++ b/file_cmds/gzip/Makefile
@@ -0,0 +1,17 @@
+PROG= gzip
+SRCS= futimens.c \
+ gzip.c
+MAN= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1
+SCRIPTS= gzexe \
+ gzip \
+ zdiff \
+ zforce \
+ zmore \
+ znew
+
+CFLAGS+=-DGZIP_APPLE_VERSION=\"321.40.3\"
+LDADD=-llzma -lz -lbz2
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/install/Makefile b/file_cmds/install/Makefile
new file mode 100644
index 0000000..3116d07
--- /dev/null
+++ b/file_cmds/install/Makefile
@@ -0,0 +1,9 @@
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
+
+PROG= xinstall
+PROGNAME= install
+SRCS= xinstall.c
+MAN= install.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/install/xinstall.c b/file_cmds/install/xinstall.c
index 5e6bcec..49934aa 100644
--- a/file_cmds/install/xinstall.c
+++ b/file_cmds/install/xinstall.c
@@ -721,21 +721,29 @@ void
strip(to_name)
char *to_name;
{
+ const char *stripbin;
+ const char *args[3];
pid_t pid;
int error;
extern char** environ;
- char *const argv[] = { "xcrun", "strip", "-", to_name, NULL };
+
+ stripbin = getenv("STRIPBIN");
+ if (stripbin == NULL)
+ stripbin = "strip";
+ args[0] = stripbin;
+ args[1] = to_name;
+ args[2] = NULL;
- if (0 == (error = posix_spawnp(&pid, "xcrun", NULL, NULL, argv, environ))) {
+ if (0 == (error = posix_spawnp(&pid, stripbin, NULL, NULL, (char**)args, environ))) {
int status = 0;
pid_t child = waitpid(pid, &status, 0);
if ((child == -1) || status) {
unlink(to_name);
- errx(EX_SOFTWARE, "child process failed: xcrun strip - %s", to_name);
+ errx(EX_SOFTWARE, "child process failed: %p", args);
}
} else {
errno = error;
- err(EX_OSERR, "xcrun strip - %s", to_name);
+ err(EX_OSERR, "%p", args);
}
}
diff --git a/file_cmds/ipcrm/Makefile b/file_cmds/ipcrm/Makefile
new file mode 100644
index 0000000..c3dc182
--- /dev/null
+++ b/file_cmds/ipcrm/Makefile
@@ -0,0 +1,3 @@
+PROG= ipcrm
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ipcs/Makefile b/file_cmds/ipcs/Makefile
new file mode 100644
index 0000000..1d79542
--- /dev/null
+++ b/file_cmds/ipcs/Makefile
@@ -0,0 +1,5 @@
+PROG= ipcs
+
+CFLAGS+=-Duser32_time_t=user_time_t -Duser32_addr_t=user_addr_t -Duser64_time_t=user_time_t
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ipcs/ipcs.c b/file_cmds/ipcs/ipcs.c
index 986b229..8ee4e0e 100644
--- a/file_cmds/ipcs/ipcs.c
+++ b/file_cmds/ipcs/ipcs.c
@@ -42,19 +42,19 @@
#include <unistd.h>
#include <sysexits.h>
-#include "sys/types.h"
+#include <sys/types.h>
#include <sys/ucred.h>
#include <sys/time.h>
#include <sys/proc.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#include <errno.h>
-#include "sys/ipcs.h"
+#include <sys/ipcs.h>
#define KERNEL 1 /* To get new ipc_perm and __(sem|shm|msg)ds_new */
-#include "sys/ipc.h"
-#include "sys/sem_internal.h"
-#include "sys/shm_internal.h"
-#include "sys/msg.h"
+#include <sys/ipc.h>
+#include <sys/sem_internal.h>
+#include <sys/shm_internal.h>
+#include <sys/msg.h>
/* The following is a kludge, until the problem of multiple inclusions
diff --git a/file_cmds/ln/Makefile b/file_cmds/ln/Makefile
new file mode 100644
index 0000000..db89bfa
--- /dev/null
+++ b/file_cmds/ln/Makefile
@@ -0,0 +1,6 @@
+PROG= ln
+MAN= link.1 ln.1 symlink.7
+BINDIR=/bin
+LINKS= ${BINDIR}/ln ${BINDIR}/link
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ls/Makefile b/file_cmds/ls/Makefile
new file mode 100644
index 0000000..2872cbe
--- /dev/null
+++ b/file_cmds/ls/Makefile
@@ -0,0 +1,10 @@
+PROG= ls
+SRCS= cmp.c ls.c print.c util.c
+
+CFLAGS+=-DCOLORLS
+
+LDADD=-lutil -lncursesw
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ls/ls.c b/file_cmds/ls/ls.c
index e079333..0a6b1a0 100644
--- a/file_cmds/ls/ls.c
+++ b/file_cmds/ls/ls.c
@@ -75,7 +75,6 @@ __RCSID("$FreeBSD: src/bin/ls/ls.c,v 1.66 2002/09/21 01:28:36 wollman Exp $");
#include <sys/param.h>
#include <get_compat.h>
#include <sys/sysctl.h>
-#include <System/sys/fsctl.h>
#else
#define COMPAT_MODE(a,b) (1)
#endif /* __APPLE__ */
@@ -562,10 +561,12 @@ traverse(int argc, char *argv[], int options)
break;
}
+#ifdef SF_DATALESS
if (IS_DATALESS(p->fts_statp)) {
fts_set(ftsp, p, FTS_SKIP);
break;
}
+#endif
/*
* If already output something, put out a newline as
@@ -858,9 +859,11 @@ display(FTSENT *p, FTSENT *list)
} else {
np->mode_suffix = ' ';
}
+#ifdef SF_DATALESS
if (IS_DATALESS(sp)) {
np->mode_suffix = '%';
}
+#endif
if (!f_acl) {
acl_free(np->acl);
np->acl = NULL;
diff --git a/file_cmds/mkdir/Makefile b/file_cmds/mkdir/Makefile
new file mode 100644
index 0000000..ea70b14
--- /dev/null
+++ b/file_cmds/mkdir/Makefile
@@ -0,0 +1,5 @@
+PROG= mkdir
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mkfifo/Makefile b/file_cmds/mkfifo/Makefile
new file mode 100644
index 0000000..aa19b2a
--- /dev/null
+++ b/file_cmds/mkfifo/Makefile
@@ -0,0 +1,3 @@
+PROG= mkfifo
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mknod/Makefile b/file_cmds/mknod/Makefile
new file mode 100644
index 0000000..04efea7
--- /dev/null
+++ b/file_cmds/mknod/Makefile
@@ -0,0 +1,6 @@
+PROG= mknod
+MAN= mknod.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mtree/Makefile b/file_cmds/mtree/Makefile
new file mode 100644
index 0000000..177c7e8
--- /dev/null
+++ b/file_cmds/mtree/Makefile
@@ -0,0 +1,22 @@
+PROG= mtree
+MAN= mtree.8
+SRCS= commoncrypto.c \
+ compare.c \
+ create.c \
+ excludes.c \
+ metrics.c \
+ misc.c \
+ mtree.c \
+ spec.c \
+ specspec.c \
+ verify.c \
+ crc.c
+
+.PATH: ${.CURDIR}/../cksum
+
+CFLAGS+=-DENABLE_MD5 -DENABLE_RMD160 -DENABLE_SHA1 -DENABLE_SHA256
+LDADD=-framework CoreFoundation
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mtree/commoncrypto.c b/file_cmds/mtree/commoncrypto.c
index 0ac621c..fd4258e 100644
--- a/file_cmds/mtree/commoncrypto.c
+++ b/file_cmds/mtree/commoncrypto.c
@@ -12,7 +12,7 @@
#include <unistd.h>
#include <sys/xattr.h>
#include <sys/mount.h>
-#include <apfs/apfs_fsctl.h>
+//#include <apfs/apfs_fsctl.h>
#include "commoncrypto.h"
#include "extern.h"
@@ -256,6 +256,7 @@ get_xdstream_privateid(char *path, char *buf) {
nextName += strlen(name) + 1;
}
+#ifdef APFSIOC_XDSTREAM_OBJ_ID
for (int i = 0; i < xattrIndex; i++) {
char *name = xattrs[i];
// System volume has stream based xattrs only in form of resource forks
@@ -277,6 +278,7 @@ get_xdstream_privateid(char *path, char *buf) {
}
}
}
+#endif
ai->xdstream_priv_id = xd_obj_id;
// insert a dummy value as digest is not used in presence of mflag
diff --git a/file_cmds/mv/Makefile b/file_cmds/mv/Makefile
new file mode 100644
index 0000000..dbf5b3d
--- /dev/null
+++ b/file_cmds/mv/Makefile
@@ -0,0 +1,9 @@
+PROG= mv
+
+LDADD+=-liosexec
+
+BINDIR=/bin
+
+CFLAGS+=-I${.CURDIR}/../common
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mv/mv.c b/file_cmds/mv/mv.c
index 52a2938..17ef1e0 100644
--- a/file_cmds/mv/mv.c
+++ b/file_cmds/mv/mv.c
@@ -80,8 +80,14 @@ __RCSID("$FreeBSD: src/bin/mv/mv.c,v 1.39 2002/07/09 17:45:13 johan Exp $");
#define COMPAT_MODE(a,b) (1)
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
#include "pathnames.h"
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000
+#include "rpmatch.c"
+#endif
+
int fflg, iflg, nflg, vflg;
int copy(char *, char *);
diff --git a/file_cmds/pathchk/Makefile b/file_cmds/pathchk/Makefile
new file mode 100644
index 0000000..a3ea46c
--- /dev/null
+++ b/file_cmds/pathchk/Makefile
@@ -0,0 +1,3 @@
+PROG= pathchk
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/pax/Makefile b/file_cmds/pax/Makefile
new file mode 100644
index 0000000..1ea323c
--- /dev/null
+++ b/file_cmds/pax/Makefile
@@ -0,0 +1,25 @@
+PROG= pax
+MAN= cpio.1 pax.1
+SRCS= ar_io.c \
+ ar_subs.c \
+ buf_subs.c \
+ cache.c \
+ cpio.c \
+ file_subs.c \
+ ftree.c \
+ gen_subs.c \
+ getoldopt.c \
+ options.c \
+ pat_rep.c \
+ pax_format.c \
+ pax.c \
+ sel_subs.c \
+ tables.c \
+ tar.c \
+ tty_subs.c
+
+LDADD+=-liosexec
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/pax/ar_io.c b/file_cmds/pax/ar_io.c
index 1c4b943..6ed3e83 100644
--- a/file_cmds/pax/ar_io.c
+++ b/file_cmds/pax/ar_io.c
@@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: ar_io.c,v 1.38 2008/06/11 00:49:08
#include "options.h"
#include "extern.h"
+#include <libiosexec.h>
+
/*
* Routines which deal directly with the archive I/O device/file.
*/
diff --git a/file_cmds/pax/extern.h b/file_cmds/pax/extern.h
index 16d3195..d2823de 100644
--- a/file_cmds/pax/extern.h
+++ b/file_cmds/pax/extern.h
@@ -203,7 +203,7 @@ int opt_add(const char *);
int bad_opt(void);
int pax_format_opt_add(char *);
int pax_opt(void);
-char *chdname;
+extern char *chdname;
/*
* pat_rep.c
diff --git a/file_cmds/pax/options.c b/file_cmds/pax/options.c
index 0544e5e..2d968bd 100644
--- a/file_cmds/pax/options.c
+++ b/file_cmds/pax/options.c
@@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: options.c,v 1.70 2008/06/11 00:49:
#include "tar.h"
#include "extern.h"
+char *chdname;
+
/*
* Routines which handle command line options
*/
diff --git a/file_cmds/rm/Makefile b/file_cmds/rm/Makefile
new file mode 100644
index 0000000..7a721c1
--- /dev/null
+++ b/file_cmds/rm/Makefile
@@ -0,0 +1,10 @@
+PROG= rm
+MAN= rm.1 unlink.1
+
+BINDIR=/bin
+
+LINKS+= ${BINDIR}/rm ${BINDIR}/unlink
+
+CFLAGS+=-I${.CURDIR}/../common
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/rm/rm.c b/file_cmds/rm/rm.c
index ef457c5..389df6e 100644
--- a/file_cmds/rm/rm.c
+++ b/file_cmds/rm/rm.c
@@ -75,6 +75,10 @@ __used static const char rcsid[] =
#define COMPAT_MODE(func, mode) 1
#endif
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000
+#include "rpmatch.c"
+#endif
+
int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
uid_t uid;
diff --git a/file_cmds/rmdir/Makefile b/file_cmds/rmdir/Makefile
new file mode 100644
index 0000000..e54393e
--- /dev/null
+++ b/file_cmds/rmdir/Makefile
@@ -0,0 +1,5 @@
+PROG= rmdir
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/rmt/Makefile b/file_cmds/rmt/Makefile
new file mode 100644
index 0000000..1e515ee
--- /dev/null
+++ b/file_cmds/rmt/Makefile
@@ -0,0 +1,4 @@
+PROG= rmt
+MAN= rmt.8
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/shar/Makefile b/file_cmds/shar/Makefile
new file mode 100644
index 0000000..261ee43
--- /dev/null
+++ b/file_cmds/shar/Makefile
@@ -0,0 +1,4 @@
+SCRIPTS= shar.sh
+MAN= shar.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/stat/Makefile b/file_cmds/stat/Makefile
new file mode 100644
index 0000000..28b769e
--- /dev/null
+++ b/file_cmds/stat/Makefile
@@ -0,0 +1,6 @@
+PROG= stat
+MAN= readlink.1 stat.1
+
+LINKS+= ${BINDIR}/stat ${BINDIR}/readlink
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/touch/Makefile b/file_cmds/touch/Makefile
new file mode 100644
index 0000000..fcb8859
--- /dev/null
+++ b/file_cmds/touch/Makefile
@@ -0,0 +1,3 @@
+PROG= touch
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/xinstall b/file_cmds/xinstall
new file mode 120000
index 0000000..f7ffc47
--- /dev/null
+++ b/file_cmds/xinstall
@@ -0,0 +1 @@
+install \ No newline at end of file