mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Trent Piepho <tpiepho@kymetacorp.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	Peter Mamonov <pmamonov@gmail.com>
Subject: Re: [PATCH] common: filetype: do not redetect MBR-type devices as a FAT-type
Date: Tue, 10 Nov 2015 09:15:47 +0100	[thread overview]
Message-ID: <20151110081547.GF8526@pengutronix.de> (raw)
In-Reply-To: <20151110080423.GE8526@pengutronix.de>

On Tue, Nov 10, 2015 at 09:04:23AM +0100, Sascha Hauer wrote:
> On Mon, Nov 09, 2015 at 06:49:53PM +0000, Trent Piepho wrote:
> > On Mon, 2015-11-09 at 13:32 +0300, Peter Mamonov wrote:
> > > Deleted pieces of code detect MBR-containig device as a FAT-type device,
> > > if it's first partition contains a FAT filesystem. This behaviour enabled one
> > > to mount the FAT FS which is either directly on the device (disk0) or on
> > > the first partition (disk0.0) using the same command:
> > >     mount /dev/disk0 /fat
> > > However, the desired behaviour can be reached with a:
> > >     mount /dev/disk0 /fat || mount /dev/disk0.0 /fat || echo "Mounting failed"
> > 
> > The in flash env for omap is found by mounting a FAT filesystem and
> > reading an env file from it.  The code that does this uses the disk as
> > the device, rather than the partition.  Which I thought was odd and
> > wondered why/if that worked correctly....
> > 
> > Anyway, this change would break that code.  I suspect than instead of
> > coding the disk0 || disk0.0 method it could just mount disk0.0.  Because
> > the code does this (edited):
> > 
> > partname = asprintf("/dev/%s.0", diskdev);
> > ret = stat(partname, &s);
> > if (ret) {
> >   pr_err("Failed to load environment: no device '%s'\n", diskdev);
> >   return 0;
> > }
> > ret = mount(diskdev, "fat", "/boot", NULL);
> 
> This is really odd. The code first tests if the partition exists and
> tries to mount the whole disk afterwards. git blame points to:
> 
> commit be322768f04603df371c9c1f08b9621690dd74c6
> Author: Sascha Hauer <s.hauer@pengutronix.de>
> Date:   Sat Aug 24 12:48:50 2013 +0200
> 
>     ARM: omap: Allow to set mmc devname used for booting
> 
> I think what we should do here is in the following patch. With this
> Trents patch can be applied as-is. Thanks for noting, Peter.

Sorry, I mixed you two up. I mean: With this Peters patch can be
applied as-is. Thanks for noting, Trent.

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

  reply	other threads:[~2015-11-10  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 10:32 Peter Mamonov
2015-11-09 11:18 ` Antony Pavlov
2015-11-09 18:49 ` Trent Piepho
2015-11-10  8:04   ` Sascha Hauer
2015-11-10  8:15     ` Sascha Hauer [this message]
2015-11-10 18:44     ` Trent Piepho
2015-11-11  7:35 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151110081547.GF8526@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=pmamonov@gmail.com \
    --cc=tpiepho@kymetacorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox