mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-06 13:51:38 +00:00
Compare commits
6
Commits
clr-debug-info-9
...
14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca63e1be25 | ||
|
|
078e9987d5 | ||
|
|
97431314b5 | ||
|
|
07e1f033e1 | ||
|
|
45f22398ca | ||
|
|
b538b457ce |
+2
-5
@@ -14,9 +14,6 @@ clr_debug_fuse_LDADD = ${fuse_LIBS} $(glib_LIBS)
|
||||
clr_debug_daemon_LDADD = $(glib_LIBS) ${curl_LIBS}
|
||||
clr_debug_prepare_LDADD = $(glib_LIBS)
|
||||
|
||||
systemdsystemunit_DATA = clr_debug_fuse.service clr_debug_daemon.service
|
||||
|
||||
systemdunitdir = @SYSTEMD_UNITDIR@
|
||||
systemdunit_DATA = clr_debug_fuse.service clr_debug_daemon.service
|
||||
|
||||
tmpwatchdir = /etc/tmpfiles.d
|
||||
tmpwatch_DATA = debuginfo.conf
|
||||
tmpfiles_DATA = debuginfo.conf
|
||||
|
||||
+7
-10
@@ -2,8 +2,8 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.66])
|
||||
AC_INIT(clr-debug-info, 9, arjan@linux.intel.com)
|
||||
AM_INIT_AUTOMAKE([foreign -Wall -W])
|
||||
AC_INIT(clr-debug-info, 11, arjan@linux.intel.com)
|
||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||
AM_SILENT_RULES([yes])
|
||||
AC_PROG_CC
|
||||
AC_LANG(C)
|
||||
@@ -13,14 +13,11 @@ PKG_CHECK_MODULES([curl], [libcurl])
|
||||
PKG_CHECK_MODULES([fuse], [fuse])
|
||||
PKG_CHECK_MODULES([SYSTEMD], [systemd])
|
||||
|
||||
AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
|
||||
[path to systemd service directory]), [path_systemdunit=${withval}],
|
||||
[path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
|
||||
if (test -n "${path_systemdunit}"); then
|
||||
SYSTEMD_UNITDIR="${path_systemdunit}"
|
||||
AC_SUBST(SYSTEMD_UNITDIR)
|
||||
AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
|
||||
fi
|
||||
tmpfilesdir=`pkg-config --variable tmpfilesdir systemd`
|
||||
AC_SUBST(tmpfilesdir)
|
||||
|
||||
systemdsystemunitdir=`pkg-config --variable systemdsystemunitdir systemd`
|
||||
AC_SUBST(systemdsystemunitdir)
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
+9
-3
@@ -610,12 +610,18 @@ int main(int argc, char *argv[])
|
||||
char *dir = "/usr/src/debug";
|
||||
char *shadowdir = "/var/cache/debuginfo/src";
|
||||
umask(0);
|
||||
|
||||
/* give the system some time to boot before we go active; this is a background task */
|
||||
sleep(1);
|
||||
|
||||
system("modprobe fuse");
|
||||
if (access("/sys/module/fuse/", F_OK))
|
||||
system("modprobe fuse");
|
||||
signal(SIGPIPE,SIG_IGN);
|
||||
|
||||
system("mkdir -p /var/cache/debuginfo/lib &> /dev/null");
|
||||
system("mkdir -p /var/cache/debuginfo/src &> /dev/null");
|
||||
if (access("/var/cache/debuginfo/lib/", F_OK))
|
||||
system("mkdir -p /var/cache/debuginfo/lib &> /dev/null");
|
||||
if (access("/var/cache/debuginfo/src/", F_OK))
|
||||
system("mkdir -p /var/cache/debuginfo/src &> /dev/null");
|
||||
|
||||
if (fork() == 0) {
|
||||
dir = "/usr/lib/debug";
|
||||
|
||||
+13
-7
@@ -124,7 +124,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
|
||||
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(filename, &statbuf);
|
||||
if (statbuf.st_size > 0 && asprintf(&command, "tar -C /usr/%s/.debug --no-same-owner -xf %s", prefix, filename) >= 0) {
|
||||
if (statbuf.st_size > 0 && asprintf(&command, "tar -C /var/cache/debuginfo/%s --no-same-owner -xf %s", prefix, filename) >= 0) {
|
||||
system(command);
|
||||
free(command);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ static void *server_thread(void *arg)
|
||||
return NULL;
|
||||
}
|
||||
url = NULL;
|
||||
if (asprintf(&url, "http://localhost/debuginfo/%s%s.tar", prefix, path) < 0) {
|
||||
if (asprintf(&url, "http://debuginfo.clearlinux.org/debuginfo/%s%s.tar", prefix, path) < 0) {
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
@@ -222,18 +222,19 @@ int main(int argc, char **argv)
|
||||
int sockfd;
|
||||
struct sockaddr_un sun;
|
||||
int ret;
|
||||
int curl_done = 0;
|
||||
|
||||
if (argc < -1)
|
||||
(void)argv;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
signal(SIGPIPE,SIG_IGN);
|
||||
|
||||
system("mkdir -p /var/cache/debuginfo/lib/ &> /dev/null");
|
||||
system("mkdir -p /var/cache/debuginfo/src/ &> /dev/null");
|
||||
|
||||
|
||||
if (access("/var/cache/debuginfo/lib/", F_OK))
|
||||
system("mkdir -p /var/cache/debuginfo/lib/ &> /dev/null");
|
||||
if (access("/var/cache/debuginfo/src/", F_OK))
|
||||
system("mkdir -p /var/cache/debuginfo/src/ &> /dev/null");
|
||||
|
||||
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sockfd < 0)
|
||||
return EXIT_FAILURE;
|
||||
@@ -259,6 +260,11 @@ int main(int argc, char **argv)
|
||||
pthread_t thread;
|
||||
|
||||
clientsock = accept(sockfd, NULL, NULL);
|
||||
|
||||
if (!curl_done) {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl_done = 1;
|
||||
}
|
||||
|
||||
pthread_create(&thread, NULL, server_thread, (void *)(unsigned long)clientsock);
|
||||
pthread_detach(thread);
|
||||
|
||||
Reference in New Issue
Block a user