[WIP]Add idevicerestorelilik-openwrt-22.03
@ -0,0 +1,69 @@ | |||||
From ec2bba4ffe5a0939ba192b014ba594eaa964412f Mon Sep 17 00:00:00 2001 | |||||
From: Rosen Penev <rosenp@gmail.com> | |||||
Date: Sun, 8 Dec 2019 15:45:19 -0800 | |||||
Subject: [PATCH] idevicedate: Fix -Wformat=2 warning | |||||
Format functions expect a constant expression, not a variable. | |||||
Simplified the code slightly. | |||||
--- | |||||
tools/idevicedate.c | 17 ++++------------- | |||||
1 file changed, 4 insertions(+), 13 deletions(-) | |||||
diff --git a/tools/idevicedate.c b/tools/idevicedate.c | |||||
index 4de90b63..6dddc185 100644 | |||||
--- a/tools/idevicedate.c | |||||
+++ b/tools/idevicedate.c | |||||
@@ -38,9 +38,9 @@ | |||||
#include <libimobiledevice/lockdown.h> | |||||
#ifdef _DATE_FMT | |||||
-#define DATE_FMT_LANGINFO() nl_langinfo (_DATE_FMT) | |||||
+#define DATE_FMT_LANGINFO nl_langinfo (_DATE_FMT) | |||||
#else | |||||
-#define DATE_FMT_LANGINFO() "" | |||||
+#define DATE_FMT_LANGINFO "%a %b %e %H:%M:%S %Z %Y" | |||||
#endif | |||||
static void print_usage(int argc, char **argv) | |||||
@@ -75,7 +75,6 @@ int main(int argc, char *argv[]) | |||||
uint64_t datetime = 0; | |||||
time_t rawtime; | |||||
struct tm * tmp; | |||||
- char const *format = NULL; | |||||
char buffer[80]; | |||||
int result = 0; | |||||
@@ -131,14 +130,6 @@ int main(int argc, char *argv[]) | |||||
} | |||||
} | |||||
- /* determine a date format */ | |||||
- if (!format) { | |||||
- format = DATE_FMT_LANGINFO (); | |||||
- if (!*format) { | |||||
- format = "%a %b %e %H:%M:%S %Z %Y"; | |||||
- } | |||||
- } | |||||
- | |||||
ret = idevice_new(&device, udid); | |||||
if (ret != IDEVICE_E_SUCCESS) { | |||||
if (udid) { | |||||
@@ -195,7 +186,7 @@ int main(int argc, char *argv[]) | |||||
tmp = localtime(&rawtime); | |||||
/* finally we format and print the current date */ | |||||
- strftime(buffer, 80, format, tmp); | |||||
+ strftime(buffer, 80, DATE_FMT_LANGINFO, tmp); | |||||
puts(buffer); | |||||
} else { | |||||
datetime = setdate; | |||||
@@ -217,7 +208,7 @@ int main(int argc, char *argv[]) | |||||
if(lockdownd_set_value(client, NULL, "TimeIntervalSince1970", node) == LOCKDOWN_E_SUCCESS) { | |||||
tmp = localtime(&setdate); | |||||
- strftime(buffer, 80, format, tmp); | |||||
+ strftime(buffer, 80, DATE_FMT_LANGINFO, tmp); | |||||
puts(buffer); | |||||
} else { | |||||
printf("ERROR: Failed to set date on device.\n"); |
@ -0,0 +1,84 @@ | |||||
# | |||||
# This is free software, licensed under the GNU General Public License v2. | |||||
# See /LICENSE for more information. | |||||
# | |||||
include $(TOPDIR)/rules.mk | |||||
PKG_NAME:=libirecovery | |||||
PKG_SOURCE_DATE:=2019-12-16 | |||||
PKG_SOURCE_VERSION:=db36196d8d9db5a1f92e6934cf931cd00a6ead2d | |||||
PKG_RELEASE:=1 | |||||
PKG_SOURCE_PROTO:=git | |||||
PKG_SOURCE_URL:=https://github.com/libimobiledevice/libirecovery | |||||
PKG_MIRROR_HASH:=635f790b97b7e0001050df6a604c2bcd5cc896213f2a2441f58cf0aa4e00f773 | |||||
PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com> | |||||
PKG_LICENSE:=LGPL-2.1-or-later | |||||
PKG_LICENSE_FILES:=COPYING | |||||
PKG_FIXUP:=autoreconf | |||||
PKG_INSTALL:=1 | |||||
PKG_BUILD_PARALLEL:=1 | |||||
include $(INCLUDE_DIR)/package.mk | |||||
define Package/libirecovery/Default | |||||
URL:=https://github.com/libimobiledevice/libirecovery | |||||
SUBMENU:=libimobiledevice | |||||
endef | |||||
define Package/libirecovery/Default/description | |||||
libirecovery is a cross-platform library which implements communication | |||||
to iBoot/iBSS found on Apple's iOS devices via USB. | |||||
endef | |||||
define Package/libirecovery | |||||
$(call Package/libirecovery/Default) | |||||
TITLE:=A library that talks to Apple iBoot/iBSS | |||||
SECTION:=libs | |||||
CATEGORY:=Libraries | |||||
DEPENDS:=+libreadline +libusb-1.0 | |||||
endef | |||||
define Package/libirecovery/description | |||||
$(call Package/libirecovery/Default/description) | |||||
endef | |||||
define Package/irecovery | |||||
$(call Package/libirecovery/Default) | |||||
TITLE:=A utility that talks to Apple iBoot/iBSS | |||||
SECTION:=utils | |||||
CATEGORY:=Utilities | |||||
DEPENDS:=+libirecovery | |||||
endef | |||||
define Package/irecovery/description | |||||
$(call Package/libirecovery/Default/description) | |||||
This package contains the libirecovery utilities. | |||||
endef | |||||
CONFIGURE_ARGS += --without-udev | |||||
define Build/InstallDev | |||||
$(INSTALL_DIR) $(1)/usr/include | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/libirecovery.h $(1)/usr/include/ | |||||
$(INSTALL_DIR) $(1)/usr/lib | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libirecovery.{a,la,so*} $(1)/usr/lib/ | |||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libirecovery.pc $(1)/usr/lib/pkgconfig/ | |||||
endef | |||||
define Package/libirecovery/install | |||||
$(INSTALL_DIR) $(1)/usr/lib | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libirecovery.so.* $(1)/usr/lib/ | |||||
endef | |||||
define Package/irecovery/install | |||||
$(INSTALL_DIR) $(1)/usr/bin | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/irecovery $(1)/usr/bin/ | |||||
endef | |||||
$(eval $(call BuildPackage,libirecovery)) | |||||
$(eval $(call BuildPackage,irecovery)) |
@ -0,0 +1,47 @@ | |||||
# | |||||
# This is free software, licensed under the GNU General Public License v2. | |||||
# See /LICENSE for more information. | |||||
# | |||||
include $(TOPDIR)/rules.mk | |||||
PKG_NAME:=idevicerestore | |||||
PKG_SOURCE_DATE:=2019-12-13 | |||||
PKG_SOURCE_VERSION:=a2a6ad16d2c3157153aae7e0835e478237b01507 | |||||
PKG_RELEASE:=1 | |||||
PKG_SOURCE_PROTO:=git | |||||
PKG_SOURCE_URL=https://github.com/libimobiledevice/idevicerestore | |||||
PKG_MIRROR_HASH:=522bd35a0a4e8cc64ef9b29716e88efd84829e81c9c00ce9170fef285ac4b137 | |||||
PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com> | |||||
PKG_LICENSE:=GPL-2.0-or-later | |||||
PKG_LICENSE_FILES:=COPYING | |||||
PKG_FIXUP:=autoreconf | |||||
PKG_INSTALL:=1 | |||||
PKG_BUILD_PARALLEL:=1 | |||||
include $(INCLUDE_DIR)/package.mk | |||||
define Package/idevicerestore | |||||
SECTION:=utils | |||||
CATEGORY:=Utilities | |||||
SUBMENU:=libimobiledevice | |||||
TITLE:=Restore/upgrade firmware of iOS devices | |||||
URL:=https://github.com/libimobiledevice/idevicerestore | |||||
DEPENDS:=+libirecovery +libzip +libcurl +usbmuxd | |||||
endef | |||||
define Package/idevicerestore/description | |||||
The idevicerestore tool allows to restore firmware files to iOS devices. | |||||
It is a full reimplementation of all granular steps which are performed | |||||
during restore of a firmware to a device. | |||||
endef | |||||
define Package/idevicerestore/install | |||||
$(INSTALL_DIR) $(1)/usr/bin | |||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/idevicerestore $(1)/usr/bin/ | |||||
endef | |||||
$(eval $(call BuildPackage,idevicerestore)) |
@ -0,0 +1,17 @@ | |||||
#!/bin/sh /etc/rc.common | |||||
START=94 | |||||
USE_PROCD=1 | |||||
PROG=/usr/sbin/usbmuxd | |||||
start_service() { | |||||
procd_open_instance | |||||
procd_set_param command $PROG -f | |||||
procd_set_param stderr 1 | |||||
procd_close_instance | |||||
} | |||||
reload_service() { | |||||
procd_send_signal $PROG | |||||
} |
@ -0,0 +1,11 @@ | |||||
--- a/src/conf.c | |||||
+++ b/src/conf.c | |||||
@@ -126,7 +126,7 @@ const char *config_get_config_dir() | |||||
#ifdef __APPLE__ | |||||
base_config_dir = strdup("/var/db"); | |||||
#else | |||||
- base_config_dir = strdup("/var/lib"); | |||||
+ base_config_dir = strdup("/etc"); | |||||
#endif | |||||
#endif | |||||
__config_dir = string_concat(base_config_dir, DIR_SEP_S, CONFIG_DIR, NULL); |