diff options
48 files changed, 3334 insertions, 1621 deletions
diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index 0dd6900d77..5de5970880 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -190,7 +190,8 @@ python packagestage_scenefunc () { # # Install the staging package somewhere temporarily so we can extract the stamp files # - cmd = bb.data.expand("${PSTAGE_PKGMANAGER} -force-depends -f ${PSTAGE_MACHCONFIG} -o ${WORKDIR}/tstage install", d) + bb.mkdirhier(bb.data.expand("${WORKDIR}/tstage/${layout_libdir}/opkg/info/ ", d)) + cmd = bb.data.expand("${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${WORKDIR}/tstage install", d) ret = os.system("PATH=\"%s\" %s %s" % (path, cmd, stagepkg)) if ret != 0: bb.fatal("Couldn't install the staging package to a temp directory") diff --git a/conf/distro/include/sane-srcdates.inc b/conf/distro/include/sane-srcdates.inc index c5b969bb7e..10a0330f17 100644 --- a/conf/distro/include/sane-srcdates.inc +++ b/conf/distro/include/sane-srcdates.inc @@ -139,7 +139,7 @@ SRCDATE_mpd ?= "20070210" SRCDATE_mystun-server ?= "20060814" SRCDATE_olsrd ?= "20060814" SRCDATE_opencvs ?= "20060814" -SRCDATE_oprofile ?= "20061011" +SRCDATE_oprofile ?= "20080210" SRCDATE_portaudio ?= "20060814" SRCDATE_putty ?= "20060814" SRCDATE_python-cairo ?= "20060814" diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc index e3d50fc52c..08575018fc 100644 --- a/conf/distro/include/sane-srcrevs.inc +++ b/conf/distro/include/sane-srcrevs.inc @@ -156,9 +156,9 @@ SRCREV_pn-openmoko-worldclock2 ?= "3365" SRCREV_pn-openocd ?= "517" SRCREV_pn-openocd-native ?= "517" SRCREV_pn-opkg ?= "4488" -SRCREV_pn-opkg-native ?= "4488" +SRCREV_pn-opkg-native ?= "4452" SRCREV_pn-opkg-sdk ?= "4488" -SRCREV_pn-oprofileui ?= "160" +SRCREV_pn-oprofileui ?= "173" SRCREV_pn-packagekit ?= "813fa8cfb139246cf180d52895b52b28616ae2f5" SRCREV_pn-psplash ?= "249" SRCREV_pn-pty-forward-native ?= "4214" diff --git a/packages/bwmon/bwmon_1.3.bb b/packages/bwmon/bwmon_1.3.bb index bc08aa7568..11b67f4522 100644 --- a/packages/bwmon/bwmon_1.3.bb +++ b/packages/bwmon/bwmon_1.3.bb @@ -1,15 +1,13 @@ DESCRIPTION = "The Linux bandwidth monitor" LICENSE = "GPL" DEPENDS = "ncurses" -PR = "r1" +PR = "r2" SRC_URI = "${SOURCEFORGE_MIRROR}/bwmon/${P}.tar.gz \ file://makefile.patch;patch=1" inherit autotools -EXTRA_OEMAKE = "LDFLAGS=-L${STAGING_LIBDIR}" - do_install () { install -d ${D}${bindir} install ${S}/bwmon ${D}${bindir}/bwmon diff --git a/packages/fetchmail/fetchmail-6.3.8/.mtn2git_empty b/packages/fetchmail/fetchmail-6.3.8/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/fetchmail/fetchmail-6.3.8/.mtn2git_empty diff --git a/packages/fetchmail/fetchmail-6.3.8/CVE-2007-4565.patch b/packages/fetchmail/fetchmail-6.3.8/CVE-2007-4565.patch new file mode 100644 index 0000000000..d0926848c2 --- /dev/null +++ b/packages/fetchmail/fetchmail-6.3.8/CVE-2007-4565.patch @@ -0,0 +1,11 @@ +--- fetchmail-6.3.8-orig/sink.c ++++ fetchmail-6.3.8/sink.c +@@ -262,7 +262,7 @@ + const char *md1 = "MAILER-DAEMON", *md2 = "MAILER-DAEMON@"; + + /* don't bounce in reply to undeliverable bounces */ +- if (!msg->return_path[0] || ++ if (!msg || !msg->return_path[0] || + strcmp(msg->return_path, "<>") == 0 || + strcasecmp(msg->return_path, md1) == 0 || + strncasecmp(msg->return_path, md2, strlen(md2)) == 0) diff --git a/packages/fetchmail/fetchmail_6.3.8.bb b/packages/fetchmail/fetchmail_6.3.8.bb new file mode 100644 index 0000000000..9b789aae25 --- /dev/null +++ b/packages/fetchmail/fetchmail_6.3.8.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Fetchmail is a free, full-featured, robust, \ +well-documented remote-mail retrieval and forwarding utility \ +intended to be used over on-demand TCP/IP links \ +(such as SLIP or PPP connections)." +SECTION = "console/network" + +LICENSE = "GPL" + +PR = "r2" + +SRC_URI = "${DEBIAN_MIRROR}/main/f/${PN}/${PN}_${PV}.orig.tar.gz \ + file://CVE-2007-4565.patch;patch=1 \ + " + +inherit autotools gettext + +FILES_${PN} = "${bindir}/fetchmail" +PACKAGES += "${PN}conf" +FILES_${PN}conf = "${libdir}/python2.5/site-packages/fetchmailconf.py* ${bindir}/fetchmailconf" +rdepends_${PN}conf = "${PN}" diff --git a/packages/gtk-webcore/midori-0.0.18/.mtn2git_empty b/packages/gtk-webcore/midori-0.0.18/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/gtk-webcore/midori-0.0.18/.mtn2git_empty diff --git a/packages/gtk-webcore/midori-0.0.18/desktop.patch b/packages/gtk-webcore/midori-0.0.18/desktop.patch new file mode 100644 index 0000000000..bb1225432a --- /dev/null +++ b/packages/gtk-webcore/midori-0.0.18/desktop.patch @@ -0,0 +1,7 @@ +--- midori-0.0.18/midori.desktop.in-orig 2008-03-19 14:34:52.000000000 -0700 ++++ midori-0.0.18/midori.desktop.in 2008-03-19 14:21:56.000000000 -0700 +@@ -1,4 +1,3 @@ +- + [Desktop Entry] + Version=1.0 + Encoding=UTF-8 diff --git a/packages/gtk-webcore/midori_0.0.18.bb b/packages/gtk-webcore/midori_0.0.18.bb index b879fef57b..bb144f8600 100644 --- a/packages/gtk-webcore/midori_0.0.18.bb +++ b/packages/gtk-webcore/midori_0.0.18.bb @@ -1 +1,6 @@ -require midori.inc +require midori.inc + +PR = "r2" + +SRC_URI += "file://desktop.patch;patch=1" + diff --git a/packages/ipkg-utils/ipkg-utils/arfile_even_alignment.patch b/packages/ipkg-utils/ipkg-utils/arfile_even_alignment.patch new file mode 100644 index 0000000000..3ab133fb15 --- /dev/null +++ b/packages/ipkg-utils/ipkg-utils/arfile_even_alignment.patch @@ -0,0 +1,11 @@ +--- ipkg-utils/arfile.py.orig 2008-06-11 21:07:01.000000000 -0500 ++++ ipkg-utils/arfile.py 2008-06-14 19:56:04.000000000 -0500 +@@ -86,6 +86,8 @@ + return FileSection(self.f, self.f.tell(), size) + + # Skip data and loop ++ if size % 2: ++ size = size + 1 + data = self.f.seek(size, 1) + # print hex(f.tell()) + diff --git a/packages/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb b/packages/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb index f64e644bd3..707a005c5c 100644 --- a/packages/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb +++ b/packages/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb @@ -5,12 +5,13 @@ LICENSE = "GPL" CONFLICTS = "ipkg-link" RDEPENDS = "python" SRCDATE = "20050404" -PR = "r20" +PR = "r20.1" SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils \ file://ipkg-utils-fix.patch;patch=1 \ file://ipkg-py-sane-vercompare.patch;patch=1 \ file://ipkg-py-tarfile.patch;patch=1 \ + file://arfile_even_alignment.patch;patch=1 \ file://ipkg-make-index-track-stamps.patch;patch=1 \ file://fields_tweaks.patch;patch=1 " diff --git a/packages/libtool/libtool-cross_2.2.4.bb b/packages/libtool/libtool-cross_2.2.4.bb index a8dadc25d2..9b3c6d78ea 100644 --- a/packages/libtool/libtool-cross_2.2.4.bb +++ b/packages/libtool/libtool-cross_2.2.4.bb @@ -1,7 +1,7 @@ require libtool.inc require libtool_${PV}.bb -PR = "r21" +PR = "r23" PACKAGES = "" FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/libtool-${PV}" SRC_URI_append = " file://cross_compile.patch;patch=1 \ @@ -28,9 +28,6 @@ do_compile () { do_stage () { install -m 0755 ${HOST_SYS}-libtool ${bindir}/${HOST_SYS}-libtool - install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/ - install -d ${STAGING_INCDIR}/libltdl - install -m 0644 libltdl/libltdl/*.h ${STAGING_INCDIR}/libltdl/ install -d ${STAGING_DATADIR}/libtool ${STAGING_DATADIR}/aclocal install -c ${S}/libltdl/config/config.guess ${STAGING_DATADIR}/libtool/ install -c ${S}/libltdl/config/config.sub ${STAGING_DATADIR}/libtool/ diff --git a/packages/libtool/libtool_2.2.4.bb b/packages/libtool/libtool_2.2.4.bb index 6739802fb7..c8380d161c 100644 --- a/packages/libtool/libtool_2.2.4.bb +++ b/packages/libtool/libtool_2.2.4.bb @@ -1,6 +1,6 @@ require libtool.inc -PR = "r12" +PR = "r14" DEFAULT_PREFERENCE = "-1" @@ -18,5 +18,8 @@ inherit autotools EXTRA_AUTORECONF = "--exclude=libtoolize" do_stage () { - autotools_stage_all + install -d ${STAGING_INCDIR}/libltdl + install -m 0644 libltdl/ltdl.h ${STAGING_INCDIR}/ + install -m 0644 libltdl/libltdl/*.h ${STAGING_INCDIR}/libltdl/ + oe_libinstall -a -so -C libltdl libltdl ${STAGING_LIBDIR} } diff --git a/packages/meta/slugos-packages.bb b/packages/meta/slugos-packages.bb index 2927bc6d7b..946b51b210 100644 --- a/packages/meta/slugos-packages.bb +++ b/packages/meta/slugos-packages.bb @@ -5,7 +5,7 @@ DESCRIPTION = "Packages that are compatible with the SlugOS firmware" HOMEPAGE = "http://www.nslu2-linux.org" LICENSE = "MIT" -PR = "r55" +PR = "r57" CONFLICTS = "db3" COMPATIBLE_MACHINE = "nslu2|ixp4xx" @@ -53,6 +53,7 @@ SLUGOS_PACKAGES = "\ bonnie++ \ boost \ bridge-utils \ + bwmon \ bzip2 \ ccxstream \ cdparanoia \ @@ -61,7 +62,6 @@ SLUGOS_PACKAGES = "\ coreutils \ cron \ cryptsetup \ - ctorrent \ ctrlproxy \ cups \ curl \ @@ -81,6 +81,7 @@ SLUGOS_PACKAGES = "\ expat \ ez-ipupdate \ fconfig \ + fetchmail \ file \ findutils \ fis \ @@ -208,6 +209,7 @@ SLUGOS_PACKAGES = "\ sipsak \ slugimage \ smartmontools \ + spandsp \ sqlite \ squid \ ssmtp \ @@ -216,6 +218,7 @@ SLUGOS_PACKAGES = "\ stunnel \ sudo \ sysfsutils \ + syslog-ng \ tar \ task-mokogateway-everything \ tcpdump \ @@ -251,10 +254,9 @@ SLUGOS_PACKAGES = "\ # Packages currently broken on all platforms SLUGOS_BROKEN_PACKAGES = "\ - bwmon \ + ctorrent \ dsniff \ eciadsl \ - fetchmail \ gspcav1 \ linphone \ lirc-modules lirc \ @@ -264,8 +266,6 @@ SLUGOS_BROKEN_PACKAGES = "\ postfix \ pwc \ qc-usb-messenger \ - spandsp \ - syslog-ng \ task-native-sdk \ unionfs-modules unionfs-utils \ wview-sim-mysql wview-wxt510-mysql wview-vpro-mysql \ diff --git a/packages/oprofile/oprofile/armv6_fix.patch b/packages/oprofile/oprofile/armv6_fix.patch new file mode 100644 index 0000000000..b981871e6e --- /dev/null +++ b/packages/oprofile/oprofile/armv6_fix.patch @@ -0,0 +1,54 @@ +--- + events/arm/armv6/events | 43 +++++++++++++++++++++---------------------- + 1 file changed, 21 insertions(+), 22 deletions(-) + +Index: oprofile-0.9.3/events/arm/armv6/events +=================================================================== +--- oprofile-0.9.3.orig/events/arm/armv6/events 2007-07-16 19:22:17.000000000 +0100 ++++ oprofile-0.9.3/events/arm/armv6/events 2007-09-28 11:13:32.000000000 +0100 +@@ -1,24 +1,23 @@ + # ARM V6 events + # +-event:0x00 counters:1,2 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses +-event:0x01 counters:1,2 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled +-event:0x02 counters:1,2 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency +-event:0x03 counters:1,2 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses +-event:0x04 counters:1,2 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses +-event:0x05 counters:1,2 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change +-event:0x06 counters:1,2 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted +-event:0x07 counters:1,2 um:zero minimum:500 name:INSN_EXECUTED : instructions executed +-event:0x09 counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations +-event:0x0a counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations +-event:0x0b counters:1,2 um:zero minimum:500 name:DCACHE_MISS : data cache miss +-event:0x0c counters:1,2 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline +-event:0x0d counters:1,2 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch +-event:0x0f counters:1,2 um:zero minimum:500 name:TLB_MISS : Main TLB miss +-event:0x10 counters:1,2 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access +-event:0x11 counters:1,2 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full +-event:0x12 counters:1,2 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained +-event:0x20 counters:1,2 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted +-event:0x21 counters:1,2 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted +-event:0x22 counters:1,2 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2 +-event:0xff counters:1,2 um:zero minimum:500 name:CPU_CYCLES2 : clock cycles counter +-event:0xfe counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter ++event:0x00 counters:0,1 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses ++event:0x01 counters:0,1 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled ++event:0x02 counters:0,1 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency ++event:0x03 counters:0,1 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses ++event:0x04 counters:0,1 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses ++event:0x05 counters:0,1 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change ++event:0x06 counters:0,1 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted ++event:0x07 counters:0,1 um:zero minimum:500 name:INSN_EXECUTED : instructions executed ++event:0x09 counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations ++event:0x0a counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations ++event:0x0b counters:0,1 um:zero minimum:500 name:DCACHE_MISS : data cache miss ++event:0x0c counters:0,1 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline ++event:0x0d counters:0,1 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch ++event:0x0f counters:0,1 um:zero minimum:500 name:TLB_MISS : Main TLB miss ++event:0x10 counters:0,1 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access ++event:0x11 counters:0,1 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full ++event:0x12 counters:0,1 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained ++event:0x20 counters:0,1 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted ++event:0x21 counters:0,1 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted ++event:0x22 counters:0,1 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2 ++event:0xff counters:0,1,2 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter diff --git a/packages/oprofile/oprofile/fix-arith.patch b/packages/oprofile/oprofile/fix-arith.patch new file mode 100644 index 0000000000..5c55f4b349 --- /dev/null +++ b/packages/oprofile/oprofile/fix-arith.patch @@ -0,0 +1,52 @@ +Index: utils/opcontrol +=================================================================== +RCS file: /cvsroot/oprofile/oprofile/utils/opcontrol,v +retrieving revision 1.148 +diff -u -r1.148 opcontrol +--- utils/opcontrol 8 Nov 2007 09:24:30 -0000 1.148 ++++ utils/opcontrol 27 Nov 2007 17:02:20 -0000 +@@ -395,7 +395,7 @@ + echo "SESSION_DIR=$SESSION_DIR" >>$SETUP_FILE + + if test "$NR_CHOSEN" != "0"; then +- for f in `seq 0 $((NR_CHOSEN - 1))`; do ++ for f in `seq 0 $(($NR_CHOSEN - 1))`; do + get_event $f + echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE + done +@@ -590,7 +590,7 @@ + OPHELP_ARGS= + + if test "$NR_CHOSEN" != 0; then +- for f in `seq 0 $((NR_CHOSEN - 1))`; do ++ for f in `seq 0 $(($NR_CHOSEN - 1))`; do + get_event $f + if test "$GOTEVENT" != ""; then + OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT" +@@ -612,7 +612,7 @@ + return + fi + +- for f in `seq 0 $((NR_CHOSEN - 1))`; do ++ for f in `seq 0 $(($NR_CHOSEN - 1))`; do + get_event $f + if test "$GOTEVENT" != ""; then + EVENT=`echo $GOTEVENT | awk -F: '{print $1}'` +@@ -1226,7 +1226,7 @@ + verify_counters + + OPROFILED_EVENTS= +- for f in `seq 0 $((NR_CHOSEN - 1))`; do ++ for f in `seq 0 $(($NR_CHOSEN - 1))`; do + get_event $f + if test "$GOTEVENT" != ""; then + EVENT=`echo $GOTEVENT | awk -F: '{print $1}'` +@@ -1383,7 +1383,7 @@ + fi + + if test "$NR_CHOSEN" != "0"; then +- for f in `seq 0 $((NR_CHOSEN - 1))`; do ++ for f in `seq 0 $(($NR_CHOSEN - 1))`; do + get_event $f + echo "Event $f: $GOTEVENT" + done diff --git a/packages/oprofile/oprofile/oparchive_fix.patch b/packages/oprofile/oprofile/oparchive_fix.patch new file mode 100644 index 0000000000..dbdd5eb4ea --- /dev/null +++ b/packages/oprofile/oprofile/oparchive_fix.patch @@ -0,0 +1,22 @@ +Index: oprofile/pp/oparchive.cpp +=================================================================== +--- oprofile.orig/pp/oparchive.cpp ++++ oprofile/pp/oparchive.cpp +@@ -95,7 +95,7 @@ int oparchive(options::spec const & spec + * to avoid overwriting files with the same name. The + * /usr/lib/debug search path is not going to work. + */ +- bfd * ibfd = open_bfd(exe_name); ++ bfd * ibfd = open_bfd(options::archive_path + exe_name); + if (ibfd) { + string global(options::archive_path + DEBUGDIR); + string dirname = op_dirname(options::archive_path + +@@ -106,7 +106,7 @@ int oparchive(options::spec const & spec + /* found something copy it over */ + string dest_debug_dir = options::outdirectory + + dirname + "/.debug/"; +- if (create_dir(dest_debug_dir.c_str())) { ++ if (!options::list_files && create_dir(dest_debug_dir.c_str())) { + cerr << "Unable to create directory: " + << dest_debug_dir << "." << endl; + exit (EXIT_FAILURE); diff --git a/packages/oprofile/oprofile/opstart.patch b/packages/oprofile/oprofile/opstart.patch new file mode 100644 index 0000000000..e8da0922cc --- /dev/null +++ b/packages/oprofile/oprofile/opstart.patch @@ -0,0 +1,235 @@ +Index: oprofile/utils/Makefile.am +=================================================================== +--- oprofile.orig/utils/Makefile.am ++++ oprofile/utils/Makefile.am +@@ -3,8 +3,15 @@ AM_CFLAGS = @OP_CFLAGS@ + + LIBS=@POPT_LIBS@ @LIBERTY_LIBS@ + +-bin_PROGRAMS = ophelp ++bin_PROGRAMS = ophelp opstart + dist_bin_SCRIPTS = opcontrol + + ophelp_SOURCES = ophelp.c + ophelp_LDADD = ../libop/libop.a ../libutil/libutil.a ++ ++opstart_SOURCES = opstart.c ++ ++install-exec-local: ++ cd $(DESTDIR)/$(bindir) && \ ++ rm -f opstop && \ ++ $(LN_S) opstart opstop +Index: oprofile/utils/opstart.c +=================================================================== +--- /dev/null ++++ oprofile/utils/opstart.c +@@ -0,0 +1,110 @@ ++/** ++ * @file opstart.c ++ * Start/Stop oprofile ++ * ++ * @remark Copyright 2007 Openedhand Ltd. ++ * @remark Read the file COPYING ++ * ++ * @author Richard Purdie ++ */ ++ ++#include <signal.h> ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <unistd.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++ ++int main(const int argc, const char* argv[]) ++{ ++ const char *enable = "/dev/oprofile/enable"; ++ const char *lockfile; ++ unsigned long dpid; ++ struct stat sbuf; ++ FILE *lfile, *efile; ++ int sig, enb, err; ++ ++ if (argc >= 2) { ++ printf("Error: Invalid options.\n"); ++ return 1; ++ } ++ ++ lockfile = getenv("LOCK_FILE"); ++ if (!lockfile) ++ lockfile = "/var/lib/oprofile/lock"; ++ ++ /* Add SESSION_DIR support? */ ++ ++ if (geteuid()) { ++ printf("Error: This program must be run as root.\n"); ++ return 1; ++ } ++ ++ if (stat(enable, &sbuf)) { ++ printf("Error: Could not find /dev/oprofile/enable, the" ++ " kernel module probably isn't loaded.\n"); ++ printf("This binary only works with 2.6 kernels and oprofile" ++ " must have been initialised with 'opcontrol --start-daemon'.\n"); ++ return 1; ++ } ++ ++ if (stat(lockfile, &sbuf)) { ++ printf("Error: Could not find lockfile %s.\n", lockfile); ++ printf("The oprofile daemon must be running (oprofile must" ++ " have been initialised with 'opcontrol --start-daemon').\n"); ++ return 1; ++ } ++ ++ lfile = fopen(lockfile, "r"); ++ if (!lfile) { ++ printf("Error opening lockfile %s.\n", lockfile); ++ return 1; ++ } ++ ++ err = fscanf(lfile, "%lud", (unsigned long *) &dpid); ++ if (err != 1) { ++ printf("Error reading pid from lockfile %s.\n", lockfile); ++ return 1; ++ } ++ fclose(lfile); ++ ++ efile = fopen(enable, "r"); ++ if (!efile) { ++ printf("Error opening %s.\n", enable); ++ return 1; ++ } ++ ++ if (strstr(argv[0], "opstart")) { ++ printf("Starting Profiler\n"); ++ sig = SIGUSR1; ++ enb = 1; ++ } else if (strstr(argv[0], "opstop")) { ++ printf("Stopping Oprofile.\n"); ++ printf("You need to run 'opcontrol --dump' when the session" ++ " is finished.\n"); ++ sig = SIGUSR2; ++ enb = 0; ++ } else { ++ printf("Error: Please call as 'opstart' or 'opstop'\n"); ++ return 1; ++ } ++ ++ err = kill(dpid, 0); ++ if (err) { ++ printf("Error sending signal to oprofiled. Stale lockfile" ++ " (%s) ?\n", lockfile); ++ return 1; ++ } ++ ++ fprintf(efile, "%d\n", enb); ++ err = kill(dpid, sig); ++ if (err) { ++ printf("Error sending signal to oprofiled. Stale lockfile" ++ " (%s) ?\n", lockfile); ++ return 1; ++ } ++ ++ return 0; ++} ++ +Index: oprofile/configure.in +=================================================================== +--- oprofile.orig/configure.in ++++ oprofile/configure.in +@@ -16,6 +16,7 @@ AM_INIT_AUTOMAKE(oprofile, 0.9.4cvs) + AM_CONFIG_HEADER(config.h) + + AC_PROG_RANLIB ++AC_PROG_LN_S + + dnl for the man page + DATE="`date '+%a %d %B %Y'`" +@@ -227,6 +228,8 @@ AC_OUTPUT(Makefile \ + doc/xsl/catalog-1.xml \ + doc/oprofile.1 \ + doc/opcontrol.1 \ ++ doc/opstart.1 \ ++ doc/opstop.1 \ + doc/ophelp.1 \ + doc/opreport.1 \ + doc/opannotate.1 \ +Index: oprofile/doc/Makefile.am +=================================================================== +--- oprofile.orig/doc/Makefile.am ++++ oprofile/doc/Makefile.am +@@ -11,6 +11,8 @@ STYLESHEETS=$(CHUNK_XHTML_STYLESHEET) $( + man_MANS = \ + oprofile.1 \ + opcontrol.1 \ ++ opstart.1 \ ++ opstop.1 \ + opreport.1 \ + opannotate.1 \ |
