From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 08:36:20 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCD4E106564A; Sun, 11 Apr 2010 08:36:20 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 87AA38FC12; Sun, 11 Apr 2010 08:36:20 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (Postfix) with ESMTPS id C0B435C59; Sun, 11 Apr 2010 10:36:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1270974979; bh=94OmU0a0wHfv+irZ7HPSwj0t93YMKKl3XBwsr0gWXG8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=qwkvigfVq4bRdrZbUdU8la6xFRugKQFj0rw9iYO51/gmdvWmNlcaDfUGLHaAJqJ4q bd6X7D/ego1tX6zXZnirLbXXyKF23DWVhlp7DpWG6D+MNsZeCwgEph1PAsomfM9CGU pbjehxik2Gm5a2WGf9B9W/qXlUyCkVwk1u0fbnOk= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o3B8aJQS057712; Sun, 11 Apr 2010 10:36:19 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Sun, 11 Apr 2010 10:36:19 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Andriy Gapon Message-ID: <20100411083618.GA57638@acme.spoerlein.net> Mail-Followup-To: Andriy Gapon , Pavel Sukhoy , freebsd-scsi@freebsd.org, freebsd-hackers@freebsd.org, Markus Wild , Hans Petter Selasky References: <903d65bf1d5624b5208c588b21e679ea@ripn.net> <4BBCFE30.2010709@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BBCFE30.2010709@icyb.net.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-scsi@freebsd.org, Pavel Sukhoy , Hans Petter Selasky , Markus Wild , freebsd-hackers@freebsd.org Subject: Re: virtual drive errors X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 08:36:20 -0000 On Thu, 08.04.2010 at 00:50:40 +0300, Andriy Gapon wrote: > Looking at cdcheckmedia and at the logged READ TOC (0x43) SCSI command errors > (as reported by Markus) I see the following problem. Even if cdsize() call at > the beginning of cdcheckmedia() succeeds, a subsequent failure of cdreadtoc() > throws us to 'bailout' label which is past the code that sets d_mediasize. > > I think that the following patch should help with this situation (and possibly > other cases with READ TOC problems): > > --- a/sys/cam/scsi/scsi_cd.c > +++ b/sys/cam/scsi/scsi_cd.c >[snip] This patch, much like the one in kern/138789 makes my external Plextor PX-755A drive successfully read "mastered" DVD media, i.e., the retail kind, not DVD-R/RW. So, please commit some version of this patch. Thanks! Regards, Uli From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:37:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04FC106564A for ; Sun, 11 Apr 2010 11:37:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C6E538FC1A for ; Sun, 11 Apr 2010 11:37:27 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7908E46B6C; Sun, 11 Apr 2010 07:37:27 -0400 (EDT) Date: Sun, 11 Apr 2010 12:37:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Churanov In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers , Leinier Cruz Salfran Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:37:28 -0000 On Fri, 9 Apr 2010, Alexander Churanov wrote: > 2010/4/9 Leinier Cruz Salfran > >> i want to ask you one thing: can you make the 'pkg_install' suite reusable >> .. means install 'libinstall.a' as a shared object in order to make it >> reusable by others devs > > I'd like to add my 50 cents. From my point of view, the true UNIX way is > re-using whole programs. This provides unbelievable isolation and > correctness. If you don't want to fork myriads of processes each second, > then, it's, probably, better to ask for pipe mode of pkg_* tools. For > example, aspell works that way. You start a process, write commands and > queries and read results. While there are clearly benefits to process isolation, there are countless situations in UNIX where I've said to myself "Oh, I wish I had a lib not just a command". This is particularly the case for monitoring tools, where third-party applications have a lot of trouble parsing and tracking the output of tools like ps(1), etc. This is why recently we've been working on libmemstat(3), libprocstat(3), libnetstat(3), etc -- so that tools can avoid rewriting that code as well as avoid the parsing problem. So I have no particular opinion on this tool, but I will say that in general, it would be nice if programs were often thin wrappers around a library that could be reused, not just command line tools. Robert From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:41:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCCA0106566C for ; Sun, 11 Apr 2010 11:41:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 94CF98FC0A for ; Sun, 11 Apr 2010 11:41:27 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 4A2C846B65; Sun, 11 Apr 2010 07:41:27 -0400 (EDT) Date: Sun, 11 Apr 2010 12:41:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Charlie Kester In-Reply-To: <20100409185150.GC61756@comcast.net> Message-ID: References: <20100409185150.GC61756@comcast.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:41:27 -0000 On Fri, 9 Apr 2010, Charlie Kester wrote: > It was a watershed moment in my programming career when I realized that the > bubbles on those DFD charts we used to use for structured design could be > whole processes and not just functions in a single, monolithic program. > Suddenly everything the structured design folks were saying about re-use, > encapsulation, loose coupling, module cohesion, etc. made a lot more sense > when viewed from the perspective of simple Unix utilities communicating with > plain text via pipes. We should encourage that approach as a default, and > only put things into binary libraries when forced to by performance > considerations. Per my e-mail, I'm not sure I entirely agree with this view, although for certain types of scripting and programming it makes a lot of sense. What was always missing from this model is a structured way to pass complex data between components: streams of one-line ASCII strings work fine, but when you want to pass data structures, you end up replicating code to generate and parse data between components. Maybe XML is an answer to this, but more likely it's not :-). There's also the issue of plugging and types: if you support complex types, why not have type checking on the plugs? For example, "gzcat | tar -xf -" only for certain file types: wouldn't it be nice if type information, as well as byte streams, were passed around and you could do static checking, or even negotiation. But it would be nice to get a clear typing error instead of garbage. This is, BTW, what windowing systems do for copy-and-paste: when you copy from one program and paste to another, the two programmes negotiate an appropriate intermediate format: if the target doesn't support rich text, then it needs to be generated as plain text by the source, etc. Robert From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:42:39 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57DD1065674 for ; Sun, 11 Apr 2010 11:42:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9198FC2A for ; Sun, 11 Apr 2010 11:42:39 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1CCA846B65; Sun, 11 Apr 2010 07:42:39 -0400 (EDT) Date: Sun, 11 Apr 2010 12:42:39 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: jax In-Reply-To: <7ABA33D2F14F4C0A886EB0F6D58A3D5B@lan.jax.org.ru> Message-ID: References: <7ABA33D2F14F4C0A886EB0F6D58A3D5B@lan.jax.org.ru> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: GSoC 2010 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:42:39 -0000 On Sat, 10 Apr 2010, jax wrote: > I am Igor Druzhinin and I want to participate in GSoC 2010 in FreeBSD > project. I want to propose to completely realise fast syscalls support for > FreeBSD on x86 platform. I have already submited my proposal few days ago on > GSoC site and tried to contact with possible mentors from technical contacts > list. But they they still have not answered me. So I have decided to try > here. What do you think about this proposal? Is it still actual or not? If > so, who can be my mentor? Hi Igor-- Due to the volume of proposals, it can take some time to get through them all, and the last few weeks have been a bit rife with holidays around the world which has slowed down answers to some questions/pings. I see your proposal in the set, and I'll point some appropriate potential mentors at it this week. Thanks for your proposal! Robert From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:43:39 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12A161065672 for ; Sun, 11 Apr 2010 11:43:39 +0000 (UTC) (envelope-from equixen@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id C3DC58FC0C for ; Sun, 11 Apr 2010 11:43:38 +0000 (UTC) Received: by qyk11 with SMTP id 11so4003010qyk.13 for ; Sun, 11 Apr 2010 04:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=4MhNZy7cxBGqxbUfsugeKUXJr+j4ZdZ6XChyhq8S/WQ=; b=SGAcEj5BUYMEtqeoF4oJoWopjrfSVjf4J9alBZ+8p2JA3KaUQb6Bf0Lb9R901y3tLH anA3Cu03zzgOsGVp4vaBKkgVSl5us/K1VPtrQvSvI2QV7asdqdR+63irZ6rfSnA35Xsz FfAb974Cog/gAV5+xDxHCdRXXsGpGRRg40C/0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=EUj2l47+dJ4f6fD9F1GxolebVQILv7wJOWrQdS+olM8xDTmw4iBcsF4bOO9bS2YTmn IalI/O7SjApCqCI+L5tOEPCjoTzUj0Hv0KLm8Gq1T2vSKLI4eNzfmqLrjzarx9W+8ZTW 0Z93OS5fSi6ypUJ73spUm0607hmJOfm3tXc7w= MIME-Version: 1.0 Received: by 10.229.88.201 with HTTP; Sun, 11 Apr 2010 04:14:55 -0700 (PDT) Date: Sun, 11 Apr 2010 07:14:55 -0400 Received: by 10.229.218.21 with SMTP id ho21mr3755436qcb.79.1270984495610; Sun, 11 Apr 2010 04:14:55 -0700 (PDT) Message-ID: From: Equixen- To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: I want to participate in some FreeBSD project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:43:39 -0000 Hello! I am a 3rd year B.Tech (Computer Science) student. I want to participate in some open source project during my summer vacations. I thought about going the Google summer of code way but due to limited knowledge and examinations during the 1st month of the program timeline didn't participate in it. However, I still want to help with the FreeBSD projects. I understand that there will be no stipend and possibly will not be provided any mentor but I request the FreeBSD team to kindly consider me for any of their ongoing project (I might help some student selected via Google SoC). I'm no programming expert and have only a basic experience in languages like C, C++, and various scripting languages. My aim for participating in a project with a big organization like The FreeBSD foundation is to understand how programming works in real world projects and use that knowledge to be an active contributor in the open source world. If I'm rejected for whatever reason I request the members and the FreeBSD team to kindly provide me links to improve my programming in the Linux arena and hopefully make it next year in the Google SoC. Regards, Ishan Sharma I've also filled the form which FreeBSD requested the students to fill up for Google SoC (Contact details have been omitted for obvious reasons). Name: Ishan Sharma email: ishan_sharma1@yahoo.co.in Availability: I'll be available after mid June. I;ll be having vacations so I can work whole day from home till mid August. After that I can spend 2-3 hrs. daily during weekdays and 4-5 hrs. or more during weekends. Bio: I'm a 3rd year B.Tech (Computer Science) student. I've only basic experience in programming languages like C, C++, Scripting languages. I've absolutely no experience of working on real projects but I'm a fast learner and if given some pointers will try to a valuable resource to the project. I know I'll need to learn a lot and that's why I'm filling out this application because if I'm not selected this year I'll be better prepared for the next year. Additionally, any help provided by the FreeBSD team now (even if it's just a link to a book I've to read) will make me a better candidate for the future. Possible Mentor: No choice. I just want to be included in a project and learn by watching others complete a project from scratch. Project Information: I just request to be included in any project which is to be started. I'll read about it as much as I can and will give a description of it and how I can help with it. Project Description: I'll research into whatever project I'm provided and will provide a description of it and how I can help with it. From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 14:59:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88E8106564A for ; Sun, 11 Apr 2010 14:59:52 +0000 (UTC) (envelope-from rpsfa@rit.edu) Received: from fast.rit.edu (fast.rit.edu [129.21.182.30]) by mx1.freebsd.org (Postfix) with ESMTP id 815798FC18 for ; Sun, 11 Apr 2010 14:59:52 +0000 (UTC) Received: from fast.rit.edu (localhost.rit.edu [127.0.0.1]) by fast.rit.edu (Postfix) with ESMTP id 619BE1D168 for ; Sun, 11 Apr 2010 10:29:31 -0400 (EDT) X-Virus-Scanned: by amavisd-new at fast.rit.edu Received: from fast.rit.edu ([127.0.0.1]) by fast.rit.edu (fast.rit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UXemuVl31WAO for ; Sun, 11 Apr 2010 10:29:26 -0400 (EDT) Received: from syn.rit.edu (syn.rit.edu [129.21.182.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by fast.rit.edu (Postfix) with ESMTPS id E9BEA1D163 for ; Sun, 11 Apr 2010 10:29:25 -0400 (EDT) Received: from syn.rit.edu (localhost.rit.edu [127.0.0.1]) by syn.rit.edu (8.14.4/8.14.3) with ESMTP id o3BETPmL018170 for ; Sun, 11 Apr 2010 10:29:25 -0400 (EDT) (envelope-from rpsfa@rit.edu) Received: (from zi@localhost) by syn.rit.edu (8.14.4/8.14.3/Submit) id o3BETPk4018120 for freebsd-hackers@freebsd.org; Sun, 11 Apr 2010 10:29:25 -0400 (EDT) (envelope-from rpsfa@rit.edu) Date: Sun, 11 Apr 2010 10:29:25 -0400 From: Ryan Steinmetz To: freebsd-hackers@freebsd.org Message-ID: <20100411142925.GB6205@fast.rit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Unofficial Heimdal 1.1 backport from 8.0-RELEASE for 7.3-RELEASE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 14:59:52 -0000 All, I've created a patch that will replace Heimdal 0.6.x that comes with 7.3-R base with a backported version of Heimdal 1.1 from 8.0-R and have found it useful in a couple of scenarios. This should add in AES support, among other things, without having to rely on/use ports. http://people.rit.edu/rpsfa/freebsd/heimdal-1.1_for_7.3.tgz To install: -Obtain a fresh source tree for 7.3-R -cd /usr/src && patch -p0 < /path/to/patch -Rebuild/install world and re-run mergemaster No warranties/guarantees; however, it has worked for me so far and I figured that I would share, -r From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 00:34:33 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50034106564A for ; Mon, 12 Apr 2010 00:34:33 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id D04D98FC0A for ; Mon, 12 Apr 2010 00:34:32 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O17bg-0007tM-Di for freebsd-hackers@freebsd.org; Mon, 12 Apr 2010 02:34:28 +0200 Received: from static-78-8-147-77.ssp.dialog.net.pl ([78.8.147.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Apr 2010 02:34:28 +0200 Received: from mwisnicki+freebsd by static-78-8-147-77.ssp.dialog.net.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Apr 2010 02:34:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Marcin Wisnicki Date: Mon, 12 Apr 2010 00:34:16 +0000 (UTC) Lines: 47 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: static-78-8-147-77.ssp.dialog.net.pl User-Agent: Pan/0.132 (Waxed in Black) Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 00:34:33 -0000 On Sun, 11 Apr 2010 12:37:27 +0100, Robert Watson wrote: > On Fri, 9 Apr 2010, Alexander Churanov wrote: > >> 2010/4/9 Leinier Cruz Salfran >> >>> i want to ask you one thing: can you make the 'pkg_install' suite >>> reusable .. means install 'libinstall.a' as a shared object in order >>> to make it reusable by others devs >> >> I'd like to add my 50 cents. From my point of view, the true UNIX way >> is re-using whole programs. This provides unbelievable isolation and >> correctness. If you don't want to fork myriads of processes each >> second, then, it's, probably, better to ask for pipe mode of pkg_* >> tools. For example, aspell works that way. You start a process, write >> commands and queries and read results. > > While there are clearly benefits to process isolation, there are > countless situations in UNIX where I've said to myself "Oh, I wish I had > a lib not just a command". This is particularly the case for > monitoring tools, where third-party applications have a lot of trouble > parsing and tracking the output of tools like ps(1), etc. This is why > recently we've been working on libmemstat(3), libprocstat(3), > libnetstat(3), etc -- so that tools can avoid rewriting that code as > well as avoid the parsing problem. A middle-ground solution to this is to standardise on a common data exchange format with a schema definition language. With schema you can autogenerate high level parsers and generators, validators and other things for free. It does not have to be XML with XML-Schema (though there are good plaintext schema languages like RelaxNG-compact and you could possibly find less verbose text encoding for XML). Fine human readable competitors to XML exists like OGDL, YAML or JSON. OGDL project even have patches for OGDL output in GNU utlities. If, say ps or ipfw, had a switch like '--format-output-yaml' and '--print-output-schema' (alternatively schema files could be stored somewhere in $prefix/share) it would be trivial to use them anywhere. Similar approach could be adopted to input passing with possibility of pipe mode. Any utilitily, with mere tweaks to output formatting and pipe mode would in fact be a class that you could instantiate (run) and use like any other object in your programming language and all of that for free, autogenerated from schema descriptions ;) The only problem I see is agreeing on a single format and forcing everyone to use it. Which is probably why it will never happen :( From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 06:35:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF74106564A for ; Mon, 12 Apr 2010 06:35:14 +0000 (UTC) (envelope-from equixen@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id DF7688FC1C for ; Mon, 12 Apr 2010 06:35:13 +0000 (UTC) Received: by qyk11 with SMTP id 11so4551254qyk.13 for ; Sun, 11 Apr 2010 23:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=Bm9S5w732FR61W87Q3QN6EQCn8RhXBk8J5tIUdGXfB0=; b=sfEnZ7uzOafbNzuBAU1A8Bqtufnw/Eu0Hs6p431z/AvSQz8tuW0imrGW39NFeZlxOf MbXwB3wwUNiN4En7PoTRhcUzLaWl5ESQJ9ashqWgrr8lYb5L59X5ih2UO5INKii3gZDk lGsLdZ035zHChkcbgfqqxJHcEg9h33PVJ3Pg0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rLP82hQtP2M3ZRdm+eg0gJqho/yHhAQgmEe6Qf4zd5QAusTh0yRcw66gfcd2SmlJJ8 d1IMxBdrC9sA2lzRM0IGZ4bUcOdo3NoCXs1AiipAsMBGS8LLggD5UC00CeOxA9DCvwWj LhY/oGW78NLrg5C1VX1iawlb9Bur9c1RARlKU= MIME-Version: 1.0 Received: by 10.229.88.201 with HTTP; Sun, 11 Apr 2010 23:35:12 -0700 (PDT) Date: Mon, 12 Apr 2010 12:05:12 +0530 Received: by 10.229.239.148 with SMTP id kw20mr5371458qcb.10.1271054112997; Sun, 11 Apr 2010 23:35:12 -0700 (PDT) Message-ID: From: Equixen- To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: I want to participate in some FreeBSD project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 06:35:14 -0000 Hello! I am a 3rd year B.Tech (Computer Science) student. I want to participate in some open source project during my summer vacations. I thought about going the Google summer of code way but due to limited knowledge and examinations during the 1st month of the program timeline didn't participate in it. However, I still want to help with the FreeBSD projects. I understand that there will be no stipend and possibly will not be provided any mentor but I request the FreeBSD team to kindly consider me for any of their ongoing project (I might help some student selected via Google SoC). I'm no programming expert and have only a basic experience in languages like C, C++, and various scripting languages. My aim for participating in a project with a big organization like The FreeBSD foundation is to understand how programming works in real world projects and use that knowledge to be an active contributor in the open source world. If I'm rejected for whatever reason I request the members and the FreeBSD team to kindly provide me links to improve my programming in the Open Source arena and hopefully make it next year in the Google SoC. Regards, Ishan Sharma I've also filled the form which FreeBSD requested the students to fill up for Google SoC (Contact details have been omitted for obvious reasons). Name: Ishan Sharma email: ishan_sharma1 at yahoo.co.in Availability: I'll be available after mid June. I;ll be having vacations so I can work whole day from home till mid August. After that I can spend 2-3 hrs. daily during weekdays and 4-5 hrs. or more during weekends. Bio: I'm a 3rd year B.Tech (Computer Science) student. I've only basic experience in programming languages like C, C++, Scripting languages. I've absolutely no experience of working on real projects but I'm a fast learner and if given some pointers will try to a valuable resource to the project. I know I'll need to learn a lot and that's why I'm filling out this application because if I'm not selected this year I'll be better prepared for the next year. Additionally, any help provided by the FreeBSD team now (even if it's just a link to a book I've to read) will make me a better candidate for the future. Possible Mentor: No choice. I just want to be included in a project and learn by watching others complete a project from scratch. Project Information: I just request to be included in any project which is to be started. I'll read about it as much as I can and will give a description of it and how I can help with it. Project Description: I'll research into whatever project I'm provided and will provide a description of it and how I can help with it. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 09:45:35 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62FDA106566C for ; Mon, 12 Apr 2010 09:45:35 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 09D918FC16 for ; Mon, 12 Apr 2010 09:45:34 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2D5C2.dip.t-dialin.net [217.226.213.194]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 46711844267; Mon, 12 Apr 2010 11:45:28 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 970115074; Mon, 12 Apr 2010 11:45:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1271065524; bh=aIKA2izyfnaFBsN/aBg78uB/EJcK+vGYoCxzoANjtfY=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=jymT4XfNdmSIsFuEVtsJAi4Gg/2RWmdwXaEP9yZTozEjex/QONAPJ+qcUSIdmFR93 DbhQ+uO2xMJlmgTxvBrR1nL71mKKC7uJuXDiDZX/lqMY75gYGiVS6q3Zh4jfjHOlw2 pdwThlmCS8XbkCMCK8wVpKxB/Ro3wZJoWju2YIPHXqGW9XYlfZ3CumZzCfdEXRlt+3 q0w33T5zCudi7znhH9GWoxJbB9MVzCqG9QBCvMQL4wtzR+311cfP388SXcknDz+g9J BvtMix5dIBxhy7+XEkDRlUz1biC4uwz4nKdahwzwJlOL6w/2hvEw9jNG1Fw/NTDOpU pwmSyXKYo4rsA== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id o3C9jOuF062399; Mon, 12 Apr 2010 11:45:24 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 12 Apr 2010 11:45:24 +0200 Message-ID: <20100412114524.4281119jvvp5na28@webmail.leidinger.net> Date: Mon, 12 Apr 2010 11:45:24 +0200 From: Alexander Leidinger To: Equixen- References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 46711844267.1CC1E X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.44, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1271670329.35191@h4QhB7U1ObRjh5wVUC5opg X-EBL-Spam-Status: No X-Mailman-Approved-At: Mon, 12 Apr 2010 11:21:14 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: I want to participate in some FreeBSD project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 09:45:35 -0000 Quoting Equixen- (from Mon, 12 Apr 2010 12:05:12 +0530): > Hello! > I am a 3rd year B.Tech (Computer Science) student. I want to > participate in some open source project during my summer vacations. > > I thought about going the Google summer of code way but due to limited > knowledge and examinations during the 1st month of the program > timeline didn't participate in it. However, I still want to help with > the FreeBSD projects. I understand that there will be no stipend and > possibly will not be provided any mentor but I request the FreeBSD > team to kindly consider me for any of their ongoing project (I might > help some student selected via Google SoC). It is unlikely that you can help a GSoC student, they shall not rely on the work of other people to be able to finish what they start. > I'm no programming expert and have only a basic experience in > languages like C, C++, and various scripting languages. My aim for > participating in a project with a big organization like The FreeBSD > foundation is to understand how programming works in real world > projects and use that knowledge to be an active contributor in the > open source world. The programming which is done in companies differs from what is done on OSS. Sometimes the OSS way is better (good code quality, good software engineering practices, smart people, ...), sometimes the company way of doing it is better (if it is a good company). > Bio: I'm a 3rd year B.Tech (Computer Science) student. I've only basic > experience in programming languages like C, C++, Scripting languages. > I've absolutely no experience of working on real projects but I'm a > fast learner and if given some pointers will try to a valuable > resource to the project. I know I'll need to learn a lot and that's > why I'm filling out this application because if I'm not selected this > year I'll be better prepared for the next year. Additionally, any help > provided by the FreeBSD team now (even if it's just a link to a book > I've to read) will make me a better candidate for the future. There is no specific pointer to things to read, as there is too much to read and it depends upon what you are interested in. > Project Information: I just request to be included in any project > which is to be started. I'll read about it as much as I can and will > give a description of it and how I can help with it. In the OSS world people to not get included (getting invited), they more attach themself to something (seeing a warm welcome when providing help). We have the FreeBSD ideas list (http://www.freebsd.org/projects/ideas/), the wiki (http://wiki.freebsd.org/) and our bug tracker (http://www.freebsd.org/cgi/query-pr-summary.cgi?category=). I suggest to wait until the GSoC students and their corresponding projects are announced, and then have a look at the remaining ideas, or to have a look at the bug tracker and to try to understand and solve a problem. Try to find out what could be interesting for you and what does not look too hard for you, and then start to research into the topic. You can ask questions on the lists (reading the lists is a good way to get an idea how we work together, and it also gives insight into how things improve over time), if someone knows an answer to your question you will probably get an answer. Bye, Alexander. -- Falling in love is a lot like dying. You never get to do it enough to become good at it. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 12:47:21 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11381065672 for ; Mon, 12 Apr 2010 12:47:21 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id A35788FC12 for ; Mon, 12 Apr 2010 12:47:21 +0000 (UTC) Received: from mr08.lnh.mail.rcn.net ([207.172.157.28]) by smtp02.lnh.mail.rcn.net with ESMTP; 12 Apr 2010 08:18:55 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr08.lnh.mail.rcn.net (MOS 3.10.8-GA) with ESMTP id LNM17120; Mon, 12 Apr 2010 08:18:11 -0400 (EDT) Received: from 209-6-91-204.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([209.6.91.204]) by smtp01.lnh.mail.rcn.net with ESMTP; 12 Apr 2010 08:18:12 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19395.3971.18547.383066@jerusalem.litteratus.org> Date: Mon, 12 Apr 2010 08:18:11 -0400 To: Alexander Leidinger In-Reply-To: <20100412114524.4281119jvvp5na28@webmail.leidinger.net> References: <20100412114524.4281119jvvp5na28@webmail.leidinger.net> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr08.lnh.mail.rcn.net) Cc: freebsd-hackers@freebsd.org, Equixen- Subject: Re: I want to participate in some FreeBSD project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 12:47:22 -0000 Alexander Leidinger writes: > In the OSS world people to not get included (getting invited), > they more attach themself to something (seeing a warm welcome > when providing help). For someone who wants to get up to speed while still making a contributrion, consider updating documentation. While the docs are ganarally good, there are a number of places (including the FAQ and the Handbook) where material is out-of-date or just poorly worded. If you speak a foreign language, there may be a localization effort with which you can help. Robert Huff From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 13:56:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C37F1065670 for ; Mon, 12 Apr 2010 13:56:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4F08FC0C for ; Mon, 12 Apr 2010 13:56:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AFB1546B46; Mon, 12 Apr 2010 09:56:04 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 224A48A021; Mon, 12 Apr 2010 09:56:03 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 12 Apr 2010 09:50:34 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <1270828122.2375.3.camel@localhost.localdomain> In-Reply-To: <1270828122.2375.3.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004120950.34811.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 12 Apr 2010 09:56:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Sean Bruno Subject: Re: C6 sleep state X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 13:56:05 -0000 On Friday 09 April 2010 11:48:42 am Sean Bruno wrote: > Has anyone worked on code for the C6 power state for the Intel Nehalem > processors yet? > > http://download.intel.com/design/processor/applnots/320354.pdf It shows up as C3 to the OS. I've yet to be able to get turbo mode to work with it enabled though (I had to drop kern.hz down to 100 before the CPUs would enter C3 instead of C2). -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 14:23:38 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD61F1065670 for ; Mon, 12 Apr 2010 14:23:38 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 75DA48FC1A for ; Mon, 12 Apr 2010 14:23:38 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1962036qwi.7 for ; Mon, 12 Apr 2010 07:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0tEyXJA0v0Mp/ViaVC4GVqAx4tlwGSA/+VGR0lJAR0k=; b=dhketoT+JiQr2jahVyHaUUklJFFg0m9aZkN621o+LUSzm1wu8k7xw9tOJlbGMZplJX MmJnwmfrAyjGhp4ProAFMbWPExJWtOQPNIHvs7gUelZze18tNAGyMCgOgYA+V1TrGkDi RyWOBc0oK7BYxtMak9v/VHfWblQbRuI8M0wHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FwIVqtakwyhaHSrUPQoCxIE2QG5GSEZDHiNzO6KWMzCFPL6Dm0+XsXtAHDk45J7Se3 DTYYZW1gAmXKcktMHK1ylVt62O8eE2zKkow6RR2uvOjIKaM4UquoVQatQ+GJIZFIl/s4 DIcWpBAxxeOFNVRWqQ1Jtds2Lwoh182e6/Kk8= MIME-Version: 1.0 Received: by 10.229.28.85 with HTTP; Mon, 12 Apr 2010 07:23:37 -0700 (PDT) In-Reply-To: <19395.3971.18547.383066@jerusalem.litteratus.org> References: <20100412114524.4281119jvvp5na28@webmail.leidinger.net> <19395.3971.18547.383066@jerusalem.litteratus.org> Date: Mon, 12 Apr 2010 07:23:37 -0700 Received: by 10.229.91.11 with SMTP id k11mr6214017qcm.50.1271082217584; Mon, 12 Apr 2010 07:23:37 -0700 (PDT) Message-ID: From: Garrett Cooper To: Robert Huff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Alexander Leidinger , Equixen- , freebsd-hackers@freebsd.org Subject: Re: I want to participate in some FreeBSD project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 14:23:38 -0000 On Mon, Apr 12, 2010 at 5:18 AM, Robert Huff wrote: > > Alexander Leidinger writes: > >> =A0In the OSS world people to not get included (getting invited), >> =A0they more attach themself to something (seeing a warm welcome >> =A0when providing help). > > =A0 =A0 =A0 =A0For someone who wants to get up to speed while still makin= g a > contributrion, consider updating documentation. =A0While the docs are > ganarally good, there are a number of places (including the FAQ and > the Handbook) where material is out-of-date or just poorly worded. > =A0 =A0 =A0 =A0If you speak a foreign language, there may be a localizati= on > effort with which you can help. Robert makes an excellent point; we're always in need of more docs folks and bugbusters to help triage things. It might not be glorious work, but it certainly helps out folks free up their time and it helps someone new in the project get up to speed. All the best, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 16:07:15 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B648106564A for ; Mon, 12 Apr 2010 16:07:15 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id CAFA68FC0A for ; Mon, 12 Apr 2010 16:07:14 +0000 (UTC) Received: by bwz8 with SMTP id 8so3187417bwz.3 for ; Mon, 12 Apr 2010 09:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=J6Qal8nPP+nZVXmzPhCOGxoWIkRKNnDl9KC0Wg3dDu8=; b=fnf2DJ+icYipJrd5eO5mj6w4P0z+CiiJhmEI9cg2tD1eYhck/VaoEeBAzUw1EdMyoe 6I/j4slV3XHKzsm57Xd/BDL7krKmLpMU1d5BhKOpOxnxiLXnn2aXalGZALF179BFziyU X3kLLdtJPFztVZuoZyx9U1bkOSLVDbiWyQSPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=P4kKrJTtaYTKjNPkxzmztk3UuVzmX1pqDS4b7suLK1muP1nzRlrpEz9VZm1nCbiuyo b64ShWSBnKHygKZB4hMDhlAx0H93U4Wz9DcHwKv3qpRR1NohALMxWZsQlBXG7Dd7hif7 3K35yAV1uOJv3Khk5q7p93EZwliD5B7lcUmoo= MIME-Version: 1.0 Received: by 10.204.67.17 with HTTP; Mon, 12 Apr 2010 09:07:13 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Apr 2010 12:07:13 -0400 Received: by 10.204.162.145 with SMTP id v17mr5051256bkx.83.1271088433468; Mon, 12 Apr 2010 09:07:13 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 16:07:15 -0000 On Sun, Apr 11, 2010 at 8:34 PM, Marcin Wisnicki wrote: > On Sun, 11 Apr 2010 12:37:27 +0100, Robert Watson wrote: > >> On Fri, 9 Apr 2010, Alexander Churanov wrote: >> >>> 2010/4/9 Leinier Cruz Salfran >>> >>>> i want to ask you one thing: can you make the 'pkg_install' suite >>>> reusable .. means install 'libinstall.a' as a shared object in order >>>> to make it reusable by others devs >>> >>> I'd like to add my 50 cents. From my point of view, the true UNIX way >>> is re-using whole programs. This provides unbelievable isolation and >>> correctness. If you don't want to fork myriads of processes each >>> second, then, it's, probably, better to ask for pipe mode of pkg_* >>> tools. For example, aspell works that way. You start a process, write >>> commands and queries and read results. >> >> While there are clearly benefits to process isolation, there are >> countless situations in UNIX where I've said to myself "Oh, I wish I had >> a lib not just a command". =C2=A0This is particularly the cas= e for >> monitoring tools, where third-party applications have a lot of trouble >> parsing and tracking the output of tools like ps(1), etc. =C2=A0This is = why >> recently we've been working on libmemstat(3), libprocstat(3), >> libnetstat(3), etc -- so that tools can avoid rewriting that code as >> well as avoid the parsing problem. > > A middle-ground solution to this is to standardise on a common data > exchange format with a schema definition language. With schema you can > autogenerate high level parsers and generators, validators and other thin= gs > for free. It does not have to be XML with XML-Schema (though there are go= od > plaintext schema languages like RelaxNG-compact and you could possibly fi= nd > less verbose text encoding for XML). > > If, say ps or ipfw, had a switch like '--format-output-yaml' and > '--print-output-schema' (alternatively schema files could be stored > somewhere in $prefix/share) it would be trivial to use them anywhere. > > The only problem I see is agreeing on a single format and forcing everyon= e > to use it. Which is probably why it will never happen :( > hello marcin that can be a smart solution but i prefer to use functions directly from library .. i think it's better well, alexander .. i must to follow your first suggestion: use 'pkg_*' commands (meanwhile) .. i plan to make this software usable to netbsd and openbsd too .. i'm not sure but maybe they have the same situation and for that reason i think use the commands is the way to follow i want to count on you to do more questions and surveys From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 16:18:20 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C35801065670 for ; Mon, 12 Apr 2010 16:18:20 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 759BA8FC1E for ; Mon, 12 Apr 2010 16:18:20 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so2006648qwi.7 for ; Mon, 12 Apr 2010 09:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FZoTlSLAp55KOwKw8+8YQEvkLEktBeatHJMIjt5IJ8M=; b=ebZl+OpxoD/03oR1W9b8Y+XQnp4Ai7KNZgUKS5qb+kT1bbqrIFkpjzMwCJxGZx8xrk CrC5I8pkl9SNhTzVXhlXdRDTOVpqFzhC+Nbk0JNlz85gidk77DbM5lFL3559xVn0kz16 ElaP25M2LyklKslIl9IgTHvZUUSqwQLHXbZNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LgGnT6hlUwhriJO+ukrQSFmGpTLnumX4wZgkm8SOyttRYBSwvlJMyx/8L7OpKCy0sF iDzGNJ6KjKXEOx0Xzf4y553c5G8Baf2v/QSfZMUwK5MLR9C8ItPq7af7XvtHZwdg/5ND bhRmQGnNmzpG2wNm33pkMSAUo2zoe0i24EHao= MIME-Version: 1.0 Received: by 10.229.28.85 with HTTP; Mon, 12 Apr 2010 09:18:19 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Apr 2010 09:18:19 -0700 Received: by 10.229.214.17 with SMTP id gy17mr3096309qcb.42.1271089099469; Mon, 12 Apr 2010 09:18:19 -0700 (PDT) Message-ID: From: Garrett Cooper To: Leinier Cruz Salfran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 16:18:20 -0000 On Mon, Apr 12, 2010 at 9:07 AM, Leinier Cruz Salfran wrote: > On Sun, Apr 11, 2010 at 8:34 PM, Marcin Wisnicki > wrote: >> On Sun, 11 Apr 2010 12:37:27 +0100, Robert Watson wrote: >> >>> On Fri, 9 Apr 2010, Alexander Churanov wrote: >>> >>>> 2010/4/9 Leinier Cruz Salfran >>>> >>>>> i want to ask you one thing: can you make the 'pkg_install' suite >>>>> reusable .. means install 'libinstall.a' as a shared object in order >>>>> to make it reusable by others devs >>>> >>>> I'd like to add my 50 cents. From my point of view, the true UNIX way >>>> is re-using whole programs. This provides unbelievable isolation and >>>> correctness. If you don't want to fork myriads of processes each >>>> second, then, it's, probably, better to ask for pipe mode of pkg_* >>>> tools. For example, aspell works that way. You start a process, write >>>> commands and queries and read results. >>> >>> While there are clearly benefits to process isolation, there are >>> countless situations in UNIX where I've said to myself "Oh, I wish I ha= d >>> a lib not just a command". =A0This is particularly the case = for >>> monitoring tools, where third-party applications have a lot of trouble >>> parsing and tracking the output of tools like ps(1), etc. =A0This is wh= y >>> recently we've been working on libmemstat(3), libprocstat(3), >>> libnetstat(3), etc -- so that tools can avoid rewriting that code as >>> well as avoid the parsing problem. >> >> A middle-ground solution to this is to standardise on a common data >> exchange format with a schema definition language. With schema you can >> autogenerate high level parsers and generators, validators and other thi= ngs >> for free. It does not have to be XML with XML-Schema (though there are g= ood >> plaintext schema languages like RelaxNG-compact and you could possibly f= ind >> less verbose text encoding for XML). >> >> If, say ps or ipfw, had a switch like '--format-output-yaml' and >> '--print-output-schema' (alternatively schema files could be stored >> somewhere in $prefix/share) it would be trivial to use them anywhere. >> >> The only problem I see is agreeing on a single format and forcing everyo= ne >> to use it. Which is probably why it will never happen :( >> > > hello marcin > > that can be a smart solution but i prefer to use functions directly > from library .. i think it's better > > well, alexander .. i must to follow your first suggestion: use 'pkg_*' > commands (meanwhile) .. i plan to make this software usable to netbsd > and openbsd too .. =A0i'm not sure but maybe they have the same > situation and for that reason i think use the commands is the way to > follow Just to give you an idea of what's out there... NetBSD used the same basic solution that FreeBSD did, but they diverged about 3 years ago and they have their own library based solution. I think that OpenBSD has their own package maintenance tool written in perl. As for us, we're going the libpkg direction-ish AFAIK, but it's going to take time before we get there. In the meantime, there's also a tool named pkgin which does similar to what you describe and it's portable between pkg_install on FreeBSD and the libpkg-ish solution on NetBSD. HTH, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 18:34:33 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2764B1065673 for ; Mon, 12 Apr 2010 18:34:33 +0000 (UTC) (envelope-from krivenok.dmitry@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 7910F8FC27 for ; Mon, 12 Apr 2010 18:34:32 +0000 (UTC) Received: by ewy24 with SMTP id 24so1162352ewy.33 for ; Mon, 12 Apr 2010 11:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=T6mwuogapU1WZLvRkxdoZ/Yb6ulWoM+nlmHRj21WSnQ=; b=ASFmpAUTgpVf/xa3BrkZHoPTQUQ6yyDnrhyLKeT4LNZoEPtHHxmQdrME749wEdSvhY jogRHTnMW52U7WVSsbf0CkRDHvlBKDvI60uQFUlGupQUXglYobRGLGw/Px64cZmbQXbV pu+WV9r97C/d2BOi+kkDwWvr9rdnQzaD3GBW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=unYSv7zDlLFzMG8Ai6eKY83p5nvRqrIHPIEcE+qQXqxX8dotd2kBhewfSCv4HJdQCi vTvDO7nhRjRI/muG8/4oBa3IMfU+fsg2X2uJIFUoCMd6mP4p797tV72yTLWARi9peW4+ iEz29zEry6FXOgbpHGRP5fgsuONSYFVyzKQ7k= MIME-Version: 1.0 Received: by 10.213.19.76 with HTTP; Mon, 12 Apr 2010 11:34:30 -0700 (PDT) Date: Mon, 12 Apr 2010 22:34:30 +0400 Received: by 10.213.60.13 with SMTP id n13mr2265652ebh.36.1271097271016; Mon, 12 Apr 2010 11:34:31 -0700 (PDT) Message-ID: From: Dmitry Krivenok To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Build world with DEBUG_FLAGS='-g -O0' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 18:34:33 -0000 Hello Hackers, I'm trying to build FreeBSD-CURRENT (r206494) with DEBUG_FLAGS='-g -O0'. Below are the commands I executed: export DEBUG_FLAGS='-g -O0' cd /usr/src/ time make buildworld I got the following error: ... ... ===> sys/boot/i386/boot2 (all) objcopy -S -O binary boot1.out boot1 dd if=/dev/zero of=boot2.ldr bs=512 count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.000142 secs (3603160 bytes/sec) cc -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno -sse3 -DUFS1_AND_UFS2 -DFLAGS=0x80 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/boot2/../../common -I/usr/src/sys/boot/i386/boot 2/../btx/lib -I. -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -W shadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mn o-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -g -O0 -std=gnu99 -S -o boot2.s.tmp /usr/src/sys/boot/i386/boot2/boot2.c sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s rm -f boot2.s.tmp as --32 -o boot2.o boot2.s cc -Os -fno-guess-branch-probability -fomit-frame-pointer -fno-unit-at-a-time -mno-align-long-strings -mrtd -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno -sse3 -DUFS1_AND_UFS2 -DFLAGS=0x80 -DSIOPRT=0x3f8 -DSIOFMT=0x3 -DSIOSPD=9600 -I/usr/src/sys/boot/i386/boot2/../../common -I/usr/src/sys/boot/i386/boot 2/../btx/lib -I. -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -W shadow -Wstrict-prototypes -Wwrite-strings -Winline --param max-inline-insns-single=100 -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mn o-sse -mno-sse2 -mno-sse3 -m32 -march=i386 -g -O0 -std=gnu99 -c /usr/src/sys/boot/i386/boot2/sio.S ld -static -N --gc-sections -nostdlib -m elf_i386_fbsd -Ttext 0x2000 -o boot2.out /usr/src/obj/usr/src/sys/boot/i386/boot2/../btx/lib/crt0.o boot2.o sio.o objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /usr/src/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=20ed text=0 data=0 bss=0 entry=0 output: fmt=bin size=297d text=200 data=277d org=0 entry=0 -2941 bytes available *** Error code 1 Stop in /usr/src/sys/boot/i386/boot2. *** Error code 1 Stop in /usr/src/sys/boot/i386. *** Error code 1 Stop in /usr/src/sys/boot. *** Error code 1 Stop in /usr/src/sys. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. real 87m23.033s user 53m7.195s sys 30m10.744s Error message "-2941 bytes available" is not clear for me :) What's wrong? Thank you beforehand! P.S. Note that compiling with DEBUG_FLAGS='-g' works fine. -- Sincerely yours, Dmitry V. Krivenok e-mail: krivenok.dmitry@gmail.com skype: krivenok_dmitry jabber: krivenok_dmitry@jabber.ru icq: 242-526-443 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 12 19:54:24 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8311065670 for ; Mon, 12 Apr 2010 19:54:24 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id D11158FC0A for ; Mon, 12 Apr 2010 19:54:22 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3CJsKEu053023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Apr 2010 21:54:21 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3CJsDB8030313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Apr 2010 21:54:13 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3CJsD56014111; Mon, 12 Apr 2010 21:54:13 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3CJsDej014110; Mon, 12 Apr 2010 21:54:13 +0200 (CEST) (envelope-from ticso) Date: Mon, 12 Apr 2010 21:54:13 +0200 From: Bernd Walter To: Dmitry Krivenok Message-ID: <20100412195413.GG12315@cicely7.cicely.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org Subject: Re: Build world with DEBUG_FLAGS='-g -O0' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 19:54:24 -0000 On Mon, Apr 12, 2010 at 10:34:30PM +0400, Dmitry Krivenok wrote: > Hello Hackers, > > I'm trying to build FreeBSD-CURRENT (r206494) with DEBUG_FLAGS='-g -O0'. > > Below are the commands I executed: > > export DEBUG_FLAGS='-g -O0' > > cd /usr/src/ > > time make buildworld > > > I got the following error: > > ... > > ... > > objcopy -S -O binary boot2.out boot2.bin > > btxld -v -E 0x2000 -f bin -b > /usr/src/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o > boot2.ld -P 1 boot2.bin > > kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 > > client: fmt=bin size=20ed text=0 data=0 bss=0 entry=0 > > output: fmt=bin size=297d text=200 data=277d org=0 entry=0 > > -2941 bytes available > > *** Error code 1 > > > > Stop in /usr/src/sys/boot/i386/boot2. > > *** Error code 1 > > > > Stop in /usr/src/sys/boot/i386. > > *** Error code 1 > > > > Stop in /usr/src/sys/boot. > > *** Error code 1 > > > > Stop in /usr/src/sys. > > *** Error code 1 > > > > Stop in /usr/src. > > *** Error code 1 > > > > Stop in /usr/src. > > *** Error code 1 > > > > Stop in /usr/src. > > > > real 87m23.033s > > user 53m7.195s > > sys 30m10.744s > > > Error message "-2941 bytes available" is not clear for me :) > What's wrong? It is 2941 bytes too big for bootcode. Bootcode is size constrained. > > Thank you beforehand! > > P.S. > Note that compiling with DEBUG_FLAGS='-g' works fine. Yes - because it compiles with -O2 then, which allows the compiler to buld smaller code. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 01:12:11 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6CC106566B for ; Tue, 13 Apr 2010 01:12:11 +0000 (UTC) (envelope-from mahan@mahan.org) Received: from ns.mahan.org (ns.mahan.org [67.116.10.138]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0EE8FC21 for ; Tue, 13 Apr 2010 01:12:10 +0000 (UTC) Received: from Gypsy.mahan.org (crowTrobot [67.116.10.140]) by ns.mahan.org (8.13.6/8.13.6) with ESMTP id o3D0wLSe006393 for ; Mon, 12 Apr 2010 17:58:21 -0700 (PDT) (envelope-from mahan@mahan.org) Message-ID: <4BC3C145.3080206@mahan.org> Date: Mon, 12 Apr 2010 17:56:37 -0700 From: Patrick Mahan User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: KLM unloading on error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 01:12:11 -0000 All, I have a requirement that when a KLM I am building fails during MOD_LOAD, it should be unloaded. Currently, I am seeing even if I return an error (eg. EINVAL or ENOSYS) the KLM is still shown as loaded (using kldstat). Instead, I would like it to fail and be removed. Does FreeBSD support this? Thanks, Patrick From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 06:49:10 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4957A1065677 for ; Tue, 13 Apr 2010 06:49:10 +0000 (UTC) (envelope-from krivenok.dmitry@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id C6B5D8FC18 for ; Tue, 13 Apr 2010 06:49:09 +0000 (UTC) Received: by ewy24 with SMTP id 24so1310311ewy.33 for ; Mon, 12 Apr 2010 23:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=72FJcfLtcO+2Tx4sViGOILecEDtQ4v/LUs9r4Jn7ias=; b=PDNfqEuvCILcvV1HyxFddzrKDX4/umY8liumRUxTc8n+66nfmNGGM6rXBRy+mqKwxK BApISXvylYEqHwL1VK9HwXUbfbe1DeFnm5OcVjcAictahE/CsEEOz50yCNNaKpcUBF32 GCUOfToQrXXboRxbE3NhZEhmTinuRiUYynM/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HQYj3fxfnJ9vzTsrAwrnGkgC7ZjBa/lH5/H62DXWFBTs2dM3O5lNyWWe2E9G2fTuwk mJoGKnZlA2lrTREvj5mWDIvMwWEb+Rx18cvJ6D0C/i5HAEu8VtJ8BZZIcqVQrewA9ytV gmrsLNXuOAYcNXDMe/ACI21nfn2aphqSqZQdY= MIME-Version: 1.0 Received: by 10.213.19.76 with HTTP; Mon, 12 Apr 2010 23:49:08 -0700 (PDT) In-Reply-To: <20100412195413.GG12315@cicely7.cicely.de> References: <20100412195413.GG12315@cicely7.cicely.de> Date: Tue, 13 Apr 2010 10:49:08 +0400 Received: by 10.213.25.78 with SMTP id y14mr2633625ebb.59.1271141348618; Mon, 12 Apr 2010 23:49:08 -0700 (PDT) Message-ID: From: Dmitry Krivenok To: ticso@cicely.de Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Build world with DEBUG_FLAGS='-g -O0' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 06:49:10 -0000 Is there a simple way to build size constrained parts of world (e.g. bootcode) with '-O2' and other parts with '-O0'? On Mon, Apr 12, 2010 at 11:54 PM, Bernd Walter wrote: > On Mon, Apr 12, 2010 at 10:34:30PM +0400, Dmitry Krivenok wrote: > > Hello Hackers, > > > > I'm trying to build FreeBSD-CURRENT (r206494) with DEBUG_FLAGS='-g -O0'. > > > > Below are the commands I executed: > > > > export DEBUG_FLAGS='-g -O0' > > > > cd /usr/src/ > > > > time make buildworld > > > > > > I got the following error: > > > > ... > > > > ... > > > > objcopy -S -O binary boot2.out boot2.bin > > > > btxld -v -E 0x2000 -f bin -b > > /usr/src/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o > > boot2.ld -P 1 boot2.bin > > > > kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 > > > > client: fmt=bin size=20ed text=0 data=0 bss=0 entry=0 > > > > output: fmt=bin size=297d text=200 data=277d org=0 entry=0 > > > > -2941 bytes available > > > > *** Error code 1 > > > > > > > > Stop in /usr/src/sys/boot/i386/boot2. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src/sys/boot/i386. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src/sys/boot. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src/sys. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src. > > > > *** Error code 1 > > > > > > > > Stop in /usr/src. > > > > > > > > real 87m23.033s > > > > user 53m7.195s > > > > sys 30m10.744s > > > > > > Error message "-2941 bytes available" is not clear for me :) > > What's wrong? > > It is 2941 bytes too big for bootcode. > Bootcode is size constrained. > > > > > Thank you beforehand! > > > > P.S. > > Note that compiling with DEBUG_FLAGS='-g' works fine. > > Yes - because it compiles with -O2 then, which allows the compiler > to buld smaller code. > > -- > B.Walter http://www.bwct.de > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. > -- Sincerely yours, Dmitry V. Krivenok e-mail: krivenok.dmitry@gmail.com skype: krivenok_dmitry jabber: krivenok_dmitry@jabber.ru icq: 242-526-443 From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 09:14:56 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94EB2106566C for ; Tue, 13 Apr 2010 09:14:56 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4EA8FC15 for ; Tue, 13 Apr 2010 09:14:55 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3D9EsCL099821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Apr 2010 11:14:54 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3D9EdBq067448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Apr 2010 11:14:39 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3D9EdNZ018027; Tue, 13 Apr 2010 11:14:39 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3D9Edxo018026; Tue, 13 Apr 2010 11:14:39 +0200 (CEST) (envelope-from ticso) Date: Tue, 13 Apr 2010 11:14:39 +0200 From: Bernd Walter To: Dmitry Krivenok Message-ID: <20100413091439.GH12315@cicely7.cicely.de> References: <20100412195413.GG12315@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: Build world with DEBUG_FLAGS='-g -O0' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 09:14:56 -0000 On Tue, Apr 13, 2010 at 10:49:08AM +0400, Dmitry Krivenok wrote: > Is there a simple way to build size constrained parts of world (e.g. > bootcode) with '-O2' and other > parts with '-O0'? You can build without bootcode: WITHOUT_BOOT=YES > On Mon, Apr 12, 2010 at 11:54 PM, Bernd Walter wrote: > > > On Mon, Apr 12, 2010 at 10:34:30PM +0400, Dmitry Krivenok wrote: > > > Hello Hackers, > > > > > > I'm trying to build FreeBSD-CURRENT (r206494) with DEBUG_FLAGS='-g -O0'. > > > > > > Below are the commands I executed: > > > > > > export DEBUG_FLAGS='-g -O0' > > > > > > cd /usr/src/ > > > > > > time make buildworld > > > > > > > > > I got the following error: > > > > > > ... > > > > > > ... > > > > > > objcopy -S -O binary boot2.out boot2.bin > > > > > > btxld -v -E 0x2000 -f bin -b > > > /usr/src/obj/usr/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o > > > boot2.ld -P 1 boot2.bin > > > > > > kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=1:1 > > > > > > client: fmt=bin size=20ed text=0 data=0 bss=0 entry=0 > > > > > > output: fmt=bin size=297d text=200 data=277d org=0 entry=0 > > > > > > -2941 bytes available > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src/sys/boot/i386/boot2. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src/sys/boot/i386. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src/sys/boot. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src/sys. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop in /usr/src. > > > > > > > > > > > > real 87m23.033s > > > > > > user 53m7.195s > > > > > > sys 30m10.744s > > > > > > > > > Error message "-2941 bytes available" is not clear for me :) > > > What's wrong? > > > > It is 2941 bytes too big for bootcode. > > Bootcode is size constrained. > > > > > > > > Thank you beforehand! > > > > > > P.S. > > > Note that compiling with DEBUG_FLAGS='-g' works fine. > > > > Yes - because it compiles with -O2 then, which allows the compiler > > to buld smaller code. > > > > -- > > B.Walter http://www.bwct.de > > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. > > > > > > -- > Sincerely yours, Dmitry V. Krivenok > e-mail: krivenok.dmitry@gmail.com > skype: krivenok_dmitry > jabber: krivenok_dmitry@jabber.ru > icq: 242-526-443 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 10:05:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B919106564A; Tue, 13 Apr 2010 10:05:52 +0000 (UTC) (envelope-from alexanderchuranov@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id D036E8FC1C; Tue, 13 Apr 2010 10:05:51 +0000 (UTC) Received: by gwaa12 with SMTP id a12so3697292gwa.13 for ; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=denznh5xw8K479gWW+EptupUuvA0WTDUqW02xdztFzE=; b=jpO5n+4oW2Wm+YXR96h/FuB3jIzR4M9vzY1iBj893Twsx5H7/Q6xFOqR26P1CvImu3 suSSaKDd0U2WeA626lT3XR821YHYwJL0sjk6EuH9kifyyd7VHEQjdOaVWMNAUdNt4r0J W//4iq70mtsb8PrFJedZr42BXA6GZG1F1FLPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=g4oRF4LK7sYSAz1r9tun1jyb/Wgu0EDH1GuzO7iIo2E7LJ6cgsJIj+s5c5U5kQnPgC IqLL0WVObwgG/SFC4cHCJZdYJRZjilJcdlwTmXOmGn5AgoWLUV9f6nR8YQMKEIEZTU1F OpUnox9+QC3jqMGx6qzawrqf9bkK4oUF7QVhY= MIME-Version: 1.0 Received: by 10.90.119.15 with HTTP; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 14:05:51 +0400 Received: by 10.91.31.6 with SMTP id i6mr2510672agj.116.1271153151092; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) Message-ID: From: Alexander Churanov To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers , Leinier Cruz Salfran Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 10:05:52 -0000 2010/4/11 Robert Watson > So I have no particular opinion on this tool, but I will say that in > general, it would be nice if programs were often thin wrappers around a > library that could be reused, not just command line tools. > > Robert > Robert, The reusable library is great. The question is how it works with the underlying system. When dealing with a package database, one may provide a library which directly reads and writes the database. On the other hand, the library may re-use some command-line tools. In the latter case there are chances for the package manipulating tool to stay consistent even if the memory in the calling process (which uses the library) is damaged. The database files are also less likely to became corrupted. Of course, run-time performance should be sacrificed. To summarize, there are two ways: 1) Provide the re-library and make command-line tools be just wrappers around the library. 2) Provide command-line tools and make the library to be just a wrapper around the tools. Approaches provide different trade-offs between run-time performance and isolation. Alexander Churanov From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 10:08:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EA18106566C; Tue, 13 Apr 2010 10:08:12 +0000 (UTC) (envelope-from alexanderchuranov@gmail.com) Received: from mail-yw0-f193.google.com (mail-yw0-f193.google.com [209.85.211.193]) by mx1.freebsd.org (Postfix) with ESMTP id 4274F8FC13; Tue, 13 Apr 2010 10:08:11 +0000 (UTC) Received: by ywh31 with SMTP id 31so1883092ywh.3 for ; Tue, 13 Apr 2010 03:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=xhPhQi3GCCjjzJe5WpJpXsWIGQiVtS/TH9mTYVIqGtg=; b=pVOHX1AXHI0QhdmQgEddY1gYrrBgraaYIiHSxHWgjA9yH5AiH1w1Pqqwdc8x6X/0VI Y9e4MLlJqjQUacNsOlxcQRHpDuWGRwb2gV/z0QfL0FjDLSi0GZaO1K3mBKj/PN1Yuyuv TA3k3sjmW6HIaOKxyt2k999Q96NVNuHgP1Ycc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DyY7CnXQ0EjZr94L6yMctVJ/L6d2GJEQ5th2E2Crx3WL7XENl+f3hH0rbVYCDmvQLt v+2zxntRH+PB+DkGgR2v4g6XK9DNw46BUY+NPT8ZYDncUSHvYdI7wuK7Vwe46iu6yCN8 TR7cUvqCeAGh21AXlKTZvy59O6BvpMMr4k69E= MIME-Version: 1.0 Received: by 10.90.119.15 with HTTP; Tue, 13 Apr 2010 03:08:11 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 14:08:11 +0400 Received: by 10.91.152.5 with SMTP id e5mr2436999ago.78.1271153291087; Tue, 13 Apr 2010 03:08:11 -0700 (PDT) Message-ID: From: Alexander Churanov To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers , Leinier Cruz Salfran Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 10:08:13 -0000 ^re-library^library From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 10:46:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DF01065674 for ; Tue, 13 Apr 2010 10:46:02 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward4.mail.yandex.net (forward4.mail.yandex.net [77.88.46.9]) by mx1.freebsd.org (Postfix) with ESMTP id 02E5E8FC19 for ; Tue, 13 Apr 2010 10:46:01 +0000 (UTC) Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward4.mail.yandex.net (Yandex) with ESMTP id AF6E46AD87F3; Tue, 13 Apr 2010 14:45:59 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1271155559; bh=52YYuwGsN0/m8RO5Ns+6fzyZiZHGZCgkfihnYow1TQI=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=sjdGEb28c2m/fBrMCg7pVuO9uo4iFa/rbT2G3g/FLOcC5ATZrCmFWCaqUY5x29S3H OqpHoF8Ckf3issklCbnnCmBpObS7NaOt+ApgmeawCcJ3OHL4lzrDTjm0K3IE6Tks4b hXONmqThpNjrD7w3doXRnHZ8bMPON4c0TD6Gpxd8= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp2.mail.yandex.net (Yandex) with ESMTPSA id 76564528097; Tue, 13 Apr 2010 14:45:59 +0400 (MSD) Message-ID: <4BC44B66.8080402@yandex.ru> Date: Tue, 13 Apr 2010 14:45:58 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Patrick Mahan References: <4BC3C145.3080206@mahan.org> In-Reply-To: <4BC3C145.3080206@mahan.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Yandex-TimeMark: 1271155559 X-Yandex-Spam: 1 X-Yandex-Front: smtp2.mail.yandex.net Cc: freebsd-hackers@freebsd.org Subject: Re: KLM unloading on error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 10:46:02 -0000 On 13.04.2010 4:56, Patrick Mahan wrote: > I have a requirement that when a KLM I am building fails during MOD_LOAD, > it should be unloaded. Currently, I am seeing even if I return an error > (eg. EINVAL or ENOSYS) the KLM is still shown as loaded (using kldstat). > Instead, I would like it to fail and be removed. Does FreeBSD support this? Hi Patrick. It seems it is bug. I have the same problem in 9-CURRENT, which FreeBSD version do you have? -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 13:51:00 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1951065679 for ; Tue, 13 Apr 2010 13:51:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A39878FC12 for ; Tue, 13 Apr 2010 13:51:00 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 45B8C46B89; Tue, 13 Apr 2010 09:51:00 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 72C1C8A01F; Tue, 13 Apr 2010 09:50:59 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 13 Apr 2010 09:12:37 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <4BC3C145.3080206@mahan.org> <4BC44B66.8080402@yandex.ru> In-Reply-To: <4BC44B66.8080402@yandex.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201004130912.37606.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 13 Apr 2010 09:50:59 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "Andrey V. Elsukov" , Patrick Mahan Subject: Re: KLM unloading on error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 13:51:01 -0000 On Tuesday 13 April 2010 6:45:58 am Andrey V. Elsukov wrote: > On 13.04.2010 4:56, Patrick Mahan wrote: > > I have a requirement that when a KLM I am building fails during MOD_LOAD, > > it should be unloaded. Currently, I am seeing even if I return an error > > (eg. EINVAL or ENOSYS) the KLM is still shown as loaded (using kldstat). > > Instead, I would like it to fail and be removed. Does FreeBSD support this? > > Hi Patrick. > > It seems it is bug. I have the same problem in 9-CURRENT, which FreeBSD > version do you have? Hmm, that does seem like a bug. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 14:11:54 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A3C3106566B for ; Tue, 13 Apr 2010 14:11:54 +0000 (UTC) (envelope-from mahan@mahan.org) Received: from ns.mahan.org (ns.mahan.org [67.116.10.138]) by mx1.freebsd.org (Postfix) with ESMTP id E5FA68FC17 for ; Tue, 13 Apr 2010 14:11:53 +0000 (UTC) Received: from Gypsy.mahan.org (crowTrobot [67.116.10.140]) by ns.mahan.org (8.13.6/8.13.6) with ESMTP id o3DEDdDC012264; Tue, 13 Apr 2010 07:13:40 -0700 (PDT) (envelope-from mahan@mahan.org) Message-ID: <4BC47BA8.2090408@mahan.org> Date: Tue, 13 Apr 2010 07:11:52 -0700 From: Patrick Mahan User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <4BC3C145.3080206@mahan.org> <4BC44B66.8080402@yandex.ru> In-Reply-To: <4BC44B66.8080402@yandex.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: KLM unloading on error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 14:11:54 -0000 *smack* sorry, should have posted it. I am running FreeBSD 8.0 Release p2 (amd64). Thanks, Patrick Andrey V. Elsukov wrote: > On 13.04.2010 4:56, Patrick Mahan wrote: >> I have a requirement that when a KLM I am building fails during MOD_LOAD, >> it should be unloaded. Currently, I am seeing even if I return an error >> (eg. EINVAL or ENOSYS) the KLM is still shown as loaded (using kldstat). >> Instead, I would like it to fail and be removed. Does FreeBSD support >> this? > > Hi Patrick. > > It seems it is bug. I have the same problem in 9-CURRENT, which FreeBSD > version do you have? > From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 20:37:58 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5411065679; Tue, 13 Apr 2010 20:37:58 +0000 (UTC) (envelope-from jaxbrigs@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 297748FC2B; Tue, 13 Apr 2010 20:37:57 +0000 (UTC) Received: by bwz8 with SMTP id 8so4713852bwz.3 for ; Tue, 13 Apr 2010 13:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:cc:subject :date:mime-version:content-type:content-transfer-encoding:x-priority :x-msmail-priority:x-mailer:x-mimeole; bh=ajuR1t7Af6akXlaDNQpYwrlFzMXrekCswnvEgOiEV3E=; b=pojmrXi56ng+odRCgWz4Q9rDKTTGUtlsuW/4c0DylEYtytj0JZud88PvVVIuoIdsab bs5lHd8PAtymd+Mdck6btFGDDqf/fmGFv8N5CKySQTYxUJOldeQiJ0sXDEWnlp/u//TI AVzLFbwa7u0nEc565003iAmIDDJYn1a3nLqg8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:cc:subject:date:mime-version:content-type :content-transfer-encoding:x-priority:x-msmail-priority:x-mailer :x-mimeole; b=uHsOXBnFKI91Uo3XEQNpsJAuLwBt5YU00bxco7MjEPNOZiPjy+roUaKtuxWk3NbfKU pFt6Vjvgxw9hvRT3uaKygw+JrBRL/whkBKmgqpGAZmIPBjMNRl74Q8x7G6WZrxgfvDs+ PrvBplZDmY4fmVQ0YVrNM/OP/gRY9yxTjksVs= Received: by 10.223.7.78 with SMTP id c14mr3641071fac.64.1271189624524; Tue, 13 Apr 2010 13:13:44 -0700 (PDT) Received: from JAX (PPPoE-78-29-107-29.san.ru [78.29.107.29]) by mx.google.com with ESMTPS id 28sm11897357fkx.6.2010.04.13.13.13.43 (version=SSLv3 cipher=RC4-MD5); Tue, 13 Apr 2010 13:13:43 -0700 (PDT) Message-ID: <5ED60A4D35014945A5F9C14F253E1D52@lan.jax.org.ru> From: "Igor Druzhinin" To: Date: Wed, 14 Apr 2010 00:13:39 +0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Mailman-Approved-At: Tue, 13 Apr 2010 20:57:36 +0000 Cc: freebsd-hackers@freebsd.org Subject: GSoC 2010 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 20:37:58 -0000 Hello, Robert Watson I have considered your remarks to my proposal. Now I have some problems with GSoC site so I've decided to post my comment here. About choosing the best method for current hardware: I think that the best way to realise it is to use small userspace shared memory region where kernel can to load additional syscall stub during initialization. It may looks like this: write() stub: ... sub $0x0C, %esp movl $_fd, (%esp) movl $_buf, 0x4(%esp) movl $_len, 0x8(%esp) movl $4, %eax call add $0x0C, %esp ... Depending on output of CPUID command during the initialization kernel will load certain shared stub. For newer processors it may be: shared stub: sysenter ret About my testing plans: I think it will be simple multi-threaded program that will call syscalls in the loop and measure them execution time with time-stamp counter (RDTSC). If all is fulfilled correctly regression should not to arise. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 23:26:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED3E1065670 for ; Tue, 13 Apr 2010 23:26:52 +0000 (UTC) (envelope-from knoseeker@googlemail.com) Received: from mail-gx0-f211.google.com (mail-gx0-f211.google.com [209.85.217.211]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5208FC0C for ; Tue, 13 Apr 2010 23:26:51 +0000 (UTC) Received: by gxk3 with SMTP id 3so3706541gxk.13 for ; Tue, 13 Apr 2010 16:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=cZIXNu9Nu0OQs7xoWHegbFpLLHlLNMoNRL/q+S6w230=; b=jrAtaK5YpKam7iQ0YnY4iOZXO47u720Qwx6Twx5Qni4o1Xr4huSv07gmpgEwAidP3C Orc8aK63WTZKhryXY9Ov35oymSnBguNQ/aWH3TVUPfVMzVO7NwJxRr8lcjPUTsl4nORM NzpiEu1xoLDK/y2wx0x3+VIKNe3ZVjQqTSGGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=tXYgPW7Ui8OSGeLZXPyBJioBRrWmd/FUaXiOhk/J0yIa+gt3IFoGHJ5uCP8mG16jPl wEJwfFUv1xcgtSA8OJUVig45fl/e5GCdbymz8b9GL9ILWx+ZzEg4qQlSh3MPvNjmCJAb 9gbWcKP3KAsyPnCEjGyeHG+bfcAapzsnhgs+U= MIME-Version: 1.0 Received: by 10.231.206.142 with HTTP; Tue, 13 Apr 2010 16:00:48 -0700 (PDT) Date: Tue, 13 Apr 2010 23:00:48 +0000 Received: by 10.91.41.19 with SMTP id t19mr2990912agj.3.1271199648263; Tue, 13 Apr 2010 16:00:48 -0700 (PDT) Message-ID: From: Knowledge Seeker To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: RPC and NFS more than 16 groups X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2010 23:26:52 -0000 Hi, I need to have my NFS server to authenticate more than 16 groups when there is a file access. I would like to know if I can just redefine my MACROS to accomplish that. The macro would be: NGRPS, because it is tested against the variable ngroups which comes from NGROUPS value. /* gids compose part of a credential; there may not be more than 16 of them */ #define NGRPS 16 In: sys/rpc/authunix_prot.c sys/rpc/svc_auth_unix.c usr.sbin/rpc.lockd/kern.c include/rpc/auth_unix.h lib/libc/rpc/PSD.doc/xdr.nts.ms Is there any critical issue in change the defs and recompile the kernel and the world? Thanks in advance. Regards -- Knoseeker From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 02:35:31 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B02106564A for ; Wed, 14 Apr 2010 02:35:31 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id E09E58FC14 for ; Wed, 14 Apr 2010 02:35:30 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o3E2YE80096540; Tue, 13 Apr 2010 21:34:14 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o3E2YEC5096539; Tue, 13 Apr 2010 21:34:14 -0500 (CDT) (envelope-from brooks) Date: Tue, 13 Apr 2010 21:34:14 -0500 From: Brooks Davis To: Knowledge Seeker Message-ID: <20100414023414.GD81708@lor.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7DO5AaGCk89r4vaK" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 13 Apr 2010 21:34:14 -0500 (CDT) Cc: freebsd-hackers@freebsd.org Subject: Re: RPC and NFS more than 16 groups X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 02:35:31 -0000 --7DO5AaGCk89r4vaK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 13, 2010 at 11:00:48PM +0000, Knowledge Seeker wrote: > Hi, > I need to have my NFS server to authenticate more than 16 groups when the= re > is a file access. >=20 > I would like to know if I can just redefine my MACROS to accomplish that. >=20 > The macro would be: NGRPS, because it is tested against the variable > ngroups which comes from NGROUPS value. >=20 > /* gids compose part of a credential; there may not be more than 16 of th= em > */ > #define NGRPS 16 >=20 > In: >=20 > sys/rpc/authunix_prot.c > sys/rpc/svc_auth_unix.c > usr.sbin/rpc.lockd/kern.c > include/rpc/auth_unix.h > lib/libc/rpc/PSD.doc/xdr.nts.ms >=20 > Is there any critical issue in change the defs and recompile the kernel a= nd > the world? It won't work unless you also change the clients and then you will be sending invalid RPC packets over the wire. If you can live with that it may well work. The real answer is switch to NFSv4 and GSSAPI authentication where the group checking all takes place on the server where it belongs in the first place. -- Brooks --7DO5AaGCk89r4vaK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLxSmlXY6L6fI4GtQRArepAKCK+BJrgxV6veRR/Gsq05LZzzxztgCfX6N1 KQri5YK/ALW/dqkkemPfuQI= =YRkI -----END PGP SIGNATURE----- --7DO5AaGCk89r4vaK-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 10:02:30 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9920106566B; Wed, 14 Apr 2010 10:02:30 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 280A78FC1B; Wed, 14 Apr 2010 10:02:29 +0000 (UTC) Received: from gw ([192.168.10.10] helo=terran) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1O1zMX-00047o-Vj; Wed, 14 Apr 2010 12:58:26 +0300 Date: Wed, 14 Apr 2010 13:03:53 +0300 From: Alexandr Rybalko To: hackers@freebsd.org Message-Id: <20100414130353.c28d5128.ray@dlink.ua> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: embedded@FreeBSD.org Subject: Patch for config utility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 10:02:31 -0000 Hi All, I made a patch for the config utility, which enables execution of config outside of the kernel source tree. The main purpose is to avoid large number of configuration files for many boards. I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel config files. If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf directory of platform :) Index: mkoptions.c =================================================================== --- mkoptions.c (revision 206411) +++ mkoptions.c (working copy) @@ -294,7 +294,11 @@ read_options(void) char genopt[MAXPATHLEN]; SLIST_INIT(&otab); - (void) snprintf(fname, sizeof(fname), "../../conf/options"); + if ( *ksrcdir != '\0' ) + (void) snprintf(fname, sizeof(fname), "%s/conf/options", + ksrcdir); + else + (void) snprintf(fname, sizeof(fname), "../../conf/options"); openit: fp = fopen(fname, "r"); if (fp == 0) { @@ -306,7 +310,12 @@ next: (void) fclose(fp); if (first == 1) { first++; - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); + if ( *ksrcdir != '\0' ) + (void) snprintf(fname, sizeof fname, + "%s/conf/options.%s", ksrcdir, machinename); + else + (void) snprintf(fname, sizeof fname, + "../../conf/options.%s", machinename); fp = fopen(fname, "r"); if (fp != 0) goto next; Index: main.c =================================================================== --- main.c (revision 206411) +++ main.c (working copy) @@ -72,6 +72,7 @@ static const char rcsid[] = char * PREFIX; char destdir[MAXPATHLEN]; +char ksrcdir[MAXPATHLEN]; char srcdir[MAXPATHLEN]; int debugging; @@ -110,8 +111,9 @@ main(int argc, char **argv) char xxx[MAXPATHLEN]; char *kernfile; + *ksrcdir = '\0'; kernfile = NULL; - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) switch (ch) { case 'C': filebased = 1; @@ -125,6 +127,12 @@ main(int argc, char **argv) case 'g': debugging++; break; + case 'k': + if (*ksrcdir == '\0') + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); + else + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); + break; case 'p': profiling++; break; @@ -164,7 +172,8 @@ main(int argc, char **argv) len = strlen(destdir); while (len > 1 && destdir[len - 1] == '/') destdir[--len] = '\0'; - get_srcdir(); + if (*ksrcdir == '\0') + get_srcdir(); } else { strlcpy(destdir, CDIR, sizeof(destdir)); strlcat(destdir, PREFIX, sizeof(destdir)); @@ -210,11 +219,14 @@ main(int argc, char **argv) * for "sys" (to make genassym.c work along with #include ) * and similarly for "machine". */ - if (*srcdir == '\0') - (void)snprintf(xxx, sizeof(xxx), "../../include"); - else + if (*ksrcdir != '\0') (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + ksrcdir, machinename); + else if (*srcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", srcdir, machinename); + else + (void)snprintf(xxx, sizeof(xxx), "../../include"); (void) unlink(path("machine")); (void) symlink(xxx, path("machine")); if (strcmp(machinename, machinearch) != 0) { @@ -222,12 +234,15 @@ main(int argc, char **argv) * make symbolic links in compilation directory for * machinearch, if it is different than machinename. */ - if (*srcdir == '\0') + if (*ksrcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + ksrcdir, machinearch); + else if (*srcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + srcdir, machinearch); + else (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", machinearch); - else - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", - srcdir, machinearch); (void) unlink(path(machinearch)); (void) symlink(xxx, path(machinearch)); } @@ -278,7 +293,7 @@ static void usage(void) { - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); fprintf(stderr, " config -x kernel\n"); exit(EX_USAGE); } Index: mkmakefile.c =================================================================== --- mkmakefile.c (revision 206411) +++ mkmakefile.c (working copy) @@ -116,7 +116,12 @@ makefile(void) int versreq; read_files(); - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); + if (*ksrcdir != '\0') + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", + ksrcdir, machinename); + else + snprintf(line, sizeof(line), "../../conf/Makefile.%s", + machinename); ifp = fopen(line, "r"); if (ifp == 0) { snprintf(line, sizeof(line), "Makefile.%s", machinename); @@ -139,7 +144,9 @@ makefile(void) fprintf(ofp, "DEBUG=-g\n"); if (profiling) fprintf(ofp, "PROFLEVEL=%d\n", profiling); - if (*srcdir != '\0') + if (*ksrcdir != '\0') + fprintf(ofp,"S=%s\n", ksrcdir); + else if (*srcdir != '\0') fprintf(ofp,"S=%s\n", srcdir); while (fgets(line, BUFSIZ, ifp) != 0) { if (*line != '%') { @@ -347,7 +354,12 @@ next: printf("%s: missing include filename.\n", fname); exit(1); } - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); + if (*ksrcdir != '\0') + (void) snprintf(ifname, sizeof(ifname), "%s/%s", + ksrcdir, wd); + else + (void) snprintf(ifname, sizeof(ifname), "../../%s", + wd); read_file(ifname); while (((wd = get_word(fp)) != (char *)EOF) && wd) ; @@ -544,9 +556,17 @@ read_files(void) char fname[MAXPATHLEN]; struct files_name *nl, *tnl; - (void) snprintf(fname, sizeof(fname), "../../conf/files"); + if (*ksrcdir != '\0') + (void) snprintf(fname, sizeof(fname), "%s/conf/files", + ksrcdir); + else + (void) snprintf(fname, sizeof(fname), "../../conf/files"); read_file(fname); - (void) snprintf(fname, sizeof(fname), + if (*ksrcdir != '\0') + (void) snprintf(fname, sizeof(fname), + "%s/conf/files.%s", ksrcdir, machinename); + else + (void) snprintf(fname, sizeof(fname), "../../conf/files.%s", machinename); read_file(fname); for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { Index: config.8 =================================================================== --- config.8 (revision 206411) +++ config.8 (working copy) @@ -38,6 +38,7 @@ .Nm .Op Fl CVgp .Op Fl d Ar destdir +.Op Fl k Ar ksrcdir .Ar SYSTEM_NAME .Nm .Op Fl x Ar kernel @@ -78,6 +79,10 @@ Note that does not append .Ar SYSTEM_NAME to the directory given. +.It Fl k Ar ksrcdir +Use +.Ar ksrcdir +as the kernel source tree directory, instead of the default one. .It Fl g Configure a system for debugging. .It Fl x Ar kernel Index: config.h =================================================================== --- config.h (revision 206411) +++ config.h (working copy) @@ -196,6 +196,8 @@ extern int maxusers; extern char *PREFIX; /* Config file name - for error messages */ extern char srcdir[]; /* root of the kernel source tree */ +extern char ksrcdir[]; /* root of the kernel source tree + * set by -k flag */ #define eq(a,b) (!strcmp(a,b)) #define ns(s) strdup(s) Index: lang.l =================================================================== --- lang.l (revision 206411) +++ lang.l (working copy) @@ -259,7 +259,10 @@ include(const char *fname, int ateof) fnamebuf = NULL; fp = fopen(fname, "r"); if (fp == NULL && fname[0] != '.' && fname[0] != '/') { - asprintf(&fnamebuf, "../../conf/%s", fname); + if (*ksrcdir != '\0') + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); + else + asprintf(&fnamebuf, "../../conf/%s", fname); if (fnamebuf != NULL) { fp = fopen(fnamebuf, "r"); free(fnamebuf); -- Alexandr Rybalko aka Alex RAY From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 13:23:26 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14580106564A for ; Wed, 14 Apr 2010 13:23:26 +0000 (UTC) (envelope-from samrobb@averesystems.com) Received: from zimbra.averesystems.com (75-149-8-243-Pennsylvania.hfc.comcastbusiness.net [75.149.8.243]) by mx1.freebsd.org (Postfix) with ESMTP id DD3F08FC16 for ; Wed, 14 Apr 2010 13:23:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 8824E8BC044 for ; Wed, 14 Apr 2010 09:06:22 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fx3hRSgug9w5 for ; Wed, 14 Apr 2010 09:06:21 -0400 (EDT) Received: from [10.1.10.168] (173-13-47-90-Pennsylvania.hfc.comcastbusiness.net [173.13.47.90]) by zimbra.averesystems.com (Postfix) with ESMTPSA id C3D118BC042 for ; Wed, 14 Apr 2010 09:06:21 -0400 (EDT) From: Sam Robb Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Wed, 14 Apr 2010 09:08:50 -0400 Message-Id: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1078) X-Mailer: Apple Mail (2.1078) Subject: Going from struct disk to a fh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:23:26 -0000 In the kernel, given a struct disk, is there a way to turn that into = something that can be used to read/write from the disk? Or is my best = bet in this situation to figure out the device path for the disk, and = just use kern_open() to access it? -Samrobb= From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 13:28:28 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E2A5106564A; Wed, 14 Apr 2010 13:28:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4076B8FC1A; Wed, 14 Apr 2010 13:28:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E168E46B89; Wed, 14 Apr 2010 09:28:27 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0C8EC8A01F; Wed, 14 Apr 2010 09:28:27 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org, embedded@freebsd.org Date: Wed, 14 Apr 2010 09:06:28 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <20100414130353.c28d5128.ray@dlink.ua> In-Reply-To: <20100414130353.c28d5128.ray@dlink.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004140906.28205.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 14 Apr 2010 09:28:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexandr Rybalko Subject: Re: Patch for config utility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:28:28 -0000 On Wednesday 14 April 2010 6:03:53 am Alexandr Rybalko wrote: > Hi All, > > I made a patch for the config utility, which enables execution of config outside of the kernel source tree. > The main purpose is to avoid large number of configuration files for many boards. > I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel > config files. > If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), > every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf > directory of platform :) I think the patch would be simpler if you set ksrcdir to "../.." initially. Then most of the conditionals can be collapsed as ksrcdir could always be used in the code. You could just use a simple boolean in the main() routine to warn about multiple -k options (or just let the last -k option win and not bother with a warning). > Index: mkoptions.c > =================================================================== > --- mkoptions.c (revision 206411) > +++ mkoptions.c (working copy) > @@ -294,7 +294,11 @@ read_options(void) > char genopt[MAXPATHLEN]; > > SLIST_INIT(&otab); > - (void) snprintf(fname, sizeof(fname), "../../conf/options"); > + if ( *ksrcdir != '\0' ) > + (void) snprintf(fname, sizeof(fname), "%s/conf/options", > + ksrcdir); > + else > + (void) snprintf(fname, sizeof(fname), "../../conf/options"); > openit: > fp = fopen(fname, "r"); > if (fp == 0) { > @@ -306,7 +310,12 @@ next: > (void) fclose(fp); > if (first == 1) { > first++; > - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); > + if ( *ksrcdir != '\0' ) > + (void) snprintf(fname, sizeof fname, > + "%s/conf/options.%s", ksrcdir, machinename); > + else > + (void) snprintf(fname, sizeof fname, > + "../../conf/options.%s", machinename); > fp = fopen(fname, "r"); > if (fp != 0) > goto next; > Index: main.c > =================================================================== > --- main.c (revision 206411) > +++ main.c (working copy) > @@ -72,6 +72,7 @@ static const char rcsid[] = > > char * PREFIX; > char destdir[MAXPATHLEN]; > +char ksrcdir[MAXPATHLEN]; > char srcdir[MAXPATHLEN]; > > int debugging; > @@ -110,8 +111,9 @@ main(int argc, char **argv) > char xxx[MAXPATHLEN]; > char *kernfile; > > + *ksrcdir = '\0'; > kernfile = NULL; > - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) > + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) > switch (ch) { > case 'C': > filebased = 1; > @@ -125,6 +127,12 @@ main(int argc, char **argv) > case 'g': > debugging++; > break; > + case 'k': > + if (*ksrcdir == '\0') > + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); > + else > + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); > + break; > case 'p': > profiling++; > break; > @@ -164,7 +172,8 @@ main(int argc, char **argv) > len = strlen(destdir); > while (len > 1 && destdir[len - 1] == '/') > destdir[--len] = '\0'; > - get_srcdir(); > + if (*ksrcdir == '\0') > + get_srcdir(); > } else { > strlcpy(destdir, CDIR, sizeof(destdir)); > strlcat(destdir, PREFIX, sizeof(destdir)); > @@ -210,11 +219,14 @@ main(int argc, char **argv) > * for "sys" (to make genassym.c work along with #include ) > * and similarly for "machine". > */ > - if (*srcdir == '\0') > - (void)snprintf(xxx, sizeof(xxx), "../../include"); > - else > + if (*ksrcdir != '\0') > (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + ksrcdir, machinename); > + else if (*srcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > srcdir, machinename); > + else > + (void)snprintf(xxx, sizeof(xxx), "../../include"); > (void) unlink(path("machine")); > (void) symlink(xxx, path("machine")); > if (strcmp(machinename, machinearch) != 0) { > @@ -222,12 +234,15 @@ main(int argc, char **argv) > * make symbolic links in compilation directory for > * machinearch, if it is different than machinename. > */ > - if (*srcdir == '\0') > + if (*ksrcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + ksrcdir, machinearch); > + else if (*srcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + srcdir, machinearch); > + else > (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", > machinearch); > - else > - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > - srcdir, machinearch); > (void) unlink(path(machinearch)); > (void) symlink(xxx, path(machinearch)); > } > @@ -278,7 +293,7 @@ static void > usage(void) > { > > - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); > + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); > fprintf(stderr, " config -x kernel\n"); > exit(EX_USAGE); > } > Index: mkmakefile.c > =================================================================== > --- mkmakefile.c (revision 206411) > +++ mkmakefile.c (working copy) > @@ -116,7 +116,12 @@ makefile(void) > int versreq; > > read_files(); > - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); > + if (*ksrcdir != '\0') > + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", > + ksrcdir, machinename); > + else > + snprintf(line, sizeof(line), "../../conf/Makefile.%s", > + machinename); > ifp = fopen(line, "r"); > if (ifp == 0) { > snprintf(line, sizeof(line), "Makefile.%s", machinename); > @@ -139,7 +144,9 @@ makefile(void) > fprintf(ofp, "DEBUG=-g\n"); > if (profiling) > fprintf(ofp, "PROFLEVEL=%d\n", profiling); > - if (*srcdir != '\0') > + if (*ksrcdir != '\0') > + fprintf(ofp,"S=%s\n", ksrcdir); > + else if (*srcdir != '\0') > fprintf(ofp,"S=%s\n", srcdir); > while (fgets(line, BUFSIZ, ifp) != 0) { > if (*line != '%') { > @@ -347,7 +354,12 @@ next: > printf("%s: missing include filename.\n", fname); > exit(1); > } > - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); > + if (*ksrcdir != '\0') > + (void) snprintf(ifname, sizeof(ifname), "%s/%s", > + ksrcdir, wd); > + else > + (void) snprintf(ifname, sizeof(ifname), "../../%s", > + wd); > read_file(ifname); > while (((wd = get_word(fp)) != (char *)EOF) && wd) > ; > @@ -544,9 +556,17 @@ read_files(void) > char fname[MAXPATHLEN]; > struct files_name *nl, *tnl; > > - (void) snprintf(fname, sizeof(fname), "../../conf/files"); > + if (*ksrcdir != '\0') > + (void) snprintf(fname, sizeof(fname), "%s/conf/files", > + ksrcdir); > + else > + (void) snprintf(fname, sizeof(fname), "../../conf/files"); > read_file(fname); > - (void) snprintf(fname, sizeof(fname), > + if (*ksrcdir != '\0') > + (void) snprintf(fname, sizeof(fname), > + "%s/conf/files.%s", ksrcdir, machinename); > + else > + (void) snprintf(fname, sizeof(fname), > "../../conf/files.%s", machinename); > read_file(fname); > for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { > Index: config.8 > =================================================================== > --- config.8 (revision 206411) > +++ config.8 (working copy) > @@ -38,6 +38,7 @@ > .Nm > .Op Fl CVgp > .Op Fl d Ar destdir > +.Op Fl k Ar ksrcdir > .Ar SYSTEM_NAME > .Nm > .Op Fl x Ar kernel > @@ -78,6 +79,10 @@ Note that > does not append > .Ar SYSTEM_NAME > to the directory given. > +.It Fl k Ar ksrcdir > +Use > +.Ar ksrcdir > +as the kernel source tree directory, instead of the default one. > .It Fl g > Configure a system for debugging. > .It Fl x Ar kernel > Index: config.h > =================================================================== > --- config.h (revision 206411) > +++ config.h (working copy) > @@ -196,6 +196,8 @@ extern int maxusers; > > extern char *PREFIX; /* Config file name - for error messages */ > extern char srcdir[]; /* root of the kernel source tree */ > +extern char ksrcdir[]; /* root of the kernel source tree > + * set by -k flag */ > > #define eq(a,b) (!strcmp(a,b)) > #define ns(s) strdup(s) > Index: lang.l > =================================================================== > --- lang.l (revision 206411) > +++ lang.l (working copy) > @@ -259,7 +259,10 @@ include(const char *fname, int ateof) > fnamebuf = NULL; > fp = fopen(fname, "r"); > if (fp == NULL && fname[0] != '.' && fname[0] != '/') { > - asprintf(&fnamebuf, "../../conf/%s", fname); > + if (*ksrcdir != '\0') > + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); > + else > + asprintf(&fnamebuf, "../../conf/%s", fname); > if (fnamebuf != NULL) { > fp = fopen(fnamebuf, "r"); > free(fnamebuf); > > > -- > Alexandr Rybalko > aka Alex RAY > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 13:46:00 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF84106564A; Wed, 14 Apr 2010 13:46:00 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1B48FC20; Wed, 14 Apr 2010 13:45:59 +0000 (UTC) Received: from gw ([192.168.10.10] helo=terran) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1O22qn-0008RT-VY; Wed, 14 Apr 2010 16:41:54 +0300 Date: Wed, 14 Apr 2010 16:47:22 +0300 From: Alexandr Rybalko To: John Baldwin Message-Id: <20100414164722.062cac6e.ray@dlink.ua> In-Reply-To: <201004140906.28205.jhb@freebsd.org> References: <20100414130353.c28d5128.ray@dlink.ua> <201004140906.28205.jhb@freebsd.org> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, embedded@freebsd.org Subject: Re: Patch for config utility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:46:00 -0000 On Wed, 14 Apr 2010 09:06:28 -0400 John Baldwin wrote: >> On Wednesday 14 April 2010 6:03:53 am Alexandr Rybalko wrote: >> > Hi All, >> > >> > I made a patch for the config utility, which enables execution of config >> outside of the kernel source tree. >> > The main purpose is to avoid large number of configuration files for many >> boards. >> > I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than >> 4 different profiles with different kernel >> > config files. >> > If every device have 3-5 configs (with different hints files), every chip >> have ~ 5-10 vendors (producing devices on this chip), >> > every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and >> platform have 10-20 family's, so we get 40000 files in conf >> > directory of platform :) >> >> I think the patch would be simpler if you set ksrcdir to "../.." initially. >> Then most of the conditionals can be collapsed as ksrcdir could always be used >> in the code. You could just use a simple boolean in the main() routine to >> warn about multiple -k options (or just let the last -k option win and not >> bother with a warning). Thanks for review. I try to use more simplify, using existing srcdir variable, but in some places I get problem with full and relative paths, so I add different variable with full path to kernel source tree. >> >> > Index: mkoptions.c >> > =================================================================== >> > --- mkoptions.c (revision 206411) >> > +++ mkoptions.c (working copy) >> > @@ -294,7 +294,11 @@ read_options(void) >> > char genopt[MAXPATHLEN]; >> > >> > SLIST_INIT(&otab); >> > - (void) snprintf(fname, sizeof(fname), "../../conf/options"); >> > + if ( *ksrcdir != '\0' ) >> > + (void) snprintf(fname, sizeof(fname), "%s/conf/options", >> > + ksrcdir); >> > + else >> > + (void) snprintf(fname, sizeof(fname), "../../conf/options"); >> > openit: >> > fp = fopen(fname, "r"); >> > if (fp == 0) { >> > @@ -306,7 +310,12 @@ next: >> > (void) fclose(fp); >> > if (first == 1) { >> > first++; >> > - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", >> machinename); >> > + if ( *ksrcdir != '\0' ) >> > + (void) snprintf(fname, sizeof fname, >> > + "%s/conf/options.%s", ksrcdir, machinename); >> > + else >> > + (void) snprintf(fname, sizeof fname, >> > + "../../conf/options.%s", machinename); >> > fp = fopen(fname, "r"); >> > if (fp != 0) >> > goto next; >> > Index: main.c >> > =================================================================== >> > --- main.c (revision 206411) >> > +++ main.c (working copy) >> > @@ -72,6 +72,7 @@ static const char rcsid[] = >> > >> > char * PREFIX; >> > char destdir[MAXPATHLEN]; >> > +char ksrcdir[MAXPATHLEN]; >> > char srcdir[MAXPATHLEN]; >> > >> > int debugging; >> > @@ -110,8 +111,9 @@ main(int argc, char **argv) >> > char xxx[MAXPATHLEN]; >> > char *kernfile; >> > >> > + *ksrcdir = '\0'; >> > kernfile = NULL; >> > - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) >> > + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) >> > switch (ch) { >> > case 'C': >> > filebased = 1; >> > @@ -125,6 +127,12 @@ main(int argc, char **argv) >> > case 'g': >> > debugging++; >> > break; >> > + case 'k': >> > + if (*ksrcdir == '\0') >> > + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); >> > + else >> > + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); >> > + break; >> > case 'p': >> > profiling++; >> > break; >> > @@ -164,7 +172,8 @@ main(int argc, char **argv) >> > len = strlen(destdir); >> > while (len > 1 && destdir[len - 1] == '/') >> > destdir[--len] = '\0'; >> > - get_srcdir(); >> > + if (*ksrcdir == '\0') >> > + get_srcdir(); >> > } else { >> > strlcpy(destdir, CDIR, sizeof(destdir)); >> > strlcat(destdir, PREFIX, sizeof(destdir)); >> > @@ -210,11 +219,14 @@ main(int argc, char **argv) >> > * for "sys" (to make genassym.c work along with #include ) >> > * and similarly for "machine". >> > */ >> > - if (*srcdir == '\0') >> > - (void)snprintf(xxx, sizeof(xxx), "../../include"); >> > - else >> > + if (*ksrcdir != '\0') >> > (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + ksrcdir, machinename); >> > + else if (*srcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > srcdir, machinename); >> > + else >> > + (void)snprintf(xxx, sizeof(xxx), "../../include"); >> > (void) unlink(path("machine")); >> > (void) symlink(xxx, path("machine")); >> > if (strcmp(machinename, machinearch) != 0) { >> > @@ -222,12 +234,15 @@ main(int argc, char **argv) >> > * make symbolic links in compilation directory for >> > * machinearch, if it is different than machinename. >> > */ >> > - if (*srcdir == '\0') >> > + if (*ksrcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + ksrcdir, machinearch); >> > + else if (*srcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + srcdir, machinearch); >> > + else >> > (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", >> > machinearch); >> > - else >> > - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > - srcdir, machinearch); >> > (void) unlink(path(machinearch)); >> > (void) symlink(xxx, path(machinearch)); >> > } >> > @@ -278,7 +293,7 @@ static void >> > usage(void) >> > { >> > >> > - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); >> > + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] >> sysname\n"); >> > fprintf(stderr, " config -x kernel\n"); >> > exit(EX_USAGE); >> > } >> > Index: mkmakefile.c >> > =================================================================== >> > --- mkmakefile.c (revision 206411) >> > +++ mkmakefile.c (working copy) >> > @@ -116,7 +116,12 @@ makefile(void) >> > int versreq; >> > >> > read_files(); >> > - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); >> > + if (*ksrcdir != '\0') >> > + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", >> > + ksrcdir, machinename); >> > + else >> > + snprintf(line, sizeof(line), "../../conf/Makefile.%s", >> > + machinename); >> > ifp = fopen(line, "r"); >> > if (ifp == 0) { >> > snprintf(line, sizeof(line), "Makefile.%s", machinename); >> > @@ -139,7 +144,9 @@ makefile(void) >> > fprintf(ofp, "DEBUG=-g\n"); >> > if (profiling) >> > fprintf(ofp, "PROFLEVEL=%d\n", profiling); >> > - if (*srcdir != '\0') >> > + if (*ksrcdir != '\0') >> > + fprintf(ofp,"S=%s\n", ksrcdir); >> > + else if (*srcdir != '\0') >> > fprintf(ofp,"S=%s\n", srcdir); >> > while (fgets(line, BUFSIZ, ifp) != 0) { >> > if (*line != '%') { >> > @@ -347,7 +354,12 @@ next: >> > printf("%s: missing include filename.\n", fname); >> > exit(1); >> > } >> > - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(ifname, sizeof(ifname), "%s/%s", >> > + ksrcdir, wd); >> > + else >> > + (void) snprintf(ifname, sizeof(ifname), "../../%s", >> > + wd); >> > read_file(ifname); >> > while (((wd = get_word(fp)) != (char *)EOF) && wd) >> > ; >> > @@ -544,9 +556,17 @@ read_files(void) >> > char fname[MAXPATHLEN]; >> > struct files_name *nl, *tnl; >> > >> > - (void) snprintf(fname, sizeof(fname), "../../conf/files"); >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(fname, sizeof(fname), "%s/conf/files", >> > + ksrcdir); >> > + else >> > + (void) snprintf(fname, sizeof(fname), "../../conf/files"); >> > read_file(fname); >> > - (void) snprintf(fname, sizeof(fname), >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(fname, sizeof(fname), >> > + "%s/conf/files.%s", ksrcdir, machinename); >> > + else >> > + (void) snprintf(fname, sizeof(fname), >> > "../../conf/files.%s", machinename); >> > read_file(fname); >> > for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { >> > Index: config.8 >> > =================================================================== >> > --- config.8 (revision 206411) >> > +++ config.8 (working copy) >> > @@ -38,6 +38,7 @@ >> > .Nm >> > .Op Fl CVgp >> > .Op Fl d Ar destdir >> > +.Op Fl k Ar ksrcdir >> > .Ar SYSTEM_NAME >> > .Nm >> > .Op Fl x Ar kernel >> > @@ -78,6 +79,10 @@ Note that >> > does not append >> > .Ar SYSTEM_NAME >> > to the directory given. >> > +.It Fl k Ar ksrcdir >> > +Use >> > +.Ar ksrcdir >> > +as the kernel source tree directory, instead of the default one. >> > .It Fl g >> > Configure a system for debugging. >> > .It Fl x Ar kernel >> > Index: config.h >> > =================================================================== >> > --- config.h (revision 206411) >> > +++ config.h (working copy) >> > @@ -196,6 +196,8 @@ extern int maxusers; >> > >> > extern char *PREFIX; /* Config file name - for error messages */ >> > extern char srcdir[]; /* root of the kernel source tree */ >> > +extern char ksrcdir[]; /* root of the kernel source tree >> > + * set by -k flag */ >> > >> > #define eq(a,b) (!strcmp(a,b)) >> > #define ns(s) strdup(s) >> > Index: lang.l >> > =================================================================== >> > --- lang.l (revision 206411) >> > +++ lang.l (working copy) >> > @@ -259,7 +259,10 @@ include(const char *fname, int ateof) >> > fnamebuf = NULL; >> > fp = fopen(fname, "r"); >> > if (fp == NULL && fname[0] != '.' && fname[0] != '/') { >> > - asprintf(&fnamebuf, "../../conf/%s", fname); >> > + if (*ksrcdir != '\0') >> > + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); >> > + else >> > + asprintf(&fnamebuf, "../../conf/%s", fname); >> > if (fnamebuf != NULL) { >> > fp = fopen(fnamebuf, "r"); >> > free(fnamebuf); >> > >> > >> > -- >> > Alexandr Rybalko >> > aka Alex RAY >> > _______________________________________________ >> > freebsd-hackers@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> > >> >> -- >> John Baldwin -- Alexandr Rybalko aka Alex RAY From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 14:32:24 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED3D0106564A for ; Wed, 14 Apr 2010 14:32:24 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7A08FC12 for ; Wed, 14 Apr 2010 14:32:24 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o3EDvuxt067902 for ; Wed, 14 Apr 2010 09:57:56 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201004141357.o3EDvuxt067902@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Wed, 14 Apr 2010 09:57:57 -0400 To: freebsd-hackers@freebsd.org From: Mike Tancsa Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 14:32:25 -0000 (Tried on questions, but no luck...) I have an embedded device (Alix box) that is running RELENG_8 off a CF that is designed to monitor / control a serial sensor device. The sensor is quite chatty and is always outputing data at 115200. The problem is that this will interrupt the boot process. I managed to get around boot0 by making this small hack (if there is a better way, please let me know. 0(ich10)# diff -u boot0.S.o boot0.S --- boot0.S.o 2010-04-13 15:11:22.000000000 -0400 +++ boot0.S 2010-04-13 15:27:02.000000000 -0400 @@ -356,7 +356,9 @@ */ #ifndef SIO movb $0x1,%ah # BIOS: Check - int $0x16 # for keypress + /* int $0x16 */ # for keypress + testb $0x02,%ah + #else /* SIO */ movb $0x03,%ah # BIOS: Read COM call bioscom @@ -538,7 +540,8 @@ pushw %bx # Save movw $0x7,%bx # Page:attribute movb $0xe,%ah # BIOS: Display - int $0x10 # character + /* int $0x10 # character */ + nop popw %bx # Restore #else /* SIO */ movb $0x01,%ah # BIOS: Send 1(ich10)# and I added in /boot/loader.conf console="nullconsole" I also tried # cat /boot.config -nmq But when I put an inline serial monitor to see why things are getting hung up, I still see the "spinning slashes" (/) show up. After that, it seems the boot process is hung and it never fully boots. There seems to be a window of opportunity where key presses on the serial console stop/pause one of the boot stages.. but boot.config should prevent that no ? I even tried to "fake" it out, but trying to make com2, the console in /boot/device.hints, but I still see the spinning slashes on com1 Is there any way to completely disable serial interaction and to truly make the bootup process quiet and non interactive ? ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:56:01 2010 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7603106566B; Wed, 14 Apr 2010 15:56:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6238FC19; Wed, 14 Apr 2010 15:56:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3EFngKM047052; Wed, 14 Apr 2010 09:49:42 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 14 Apr 2010 09:49:55 -0600 (MDT) Message-Id: <20100414.094955.505347165636258137.imp@bsdimp.com> To: jhb@FreeBSD.org, freebsd-hackers@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20100414164722.062cac6e.ray@dlink.ua> References: <20100414130353.c28d5128.ray@dlink.ua> <201004140906.28205.jhb@freebsd.org> <20100414164722.062cac6e.ray@dlink.ua> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Patch to config for compatibility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 15:56:01 -0000 I also have a patch to config. It lets you put a line of the form CONFIG_OLD_OPTION = CONFIG_NEW_OPTION in the options files. This is useful when optioning are changing and have a rather wide scope and need to be merged, as with the recent CONFIG_FREEBSD32 option. With this merged to stable, we can rename that without requiring config file tweaks on a stable branch. Comments? Warner Index: mkoptions.c =================================================================== --- mkoptions.c (revision 205300) +++ mkoptions.c (working copy) @@ -90,6 +90,17 @@ SLIST_INSERT_HEAD(&opt, op, op_next); read_options(); + SLIST_FOREACH(op, &opt, op_next) { + SLIST_FOREACH(ol, &otab, o_next) { + if (eq(op->op_name, ol->o_name) && + (ol->o_flags & OL_ALIAS)) { + printf("Mapping option %s to %s.\n", + op->op_name, ol->o_file); + op->op_name = ol->o_file; + break; + } + } + } SLIST_FOREACH(ol, &otab, o_next) do_option(ol->o_name); SLIST_FOREACH(op, &opt, op_next) { @@ -120,7 +131,6 @@ int tidy; file = tooption(name); - /* * Check to see if the option was specified.. */ @@ -284,6 +294,7 @@ struct opt_list *po; int first = 1; char genopt[MAXPATHLEN]; + int flags = 0; SLIST_INIT(&otab); (void) snprintf(fname, sizeof(fname), "../../conf/options"); @@ -293,6 +304,7 @@ return; } next: + flags = 0; wd = get_word(fp); if (wd == (char *)EOF) { (void) fclose(fp); @@ -324,6 +336,18 @@ (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s)); val = genopt; free(s); + } else if (eq(val, "=")) { + val = get_word(fp); + if (val == (char *)EOF) { + printf("%s: unexpected end of file\n", fname); + exit(1); + } + if (val == 0) { + printf("%s: Expected a right hand side at %s\n", fname, + this); + exit(1); + } + flags |= OL_ALIAS; } val = ns(val); @@ -338,6 +362,7 @@ po = (struct opt_list *) calloc(1, sizeof *po); po->o_name = this; po->o_file = val; + po->o_flags = flags; SLIST_INSERT_HEAD(&otab, po, o_next); goto next; Index: config.h =================================================================== --- config.h (revision 205300) +++ config.h (working copy) @@ -129,6 +129,8 @@ struct opt_list { char *o_name; char *o_file; + int o_flags; +#define OL_ALIAS 1 SLIST_ENTRY(opt_list) o_next; }; From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 15:56:16 2010 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 114B71065672; Wed, 14 Apr 2010 15:56:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B0A298FC19; Wed, 14 Apr 2010 15:56:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3EFjNwW047018; Wed, 14 Apr 2010 09:45:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 14 Apr 2010 09:45:36 -0600 (MDT) Message-Id: <20100414.094536.918765004165097153.imp@bsdimp.com> To: ray@dlink.ua From: "M. Warner Losh" In-Reply-To: <20100414130353.c28d5128.ray@dlink.ua> References: <20100414130353.c28d5128.ray@dlink.ua> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: hackers@FreeBSD.org, embedded@FreeBSD.org Subject: Re: Patch for config utility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 15:56:16 -0000 Quick comment: Why not set srcdir instead of inventing ksrcdir? Warner In message: <20100414130353.c28d5128.ray@dlink.ua> Alexandr Rybalko writes: : Hi All, : : I made a patch for the config utility, which enables execution of config outside of the kernel source tree. : The main purpose is to avoid large number of configuration files for many boards. : I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel : config files. : If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), : every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf : directory of platform :) : : : Index: mkoptions.c : =================================================================== : --- mkoptions.c (revision 206411) : +++ mkoptions.c (working copy) : @@ -294,7 +294,11 @@ read_options(void) : char genopt[MAXPATHLEN]; : : SLIST_INIT(&otab); : - (void) snprintf(fname, sizeof(fname), "../../conf/options"); : + if ( *ksrcdir != '\0' ) : + (void) snprintf(fname, sizeof(fname), "%s/conf/options", : + ksrcdir); : + else : + (void) snprintf(fname, sizeof(fname), "../../conf/options"); : openit: : fp = fopen(fname, "r"); : if (fp == 0) { : @@ -306,7 +310,12 @@ next: : (void) fclose(fp); : if (first == 1) { : first++; : - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); : + if ( *ksrcdir != '\0' ) : + (void) snprintf(fname, sizeof fname, : + "%s/conf/options.%s", ksrcdir, machinename); : + else : + (void) snprintf(fname, sizeof fname, : + "../../conf/options.%s", machinename); : fp = fopen(fname, "r"); : if (fp != 0) : goto next; : Index: main.c : =================================================================== : --- main.c (revision 206411) : +++ main.c (working copy) : @@ -72,6 +72,7 @@ static const char rcsid[] = : : char * PREFIX; : char destdir[MAXPATHLEN]; : +char ksrcdir[MAXPATHLEN]; : char srcdir[MAXPATHLEN]; : : int debugging; : @@ -110,8 +111,9 @@ main(int argc, char **argv) : char xxx[MAXPATHLEN]; : char *kernfile; : : + *ksrcdir = '\0'; : kernfile = NULL; : - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) : + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) : switch (ch) { : case 'C': : filebased = 1; : @@ -125,6 +127,12 @@ main(int argc, char **argv) : case 'g': : debugging++; : break; : + case 'k': : + if (*ksrcdir == '\0') : + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); : + else : + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); : + break; : case 'p': : profiling++; : break; : @@ -164,7 +172,8 @@ main(int argc, char **argv) : len = strlen(destdir); : while (len > 1 && destdir[len - 1] == '/') : destdir[--len] = '\0'; : - get_srcdir(); : + if (*ksrcdir == '\0') : + get_srcdir(); : } else { : strlcpy(destdir, CDIR, sizeof(destdir)); : strlcat(destdir, PREFIX, sizeof(destdir)); : @@ -210,11 +219,14 @@ main(int argc, char **argv) : * for "sys" (to make genassym.c work along with #include ) : * and similarly for "machine". : */ : - if (*srcdir == '\0') : - (void)snprintf(xxx, sizeof(xxx), "../../include"); : - else : + if (*ksrcdir != '\0') : (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + ksrcdir, machinename); : + else if (*srcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : srcdir, machinename); : + else : + (void)snprintf(xxx, sizeof(xxx), "../../include"); : (void) unlink(path("machine")); : (void) symlink(xxx, path("machine")); : if (strcmp(machinename, machinearch) != 0) { : @@ -222,12 +234,15 @@ main(int argc, char **argv) : * make symbolic links in compilation directory for : * machinearch, if it is different than machinename. : */ : - if (*srcdir == '\0') : + if (*ksrcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + ksrcdir, machinearch); : + else if (*srcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + srcdir, machinearch); : + else : (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", : machinearch); : - else : - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : - srcdir, machinearch); : (void) unlink(path(machinearch)); : (void) symlink(xxx, path(machinearch)); : } : @@ -278,7 +293,7 @@ static void : usage(void) : { : : - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); : + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); : fprintf(stderr, " config -x kernel\n"); : exit(EX_USAGE); : } : Index: mkmakefile.c : =================================================================== : --- mkmakefile.c (revision 206411) : +++ mkmakefile.c (working copy) : @@ -116,7 +116,12 @@ makefile(void) : int versreq; : : read_files(); : - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); : + if (*ksrcdir != '\0') : + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", : + ksrcdir, machinename); : + else : + snprintf(line, sizeof(line), "../../conf/Makefile.%s", : + machinename); : ifp = fopen(line, "r"); : if (ifp == 0) { : snprintf(line, sizeof(line), "Makefile.%s", machinename); : @@ -139,7 +144,9 @@ makefile(void) : fprintf(ofp, "DEBUG=-g\n"); : if (profiling) : fprintf(ofp, "PROFLEVEL=%d\n", profiling); : - if (*srcdir != '\0') : + if (*ksrcdir != '\0') : + fprintf(ofp,"S=%s\n", ksrcdir); : + else if (*srcdir != '\0') : fprintf(ofp,"S=%s\n", srcdir); : while (fgets(line, BUFSIZ, ifp) != 0) { : if (*line != '%') { : @@ -347,7 +354,12 @@ next: : printf("%s: missing include filename.\n", fname); : exit(1); : } : - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); : + if (*ksrcdir != '\0') : + (void) snprintf(ifname, sizeof(ifname), "%s/%s", : + ksrcdir, wd); : + else : + (void) snprintf(ifname, sizeof(ifname), "../../%s", : + wd); : read_file(ifname); : while (((wd = get_word(fp)) != (char *)EOF) && wd) : ; : @@ -544,9 +556,17 @@ read_files(void) : char fname[MAXPATHLEN]; : struct files_name *nl, *tnl; : : - (void) snprintf(fname, sizeof(fname), "../../conf/files"); : + if (*ksrcdir != '\0') : + (void) snprintf(fname, sizeof(fname), "%s/conf/files", : + ksrcdir); : + else : + (void) snprintf(fname, sizeof(fname), "../../conf/files"); : read_file(fname); : - (void) snprintf(fname, sizeof(fname), : + if (*ksrcdir != '\0') : + (void) snprintf(fname, sizeof(fname), : + "%s/conf/files.%s", ksrcdir, machinename); : + else : + (void) snprintf(fname, sizeof(fname), : "../../conf/files.%s", machinename); : read_file(fname); : for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { : Index: config.8 : =================================================================== : --- config.8 (revision 206411) : +++ config.8 (working copy) : @@ -38,6 +38,7 @@ : .Nm : .Op Fl CVgp : .Op Fl d Ar destdir : +.Op Fl k Ar ksrcdir : .Ar SYSTEM_NAME : .Nm : .Op Fl x Ar kernel : @@ -78,6 +79,10 @@ Note that : does not append : .Ar SYSTEM_NAME : to the directory given. : +.It Fl k Ar ksrcdir : +Use : +.Ar ksrcdir : +as the kernel source tree directory, instead of the default one. : .It Fl g : Configure a system for debugging. : .It Fl x Ar kernel : Index: config.h : =================================================================== : --- config.h (revision 206411) : +++ config.h (working copy) : @@ -196,6 +196,8 @@ extern int maxusers; : : extern char *PREFIX; /* Config file name - for error messages */ : extern char srcdir[]; /* root of the kernel source tree */ : +extern char ksrcdir[]; /* root of the kernel source tree : + * set by -k flag */ : : #define eq(a,b) (!strcmp(a,b)) : #define ns(s) strdup(s) : Index: lang.l : =================================================================== : --- lang.l (revision 206411) : +++ lang.l (working copy) : @@ -259,7 +259,10 @@ include(const char *fname, int ateof) : fnamebuf = NULL; : fp = fopen(fname, "r"); : if (fp == NULL && fname[0] != '.' && fname[0] != '/') { : - asprintf(&fnamebuf, "../../conf/%s", fname); : + if (*ksrcdir != '\0') : + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); : + else : + asprintf(&fnamebuf, "../../conf/%s", fname); : if (fnamebuf != NULL) { : fp = fopen(fnamebuf, "r"); : free(fnamebuf); : : : -- : Alexandr Rybalko : aka Alex RAY : _______________________________________________ : freebsd-embedded@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-embedded : To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" : : From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 16:23:19 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB4B1065670 for ; Wed, 14 Apr 2010 16:23:19 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id E416D8FC18 for ; Wed, 14 Apr 2010 16:23:18 +0000 (UTC) Received: by bwz6 with SMTP id 6so310735bwz.13 for ; Wed, 14 Apr 2010 09:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=t7BIR1wQBPBh7I+UbW/C6UeG0SWDQMDyYfsYdLoej7Q=; b=v3M6WLXioo3dqTLJYhGDblWOqZyCDCqsowZsfxHM/5taKhKJuHwD7SULNlFaTcBw2f gKB2KOVk6KG8egxF7wrtSrYjpRqg9PiUdhCoEUJG8mLsohlzS392FE+aSzZ5OiFxm7tg trgYhEWXx1w7zq9VBtdWoSdaEI65+o9Te4HX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kl/t2RFMGS9zQpGqWZwyZkNoZZ4gSDsCWXtaYL0c/LNj1/ClKh3Izl1xTAR2IAZCl3 0TF6SIHTLNhIT67lUZwQxq7Tcmi9Stn8GknURHX4QF8uhFFhw6dj+2uNLaf2efE/epZX GA7y5jSwswpNpuWGOkUDikOjArg/HOOXV9/mE= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 09:23:16 -0700 (PDT) Date: Wed, 14 Apr 2010 12:23:16 -0400 Received: by 10.204.151.83 with SMTP id b19mr8302565bkw.54.1271262196820; Wed, 14 Apr 2010 09:23:16 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 16:23:19 -0000 hello all fbsd devs i want to know if there is a possibility to avoid current strict libraries linking .. i will explain myself for example .. i have installed 'gtk' (2.18) that depends on library 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not be upgraded, so it will still depending on 'libpng.so.5' .. so here is my question: there is a way to avoid this?????? i means that 'gtk' load 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of 'libpng.so.5' at runtime i think this is a VERY VERY strict rule because in linux programs load 'lib*.so' instead 'lib*.so.#' except if that program was linked to 'lib*.so.#' at compilation time From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 16:44:35 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E469C1065673 for ; Wed, 14 Apr 2010 16:44:35 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 724AE8FC1C for ; Wed, 14 Apr 2010 16:44:35 +0000 (UTC) Received: by bwz6 with SMTP id 6so332696bwz.13 for ; Wed, 14 Apr 2010 09:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=KsLPpoH9YrFYNE1Xe4q42aqM8MHfN8K5DTOuliqOL28=; b=VmDd+1J8WZBD0xyI6e9JnyPDrC96AACZ5dou14D0PeZx+azD4KqUF+RdBGT7SW05Ke BYMIR3UyOOZDQIOtBmCWyRlF88YmZjVtBV2v5C2TmCry91KIUWgiv0mak7+IcyjsKX0W UQ9jT+WYy0pihbPXr2cZbVYDAxACLsd7MwTdo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=c6xtubl2Nn7lfcronvfM/bOckvy++KjC/xSBvJKbE3+ivR9L3/6mkgXDoxhY7XSYJb fvnQa7AzpDGGammRTLMaBJwFtlPVWLD4KknLNcMX52jHm86+Bf1jVnduvPyqjh+tDqKJ hS0ISlJw99MkyfFK9NniJyEgtYm1r4Dy3yZuY= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 09:44:32 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Apr 2010 12:44:32 -0400 Received: by 10.204.6.73 with SMTP id 9mr5424927bky.143.1271263473274; Wed, 14 Apr 2010 09:44:33 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 16:44:36 -0000 On Wed, Apr 14, 2010 at 12:32 PM, Tom Evans wrote: > On Wed, Apr 14, 2010 at 5:23 PM, Leinier Cruz Salfran > wrote: >> hello all fbsd devs >> >> i want to know if there is a possibility to avoid current strict >> libraries linking .. i will explain myself >> >> for example .. i have installed 'gtk' (2.18) that depends on library >> 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior >> version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not >> be upgraded, so it will still depending on 'libpng.so.5' .. so here is >> my question: there is a way to avoid this?????? i means that 'gtk' >> load 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of >> 'libpng.so.5' at runtime >> > > The reason the library version is bumped is to avoid loading > libpng.so.6 into a process looking for libpng.so.5. If you want to try > it, you can use /etc/libmap.conf to map requests for libpng.so.5 into > libpng.so.6 (and watch your apps crash instead of not running). > > > Tom > hello tom we should keep in mind that new versions of libraries are built with previous versions compatibility in order to avoid 'crashing' .. i put the 'gtk' example because i upgrade my system yesterday and I got that situation .. I started to imagine what could happen if I restart 'gdm' at that moment .. and I think that 'gdm' will not start because 'gtk' will not find 'libpng.so.5' .. so I do the following: create a symbolic link: 'libpng.so.5' -> 'libpng.so.6' .. restart 'gdm' and all was fine what do you think about that ps: clic in 'reply to all' in order to reply to 'freebsd-hacker' list too, please (thanks) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 16:46:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EC131065677 for ; Wed, 14 Apr 2010 16:46:13 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id D0E6C8FC18 for ; Wed, 14 Apr 2010 16:46:12 +0000 (UTC) Received: by bwz6 with SMTP id 6so334419bwz.13 for ; Wed, 14 Apr 2010 09:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Ee0XJYyjv7Y39VuzukShBAfCJWdH4mAdWmsrGsfJbiI=; b=XEONZBymQVOqX2ggAWoY79WEVIm4YNAWJlwEIqKkxdLV8GFfD0FkFUQ1BfXRl5l9MC OxLXioe86+dGZB1o69oIR1zyaNMc0nNydXN9dmDsMX8hH5Yy8LfumRui8weJv5+bc5AV Zkvkw61xk6UeUTzEBaw3cf+FQLUc81eppDx1Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=X/cp5eHJ27mqz3Br0JCRs7ZhHleDkz++KZADkgjJtcBD06Z3YdHnWqFxaj4L8R5k0Y SAXX78jrCRVm8ECp0mEqOo0uLkReuq4OAsKGM+8F76od/AlrWqatxiTKjfGnYdGlEANO kxvx6h1/llh4fxpUJ1UlsqQ+p3pdXzhOO92V0= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 09:46:11 -0700 (PDT) In-Reply-To: <20100414184254.63d0cdf9@ernst.jennejohn.org> References: <20100414184254.63d0cdf9@ernst.jennejohn.org> Date: Wed, 14 Apr 2010 12:46:11 -0400 Received: by 10.204.7.194 with SMTP id e2mr4146557bke.103.1271263571618; Wed, 14 Apr 2010 09:46:11 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 16:46:13 -0000 On Wed, Apr 14, 2010 at 12:42 PM, Gary Jennejohn wrote: > On Wed, 14 Apr 2010 12:23:16 -0400 > Leinier Cruz Salfran wrote: > >> hello all fbsd devs >> >> i want to know if there is a possibility to avoid current strict >> libraries linking .. i will explain myself >> >> for example .. i have installed 'gtk' (2.18) that depends on library >> 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior >> version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not >> be upgraded, so it will still depending on 'libpng.so.5' .. so here is >> my question: there is a way to avoid this?????? i means that 'gtk' >> load 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of >> 'libpng.so.5' at runtime >> > > You might be able to do this with /etc/libmap.conf. =C2=A0See the man pag= e > for libmap.conf(5). > > -- > Gary Jennejohn > hello and thanks gary .. I forgot 'libmap.conf' .. that could be a nice sol= ution From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 17:08:26 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4A93106564A for ; Wed, 14 Apr 2010 17:08:26 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 51EE68FC21 for ; Wed, 14 Apr 2010 17:08:25 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id d26so54372eyd.9 for ; Wed, 14 Apr 2010 10:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=NMkGqKEmmZzBy5raVN1pilPy/y2Nrf++glemTPVugy0=; b=A7en5rFnAoI4ij/0u/y0zNk75H2vEsVHVERII8apn+1JyBvxWIyaPwtCylAcsevjxQ CvHZ2Qza1KaG4XT6TkuqY4vbF/814XR7M1E1LvbzCx0744ZQzGNZBhRNGEClJA7qg/wk 9sIdkhHwD6JaQZ484UA9CcDt1dOba9rG33QhA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=eB36PsUlxleme9miqneMTIrpheVenp6KOvWPQ1C4AuO+tCbSB9qppo5fx0zX2/QZWw ZAkhK8pJET+v2ejNh3hISIwHtWpAHhJRm2z2YiGkAAkfxhim7ZfKyBjO4f00Rrqj3hQm cpXebMESrzbo/wWQhelNKgP3zcxWdDiIi+G0c= Received: by 10.103.3.17 with SMTP id f17mr4332570mui.123.1271263377871; Wed, 14 Apr 2010 09:42:57 -0700 (PDT) Received: from ernst.jennejohn.org (p57AE0031.dip0.t-ipconnect.de [87.174.0.49]) by mx.google.com with ESMTPS id e9sm3168660muf.10.2010.04.14.09.42.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 09:42:57 -0700 (PDT) Date: Wed, 14 Apr 2010 18:42:54 +0200 From: Gary Jennejohn To: Leinier Cruz Salfran Message-ID: <20100414184254.63d0cdf9@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 14 Apr 2010 17:14:24 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 17:08:26 -0000 On Wed, 14 Apr 2010 12:23:16 -0400 Leinier Cruz Salfran wrote: > hello all fbsd devs > > i want to know if there is a possibility to avoid current strict > libraries linking .. i will explain myself > > for example .. i have installed 'gtk' (2.18) that depends on library > 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior > version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not > be upgraded, so it will still depending on 'libpng.so.5' .. so here is > my question: there is a way to avoid this?????? i means that 'gtk' > load 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of > 'libpng.so.5' at runtime > > i think this is a VERY VERY strict rule because in linux programs load > 'lib*.so' instead 'lib*.so.#' except if that program was linked to > 'lib*.so.#' at compilation time > You might be able to do this with /etc/libmap.conf. See the man page for libmap.conf(5). -- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 17:48:55 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 027891065672 for ; Wed, 14 Apr 2010 17:48:55 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id BBDD28FC0A for ; Wed, 14 Apr 2010 17:48:54 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o3EHmr2G024660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 14 Apr 2010 12:48:53 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o3EHmrTb017313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 14 Apr 2010 12:48:53 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o3EHmrYS017312; Wed, 14 Apr 2010 12:48:53 -0500 (CDT) (envelope-from dan) Date: Wed, 14 Apr 2010 12:48:53 -0500 From: Dan Nelson To: Leinier Cruz Salfran Message-ID: <20100414174853.GC43908@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 8.0-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Wed, 14 Apr 2010 12:48:53 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-hackers@freebsd.org Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 17:48:55 -0000 In the last episode (Apr 14), Leinier Cruz Salfran said: > i want to know if there is a possibility to avoid current strict libraries > linking .. i will explain myself > > for example .. i have installed 'gtk' (2.18) that depends on library > 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior > version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not be > upgraded, so it will still depending on 'libpng.so.5' .. so here is my > question: there is a way to avoid this?????? i means that 'gtk' load > 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of > 'libpng.so.5' at runtime The whole reason for a library version bump is because the libraries are not compatible with each other, usually due to a function being removed or its argument list changing, or a structure changing size. Symlinking one version onto another version might work, but only if the application doesn't use any of the removed or changed functions. http://article.gmane.org/gmane.comp.graphics.png.devel/3283 It's much safer to just leave the libraries alone. Just because you upgraded libpng doesn't mean that your old gtk binary will stop working (assuming you are using "portupgrade" or "portmaster -w" which preserves old libraries of course). Anyway, the FreeBSD port maintainers usually bump the revision of dependant ports when a major library like libpng gets upgraded, to force everyone to upgrade anything that depends on it. > i think this is a VERY VERY strict rule because in linux programs load > 'lib*.so' instead 'lib*.so.#' except if that program was linked to > 'lib*.so.#' at compilation time no, the rule is the same in Linux. Programs load "lib*.so.#" there also: (dan@linuxbox) ~># ldd /usr/bin/rrdtool linux-vdso.so.1 => (0x00007fff4f9ff000) librrd.so.2 => /usr/lib64/librrd.so.2 (0x00007fa047716000) libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fa04759b000) libpng.so.3 => /usr/lib64/libpng.so.3 (0x00007fa04745f000) libz.so.1 => /lib64/libz.so.1 (0x00007fa04734b000) libart_lgpl_2.so.2 => /usr/lib64/libart_lgpl_2.so.2 (0x00007fa047234000) libm.so.6 => /lib64/libm.so.6 (0x00007fa0470df000) libc.so.6 => /lib64/libc.so.6 (0x00007fa046e9f000) /lib64/ld-linux-x86-64.so.2 (0x00007fa04785e000) -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 18:18:49 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E1B1106566B for ; Wed, 14 Apr 2010 18:18:49 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3458FC1A for ; Wed, 14 Apr 2010 18:18:45 +0000 (UTC) Received: by bwz6 with SMTP id 6so430992bwz.13 for ; Wed, 14 Apr 2010 11:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=SxscQqdVgCvyzCPnhWtVcEDD+r9Ojrcdg35eAqz6giU=; b=axfcxfxX9ryferv+/swrCQSPgB/9JM2xZElMCLcbVDJ6ZBeWMXqr2lyOTx0fUPIgAc a3Sd8OXnOx5UzELQcS2A9BAdCsxOv9ti2Qz0julaRcaX6x0aV3NpMRIQknZwFVDpMxWl qbkzSqe2sF9/w0FksoL/TA1tNKrsRJPyurSPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=v+Vlsglh6NduLfKn2037NL/c/ZjpEdXWRi36yPT5X6wl6UoO0B3krG/JQf/cHoE1Mh 7yL+NW1WTvPSxUV30u5jSGsKzJNoNtafnr7ZMafBv+wnImvNbhfUXbrtEJWCje+pmiR7 ZMUsVmdiKz2eIoq4rEo+vwB87aofOkMsYejT8= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 11:18:40 -0700 (PDT) In-Reply-To: <20100414174853.GC43908@dan.emsphone.com> References: <20100414174853.GC43908@dan.emsphone.com> Date: Wed, 14 Apr 2010 14:18:40 -0400 Received: by 10.204.6.73 with SMTP id 9mr5580115bky.143.1271269120622; Wed, 14 Apr 2010 11:18:40 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:18:49 -0000 On Wed, Apr 14, 2010 at 1:48 PM, Dan Nelson wrote= : > In the last episode (Apr 14), Leinier Cruz Salfran said: >> i want to know if there is a possibility to avoid current strict librari= es >> linking .. =C2=A0i will explain myself >> >> for example .. i have installed 'gtk' (2.18) that depends on library >> 'libpng.so.5' (png) .. =C2=A0and i will upgrade 'png' port to a superior >> version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not b= e >> upgraded, so it will still depending on 'libpng.so.5' .. =C2=A0so here i= s my >> question: there is a way to avoid this?????? =C2=A0i means that 'gtk' lo= ad >> 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of >> 'libpng.so.5' at runtime > > The whole reason for a library version bump is because the libraries are = not > compatible with each other, usually due to a function being removed or it= s > argument list changing, or a structure changing size. =C2=A0Symlinking on= e > version onto another version might work, but only if the application does= n't > use any of the removed or changed functions. > http://article.gmane.org/gmane.comp.graphics.png.devel/3283 > as I said: almost all new versions of libraries (those that developer knows what he/she is doing) maintain functions that are compatible with previous versions functions .. that's why gtk continue (right now) working on my box > It's much safer to just leave the libraries alone. agree >=C2=A0Just because you > upgraded libpng doesn't mean that your old gtk binary will stop working I disagree .. I have a program that depends on 'libpng.so.5' .. I tried to execute it after upgrade 'png' and it don't started becase the system lacks 'libpng.so.5' I solved the situation RECOMPILING the program .. doing that the program linked against NEW 'libpng.so.6' and when I tried to execute it once again it works fine > Anyway, the FreeBSD port maintainers usually bump the > revision of dependant ports when a major library like libpng gets upgrade= d, > to force everyone to upgrade anything that depends on it. > mmm .. I think it's not true because I maintain a port and i'm VERY VERY restricted to update the port because I depends on a mentor that will ONLY update the port in fbsd svn tree if I sent to him the tinderbox log of the sucessfully build of the port .. so I have not much patience to do all this things so I update the port and do ALL task including constructing the package into tinderbox ONLY when a new version of the program is available .. and I think that exists a lot of ports maintainers that are in same situation do you agree with me that it's difficult to a port maintainer to update his/her port because of this restriction???? could be a good idea to plan and implement a system to allow fbsd ports maintainers to maintain easyly the own ports via web or mail ONCE a fbsd mentor have uploaded his/her port to fbsd svn tree????????????? >> i think this is a VERY VERY strict rule because in linux programs load >> 'lib*.so' instead 'lib*.so.#' except if that program was linked to >> 'lib*.so.#' at compilation time > > no, the rule is the same in Linux. =C2=A0Programs load "lib*.so.#" there = also: > > (dan@linuxbox) ~># ldd /usr/bin/rrdtool > =C2=A0 =C2=A0 =C2=A0 =C2=A0linux-vdso.so.1 =3D> =C2=A0(0x00007fff4f9ff000= ) > =C2=A0 =C2=A0 =C2=A0 =C2=A0librrd.so.2 =3D> /usr/lib64/librrd.so.2 (0x000= 07fa047716000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libfreetype.so.6 =3D> /usr/lib64/libfreetype.s= o.6 (0x00007fa04759b000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libpng.so.3 =3D> /usr/lib64/libpng.so.3 (0x000= 07fa04745f000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libz.so.1 =3D> /lib64/libz.so.1 (0x00007fa0473= 4b000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libart_lgpl_2.so.2 =3D> /usr/lib64/libart_lgpl= _2.so.2 (0x00007fa047234000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libm.so.6 =3D> /lib64/libm.so.6 (0x00007fa0470= df000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0libc.so.6 =3D> /lib64/libc.so.6 (0x00007fa046e= 9f000) > =C2=A0 =C2=A0 =C2=A0 =C2=A0/lib64/ld-linux-x86-64.so.2 (0x00007fa04785e00= 0) > > -- > =C2=A0 =C2=A0 =C2=A0 =C2=A0Dan Nelson > =C2=A0 =C2=A0 =C2=A0 =C2=A0dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 18:45:08 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070951065677 for ; Wed, 14 Apr 2010 18:45:08 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 86BA18FC16 for ; Wed, 14 Apr 2010 18:45:07 +0000 (UTC) Received: by bwz6 with SMTP id 6so458999bwz.13 for ; Wed, 14 Apr 2010 11:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=9Er8uEuAiYT3SMyzOY5sJamgleVy5KbOy93t0X7mXfo=; b=T1/HOgQEbD6ll4uqNoqXzAOJwz1QG0Egl3q5aQ9ZZbiLEt26G1ez+FGb2Yo9ZzvVa5 DAyd+2Zs/IVqbN+p1Xn3URwU9X/FLXe7OW1rVuVjp8eqwh7SJ03DBu2FpnHbgTQzGl9O GYBEdFTqNmikC2DydkwI9nIgY8mUyl/dxyf6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Ju3JjPpqeRy4y8PB9rmHRs1r0g2KM7FRDDwqAHAB/JA+xDtpTtsZT7dZ8w771baGSQ W4mCyxUIGnepxwK4XePZmYLk5/vsItGahy2dZvpaHCTKrEpXjznLTNdSTKef0shSRIai 31lOWmzu102tXakCElukJiJH4wYuozWW1t67o= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 11:45:06 -0700 (PDT) In-Reply-To: <20100414141759.085aec63@bhuda.mired.org> References: <20100414141759.085aec63@bhuda.mired.org> Date: Wed, 14 Apr 2010 14:45:06 -0400 Received: by 10.204.36.208 with SMTP id u16mr2504600bkd.168.1271270706157; Wed, 14 Apr 2010 11:45:06 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:45:08 -0000 On Wed, Apr 14, 2010 at 2:17 PM, Mike Meyer wrote: > On Wed, 14 Apr 2010 12:44:32 -0400 > Leinier Cruz Salfran wrote: > >> On Wed, Apr 14, 2010 at 12:32 PM, Tom Evans wrote: >> > On Wed, Apr 14, 2010 at 5:23 PM, Leinier Cruz Salfran >> > wrote: >> >> hello all fbsd devs >> >> >> >> i want to know if there is a possibility to avoid current strict >> >> libraries linking .. i will explain myself >> >> >> >> for example .. i have installed 'gtk' (2.18) that depends on library >> >> 'libpng.so.5' (png) .. and i will upgrade 'png' port to a superior >> >> version that install the library 'libpng.so.6' BUUUTTTT 'gtk' will not >> >> be upgraded, so it will still depending on 'libpng.so.5' .. so here is >> >> my question: there is a way to avoid this?????? i means that 'gtk' >> >> load 'libpng.so' (that is a symbolic link to 'libpng.so.6') instead of >> >> 'libpng.so.5' at runtime >> > >> > The reason the library version is bumped is to avoid loading >> > libpng.so.6 into a process looking for libpng.so.5. If you want to try >> > it, you can use /etc/libmap.conf to map requests for libpng.so.5 into >> > libpng.so.6 (and watch your apps crash instead of not running). >> >> we should keep in mind that new versions of libraries are built with >> previous versions compatibility in order to avoid 'crashing' > > That's a false generalization. While it may be true for most > libraries, it's definitely not true in all cases. you have right mike > Since I tend to do > upgrades wholesale, I only find the ones where the breakage is exposed > at the source level, so the last one I recall is when libgtkhtml > changed the underlying print engine, breaking anything that depended > on it for printing, like gnucash. > I want to share one thing: I restarted my box right now (since I upgraded my box I haven't restarted) and I saw one interesting thing: - before upgrade GIMP was able to load PNG files - after upgrade GIMP can't load PNG files - when I did the symbolic link GIMP was able to load PNG files ONCE AGAIN - I delete the symbolic link, then restarted my box AAANNNDDDD GIMP is able to load PNG files ONCE AGAIN there is happening something that I don't know yet???? somebody knows???? From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 18:50:36 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26A381065670 for ; Wed, 14 Apr 2010 18:50:36 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id EC6D18FC13 for ; Wed, 14 Apr 2010 18:50:35 +0000 (UTC) Received: by pwi9 with SMTP id 9so455189pwi.13 for ; Wed, 14 Apr 2010 11:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=SVuNtQP8SUDa2hdGeiN98gzqOh6eoLBpXgf/O5XMYBg=; b=hlwkPMw4KhXQLgpvX92/og8LunXyl1871CYch12vgqkGZPwhWMbqlIoy841a8fLrqV fgg9XZ78K2V15brqN2Be+691MZTJyf5hlsb3WC9P3rUNBxtAaQqi4wogXJkFzUqMgG9j No4wPfW2WkJkJG1yVlBCRLmRH68/7ZkvKObyg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UxJ3fYstzCW5XP9BMtyFifSH8iN/mZQBKJhyyDjTCER8EU6NGsgwNb+tO5D7reBcrs pFnNY7KrQUUT0fhcpCZCaEemchwrxYleXLK+B0wqY3cKzg/jTbjrdlAroB0mZMDCOF9f hybOb1qSpEYYlcMvYViWvC6TBoH2cWZZw5CKQ= MIME-Version: 1.0 Received: by 10.231.14.76 with HTTP; Wed, 14 Apr 2010 11:50:35 -0700 (PDT) In-Reply-To: References: <20100414174853.GC43908@dan.emsphone.com> Date: Wed, 14 Apr 2010 11:50:35 -0700 Received: by 10.140.247.5 with SMTP id u5mr7799799rvh.62.1271271035414; Wed, 14 Apr 2010 11:50:35 -0700 (PDT) Message-ID: From: Freddie Cash To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 18:50:36 -0000 On Wed, Apr 14, 2010 at 11:18 AM, Leinier Cruz Salfran < salfrancl.listas@gmail.com> wrote: > On Wed, Apr 14, 2010 at 1:48 PM, Dan Nelson > wrote:> Just because you > > Anyway, the FreeBSD port maintainers usually bump the > > revision of dependant ports when a major library like libpng gets > upgraded, > > to force everyone to upgrade anything that depends on it. > > > > mmm .. I think it's not true because I maintain a port and i'm VERY > VERY restricted to update the port because I depends on a mentor that > will ONLY update the port in fbsd svn tree if I sent to him the > tinderbox log of the sucessfully build of the port .. so I have not > much patience to do all this things so I update the port and do ALL > task including constructing the package into tinderbox ONLY when a new > version of the program is available .. and I think that exists a lot > of ports maintainers that are in same situation > > do you agree with me that it's difficult to a port maintainer to > update his/her port because of this restriction???? > The port maintainer doesn't *have to* update anything. When library ports go through a library bump like this, all the ports that depend on it get an automatic PORTREVISION bump. All the port maintainer has to do is double-check that the port compiles with the new version of the lib. Only if there are issues with that (which usually get picked up by the -exp runs on the ports cluster), then the port maintainer has to step in and fix things. 9 times out of 10, a port maintainer doesn't have to do anything with a port until a new version of the app is released. > could be a good idea to plan and implement a system to allow fbsd > ports maintainers to maintain easyly the own ports via web or mail > ONCE a fbsd mentor have uploaded his/her port to fbsd svn > tree???????????? > In several years of port maintainership, I've never had a need for anything like this. A new version of an app I maintain is released, I update the port locally, test it, submit a PR with the update, someone looks at it and sends back suggestions/issues, the port is fixed locally and patches re-submitted to the PR, and then the port is committed to the tree. Overall, not a long process. If you maintain enough ports for enough time, and generate enough committed PRs to annoy people enough, you get rewarded with a commit bit. :) -- Freddie Cash fjwcash@gmail.com From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 19:02:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68CB1065679 for ; Wed, 14 Apr 2010 19:02:01 +0000 (UTC) (envelope-from salfrancl.listas@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 70C8C8FC1F for ; Wed, 14 Apr 2010 19:02:01 +0000 (UTC) Received: by mail-bw0-f214.google.com with SMTP id 6so476738bwz.13 for ; Wed, 14 Apr 2010 12:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2/p57Oj9DLwbZNkjcXUEbfRYQoe7jZaxA5uVqIsRRos=; b=BwRmW38tnBaYpx5clVct3+2mPtt+22M7v/Cxq/tbN7mzyEwcskcI0jCOTnEc06UY4z +OyGr/Sxlj9i7SNfxd58MnI/wPDuZpNuNRACkDkR4jgYANZHoBD0F35rTT1SZa6sM9Hc vFSEAHtWXVoJjRpDP8PcRS0AjJVmWDsk2llaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wka5+JnutAbaHYipQ2Q55JZNFMZjTMfVPTtRDokYHuY8cU6Dv0AFuZ7qKuWG86KqsQ AfXWtpW0OdeUxn2NnZnik5JAqru2jhjUhEacXiCde65CYGOX0Tw8z4kA3iHk82+8GMIQ W+sG6ZkoQhAeU4e1JuQ1C0TdrO8SSNwxMGKKI= MIME-Version: 1.0 Received: by 10.204.122.74 with HTTP; Wed, 14 Apr 2010 12:02:00 -0700 (PDT) In-Reply-To: References: <20100414174853.GC43908@dan.emsphone.com> Date: Wed, 14 Apr 2010 15:02:00 -0400 Received: by 10.204.142.207 with SMTP id r15mr301269bku.134.1271271720648; Wed, 14 Apr 2010 12:02:00 -0700 (PDT) Message-ID: From: Leinier Cruz Salfran To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:02:02 -0000 On Wed, Apr 14, 2010 at 2:50 PM, Freddie Cash wrote: > On Wed, Apr 14, 2010 at 11:18 AM, Leinier Cruz Salfran < > salfrancl.listas@gmail.com> wrote: > >> On Wed, Apr 14, 2010 at 1:48 PM, Dan Nelson >> wrote:> Just because you >> > Anyway, the FreeBSD port maintainers usually bump the >> > revision of dependant ports when a major library like libpng gets >> upgraded, >> > to force everyone to upgrade anything that depends on it. >> > >> >> mmm .. I think it's not true because I maintain a port and i'm VERY >> VERY restricted to update the port because I depends on a mentor that >> will ONLY update the port in fbsd svn tree if I sent to him the >> tinderbox log of the sucessfully build of the port .. so I have not >> much patience to do all this things so I update the port and do ALL >> task including constructing the package into tinderbox ONLY when a new >> version of the program is available .. and I think that exists a lot >> of ports maintainers that are in same situation >> >> do you agree with me that it's difficult to a port maintainer to >> update his/her port because of this restriction???? >> > > The port maintainer doesn't *have to* update anything. =C2=A0When library= ports > go through a library bump like this, all the ports that depend on it get = an > automatic PORTREVISION bump. > okey maybe i didn't understood the 'bump' means .. I must to thank you because of comment about this subject > All the port maintainer has to do is double-check that the port compiles > with the new version of the lib. =C2=A0Only if there are issues with that= (which > usually get picked up by the -exp runs on the ports cluster), then the po= rt > maintainer has to step in and fix things. > okey let me see if I understood you .. you mean that I create a 'ONE_PORT' to a specific program version and if one of the library on which the 'ONE_PORT' depends change to a major version, then the 'ports cluster' put add PORTREVISION to the 'ONE_PORT' and update the *_DEPENDS automatically???????? > 9 times out of 10, a port maintainer doesn't have to do anything with a p= ort > until a new version of the app is released. > okey okey do not repeat again .. I read 9 times out of 10 ;) > >> could be a good idea to plan and implement a system to allow fbsd >> ports maintainers to maintain easyly the own ports via web or mail >> ONCE a fbsd mentor have uploaded his/her port to fbsd svn >> tree???????????? >> > > In several years of port maintainership, I've never had a need for anythi= ng > like this. =C2=A0A new version of an app I maintain is released, I update= the > port locally, test it, submit a PR with the update, someone looks at it a= nd > sends back suggestions/issues, the port is fixed locally and patches > re-submitted to the PR, and then the port is committed to the tree. > =C2=A0Overall, not a long process. > > If you maintain enough ports for enough time, and generate enough committ= ed > PRs to annoy people enough, you get rewarded with a commit bit. =C2=A0:) > oohh .. thanks for the tip :) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 19:09:22 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511341065678 for ; Wed, 14 Apr 2010 19:09:22 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 068078FC16 for ; Wed, 14 Apr 2010 19:09:21 +0000 (UTC) Received: by gyh20 with SMTP id 20so214355gyh.13 for ; Wed, 14 Apr 2010 12:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=+0jxQ4MxYPxa40AHws0rBxjI1s5yLQTr/7Lb4gKqmyg=; b=nvyGrA850fp/sBXylTm/FPTykEr7vLtTmS4BWBrnxgGuQM1uZ17qmObbZQQjN9LFo5 en+tzVHiZKAd87ht1/u7y1QCA6EH6LQJlg9OFDEn4jHgKnULVZDbTWFBiRUTcjxE9G1f /RsDu8bylA9C3XS3/otvvGXw6Y6y5WHwgAje0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jER6R5xbZdZngRtDdqfA0jRy2vjPndgLCRbUB/nkGz9xkA5opO5SWzfZXCDKX/xlce PRJT3Wa9La+SnLTnvk728gXoGTDsfBGlV8C7VFA9nwsox8vA92ELdb/O77J+HpooczeC meoOc9YJBrfHCMk8FWDU738xnyKdqwe9IcHzk= MIME-Version: 1.0 Received: by 10.231.14.76 with HTTP; Wed, 14 Apr 2010 12:09:20 -0700 (PDT) In-Reply-To: References: <20100414174853.GC43908@dan.emsphone.com> Date: Wed, 14 Apr 2010 12:09:20 -0700 Received: by 10.231.159.198 with SMTP id k6mr3450219ibx.92.1271272161091; Wed, 14 Apr 2010 12:09:21 -0700 (PDT) Message-ID: From: Freddie Cash To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: there is a way to avoid strict libraries linking? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:09:22 -0000 On Wed, Apr 14, 2010 at 12:02 PM, Leinier Cruz Salfran < salfrancl.listas@gmail.com> wrote: > On Wed, Apr 14, 2010 at 2:50 PM, Freddie Cash wrote: > > The port maintainer doesn't *have to* update anything. When library > ports > > go through a library bump like this, all the ports that depend on it get > an > > automatic PORTREVISION bump. > > okey maybe i didn't understood the 'bump' means .. I must to thank you > because of comment about this subject > > > All the port maintainer has to do is double-check that the port compiles > > with the new version of the lib. Only if there are issues with that > (which > > usually get picked up by the -exp runs on the ports cluster), then the > port > > maintainer has to step in and fix things. > > okey let me see if I understood you .. you mean that I create a > 'ONE_PORT' to a specific program version and if one of the library on > which the 'ONE_PORT' depends change to a major version, then the > 'ports cluster' put add PORTREVISION to the 'ONE_PORT' and update the > *_DEPENDS automatically???????? Correct. The PORTVERSION doesn't change. But PORTREVISION gets bumped up by 1. That way, when user's check for updates in the ports tree, via "pkg_version -vl '<'" or "portversion -v" or similar tools, then ONE_PORT will be listed as "update available" like so (not exact syntax, going from memory): one_port-1.0.0 <= needs update (port has one_port-1.0.0_1) The _1 part is PORTREVISION. It's used to say "the version hasn't changed, but something in the ports tree requires this to be re-installed or 'upgraded'". Maybe an OPTIONS line was added, or a dependent library version changed, or a build dependency changed, or a new RC script was added, or something like that. There's some good examples/explanations of PORTREVISION in the FreeBSD Porter's Handbook. -- Freddie Cash fjwcash@gmail.com From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 19:56:48 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61201106564A; Wed, 14 Apr 2010 19:56:48 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id AC09F8FC22; Wed, 14 Apr 2010 19:56:47 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so179939fge.13 for ; Wed, 14 Apr 2010 12:56:46 -0700 (PDT) Received: by 10.86.6.39 with SMTP id 39mr6329437fgf.4.1271275006382; Wed, 14 Apr 2010 12:56:46 -0700 (PDT) Received: from localhost (246-58-132-95.pool.ukrtel.net [95.132.58.246]) by mx.google.com with ESMTPS id e11sm126862fga.18.2010.04.14.12.56.43 (version=SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 12:56:44 -0700 (PDT) Date: Wed, 14 Apr 2010 22:56:13 +0300 From: Alex RAY To: "M. Warner Losh" Message-Id: <20100414225613.99ceff5d.ray@ddteam.net> In-Reply-To: <20100414.094536.918765004165097153.imp@bsdimp.com> References: <20100414130353.c28d5128.ray@dlink.ua> <20100414.094536.918765004165097153.imp@bsdimp.com> Organization: DDTeam.net X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ray@dlink.ua, hackers@FreeBSD.org, embedded@FreeBSD.org Subject: Re: Patch for config utility X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:56:48 -0000 Thanks for On Wed, 14 Apr 2010 09:45:36 -0600 (MDT) "M. Warner Losh" wrote: > Quick comment: Why not set srcdir instead of inventing ksrcdir? I've tried to use a variable srcdir, but found several points where need to change relative to absolute paths. Because I tried to minimize the impact on the behavior of utilities and tried to make the code of changes easier to read, then decided to make a separate variable. > > Warner > > In message: <20100414130353.c28d5128.ray@dlink.ua> > Alexandr Rybalko writes: > : Hi All, > : > : I made a patch for the config utility, which enables execution of config outside of the kernel source tree. > : The main purpose is to avoid large number of configuration files for many boards. > : I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel > : config files. > : If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), > : every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf > : directory of platform :) > : > : > : Index: mkoptions.c > : =================================================================== > : --- mkoptions.c (revision 206411) > : +++ mkoptions.c (working copy) > : @@ -294,7 +294,11 @@ read_options(void) > : char genopt[MAXPATHLEN]; > : > : SLIST_INIT(&otab); > : - (void) snprintf(fname, sizeof(fname), "../../conf/options"); > : + if ( *ksrcdir != '\0' ) > : + (void) snprintf(fname, sizeof(fname), "%s/conf/options", > : + ksrcdir); > : + else > : + (void) snprintf(fname, sizeof(fname), "../../conf/options"); > : openit: > : fp = fopen(fname, "r"); > : if (fp == 0) { > : @@ -306,7 +310,12 @@ next: > : (void) fclose(fp); > : if (first == 1) { > : first++; > : - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); > : + if ( *ksrcdir != '\0' ) > : + (void) snprintf(fname, sizeof fname, > : + "%s/conf/options.%s", ksrcdir, machinename); > : + else > : + (void) snprintf(fname, sizeof fname, > : + "../../conf/options.%s", machinename); > : fp = fopen(fname, "r"); > : if (fp != 0) > : goto next; > : Index: main.c > : =================================================================== > : --- main.c (revision 206411) > : +++ main.c (working copy) > : @@ -72,6 +72,7 @@ static const char rcsid[] = > : > : char * PREFIX; > : char destdir[MAXPATHLEN]; > : +char ksrcdir[MAXPATHLEN]; > : char srcdir[MAXPATHLEN]; > : > : int debugging; > : @@ -110,8 +111,9 @@ main(int argc, char **argv) > : char xxx[MAXPATHLEN]; > : char *kernfile; > : > : + *ksrcdir = '\0'; > : kernfile = NULL; > : - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) > : + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) > : switch (ch) { > : case 'C': > : filebased = 1; > : @@ -125,6 +127,12 @@ main(int argc, char **argv) > : case 'g': > : debugging++; > : break; > : + case 'k': > : + if (*ksrcdir == '\0') > : + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); > : + else > : + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); > : + break; > : case 'p': > : profiling++; > : break; > : @@ -164,7 +172,8 @@ main(int argc, char **argv) > : len = strlen(destdir); > : while (len > 1 && destdir[len - 1] == '/') > : destdir[--len] = '\0'; > : - get_srcdir(); > : + if (*ksrcdir == '\0') > : + get_srcdir(); > : } else { > : strlcpy(destdir, CDIR, sizeof(destdir)); > : strlcat(destdir, PREFIX, sizeof(destdir)); > : @@ -210,11 +219,14 @@ main(int argc, char **argv) > : * for "sys" (to make genassym.c work along with #include ) > : * and similarly for "machine". > : */ > : - if (*srcdir == '\0') > : - (void)snprintf(xxx, sizeof(xxx), "../../include"); > : - else > : + if (*ksrcdir != '\0') > : (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + ksrcdir, machinename); > : + else if (*srcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : srcdir, machinename); > : + else > : + (void)snprintf(xxx, sizeof(xxx), "../../include"); > : (void) unlink(path("machine")); > : (void) symlink(xxx, path("machine")); > : if (strcmp(machinename, machinearch) != 0) { > : @@ -222,12 +234,15 @@ main(int argc, char **argv) > : * make symbolic links in compilation directory for > : * machinearch, if it is different than machinename. > : */ > : - if (*srcdir == '\0') > : + if (*ksrcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + ksrcdir, machinearch); > : + else if (*srcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + srcdir, machinearch); > : + else > : (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", > : machinearch); > : - else > : - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : - srcdir, machinearch); > : (void) unlink(path(machinearch)); > : (void) symlink(xxx, path(machinearch)); > : } > : @@ -278,7 +293,7 @@ static void > : usage(void) > : { > : > : - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); > : + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); > : fprintf(stderr, " config -x kernel\n"); > : exit(EX_USAGE); > : } > : Index: mkmakefile.c > : =================================================================== > : --- mkmakefile.c (revision 206411) > : +++ mkmakefile.c (working copy) > : @@ -116,7 +116,12 @@ makefile(void) > : int versreq; > : > : read_files(); > : - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); > : + if (*ksrcdir != '\0') > : + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", > : + ksrcdir, machinename); > : + else > : + snprintf(line, sizeof(line), "../../conf/Makefile.%s", > : + machinename); > : ifp = fopen(line, "r"); > : if (ifp == 0) { > : snprintf(line, sizeof(line), "Makefile.%s", machinename); > : @@ -139,7 +144,9 @@ makefile(void) > : fprintf(ofp, "DEBUG=-g\n"); > : if (profiling) > : fprintf(ofp, "PROFLEVEL=%d\n", profiling); > : - if (*srcdir != '\0') > : + if (*ksrcdir != '\0') > : + fprintf(ofp,"S=%s\n", ksrcdir); > : + else if (*srcdir != '\0') > : fprintf(ofp,"S=%s\n", srcdir); > : while (fgets(line, BUFSIZ, ifp) != 0) { > : if (*line != '%') { > : @@ -347,7 +354,12 @@ next: > : printf("%s: missing include filename.\n", fname); > : exit(1); > : } > : - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); > : + if (*ksrcdir != '\0') > : + (void) snprintf(ifname, sizeof(ifname), "%s/%s", > : + ksrcdir, wd); > : + else > : + (void) snprintf(ifname, sizeof(ifname), "../../%s", > : + wd); > : read_file(ifname); > : while (((wd = get_word(fp)) != (char *)EOF) && wd) > : ; > : @@ -544,9 +556,17 @@ read_files(void) > : char fname[MAXPATHLEN]; > : struct files_name *nl, *tnl; > : > : - (void) snprintf(fname, sizeof(fname), "../../conf/files"); > : + if (*ksrcdir != '\0') > : + (void) snprintf(fname, sizeof(fname), "%s/conf/files", > : + ksrcdir); > : + else > : + (void) snprintf(fname, sizeof(fname), "../../conf/files"); > : read_file(fname); > : - (void) snprintf(fname, sizeof(fname), > : + if (*ksrcdir != '\0') > : + (void) snprintf(fname, sizeof(fname), > : + "%s/conf/files.%s", ksrcdir, machinename); > : + else > : + (void) snprintf(fname, sizeof(fname), > : "../../conf/files.%s", machinename); > : read_file(fname); > : for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { > : Index: config.8 > : =================================================================== > : --- config.8 (revision 206411) > : +++ config.8 (working copy) > : @@ -38,6 +38,7 @@ > : .Nm > : .Op Fl CVgp > : .Op Fl d Ar destdir > : +.Op Fl k Ar ksrcdir > : .Ar SYSTEM_NAME > : .Nm > : .Op Fl x Ar kernel > : @@ -78,6 +79,10 @@ Note that > : does not append > : .Ar SYSTEM_NAME > : to the directory given. > : +.It Fl k Ar ksrcdir > : +Use > : +.Ar ksrcdir > : +as the kernel source tree directory, instead of the default one. > : .It Fl g > : Configure a system for debugging. > : .It Fl x Ar kernel > : Index: config.h > : =================================================================== > : --- config.h (revision 206411) > : +++ config.h (working copy) > : @@ -196,6 +196,8 @@ extern int maxusers; > : > : extern char *PREFIX; /* Config file name - for error messages */ > : extern char srcdir[]; /* root of the kernel source tree */ > : +extern char ksrcdir[]; /* root of the kernel source tree > : + * set by -k flag */ > : > : #define eq(a,b) (!strcmp(a,b)) > : #define ns(s) strdup(s) > : Index: lang.l > : =================================================================== > : --- lang.l (revision 206411) > : +++ lang.l (working copy) > : @@ -259,7 +259,10 @@ include(const char *fname, int ateof) > : fnamebuf = NULL; > : fp = fopen(fname, "r"); > : if (fp == NULL && fname[0] != '.' && fname[0] != '/') { > : - asprintf(&fnamebuf, "../../conf/%s", fname); > : + if (*ksrcdir != '\0') > : + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); > : + else > : + asprintf(&fnamebuf, "../../conf/%s", fname); > : if (fnamebuf != NULL) { > : fp = fopen(fnamebuf, "r"); > : free(fnamebuf); > : > : > : -- > : Alexandr Rybalko > : aka Alex RAY > : _______________________________________________ > : freebsd-embedded@freebsd.org mailing list > : http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > : To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" > : > : -- Alex RAY From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 20:22:57 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83C21106564A for ; Wed, 14 Apr 2010 20:22:57 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5A98FC1D for ; Wed, 14 Apr 2010 20:22:56 +0000 (UTC) Received: by ewy24 with SMTP id 24so272296ewy.33 for ; Wed, 14 Apr 2010 13:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=rJcubCDcBakpgxYoBNlrHRaTtO4OeLv3X/1GFbxCo3Y=; b=RD5EdcTbwerVL78Yyi/QiIMOD/ifJu68qnG9oKh1ii1HhAy6cDxcZOU71uenq+5Nga +o5OhbCK4wux2G50n/T1xxqRVw3VMJdFMtoxVkf3DAN2/1DJvqA4s8xohJA30vC6g0qQ XsKMl4K4WAGZBcijBL2KCvHNYBbbY2Yw53LdA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rbF9pJtxJAfbiu9+WH8/qOpij7NLtpwxeeL+073XXUuYh/sb4PW0qf852r5f8Y6rhm e1UMBNbwBzChHdRSR62yvo7+mectjTg9gVlQ7E3oJRbppH44ANjq5a9Kpwbs2XzVdIde I/6AbtH0phOZC+7TJDZ8SsYuO8ApuwKTiRHKk= MIME-Version: 1.0 Received: by 10.213.9.134 with HTTP; Wed, 14 Apr 2010 13:22:56 -0700 (PDT) Date: Wed, 14 Apr 2010 22:22:56 +0200 Received: by 10.213.65.202 with SMTP id k10mr4363547ebi.63.1271276576056; Wed, 14 Apr 2010 13:22:56 -0700 (PDT) Message-ID: From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: FreeBSD Hackers Content-Type: text/plain; charset=ISO-8859-1 Subject: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:22:57 -0000 Hi all, I'm trying to read process memory other than the current process in kernel. I was told to use the proc_rwmem function, however I can't get it working properly. At first, I'm trying to read how many elements the environment variables vector has. To do this I tried this from a linprocfs filler function: struct iovec iov; struct uio tmp_uio; struct ps_strings *pss; int ret_code; buff = malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK); memset(buff, 0, sizeof(struct ps_strings)); PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); iov.iov_base = (caddr_t) buff; iov.iov_len = sizeof(struct ps_strings); tmp_uio.uio_iov = &iov; tmp_uio.uio_iovcnt = 1; tmp_uio.uio_offset = (off_t)(p->p_sysent->sv_psstrings); tmp_uio.uio_resid = sizeof(struct ps_strings); tmp_uio.uio_segflg = UIO_USERSPACE; tmp_uio.uio_rw = UIO_READ; tmp_uio.uio_td = td; ret_code = proc_rwmem(td->td_proc, &tmp_uio); if (ret_code == 0) { sbuf_printf(sb, "proc_rwmem successfully executed: %d\n", ret_code); } else { sbuf_printf(sb, "Error in proc_rwmem: %d\n", ret_code); } pss = (struct ps_strings *)(iov.iov_base); sbuf_printf(sb, "ps_nargvstr = %d\nps_nenvstr = %d\n", pss->ps_nargvstr, pss->ps_nenvstr); free(buff, M_TEMP); Considering I left security and error handling aside, what is wrong with the code above? proc_rwmem returns 0 indicating no failure, but when I try to print the result, I get random stuff. I thought maybe the problem is in the uio_offset field, but p->p_sysent->sv_psstrings is a vm_offset_t. Is the offset properly specified? If not, what else could be the problem? Thanks in advance. PS: I posted a similar question at forums.freebsd.org but got no answer, that is why I ask here. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 21:22:23 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E3431065674 for ; Wed, 14 Apr 2010 21:22:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F3BAF8FC15 for ; Wed, 14 Apr 2010 21:22:22 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A71F546B99; Wed, 14 Apr 2010 17:22:22 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E89D78A025; Wed, 14 Apr 2010 17:22:21 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 14 Apr 2010 17:18:05 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> In-Reply-To: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004141718.05534.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 14 Apr 2010 17:22:21 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Sam Robb Subject: Re: Going from struct disk to a fh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:22:23 -0000 On Wednesday 14 April 2010 9:08:50 am Sam Robb wrote: > In the kernel, given a struct disk, is there a way to turn that into something that can be used to read/write from the disk? Or is my best bet in this situation to figure out the device path for the disk, and just use kern_open() to access it? You can use dp->d_geom as the target of a bio via GEOM I think. However, I don't have experience with sending bio's to a specific GEOM directly. File systems usually use geom_vfs to feed requests from bread(), etc. to a mounted disk device using a devfs vnode for the associated disk device. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 21:22:24 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7837C1065670 for ; Wed, 14 Apr 2010 21:22:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 48C1F8FC1B for ; Wed, 14 Apr 2010 21:22:24 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id F025546B8B; Wed, 14 Apr 2010 17:22:23 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 4B2328A01F; Wed, 14 Apr 2010 17:22:23 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 14 Apr 2010 17:21:00 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201004141721.00254.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 14 Apr 2010 17:22:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Fernando =?iso-8859-1?q?Apestegu=EDa?= Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:22:24 -0000 On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu=EDa wrote: > Hi all, >=20 > I'm trying to read process memory other than the current process in > kernel. I was told to use the proc_rwmem function, however I can't get > it working properly. At first, I'm trying to read how many elements > the environment variables vector has. To do this I tried this from a > linprocfs filler function: >=20 >=20 > struct iovec iov; > struct uio tmp_uio; > struct ps_strings *pss; > int ret_code; >=20 > buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK); > memset(buff, 0, sizeof(struct ps_strings)); >=20 > PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); > iov.iov_base =3D (caddr_t) buff; > iov.iov_len =3D sizeof(struct ps_strings); > tmp_uio.uio_iov =3D &iov; > tmp_uio.uio_iovcnt =3D 1; > tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings); > tmp_uio.uio_resid =3D sizeof(struct ps_strings); > tmp_uio.uio_segflg =3D UIO_USERSPACE; > tmp_uio.uio_rw =3D UIO_READ; > tmp_uio.uio_td =3D td; > ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); I think you want to use 'p' instead of 'td->td_proc' here. As it is you ar= e=20 reading from the current process instead of the target process I believe. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 14 21:35:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC485106566B; Wed, 14 Apr 2010 21:35:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 42E308FC14; Wed, 14 Apr 2010 21:35:51 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3ELZlMp069372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 00:35:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3ELZlQt004109; Thu, 15 Apr 2010 00:35:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3ELZlvn004108; Thu, 15 Apr 2010 00:35:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 15 Apr 2010 00:35:47 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20100414213547.GY2415@deviant.kiev.zoral.com.ua> References: <201004141721.00254.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yU7+DNvIsw2sWoF2" Content-Disposition: inline In-Reply-To: <201004141721.00254.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Fernando Apestegu?a Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:35:52 -0000 --yU7+DNvIsw2sWoF2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 14, 2010 at 05:21:00PM -0400, John Baldwin wrote: > On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu?a wrote: > > Hi all, > >=20 > > I'm trying to read process memory other than the current process in > > kernel. I was told to use the proc_rwmem function, however I can't get > > it working properly. At first, I'm trying to read how many elements > > the environment variables vector has. To do this I tried this from a > > linprocfs filler function: > >=20 > >=20 > > struct iovec iov; > > struct uio tmp_uio; > > struct ps_strings *pss; > > int ret_code; > >=20 > > buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK); > > memset(buff, 0, sizeof(struct ps_strings)); > >=20 > > PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); > > iov.iov_base =3D (caddr_t) buff; > > iov.iov_len =3D sizeof(struct ps_strings); > > tmp_uio.uio_iov =3D &iov; > > tmp_uio.uio_iovcnt =3D 1; > > tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings); > > tmp_uio.uio_resid =3D sizeof(struct ps_strings); > > tmp_uio.uio_segflg =3D UIO_USERSPACE; > > tmp_uio.uio_rw =3D UIO_READ; > > tmp_uio.uio_td =3D td; > > ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); >=20 > I think you want to use 'p' instead of 'td->td_proc' here. As it is you = are=20 > reading from the current process instead of the target process I believe. And UIO_USERSPACE sound suspicious. Note that segment flag is for the requestor address space. --yU7+DNvIsw2sWoF2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvGNTMACgkQC3+MBN1Mb4gxEACgq+kVWS7GxrzbgLDlTNgPl00K veAAn3/GlFs+mwAcrx1JQXs/2qKoeRSK =bUSc -----END PGP SIGNATURE----- --yU7+DNvIsw2sWoF2-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 04:13:20 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52535106564A for ; Thu, 15 Apr 2010 04:13:20 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (unknown [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 2F11E8FC0A for ; Thu, 15 Apr 2010 04:13:20 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id o3F4DJxU013332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 14 Apr 2010 21:13:19 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id o3F4DJIc013331; Wed, 14 Apr 2010 21:13:19 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA01894; Wed, 14 Apr 10 21:05:41 PDT Date: Wed, 14 Apr 2010 21:04:46 -0700 From: perryh@pluto.rain.com To: mike@sentex.net Message-Id: <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> In-Reply-To: <201004141357.o3EDvuxt067902@lava.sentex.ca> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 04:13:20 -0000 Mike Tancsa wrote: > I have an embedded device (Alix box) that is running RELENG_8 off > a CF that is designed to monitor / control a serial sensor device. > The sensor is quite chatty and is always outputing data at 115200. > The problem is that this will interrupt the boot process. > I even tried to "fake" it out, but trying to make com2, the console > in /boot/device.hints ... > > Is there any way to completely disable serial interaction and > to truly make the bootup process quiet and non interactive ? More of a workaround than a fix, but does it work any better if you connect the device to com2 instead of com1? From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 07:19:56 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDAB4106566B; Thu, 15 Apr 2010 07:19:56 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id 54F348FC1C; Thu, 15 Apr 2010 07:19:55 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id d26so81577eyd.9 for ; Thu, 15 Apr 2010 00:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=99ERwOgGYP0nYASYnycgYXo50qbDab5xjtN1jveBrLw=; b=C8yMVwK8mUEDbMZeEcIvxBNIA6iRrgYDd2wd2WVh/Q+kNMijwr60TFptVysSIj/Vwo 1RZcv48piaAbJFDpKo1B+gsBMYtAQBBOfzKAqNGpNapAsS+xWafNJN4Bjm3XrKQ2XNYE m2seO8h/f53KlI/tXE1jg1eYkINNKQoqUVB4g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=vdPIkSJDujHK5ddxz/rAV4/LpkJbbbiITtdd3N4Vil3fhIY0AADf4sVAh50xB6sHkc GBZS003BH+btDM71iWUKX/yicq1YZhRJTTclIjitBpMAdR0jnIvZj2A2dUVMGpps2uTh R07W2GF7NTzUiOEO4Q7on+iJo4Ixaboz1UT9s= MIME-Version: 1.0 Received: by 10.213.9.134 with HTTP; Thu, 15 Apr 2010 00:19:54 -0700 (PDT) In-Reply-To: <20100414213547.GY2415@deviant.kiev.zoral.com.ua> References: <201004141721.00254.jhb@freebsd.org> <20100414213547.GY2415@deviant.kiev.zoral.com.ua> Date: Thu, 15 Apr 2010 09:19:54 +0200 Received: by 10.213.42.73 with SMTP id r9mr4348892ebe.40.1271315994994; Thu, 15 Apr 2010 00:19:54 -0700 (PDT) Message-ID: From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 07:19:57 -0000 On Wed, Apr 14, 2010 at 11:35 PM, Kostik Belousov wro= te: > On Wed, Apr 14, 2010 at 05:21:00PM -0400, John Baldwin wrote: >> On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu?a wrote: >> > Hi all, >> > >> > I'm trying to read process memory other than the current process in >> > kernel. I was told to use the proc_rwmem function, however I can't get >> > it working properly. At first, I'm trying to read how many elements >> > the environment variables vector has. To do this I tried this from a >> > linprocfs filler function: >> > >> > >> > =A0 =A0 =A0 =A0 struct iovec iov; >> > =A0 =A0 struct uio tmp_uio; >> > =A0 =A0 struct ps_strings *pss; >> > =A0 =A0 int ret_code; >> > >> > =A0 =A0 buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK); >> > =A0 =A0 memset(buff, 0, sizeof(struct ps_strings)); >> > >> > =A0 =A0 PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); >> > =A0 =A0 iov.iov_base =3D (caddr_t) buff; >> > =A0 =A0 iov.iov_len =3D sizeof(struct ps_strings); >> > =A0 =A0 tmp_uio.uio_iov =3D &iov; >> > =A0 =A0 tmp_uio.uio_iovcnt =3D 1; >> > =A0 =A0 tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings); >> > =A0 =A0 tmp_uio.uio_resid =3D sizeof(struct ps_strings); >> > =A0 =A0 tmp_uio.uio_segflg =3D UIO_USERSPACE; >> > =A0 =A0 tmp_uio.uio_rw =3D UIO_READ; >> > =A0 =A0 tmp_uio.uio_td =3D td; >> > =A0 =A0 ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); >> >> I think you want to use 'p' instead of 'td->td_proc' here. =A0As it is y= ou are >> reading from the current process instead of the target process I believe= . > > And UIO_USERSPACE sound suspicious. Note that segment flag > is for the requestor address space. Ugh, sorry. Copy-paste error. Yes, that should be UIO_SYSSPACE. > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 10:03:10 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69FBB1065675 for ; Thu, 15 Apr 2010 10:03:10 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 2D5CD8FC1D for ; Thu, 15 Apr 2010 10:03:09 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o3FA3886074754; Thu, 15 Apr 2010 06:03:08 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201004151003.o3FA3886074754@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Thu, 15 Apr 2010 06:03:10 -0400 To: perryh@pluto.rain.com From: Mike Tancsa In-Reply-To: <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 10:03:10 -0000 At 12:04 AM 4/15/2010, perryh@pluto.rain.com wrote: >Mike Tancsa wrote: > > > I have an embedded device (Alix box) that is running RELENG_8 off > > a CF that is designed to monitor / control a serial sensor device. > > The sensor is quite chatty and is always outputing data at 115200. > > The problem is that this will interrupt the boot process. > > > I even tried to "fake" it out, but trying to make com2, the console > > in /boot/device.hints ... > > > > Is there any way to completely disable serial interaction and > > to truly make the bootup process quiet and non interactive ? > >More of a workaround than a fix, but does it work any better >if you connect the device to com2 instead of com1? Unfortunately there is only one serial port on the board we are using. ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 13:17:26 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE03D106566B; Thu, 15 Apr 2010 13:17:26 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id B1F218FC13; Thu, 15 Apr 2010 13:17:26 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 9CBEE7E84A; Thu, 15 Apr 2010 23:17:23 +1000 (EST) Message-ID: <4BC711DA.4080207@freebsd.org> Date: Thu, 15 Apr 2010 23:17:14 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rrs@freebsd.org, tuexen@freebsd.org Subject: A cookie for anyone who can solve this C/macro problem... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 13:17:27 -0000 Hi All, I've hit a road block that I'm hoping people with better C/macro fu can help me with. It also may be the case that what I'm trying to do can't be done, so I welcome alternative suggestions as well. The problem: I'm working on a KPI to modularise congestion control support in the kernel (overview of KPI is visible in [1]). So far, I've been focused solely on TCP, but I want to have the framework generalise to be able to share congestion control algorithms between other congestion aware transports e.g. SCTP, DCCP. To achieve this, I need to pass congestion control information into the hook functions in a protocol agnostic way. The current KPI passes the tcpcb ptr and this works nicely, but obviously doesn't help. The cleanest option as I see it is to embed a new CC specific struct in the appropriate TCP and SCTP structs, and pass this in to the KPI. I started down this road and quickly stopped - the amount of code churn this will cause in the TCP and SCTP stacks is to my mind far to intrusive, at least for an initial import of the framework. So the next idea I've been trying to prototype was to pass a union of the various protocol struct types into the KPI and then use macro magic to allow the CC algorithms to access commonly named variables across the different transport struct types. It would require vars to have the same name, which would still mean some code churn, but less than the first option. Here are the basic bits I'm currently working with: struct cc_var { uint16_t type; union { struct tcpcb *tcp; struct sctp_nets *sctp; } ccvc; }; All function ptrs in struct cc_algo [1] are modified to accept a "struct cc_var *ccv". In an algorithm implementation e.g. NewReno [2], I then want to be able to do things like this with the fictitious CCVC() macro: void newreno_ack_received(struct cc_var *ccv) { u_int cw = CCVC(ccv)->snd_cwnd; ... CCVC(ccv)->snd_cwnd = blah; } So far I haven't found a way to achieve the above, and the best I've come up (with help) is this: #define CCV_DO(ccv, what) \ ( \ (ccv)->type == IPPROTO_TCP ? (ccv)->ccvc.tcp->what : \ (ccv)->ccvc.sctp->what \ ) which can be used like this: void newreno_ack_received(struct cc_var *ccv) { u_int cw = CCV_DO(ccv, snd_cwnd); ... CCVC(ccv, snd_cwnd = blah); } Of course, this falls apart if you try do this for example: CCVC(ccv, snd_cwnd = min(blah, bleh)); So... I'm sure there are some good ideas out there and would really appreciate hearing about them. Cheers, Lawrence PS: Cookie will only be awarded after complete working solution has been demonstrated and verified in my development branch! [1] http://svn.freebsd.org/viewvc/base/projects/tcp_cc_head/sys/netinet/cc.h?view=markup [2] http://svn.freebsd.org/viewvc/base/projects/tcp_cc_head/sys/netinet/cc_newreno.c?view=markup From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 14:14:28 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB971065672; Thu, 15 Apr 2010 14:14:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC7D8FC21; Thu, 15 Apr 2010 14:14:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2F14746B3B; Thu, 15 Apr 2010 10:14:28 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 788EE8A01F; Thu, 15 Apr 2010 10:14:27 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 15 Apr 2010 10:14:17 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <4BC711DA.4080207@freebsd.org> In-Reply-To: <4BC711DA.4080207@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004151014.17405.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 15 Apr 2010 10:14:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Lawrence Stewart , tuexen@freebsd.org, rrs@freebsd.org Subject: Re: A cookie for anyone who can solve this C/macro problem... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 14:14:28 -0000 On Thursday 15 April 2010 9:17:14 am Lawrence Stewart wrote: > void > newreno_ack_received(struct cc_var *ccv) > { > u_int cw = CCV_DO(ccv, snd_cwnd); > ... > CCVC(ccv, snd_cwnd = blah); > } > > Of course, this falls apart if you try do this for example: > > CCVC(ccv, snd_cwnd = min(blah, bleh)); > > > So... I'm sure there are some good ideas out there and would really > appreciate hearing about them. If you want to go this route, you could use separate _SET and _GET macros ala PCPU_*(). Then you would end up with something like: u_int cw = CCV_GET(ccv, snd_cwnd); CCV_SET(ccv, snd_cwnd, min(blah, bleh)); -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 16:18:37 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1633106566B for ; Thu, 15 Apr 2010 16:18:37 +0000 (UTC) (envelope-from julianelischer@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 619EE8FC1B for ; Thu, 15 Apr 2010 16:18:37 +0000 (UTC) Received: by wwa36 with SMTP id 36so1024706wwa.13 for ; Thu, 15 Apr 2010 09:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=1vE4tO/DU12nDYwxhehhteiDgrqnyQFkZ+YO15g+jNk=; b=UPll18DF0/MqpcHhipnFEFdH/YrJrjOyPaGmK82XFEgiHaCeAP/cTduAIbCEGk/+oE yjJNZBFLMCO3buga6pOrmEKkw84dkYahGTehT2xWMDixgLl163Z87+qW0SlvPz+UCH/J YCv6wWS9mNEzTJwAvYALlHlf5QX+IaMY04deo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=jGlqqVL2Ic4MA60cU+nCUd0hGyS88rNnCZbDLduqomXLdw6Jrt7+AnHtX6Gp8L2e7K LHwuryVzjg7CDF7rpjtN/27nn4d+L6BAIRsTtVfF+Qw0606E7eXqQCGaz0PHGVkN0ZoA kSzUB6GxwuetlQnw4p5aEiNluC8wTjU4VFeDA= Received: by 10.216.87.147 with SMTP id y19mr296250wee.136.1271348315727; Thu, 15 Apr 2010 09:18:35 -0700 (PDT) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by mx.google.com with ESMTPS id x14sm12898733wbs.12.2010.04.15.09.18.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Apr 2010 09:18:33 -0700 (PDT) Sender: Julian Elischer Message-ID: <4BC73C56.4080105@elischer.org> Date: Thu, 15 Apr 2010 09:18:30 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Mike Tancsa References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> <201004151003.o3FA3886074754@lava.sentex.ca> In-Reply-To: <201004151003.o3FA3886074754@lava.sentex.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, perryh@pluto.rain.com Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:18:38 -0000 On 4/15/10 3:03 AM, Mike Tancsa wrote: > At 12:04 AM 4/15/2010, perryh@pluto.rain.com wrote: >> Mike Tancsa wrote: >> >> > I have an embedded device (Alix box) that is running RELENG_8 off >> > a CF that is designed to monitor / control a serial sensor device. >> > The sensor is quite chatty and is always outputing data at 115200. >> > The problem is that this will interrupt the boot process. >> >> > I even tried to "fake" it out, but trying to make com2, the console >> > in /boot/device.hints ... >> > >> > Is there any way to completely disable serial interaction and >> > to truly make the bootup process quiet and non interactive ? >> >> More of a workaround than a fix, but does it work any better >> if you connect the device to com2 instead of com1? > > > Unfortunately there is only one serial port on the board we are using. yes but can the bios map it to be com2? > > > ---Mike > > > -------------------------------------------------------------------- > Mike Tancsa, tel +1 519 651 3400 > Sentex Communications, mike@sentex.net > Providing Internet since 1994 www.sentex.net > Cambridge, Ontario Canada www.sentex.net/mike > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 17:23:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D9D6106566B for ; Thu, 15 Apr 2010 17:23:13 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB238FC1A for ; Thu, 15 Apr 2010 17:23:12 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o3FHN9Ei076949; Thu, 15 Apr 2010 13:23:10 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201004151723.o3FHN9Ei076949@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Thu, 15 Apr 2010 13:23:12 -0400 To: Julian Elischer From: Mike Tancsa In-Reply-To: <4BC73C56.4080105@elischer.org> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> <201004151003.o3FA3886074754@lava.sentex.ca> <4BC73C56.4080105@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-hackers@freebsd.org, perryh@pluto.rain.com Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:23:13 -0000 At 12:18 PM 4/15/2010, Julian Elischer wrote: >>>More of a workaround than a fix, but does it work any better >>>if you connect the device to com2 instead of com1? >> >> >>Unfortunately there is only one serial port on the board we are using. > >yes but can the bios map it to be com2? The BIOS (Alix) is very "helpful" in that anything that boot0 (and I think boot2) prints out, it just puts it out the one serial port. So even if I install boot0 and not boot0sio, I still get "stuff" on the one serial port. (Same with spinconsole from current) Similarly, I can compile a kernel sans uart and then load uart once things are fully booted. However, there is still output on the serial port (which I guess was destined for the console), so it does not seem to be an issue with FreeBSD's kernel as the input/output takes place prior to that. I can disable serial output in the BIOS, but the problem is sometimes that gets factory reset in the field... Also, we are doing a few hundred of these things so invariably a few will be missed etc. So I would rather have an extra layer of protection to deal with it at the OS layer, not to mention I dont want any output that confuses the device I am to monitor. ---Mike _______________________________________________ >>freebsd-hackers@freebsd.org mailing list >>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" ario Canada www.sentex.net/mike From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 17:24:30 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665FF10656F2 for ; Thu, 15 Apr 2010 17:24:30 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 927618FC18 for ; Thu, 15 Apr 2010 17:24:28 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o3FHOQbB076956; Thu, 15 Apr 2010 13:24:26 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201004151724.o3FHOQbB076956@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Thu, 15 Apr 2010 13:24:29 -0400 To: Rui Paulo , Julian Elischer From: Mike Tancsa In-Reply-To: <7C872B09-2644-42FB-969F-4FFA26FE6417@gmail.com> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> <201004151003.o3FA3886074754@lava.sentex.ca> <4BC73C56.4080105@elischer.org> <7C872B09-2644-42FB-969F-4FFA26FE6417@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-hackers@freebsd.org, perryh@pluto.rain.com Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:24:30 -0000 At 12:59 PM 4/15/2010, Rui Paulo wrote: >If not, maybe there's some way to do this by changing the hints file. Prior to /boot/loader running, is that even consulted ? ---Mike >Regards, >-- >Rui Paulo -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 17:37:08 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7321106564A for ; Thu, 15 Apr 2010 17:37:08 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 6D78B8FC19 for ; Thu, 15 Apr 2010 17:37:07 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3FHb566088684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Apr 2010 19:37:06 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3FHb0VV010570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 19:37:00 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3FHaxvc033650; Thu, 15 Apr 2010 19:36:59 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3FHaxio033649; Thu, 15 Apr 2010 19:36:59 +0200 (CEST) (envelope-from ticso) Date: Thu, 15 Apr 2010 19:36:59 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20100415173659.GB31933@cicely7.cicely.de> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004141357.o3EDvuxt067902@lava.sentex.ca> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:37:09 -0000 On Wed, Apr 14, 2010 at 09:57:57AM -0400, Mike Tancsa wrote: > (Tried on questions, but no luck...) > > > > I have an embedded device (Alix box) that is running RELENG_8 off a > CF that is designed to monitor / control a serial sensor device. The > sensor is quite chatty and is always outputing data at 115200. The > problem is that this will interrupt the boot process. Is the sensor prohibiting the use of USB RS232 in any way? -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 17:45:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96671106566B for ; Thu, 15 Apr 2010 17:45:41 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by mx1.freebsd.org (Postfix) with ESMTP id 588D48FC0C for ; Thu, 15 Apr 2010 17:45:41 +0000 (UTC) Received: from mdt-xp.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.14.3/8.14.3) with ESMTP id o3FHjXI2077062; Thu, 15 Apr 2010 13:45:33 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <201004151745.o3FHjXI2077062@lava.sentex.ca> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Thu, 15 Apr 2010 13:45:36 -0400 To: ticso@cicely.de From: Mike Tancsa In-Reply-To: <20100415173659.GB31933@cicely7.cicely.de> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <20100415173659.GB31933@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:45:41 -0000 At 01:36 PM 4/15/2010, Bernd Walter wrote: >Is the sensor prohibiting the use of USB RS232 in any way? Just our wallets :) Extra cost to include it and the case would need to change as well as its in an environment where it can get hit by water. ---Mike >-- >B.Walter http://www.bwct.de >Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 16:59:24 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B517B1065673 for ; Thu, 15 Apr 2010 16:59:24 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 3BBCE8FC0C for ; Thu, 15 Apr 2010 16:59:23 +0000 (UTC) Received: by bwz6 with SMTP id 6so1443005bwz.13 for ; Thu, 15 Apr 2010 09:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=U/CdocbqBJMz4Fa6H2qHVivWzAxPFEtH2L9UL/5wKtE=; b=ZrPNS8WSN8KK1p6AbcgyyhYatOfKMg9kAdSX2aRlWGPPOG49e6tWq0VGxPg2waPLbf jYkHLSIYjJpzXqZ/qleKaLHZHUZxQw7XdTZQaXXXYodOgfQ9P/mKhLIhfZIDaAutNIYn oZtQ9lrzqh7LdsnkuikFMNNXKF8u/butXR0Pw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=B2jtbC2mFOvN50ojifGz0MzHWkk06HYF5gPefKDBuw3FYIg3h91DgrOo8DUQMAd1J8 uFwfOpxSu5spc/laVq036eZQOGA/+luboobuKniQkF8abuwKbn/kaxiieTrFnkMgfX1j nbk7ROkMMkNYZ9DgLKjgoitJ3bZWOEHchXXg4= Received: by 10.102.236.19 with SMTP id j19mr238710muh.110.1271350763004; Thu, 15 Apr 2010 09:59:23 -0700 (PDT) Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id s10sm9142209mue.27.2010.04.15.09.59.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Apr 2010 09:59:20 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <4BC73C56.4080105@elischer.org> Date: Thu, 15 Apr 2010 17:59:18 +0100 Content-Transfer-Encoding: 7bit Message-Id: <7C872B09-2644-42FB-969F-4FFA26FE6417@gmail.com> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> <201004151003.o3FA3886074754@lava.sentex.ca> <4BC73C56.4080105@elischer.org> To: Julian Elischer X-Mailer: Apple Mail (2.1078) X-Mailman-Approved-At: Thu, 15 Apr 2010 18:09:34 +0000 Cc: freebsd-hackers@freebsd.org, perryh@pluto.rain.com, Mike Tancsa Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 16:59:24 -0000 On 15 Apr 2010, at 17:18, Julian Elischer wrote: > On 4/15/10 3:03 AM, Mike Tancsa wrote: >> At 12:04 AM 4/15/2010, perryh@pluto.rain.com wrote: >>> Mike Tancsa wrote: >>> >>> > I have an embedded device (Alix box) that is running RELENG_8 off >>> > a CF that is designed to monitor / control a serial sensor device. >>> > The sensor is quite chatty and is always outputing data at 115200. >>> > The problem is that this will interrupt the boot process. >>> >>> > I even tried to "fake" it out, but trying to make com2, the console >>> > in /boot/device.hints ... >>> > >>> > Is there any way to completely disable serial interaction and >>> > to truly make the bootup process quiet and non interactive ? >>> >>> More of a workaround than a fix, but does it work any better >>> if you connect the device to com2 instead of com1? >> >> >> Unfortunately there is only one serial port on the board we are using. > > yes but can the bios map it to be com2? If not, maybe there's some way to do this by changing the hints file. Regards, -- Rui Paulo From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 17:27:57 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678091065673 for ; Thu, 15 Apr 2010 17:27:57 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id E470C8FC19 for ; Thu, 15 Apr 2010 17:27:56 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so1599413fgb.13 for ; Thu, 15 Apr 2010 10:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=6uBO0NKA+KziwDNXw176cp+9+mPTNAsNl8V6CBed8T0=; b=rWJaR4CqYDTMdiwwU8diF0LSvxg5rdnaPbLh87IR2gEBJk9JULw8rq006ZC7Z/pRQy W7qlDq4YKqlM2qObw8/WJnRqdkKArG9QkOOgQLtWL//lL0DF0gwcHyE2YjMEgsykVpcr WFgWrB94uP1dkHblWhWQvNGMGKM3qDMQd1Gbw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=w9dbIK2B6TzABVo8FAM/+8/N4ob39rMXnRwngt7g0dpCxcAc/ANtDXUUaBpTGGtsYo Bl5RSaQFogXBqmu5SDoaK03oox2V2mJkCTBU3f67sA7VmhbSLaO/JdHsMct2KHKACYYg FOQDFYUst3nIHHupmfUBd2elZxyZS8QWA0Zq4= Received: by 10.223.17.150 with SMTP id s22mr165010faa.14.1271352475643; Thu, 15 Apr 2010 10:27:55 -0700 (PDT) Received: from [10.0.10.2] (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id 4sm1852658fge.18.2010.04.15.10.27.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Apr 2010 10:27:52 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201004151724.o3FHOQbB076956@lava.sentex.ca> Date: Thu, 15 Apr 2010 18:27:50 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <4bc6905e.9tkYBdShtBRdGu5Q%perryh@pluto.rain.com> <201004151003.o3FA3886074754@lava.sentex.ca> <4BC73C56.4080105@elischer.org> <7C872B09-2644-42FB-969F-4FFA26FE6417@gmail.com> <201004151724.o3FHOQbB076956@lava.sentex.ca> To: Mike Tancsa X-Mailer: Apple Mail (2.1078) X-Mailman-Approved-At: Thu, 15 Apr 2010 18:19:08 +0000 Cc: freebsd-hackers@freebsd.org, perryh@pluto.rain.com, Julian Elischer Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 17:27:57 -0000 On 15 Apr 2010, at 18:24, Mike Tancsa wrote: > At 12:59 PM 4/15/2010, Rui Paulo wrote: > >> If not, maybe there's some way to do this by changing the hints file. > > Prior to /boot/loader running, is that even consulted ? Right, I missed that... Regards, -- Rui Paulo From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 19:04:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBCD106564A for ; Thu, 15 Apr 2010 19:04:14 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 2AFED8FC08 for ; Thu, 15 Apr 2010 19:04:13 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3FJ4BXr098517 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Apr 2010 21:04:11 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3FJ45rk014139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 21:04:05 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3FJ45rW034021; Thu, 15 Apr 2010 21:04:05 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3FJ4535034020; Thu, 15 Apr 2010 21:04:05 +0200 (CEST) (envelope-from ticso) Date: Thu, 15 Apr 2010 21:04:05 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20100415190405.GC31933@cicely7.cicely.de> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <20100415173659.GB31933@cicely7.cicely.de> <201004151745.o3FHjXI2077062@lava.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004151745.o3FHjXI2077062@lava.sentex.ca> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 19:04:14 -0000 On Thu, Apr 15, 2010 at 01:45:36PM -0400, Mike Tancsa wrote: > At 01:36 PM 4/15/2010, Bernd Walter wrote: > > >Is the sensor prohibiting the use of USB RS232 in any way? > > Just our wallets :) Extra cost to include it and the case would need > to change as well as its in an environment where it can get hit by water. Ok - that's an understandable reason. The unfortunate thing is that the bootcode reacts on buffered input and the BIOS might already have buffered some bytes. This has nothing to do with FreeBSDs knowledge about comconsole because the BIOS translates it. IIRC the Soekris BIOS has an option to disable the SIO support, maybe your board has something similar. Otherwise this means you need to disable the bootcode (including boot0) to process any kind of input. This shouldn't be too hard to code since the code is well documented. It happens in at least boot0 and loader - the later likely can be handled by using a customized loader.rc script, which wraps to nullconsole. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 19:25:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7F5106568E for ; Thu, 15 Apr 2010 19:25:41 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id BC1CC8FC38 for ; Thu, 15 Apr 2010 19:25:40 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3FJPdFZ001187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Apr 2010 21:25:39 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3FJPPPo015011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 21:25:25 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3FJPOW8034115; Thu, 15 Apr 2010 21:25:24 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3FJPOPK034114; Thu, 15 Apr 2010 21:25:24 +0200 (CEST) (envelope-from ticso) Date: Thu, 15 Apr 2010 21:25:24 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20100415192524.GD31933@cicely7.cicely.de> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <20100415173659.GB31933@cicely7.cicely.de> <201004151745.o3FHjXI2077062@lava.sentex.ca> <20100415190405.GC31933@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100415190405.GC31933@cicely7.cicely.de> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 19:25:41 -0000 On Thu, Apr 15, 2010 at 09:04:05PM +0200, Bernd Walter wrote: > On Thu, Apr 15, 2010 at 01:45:36PM -0400, Mike Tancsa wrote: > > At 01:36 PM 4/15/2010, Bernd Walter wrote: > > > > >Is the sensor prohibiting the use of USB RS232 in any way? > > > > Just our wallets :) Extra cost to include it and the case would need > > to change as well as its in an environment where it can get hit by water. > > Ok - that's an understandable reason. > > The unfortunate thing is that the bootcode reacts on buffered input > and the BIOS might already have buffered some bytes. > This has nothing to do with FreeBSDs knowledge about comconsole because > the BIOS translates it. > IIRC the Soekris BIOS has an option to disable the SIO support, maybe > your board has something similar. > Otherwise this means you need to disable the bootcode (including boot0) > to process any kind of input. Ups - I ment boot2 and not boot0 - you likely don't install boot0. > This shouldn't be too hard to code since the code is well documented. > It happens in at least boot0 and loader - the later likely can be > handled by using a customized loader.rc script, which wraps to > nullconsole. > > -- > B.Walter http://www.bwct.de > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 19:28:48 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A015F1065686 for ; Thu, 15 Apr 2010 19:28:48 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 2CEDC8FC15 for ; Thu, 15 Apr 2010 19:28:47 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o3FJSkAj001327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Apr 2010 21:28:46 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o3FJSUHL015065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Apr 2010 21:28:30 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o3FJSUKL034123; Thu, 15 Apr 2010 21:28:30 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o3FJSUQ0034122; Thu, 15 Apr 2010 21:28:30 +0200 (CEST) (envelope-from ticso) Date: Thu, 15 Apr 2010 21:28:30 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20100415192830.GE31933@cicely7.cicely.de> References: <201004141357.o3EDvuxt067902@lava.sentex.ca> <20100415173659.GB31933@cicely7.cicely.de> <201004151745.o3FHjXI2077062@lava.sentex.ca> <20100415190405.GC31933@cicely7.cicely.de> <20100415192524.GD31933@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100415192524.GD31933@cicely7.cicely.de> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: disabling all serial input / output at boot time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 19:28:48 -0000 On Thu, Apr 15, 2010 at 09:25:24PM +0200, Bernd Walter wrote: > On Thu, Apr 15, 2010 at 09:04:05PM +0200, Bernd Walter wrote: > > On Thu, Apr 15, 2010 at 01:45:36PM -0400, Mike Tancsa wrote: > > > At 01:36 PM 4/15/2010, Bernd Walter wrote: > > > > > > >Is the sensor prohibiting the use of USB RS232 in any way? > > > > > > Just our wallets :) Extra cost to include it and the case would need > > > to change as well as its in an environment where it can get hit by water. > > > > Ok - that's an understandable reason. > > > > The unfortunate thing is that the bootcode reacts on buffered input > > and the BIOS might already have buffered some bytes. > > This has nothing to do with FreeBSDs knowledge about comconsole because > > the BIOS translates it. > > IIRC the Soekris BIOS has an option to disable the SIO support, maybe > > your board has something similar. > > Otherwise this means you need to disable the bootcode (including boot0) > > to process any kind of input. > > Ups - I ment boot2 and not boot0 - you likely don't install boot0. For boot2 take a look into sys/boot/i386/boot2/boot2.c xgetc function. I assume it is all you need to chnage. > > > This shouldn't be too hard to code since the code is well documented. > > It happens in at least boot0 and loader - the later likely can be > > handled by using a customized loader.rc script, which wraps to > > nullconsole. > > > > -- > > B.Walter http://www.bwct.de > > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > -- > B.Walter http://www.bwct.de > Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 15 20:43:53 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131AF1065676 for ; Thu, 15 Apr 2010 20:43:53 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 54C5B8FC20 for ; Thu, 15 Apr 2010 20:43:51 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA10611 for ; Thu, 15 Apr 2010 23:43:50 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1O2Vug-0006Lb-Fn for freebsd-hackers@freebsd.org; Thu, 15 Apr 2010 23:43:50 +0300 Message-ID: <4BC77A85.6070603@freebsd.org> Date: Thu, 15 Apr 2010 23:43:49 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4BACC791.70502@icyb.net.ua> <20100327214634.GI32799@server.vk2pj.dyndns.org> <86fx3k7jqi.fsf@ds4.des.no> <201003291044.28544.jhb@freebsd.org> <4BB22A42.7050003@icyb.net.ua> <4BBB2D69.80002@freebsd.org> In-Reply-To: <4BBB2D69.80002@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: periodically save current time to time-of-day hardware X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 20:43:53 -0000 on 06/04/2010 15:47 Andriy Gapon said the following: > on 30/03/2010 19:43 Andriy Gapon said the following: >> do you think that periodic saving of system clock to hardware and making resettodr >> asynchronous are dependent issues? Or are they orthogonal and can be implemented >> independently? > > A new version of the patch: > http://people.freebsd.org/~avg/periodic_resettodr.diff Given total lack of reviews and comments I am keeping this patch for my local use. > Some notes: > - this patch doesn't implement any resettodr enhancements proposed earlier: making > it non-blocking/asynchronous and saving time closer to seconds boundary; > - the patch adds code for saving time on shutdown, adds logic for checking ntp > synchronization status and for dynamically stoping/(re-)starting the callout via > period sysctl; > - the patch consists of two pieces: the first is abstracting ntp status check into > a separate function and the other is all the time saving code; > - I don't feel that kern_ntptime.c is best place for this code, I only chose it > because of ntp status checking; perhaps ntp_is_time_error needs to be made public > and the code moved to a better file; suggestion are welcome! > > I also welcome any comments and suggestions on code style, identifier naming, > logic, strategy, etc. > Thank you! > > P.S. it seems that machdep is not the best place for "RTC" sysctls, but I am > deferring this issue at the moment. > -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 08:16:55 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2BA106564A; Fri, 16 Apr 2010 08:16:55 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 9EFB08FC13; Fri, 16 Apr 2010 08:16:54 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id C9A587E84A; Fri, 16 Apr 2010 18:16:52 +1000 (EST) Message-ID: <4BC81CF4.6060006@freebsd.org> Date: Fri, 16 Apr 2010 18:16:52 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100409 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4BC711DA.4080207@freebsd.org> In-Reply-To: <4BC711DA.4080207@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rrs@freebsd.org, tuexen@freebsd.org Subject: Re: A cookie for anyone who can solve this C/macro problem... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 08:16:55 -0000 On 04/15/10 23:17, Lawrence Stewart wrote: > Hi All, > > I've hit a road block that I'm hoping people with better C/macro fu can > help me with. It also may be the case that what I'm trying to do can't > be done, so I welcome alternative suggestions as well. > > The problem: > > I'm working on a KPI to modularise congestion control support in the > kernel (overview of KPI is visible in [1]). So far, I've been focused > solely on TCP, but I want to have the framework generalise to be able to > share congestion control algorithms between other congestion aware > transports e.g. SCTP, DCCP. > > To achieve this, I need to pass congestion control information into the > hook functions in a protocol agnostic way. The current KPI passes the > tcpcb ptr and this works nicely, but obviously doesn't help. > > The cleanest option as I see it is to embed a new CC specific struct in > the appropriate TCP and SCTP structs, and pass this in to the KPI. I > started down this road and quickly stopped - the amount of code churn > this will cause in the TCP and SCTP stacks is to my mind far to > intrusive, at least for an initial import of the framework. > > So the next idea I've been trying to prototype was to pass a union of > the various protocol struct types into the KPI and then use macro magic > to allow the CC algorithms to access commonly named variables across the > different transport struct types. It would require vars to have the same > name, which would still mean some code churn, but less than the first > option. Here are the basic bits I'm currently working with: > > struct cc_var { > uint16_t type; > union { > struct tcpcb *tcp; > struct sctp_nets *sctp; > } ccvc; > }; > > All function ptrs in struct cc_algo [1] are modified to accept a "struct > cc_var *ccv". > > In an algorithm implementation e.g. NewReno [2], I then want to be able > to do things like this with the fictitious CCVC() macro: > > void > newreno_ack_received(struct cc_var *ccv) > { > u_int cw = CCVC(ccv)->snd_cwnd; > ... > CCVC(ccv)->snd_cwnd = blah; > } > > > So far I haven't found a way to achieve the above, and the best I've > come up (with help) is this: > > #define CCV_DO(ccv, what) \ > ( \ > (ccv)->type == IPPROTO_TCP ? (ccv)->ccvc.tcp->what : \ > (ccv)->ccvc.sctp->what \ > ) > > which can be used like this: > > void > newreno_ack_received(struct cc_var *ccv) > { > u_int cw = CCV_DO(ccv, snd_cwnd); > ... > CCVC(ccv, snd_cwnd = blah); > } > > Of course, this falls apart if you try do this for example: > > CCVC(ccv, snd_cwnd = min(blah, bleh)); > > > So... I'm sure there are some good ideas out there and would really > appreciate hearing about them. Thanks to those who replied on and off list. The cookie reward goes to Hans and Daniel. The key insight I was missing is that the C ternary statement doesn't return something suitable for use as an lvalue. Dereferencing a ptr returned by the ternary does though, and this provides me with a fairly neat way of dealing with the problem. For posterity's sake, relevant snippets of working code that I'm now using are as follows: struct cc_var { union ccv_container { struct tcpcb *tcp; struct sctp_nets *sctp; } ccvc; int type; }; #define CCV(ccv, what) \ (*( \ (ccv)->type == IPPROTO_TCP ? &(ccv)->ccvc.tcp->what : \ &(ccv)->ccvc.sctp->what \ )) In future, the CCV macro could also grow support for DCCP using a nested ternary e.g. (untested) #define CCV(ccv, what) \ (*( \ (ccv)->type == IPPROTO_TCP ? &(ccv)->ccvc.tcp->what : \ ((ccv)->type == IPPROTO_SCTP ? &(ccv)->ccvc.sctp->what : \ &(ccv)->ccvc.dccp->what) \ )) And finally, an example use of the current code in the NewReno CC module: void newreno_ack_received(struct cc_var *ccv) { u_int cw = CCV(ccv, snd_cwnd); u_int incr = CCV(ccv, t_maxseg); if (cw > CCV(ccv, snd_ssthresh)) incr = max((incr * incr / cw), 1); CCV(ccv, snd_cwnd) = min(cw+incr, TCP_MAXWIN << CCV(ccv, snd_scale)); } Whilst we're here and on an educational roll, does anyone have thoughts on what the compiler actually does with "*(blah ? &1 : &2)"? As this TCP code is called in the fast path, I'm curious to know if there is a runtime penalty for taking the ref and then immediately derefing it like this, or if the only overhead is the test+branch and the compiler is smart enough to collapse *(&1 or &2) to (1 or 2). I don't have a good mental model of how this stuff works under the hood... Thanks again. Cheers, Lawrence From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 08:39:56 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 121C8106566C; Fri, 16 Apr 2010 08:39:56 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 03E4D8FC1D; Fri, 16 Apr 2010 08:39:56 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3G8drF5098745; Fri, 16 Apr 2010 08:39:55 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4BC82259.90203@freebsd.org> Date: Fri, 16 Apr 2010 16:39:53 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Jeremy Lea References: <20091002201039.GA53034@flint.openpave.org> In-Reply-To: <20091002201039.GA53034@flint.openpave.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Distributed SSH attack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 08:39:56 -0000 Jeremy Lea wrote: > Hi, > > This is off topic to this list, but I dont want to subscribe to -chat > just to post there... Someone is currently running a distributed SSH > attack against one of my boxes - one attempted login for root every > minute or so for the last 48 hours. They wont get anywhere, since the > box in question has no root password, and doesn't allow root logins via > SSH anyway... > > But I was wondering if there were any security researchers out there > that might be interested in the +-800 IPs I've collected from the > botnet? The resolvable hostnames mostly appear to be in Eastern Europe > and South America - I haven't spotted any that might be 'findable' to > get the botnet software. > > I could switch out the machine for a honeypot in a VM or a jail, by > moving the host to a new IP, and if you can think of a way of allowing > the next login to succeed with any password, then you could try to see > what they delivered... But I don't have a lot of time to help. > > Regards, > -Jeremy > Try to change SSH port to something other than default port 22, I always did this for my machines, e.g, change them to 13579 :-) Regards, David Xu From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 12:11:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9AD106566C; Fri, 16 Apr 2010 12:11:27 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id D878C8FC0C; Fri, 16 Apr 2010 12:11:26 +0000 (UTC) Received: by ewy24 with SMTP id 24so781706ewy.33 for ; Fri, 16 Apr 2010 05:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=KirGyqtLk+GCUA7jRrUfjipRZp4P6i2CBbO0iLvIdOA=; b=HObJVWfkgAJO1w32qHSmJMTQ6ocCiqfrWs8/03K1kAnWgmZXjcPKqJPyIS9BhSIOrv wauiD5UFEPDCSUp6ues9BU3/lHQ8sFuHqMEeV5CamEFsuN3bRlxL5Iw5zPq6NbZbZ4oQ Oahvkgjvth0VeFkvtb5clxKjAjQq2uck3TY/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tVi3SnNHEdlUUB7rMzCAvluYw1f5FOIRwdPZEc274zzy18H4sqK5f5nE7ygO2jpxpZ G55LItt81ULnbavIk1ncywLY4zquignG/bN/XLnJMi7A1OMivFMtNX/Fc+WM2PpcbwXN /R/c6mR1qNLWbfY05OsDJamDd/8cyjku0vbcQ= MIME-Version: 1.0 Received: by 10.213.9.134 with HTTP; Fri, 16 Apr 2010 05:11:25 -0700 (PDT) In-Reply-To: <201004141721.00254.jhb@freebsd.org> References: <201004141721.00254.jhb@freebsd.org> Date: Fri, 16 Apr 2010 14:11:25 +0200 Received: by 10.213.52.195 with SMTP id j3mr753530ebg.33.1271419885613; Fri, 16 Apr 2010 05:11:25 -0700 (PDT) Message-ID: From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 12:11:27 -0000 2010/4/14 John Baldwin : > On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu=EDa wrote: >> Hi all, >> >> I'm trying to read process memory other than the current process in >> kernel. I was told to use the proc_rwmem function, however I can't get >> it working properly. At first, I'm trying to read how many elements >> the environment variables vector has. To do this I tried this from a >> linprocfs filler function: >> >> >> =A0 =A0 =A0 =A0 struct iovec iov; >> =A0 =A0 =A0 struct uio tmp_uio; >> =A0 =A0 =A0 struct ps_strings *pss; >> =A0 =A0 =A0 int ret_code; >> >> =A0 =A0 =A0 buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK)= ; >> =A0 =A0 =A0 memset(buff, 0, sizeof(struct ps_strings)); >> >> =A0 =A0 =A0 PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); >> =A0 =A0 =A0 iov.iov_base =3D (caddr_t) buff; >> =A0 =A0 =A0 iov.iov_len =3D sizeof(struct ps_strings); >> =A0 =A0 =A0 tmp_uio.uio_iov =3D &iov; >> =A0 =A0 =A0 tmp_uio.uio_iovcnt =3D 1; >> =A0 =A0 =A0 tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings); >> =A0 =A0 =A0 tmp_uio.uio_resid =3D sizeof(struct ps_strings); >> =A0 =A0 =A0 tmp_uio.uio_segflg =3D UIO_USERSPACE; >> =A0 =A0 =A0 tmp_uio.uio_rw =3D UIO_READ; >> =A0 =A0 =A0 tmp_uio.uio_td =3D td; >> =A0 =A0 =A0 ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); > > I think you want to use 'p' instead of 'td->td_proc' here. =A0As it is yo= u are > reading from the current process instead of the target process I believe. Thank you. You are right. I made the changes suggested by both you and Kostik. I still have random data when reading. I'm trying to to the same thing using kern/sys_generic.c::read and kern/sys_process.c::kern_ptrace as examples, but I'm missing something... After reading with proc_rwmem, is it possible to do something like the following? if (ret_code =3D=3D 0) { sbuf_printf(sb, "proc_rwmem successfully executed: %d\n", ret_code); } else { sbuf_printf(sb, "Error in proc_rwmem: %d\n", ret_code); } pss =3D (struct ps_strings *)(iov.iov_base); sbuf_printf(sb, "ps_nargvstr =3D %d\nps_nenvstr =3D %d\n", pss->ps_nargvstr, pss->ps_nenvstr); Thanks in advance. > > -- > John Baldwin > From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 09:18:10 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5B0E106566C for ; Fri, 16 Apr 2010 09:18:10 +0000 (UTC) (envelope-from kraduk@googlemail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 1A38B8FC23 for ; Fri, 16 Apr 2010 09:18:09 +0000 (UTC) Received: by bwz6 with SMTP id 6so2089637bwz.13 for ; Fri, 16 Apr 2010 02:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=0TEwYG9OU7LFKCKdwJxvktRbjxsccx2QeqvmooxvFww=; b=SjiXInhDS3bVrdrMfnnlr8Ps0uUYayXfeb73nEDV0SdBHg25G6EIVeQINbE6xzf6qv L3X0yNfz8+Ce/xbU/5uz0t4HoKfqr4JPt3hThSfty9CvPGAcIM4qaS5CgyWj8LHRyDJu 8o1hEGz8evaZ5lnUbwGti5WzEGxMTOlCc64TQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=sUt49GEx6xDe5P/iqZyN1mV6WCl97O8Aaxff7IXvTTazt2wJ7Dz6gTSMSlCUPtwBqR dQt0B7ReaFe8ysaliMV8e8ZsC1A0D6ndVkE5tmSM58E1a+A9dm4mDWMD9sAzC4Z2itU1 oPkHnOcdM4CmwmNzi9Lw/MEHAoWgVGgtTc8qk= MIME-Version: 1.0 Received: by 10.239.165.129 with HTTP; Fri, 16 Apr 2010 02:18:08 -0700 (PDT) In-Reply-To: <4BC82259.90203@freebsd.org> References: <20091002201039.GA53034@flint.openpave.org> <4BC82259.90203@freebsd.org> Date: Fri, 16 Apr 2010 10:18:08 +0100 Received: by 10.239.182.204 with SMTP id r12mr77499hbg.193.1271409488596; Fri, 16 Apr 2010 02:18:08 -0700 (PDT) Message-ID: From: krad To: David Xu X-Mailman-Approved-At: Fri, 16 Apr 2010 12:14:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jeremy Lea , freebsd-hackers@freebsd.org Subject: Re: Distributed SSH attack X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 09:18:11 -0000 On 16 April 2010 09:39, David Xu wrote: > Jeremy Lea wrote: > >> Hi, >> >> This is off topic to this list, but I dont want to subscribe to -chat >> just to post there... Someone is currently running a distributed SSH >> attack against one of my boxes - one attempted login for root every >> minute or so for the last 48 hours. They wont get anywhere, since the >> box in question has no root password, and doesn't allow root logins via >> SSH anyway... >> >> But I was wondering if there were any security researchers out there >> that might be interested in the +-800 IPs I've collected from the >> botnet? The resolvable hostnames mostly appear to be in Eastern Europe >> and South America - I haven't spotted any that might be 'findable' to >> get the botnet software. >> >> I could switch out the machine for a honeypot in a VM or a jail, by >> moving the host to a new IP, and if you can think of a way of allowing >> the next login to succeed with any password, then you could try to see >> what they delivered... But I don't have a lot of time to help. >> >> Regards, >> -Jeremy >> >> > Try to change SSH port to something other than default port 22, > I always did this for my machines, e.g, change them to 13579 :-) > > Regards, > David Xu > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > dont allow password auth, tcp wrap it, and acl it with pf. Probably more stuff you can do. Think onions From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 12:22:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10812106566C for ; Fri, 16 Apr 2010 12:22:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D41618FC19 for ; Fri, 16 Apr 2010 12:22:26 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84ED146B94; Fri, 16 Apr 2010 08:22:26 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B29A58A021; Fri, 16 Apr 2010 08:22:25 -0400 (EDT) From: John Baldwin To: Fernando =?iso-8859-1?q?Apestegu=EDa?= Date: Fri, 16 Apr 2010 08:18:28 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201004141721.00254.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201004160818.28944.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 16 Apr 2010 08:22:25 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 12:22:27 -0000 On Friday 16 April 2010 8:11:25 am Fernando Apestegu=EDa wrote: > 2010/4/14 John Baldwin : > > On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu=EDa wrote: > >> Hi all, > >> > >> I'm trying to read process memory other than the current process in > >> kernel. I was told to use the proc_rwmem function, however I can't get > >> it working properly. At first, I'm trying to read how many elements > >> the environment variables vector has. To do this I tried this from a > >> linprocfs filler function: > >> > >> > >> struct iovec iov; > >> struct uio tmp_uio; > >> struct ps_strings *pss; > >> int ret_code; > >> > >> buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAITOK); > >> memset(buff, 0, sizeof(struct ps_strings)); > >> > >> PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); > >> iov.iov_base =3D (caddr_t) buff; > >> iov.iov_len =3D sizeof(struct ps_strings); > >> tmp_uio.uio_iov =3D &iov; > >> tmp_uio.uio_iovcnt =3D 1; > >> tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings); > >> tmp_uio.uio_resid =3D sizeof(struct ps_strings); > >> tmp_uio.uio_segflg =3D UIO_USERSPACE; > >> tmp_uio.uio_rw =3D UIO_READ; > >> tmp_uio.uio_td =3D td; > >> ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); > > > > I think you want to use 'p' instead of 'td->td_proc' here. As it is yo= u=20 are > > reading from the current process instead of the target process I believ= e. >=20 > Thank you. You are right. >=20 > I made the changes suggested by both you and Kostik. I still have > random data when reading. > I'm trying to to the same thing using kern/sys_generic.c::read and > kern/sys_process.c::kern_ptrace > as examples, but I'm missing something... > After reading with proc_rwmem, is it possible to do something like the > following? >=20 > if (ret_code =3D=3D 0) { > sbuf_printf(sb, "proc_rwmem successfully executed: %d\n", ret_code); > } else { > sbuf_printf(sb, "Error in proc_rwmem: %d\n", ret_code); > } >=20 > pss =3D (struct ps_strings *)(iov.iov_base); > sbuf_printf(sb, "ps_nargvstr =3D %d\nps_nenvstr =3D %d\n", > pss->ps_nargvstr, pss->ps_nenvstr); >=20 > Thanks in advance. No, functions like uiomove() modify the iovec structures. Just use 'buff'= =20 instead of iov.iov_base. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 12:37:16 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FCD81065675; Fri, 16 Apr 2010 12:37:16 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id DAB608FC1A; Fri, 16 Apr 2010 12:37:15 +0000 (UTC) Received: by ewy24 with SMTP id 24so788090ewy.33 for ; Fri, 16 Apr 2010 05:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3Vr9ECiEHrwEoeir2A1UCIuJqlg7s+JnOTlqTXEKNHo=; b=lwdzp3fmioew9oKxRDlD7KL3TN3IYmO9oipAqOVucJRWiS6MHgyFpbxf9LQlU+aKgU ds1igLwCmbk9FMWPt4CaUdXfCf8eKhbgJm/Fq3Ml+/iJBU/e+b8htKqpU0Mzoz6gPc4Y tUMm4fadALz3tUehE6nBpkpKOvIs5prw+pxow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JmyEIuySDpO2bYQMmPsTm4SzWpaCbsjxXf1Ow7qOj8KqAlv9yUxS9rjI9HHXiPHWVY 7Aa7OJ4nH6rpmoIf/bDralFxM/JBvyYfMiu5v3zfyhwhhIdH27rD1QjqDGXQ/hAr+5gd aRR1otJOQDTNqWBc8cvrMn9Xp4lgaCOyr9RYs= MIME-Version: 1.0 Received: by 10.213.9.134 with HTTP; Fri, 16 Apr 2010 05:37:14 -0700 (PDT) In-Reply-To: <201004160818.28944.jhb@freebsd.org> References: <201004141721.00254.jhb@freebsd.org> <201004160818.28944.jhb@freebsd.org> Date: Fri, 16 Apr 2010 14:37:14 +0200 Received: by 10.213.51.212 with SMTP id e20mr760293ebg.85.1271421434740; Fri, 16 Apr 2010 05:37:14 -0700 (PDT) Message-ID: From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Understanding proc_rwmem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 12:37:16 -0000 2010/4/16 John Baldwin : > On Friday 16 April 2010 8:11:25 am Fernando Apestegu=EDa wrote: >> 2010/4/14 John Baldwin : >> > On Wednesday 14 April 2010 4:22:56 pm Fernando Apestegu=EDa wrote: >> >> Hi all, >> >> >> >> I'm trying to read process memory other than the current process in >> >> kernel. I was told to use the proc_rwmem function, however I can't ge= t >> >> it working properly. At first, I'm trying to read how many elements >> >> the environment variables vector has. To do this I tried this from a >> >> linprocfs filler function: >> >> >> >> >> >> =A0 =A0 =A0 =A0 struct iovec iov; >> >> =A0 =A0 =A0 struct uio tmp_uio; >> >> =A0 =A0 =A0 struct ps_strings *pss; >> >> =A0 =A0 =A0 int ret_code; >> >> >> >> =A0 =A0 =A0 buff =3D malloc(sizeof(struct ps_strings), M_TEMP, M_WAIT= OK); >> >> =A0 =A0 =A0 memset(buff, 0, sizeof(struct ps_strings)); >> >> >> >> =A0 =A0 =A0 PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); >> >> =A0 =A0 =A0 iov.iov_base =3D (caddr_t) buff; >> >> =A0 =A0 =A0 iov.iov_len =3D sizeof(struct ps_strings); >> >> =A0 =A0 =A0 tmp_uio.uio_iov =3D &iov; >> >> =A0 =A0 =A0 tmp_uio.uio_iovcnt =3D 1; >> >> =A0 =A0 =A0 tmp_uio.uio_offset =3D (off_t)(p->p_sysent->sv_psstrings)= ; >> >> =A0 =A0 =A0 tmp_uio.uio_resid =3D sizeof(struct ps_strings); >> >> =A0 =A0 =A0 tmp_uio.uio_segflg =3D UIO_USERSPACE; >> >> =A0 =A0 =A0 tmp_uio.uio_rw =3D UIO_READ; >> >> =A0 =A0 =A0 tmp_uio.uio_td =3D td; >> >> =A0 =A0 =A0 ret_code =3D proc_rwmem(td->td_proc, &tmp_uio); >> > >> > I think you want to use 'p' instead of 'td->td_proc' here. =A0As it is= you > are >> > reading from the current process instead of the target process I belie= ve. >> >> Thank you. You are right. >> >> I made the changes suggested by both you and Kostik. I still have >> random data when reading. >> I'm trying to to the same thing using kern/sys_generic.c::read and >> kern/sys_process.c::kern_ptrace >> as examples, but I'm missing something... >> After reading with proc_rwmem, is it possible to do something like the >> following? >> >> if (ret_code =3D=3D 0) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_printf(sb, "proc_rwmem successfully exe= cuted: %d\n", ret_code); >> } else { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 sbuf_printf(sb, "Error in proc_rwmem: %d\n",= ret_code); >> } >> >> pss =3D (struct ps_strings *)(iov.iov_base); >> sbuf_printf(sb, "ps_nargvstr =3D %d\nps_nenvstr =3D %d\n", >> pss->ps_nargvstr, pss->ps_nenvstr); >> >> Thanks in advance. > > No, functions like uiomove() modify the iovec structures. =A0Just use 'bu= ff' > instead of iov.iov_base. Ah! That was it! Thanks! > > -- > John Baldwin > From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 16 19:05:11 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD501065676 for ; Fri, 16 Apr 2010 19:05:11 +0000 (UTC) (envelope-from samrobb@averesystems.com) Received: from zimbra.averesystems.com (75-149-8-243-Pennsylvania.hfc.comcastbusiness.net [75.149.8.243]) by mx1.freebsd.org (Postfix) with ESMTP id E10778FC19 for ; Fri, 16 Apr 2010 19:05:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.averesystems.com (Postfix) with ESMTP id 924D18BC913 for ; Fri, 16 Apr 2010 15:04:12 -0400 (EDT) X-Virus-Scanned: amavisd-new at averesystems.com Received: from zimbra.averesystems.com ([127.0.0.1]) by localhost (zimbra.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pUQzVPYVL1Dc for ; Fri, 16 Apr 2010 15:04:11 -0400 (EDT) Received: from [10.0.1.224] (fw.arriad.com [10.0.0.16]) by zimbra.averesystems.com (Postfix) with ESMTPSA id D356D8BC044 for ; Fri, 16 Apr 2010 15:04:11 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1078) From: Sam Robb In-Reply-To: <201004141718.05534.jhb@freebsd.org> Date: Fri, 16 Apr 2010 15:06:40 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <24EE4B09-0317-441A-822A-43F36D7D61E7@averesystems.com> References: <1DF133F5-6B00-4F06-8837-946702226A54@averesystems.com> <201004141718.05534.jhb@freebsd.org> To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.1078) Subject: Re: Going from struct disk to a fh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2010 19:05:11 -0000 On Apr 14, 2010, at 5:18 PM, John Baldwin wrote: > On Wednesday 14 April 2010 9:08:50 am Sam Robb wrote: >> In the kernel, given a struct disk, is there a way to turn that into=20= > something that can be used to read/write from the disk? Or is my best = bet in=20 > this situation to figure out the device path for the disk, and just = use=20 > kern_open() to access it? >=20 > You can use dp->d_geom as the target of a bio via GEOM I think. = However, I=20 > don't have experience with sending bio's to a specific GEOM directly. = File=20 > systems usually use geom_vfs to feed requests from bread(), etc. to a = mounted=20 > disk device using a devfs vnode for the associated disk device. Thanks, John. I've found another way around my problem in user space; = if I revisit the kernel solution, I'll take a look at using bio. -Samrobb= From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 17 10:06:04 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79BB1106566C for ; Sat, 17 Apr 2010 10:06:04 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE1B8FC21 for ; Sat, 17 Apr 2010 10:06:03 +0000 (UTC) Received: from park.js.berklix.net (p549A446A.dip.t-dialin.net [84.154.68.106]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id o3HA61AH024950 for ; Sat, 17 Apr 2010 10:06:01 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id o3HA5qfX082924 for ; Sat, 17 Apr 2010 12:05:52 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.3/8.14.3) with ESMTP id o3HA5kfo014359 for ; Sat, 17 Apr 2010 12:05:51 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201004171005.o3HA5kfo014359@fire.js.berklix.net> To: hackers@freebsd.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Linux Unix Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Sat, 17 Apr 2010 12:05:46 +0200 Sender: jhs@berklix.com Cc: Subject: Bug with fixit live 8.0 memstick.img running on F1 after MBR X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 10:06:04 -0000 Hi Hackers, Bug found with fixit live 8.0 memstick.img running on F1 after MBR : First I checked my PC BIOS boots OK: I copied 8.0-RELEASE-i386-memstick.img to a raw 2G USB stick, it boots fine, & one can go into fixit menu, using image on stick Next I fdisk partitioned an 8G stick & copied 8.0-RELEASE-i386-memstick.img to F1 (da0s1), set F1 active, booted OK, went into fixit, selected USB stick for the live media, & it failed to find a USB media. (The live command prompt on F4 wasn't much use, no ls yet.) I tried telling it to install to F2 (6.5 G ufs), using files from local FS on stick, (I told it path 8.0-RELEASE ) but on 2 attempts, it couldnt find where to install to get bins from. I since confirmed those files are there on F1 8.0-RELEASE/ , see below. Conclusion: Would be nice if others tried too, to tell if it's my mistake or a bug. WOrth doing as it also sets you up ready with a stick that can rescue/ fixit + has enough space for other file systemes with your own personal /usr/local inc. X, ready for eg testing laptops in shops. I since mounted my 8G stick on a normal 8.0 PC & installed F2 from /usr/src & /usr/local from hard disc. I have another 4G I could test with MBR, but testing here is disruptive as only my main machine has boot- off- USB functionality). I mounted both sticks later to document what I was using: 2G stick with no MBR, (`dangerously dedicated', that worked OK: ls -l /devusb/red -> /dev/da0a df | grep usb Filesystem Size Used Avail Capacity Mounted on /devusb/red 921M 858M -11M 101% /usb/red disklabel da0 # /dev/da0: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 1803124 16 unused 0 0 c: 1803140 0 unused 0 0 # "raw" part, don't edit disklabel: partition c doesn't cover the whole unit! disklabel: An incorrect partition c may cause problems for standard system utilities 8G stick with MBR: fdisk da0 ******* Working on device /dev/da0 ******* parameters extracted from in-core disklabel are: cylinders=977 heads=255 sectors/track=63 (16065 blks/cyl) parameters to be used for BIOS calculations are: cylinders=977 heads=255 sectors/track=63 (16065 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 2988027 (1458 Meg), flag 0 beg: cyl 0/ head 1/ sector 1; end: cyl 185/ head 254/ sector 63 The data for partition 2 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 2988090, size 12707415 (6204 Meg), flag 80 (active) beg: cyl 186/ head 0/ sector 1; end: cyl 976/ head 254/ sector 63 The data for partition 3 is: The data for partition 4 is: mount /dev/da0s1a on /usb/sanblack.img (ufs, local) /dev/da0s2a on /usb/sanblack.ufs (ufs, local, soft-updates) df Filesystem Size Used Avail Capacity Mounted on /dev/da0s1a 921M 858M -11M 101% /usb/sanblack.img /dev/da0s2a 6.3G 2.7M 5.8G 0% /usb/sanblack.ufs cd /usb/sanblack.img/8.0-RELEASE du -s kernels # 60M ls base # base.aa - base.bl, base.inf base.mtree install.sh* disklabel da0s1 # size offset fstype [fsize bsize bps/cpg] a: 1803124 16 unused 0 0 c: 2988027 0 unused 0 0 disklabel da0s2 a: 12707399 16 4.2BSD 0 0 0 c: 12707415 0 unused 0 0 Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Mail plain text, Not HTML quoted-printable Base64 http://www.asciiribbon.org From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 17 12:15:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A47106564A for ; Sat, 17 Apr 2010 12:15:52 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id DC7208FC18 for ; Sat, 17 Apr 2010 12:15:51 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA16390 for ; Sat, 17 Apr 2010 15:15:50 +0300 (EEST) (envelope-from avg@icyb.net.ua) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1O36w9-000EHf-Ti for freebsd-hackers@freebsd.org; Sat, 17 Apr 2010 15:15:49 +0300 Message-ID: <4BC9A674.2050705@icyb.net.ua> Date: Sat, 17 Apr 2010 15:15:48 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: towards fixing intermingled dmesg X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 12:15:52 -0000 Here is a simple extension of msgbuf_addchar that is supposed to allow to put N characters consecutively into msgbuf. The idea is very simple: atomically forward msg_wseq by N and then copy characters into the reserved space. Could you please check if this is implemented correctly and if it would actually work the way I expect? There is still a harder issue of actually plugging this routine into subr_prf.c :-) --- a/sys/kern/subr_msgbuf.c +++ b/sys/kern/subr_msgbuf.c @@ -131,6 +131,26 @@ msgbuf_addchar(struct msgbuf *mbp, int c) mbp->msg_ptr[pos] = c; } +void +msgbuf_addchars(struct msgbuf *mbp, const char *s, const int n) +{ + u_int new_seq, pos, seq; + int c, i; + + do { + seq = mbp->msg_wseq; + new_seq = MSGBUF_SEQNORM(mbp, seq + n); + } while (atomic_cmpset_rel_int(&mbp->msg_wseq, seq, new_seq) == 0); + + for (i = 0; i < n; i++) { + pos = MSGBUF_SEQ_TO_POS(mbp, seq + i); + c = s[i]; + atomic_add_int(&mbp->msg_cksum, (u_int)(u_char)c - + (u_int)(u_char)mbp->msg_ptr[pos]); + mbp->msg_ptr[pos] = c; + } +} + /* * Read and mark as read a character from a message buffer. * Returns the character, or -1 if no characters are available. -- Andriy Gapon