From: Karel Zak Subject: Re: [PATCH v1] partitions/efi: Add 'gpt_sector' kernel cmdline parameter Date: Mon, 24 Feb 2020 17:33:42 +0100 Message-ID: <20200224163342.d4acf224b56celup@ws.net.home> References: <20200219162339.16192-1-digetx@gmail.com> <20200219162738.GA10644@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Stephen Warren Cc: Christoph Hellwig , Dmitry Osipenko , Jens Axboe , Davidlohr Bueso , Colin Cross , Thierry Reding , Jonathan Hunter , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , David Heidelberg , Peter Geis , linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org On Wed, Feb 19, 2020 at 09:59:54AM -0700, Stephen Warren wrote: > On 2/19/20 9:27 AM, Christoph Hellwig wrote: > > On Wed, Feb 19, 2020 at 07:23:39PM +0300, Dmitry Osipenko wrote: > > > The gpt_sector= causes the GPT partition search to look at the > > > specified sector for a valid GPT header if the GPT is not found at the > > > beginning or the end of block device. > > > > > > In particular this is needed for NVIDIA Tegra consumer-grade Android > > > devices in order to make them usable with the upstream kernel because > > > these devices use a proprietary / closed-source partition table format > > > for the EMMC and it's impossible to change the partition's format. Luckily > > > there is a GPT table in addition to the proprietary table, which is placed > > > in uncommon location of the EMMC storage and bootloader passes the > > > location to kernel using "gpt gpt_sector=" cmdline parameters. > > > > > > This patch is based on the original work done by Colin Cross for the > > > downstream Android kernel. > > > > I don't think a magic command line is the way to go. The best would be > > to reverse-engineer the proprietary partition table format. If that is > > too hard we can at least key off the odd GPT location based of it's > > magic number. +1 > I thought that the backup GPT was always present in the standard location; If they have proprietary stuff on begin of the device and valid backup GPT at the end of the device then designer of this junk is crazy, because many GPT fdisk-like tools will try to recover from the backup header and overwrite the unknown (invalid) stuff at the begin of the device... Karel -- Karel Zak http://karelzak.blogspot.com