Re: [PATCH v5] arm: boards: phytec-som-am335x: Update boot scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sascha,

Am 26.06.2017 um 08:35 schrieb Sascha Hauer:
On Tue, Jun 20, 2017 at 05:42:22PM +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.

Why is "rootwait" removed? From my experience adding "rootwait" is
pretty essential when booting from mmc. Has that changed?

Ah that's a good point! We add these commands in Yocto, but I forgot the use case without Yocto. So I will add a nv/linux.bootargs.rootfs file with "rootwait ro fsck.repair=yes" (fsck.repair is a systemd unit).

-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 $bootsource_instance = 1 ]; then
+	global.boot.default="emmc mmc spi net"
+elif [ $bootsource = mmc -a $bootsource_instance = 0 ]; then
+	global.boot.default="mmc $nvmem spi net"
  elif [ $bootsource = nand ]; then
  	global.boot.default="nand spi mmc net"
  elif [ $bootsource = spi ]; then
-	global.boot.default="spi nand mmc net"
+	global.boot.default="spi $nvmem mmc net"
  elif [ $bootsource = net ]; then
-	global.boot.default="net nand spi mmc"
+	global.boot.default="net $nvmem spi mmc"
  fi

Normally the desired behaviour is that the bootsource can be changed
persistently by setting nv.boot.default to the desired source. This
does not work when global.boot.default gets overwritten after the nvvars
have been read from the environment.

This behaviour is not changed with this patch, but I would welcome a
patch that changes this script to the desired behaviour. This could
be done by changing global.boot.default only when nv.boot.default is
empty.


This is already implemented by a test above these changes, isn't it?

snippet from init/bootsource:
1 #!/bin/sh 2 3 if [ -n "$nv.boot.default" ]; then 4 exit 5 fi 6
  7 if [ -e /dev/mmc1.0 ]; then
  ...

Sascha


--
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux