diff options
| author | Koen Kooi <koen@openembedded.org> | 2009-05-21 15:02:42 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2009-05-21 15:02:42 +0200 |
| commit | ccab93e06e6b3fc9a58a000fce97270d99911780 (patch) | |
| tree | 545cf8b2e2d6a23df9f47aa4128d5baef75b61a0 | |
| parent | d543c80be652f118cbbfa94250bd2aca9bb9aea4 (diff) | |
| parent | eca20211da63073e3a35dd1f647ef534662c4771 (diff) | |
Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into org.openembedded.dev
48 files changed, 3204 insertions, 337 deletions
diff --git a/classes/xfce.bbclass b/classes/xfce.bbclass index 48e012e67e..b18313fa2a 100644 --- a/classes/xfce.bbclass +++ b/classes/xfce.bbclass @@ -5,7 +5,7 @@ # Global class to make it easier to maintain XFCE packages HOMEPAGE = "http://www.xfce.org" -LICENSE = "LGPL-2" +LICENSE = "LGPLv2" DEPENDS += "startup-notification" XFCE_VERSION = ${PV} diff --git a/conf/checksums.ini b/conf/checksums.ini index b991b74781..2764372fc1 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -1302,6 +1302,10 @@ sha256=aa3c42224ec702b6cdb69ca6501284cb6dacb87473a076d7337ee9635c96f160 md5=5c9b705700df51d232be223b6ab6414d sha256=aa3c42224ec702b6cdb69ca6501284cb6dacb87473a076d7337ee9635c96f160 +[http://downloads.sourceforge.net/acpid/acpid-1.0.8.tar.gz] +md5=1d9c52fe2c0b51f8463f357c2a3d3ddb +sha256=d57ae5302c38c37d060a097fa51600fe06fbfffd575641d638407944f126b7b1 + [http://ftp.gnu.org/gnu/classpathx/activation-1.1.1.tar.gz] md5=de50d7728e8140eb404f2b4554321f8c sha256=b1b5ef560d30fcb11fbf537246857d14110ce4eb2b200d4c54690472305d87b7 @@ -6130,6 +6134,10 @@ sha256=9635a44bceb478bbf2ee8a785cf6986fba525afb5fad1fd4bba73cf71f2d3edf md5=8845d4536fcd3a329690c93bce9bbf8e sha256=c7345faf10b269b3556f2e1373c4afc35f08891f8bbd54e45d49151a8c8e4ac0 +[http://fpdownload.macromedia.com/get/flashplayer/current//flash-plugin-10.0.22.87-release.i386.rpm] +md5=a3bb1f9a8e2b1238ffaf89193e60be02 +sha256=ec5ace49df7cfe69b7c02c8d1b6df8089f32076a390b931051feed2a9762d554 + [http://downloads.sourceforge.net/flex/flex-2.5.31.tar.bz2] md5=363dcc4afc917dc51306eb9d3de0152f sha256=701353279a17655d78e3b3678ad78d0375f5bf45877ad8b3507d589c42427f26 @@ -8382,6 +8390,10 @@ sha256=8418ed3a2e8dad923a6626d22eaffe796aab9cbcf827a17ab95bf99956e22a6d md5=3ce6ba6483ccd6fe9974cface582337a sha256=173df749482f7391e50a6eb8339107b2b201582978637c63190c4a79f8e66d07 +[http://ftp.gnome.org/pub/GNOME/sources/gnumeric/1.8/gnumeric-1.8.4.tar.bz2] +md5=338f0084f04a16f78797ad01f85d3251 +sha256=a3c7fdbbafa6c9cfee7f16c067b043c3041cd0240292aa92b653a2221ae04503 + [ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.2.2.tar.bz2] md5=c34736eb7cb687f9e5b6d4df48aaf7c8 sha256=174e7f78c670d76984c4c4bd6077a0b9fec7b4be700b9f3e40c6889b78110c57 @@ -9890,6 +9902,10 @@ sha256=15aa3a926307b4b3e40f3a9b05c604df6811eb48814b1534db32aed414aefb0c md5=060ea25c471e5f4cf5c1baeac27d0345 sha256=0d8b6630c546327ddc67c700859731036eebdf77e51ad8b71e4d19d28ca2ff2c +[http://ftp.gnome.org/pub/GNOME/sources/gtk-engines/2.18/gtk-engines-2.18.1.tar.bz2] +md5=5dc748cfb0587bb412adc49b666fb6f8 +sha256=d7e2672fcf80f5c35d481c24e0ab5b7d0f6526dcc3d8821ab76468c1816dc3bc + [http://ftp.gnome.org/pub/GNOME/sources/gtk-engines/2.2/gtk-engines-2.2.0.tar.bz2] md5=78e9276c28b509f3203de4873c20a263 sha256=140541cae8b003d2f7210e2ef060ac328d7e45a04e2cf5fa943fff73c9955dd6 @@ -10014,6 +10030,10 @@ sha256=c1c2e1fb0168ecb3a5e773ac0cd74a0e5caeaaf402f108479337794dab8aa75f md5=a56ea78c74fe93a604357d7c555af0e5 sha256=38c238ec57bf22023bbc50f70ecbaee8c06b817b9e11f1a3a0ae7faf95cc1f26 +[http://ftp.gnome.org/pub/GNOME/sources/gtksourceview/2.6/gtksourceview-2.6.0.tar.bz2] +md5=dd065ab2e96e51aade949249c5556439 +sha256=92ddd976721e26377eaa59fea07707a0caa85eb874500868c1e6fdd9a21fe0dd + [http://downloads.sourceforge.net/gtkterm/gtkterm2-0.2.3.tar.gz] md5=a49f93d15909dbd2e7011428ae01f0f0 sha256=fb68b18d752ae2379f144186b94743be991af1a42c88bc1e6f0685e45cb1d573 @@ -10166,6 +10186,10 @@ sha256=65d8f8eeb61e7609a8c5001b6660d90e7a482c4b74b4e226d09b433dc1a80c9d md5=a6f532770cf9286e1de38d6570cbc6bc sha256=65d8f8eeb61e7609a8c5001b6660d90e7a482c4b74b4e226d09b433dc1a80c9d +[https://fedorahosted.org/releases/h/a/hal-cups-utils/hal-cups-utils-0.6.19.tar.gz] +md5=58e1c8f5597dd39e57dcf3c4aabe60f8 +sha256=f40a7ebd1453d471a8a6bfd8c635708dd739a6160bb661813f936d936ba85618 + [http://hal.freedesktop.org/releases/hal-info-20070618.tar.gz] md5=c7005ccb1765d8359fd2348350770495 sha256=bec1b0ad166b6c4d5269e7aa6d7bdbd0eb05c8f2c30042e4dca18993ba5682f0 @@ -11338,6 +11362,10 @@ sha256=f24ae604a20da87e3716bb1d441c483e56479eaef4e99888f41be06059790bca md5=4e979c0dda766ba1dd719905ca975c7b sha256=202de62e2f3d0667cc464720d5897d0ccb29767ec24e0a4d4c5bd6c4d37425a4 +[http://download.java.net/dlj/binaries/jdk-6u10-dlj-linux-i586.bin] +md5=b70924c697584ab7955050d7a9b4de57 +sha256=dae79e8c56090ac3fb4ac3fe0df9faf6a0c9694a89ef978dce0ab970557ad264 + [http://www.jdom.org/dist/binary/jdom-1.1.tar.gz] md5=22745cbaaddb12884ed8ee09083d8fe2 sha256=a13549087141be24ad176b659afdc2c675f1ffa5288ff999a193d6d44a282056 @@ -16890,6 +16918,10 @@ sha256=af083a73425d664d4607ef6c6564fd9319a0e47ee7c105259a45356cb834690e md5=3e68b857b4e1f3a6521d1dfefbd30a36 sha256=af083a73425d664d4607ef6c6564fd9319a0e47ee7c105259a45356cb834690e +[http://ftp.gnu.org/gnu/mtools/mtools-4.0.10.tar.bz2] +md5=750c2beba968a5d46dbaae24551a82b9 +sha256=860fee13acb39365bd28763070e24011ea55f381f96714d2841937525aa02ded + [http://downloads.sourceforge.net/mtpaint/mtpaint-3.02.tar.bz2] md5=828013176f135fc24ffdf16a011c51e6 sha256=991a1376dc23d0663d45b3b395c0e5c5542fee3906a120889583d67f854f5206 @@ -19350,6 +19382,10 @@ sha256=6bca237485a352362133792e000a3c8e367a26b0312c5c607db7c2a97717d15f md5=2e81938855cf5cc38856bd4a31d79a4c sha256=a13c81897c94b3d6e705fc9da07c610492e28cf7abd5ff8e992f0ec95a269d62 +[http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.4/linux-i686/xpi/pt-BR.xpi] +md5=29c672886aa9ca41428ba04196938545 +sha256=1474828a58f893bed20f0e0cd26bc310c7472d69bf7a1ae01c00a371de256b1a + [ftp://ftp.ossp.org/pkg/lib/pth/pth-2.0.0.tar.gz] md5=f84a87295fef3b41499f3b728b1f0050 sha256=1935a06368c1555d5f80329ba1e53f5b1a7dd9efb7fc9354427f2d1a583c81a3 @@ -19698,6 +19734,10 @@ sha256=a6d7db68c87699e283a1f58b637a7e730c350899fd7b35b88e63caa0e85a9ab9 md5=4d5674f3898a573691ffb335e8d749cd sha256=b08d4ed54c9403c77778a3803e53a4f33f359b42d94f6f3e14abb1bf4941e6ea +[http://cyberelk.net/tim/data/pycups/pycups-1.9.45.tar.bz2] +md5=ff634a6751f8a859ed26751bf03abef0 +sha256=ef6e576e5465da9c338ac8ff9f162825cfb7997359efc52e6a110c295a9f363b + [http://pycurl.sourceforge.net/download/pycurl-7.14.0.tar.gz] md5=6f73d518fb520af14634a06ee1b7ddce sha256=a60e08b01fc3355ec18ec0e447349b6f8bff3f9628eb42891cff1eb51b9618b1 @@ -22362,6 +22402,10 @@ sha256=26c05ef7666881eb1d60291a4293e67d75dbf048ca8a30f6b9eb3dc86ad1b6b0 md5=d7b8f27b83ff080ff824177d65a7dae0 sha256=0a63da1c99b6a9b6a93b6fd0a9391c7d8216f658d2bea0ba81999e261c6b6649 +[http://cyberelk.net/tim/data/system-config-printer/1.1/system-config-printer-1.1.7.tar.bz2] +md5=a77bde5adc5ee8822b0764ff786ccc09 +sha256=fdd50cb114151c66b8180c0ce90ba0e99f77a69770ac21598a87be935eec2224 + [ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.86.tar.gz] md5=7d5d61c026122ab791ac04c8a84db967 sha256=035f98fae17d9cff002993c564ccc83dc4ed136127172caeff872b6abdb679d8 @@ -23130,6 +23174,10 @@ sha256=4f32cfd01f0678080f8e98009ba99ce37f1261d842e3af9a6b3add22005a80ca md5=f10b6954498bab5d08d0f50de381af50 sha256=4f32cfd01f0678080f8e98009ba99ce37f1261d842e3af9a6b3add22005a80ca +[http://avr32linux.org/twiki/pub/Main/UbootPatches/u-boot-1.1.4-avr1.patch.bz2] +md5=4508e9abd423a672763441d8535331c4 +sha256=b18d9f4e1fa5cf1f3d89640d6aa5067da150cebb822fdeb07222991f71684590 + [ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2] md5=096cac66046326659b97eeded007ec73 sha256=1af9d68adfe044cb8fe1b3efa5b661c4cb57edf90f4a8daf38f0fc19692677a7 diff --git a/conf/distro/include/preferred-om-2008-versions.inc b/conf/distro/include/preferred-om-2008-versions.inc index 8c5c4f7cb0..65676ec969 100644 --- a/conf/distro/include/preferred-om-2008-versions.inc +++ b/conf/distro/include/preferred-om-2008-versions.inc @@ -503,7 +503,7 @@ PREFERRED_VERSION_gnome-vfs ?= "2.22.0" PREFERRED_VERSION_gnome-vfs-extras ?= "0.99.13" PREFERRED_VERSION_gnome-vfs-obexftp ?= "0.4" PREFERRED_VERSION_gnuchess ?= "5.05" -PREFERRED_VERSION_gnumeric ?= "1.6.3" +PREFERRED_VERSION_gnumeric ?= "1.8.4" PREFERRED_VERSION_gnupg ?= "1.4.2.2" PREFERRED_VERSION_gnuplot ?= "4.2.2" PREFERRED_VERSION_gnuradio ?= "3.0.4" diff --git a/conf/distro/include/preferred-xorg-versions-X11R7.4-updates.inc b/conf/distro/include/preferred-xorg-versions-X11R7.4-updates.inc index 1f6076525f..6e42065aed 100644 --- a/conf/distro/include/preferred-xorg-versions-X11R7.4-updates.inc +++ b/conf/distro/include/preferred-xorg-versions-X11R7.4-updates.inc @@ -2,6 +2,6 @@ PREFERRED_VERSION_xserver-xorg ?= "1.5.3" PREFERRED_VERSION_xf86-input-evdev ?= "2.1.0" -PREFERRED_VERSION_xf86-video-geode ?= "2.11.0" +PREFERRED_VERSION_xf86-video-geode ?= "2.11.2" PREFERRED_VERSION_libxi ?= "1.2.0" PREFERRED_VERSION_inputproto ?= "1.5.0" diff --git a/conf/licenses.conf b/conf/licenses.conf index 01c4747167..c0676275fa 100644 --- a/conf/licenses.conf +++ b/conf/licenses.conf @@ -1,6 +1,5 @@ SRC_DISTRIBUTE_LICENSES += "GPL GPLv2 GPLv3 LGPL LGPLv2.1 LGPLv3" -SRC_DISTRIBUTE_LICENSES += "BSD Apache-2.0 QPL AFL" +SRC_DISTRIBUTE_LICENSES += "BSD Apache-2.0 QPL AFL CUPS" SRC_DISTRIBUTE_LICENSES += "MIT Sleepycat Classpath Perl PSF PD Artistic" SRC_DISTRIBUTE_LICENSES += "bzip2 zlib ntp cron libpng netperf openssl" SRC_DISTRIBUTE_LICENSES += "Info-ZIP tcp-wrappers" - diff --git a/conf/machine/geodegx.conf b/conf/machine/geodegx.conf index 6fe6a830e6..0ec6782076 100644 --- a/conf/machine/geodegx.conf +++ b/conf/machine/geodegx.conf @@ -4,7 +4,7 @@ TARGET_ARCH = "i486" -require conf/machine/include/tune-geodegx.inc +require conf/machine/include/tune-geode.inc PREFERRED_PROVIDER_virtual/kernel = "linux-geodegx" BOOTSTRAP_EXTRA_RDEPENDS = "kernel pciutils udev kernel-modules" @@ -14,4 +14,4 @@ udevdir = "/dev" KERNEL_IMAGETYPE = "bzImage" GLIBC_ADDONS = "nptl" -GLIBC_EXTRA_OECONF = "--with-tls" +GLIBC_EXTRA_OECONF = "--with-tls --with-cpu=geode" diff --git a/conf/machine/geodelx.conf b/conf/machine/geodelx.conf index de4d9ca16e..f8874fd966 100644 --- a/conf/machine/geodelx.conf +++ b/conf/machine/geodelx.conf @@ -1,14 +1,15 @@ -TARGET_ARCH = "i486" +# Machine file for devices with the AMD Geode LX processor +# Copyright (C) 2005, Advanced Micro Devices, Inc. All Rights Reserved +# Released under the MIT license (see packages/COPYING) -require conf/machine/include/tune-geodelx.inc +TARGET_ARCH = "i486" -PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}depmod:module-init-tools-cross" +require conf/machine/include/tune-geode.inc -PREFERRED_PROVIDER_virtual/kernel="linux-geodelx" - -SELECTED_OPTIMIZATION_glibc := "${@'${SELECTED_OPTIMIZATION}'.replace('-fomit-frame-pointer', '')}" +PREFERRED_PROVIDER_virtual/kernel = "linux-geodelx" KERNEL_IMAGETYPE = "bzImage" GLIBC_ADDONS = "nptl" -GLIBC_EXTRA_OECONF = "--with-tls" +GLIBC_EXTRA_OECONF = "--with-tls --with-cpu=geode" +SELECTED_OPTIMIZATION_pn-glibc := "${@'${SELECTED_OPTIMIZATION}'.replace('-fomit-frame-pointer', '')}" diff --git a/conf/machine/include/tune-geodegx.inc b/conf/machine/include/tune-geode.inc index cae285a91c..eda332a74e 100644 --- a/conf/machine/include/tune-geodegx.inc +++ b/conf/machine/include/tune-geode.inc @@ -1,6 +1,5 @@ -TARGET_CC_ARCH = "-march=geode" +TARGET_CC_ARCH = "-march=geode -mtune=geode" BASE_PACKAGE_ARCH = "geode" PACKAGE_EXTRA_ARCHS += "x86 i386 geode" FEED_ARCH = "geode" - diff --git a/conf/machine/include/tune-geodelx.inc b/conf/machine/include/tune-geodelx.inc deleted file mode 100644 index 63e6678947..0000000000 --- a/conf/machine/include/tune-geodelx.inc +++ /dev/null @@ -1,9 +0,0 @@ -# Geode CPU has it's own target in GCC 4.3 -# in older versions k6-2 is closest -# -TARGET_CC_ARCH = "-march=geode" -BASE_PACKAGE_ARCH = "geode" -PACKAGE_EXTRA_ARCHS += "x86 i386 geode" - -FEED_ARCH = "geode" - diff --git a/docs/usermanual/reference/class_rootfs_ipkg.xml b/docs/usermanual/reference/class_rootfs_ipkg.xml index b60adf8e70..fde8a38c03 100644 --- a/docs/usermanual/reference/class_rootfs_ipkg.xml +++ b/docs/usermanual/reference/class_rootfs_ipkg.xml @@ -41,7 +41,7 @@ <listitem> <para>Installs the list of requested <command>.ipkg</command> packages, - <command>${IPKG_INSTALL}</command>;</para> + <command>${PACKAGE_INSTALL}</command>;</para> </listitem> <listitem> @@ -89,7 +89,7 @@ <variablelist> <varlistentry> - <term>IPKG_INSTALL</term> + <term>PACKAGE_INSTALL</term> <listitem> <para>The list of packages which will be installed into the root @@ -114,7 +114,7 @@ </varlistentry> <varlistentry> - <term>PACKAGE_ARCH</term> + <term>PACKAGE_ARCHS</term> <listitem> <para>Defines the list of architectures that are support by the target @@ -212,4 +212,4 @@ which is executed without <xref linkend="fakeroot" /> and therefore can be used from other classes, such as <xref linkend="image_class" />, that are already running under the control of <xref linkend="fakeroot" />.</para> -</section>
\ No newline at end of file +</section> diff --git a/recipes/acpid/acpid/event.c.diff b/recipes/acpid/acpid/event.c.diff new file mode 100644 index 0000000000..4ef3bafd6b --- /dev/null +++ b/recipes/acpid/acpid/event.c.diff @@ -0,0 +1,43 @@ +--- acpid-1.0.8.orig/event.c ++++ acpid-1.0.8/event.c +@@ -23,6 +23,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/wait.h> ++#include <libgen.h> + #include <fcntl.h> + #include <unistd.h> + #include <stdio.h> +@@ -90,6 +91,8 @@ + struct dirent *dirent; + char *file = NULL; + int nrules = 0; ++ char *basen = NULL; ++ regex_t preg; + + lock_rules(); + +@@ -139,10 +142,19 @@ + continue; /* skip non-regular files */ + } + +- r = parse_file(file); +- if (r) { +- enlist_rule(&cmd_list, r); +- nrules++; ++ /* check for run-parts style filename */ ++ basen = basename(file); ++ if (regcomp(&preg, "^[a-zA-Z0-9_-]+$", RULE_REGEX_FLAGS) == 0){ ++ if (regexec(&preg, basen, 0, NULL, 0) == 0){ ++ r = parse_file(file); ++ if (r) { ++ enlist_rule(&cmd_list, r); ++ nrules++; ++ } ++ } else { ++ acpid_log(LOG_DEBUG, "ignoring conf file %s\n", file); ++ } ++ + } + free(file); + } diff --git a/recipes/acpid/acpid/fixfd.diff b/recipes/acpid/acpid/fixfd.diff new file mode 100644 index 0000000000..93ceb5cfea --- /dev/null +++ b/recipes/acpid/acpid/fixfd.diff @@ -0,0 +1,12 @@ +diff -Nru a/acpid.c b/acpid.c +--- a/acpid.c 2008-11-03 14:04:43.000000000 +0100 ++++ b/acpid.c 2008-12-19 18:38:14.291127677 +0100 +@@ -456,7 +456,7 @@ + int log_opts; + + /* open /dev/null */ +- nullfd = open("/dev/null", O_RDONLY); ++ nullfd = open("/dev/null", O_RDWR); + if (nullfd < 0) { + fprintf(stderr, "%s: can't open %s: %s\n", progname, + "/dev/null", strerror(errno)); diff --git a/recipes/acpid/acpid/netlink.diff b/recipes/acpid/acpid/netlink.diff new file mode 100644 index 0000000000..5dbbedd5a3 --- /dev/null +++ b/recipes/acpid/acpid/netlink.diff @@ -0,0 +1,2797 @@ +diff -ruN acpid-1.0.8.orig/acpid.8 acpid-1.0.8/acpid.8 +--- acpid-1.0.8.orig/acpid.8 2008-11-03 14:04:43.000000000 +0100 ++++ acpid-1.0.8/acpid.8 2009-03-29 17:10:14.000000000 +0200 +@@ -10,11 +10,13 @@ + \fBacpid\fP is designed to notify user-space programs of ACPI events. + \fBacpid\fP should be started during the system boot, and will run as a + background process, by default. It will open an events file +-(\fI/proc/acpi/event\fP by default) and attempt to read whole lines. When +-a line is received (an \fIevent\fP), \fBacpid\fP will examine a list of rules, +-and execute the rules that match the event. +-\fBacpid\fP will ignore all incoming ACPI events if a lock file exists +-(\fI/var/lock/acpid\fP by default). ++(\fI/proc/acpi/event\fP by default) and attempt to read whole lines which ++represent ACPI events. If the events file does not exist, \fBacpid\fP will ++attempt to connect to the Linux kernel via the input layer and netlink. When an ++ACPI event is received from one of these sources, \fBacpid\fP will examine a ++list of rules, and execute the rules that match the event. \fBacpid\fP will ++ignore all incoming ACPI events if a lock file exists (\fI/var/lock/acpid\fP by ++default). + .PP + \fIRules\fP are defined by simple configuration files. \fBacpid\fP + will look in a configuration directory (\fI/etc/acpi/events\fP by default), +@@ -69,6 +71,9 @@ + This option changes the event file from which \fBacpid\fP reads events. + Default is \fI/proc/acpi/event\fP. + .TP ++.BI \-n "\fR, \fP" \--netlink ++This option forces \fBacpid\fP to use the Linux kernel input layer and netlink interface for ACPI events. ++.TP + .BI \-f "\fR, \fP" \--foreground + This option keeps \fBacpid\fP in the foreground by not forking at startup. + .TP +@@ -122,6 +127,8 @@ + .PD 0 + .B /proc/acpi/event + .br ++.B /dev/input/event* ++.br + .B /etc/acpi/ + .br + .B /var/run/acpid.socket +diff -ruN acpid-1.0.8.orig/acpid.c acpid-1.0.8/acpid.c +--- acpid-1.0.8.orig/acpid.c 2008-11-03 14:04:43.000000000 +0100 ++++ acpid-1.0.8/acpid.c 2009-03-29 17:10:14.000000000 +0200 +@@ -20,23 +20,23 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#include <sys/types.h> +-#include <sys/stat.h> ++#include <unistd.h> + #include <fcntl.h> + #include <signal.h> +-#include <unistd.h> ++#include <string.h> + #include <stdio.h> + #include <stdlib.h> +-#include <string.h> + #include <errno.h> + #include <getopt.h> +-#include <time.h> +-#include <sys/poll.h> +-#include <grp.h> +-#include <syslog.h> ++#include <stdarg.h> + + #include "acpid.h" +-#include "ud_socket.h" ++#include "event.h" ++#include "connection_list.h" ++#include "proc.h" ++#include "sock.h" ++#include "input_layer.h" ++#include "netlink.h" + + static int handle_cmdline(int *argc, char ***argv); + static void close_fds(void); +@@ -45,7 +45,6 @@ + static int create_pidfile(void); + static void clean_exit(int sig); + static void reload_conf(int sig); +-static char *read_line(int fd); + + /* global debug level */ + int acpid_debug; +@@ -53,23 +52,18 @@ + /* do we log event info? */ + int logevents; + +-static const char *progname; +-static const char *confdir = ACPID_CONFDIR; +-static const char *eventfile = ACPID_EVENTFILE; +-static const char *socketfile = ACPID_SOCKETFILE; ++const char *progname; ++ + static const char *lockfile = ACPID_LOCKFILE; ++static const char *confdir = ACPID_CONFDIR; + static int nosocket; +-static const char *socketgroup; +-static mode_t socketmode = ACPID_SOCKETMODE; + static int foreground; + static const char *pidfile = ACPID_PIDFILE; ++static int netlink; + + int + main(int argc, char **argv) + { +- int event_fd; +- int sock_fd = -1; /* init to avoid a compiler warning */ +- + /* learn who we really are */ + progname = (const char *)strrchr(argv[0], '/'); + progname = progname ? (progname + 1) : argv[0]; +@@ -80,14 +74,22 @@ + /* close any extra file descriptors */ + close_fds(); + +- /* actually open the event file */ +- event_fd = open(eventfile, O_RDONLY); +- if (event_fd < 0) { +- fprintf(stderr, "%s: can't open %s: %s\n", progname, +- eventfile, strerror(errno)); +- exit(EXIT_FAILURE); ++ if (!netlink) ++ { ++ /* open the acpi event file in the proc fs */ ++ /* if the open fails, try netlink */ ++ if (open_proc()) ++ netlink = 1; ++ } ++ ++ if (netlink) ++ { ++ /* open the input layer */ ++ open_input(); ++ ++ /* open netlink */ ++ open_netlink(); + } +- fcntl(event_fd, F_SETFD, FD_CLOEXEC); + + /* + * if there is data, and the kernel is NOT broken, this eats 1 byte. We +@@ -124,34 +126,7 @@ + + /* open our socket */ + if (!nosocket) { +- sock_fd = ud_create_socket(socketfile); +- if (sock_fd < 0) { +- fprintf(stderr, "%s: can't open socket %s: %s\n", +- progname, socketfile, strerror(errno)); +- exit(EXIT_FAILURE); +- } +- fcntl(sock_fd, F_SETFD, FD_CLOEXEC); +- chmod(socketfile, socketmode); +- if (socketgroup) { +- struct group *gr; +- struct stat buf; +- gr = getgrnam(socketgroup); +- if (!gr) { +- fprintf(stderr, "%s: group %s does not exist\n", +- progname, socketgroup); +- exit(EXIT_FAILURE); +- } +- if (stat(socketfile, &buf) < 0) { +- fprintf(stderr, "%s: can't stat %s\n", +- progname, socketfile); +- exit(EXIT_FAILURE); +- } +- if (chown(socketfile, buf.st_uid, gr->gr_gid) < 0) { +- fprintf(stderr, "%s: chown(): %s\n", +- progname, strerror(errno)); +- exit(EXIT_FAILURE); +- } +- } ++ open_sock(); + } + + /* if we're running in foreground, we don't daemonize */ +@@ -164,7 +139,8 @@ + if (open_log() < 0) { + exit(EXIT_FAILURE); + } +- acpid_log(LOG_INFO, "starting up\n"); ++ acpid_log(LOG_INFO, "starting up with %s\n", ++ netlink ? "netlink and the input layer" : "proc fs"); + + /* trap key signals */ + signal(SIGHUP, reload_conf); +@@ -183,109 +159,50 @@ + exit(EXIT_FAILURE); + } + +- /* main loop */ + acpid_log(LOG_INFO, "waiting for events: event logging is %s\n", + logevents ? "on" : "off"); +- while (1) { +- struct pollfd ar[2]; +- int r; +- int fds = 0; +- +- /* poll for the socket and the event file */ +- ar[0].fd = event_fd; ar[0].events = POLLIN; fds++; +- if (!nosocket) { +- ar[1].fd = sock_fd; ar[1].events = POLLIN; fds++; +- } +- r = poll(ar, fds, -1); + +- if (r < 0 && errno == EINTR) { ++ /* main loop */ ++ while (1) ++ { ++ fd_set readfds; ++ int nready; ++ int i; ++ struct connection *p; ++ ++ /* it's going to get clobbered, so use a copy */ ++ readfds = *get_fdset(); ++ ++ /* wait on data */ ++ nready = select(get_highestfd() + 1, &readfds, NULL, NULL, NULL); ++ ++ if (nready < 0 && errno == EINTR) { + continue; +- } else if (r < 0) { +- acpid_log(LOG_ERR, "poll(): %s\n", strerror(errno)); ++ } else if (nready < 0) { ++ acpid_log(LOG_ERR, "select(): %s\n", strerror(errno)); + continue; + } + +- /* was it an event? */ +- if (ar[0].revents) { +- char *event; +- struct stat trash; +- int fexists; +- +- /* check for existence of a lockfile */ +- fexists = (stat(lockfile, &trash) == 0); +- +- /* this shouldn't happen */ +- if (!ar[0].revents & POLLIN) { +- acpid_log(LOG_DEBUG, +- "odd, poll set flags 0x%x\n", +- ar[0].revents); +- continue; +- |
