summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/system-cmds/make.sh7
-rw-r--r--data/system-cmds/reboot.diff37
2 files changed, 41 insertions, 3 deletions
diff --git a/data/system-cmds/make.sh b/data/system-cmds/make.sh
index 284e5dad4..2fc92eff5 100644
--- a/data/system-cmds/make.sh
+++ b/data/system-cmds/make.sh
@@ -13,8 +13,8 @@ arm-apple-darwin-gcc -o passwd passwd.tproj/!(od_passwd).c -I. -DTARGET_OS_EMBED
arm-apple-darwin-strip passwd
cp -va "${PKG_DATA}"/kextmanager* .
-# dmesg reboot shutdown
-for tproj in getconf getty hostinfo iostat login nvram sync sysctl vipw zprint; do
+# dmesg shutdown
+for tproj in getconf getty hostinfo iostat login nvram reboot sync sysctl vipw zprint; do
echo "${tproj}"
arm-apple-darwin-gcc -o "${tproj}" "${tproj}.tproj"/*.c -I. -D'__FBSDID(x)=' -DTARGET_OS_EMBEDDED -framework CoreFoundation -framework IOKit kextmanagerUser.c
arm-apple-darwin-strip "${tproj}"
@@ -22,8 +22,9 @@ done
chmod u+s passwd login
-pkg: mkdir -p /bin /usr/bin /usr/sbin
+pkg: mkdir -p /bin /sbin /usr/bin /usr/sbin
pkg: cp -a sync /bin
+pkg: cp -a reboot /sbin
pkg: cp -a passwd zprint getty getconf hostinfo login /usr/bin
pkg: cp -a sysctl nvram vipw iostat /usr/sbin
diff --git a/data/system-cmds/reboot.diff b/data/system-cmds/reboot.diff
new file mode 100644
index 000000000..21d11a3bd
--- /dev/null
+++ b/data/system-cmds/reboot.diff
@@ -0,0 +1,37 @@
+diff -r -u system_cmds-431/reboot.tproj/reboot.c system_cmds-431+iPhone/reboot.tproj/reboot.c
+--- system_cmds-431/reboot.tproj/reboot.c 2007-09-06 20:46:17.000000000 +0000
++++ system_cmds-431+iPhone/reboot.tproj/reboot.c 2008-02-12 11:29:02.000000000 +0000
+@@ -81,11 +81,9 @@
+ int ch, howto, kflag, lflag, nflag, qflag, uflag;
+ char *p;
+ const char *user;
+-#ifndef __APPLE__
+ int i, fd, pflag, sverrno;
+ u_int pageins;
+ char *kernel;
+-#endif
+
+ if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) {
+ dohalt = 1;
+@@ -240,19 +238,16 @@
+ }
+ #endif
+
+-#ifdef __APPLE__
+- // launchd(8) handles reboot. This call returns NULL on success.
+- exit(reboot2(howto) == NULL ? EXIT_SUCCESS : EXIT_FAILURE);
+-#else /* __APPLE__ */
+ reboot(howto);
+ /* FALLTHROUGH */
+
++#ifndef __APPLE__
+ restart:
++#endif
+ sverrno = errno;
+ errx(1, "%s%s", kill(1, SIGHUP) == -1 ? "(can't restart init): " : "",
+ strerror(sverrno));
+ /* NOTREACHED */
+-#endif /* __APPLE__ */
+ }
+
+ void