Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
Hi Sascha, Am 06.06.2017 um 07:46 schrieb Sascha Hauer: Hi Daniel, On Fri, Jun 02, 2017 at 10:07:34AM +0200, Daniel Schultz wrote: Hi, Am 17.05.2017 um 08:30 schrieb Sascha Hauer: On Fri, May 12, 2017 at 01:07:18PM +0200, Daniel Schultz wrote: Expand the boot scripts with EMMC and add a default file source for expansions. Removed "rw" and "rootwait" bootargs from existing boot scripts. Added "rootflags='data=journal'" bootarg to SD card boot script. Signed-off-by: Daniel Schultz--- .../defaultenv-physom-am335x/boot/emmc | 7 +++ .../phytec-som-am335x/defaultenv-physom-am335x/boot/mmc | 7 --- .../defaultenv-physom-am335x/boot/nand | 4 +++- .../phytec-som-am335x/defaultenv-physom-am335x/boot/net | 17 + .../phytec-som-am335x/defaultenv-physom-am335x/boot/spi | 4 +++- .../defaultenv-physom-am335x/init/bootsource| 16 6 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file mode 100644 index 000..6ad5f87 --- /dev/null +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -e /env/config-expansions ] && /env/config-expansions What do you have in these config-expansions or what do you expect to be there? These config-expanions files contain source commands for different expansions like HDMI, LCD, WiFi, ... and are written from Yocto. We don't want to bring these mainline, but without this line we have to overwrite each boot script file from Yocto. Maybe this could be a good feature since we're not the only one with expansion configurations. I am generally open to such expansions, I just want to understand what's missing first. In this case I'd like to understand why you can't add an init script to /env/bin/init/ instead. If you want to extend the kernel commandline you could also add a nv variable to /env/nv/linux.bootargs.yocto. Oh I didn't know this part of the bin/init script. What do you think about this change? This would complete the config hierarchy by expensions: +++ b/defaultenv/defaultenv-2-base/bin/init @@ -25,6 +25,7 @@ magicvar -a global.allow_color "Allow color on the console (boolean)" [ -z "${global.editcmd}" ] && global.editcmd=sedit [ -e /env/config-board ] && /env/config-board +[ -e /env/config-expansions ] && /env/config-expansions /env/config # allow to stop the boot before execute the /env/init/* Otherwise I would move the config-expanions scripts to init/ The problem with the nv vars are the differences between the bootsources. Is there a way to add these vars with something like linux.bootargs.rootfs.mmc ? -- Mit freundlichen Grüßen, With best regards, Daniel Schultz ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
Hi Daniel, On Fri, Jun 02, 2017 at 10:07:34AM +0200, Daniel Schultz wrote: > Hi, > > Am 17.05.2017 um 08:30 schrieb Sascha Hauer: > > On Fri, May 12, 2017 at 01:07:18PM +0200, Daniel Schultz wrote: > > > Expand the boot scripts with EMMC and add a default file source for > > > expansions. > > > > > > Removed "rw" and "rootwait" bootargs from existing boot scripts. > > > Added "rootflags='data=journal'" bootarg to SD card boot script. > > > > > > Signed-off-by: Daniel Schultz> > > --- > > > .../defaultenv-physom-am335x/boot/emmc | 7 +++ > > > .../phytec-som-am335x/defaultenv-physom-am335x/boot/mmc | 7 --- > > > .../defaultenv-physom-am335x/boot/nand | 4 +++- > > > .../phytec-som-am335x/defaultenv-physom-am335x/boot/net | 17 > > > + > > > .../phytec-som-am335x/defaultenv-physom-am335x/boot/spi | 4 +++- > > > .../defaultenv-physom-am335x/init/bootsource| 16 > > > > > > 6 files changed, 46 insertions(+), 9 deletions(-) > > > create mode 100644 > > > arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > > > create mode 100644 > > > arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net > > > > > > diff --git > > > a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > > > b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > > > new file mode 100644 > > > index 000..6ad5f87 > > > --- /dev/null > > > +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > > > @@ -0,0 +1,7 @@ > > > +#!/bin/sh > > > + > > > +[ -e /env/config-expansions ] && /env/config-expansions > > > > What do you have in these config-expansions or what do you expect to be > > there? > > > > These config-expanions files contain source commands for different > expansions like HDMI, LCD, WiFi, ... and are written from Yocto. We don't > want to bring these mainline, but without this line we have to overwrite > each boot script file from Yocto. > > Maybe this could be a good feature since we're not the only one with > expansion configurations. I am generally open to such expansions, I just want to understand what's missing first. In this case I'd like to understand why you can't add an init script to /env/bin/init/ instead. If you want to extend the kernel commandline you could also add a nv variable to /env/nv/linux.bootargs.yocto. 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
On Fri, May 12, 2017 at 01:07:18PM +0200, Daniel Schultz wrote: > Expand the boot scripts with EMMC and add a default file source for > expansions. > > Removed "rw" and "rootwait" bootargs from existing boot scripts. > Added "rootflags='data=journal'" bootarg to SD card boot script. > > Signed-off-by: Daniel Schultz> --- > .../defaultenv-physom-am335x/boot/emmc | 7 +++ > .../phytec-som-am335x/defaultenv-physom-am335x/boot/mmc | 7 --- > .../defaultenv-physom-am335x/boot/nand | 4 +++- > .../phytec-som-am335x/defaultenv-physom-am335x/boot/net | 17 > + > .../phytec-som-am335x/defaultenv-physom-am335x/boot/spi | 4 +++- > .../defaultenv-physom-am335x/init/bootsource| 16 > 6 files changed, 46 insertions(+), 9 deletions(-) > create mode 100644 > arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > create mode 100644 > arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net > > diff --git > a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > new file mode 100644 > index 000..6ad5f87 > --- /dev/null > +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc > @@ -0,0 +1,7 @@ > +#!/bin/sh > + > +[ -e /env/config-expansions ] && /env/config-expansions What do you have in these config-expansions or what do you expect to be there? 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
[PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
Expand the boot scripts with EMMC and add a default file source for expansions. Removed "rw" and "rootwait" bootargs from existing boot scripts. Added "rootflags='data=journal'" bootarg to SD card boot script. Signed-off-by: Daniel Schultz--- .../defaultenv-physom-am335x/boot/emmc | 7 +++ .../phytec-som-am335x/defaultenv-physom-am335x/boot/mmc | 7 --- .../defaultenv-physom-am335x/boot/nand | 4 +++- .../phytec-som-am335x/defaultenv-physom-am335x/boot/net | 17 + .../phytec-som-am335x/defaultenv-physom-am335x/boot/spi | 4 +++- .../defaultenv-physom-am335x/init/bootsource| 16 6 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file mode 100644 index 000..6ad5f87 --- /dev/null +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -e /env/config-expansions ] && /env/config-expansions + +global.bootm.image=/mnt/mmc1.0/linuximage +global.bootm.oftree=/mnt/mmc1.0/oftree +global.linux.bootargs.dyn.root="root=/dev/mmcblk1p2 rootflags='data=journal'" diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc index 834669d..0fefeb2 100644 --- a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc @@ -1,6 +1,7 @@ #!/bin/sh -global.bootm.image=/boot/linuximage -global.bootm.oftree=/boot/oftree +[ -e /env/config-expansions ] && /env/config-expansions -global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rw rootwait" +global.bootm.image=/mnt/mmc0.0/linuximage +global.bootm.oftree=/mnt/mmc0.0/oftree +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootflags='data=journal'" diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand index ece44b7..fa695bb 100644 --- a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand @@ -1,8 +1,10 @@ #!/bin/sh +[ -e /env/config-expansions ] && /env/config-expansions + [ ! -e /dev/nand0.root.ubi ] && ubiattach /dev/nand0.root global.bootm.image="/dev/nand0.root.ubi.kernel" global.bootm.oftree="/dev/nand0.root.ubi.oftree" -global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rw rootfstype=ubifs" +global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rootfstype=ubifs" diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net new file mode 100644 index 000..6dbd2aa --- /dev/null +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net @@ -0,0 +1,17 @@ +#!/bin/sh + +path="/mnt/tftp" + +global.bootm.image="${path}/${global.user}-linux-${global.hostname}" + +oftree="${path}/${global.user}-oftree-${global.hostname}" +if [ -f "${oftree}" ]; then +global.bootm.oftree="$oftree" +fi + +nfsroot="/nfsroot/${global.hostname}" +bootargs-ip + +[ -e /env/config-expansions ] && /env/config-expansions + +global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,vers=3,udp" diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi index 71c5834..2d88626 100644 --- a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi @@ -1,7 +1,9 @@ #!/bin/sh +[ -e /env/config-expansions ] && /env/config-expansions + global.bootm.image="/dev/m25p0.kernel" global.bootm.oftree="/dev/m25p0.oftree" # Use rootfs from NAND -global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rw rootfstype=ubifs" +global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource index 3f2ff4b..61a0879 100644 --- a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource @@ -4,12 +4,20 @@ if [ -n "$nv.boot.default" ]; then exit fi -if [ $bootsource = mmc ]; then - global.boot.default="mmc nand spi net" +if [ -e /dev/mmc1.0 ]; then + nvmem="emmc" +else + nvmem="nand" +fi + +if [ $bootsource = mmc -a