--- longrun-0.9.orig/Makefile +++ longrun-0.9/Makefile @@ -1,10 +1,26 @@ -all: longrun README +include Makeconfig + +all: longrun README stamp-po longrun: longrun.c - gcc -g -O2 -W -Wall -o longrun longrun.c + gcc -DLOCALEDIR=\"$(LOCALEDIR)\" -g -O2 -W -Wall -o longrun longrun.c README: longrun.1 groff -Tascii -man longrun.1 | col -bx > README +stamp-po: + make -C po + touch stamp-po + +install: all + mkdir -p $(DESTDIR)$(BINDIR) + install -o root -g root -m 755 longrun $(DESTDIR)$(BINDIR)/longrun + mkdir -p $(DESTDIR)$(MANDIR)/man1 + install -m 644 longrun.1 $(DESTDIR)$(MANDIR)/man1/longrun.1 + mkdir -p $(DESTDIR)$(MANDIR)/ja/man1 + install -m 644 longrun.1.ja $(DESTDIR)$(MANDIR)/ja/man1/longrun.1 + make -C po install + clean: - -rm -f longrun README + -rm -f longrun README stamp-po *~ + make -C po clean --- longrun-0.9.orig/longrun.1 +++ longrun-0.9/longrun.1 @@ -39,27 +39,27 @@ .TH LONGRUN 1 "February 14, 2001" .nh .SH NAME -Transmeta(TM) Crusoe(TM) LongRun(TM) utility +longrun \- Transmeta(TM) Crusoe(TM) LongRun(TM) utility .SH SYNOPSIS -.B longrun [-c device] [-m device] [-hlpv] [-f flag] [-s low high] +.B longrun [\-c device] [\-m device] [\-hlpv] [\-f flag] [\-s low high] [\-t num] .SH DESCRIPTION The .I longrun utility is used to control and query LongRun settings on Transmeta Crusoe processors. .TP --c device +\-c device Set the CPUID device. The default CPUID device is .BR /dev/cpu/0/cpuid . .TP --m device -Set the MSR device. The default CPUID device is +\-m device +Set the MSR device. The default MSR device is .BR /dev/cpu/0/msr . .TP --h +\-h Print help. .TP --l +\-l List LongRun information about available performance levels for the CPU. .RS 7 @@ -84,17 +84,17 @@ .RE .RE .TP --p +\-p Print current LongRun settings and status: whether LongRun is enabled, whether LongRun Thermal Extensions are active, the current LongRun performance window (expressed as a percentile range), the current LongRun performance level (expressed as a percentile), and the current LongRun flags. .TP --v +\-v Be more verbose. .TP --f flag +\-f flag Set a LongRun mode flag. Currently, the two supported flags are .B performance and @@ -102,11 +102,40 @@ This controls whether the processor is in "performance mode" or "economy mode". .TP --s low high +\-s low high Set the current LongRun performance window as a percentile range. The low number cannot be greater than the high number. The minimum and maximum performance values accepted by the CPU are 0 and 100, respectively. +.TP +\-t num +Set current LongRun Thermal Extensions setting (0 to 8, 8 = off). Take +care with \-t 0 and \-t 1. +.RS +.P +Longrun Thermal Extensions (LTX) is an alternative way to manipulate the +power saving functionality of the processor, by controlling heat +dissipation directly. Settings 2 through 8 represent power utilization +levels from 25% to 100%, respectively, in 12.5% increments. NOTE: +Settings 0 and 1 are listed as 'reserved' in the TM5600 literature. +Though they appear to represent 0% and 12.5% respectively on the TM5800 +chip, use these settings at your own risk. +.P +Interaction with the \-s flag: +Originally intended as a mechanism to use Transmeta chips on fanless +machines (referred to apocryphally as "coolrun"), the \-t flag limits the +power range of the processor. The performance range of the processor is +limited first by the \-t flag, and then subsequently the \-s flag. In +other words, setting both '\-s 57 100' and '\-t 6' will result in the +processor running in the 57 to 75% power range. +.P +Notes: +This functionality may or may not provide you with different performance +per watt characteristings than the \-s flag. It is provided for +completeness, and left as an exercise to the reader to decide if it is +appropriate on their system. As mentioned above, use the \-t 0 and \-t 1 +settings with caution. +.RE .SH ENVIRONMENT No environment variables are used. .SH FILES --- longrun-0.9.orig/longrun.c +++ longrun-0.9/longrun.c @@ -32,13 +32,34 @@ #include #include #include +#include #define __USE_UNIX98 /* for pread/pwrite */ +#define __USE_FILE_OFFSET64 /* we should use 64 bit offset for pread/pwrite */ #include +#include +#define _(Text) gettext(Text) + #define MSR_DEVICE "/dev/cpu/0/msr" #define MSR_TMx86_LONGRUN 0x80868010 #define MSR_TMx86_LONGRUN_FLAGS 0x80868011 +#define MSR_TMx86_LRTI_READOUT 0x80868018 +#define MSR_TMx86_LRTI_PERF 0x80868019 +#define MSR_TMx86_LRTI_VOLT_MHZ 0x8086801A +#define MSR_TMx86_LRTI_DIV_MEM 0x8086801B +#define MSR_TMx86_LRTI_DIV_IO 0x8086801C +#define MSR_TMx86_LRTI_GATE 0x8086801D + +#define MSR_TMx86_LRTI_SDR_MISC 0x80868030 +#define MSR_TMx86_LRTI_SDR_TIF 0x80868031 +#define MSR_TMx86_LRTI_SDR_MRS 0x80868032 +#define MSR_TMx86_LRTI_SDR_LBT 0x80868033 +#define MSR_TMx86_LRTI_DDR_MISC_TIF 0x80868034 +#define MSR_TMx86_LRTI_DDR_MRS0 0x80868035 +#define MSR_TMx86_LRTI_DDR_MRS1_MRS2 0x80868036 +#define MSR_TMx86_PFTI_MING 0x80868037 + #define LONGRUN_MASK(x) ((x) & 0x0000007f) #define LONGRUN_RESERVED(x) ((x) & 0xffffff80) #define LONGRUN_WRITE(x, y) (LONGRUN_RESERVED(x) | LONGRUN_MASK(y)) @@ -48,6 +69,7 @@ #define CPUID_TMx86_PROCESSOR_INFO 0x80860001 #define CPUID_TMx86_LONGRUN_STATUS 0x80860007 #define CPUID_TMx86_FEATURE_LONGRUN(x) ((x) & 0x02) +#define CPUID_TMx86_FEATURE_LRTI(x) ((x) & 0x08) /* Advanced Thermal Management */ #define LR_NORTHBRIDGE "/proc/bus/pci/00/00.0" @@ -70,8 +92,8 @@ FILE *stream = status ? stderr : stdout; fprintf(stream, - "%s %s (%s)\n" - "usage: %s [-c device] [-m device] [-hlpv] [-f flag] [-s low high]\n" + _("%s %s (%s)\n" + "usage: %s [-c device] [-m device] [-hlpv] [-f flag] [-s low high] [-t tlx]\n" " -c device set CPUID device\n" " -m device set MSR device\n" " -h print this help\n" @@ -80,10 +102,11 @@ " -v be more verbose\n" " -f [flag] set a LongRun mode flag\n" " -s low high set current LongRun performance window (0 to 100)\n" + " -t tlx set current LongRun Thermal Extensions setting (0 to 8, 8 = off)\n" "\n" "supported flags:\n" " economy set economy mode (turn off performance mode)\n" - " performance set performance mode (turn off economy mode)\n", + " performance set performance mode (turn off economy mode)\n"), progname, VERSION, REVDATE, progname); exit(status); @@ -126,32 +149,51 @@ nb = open(LR_NORTHBRIDGE, O_RDONLY); if (nb < 0) { - error_warn("error opening %s", LR_NORTHBRIDGE); + error_warn(_("error opening %s"), LR_NORTHBRIDGE); if (errno == ENOENT) { - fprintf(stderr, "make sure /proc is mounted\n"); + fprintf(stderr, _("make sure /proc is mounted\n")); } exit(1); } if (pread(nb, atm, 1, ATM_ADDRESS) != 1) { - error_die("error reading %s", LR_NORTHBRIDGE); + error_die(_("error reading %s"), LR_NORTHBRIDGE); + } + close(nb); +} + +/* write Advanced Thermal Management definitions register */ +void write_atm(uint8_t *atm) +{ + int nb; + + nb = open(LR_NORTHBRIDGE, O_RDWR); + if (nb < 0) { + error_warn(_("error opening %s"), LR_NORTHBRIDGE); + if (errno == ENOENT) { + fprintf(stderr, _("make sure /proc is mounted\n")); + } + exit(1); + } + if (pwrite(nb, atm, 1, ATM_ADDRESS) != 1) { + error_die(_("error reading %s"), LR_NORTHBRIDGE); } close(nb); } /* note: if an output is NULL, then don't set it */ -void read_msr(long address, int *lower, int *upper) +void read_msr(loff_t address, int *lower, int *upper) { uint32_t data[2]; if (pread(msr_fd, &data, 8, address) != 8) { - error_die("error reading %s", msr_device); + error_die(_("error reading %s"), msr_device); } if (lower) *lower = data[0]; if (upper) *upper = data[1]; } -void write_msr(long address, int lower, int upper) +void write_msr(loff_t address, int lower, int upper) { uint32_t data[2]; @@ -159,17 +201,17 @@ data[1] = (uint32_t) upper; if (pwrite(msr_fd, &data, 8, address) != 8) { - error_die("error writing %s", msr_device); + error_die(_("error writing %s"), msr_device); } } /* note: if an output is NULL, then don't set it */ -void read_cpuid(long address, int *eax, int *ebx, int *ecx, int *edx) +void read_cpuid(loff_t address, int *eax, int *ebx, int *ecx, int *edx) { uint32_t data[4]; if (pread(cpuid_fd, &data, 16, address) != 16) { - error_die("error reading %s", cpuid_device); + error_die(_("error reading %s"), cpuid_device); } if (eax) *eax = data[0]; @@ -185,19 +227,113 @@ /* test for "TransmetaCPU" */ read_cpuid(CPUID_TMx86_VENDOR_ID, &eax, &ebx, &ecx, &edx); if (ebx != 0x6e617254 || ecx != 0x55504361 || edx != 0x74656d73) { - fprintf(stderr, "%s: not a Transmeta x86 CPU\n", progname); + fprintf(stderr, _("%s: not a Transmeta x86 CPU\n"), progname); exit(1); } /* test for LongRun feature flag */ read_cpuid(CPUID_TMx86_PROCESSOR_INFO, &eax, &ebx, &ecx, &edx); if (!CPUID_TMx86_FEATURE_LONGRUN(edx)) { - printf("LongRun: unsupported\n"); + printf(_("LongRun: unsupported\n")); exit(0); } } -void list_longrun() +void print_lrti_info() +{ + int max; + int junk; + int max_voltage, max_mhz; + double max_power; + + read_msr(MSR_TMx86_LRTI_READOUT, &junk, &max); + + write_msr(MSR_TMx86_LRTI_READOUT, 0, max); + read_msr(MSR_TMx86_LRTI_VOLT_MHZ, &max_mhz, &max_voltage); + + max_power = ((double)max_mhz * max_voltage) * max_voltage; + + printf(_("# %% MHz Volts usage SDR DDR PCI\n")); + + int i; + for (i = max; i >= 0; i--) + { + int percent, mhz, voltage; + double power; + int ddr_mem_div, sdr_mem_div, ddr_freq, sdr_freq; + int io_div; + write_msr(MSR_TMx86_LRTI_READOUT, i, max); + + read_msr(MSR_TMx86_LRTI_PERF, &percent, &junk); + printf(_("%3d "), percent); + + read_msr(MSR_TMx86_LRTI_VOLT_MHZ, &mhz, &voltage); + printf(_("%5d %6.3f "), mhz, (voltage / 1000.0)); + + power = ((double)mhz * voltage) * voltage; + + printf(_("%6.3f "), ((double) power) / max_power); + + // TODO: Watch for zeros + read_msr(MSR_TMx86_LRTI_DIV_MEM, &sdr_mem_div, &ddr_mem_div); + + sdr_freq = 0; + ddr_freq = 0; + + if (sdr_mem_div > 0) + { + sdr_freq = mhz / sdr_mem_div; + } + + if (ddr_mem_div > 0) + { + ddr_freq = mhz / ddr_mem_div; + } + + printf(_("%4d %4d "), sdr_freq, ddr_freq); + + read_msr(MSR_TMx86_LRTI_DIV_IO, &io_div, &junk); + if (io_div) { + printf(_("%4d\n"), mhz / io_div); + } + else { + printf("%4s\n", "--"); + } + + /* + // Most of the rest of these flags don't appear too interesting + int eax, ebx; + read_msr(MSR_TMx86_LRTI_GATE, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_GATE: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_SDR_MISC, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_SDR_MISC: %x %x\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_SDR_TIF, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_SDR_TIF: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_SDR_MRS, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_SDR_MRS: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_SDR_LBT, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_SDR_LBT: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_DDR_MISC_TIF, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_DDR_MISC_TIF: %x %x\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_DDR_MRS0, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_DDR_MRS0: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_LRTI_DDR_MRS1_MRS2, &eax, &ebx); + printf(_("MSR_TMx86_LRTI_DDR_MRS1_MRS2: %d %d\n"), eax, ebx); + + read_msr(MSR_TMx86_PFTI_MING, &eax, &ebx); + printf(_("MSR_TMx86_PFTI_MING: %d %d\n"), eax, ebx); + */ + } +} + +void old_list_longrun() { int i, save_lower, save_upper, pct_in, pct_last, steps, freq_max; int eax, ebx, ecx; @@ -230,7 +366,7 @@ LONGRUN_WRITE(save_upper, pct_in)); read_cpuid(CPUID_TMx86_LONGRUN_STATUS, &eax, &ebx, &ecx, 0); if (opt_verbose) - printf("# set %d, got %d\n", pct_in, ecx); + printf(_("# set %d, got %d\n"), pct_in, ecx); if (pct_last < ecx) { perf[i] = ecx; mhz[i] = eax; @@ -246,12 +382,12 @@ /* find power_max */ power_max = mhz[i] * volts[i] * volts[i]; + printf(_("# %% MHz Volts usage\n")); /* print results */ - printf("# %% MHz Volts usage\n"); for (i = 0; i <= steps; i++) { if (mhz[i]) { power_ratio = mhz[i] * volts[i] * volts[i] / power_max; - printf("%3d %5d %6.3f %6.3f\n", + printf(_("%3d %5d %6.3f %6.3f\n"), perf[i], mhz[i], volts[i] / 1000.0, power_ratio); } } @@ -264,6 +400,21 @@ write_msr(MSR_TMx86_LONGRUN, save_lower, save_upper); } +void list_longrun() +{ + int eax, ebx, ecx, edx; + + read_cpuid(CPUID_TMx86_PROCESSOR_INFO, &eax, &ebx, &ecx, &edx); + if (CPUID_TMx86_FEATURE_LRTI(edx)) + { + print_lrti_info(); + } + else + { + old_list_longrun(); + } +} + void get_longrun(int *low, int *high) { read_msr(MSR_TMx86_LONGRUN, low, high); @@ -280,7 +431,24 @@ write_msr(MSR_TMx86_LONGRUN, LONGRUN_WRITE(lower, low), LONGRUN_WRITE(upper, high)); if (opt_verbose) { - printf("Setting performance window: %d to %d\n", low, high); + printf(_("Setting performance window: %d to %d\n"), low, high); + } +} + +void set_longrun_atm(int level) +{ + uint8_t flags = 0x00; + if (level != 8) + { + // LTX codes constitute bits 0-5, with the middle three bits + // indicating the TLX setting + flags = 0x11; + flags |= (level & 0x7)<<1; + } + + write_atm(&flags); + if (opt_verbose) { + printf(_("Setting thermal extensions: %x\n"), flags); } } @@ -292,14 +460,14 @@ if (!strcmp(flag, "economy")) { write_msr(MSR_TMx86_LONGRUN_FLAGS, lower & 0xfffffffe, upper); if (opt_verbose) { - printf("Setting flag: economy\n"); + printf(_("Setting flag: economy\n")); } } else if (!strcmp(flag, "performance")) { write_msr(MSR_TMx86_LONGRUN_FLAGS, (lower & 0xffffffff) | 0x1, upper); if (opt_verbose) { - printf("Setting flag: performance\n"); + printf(_("Setting flag: performance\n")); } } else { @@ -317,54 +485,60 @@ read_atm(&atm); - printf("LongRun: %s\n", LR_EN(atm) ? "enabled" : "disabled"); - printf("LongRun Thermal Extensions (LTX): %s\n", ATM_EN(atm) ? "active" : "inactive"); + printf(_("LongRun: %s\n"), LR_EN(atm) ? _("enabled") : _("disabled")); + printf(_("LongRun Thermal Extensions (LTX): %s\n"), ATM_EN(atm) ? _("active") : _("inactive")); if (ATM_EN(atm)) { - printf("LTX setting: "); + printf(_("LTX setting: ")); switch(ATM_LVL(atm)) { case 0: case 1: - printf("reserved\n"); break; + printf(_("reserved\n")); break; case 2: - printf("75%% reduction\n"); break; + printf(_("75%% reduction\n")); break; case 3: - printf("62.5%% reduction\n"); break; + printf(_("62.5%% reduction\n")); break; case 4: - printf("50%% reduction\n"); break; + printf(_("50%% reduction\n")); break; case 5: - printf("37.5%% reduction\n"); break; + printf(_("37.5%% reduction\n")); break; case 6: - printf("25%% reduction\n"); break; + printf(_("25%% reduction\n")); break; case 7: - printf("12.5%% reduction\n"); break; + printf(_("12.5%% reduction\n")); break; } } get_longrun(&lower, &upper); - printf("Current performance window: %d to %d\n", lower, upper); - printf("Current performance level: %d\n", percent); + printf(_("Current performance window: %d to %d\n"), lower, upper); + printf(_("Current performance level: %d\n"), percent); read_msr(MSR_TMx86_LONGRUN_FLAGS, &lower, &upper); - printf("LongRun flags: %s\n", (lower & 1) ? "performance" : "economy"); + printf(_("LongRun flags: %s\n"), (lower & 1) ? _("performance") : _("economy")); } int main(int argc, char *argv[]) { int low, high; + int atm; int g; char *opt_flag = NULL; int opt_list = 0; int opt_print = 0; int opt_set = 0; + int opt_atm = 0; if (argc) progname = my_basename(argv[0]); else progname = "longrun"; + setlocale (LC_ALL, ""); + bindtextdomain (progname, LOCALEDIR); + textdomain (progname); + msr_device = MSR_DEVICE; cpuid_device = CPUID_DEVICE; /* command line options */ - while ((g = getopt(argc, argv, "c:f:m:hlpsv")) != EOF) { + while ((g = getopt(argc, argv, "c:f:m:hlpstv")) != EOF) { switch (g) { case 'c': cpuid_device = optarg; @@ -387,35 +561,43 @@ case 's': opt_set = 1; break; + case 't': + opt_atm = 1; + break; case 'v': opt_verbose++; break; } } - if (opt_list + opt_print + opt_set + (opt_flag ? 1 : 0) != 1) + /* Modified for Debian to allow concurrent use of the -s and -f + * switches -- JEH */ + if (opt_list + opt_print + opt_atm + (opt_set || (opt_flag ? 1 : 0)) != 1) usage(1); if (opt_set && (optind + 2 != argc)) usage(1); + if (opt_atm && (optind + 1 != argc)) + usage(1); + if (geteuid()) { - fprintf(stderr, "%s: must be run as root\n", progname); + fprintf(stderr, _("%s: must be run as root\n"), progname); exit(1); } if ((cpuid_fd = open(cpuid_device, O_RDWR)) < 0) { - error_warn("error opening %s", cpuid_device); + error_warn(_("error opening %s"), cpuid_device); if (errno == ENODEV) { - fprintf(stderr, "make sure your kernel was compiled with CONFIG_X86_CPUID=y\n"); + fprintf(stderr, _("make sure your kernel was compiled with CONFIG_X86_CPUID=y\n")); } exit(1); } if ((msr_fd = open(msr_device, O_RDWR)) < 0) { - error_warn("error opening %s", msr_device); + error_warn(_("error opening %s"), msr_device); if (errno == ENODEV) { - fprintf(stderr, "make sure your kernel was compiled with CONFIG_X86_MSR=y\n"); + fprintf(stderr, _("make sure your kernel was compiled with CONFIG_X86_MSR=y\n")); } exit(1); } @@ -431,6 +613,10 @@ high = strtol(argv[optind + 1], NULL, 10); set_longrun(low, high); } + if (opt_atm) { + atm = strtol(argv[optind], NULL, 10); + set_longrun_atm(atm); + } if (opt_flag) { set_longrun_flag(opt_flag); } --- longrun-0.9.orig/Makeconfig +++ longrun-0.9/Makeconfig @@ -0,0 +1,8 @@ +PACKAGE=longrun + +PREFIX=/usr +BINDIR=$(PREFIX)/bin +DATADIR=$(PREFIX)/share + +MANDIR=$(DATADIR)/man +LOCALEDIR=$(DATADIR)/locale --- longrun-0.9.orig/longrun.1.ja +++ longrun-0.9/longrun.1.ja @@ -0,0 +1,188 @@ +.\" Copyright (C) 2001 Transmeta Corporation. All rights reserved. +.\" +.\" The information contained in this document is provided solely for use in +.\" connection with Transmeta products, and Transmeta reserves all rights in +.\" and to such information and the products discussed herein. This document +.\" should not be construed as transferring or granting a license to any +.\" intellectual property rights, whether express, implied, arising through +.\" estoppel or otherwise. Except as may be agreed in writing by Transmeta, +.\" all Transmeta products are provided "as is" and without a warranty of any +.\" kind, and Transmeta hereby disclaims all warranties, express or implied, +.\" relating to Transmeta's products, including, but not limited to, the +.\" implied warranties of merchantability, fitness for a particular purpose and +.\" non-infringement of third party intellectual property. Transmeta products +.\" may contain design defects or errors which may cause the products to +.\" deviate from published specifications, and Transmeta documents may contain +.\" inaccurate information. Transmeta makes no representations or warranties +.\" with respect to the accuracy or completeness of the information contained +.\" in this document, and Transmeta reserves the right to change product +.\" descriptions and product specifications at any time, without notice. +.\" +.\" Transmeta products have not been designed, tested, or manufactured for use +.\" in any application where failure, malfunction, or inaccuracy carries a risk +.\" of death, bodily injury, or damage to tangible property, including, but not +.\" limited to, use in factory control systems, medical devices or facilities, +.\" nuclear facilities, aircraft, watercraft or automobile navigation or +.\" communication, emergency systems, or other applications with a similar +.\" degree of potential hazard. +.\" +.\" Transmeta reserves the right to discontinue any product or product document +.\" at any time without notice, or to change any feature or function of any +.\" Transmeta product or product document at any time without notice. +.\" +.\" Trademarks: Transmeta, the Transmeta logo, Crusoe, the Crusoe logo, Code +.\" Morphing, LongRun and combinations thereof are trademarks of Transmeta +.\" Corporation in the USA and other countries. Other product names and brands +.\" used in this document are for identification purposes only, and are the +.\" property of their respective owners. +.\" +.\" Japanese Translated by ISHIKAWA Mutsumi +.\" Last Modified at Sun Feb 25 17:38:20 JST 2001 +.\" +.\".TH LONGRUN 1 "February 14, 2001" +.TH LONGRUN 1 "2001 ǯ 2 ·î 14Æü" +.nh +.\" .SH NAME +.SH ̾Á° +.\" Transmeta(TM) Crusoe(TM) LongRun(TM) utility +longrun \- Transmeta(TM) Crusoe(TM) LongRun(TM) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£ +.\".SH SYNOPSIS +.\" .B longrun [\-c device] [\-m device] [\-hlpv] [\-f flag] [\-s low high] +.SH ½ñ¼° +.B longrun [\-c ¥Ç¥Ð¥¤¥¹] [\-m ¥Ç¥Ð¥¤¥¹] [\-hlpv] [\-f ¥Õ¥é¥°] [\-s ²¼¸Â ¾å¸Â] +.\" .SH DESCRIPTION +.SH ÀâÌÀ +.\" The +.\" .I longrun +.\" utility is used to control and query LongRun settings on Transmeta +.\" Crusoe processors. +.I longrun +¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï Transmeta Crusoe ¥×¥í¥»¥Ã¥µ¤Î LongRun ¤ÎÀßÄê¤Î¥³¥ó¥È¥í¡¼¥ë¤È +Ì䤤¹ç¤ï¤»¤ËÍøÍѤµ¤ì¤ë¡£ +.TP +.\" \-c device +.\" Set the CPUID device. The default CPUID device is +.\" .BR /dev/cpu/0/cpuid . +\-c ¥Ç¥Ð¥¤¥¹ +CPUID ¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£¥Ç¥£¥Õ¥©¥ë¥È¤Î CPUID ¥Ç¥Ð¥¤¥¹¤Ï +.BR /dev/cpu/0/cpuid +¤Ç¤¢¤ë¡£ +.TP +.\" \-m device +.\" Set the MSR device. The default MSR device is +.\" .BR /dev/cpu/0/msr . +\-m ¥Ç¥Ð¥¤¥¹ +MSR ¥Ç¥Ð¥¤¥¹¤ò»ØÄꤹ¤ë¡£¥Ç¥£¥Õ¥©¥ë¥È¤Î MSR ¥Ç¥Ð¥¤¥¹¤Ï +.BR /dev/cpu/0/msr . +¤Ç¤¢¤ë¡£ +.TP +.\" \-h +.\" Print help. +\-h +¥Ø¥ë¥×¤Îɽ¼¨ +.TP +.\" \-l +.\" List LongRun information about available performance levels for +.\" the CPU. +\-l +CPU ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë¤Ë´Ø¤¹¤ë LongRun ¾ðÊó¤òɽ¼¨¤¹¤ë¡£ +.RS 7 +.TP +.\" The following values are reported on all Transmeta CPUs that \ +.\" implement LongRun. +LongRun ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëÁ´¤Æ¤Î Transmeta CPU ¤Ç¤Ï°Ê²¼¤ÎÃͤ¬Êó¹ð¤µ¤ì¤ë¡£ +.RS 3 +.TP +% +.\" An available performance level, expressed as a percentage of range of +.\" available core CPU frequencies. 0 corresponds to the lowest available +.\" frequency and 100 corresponds to the highest. +¤½¤Î CPU ¤¬¼Â¸½²Äǽ¤Ê(ºÇÂç)CPU ¥³¥¢¥¯¥í¥Ã¥¯¤ËÂФ¹¤ë³ä¹ç¤È¤·¤ÆÉ½¤µ¤ì¤ë +Ê¿¶Ñ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë¡£0 ¤¬¼Â¸½²Äǽ¤Ê¤â¤Ã¤È¤âÄ㤤 CPU ¥¯¥í¥Ã¥¯¤Ë +Âбþ¤·¡¢100 ¤¬¤â¤Ã¤È¤â¹â¤¤ CPU ¥¯¥í¥Ã¥¯¤ËÂбþ¤¹¤ë¡£ +.TP +.\" MHz +.\" The core CPU frequency at that level. +MHz +¤½¤Î¥ì¥Ù¥ë¤Î CPU ¥³¥¢¥¯¥í¥Ã¥¯ +.TP +.\" Volts +.\" The core CPU voltage at that level. +Å۵ +¤½¤Î¥ì¥Ù¥ë¤Î CPU ¥³¥¢Å۵ +.TP +.\" usage +.\" The power usage relative to the maximum performance level. +»ÈÍÑΨ +ºÇÂç¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë¤ËÂФ¹¤ëÅŸ»»ÈÍѤγä¹ç +.RE +.RE +.TP +.\" \-p +.\" Print current LongRun settings and status: whether LongRun is enabled, +.\" whether LongRun Thermal Extensions are active, the current LongRun +.\" performance window (expressed as a percentile range), the current +.\" LongRun performance level (expressed as a percentile), and the current +.\" LongRun flags. +\-p +¸½ºß¤Î LongRun ÀßÄê¤È¥¹¥Æ¡¼¥¿¥¹¤òɽ¼¨¤¹¤ë¡£LongRun ¤¬Í­¸ú¤Ë +¤Ê¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«¡¢LongRun Thermal Extension ¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤ë¤«¤É¤¦¤«¡¢ +(¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¤Î¥ì¥ó¥¸¤È¤·¤ÆÉ½¤µ¤ì¤ë)¸½ºß¤Î LongRun +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥¦¥£¥ó¥É¡¢(¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¤È¤·¤ÆÉ½¤µ¤ì¤ë)¸½ºß¤Î +LongRun ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë¡¢¸½ºß¤Î LongRun ¥Õ¥é¥°¤¬¼¨¤µ¤ì¤ë¡£ +.TP +.\" \-v +.\" Be more verbose. +\-v +¤è¤ê¿¤¯¤Î¾ðÊó¤ò½ÐÎϤ¹¤ë(verbose ¥â¡¼¥É) +.TP +.\" \-f flag +.\" Set a LongRun mode flag. Currently, the two supported flags are +.\" .B performance +.\" and +.\" .BR economy . +.\" This controls whether the processor is in "performance mode" or +.\" "economy mode". +\-f ¥Õ¥é¥° +LongRun ¥â¡¼¥É¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£¸½ºß¤Ï +.B performance +¤È +.B economy +¤ÎÆó¤Ä¤Î¥Õ¥é¥°¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£ +¤³¤ì¤Ï¡¢¥×¥í¥»¥Ã¥µ¤¬ "¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥â¡¼¥É(performance mode)"¤Ç +ưºî¤¹¤ë¤«¡¢"¥¨¥³¥Î¥ß¡¼¥â¡¼¥É(economy mode)"¤Çưºî¤¹¤ë¤«¤ò +À©¸æ¤¹¤ë¡£ +.TP +.\" \-s low high +.\" Set the current LongRun performance window as a percentile range. The +.\" low number cannot be greater than the high number. The minimum and +.\" maximum performance values accepted by the CPU are 0 and 100, +.\" respectively. +\-s ²¼¸ÂÃÍ(%) ¾å¸ÂÃÍ(%) +¸½ºß¤Î LongRun ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥¦¥£¥ó¥É¤ò¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¤Çɽ¤µ¤ì¤ëÎΰè¤Ë +¥»¥Ã¥È¤¹¤ë¡£²¼¸ÂÃͤϾå¸ÂÃͤò¾å²ó¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£CPU ¤¬¼õ¤±ÉÕ¤±¤ë +¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹Ãͤξå¸Â¤ª¤è¤Ó²¼¸Â¤Ï 0(%) ¤«¤é 100(%) ¤Ç¤¢¤ë¡£ +.\" .SH ENVIRONMENT +.\" No environment variables are used. +.SH ´Ä¶­ÊÑ¿ô +´Ä¶­ÊÑ¿ô¤Ï»²¾È¤·¤Ê¤¤¡£ +.\" .SH FILES +.SH ¥Õ¥¡¥¤¥ë +.\" This program requires that the Linux CPUID and MSR devices be compiled +.\" into the kernel (or loaded as kernel modules), that the CPUID character +.\" device be readable, and that the MSR character device be both readable +.\" and writable. +¤³¤Î¥×¥í¥°¥é¥à¤Ï Linux CPUID ¥Ç¥Ð¥¤¥¹¤È MSR ¥Ç¥Ð¥¤¥¹¤¬ ¥«¡¼¥Í¥ë¤Ë +ÁȤ߹þ¤Þ¤ì¤Æ¤ª¤ê(¤â¤·¤¯¤Ï ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤Æ¤ª¤ê)¡¢ +CPUID ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹¤¬ÆÉ¤ß¹þ¤ß²Äǽ¡¢¤½¤·¤Æ¡¢MSR ¥­¥ã¥é¥¯¥¿¥Ç¥Ð¥¤¥¹ +¤¬ÆÉ¤ß½ñ¤­²Äǽ¤Ç¤¢¤ëɬÍפ¬¤¢¤ë¡£ +.\" .SH "SEE ALSO" +.SH ´ØÏ¢¹àÌÜ +.BR acpid (8), +.BR apmd (8), +.BR hdparm (8) +.\" .SH AUTHOR +.SH Ãø¼Ô +Daniel Quinlan + +(ÆüËܸìÌõ ÀÐÀî ËÓ ) --- longrun-0.9.orig/debian/default +++ longrun-0.9/debian/default @@ -0,0 +1,47 @@ +# Configuration file for /etc/apm/event.d/longrun +# +# This sets up longrun handling of APM and ACPI events. + +# If this variable is set to 1, APM and ACPI events will trigger +# a change in longrun settings. + +#LONGRUN_ENABLE="1" + +# Performance mode +# +# Used to set the longrun performance window when running on +# AC power. +# +# Use "longrun -l" to check the available performance levels + +PERFORMANCE="0 100" + +# Economy mode +# +# Used to set the longrun performance window when running on +# battery. +# +# Use "longrun -l" to check the available performance levels + +ECONOMY="0 70" + +# Low battery mode +# +# Used to set the longrun performance window when the system +# battery is running out. +# +# Use "longrun -l" to check the available performance levels + +LOW_BATTERY="0 0" + +# Under which battery charge do we consider the battery charge +# being low (you also need to update /etc/default/apmd). Not available for +# ACPI, which defines its own low battery threshold internally. + +#BATTERY_THRESHOLD="10" + +# Debug mode +# +# If you set DEBUG to "1", longrun change will be logged to syslog. + +#DEBUG="1" --- longrun-0.9.orig/debian/watch +++ longrun-0.9/debian/watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.kernel.org/pub/linux/utils/cpu/crusoe/longrun-(.*).tar.gz --- longrun-0.9.orig/debian/control +++ longrun-0.9/debian/control @@ -0,0 +1,19 @@ +Source: longrun +Section: utils +Priority: extra +Maintainer: Uwe Hermann +Build-Depends: debhelper (>= 7), groff, bsdmainutils, gettext +Standards-Version: 3.8.0 +Vcs-Git: git://git.kitenet.net/joey/packages/longrun +Homepage: ftp://ftp.kernel.org/pub/linux/utils/cpu/crusoe/ + +Package: longrun +Architecture: i386 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Transmeta Crusoe LongRun control utility + The longrun utility is used to query and control the LongRun settings of + Transmeta Crusoe processors. It can set the performance level, and set the + CPU speed window. + . + This utility only works on with the Transmeta Crusoe CPU, and + requires the Linux CPUID and MSR device drivers. --- longrun-0.9.orig/debian/postinst +++ longrun-0.9/debian/postinst @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +if [ "$1" = configure ]; then + if [ ! -e /dev/cpu/0/msr ] || [ ! -e /dev/cpu/0/cpuid ] ; then + if [ -x /dev/MAKEDEV ]; then + cd /dev && ./MAKEDEV cpu + fi + fi +fi + +#DEBHELPER# --- longrun-0.9.orig/debian/copyright +++ longrun-0.9/debian/copyright @@ -0,0 +1,21 @@ +This package was debianized by ISHIKAWA Mutsumi +and is now maintained by Uwe Hermann + +It was downloaded from ftp://ftp.kernel.org/pub/linux/utils/cpu/crusoe/longrun-0.9.tar.bz2 + + * longrun - Transmeta(TM) Crusoe(TM) LongRun(TM) utility + * + * Copyright (C) 2001 Transmeta Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- longrun-0.9.orig/debian/acpi.action +++ longrun-0.9/debian/acpi.action @@ -0,0 +1,86 @@ +#!/bin/sh + +# Longrun setup in response to acpi events +# +# Do not make changes to this file, use /etc/default/longrun to tune +# this script + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +LONGRUN_BIN=/usr/bin/longrun +DEFAULTS=/etc/default/longrun + +# Default values - overiden by /etc/default/longrun + +LONGRUN_ENABLE="0" +PERFORMANCE="0 100" +ECONOMY="0 70" +LOW_BATTERY="0 0" +BATTERY_THRESHOLD="10" +DEBUG="0" + +# longrun settings update function + +set_longrun () { +[ "$DEBUG" -eq 1 ] && logger -t longrun "$1; perf. window: $2; flag: $3" +"$LONGRUN_BIN" -s $2 +"$LONGRUN_BIN" -f $3 +} + +# Source the default values + +if [ -e "$DEFAULTS" ]; then + . "$DEFAULTS" +fi + +# Should we go on? + +[ "$LONGRUN_ENABLE" = "1" ] || exit 0 + +# Calculate the remaining power (as a percentage) from +# iterating over the battery info and state files in +# /proc/acpi/battery/*/{info,state} if available. + +LAST_FULL_CAPACITY=0 +REMAINING_CAPACITY=0 +for battery in /proc/acpi/battery/* ; do + if [ -d "$battery" ]; then + LAST_FULL_CAPACITY=$(($LAST_FULL_CAPACITY + `awk '/last full/ {print $4}' $battery/info`)) + REMAINING_CAPACITY=$(($REMAINING_CAPACITY + `awk '/remaining/ {print $3}' $battery/state`)) + fi +done + +if [ "$LAST_FULL_CAPACITY" -gt 0 ] ; then + REMAINING_POWER=$((100*$REMAINING_CAPACITY/$LAST_FULL_CAPACITY)) +else + REMAINING_POWER=-1 +fi + +# Is longrun available + +[ -x "$LONGRUN_BIN" ] || exit 0 + +# Can take different actions based on the ACPI event +# that triggered the script, but for now all events +# require the same action. + +case "$1" in + + *) + if `on_ac_power` ; then + + set_longrun "on ac" "$PERFORMANCE" "performance" + + elif [ "$REMAINING_POWER" -eq -1 ] || \ + [ "$REMAINING_POWER" -gt "$BATTERY_THRESHOLD" ] ; then + + set_longrun "on battery" "$ECONOMY" "economy" + + else + + set_longrun "on battery" "$LOW_BATTERY" "economy" + + fi + ;; + +esac --- longrun-0.9.orig/debian/rules +++ longrun-0.9/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +%: + dh $@ + +binary-arch: build install + dh binary-arch --before dh_installdirs + dh_installdirs etc/apm/event.d etc/acpi/events etc/acpi/actions + install debian/apm.event debian/longrun/etc/apm/event.d/longrun + install -m 0644 debian/acpi.event debian/longrun/etc/acpi/events/longrun + install debian/acpi.action debian/longrun/etc/acpi/actions/longrun + dh binary-arch --remaining + +binary: binary-indep binary-arch --- longrun-0.9.orig/debian/changelog +++ longrun-0.9/debian/changelog @@ -0,0 +1,161 @@ +longrun (0.9-22) unstable; urgency=low + + * New maintainer (Closes: #483251). + * Fix a number of lintian warnings regarding hyphens in the manpage. + * Standards-Version: 3.8.0 + + Add Homepage field. + + -- Uwe Hermann Thu, 15 Jan 2009 23:25:38 +0100 + +longrun (0.9-21) unstable; urgency=low + + * use debhelper v7; rules file minimisation + * Orphaned the package. + + -- Joey Hess Fri, 25 Apr 2008 18:38:42 -0400 + +longrun (0.9-20) unstable; urgency=low + + * Add acpid event scripts contributed by Kevin Locke. Closes: #357531 + * Fix bashisms in scripts. + + -- Joey Hess Sat, 18 Mar 2006 13:24:00 -0500 + +longrun (0.9-19) unstable; urgency=low + + * Added a Swedish translation by Daniel Nylander. Closes: #345182 + + -- Joey Hess Mon, 2 Jan 2006 16:22:30 -0500 + +longrun (0.9-18) unstable; urgency=low + + * Current policy. + * Fix some lintian errors, but not the ones involving the Jpanese man page. + + -- Joey Hess Sun, 18 Dec 2005 17:09:13 -0500 + +longrun (0.9-17) unstable; urgency=low + + * Set default ECONOMY in the event script to what it is in the defaults + file, for consistency. + + -- Joey Hess Sat, 25 Jun 2005 19:37:37 -0400 + +longrun (0.9-16) unstable; urgency=low + + * Patch from dean gaudet with following changes for improved efficion + support. Closes: #283583 + * LRTI is bit 3, not bit 2... the old code happens to have worked on + many crusoe because they also set bit 2, but this bit is not set on + all crusoe, nor is it set on efficeon. (i'm not sure if bit 2 is + publically documented). + * mhz * millivolt * millivolt power estimation overflows 31-bit + signed integer once the clock is fast enough... use double instead. + * io_div (and most divisors) are 0 on efficeon, avoid div-by-0. + + -- Joey Hess Fri, 31 Dec 2004 11:53:33 -0500 + +longrun (0.9-15) unstable; urgency=low + + * Fix mistake on man page. Closes: #249866 + + -- Joey Hess Tue, 28 Sep 2004 14:58:24 -0400 + +longrun (0.9-14) unstable; urgency=low + + * Patch from Jason Marshall to make the -l flag use the LRTI information if + available, which avoids needing to adjust processor speed to get the info, + and lets it print bus speed information too. + + -- Joey Hess Sun, 13 Jun 2004 15:16:13 -0400 + +longrun (0.9-13) unstable; urgency=low + + * Patch from Jason Marshall to add a -t flax to allow control of the + Longrun Thermal Extensions. + + -- Joey Hess Fri, 9 Apr 2004 13:00:13 -0400 + +longrun (0.9-12) unstable; urgency=low + + * Fix a typo in the postinst that broke upgrade. + + -- Joey Hess Sun, 14 Dec 2003 16:02:34 -0500 + +longrun (0.9-11) unstable; urgency=low + + * Allow concurrent use of the -s and -f switches. Closes: #206153 + + -- Joey Hess Sun, 30 Nov 2003 13:39:02 -0500 + +longrun (0.9-10) unstable; urgency=low + + * Fix url in copyright file. + * Added a watch file. + * Fix logic error in postinst. + + -- Joey Hess Sat, 13 Sep 2003 22:53:41 -0400 + +longrun (0.9-9) unstable; urgency=low + + * New maintainer. Closes: #173887 + * Remove the README from the deb as it is just a copy of the man page. + * Updated to my current best practices. + * Applied a patch from Jean-Philippe Guarard to add an + /etc/apm/event.d/longrun and a /etc/default/longrun to control it. + These let longrun react to APM events like low power and on/off ac power, + but are disabled and do nothing by default. + + -- Joey Hess Mon, 18 Aug 2003 20:50:40 -0400 + +longrun (0.9-8) unstable; urgency=low + + * orphaning, #173887 + + -- ISHIKAWA Mutsumi Sat, 2 Aug 2003 16:14:41 +0900 + +longrun (0.9-7) unstable; urgency=low + + * fix pread(),pwrite() offset problem, closes: #165781 + + -- ISHIKAWA Mutsumi Wed, 23 Oct 2002 02:24:54 +0900 + +longrun (0.9-6) unstable; urgency=low + + * add Build-Depends: gettext, closes: #133708 + * cleanup postinst and debian/rules (lintian clean) + + -- ISHIKAWA Mutsumi Fri, 15 Feb 2002 21:28:48 +0900 + +longrun (0.9-5) unstable; urgency=low + + * add Build-Depends: bsdmainutils, closes: #123711 + + -- ISHIKAWA Mutsumi Thu, 13 Dec 2001 09:07:31 +0900 + +longrun (0.9-4) unstable; urgency=low + + * remove invalid file /usr/share/man/man1/longrun.1.ja.gz, + closes: #92216 + + -- ISHIKAWA Mutsumi Sat, 31 Mar 2001 02:23:08 +0900 + +longrun (0.9-3) unstable; urgency=low + + * gettextize and add japanese message file (patch is already sent to + upstream auther of cause :-) + + -- ISHIKAWA Mutsumi Wed, 28 Feb 2001 00:53:43 +0900 + +longrun (0.9-2) unstable; urgency=low + + * add Japanese man page (already sent to upsream auther) + * rewrite description, closes: #87130 + + -- ISHIKAWA Mutsumi Sat, 24 Feb 2001 02:59:45 +0900 + +longrun (0.9-1) unstable; urgency=low + + * Initial Release. + + -- ISHIKAWA Mutsumi Thu, 15 Feb 2001 01:43:45 +0900 --- longrun-0.9.orig/debian/acpi.event +++ longrun-0.9/debian/acpi.event @@ -0,0 +1,11 @@ +# /etc/acpi/events/longrun +# ACPI event configuration file for longrun + +# Whenever the power conditions of the computer change +# (either battery or ac_adapter changes) we call the +# longrun actions script to change the longrun settings +# appropriately based on the configuration in +# /etc/default/longrun + +event=(ac_adapter|battery) +action=/etc/acpi/actions/longrun %e --- longrun-0.9.orig/debian/compat +++ longrun-0.9/debian/compat @@ -0,0 +1 @@ +7 --- longrun-0.9.orig/debian/apm.event +++ longrun-0.9/debian/apm.event @@ -0,0 +1,99 @@ +#!/bin/sh + +# Longrun setup in response to apm events +# +# Do not make changes to this file, use /etc/default/longrun to tune +# this script + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +LONGRUN_BIN=/usr/bin/longrun +DEFAULTS=/etc/default/longrun + +# Default values - overiden by /etc/default/longrun + +LONGRUN_ENABLE="0" +PERFORMANCE="0 100" +ECONOMY="0 70" +LOW_BATTERY="0 0" +BATTERY_THRESHOLD="10" +DEBUG="0" + +# longrun settings update function + +set_longrun () { +[ "$DEBUG" -eq 1 ] && logger -t longrun "$1; perf. window: $2; flag: $3" +"$LONGRUN_BIN" -s $2 +"$LONGRUN_BIN" -f $3 +} + +# Is APM available + +apm_available || exit 0 + +# Source the default values + +if [ -e "$DEFAULTS" ]; then + . "$DEFAULTS" +fi + +# Should we go on? + +[ "$LONGRUN_ENABLE" = "1" ] || exit 0 + +# Check the APM kernel driver version, to see if we +# understand the content of /proc/apm. Then, get the +# remaining battery charge from /proc/apm. + +# See /usr/src/linux/arch/i386/kernel/apm.c + +APM_VERSION=`cat /proc/apm | cut -d " " -f 1` + +if [ "$APM_VERSION" = "1.16" ] ; then + REMAINING_POWER=`cat /proc/apm | cut -d " " -f 7 | tr -d "%"` +else + REMAINING_POWER=-1 +fi + +# Is longrun available + +[ -x "$LONGRUN_BIN" ] || exit 0 + +# Act depending on the APM event + +case "$1,$2" in + + change,power|resume,*|start,*) + if `on_ac_power` ; then + + set_longrun "on ac" "$PERFORMANCE" "performance" + + elif [ "$REMAINING_POWER" -eq -1 -o \ + "$REMAINING_POWER" -gt "$BATTERY_THRESHOLD" ] ; then + + set_longrun "on battery" "$ECONOMY" "economy" + + else + + set_longrun "on battery" "$LOW_BATTERY" "economy" + + fi + ;; + + change,battery) + if `on_ac_power` ; then + + set_longrun "on ac" "$PERFORMANCE" "performance" + + elif [ "$REMAINING_POWER" -gt "$BATTERY_THRESHOLD" ] ; then + + set_longrun "on battery" "$ECONOMY" "economy" + + else + + set_longrun "on battery" "$LOW_BATTERY" "economy" + + fi + ;; + +esac --- longrun-0.9.orig/debian/README.Debian +++ longrun-0.9/debian/README.Debian @@ -0,0 +1,9 @@ +The longrun utility requires the Linux CPUID and MSR devices be compiled into +the kernel, or the msr and cpuid modules must be loaded. You should use kernel +2.4.0 or later. + +This package includes integration with the apm and acpid daemons. To make +your laptop enter low power mode when unplugged from AC power, or when the +battery is low, edit /etc/default/longrun. This is disabled by default. + + -- Joey Hess --- longrun-0.9.orig/po/sv.po +++ longrun-0.9/po/sv.po @@ -0,0 +1,224 @@ +# Swedish translation of longrun. +# Copyright (C) 2005 Free Software Foundation, Inc. +# Daniel Nylander , 2005 +# License: GPL +# +msgid "" +msgstr "" +"Project-Id-Version: longrun 0.9-18\n" +"POT-Creation-Date: 2001-02-27 21:41+0900\n" +"PO-Revision-Date: 2005-12-30 04:55+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../longrun.c:253 +msgid "# %% MHz Volts usage\n" +msgstr "# %% MHz Volt användning\n" + +#: ../longrun.c:236 +#, c-format +msgid "# set %d, got %d\n" +msgstr "# satt %d, fick %d\n" + +#: ../longrun.c:257 +#, c-format +msgid "%3d %5d %6.3f %6.3f\n" +msgstr "%3d %5d %6.3f %6.3f\n" + +#: ../longrun.c:76 +#, c-format +msgid "" +"%s %s (%s)\n" +"usage: %s [-c device] [-m device] [-hlpv] [-f flag] [-s low high]\n" +" -c device set CPUID device\n" +" -m device set MSR device\n" +" -h print this help\n" +" -l list LongRun information about available performance levels\n" +" -p print current LongRun settings and status\n" +" -v be more verbose\n" +" -f [flag] set a LongRun mode flag\n" +" -s low high set current LongRun performance window (0 to 100)\n" +"\n" +"supported flags:\n" +" economy set economy mode (turn off performance mode)\n" +" performance set performance mode (turn off economy mode)\n" +msgstr "" +"%s %s (%s)\n" +"använding: %s [-c enhet] [-m enhet] [-hlpv] [-f flagga] [-s låg hög]\n" +" -c enhet sätt CPUID-enhet\n" +" -m enhet sätt MSR-enhet\n" +" -h skriv ut denna hjälp\n" +" -l lista LongRun-information om tillgängliga prestandanivåer\n" +" -p skriv ut nuvarande LongRun-inställningar och status\n" +" -v var mer informativ\n" +" -f [flagga] sätt en lägesflagga för LongRun\n" +" -s låg hög sätt nuvarande prestandafönster för LongRun (0 till 100)\n" +"\n" +"flaggor som stöds:\n" +" ekonomi sätt ekonomiläge (stäng av prestandaläge)\n" +" prestanda sätt prestandaläge (stäng av ekonomiläge)\n" + +#: ../longrun.c:107 +#: ../longrun.c:118 +#, c-format +msgid "%s: " +msgstr "%s: " + +#: ../longrun.c:410 +#, c-format +msgid "%s: must be run as root\n" +msgstr "%s: måste köras som root\n" + +#: ../longrun.c:191 +#, c-format +msgid "%s: not a Transmeta x86 CPU\n" +msgstr "%s: inte en Transmeta x86 CPU\n" + +#: ../longrun.c:342 +msgid "12.5%% reduction\n" +msgstr "12.5%% minskning\n" + +#: ../longrun.c:340 +msgid "25%% reduction\n" +msgstr "25%% minskning\n" + +#: ../longrun.c:338 +msgid "37.5%% reduction\n" +msgstr "37.5%% minskning\n" + +#: ../longrun.c:336 +msgid "50%% reduction\n" +msgstr "50%% minskning\n" + +#: ../longrun.c:334 +msgid "62.5%% reduction\n" +msgstr "62.5%% minskning\n" + +#: ../longrun.c:332 +msgid "75%% reduction\n" +msgstr "75%% minskning\n" + +#: ../longrun.c:109 +#: ../longrun.c:120 +#, c-format +msgid ": %s\n" +msgstr ": %s\n" + +#: ../longrun.c:347 +#, c-format +msgid "Current performance level: %d\n" +msgstr "Nuvarande prestandanivå: %d\n" + +#: ../longrun.c:346 +#, c-format +msgid "Current performance window: %d to %d\n" +msgstr "Nuvarande prestandafönster: %d till %d\n" + +#: ../longrun.c:326 +msgid "LTX setting: " +msgstr "LTX-inställning: " + +#: ../longrun.c:324 +#, c-format +msgid "LongRun Thermal Extensions (LTX): %s\n" +msgstr "LongRun Thermal Extensions (LTX): %s\n" + +#: ../longrun.c:349 +#, c-format +msgid "LongRun flags: %s\n" +msgstr "LongRun-flaggor: %s\n" + +#: ../longrun.c:323 +#, c-format +msgid "LongRun: %s\n" +msgstr "LongRun: %s\n" + +#: ../longrun.c:198 +msgid "LongRun: unsupported\n" +msgstr "LongRun: stöds ej\n" + +#: ../longrun.c:298 +msgid "Setting flag: economy\n" +msgstr "Sätter flagga: ekonomi\n" + +#: ../longrun.c:305 +msgid "Setting flag: performance\n" +msgstr "Sätter flagga: prestanda\n" + +#: ../longrun.c:286 +#, c-format +msgid "Setting performance window: %d to %d\n" +msgstr "Sätter prestandafönster: %d till %d\n" + +#: ../longrun.c:324 +msgid "active" +msgstr "aktiv" + +#: ../longrun.c:374 +msgid "c:f:m:hlpsv" +msgstr "c:f:m:hlpsv" + +#: ../longrun.c:323 +msgid "disabled" +msgstr "avstängd" + +#: ../longrun.c:295 +#: ../longrun.c:349 +msgid "economy" +msgstr "ekonomi" + +#: ../longrun.c:323 +msgid "enabled" +msgstr "aktiverad" + +#: ../longrun.c:132 +#: ../longrun.c:415 +#: ../longrun.c:423 +#, c-format +msgid "error opening %s" +msgstr "fel vid öppning av %s" + +#: ../longrun.c:139 +#: ../longrun.c:150 +#: ../longrun.c:175 +#, c-format +msgid "error reading %s" +msgstr "fel vid läsning av %s" + +#: ../longrun.c:165 +#, c-format +msgid "error writing %s" +msgstr "fel vid skrivning till %s" + +#: ../longrun.c:324 +msgid "inactive" +msgstr "inaktiv" + +#: ../longrun.c:364 +msgid "longrun" +msgstr "longrun" + +#: ../longrun.c:134 +msgid "make sure /proc is mounted\n" +msgstr "se till att /proc är monterad\n" + +#: ../longrun.c:417 +msgid "make sure your kernel was compiled with CONFIG_X86_CPUID=y\n" +msgstr "se till att din kärna blev kompilerad med CONFIG_X86_CPUID=y\n" + +#: ../longrun.c:425 +msgid "make sure your kernel was compiled with CONFIG_X86_MSR=y\n" +msgstr "se till att din kärna blev kompilerad med CONFIG_X86_MSR=y\n" + +#: ../longrun.c:301 +#: ../longrun.c:349 +msgid "performance" +msgstr "prestanda" + +#: ../longrun.c:330 +msgid "reserved\n" +msgstr "reserverad\n" + --- longrun-0.9.orig/po/longrun.pot +++ longrun-0.9/po/longrun.pot @@ -0,0 +1,202 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#: ../longrun.c:366 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2001-02-27 21:41+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: ../longrun.c:253 +msgid "# %% MHz Volts usage\n" +msgstr "" + +#: ../longrun.c:236 +#, c-format +msgid "# set %d, got %d\n" +msgstr "" + +#: ../longrun.c:257 +#, c-format +msgid "%3d %5d %6.3f %6.3f\n" +msgstr "" + +#: ../longrun.c:76 +#, c-format +msgid "" +"%s %s (%s)\n" +"usage: %s [-c device] [-m device] [-hlpv] [-f flag] [-s low high]\n" +" -c device set CPUID device\n" +" -m device set MSR device\n" +" -h print this help\n" +" -l list LongRun information about available performance levels\n" +" -p print current LongRun settings and status\n" +" -v be more verbose\n" +" -f [flag] set a LongRun mode flag\n" +" -s low high set current LongRun performance window (0 to 100)\n" +"\n" +"supported flags:\n" +" economy set economy mode (turn off performance mode)\n" +" performance set performance mode (turn off economy mode)\n" +msgstr "" + +#: ../longrun.c:107 ../longrun.c:118 +#, c-format +msgid "%s: " +msgstr "" + +#: ../longrun.c:410 +#, c-format +msgid "%s: must be run as root\n" +msgstr "" + +#: ../longrun.c:191 +#, c-format +msgid "%s: not a Transmeta x86 CPU\n" +msgstr "" + +#: ../longrun.c:342 +msgid "12.5%% reduction\n" +msgstr "" + +#: ../longrun.c:340 +msgid "25%% reduction\n" +msgstr "" + +#: ../longrun.c:338 +msgid "37.5%% reduction\n" +msgstr "" + +#: ../longrun.c:336 +msgid "50%% reduction\n" +msgstr "" + +#: ../longrun.c:334 +msgid "62.5%% reduction\n" +msgstr "" + +#: ../longrun.c:332 +msgid "75%% reduction\n" +msgstr "" + +#: ../longrun.c:109 ../longrun.c:120 +#, c-format +msgid ": %s\n" +msgstr "" + +#: ../longrun.c:347 +#, c-format +msgid "Current performance level: %d\n" +msgstr "" + +#: ../longrun.c:346 +#, c-format +msgid "Current performance window: %d to %d\n" +msgstr "" + +#: ../longrun.c:326 +msgid "LTX setting: " +msgstr "" + +#: ../longrun.c:324 +#, c-format +msgid "LongRun Thermal Extensions (LTX): %s\n" +msgstr "" + +#: ../longrun.c:349 +#, c-format +msgid "LongRun flags: %s\n" +msgstr "" + +#: ../longrun.c:323 +#, c-format +msgid "LongRun: %s\n" +msgstr "" + +#: ../longrun.c:198 +msgid "LongRun: unsupported\n" +msgstr "" + +#: ../longrun.c:298 +msgid "Setting flag: economy\n" +msgstr "" + +#: ../longrun.c:305 +msgid "Setting flag: performance\n" +msgstr "" + +#: ../longrun.c:286 +#, c-format +msgid "Setting performance window: %d to %d\n" +msgstr "" + +#: ../longrun.c:324 +msgid "active" +msgstr "" + +#: ../longrun.c:374 +msgid "c:f:m:hlpsv" +msgstr "" + +#: ../longrun.c:323 +msgid "disabled" +msgstr "" + +#: ../longrun.c:295 ../longrun.c:349 +msgid "economy" +msgstr "" + +#: ../longrun.c:323 +msgid "enabled" +msgstr "" + +#: ../longrun.c:132 ../longrun.c:415 ../longrun.c:423 +#, c-format +msgid "error opening %s" +msgstr "" + +#: ../longrun.c:139 ../longrun.c:150 ../longrun.c:175 +#, c-format +msgid "error reading %s" +msgstr "" + +#: ../longrun.c:165 +#, c-format +msgid "error writing %s" +msgstr "" + +#: ../longrun.c:324 +msgid "inactive" +msgstr "" + +#: ../longrun.c:364 +msgid "longrun" +msgstr "" + +#: ../longrun.c:134 +msgid "make sure /proc is mounted\n" +msgstr "" + +#: ../longrun.c:417 +msgid "make sure your kernel was compiled with CONFIG_X86_CPUID=y\n" +msgstr "" + +#: ../longrun.c:425 +msgid "make sure your kernel was compiled with CONFIG_X86_MSR=y\n" +msgstr "" + +#: ../longrun.c:301 ../longrun.c:349 +msgid "performance" +msgstr "" + +#: ../longrun.c:330 +msgid "reserved\n" +msgstr "" --- longrun-0.9.orig/po/ja.po +++ longrun-0.9/po/ja.po @@ -0,0 +1,203 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#: longrun.c:366 +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: longrun 0.9.1\n" +"POT-Creation-Date: 2001-02-22 17:09+0900\n" +"PO-Revision-Date: 2001-02-22 17:09+0900\n" +"Last-Translator: ISHIKAWA Mutsumi \n" +"Language-Team: ISHIKAWA Mutsumi \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-JP\n" +"Content-Transfer-Encoding: 8bit\n" + +#: longrun.c:76 +#, c-format +msgid "" +"%s %s (%s)\n" +"usage: %s [-c device] [-m device] [-hlpv] [-f flag] [-s low high]\n" +" -c device set CPUID device\n" +" -m device set MSR device\n" +" -h print this help\n" +" -l list LongRun information about available performance levels\n" +" -p print current LongRun settings and status\n" +" -v be more verbose\n" +" -f [flag] set a LongRun mode flag\n" +" -s low high set current LongRun performance window (0 to 100)\n" +"\n" +"supported flags:\n" +" economy set economy mode (turn off performance mode)\n" +" performance set performance mode (turn off economy mode)\n" +msgstr "" +"%s %s (%s)\n" +"»ÈÍÑË¡: %s [-c ¥Ç¥Ð¥¤¥¹] [-m ¥Ç¥Ð¥¤¥¹] [-hlpv] [-f ¥Õ¥é¥°] [-s ²¼¸Â ¾å¸Â]\n" +" -c ¥Ç¥Ð¥¤¥¹ CPUID ¥Ç¥Ð¥¤¥¹¤òÀßÄê\n" +" -m ¥Ç¥Ð¥¤¥¹ MSR ¥Ç¥Ð¥¤¥¹¤òÀßÄê\n" +" -h ¤³¤Î¥Ø¥ë¥×¤òɽ¼¨\n" +" -l ¼Â¸½²Äǽ¤Ê¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë¤Ë´Ø¤¹¤ë LongRun ¾ðÊó¤òɽ¼¨\n" +" -p ¸½ºß¤Î LongRun ¤ÎÀßÄê¤È¾õ¶·¤òɽ¼¨\n" +" -v ¤è¤ê¿¤¯¤Î¾ðÊó¤òɽ¼¨(verbose ¥â¡¼¥É)\n" +" -f [¥Õ¥é¥°] LongRun ¥â¡¼¥É¥Õ¥é¥°¤òÀßÄê\n" +" -s ²¼¸Â ¾å¸Â ¸½ºß¤Î LongRun ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥¦¥£¥ó¥É¤òÀßÄê (0 ¤«¤é 100)\n" +"\n" +"¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤Ï:\n" +" economy ¥¨¥³¥Î¥ß¡¼¥â¡¼¥É¤ËÀßÄê(¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥â¡¼¥É¤ò¥ª¥Õ¤Ë¤¹¤ë)\n" +" performance ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥â¡¼¥É¤ËÀßÄê(¥¨¥³¥Î¥ß¡¼¥â¡¼¥É¤ò¥ª¥Õ¤Ë¤¹¤ë)\n" + + +#: longrun.c:132 longrun.c:415 longrun.c:423 +#, c-format +msgid "error opening %s" +msgstr "Áàºî¥¨¥é¡¼ %s" + +#: longrun.c:134 +msgid "make sure /proc is mounted\n" +msgstr "/proc ¤¬¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤\n" + +#: longrun.c:139 longrun.c:150 longrun.c:175 +#, c-format +msgid "error reading %s" +msgstr "ÆÉ¤ß¹þ¤ß¥¨¥é¡¼ %s" + +#: longrun.c:165 +#, c-format +msgid "error writing %s" +msgstr "½ñ¤­¹þ¤ß¥¨¥é¡¼ %s" + +#: longrun.c:191 +#, c-format +msgid "%s: not a Transmeta x86 CPU\n" +msgstr "%s: ¤³¤Î¥Þ¥·¥ó¤Î CPU ¤Ï Transmeta x86 CPU ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó\n" + +#: longrun.c:198 +msgid "LongRun: unsupported\n" +msgstr "LongRun ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó\n" + +#: longrun.c:236 +#, c-format +msgid "# set %d, got %d\n" +msgstr "" + +#: longrun.c:253 +msgid "# %% MHz Volts usage\n" +msgstr "# %% MHz Å۵ »ÈÍÑΨ\n" + +#: longrun.c:257 +#, c-format +msgid "%3d %5d %6.3f %6.3f\n" +msgstr "%3d %5d %6.3f %6.3f\n" + +#: longrun.c:286 +#, c-format +msgid "Setting performance window: %d to %d\n" +msgstr "¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥¦¥¤¥ó¥É¤ò %d ¤«¤é %d ¤ËÀßÄꤷ¤Þ¤¹\n" + +#: longrun.c:295 longrun.c:349 +msgid "economy" +msgstr "¥¨¥³¥Î¥ß¡¼" + +#: longrun.c:298 +msgid "Setting flag: economy\n" +msgstr "¥Õ¥é¥°¤ò¥¨¥³¥Î¥ß¡¼¤ËÀßÄꤷ¤Þ¤¹\n" + +#: longrun.c:301 longrun.c:349 +msgid "performance" +msgstr "¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹" + +#: longrun.c:305 +msgid "Setting flag: performance\n" +msgstr "¥Õ¥é¥°¤ò¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ËÀßÄꤷ¤Þ¤¹\n" + +#: longrun.c:323 +#, c-format +msgid "LongRun: %s\n" +msgstr "" + +#: longrun.c:323 +msgid "enabled" +msgstr "Í­¸ú" + +#: longrun.c:323 +msgid "disabled" +msgstr "̵¸ú" + +#: longrun.c:324 +#, c-format +msgid "LongRun Thermal Extensions (LTX): %s\n" +msgstr "LongRun ȯǮÄ㸺³ÈÄ¥ (LTX): %s\n" + +#: longrun.c:324 +msgid "active" +msgstr "³èÀ­" + +#: longrun.c:324 +msgid "inactive" +msgstr "Èó³èÀ­" + +#: longrun.c:326 +msgid "LTX setting: " +msgstr "LTX ¤ÎÀßÄê: " + +#: longrun.c:330 +msgid "reserved\n" +msgstr "ͽÌó\n" + +#: longrun.c:332 +msgid "75%% reduction\n" +msgstr "75%% Ä㸺\n" + +#: longrun.c:334 +msgid "62.5%% reduction\n" +msgstr "62.5%% Ä㸺\n" + +#: longrun.c:336 +msgid "50%% reduction\n" +msgstr "50%% Ä㸺\n" + +#: longrun.c:338 +msgid "37.5%% reduction\n" +msgstr "37.5%% Ä㸺\n" + +#: longrun.c:340 +msgid "25%% reduction\n" +msgstr "25%% Ä㸺\n" + +#: longrun.c:342 +msgid "12.5%% reduction\n" +msgstr "12.5%% Ä㸺\n" + +#: longrun.c:346 +#, c-format +msgid "Current performance window: %d to %d\n" +msgstr "¸½ºß¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹ ¥¦¥¤¥ó¥É: %d ¤«¤é %d\n" + +#: longrun.c:347 +#, c-format +msgid "Current performance level: %d\n" +msgstr "¸½ºß¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥ì¥Ù¥ë: %d\n" + +#: longrun.c:349 +#, c-format +msgid "LongRun flags: %s\n" +msgstr "LongRun ¥Õ¥é¥°: %s\n" + +#: longrun.c:410 +#, c-format +msgid "%s: must be run as root\n" +msgstr "%s: root ¸¢¸Â¤Ç¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó\n" + +#: longrun.c:417 +msgid "make sure your kernel was compiled with CONFIG_X86_CPUID=y\n" +msgstr "" +"CONFIG_X86_CPUID=y ¤òÀßÄꤷ¤Æ ¥«¡¼¥Í¥ë¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤«" +"³Îǧ¤·¤Æ¤¯¤À¤µ¤¤\n" + +#: longrun.c:425 +msgid "make sure your kernel was compiled with CONFIG_X86_MSR=y\n" +msgstr "" +"CONFIG_X86_MSR=y ¤òÀßÄꤷ¤Æ¥«¡¼¥Í¥ë¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤«" +"³Îǧ¤·¤Æ¤¯¤À¤µ¤¤\n" --- longrun-0.9.orig/po/Makefile +++ longrun-0.9/po/Makefile @@ -0,0 +1,46 @@ +include ../Makeconfig + +POFILES=ja.po sv.po +GMOFILES=ja.gmo sv.gmo + +POTFILES=../longrun.c + +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: .c .o .po .pox .gmo .mo + +all: $(GMOFILES) + +longrun.pot: ../longrun.c + xgettext -a -d longrun -k_ -o longrun.pot -s ../longrun.c + +.po.pox: + make longrun.pot + msgmerge $< longrun.pot -o $*.pox + +.po.mo: + msgfmt -o $@ $< + +.po.gmo: + file=`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && msgfmt -o $$file $< + +install: + mkdir -p $(DESTDIR)$(LOCALEDIR) + + @catalogs='$(GMOFILES)'; \ + localedir='$(DESTDIR)$(LOCALEDIR)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$localedir/$$lang/LC_MESSAGES; \ + mkdir -p $$dir; \ + if test -r $$cat; then \ + install -m 644 $$cat $$dir/$(PACKAGE)$(INSTOBJEXT) || exit 1; \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi \ + done + +clean: + rm -f *.mo *.gmo