From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TAPUn-0001yB-67 for barebox@lists.infradead.org; Sat, 08 Sep 2012 18:11:06 +0000 Date: Sat, 8 Sep 2012 20:11:03 +0200 From: Sascha Hauer Message-ID: <20120908181103.GK18243@pengutronix.de> References: <1347020017-12110-9-git-send-email-plagnioj@jcrosoft.com> <20120907182106.GA18243@pengutronix.de> <20120908054033.GT20330@game.jcrosoft.org> <20120908061730.GV20330@game.jcrosoft.org> <20120908134706.GB18243@pengutronix.de> <20120908145125.GB20330@game.jcrosoft.org> <20120908152712.GI18243@pengutronix.de> <20120908171229.GC20330@game.jcrosoft.org> <20120908172200.GJ18243@pengutronix.de> <20120908173524.GG20330@game.jcrosoft.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120908173524.GG20330@game.jcrosoft.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 09/11] defaultenv-2: boot/net add bootp support To: Jean-Christophe PLAGNIOL-VILLARD Cc: barebox@lists.infradead.org On Sat, Sep 08, 2012 at 07:35:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 19:22 Sat 08 Sep , Sascha Hauer wrote: > > On Sat, Sep 08, 2012 at 07:12:29PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > Look, there are so many possible setups. > > > > > > > > - kernel on tftp, disk, nand > > > > - oftree on tftp, disk, nand, none at all > > > > - root on nfs, disk, nand > > > > > > > > Even the above makes for 36 combinations, different names/partitions not > > > > counted. The setups are board specific, company specific, project > > > > specific or person specific. There is no way of making all happy with a > > > > single script. Instead the bootscripts are meant as an *example* to get > > > > started, they are *not* meant to fit all your and everyone elses needs. > > > > > > > > You want to get your oftree path from a dhcp request? Then fine, change > > > > global.bootm.oftree to "${path}/${global.dhcp.oftree_file}". You want > > > > to use the one from /env/oftree? Then change global.bootm.oftree > > > > accordingly. You want to use one as a fallback from another one? Also > > > > fine, do some if/else. > > > > > > > > But please don't try to force your specific setup to other people. > > > I force nothing I just add the generic bootp support > > > > Sure you do. For example you leave no option to not use > > $global.dhcp.rootpath even if set. There is no option to not use > > $global.dhcp.bootfile even if set. Yes, you could add an option > > somewhere, but that would make the boot scripts even more complicated. > I do not want to add options ifs omeone want something different modify it Yes, that's my point. For this the scripts have to be modifyable, that means simple. Modifying should not mean hack through ifs/elses. In barebox we have the problem that it's not really clear what is configuration and what is code. The boot scripts are clearly meant for configuration. > > > > The boot scripts are not the place to add code. You can add a > > helper script to do whatever magic you need; and if it's sufficiently > > useful we can add it to the tree. > in the case of bootp we need as it's a specifc boot method if you have in mind > a code for the helper please show me because I do not see any right now One could be: kernel-bootp -m [nfs|tftp] oftree-bootp -m [nfs|tftp] These scripts could for example only set global.bootm.image only if not set already. Then you could put the fallback into the next line without additional ifs. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox