* Kernel 3.10.31 and SD card numbering and boot scripts @ 2014-10-10 0:00 Eric Nelson 2014-10-10 1:18 ` Otavio Salvador 0 siblings, 1 reply; 5+ messages in thread From: Eric Nelson @ 2014-10-10 0:00 UTC (permalink / raw) To: meta-freescale@yoctoproject.org; +Cc: Troy Hi all, The 3.10.31 kernel contains a nifty bit of code from Sascha Hauer that addresses the question of SD card numbering (device naming) quite well: http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mmc/card/block.c?h=imx_3.10.31_1.1.0_beta&id=5f9447e5d97060207c4742d5a06e5548de45972d https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html Unfortunately, it also changes the requirements for the kernel command-line and breaks our boot scripts. This is probably a good time to ask a related question about where we're keeping boot scripts. We have been compiling boot scripts out of our U-Boot tree from a Yocto-specific "6x_bootscript-yocto.txt" that implements the conventions of the Freescale Community BSP (kernel in the root of partition 1 and rootfs in partition 2). Since boot scripts have dependencies on a lot of things, it's not clear to me that they belong in the U-Boot source tree and that a Yocto-specific boot script really belongs directly in the Yocto tree somewhere. Since a Yocto build knows about the PREFERRED_VERSION of the kernel, it would be straightforward to have multiple versions of a boot script. Otherwise, we'd need to place a couple of versions in the U-Boot tree: 6x_bootscript-yocto.txt 6x_bootscript-yocto-after-3.10.17.txt and we'd also need some logic in u-boot-script-boundary.bb to choose between them. Before crafting a patch to do this, I'd like to get some feedback. Regards, Eric ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel 3.10.31 and SD card numbering and boot scripts 2014-10-10 0:00 Kernel 3.10.31 and SD card numbering and boot scripts Eric Nelson @ 2014-10-10 1:18 ` Otavio Salvador 2014-10-10 1:45 ` Eric Nelson 0 siblings, 1 reply; 5+ messages in thread From: Otavio Salvador @ 2014-10-10 1:18 UTC (permalink / raw) To: Eric Nelson; +Cc: meta-freescale@yoctoproject.org, Troy On Thu, Oct 9, 2014 at 9:00 PM, Eric Nelson <eric.nelson@boundarydevices.com> wrote: > The 3.10.31 kernel contains a nifty bit of code from Sascha Hauer > that addresses the question of SD card numbering (device naming) > quite well: > > http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mmc/card/block.c?h=imx_3.10.31_1.1.0_beta&id=5f9447e5d97060207c4742d5a06e5548de45972d > https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html > > Unfortunately, it also changes the requirements for the kernel > command-line and breaks our boot scripts. Yes. > This is probably a good time to ask a related question about > where we're keeping boot scripts. > > We have been compiling boot scripts out of our U-Boot tree > from a Yocto-specific "6x_bootscript-yocto.txt" that implements > the conventions of the Freescale Community BSP (kernel in > the root of partition 1 and rootfs in partition 2). > > Since boot scripts have dependencies on a lot of things, it's > not clear to me that they belong in the U-Boot source tree > and that a Yocto-specific boot script really belongs directly > in the Yocto tree somewhere. > > Since a Yocto build knows about the PREFERRED_VERSION of the > kernel, it would be straightforward to have multiple versions > of a boot script. > > Otherwise, we'd need to place a couple of versions in the > U-Boot tree: > 6x_bootscript-yocto.txt > 6x_bootscript-yocto-after-3.10.17.txt > and we'd also need some logic in u-boot-script-boundary.bb > to choose between them. > > Before crafting a patch to do this, I'd like to get some feedback. It is harder than it seems to be. The providing system does not track versions so you'd need to do some "uglyness" to make this work. Personally I think it is easier to address this on the bootscript itself using the setexpr command in U-Boot and with the REGEX config enabled. So you could try to match the kernel version on it somehow. Not sure if we have a command to 'ask' for the kernel version loaded though... -- Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel 3.10.31 and SD card numbering and boot scripts 2014-10-10 1:18 ` Otavio Salvador @ 2014-10-10 1:45 ` Eric Nelson 2014-10-10 12:23 ` Otavio Salvador 0 siblings, 1 reply; 5+ messages in thread From: Eric Nelson @ 2014-10-10 1:45 UTC (permalink / raw) To: Otavio Salvador; +Cc: meta-freescale@yoctoproject.org, Troy Thanks for the feedback Otavio, On 10/09/2014 06:18 PM, Otavio Salvador wrote: > On Thu, Oct 9, 2014 at 9:00 PM, Eric Nelson > <eric.nelson@boundarydevices.com> wrote: >> The 3.10.31 kernel contains a nifty bit of code from Sascha Hauer >> that addresses the question of SD card numbering (device naming) >> quite well: >> >> http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mmc/card/block.c?h=imx_3.10.31_1.1.0_beta&id=5f9447e5d97060207c4742d5a06e5548de45972d >> https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html >> >> Unfortunately, it also changes the requirements for the kernel >> command-line and breaks our boot scripts. > > Yes. > >> This is probably a good time to ask a related question about >> where we're keeping boot scripts. >> >> We have been compiling boot scripts out of our U-Boot tree >> from a Yocto-specific "6x_bootscript-yocto.txt" that implements >> the conventions of the Freescale Community BSP (kernel in >> the root of partition 1 and rootfs in partition 2). >> >> Since boot scripts have dependencies on a lot of things, it's >> not clear to me that they belong in the U-Boot source tree >> and that a Yocto-specific boot script really belongs directly >> in the Yocto tree somewhere. >> >> Since a Yocto build knows about the PREFERRED_VERSION of the >> kernel, it would be straightforward to have multiple versions >> of a boot script. >> >> Otherwise, we'd need to place a couple of versions in the >> U-Boot tree: >> 6x_bootscript-yocto.txt >> 6x_bootscript-yocto-after-3.10.17.txt >> and we'd also need some logic in u-boot-script-boundary.bb >> to choose between them. >> >> Before crafting a patch to do this, I'd like to get some feedback. > > It is harder than it seems to be. The providing system does not track > versions so you'd need to do some "uglyness" to make this work. > I haven't tried, but it seems generally useful to allow conditionals based on kernel versions in Yocto/OE and I'm surprised that there isn't a stock way of doing this. > Personally I think it is easier to address this on the bootscript > itself using the setexpr command in U-Boot and with the REGEX config > enabled. So you could try to match the kernel version on it somehow. > > Not sure if we have a command to 'ask' for the kernel version loaded though... > Not currently. Using a root=PARTUUID=blah would also be nice and might allow the same command-line on multiple kernel versions. Unfortunately, this doesn't seem to work: https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.31_1.1.0_beta/init/do_mounts.c#L213 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel 3.10.31 and SD card numbering and boot scripts 2014-10-10 1:45 ` Eric Nelson @ 2014-10-10 12:23 ` Otavio Salvador 2014-10-10 14:04 ` Eric Nelson 0 siblings, 1 reply; 5+ messages in thread From: Otavio Salvador @ 2014-10-10 12:23 UTC (permalink / raw) To: Eric Nelson; +Cc: meta-freescale@yoctoproject.org, Troy On Thu, Oct 9, 2014 at 10:45 PM, Eric Nelson <eric.nelson@boundarydevices.com> wrote: > Thanks for the feedback Otavio, > > On 10/09/2014 06:18 PM, Otavio Salvador wrote: >> On Thu, Oct 9, 2014 at 9:00 PM, Eric Nelson >> <eric.nelson@boundarydevices.com> wrote: >>> The 3.10.31 kernel contains a nifty bit of code from Sascha Hauer >>> that addresses the question of SD card numbering (device naming) >>> quite well: >>> >>> http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mmc/card/block.c?h=imx_3.10.31_1.1.0_beta&id=5f9447e5d97060207c4742d5a06e5548de45972d >>> https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html >>> >>> Unfortunately, it also changes the requirements for the kernel >>> command-line and breaks our boot scripts. >> >> Yes. >> >>> This is probably a good time to ask a related question about >>> where we're keeping boot scripts. >>> >>> We have been compiling boot scripts out of our U-Boot tree >>> from a Yocto-specific "6x_bootscript-yocto.txt" that implements >>> the conventions of the Freescale Community BSP (kernel in >>> the root of partition 1 and rootfs in partition 2). >>> >>> Since boot scripts have dependencies on a lot of things, it's >>> not clear to me that they belong in the U-Boot source tree >>> and that a Yocto-specific boot script really belongs directly >>> in the Yocto tree somewhere. >>> >>> Since a Yocto build knows about the PREFERRED_VERSION of the >>> kernel, it would be straightforward to have multiple versions >>> of a boot script. >>> >>> Otherwise, we'd need to place a couple of versions in the >>> U-Boot tree: >>> 6x_bootscript-yocto.txt >>> 6x_bootscript-yocto-after-3.10.17.txt >>> and we'd also need some logic in u-boot-script-boundary.bb >>> to choose between them. >>> >>> Before crafting a patch to do this, I'd like to get some feedback. >> >> It is harder than it seems to be. The providing system does not track >> versions so you'd need to do some "uglyness" to make this work. >> > > I haven't tried, but it seems generally useful to allow > conditionals based on kernel versions in Yocto/OE and I'm > surprised that there isn't a stock way of doing this. It would be indeed however there are some complexities as package feed upgrade path and other details which makes this very complex. As I said, I think this is technically possible to be done but will require some 'hacks'. >> Personally I think it is easier to address this on the bootscript >> itself using the setexpr command in U-Boot and with the REGEX config >> enabled. So you could try to match the kernel version on it somehow. >> >> Not sure if we have a command to 'ask' for the kernel version loaded though... >> > > Not currently. > > Using a root=PARTUUID=blah would also be nice and might allow the same > command-line on multiple kernel versions. > > Unfortunately, this doesn't seem to work: > https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.31_1.1.0_beta/init/do_mounts.c#L213 The problem with the UUID is because we need to inject it during rootfs generation and it'd not be in the initial environment, so an 'env default -f -a' would make the system not bootable. In your case, as you use the script in a partition it is more doable but it'd not be an generic solution. -- Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Kernel 3.10.31 and SD card numbering and boot scripts 2014-10-10 12:23 ` Otavio Salvador @ 2014-10-10 14:04 ` Eric Nelson 0 siblings, 0 replies; 5+ messages in thread From: Eric Nelson @ 2014-10-10 14:04 UTC (permalink / raw) To: Otavio Salvador; +Cc: meta-freescale@yoctoproject.org, Troy Hi Otavio, On 10/10/2014 05:23 AM, Otavio Salvador wrote: > On Thu, Oct 9, 2014 at 10:45 PM, Eric Nelson > <eric.nelson@boundarydevices.com> wrote: >> Thanks for the feedback Otavio, >> >> On 10/09/2014 06:18 PM, Otavio Salvador wrote: >>> On Thu, Oct 9, 2014 at 9:00 PM, Eric Nelson >>> <eric.nelson@boundarydevices.com> wrote: >>>> The 3.10.31 kernel contains a nifty bit of code from Sascha Hauer >>>> that addresses the question of SD card numbering (device naming) >>>> quite well: >>>> >>>> http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/mmc/card/block.c?h=imx_3.10.31_1.1.0_beta&id=5f9447e5d97060207c4742d5a06e5548de45972d >>>> https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html >>>> >>>> Unfortunately, it also changes the requirements for the kernel >>>> command-line and breaks our boot scripts. >>> >>> Yes. >>> >>>> This is probably a good time to ask a related question about >>>> where we're keeping boot scripts. >>>> >>>> We have been compiling boot scripts out of our U-Boot tree >>>> from a Yocto-specific "6x_bootscript-yocto.txt" that implements >>>> the conventions of the Freescale Community BSP (kernel in >>>> the root of partition 1 and rootfs in partition 2). >>>> >>>> Since boot scripts have dependencies on a lot of things, it's >>>> not clear to me that they belong in the U-Boot source treet >>>> and that a Yocto-specific boot script really belongs directly >>>> in the Yocto tree somewhere. >>>> >>>> Since a Yocto build knows about the PREFERRED_VERSION of the >>>> kernel, it would be straightforward to have multiple versions >>>> of a boot script. >>>> >>>> Otherwise, we'd need to place a couple of versions in the >>>> U-Boot tree: >>>> 6x_bootscript-yocto.txt >>>> 6x_bootscript-yocto-after-3.10.17.txt >>>> and we'd also need some logic in u-boot-script-boundary.bb >>>> to choose between them. >>>> >>>> Before crafting a patch to do this, I'd like to get some feedback. >>> >>> It is harder than it seems to be. The providing system does not track >>> versions so you'd need to do some "uglyness" to make this work. >>> >> >> I haven't tried, but it seems generally useful to allow >> conditionals based on kernel versions in Yocto/OE and I'm >> surprised that there isn't a stock way of doing this. > > It would be indeed however there are some complexities as package feed > upgrade path and other details which makes this very complex. > > As I said, I think this is technically possible to be done but will > require some 'hacks'. > >>> Personally I think it is easier to address this on the bootscript >>> itself using the setexpr command in U-Boot and with the REGEX config >>> enabled. So you could try to match the kernel version on it somehow. >>> >>> Not sure if we have a command to 'ask' for the kernel version loaded though... >>> >> >> Not currently. >> >> Using a root=PARTUUID=blah would also be nice and might allow the same >> command-line on multiple kernel versions. >> >> Unfortunately, this doesn't seem to work: >> https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.10.31_1.1.0_beta/init/do_mounts.c#L213 > > The problem with the UUID is because we need to inject it during > rootfs generation and it'd not be in the initial environment, so an > 'env default -f -a' would make the system not bootable. In your case, > as you use the script in a partition it is more doable but it'd not be > an generic solution. > If the kernel could accept a PARTUUID parameter, the boot script could potentially produce it, but that doesn't seem to be an immediate option. Regards, Eric ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-10 14:05 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-10-10 0:00 Kernel 3.10.31 and SD card numbering and boot scripts Eric Nelson 2014-10-10 1:18 ` Otavio Salvador 2014-10-10 1:45 ` Eric Nelson 2014-10-10 12:23 ` Otavio Salvador 2014-10-10 14:04 ` Eric Nelson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.