Re: last patch, idea
On 2011/04/10 00:02, Peter J. Philipp wrote: Hi, while going through my wtmp with last(1) I noticed there could be a better way than always gunzip'ing wtmp files and then using last -f. I've made a patch for your consideration that does the following: a) it checks if the file is a gzipped file by looking at the wtmp's file magic b) it writes the gzipped file to a /tmp location uncompressed so that the normal way of operation can be done on the tmp file. Having tried to do things like gzcat /var/log/wtmp.0.gz | last -f /dev/stdin before, I'd certainly find it useful and this is less intrusive than modifying last(8) so it could work with standard input. I didn't want to start the discussion empty handed whether this is a good patch or not, so I made the patch but it needs cleanup and probably a manpage change. Let me know if this could go in, before I do any more work. Here are a couple of minor comments, + if (isgzipped()) { + tmpdir = create_tmp(file); + gzcopy(); + file = tmpdir; + } + + extra whitespace +/* + * create a temporary directory where a temporary file can be put in + */ maybe: * create a temporary directory to hold decompressed files + snprintf(d0, sizeof(d0), /tmp/last.); more X's wanted here (At least 6 Xs should be used, though 10 is much better.) Yes it does want a manpage change.
Re: horribly slow fsck_ffs pass1 performance
On Sat, Apr 02, 2011 at 01:45:36PM -0500, Amit Kulkarni wrote: Hi, I am replying in a single email. I do a fsck once in a while, not regular. In the last 6-8 months I might have done it about 5 times. And I did it multi-user the few times I did it, but plan on doing it single user in future and I do plan to do it monthly. After seeing the messages when you fsck, it is better to do it monthly. FreeBSD which is the origin of FFS does a background fsck, and if Kirk McCusick feels so strongly I will do it too. (I remember somebody talking about having background fsck here on a openbsd list, but I forgot who it was). This is completely stupid. What do you trust more ? your file system, or fsck ? oth have bugs ! I'm sure of it ! so, if you run fsck, it's likely you're going to run into fsck bugs eventually (and trying fsck on a mounted partition was really, really stupid). Whereas, if you don't run fsck, you're going to run into fs bugs eventually. Now, consider this: the fs code is very heavily tested. People use it 24 hours a day, 365 days a year. Compared to THAT, the fsck code is very lightly tested. It's run only once in a while, when the power shuts down, or when you update your machines. What is more likely ? corrupting a perfectly sane filesystem by running fsck on it (which has MORE code paths to correct problems and is usually run on corrupted filesystems), or having an unseen bug in the fs code that affects only you and that fsck would be able to see ?
Re: horribly slow fsck_ffs pass1 performance
Now, consider this: the fs code is very heavily tested. People use it 24 hours a day, 365 days a year. Except on leap years, of course. Those years see even more real-life testing happening!
Re: Elf support for strings(1)
On 09/04/11(Sat) 09:19, Matthew Dempsky wrote: On Fri, Apr 8, 2011 at 11:04 PM, Martin Pieuchot mpieuc...@nolizard.org wrote: Diff below add elf support to (bsd) strings(1) and make it usable for architectures with ELF_TOOLCHAIN=Yes. Wait, why? I don't get it. This seems out of scope for strings(1). Without the -a option strings(1) doesn't scan the file entirely [0]. In this case, for elf files it only looks for strings in non empty sections flagged with SHF_ALLOC [1]. Maybe the manpage should be updated. +elf32.c: ${.CURDIR}/elf.c + echo '#define ELFSIZE 32' | cat - $ ${.TARGET} + +elf64.c: ${.CURDIR}/elf.c + echo '#define ELFSIZE 64' | cat - $ ${.TARGET} Why not just create elf32.c with: #define ELFSIZE 32 #include elf.c and similar for elf64.c? I would say to not create empty files, I just used the same method as for nm. The question here is more about *how* to reuse nm(1)'s elf.c in a smart way (for nm, ranlib, strings...). I could have used the same file (diff below) but that makes the binary twice bigger in size (but still less than 5% of the size of the actual strings on amd64). Martin [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/strings.html [1] http://www.sco.com/developers/gabi/latest/ch4.sheader.html#special_sections Index: Makefile === RCS file: /cvs/src/usr.bin/strings/Makefile,v retrieving revision 1.3 diff -u -p -r1.3 Makefile --- Makefile21 Sep 1997 11:51:00 - 1.3 +++ Makefile10 Apr 2011 10:54:50 - @@ -1,5 +1,16 @@ # $OpenBSD: Makefile,v 1.3 1997/09/21 11:51:00 deraadt Exp $ PROG= strings +SRCS= strings.c elf32.c elf64.c + +CLEANFILES+= elf32.c elf64.c + +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../nm + +elf32.c: ${.CURDIR}/../nm/elf.c + echo '#define ELFSIZE 32' | cat - $ ${.TARGET} + +elf64.c: ${.CURDIR}/../nm/elf.c + echo '#define ELFSIZE 64' | cat - $ ${.TARGET} .include bsd.prog.mk === RCS file: /cvs/src/usr.bin/strings/strings.c,v retrieving revision 1.15 diff -u -p -r1.15 strings.c --- strings.c 27 Oct 2009 23:59:43 - 1.15 +++ strings.c 10 Apr 2011 10:57:01 - @@ -34,46 +34,56 @@ #include a.out.h #include ctype.h +#include elf_abi.h +#include err.h #include errno.h #include fcntl.h +#include locale.h #include stdio.h #include stdlib.h #include string.h -#include locale.h #include unistd.h -#include err.h -#define FORMAT_DEC %07ld -#define FORMAT_OCT %07lo -#define FORMAT_HEX %07lx +#include elfuncs.h + +#define FORMAT_DEC %7lld +#define FORMAT_OCT %7llo +#define FORMAT_HEX %7llx #define DEF_LEN4 /* default minimum string length */ #define ISSTR(ch) (isascii(ch) (isprint(ch) || ch == '\t')) -typedef struct execEXEC; /* struct exec cast */ - -static longfoff; /* offset in the file */ -static int hcnt, /* head count */ - head_len, /* length of header */ - read_len; /* length to read */ -static u_char hbfr[sizeof(EXEC)]; /* buffer for struct exec */ - -static void usage(void); -int getch(void); +union hdr { + struct exec aout; + Elf32_Ehdr elf32; + Elf64_Ehdr elf64; +}; + +char *stab; /* Unsused, keep elf.c happy */ +intusemmap;/* Unsused, keep elf.c happy */ + +static int hcnt, /* head count */ + head_len; /* length of header */ +static u_char hbuf[sizeof(union hdr)];/* buffer for header */ + +short scan_entirely; +short print_name; +char *offset_format; +intminlen, maxlen, buflen; + +static voidusage(void); +intgetch(void); +intprocess_file(const char *, u_char *); +void find_strings(const char *, u_char *, off_t, off_t); int main(int argc, char *argv[]) { - extern char *optarg; - extern int optind; - int ch, cnt; - u_char *C; - EXEC *head; - int exitcode, minlen, maxlen, bfrlen; - short asdata, fflg; - u_char *bfr; - char *file, *p; - char *offset_format; + extern char *optarg; + extern int optind; + int ch, rval = 0; + u_char *buf; + char*file, *p; setlocale(LC_ALL, ); @@ -81,7 +91,7 @@ main(int argc, char *argv[]) * for backward compatibility, allow '-' to specify 'a' flag; no * longer documented in the man page or usage string. */ - asdata = exitcode = fflg = 0; + scan_entirely = print_name = 0; offset_format = NULL; minlen = -1; maxlen = -1; @@ -103,10 +113,10 @@
Re: horribly slow fsck_ffs pass1 performance
On Sun, Apr 10, 2011 at 11:27:41AM +, Miod Vallat wrote: Now, consider this: the fs code is very heavily tested. People use it 24 hours a day, 365 days a year. Except on leap years, of course. Those years see even more real-life testing happening! Good point. Maybe we should go to single user and run fsck in a loop on february 29th.
Re: system/6586: rdist (file larger than 2GB) times out but will not die -- Testers needed
No need to copy bugs@, tech@ and misc@. One is enough. I pick tech@. There a few size_t vs ssize_t inconsistencies but this looks very good for a start. I would suggest that as we are changing strtol and atoi calls that we take the opportunity to replace them with strtonum calls. Ken On Sat, Apr 09, 2011 at 11:20:09AM -0400, Steven R. Gerber wrote: Hi folks. Current rdist will timeout with files 2GB, log as finished, but will not die. The bug (system/6586) was originally noted by IBM (AIX) in 2006: https://www-304.ibm.com/support/docview.wss?uid=isg1IY85396 I have patches for the client rdist and server rdistd. I have tested i386 and amd64, in both directions. Please continue this. Testing on alpha would be especially welcomed. Thanks to everyone in advance. Steven client.c I did check into the comparison at line 689. Basically, it is ASSUMED that link files (not the actual files) will be tiny. The only attributes returned from an lstat() that refer to the symbolic link itself are the file type (S_IFLNK), size, blocks, and link count (always 1). That code is safe FOR NOW ... IF the (meta)data in the link grows a lot THEN it could be a problem. This should be a good state. 1. FIXED bug of filesize 2GB -- calculations and messages 2. FIXED similar in minimum freespace (and free files) 3. verified/fixed system write (and read) calls 4. TODO improve buffering i386 - i386 install BIG file OK i386 - i386 BIG file already installedOK amd64 - i386 install BIG file OK amd64 - i386 BIG file already installedOK i386 - amd64 install BIG file OK i386 - amd64 BIG file already installedOK i386 - macppcOK richardtoo...@paradise.net.nz i386 - amd64 OK richardtoo...@paradise.net.nz macppc - amd64 OK richardtoo...@paradise.net.nz amd64 - i386 OK richardtoo...@paradise.net.nz
Re: system/6586: rdist (file larger than 2GB) times out but will not die -- Testers needed
On Sat, Apr 09, 2011 at 11:20:09AM -0400, Steven R. Gerber wrote: Hi folks. Current rdist will timeout with files 2GB, log as finished, but will not die. The bug (system/6586) was originally noted by IBM (AIX) in 2006: https://www-304.ibm.com/support/docview.wss?uid=isg1IY85396 I have patches for the client rdist and server rdistd. I have tested i386 and amd64, in both directions. Please continue this. Testing on alpha would be especially welcomed. Thanks to everyone in advance. My mistake. This doesn't appear to even apply to the OpenBSD tree. How did you test it? Ken
Re: horribly slow fsck_ffs pass1 performance
On Sun, 10 Apr 2011, Marc Espie wrote: This is completely stupid. What do you trust more ? your file system, or fsck ? oth have bugs ! I'm sure of it ! so, if you run fsck, it's likely you're going to run into fsck bugs eventually (and trying fsck on a mounted partition was really, really stupid). There is an optional fsck -n of (mostly) mounted filesystems in /etc/daily. In what cases is this automated check intended to be used? Regards, David
Re: horribly slow fsck_ffs pass1 performance
On Sun, Apr 10, 2011 at 02:40:09PM +0200, David Vasek wrote: On Sun, 10 Apr 2011, Marc Espie wrote: This is completely stupid. What do you trust more ? your file system, or fsck ? oth have bugs ! I'm sure of it ! so, if you run fsck, it's likely you're going to run into fsck bugs eventually (and trying fsck on a mounted partition was really, really stupid). There is an optional fsck -n of (mostly) mounted filesystems in /etc/daily. In what cases is this automated check intended to be used? It's code we got from BSD 4.4 lite2. This specific chunk was brought by millert@ in rev 1.17. I would venture that apart from file system hackers, or people with really flaky hardware, no-one should set that specific test...
Re: last patch, idea
while going through my wtmp with last(1) I noticed there could be a better way than always gunzip'ing wtmp files and then using last -f. I've made a patch for your consideration that does the following: b) it writes the gzipped file to a /tmp location uncompressed so that the normal way of operation can be done on the tmp file. Having tried to do things like gzcat /var/log/wtmp.0.gz | last -f /dev/stdin before, I'd certainly find it useful and this is less intrusive than modifying last(8) so it could work with standard input. Unless you run an extermely large shop like Beck does, or have extremely tiny disks, why not just remove all the Z flags from newsyslog.conf? This has the side effect of not having to gunzip /var/log/daemon* friends. I guess we inherited this log gzipping from 4BSD, but in those days a 300MB disk cost a month's salary. Plus another week's salary or so for the trucking charges.
Re: last patch, idea
On 2011/04/10 10:08, Ian Darwin wrote: while going through my wtmp with last(1) I noticed there could be a better way than always gunzip'ing wtmp files and then using last -f. I've made a patch for your consideration that does the following: b) it writes the gzipped file to a /tmp location uncompressed so that the normal way of operation can be done on the tmp file. Having tried to do things like gzcat /var/log/wtmp.0.gz | last -f /dev/stdin before, I'd certainly find it useful and this is less intrusive than modifying last(8) so it could work with standard input. Unless you run an extermely large shop like Beck does, or have extremely tiny disks, why not just remove all the Z flags from newsyslog.conf? Ah yes, this probably makes a lot of sense for wtmp... This has the side effect of not having to gunzip /var/log/daemon* friends. I guess we inherited this log gzipping from 4BSD, but in those days a 300MB disk cost a month's salary. Plus another week's salary or so for the trucking charges. Not sure about those; they can be very helpful when syslog's last message repeated NN times fails (e.g. two separate log entries which are repeated very often). zgrep and zless make it pretty easy to work with compressed normal logfiles. And though I haven't tested, I suspect that with CPU speeds these days, the reduction in disk i/o may even save time when you're searching through old logs.
Re: system/6586: rdist (file larger than 2GB) times out but will not die
On Sat, Apr 09, 2011 at 03:21:40PM -0400, Steven R. Gerber wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 4/9/2011 1:04 PM, Theo de Raadt wrote: When you print and off_t, for portability you should use: %lld, (long long)offt I'm a bit confused by the different diffs, but my version is below. Even more type-nazi, use f_favail instead of f_ffree since we use f_bavail rather than f_bfree. Use strtonum() when parsing options. Untested at the moment. Ken Index: rdist/child.c === RCS file: /cvs/src/usr.bin/rdist/child.c,v retrieving revision 1.14 diff -u -p -r1.14 child.c --- rdist/child.c 27 Oct 2009 23:59:42 - 1.14 +++ rdist/child.c 10 Apr 2011 14:28:11 - @@ -177,7 +177,7 @@ static void readchild(CHILD *child) { char rbuf[BUFSIZ]; - int amt; + ssize_t amt; debugmsg(DM_CALL, [readchild(%s, %d, %d) start], child-c_name, child-c_pid, child-c_readfd); @@ -196,7 +196,7 @@ readchild(CHILD *child) */ while ((amt = read(child-c_readfd, rbuf, sizeof(rbuf))) 0) { /* XXX remove these debug calls */ - debugmsg(DM_MISC, [readchild(%s, %d, %d) got %d bytes], + debugmsg(DM_MISC, [readchild(%s, %d, %d) got %lld bytes], child-c_name, child-c_pid, child-c_readfd, amt); (void) xwrite(fileno(stdout), rbuf, amt); @@ -205,7 +205,7 @@ readchild(CHILD *child) child-c_name, child-c_pid, child-c_readfd); } - debugmsg(DM_MISC, readchild(%s, %d, %d) done: amt = %d errno = %d\n, + debugmsg(DM_MISC, readchild(%s, %d, %d) done: amt = %lld errno = %d\n, child-c_name, child-c_pid, child-c_readfd, amt, errno); /* Index: rdist/client.c === RCS file: /cvs/src/usr.bin/rdist/client.c,v retrieving revision 1.22 diff -u -p -r1.22 client.c --- rdist/client.c 27 Oct 2009 23:59:42 - 1.22 +++ rdist/client.c 10 Apr 2011 14:28:11 - @@ -399,8 +399,8 @@ sendfile(char *rname, opt_t opts, struct */ ENCODE(ername, rname); - (void) sendcmd(C_RECVREG, %o %04o %ld %ld %ld %s %s %s, - opts, stb-st_mode 0, (long) stb-st_size, + (void) sendcmd(C_RECVREG, %o %04o %lld %ld %ld %s %s %s, + opts, stb-st_mode 0, (long long) stb-st_size, stb-st_mtime, stb-st_atime, user, group, ername); if (response() 0) { @@ -409,8 +409,8 @@ sendfile(char *rname, opt_t opts, struct } - debugmsg(DM_MISC, Send file '%s' %ld bytes\n, rname, -(long) stb-st_size); + debugmsg(DM_MISC, Send file '%s' %lld bytes\n, rname, +(long long) stb-st_size); /* * Set remote time out alarm handler. @@ -666,8 +666,8 @@ sendlink(char *rname, opt_t opts, struct * Gather and send basic link info */ ENCODE(ername, rname); - (void) sendcmd(C_RECVSYMLINK, %o %04o %ld %ld %ld %s %s %s, - opts, stb-st_mode 0, (long) stb-st_size, + (void) sendcmd(C_RECVSYMLINK, %o %04o %lld %ld %ld %s %s %s, + opts, stb-st_mode 0, (long long) stb-st_size, stb-st_mtime, stb-st_atime, user, group, ername); if (response() 0) @@ -869,7 +869,7 @@ update(char *rname, opt_t opts, struct s /* * Parse size */ - size = (off_t) strtol(cp, (char **)cp, 10); + size = (off_t) strtoll(cp, (char **)cp, 10); if (*cp++ != ' ') { error(update: size not delimited); return(US_NOTHING); @@ -921,8 +921,8 @@ update(char *rname, opt_t opts, struct s debugmsg(DM_MISC, update(%s,) local mode %04o remote mode %04o\n, rname, lmode, rmode); - debugmsg(DM_MISC, update(%s,) size %ld mtime %d owner '%s' grp '%s'\n, -rname, (long) size, mtime, owner, group); + debugmsg(DM_MISC, update(%s,) size %lld mtime %d owner '%s' grp '%s' +\n, rname, (long long) size, mtime, owner, group); if (statp-st_mtime != mtime) { if (statp-st_mtime mtime IS_ON(opts, DO_YOUNGER)) { @@ -935,8 +935,8 @@ update(char *rname, opt_t opts, struct s } if (statp-st_size != size) { - debugmsg(DM_MISC, size does not match (%ld != %ld).\n, -(long) statp-st_size, (long) size); + debugmsg(DM_MISC, size does not match (%lld != %lld).\n, +(long long) statp-st_size, (long long) size); return(US_OUTDATE); } Index: rdist/common.c === RCS file:
Re: Merge viapm and viaenv drivers
On 2011/04/06 23:52, Alexandr Shadchin wrote: Hi! Merge viapm and viaenv Pluse: - Add support SMBus for VT82C596, VT82C596B, VT82C686A, VT8231 - Add support ACPI timer for all VIA South Bridges Tested on: - VT82C596B (Gigabyte GA-6VXE7+) - VT82C686A (Neoware CA2) - VT8231 (HP T5700) - VT8235 (Neoware CA10) Works for me on EPIA 500 (another VT8231). Sensors work just as well as they did before, spdmem now also works. viapm0 at pci0 dev 17 function 4 VIA VT8231 PMG rev 0x10: SMI hw.sensors.viapm0.temp0=19.68 degC hw.sensors.viapm0.temp1=63.70 degC hw.sensors.viapm0.temp2=2.38 degC hw.sensors.viapm0.fan0=0 RPM hw.sensors.viapm0.fan1=0 RPM hw.sensors.viapm0.volt0=2.52 VDC (VSENS1) hw.sensors.viapm0.volt1=2.47 VDC (VSENS2) hw.sensors.viapm0.volt2=1.98 VDC (Vcore) hw.sensors.viapm0.volt3=5.40 VDC (VSENS3) hw.sensors.viapm0.volt4=12.43 VDC (VSENS4) OpenBSD 4.9 (GENERIC) #0: Sun Apr 10 18:56:12 BST 2011 sthen@mx1-pl7:/usr/src/sys/arch/i386/compile/GENERIC cpu0: VIA Samuel 2 (CentaurHauls 686-class) 534 MHz cpu0: FPU,DE,TSC,MSR,MTRR,PGE,MMX real mem = 534278144 (509MB) avail mem = 515407872 (491MB) mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 11/14/02, BIOS32 rev. 0 @ 0xfb370, SMBIOS rev. 2.2 @ 0xf0800 (29 entries) bios0: vendor Award Software International, Inc. version 6.00 PG date 11/14/2002 bios0: VIA TECHNOLOGIES, INC. EPIA apm0 at bios0: Power Management spec V1.2 (slowidle) apm0: AC on, battery charge unknown acpi at bios0 function 0x0 not configured pcibios0 at bios0: rev 2.1 @ 0xf/0xdce4 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdc70/112 (5 entries) pcibios0: PCI Exclusive IRQs: 10 11 12 pcibios0: PCI Interrupt Router at 000:17:0 (VIA VT8231 ISA rev 0x00) pcibios0: PCI bus #1 is the last bus bios0: ROM list: 0xc/0xc000 0xcc000/0x4000! cpu0 at mainbus0: (uniprocessor) pci0 at mainbus0 bus 0: configuration mode 1 (bios) pchb0 at pci0 dev 0 function 0 VIA VT8601 PCI rev 0x05 viaagp0 at pchb0: v2 agp0 at viaagp0: aperture at 0xd000, size 0x1000 ppb0 at pci0 dev 1 function 0 VIA VT82C601 AGP rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 Trident CyberBlade i1 rev 0x6a wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) pcib0 at pci0 dev 17 function 0 VIA VT8231 ISA rev 0x10 pciide0 at pci0 dev 17 function 1 VIA VT82C571 IDE rev 0x06: ATA100, channel 0 configured to compatibility, channel 1 configured to compatibility wd0 at pciide0 channel 0 drive 0: IC35L120AVV207-0 wd0: 16-sector PIO, LBA48, 117800MB, 241254720 sectors wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5 pciide0: channel 1 disabled (no drives) uhci0 at pci0 dev 17 function 2 VIA VT83C572 USB rev 0x1e: irq 12 uhci1 at pci0 dev 17 function 3 VIA VT83C572 USB rev 0x1e: irq 12 viapm0 at pci0 dev 17 function 4 VIA VT8231 PMG rev 0x10: SMI iic0 at viapm0 iic0: addr 0x20 06=80 0e=03 0f=05 10=20 13=05 14=21 15=04 1b=02 86=80 8e=03 8f=05 90=20 93=05 94=21 95=04 9b=02 words 00= 01= 02= 03= 04= 05=0080 06=8000 07= spdmem0 at iic0 addr 0x50: 512MB SDRAM non-parity PC133CL2 viapm0: 24-bit timer at 3579545Hz auvia0 at pci0 dev 17 function 5 VIA VT82C686 AC97 rev 0x40: irq 10 ac97: codec id 0x56494161 (VIA Technologies VT1612A) ac97: codec features headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D audio0 at auvia0 vr0 at pci0 dev 18 function 0 VIA RhineII-2 rev 0x51: irq 11, address 00:40:63:c0:a4:1e ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 0x004063, model 0x0032 isa0 at pcib0 isadma0 at isa0 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo com0: console pckbc0 at isa0 port 0x60/5 pckbd0 at pckbc0 (kbd slot) pckbc0: using irq 1 for kbd slot wskbd0 at pckbd0: console keyboard, using wsdisplay0 pcppi0 at isa0 port 0x61 spkr0 at pcppi0 lpt0 at isa0 port 0x378/4 irq 7 npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16 usb0 at uhci0: USB revision 1.0 uhub0 at usb0 VIA UHCI root hub rev 1.00/1.00 addr 1 usb1 at uhci1: USB revision 1.0 uhub1 at usb1 VIA UHCI root hub rev 1.00/1.00 addr 1 biomask f36d netmask fb6d ttymask fbff mtrr: Pentium Pro MTRR support vscsi0 at root scsibus0 at vscsi0: 256 targets softraid0 at root root on wd0a swap on wd0b dump on wd0b carp87: state transition: BACKUP - MASTER arp_rtrequest: bad gateway value
Re: Elf support for strings(1)
On Sun, Apr 10, 2011 at 4:32 AM, Martin Pieuchot mpieuc...@nolizard.org wrote: Without the -a option strings(1) doesn't scan the file entirely [0]. I see, I never realized strings(1) handled executables specially... I always assumed the -a behavior was the default anyway. My bad. I would say to not create empty files, I just used the same method as for nm. I was thinking something like sys/kern/exec_elf*.c, but mimicking nm(1) makes sense too. The question here is more about *how* to reuse nm(1)'s elf.c in a smart way (for nm, ranlib, strings...). I could have used the same file (diff below) but that makes the binary twice bigger in size (but still less than 5% of the size of the actual strings on amd64). I'm in favor of just reusing the existing nm(1) elf.c code for simplicity. If a lot of tools use the same code, we can move the code to libutil or something so it can be shared. (Maybe import a BSD-licensed libelf to base?)
Queen - 20 discos - Colección para descarga digital.
Queen I Queen II Sheer Heart Attack A Night The Opera A Day At Races News Of The World Jazz Live Killers Flash Gordon The Game Greatest Hits Hot Spaces The Works Kind Of Magic Live Magic At The Beeb The Miracle Made In heaven Greatest Hits 2 Greatest Hits 3
the importance of writing documentation
Like most people, I have my pet peeves. I consider that documentation is very important to code quality. I ran into a school-book example a week ago, so I decided to share what I mean. There was this problem with dpb where some packages in a MULTI_PACKAGES show up as Errors when they don't build on a given architecture, even though they're marked as NOT_FOR_ARCHS-sub = ... I had fixed that particular way of building things by getting those to vanish when building all packages, so that the build would not error out, but dpb was still getting them as errors (and the remaining subpackages were built correclty) Looking more closely, dpb actually dumps information for all subpackages, including the non-building ones. Not including the non-building ones would not work, because the listing job would retry and retry. Nope, what was needed was the same mechanism that lets dpb ignore regular packages, that is the IGNORE variable. So, all that was needed was to set the IGNORE variable on a subpackage dependent basis, and dpb would happily trudge along. Thus, a patch was born, tested and committed that would make IGNORE subpackage dependent. I tried to make it as simple as could be: (the relevant part is setting all IGNORE-sub, then having IGNORE = ${IGNORE-sub} and testing IGNORE, plus marking IGNORE as subpackage dependent for dump-vars) Index: bsd.port.mk === RCS file: /home/openbsd/cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1074 retrieving revision 1.1075 diff -u -p -r1.1074 -r1.1075 --- bsd.port.mk 28 Mar 2011 00:16:13 - 1.1074 +++ bsd.port.mk 3 Apr 2011 07:19:05 - 1.1075 @@ -92,11 +92,11 @@ _SHSCRIPT = sh ${PORTSDIR}/infrastructur _PERLSCRIPT = perl ${PORTSDIR}/infrastructure/bin # All variables relevant to the port's description -_ALL_VARIABLES = BUILD_DEPENDS IGNORE IS_INTERACTIVE \ +_ALL_VARIABLES = BUILD_DEPENDS IS_INTERACTIVE \ SUBPACKAGE MULTI_PACKAGES # and stuff needing to be MULTI_PACKAGE'd _ALL_VARIABLES_INDEXED = FULLPKGNAME RUN_DEPENDS LIB_DEPENDS \ - PKG_ARCH + PKG_ARCH IGNORE _ALL_VARIABLES_PER_ARCH = .if ${DPB:L:Mfetch} @@ -1320,7 +1320,6 @@ IS_INTERACTIVE = Yes # # Don't build a port if it comes with the base system. -IGNORE ?= TRY_BROKEN ?= No _IGNORE_REGRESS ?= .if defined(REGRESS_IS_INTERACTIVE) defined(BATCH) @@ -1328,44 +1327,49 @@ _IGNORE_REGRESS += has interactive test .elif !defined(REGRESS_IS_INTERACTIVE) defined(INTERACTIVE) _IGNORE_REGRESS += does not have interactive tests .endif -.if defined(IS_INTERACTIVE) defined(BATCH) -IGNORE += is an interactive port -.elif !defined(IS_INTERACTIVE) defined(INTERACTIVE) -IGNORE += is not an interactive port -.endif -.if !exists(${X11BASE}) -IGNORE += building ports requires X11 but ${X11BASE} not found -.endif -.if !defined(_ARCH_OK${SUBPACKAGE}) || ${_ARCH_OK${SUBPACKAGE}} == 0 -. if defined(ONLY_FOR_ARCHS${SUBPACKAGE}) -.if ${MACHINE_ARCH} == ${ARCH} -IGNORE += is only for ${ONLY_FOR_ARCHS${SUBPACKAGE}}, not ${MACHINE_ARCH} + +.for _s in ${MULTI_PACKAGES} +IGNORE${_s} ?= +. if defined(IS_INTERACTIVE) defined(BATCH) +IGNORE${_s} += is an interactive port +. elif !defined(IS_INTERACTIVE) defined(INTERACTIVE) +IGNORE${_s} += is not an interactive port +. endif +. if !exists(${X11BASE}) +IGNORE${_s} += building ports requires X11 but ${X11BASE} not found +. endif +. if !defined(_ARCH_OK${_s}) || ${_ARCH_OK${_s}} == 0 +.if defined(ONLY_FOR_ARCHS${_s}) +. if ${MACHINE_ARCH} == ${ARCH} +IGNORE${_s} += is only for ${ONLY_FOR_ARCHS${_s}}, not ${MACHINE_ARCH} +. else +IGNORE${_s} += is only for ${ONLY_FOR_ARCHS${_s}}, not ${MACHINE_ARCH} \(${ARCH}\) +. endif .else -IGNORE += is only for ${ONLY_FOR_ARCHS${SUBPACKAGE}}, not ${MACHINE_ARCH} \(${ARCH}\) +IGNORE${_s} += is not for ${NOT_FOR_ARCHS} .endif -. else -IGNORE += is not for ${NOT_FOR_ARCHS} . endif -.endif -.if ${SHARED_ONLY:L} == yes ${NO_SHARED_LIBS:L} == yes -IGNORE += requires shared libraries -.endif - -.if ${TRY_BROKEN:L} != yes -. if defined(BROKEN-${ARCH}) -IGNORE += is marked as broken for ${ARCH}: ${BROKEN-${ARCH}:Q} +. if ${SHARED_ONLY:L} == yes ${NO_SHARED_LIBS:L} == yes +IGNORE${_s} += requires shared libraries . endif -. if ${MACHINE_ARCH} != ${ARCH} defined(BROKEN-${MACHINE_ARCH}) -IGNORE += is marked as broken for ${MACHINE_ARCH}: ${BROKEN-${MACHINE_ARCH}:Q} + +. if ${TRY_BROKEN:L} != yes +.if defined(BROKEN-${ARCH}) +IGNORE${_s} += is marked as broken for ${ARCH}: ${BROKEN-${ARCH}:Q} +.endif +.if ${MACHINE_ARCH} != ${ARCH} defined(BROKEN-${MACHINE_ARCH}) +IGNORE${_s} += is marked as broken for ${MACHINE_ARCH}: ${BROKEN-${MACHINE_ARCH}:Q} +.endif +.if defined(BROKEN) +IGNORE${_s} += is marked as broken: ${BROKEN:Q} +.endif . endif -. if defined(BROKEN) -IGNORE += is marked as