Skip to contentSkip to conversation

arm: mach-omap: Change mountpoint of boot partitions

PATCH In review Daniel Schultz 2 participants 13 messages May 12, 2017 – Jun 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 arm: mach-omap: Change mountpoint of boot partitions

If using EMMC and SD as bootsources, mounting the boot partition of both devices to /boot makes trouble. Either the correct device is mounted to /boot or a remount of /boot has to be performed.

To ensure this problem each MMCn bootsource will be mounted to his own path in /mnt/mmcN.0

---
Changes:
v3: Added symlink from rootpath to BOOT_PATH

 arch/arm/mach-omap/omap_generic.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)
arch/arm/mach-omap/omap_generic.c +25 -11
index 1d03eac..694c951 100644
@@ -113,12 +113,15 @@ const char *omap_get_bootmmc_devname(void)
 }
 
 #if defined(CONFIG_ENV_HANDLING)
-#define ENV_PATH "/boot/barebox.env"
+static char *envpath = "/mnt/mmc0.0/barebox.env";
+
 static int omap_env_init(void)
 {
-	char *partname;
-	const char *diskdev;
 	int ret;
+	const char *diskdev;
+	char *partname;
+	struct cdev *cdev;
+	const char *rootpath;
 
 	if (bootsource_get() != BOOTSOURCE_MMC)
 		return 0;
@@ -129,18 +132,29 @@ static int omap_env_init(void)
 		diskdev = "disk0";
 
 	device_detect_by_name(diskdev);
+	partname = basprintf("%s.0", diskdev);
+	cdev = cdev_by_name(partname);
+	if (cdev == NULL) {
+		pr_err("Failed to get device %s\n", partname);
+		goto out;
+	}
 
-	partname = basprintf("/dev/%s.0", diskdev);
-
-	mkdir("/boot", 0666);
-	ret = mount(partname, "fat", "/boot", NULL);
-	if (ret) {
-		pr_err("Failed to load environment: mount %s failed (%d)\n", partname, ret);
+	rootpath = cdev_mount_default(cdev, NULL);
+	if (IS_ERR(rootpath)) {
+		pr_err("Failed to load environment: mount %s failed (%d)\n",
+						cdev->name, IS_ERR(rootpath));
 		goto out;
 	}
+	ret = symlink(rootpath, "/boot");
+	if (ret < 0)
+		pr_warn("Failed to create symlink from %s to %s\n", rootpath
+								, "/boot");
+
+	envpath = basprintf("%s/barebox.env", rootpath);
 
-	pr_debug("Loading default env from %s on device %s\n", ENV_PATH, partname);
-	default_environment_path_set(ENV_PATH);
+	pr_debug("Loading default env from %s on device %s\n", envpath,
+								partname);
+	default_environment_path_set(envpath);
 
 out:
 	free(partname);
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v3 2/4 arm: boards: phytec-som-am335x: Add automount script

Each MMC boot source is mounted to /mnt/mmcN.0. To make the not-mounted boot source available in Barebox, an automount script mounts this device also to /mnt/, if the directory will be accessed.

---
 .../defaultenv-physom-am335x/init/automount         | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount new file +21 -0
new file mode 100644
index 0000000..53ecbe3
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+# automount nfs server's nfsroot
+
+mkdir -p /mnt/nfs
+automount /mnt/nfs 'ifup eth0 && mount -t nfs ${eth0.serverip}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+
+#automount SD card and EMMC boot partitions
+
+if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
+	mkdir -p /mnt/mmc0.0
+	automount /mnt/mmc0.0 '[ -e /dev/mmc0.0 ] && mount /dev/mmc0.0 /mnt/mmc0.0'
+else
+	mkdir -p /mnt/mmc1.0
+	automount /mnt/mmc1.0 '[ -e /dev/mmc1.0 ] && mount /dev/mmc1.0 /mnt/mmc1.0'
+fi
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH v3 3/4 arm: boards: phytec-som-am335x: Update boot scripts

In reply to Daniel Schultz

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.

---
 .../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
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +7 -0
new file mode 100644
index 0000000..6ad5f87
@@ -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'"
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/mmc +4 -3
index 834669d..0fefeb2 100644
@@ -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'"
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/nand +3 -1
index ece44b7..fa695bb 100644
@@ -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"
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/net new file +17 -0
new file mode 100644
index 0000000..6dbd2aa
@@ -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"
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/spi +3 -1
index 71c5834..2d88626 100644
@@ -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"
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource +12 -4
index 3f2ff4b..61a0879 100644
@@ -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 $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
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH v3 4/4 arm: boards: beaglebone: Delete default env

In reply to Daniel Schultz

The Beaglebone environment should be set from outside with an application specific environment.

---
 arch/arm/boards/beaglebone/Makefile                                 | 1 -
 arch/arm/boards/beaglebone/board.c                                  | 2 --
 arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd            | 6 ------
 .../arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 | 5 -----
 4 files changed, 14 deletions(-)
 delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
 delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
arch/arm/boards/beaglebone/Makefile +0 -1
index 21a1a29..092c31d 100644
@@ -1,3 +1,2 @@
 lwl-y += lowlevel.o
 obj-y += board.o
-bbenv-y += defaultenv-beaglebone
arch/arm/boards/beaglebone/board.c +0 -2
index 5717c45..fc16aea 100644
@@ -85,8 +85,6 @@ static int beaglebone_devices_init(void)
 
 	black = is_beaglebone_black();
 
-	defaultenv_append_directory(defaultenv_beaglebone);
-
 	globalvar_add_simple("board.variant", black ? "boneblack" : "bone");
 
 	printf("detected 'BeagleBone %s'\n", black ? "Black" : "White");
arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd deleted +0 -6
deleted file mode 100644
index aa94b2f..0000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-global.bootm.image=/boot/uImage
-global.bootm.oftree=/boot/oftree
-#global.bootm.initrd=<path to initrd>
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 deleted +0 -5
deleted file mode 100644
index 56313bf..0000000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo -n "changing USB current limit to 1300 mA... "
-i2c_write -b 0 -a 0x24 -r 0x01 0x3e
-echo "done"
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw
In reply to Daniel Schultz
Quoted 11 lines · Daniel Schultz

If using EMMC and SD as bootsources, mounting the boot partition of both devices to /boot makes trouble. Either the correct device is mounted to /boot or a remount of /boot has to be performed.

To ensure this problem each MMCn bootsource will be mounted to his own path in /mnt/mmcN.0

---
Changes:
v3: Added symlink from rootpath to BOOT_PATH

Applied (this patch), thanks

Sascha

Quoted 74 lines
 arch/arm/mach-omap/omap_generic.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)
arch/arm/mach-omap/omap_generic.c +25 -11
index 1d03eac..694c951 100644
@@ -113,12 +113,15 @@ const char *omap_get_bootmmc_devname(void)
 }
 
 #if defined(CONFIG_ENV_HANDLING)
-#define ENV_PATH "/boot/barebox.env"
+static char *envpath = "/mnt/mmc0.0/barebox.env";
+
 static int omap_env_init(void)
 {
-	char *partname;
-	const char *diskdev;
 	int ret;
+	const char *diskdev;
+	char *partname;
+	struct cdev *cdev;
+	const char *rootpath;
 
 	if (bootsource_get() != BOOTSOURCE_MMC)
 		return 0;
@@ -129,18 +132,29 @@ static int omap_env_init(void)
 		diskdev = "disk0";
 
 	device_detect_by_name(diskdev);
+	partname = basprintf("%s.0", diskdev);
+	cdev = cdev_by_name(partname);
+	if (cdev == NULL) {
+		pr_err("Failed to get device %s\n", partname);
+		goto out;
+	}
 
-	partname = basprintf("/dev/%s.0", diskdev);
-
-	mkdir("/boot", 0666);
-	ret = mount(partname, "fat", "/boot", NULL);
-	if (ret) {
-		pr_err("Failed to load environment: mount %s failed (%d)\n", partname, ret);
+	rootpath = cdev_mount_default(cdev, NULL);
+	if (IS_ERR(rootpath)) {
+		pr_err("Failed to load environment: mount %s failed (%d)\n",
+						cdev->name, IS_ERR(rootpath));
 		goto out;
 	}
+	ret = symlink(rootpath, "/boot");
+	if (ret < 0)
+		pr_warn("Failed to create symlink from %s to %s\n", rootpath
+								, "/boot");
+
+	envpath = basprintf("%s/barebox.env", rootpath);
 
-	pr_debug("Loading default env from %s on device %s\n", ENV_PATH, partname);
-	default_environment_path_set(ENV_PATH);
+	pr_debug("Loading default env from %s on device %s\n", envpath,
+								partname);
+	default_environment_path_set(envpath);
 
 out:
 	free(partname);
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script

In reply to Daniel Schultz
Quoted 9 lines · Daniel Schultz

Each MMC boot source is mounted to /mnt/mmcN.0. To make the not-mounted boot source available in Barebox, an automount script mounts this device also to /mnt/, if the directory will be accessed.

---
 .../defaultenv-physom-am335x/init/automount         | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount

This should not be needed when "fs: Create automount entries for the default mount pathes" is applied, right?

Sascha

Quoted 37 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount new file +21 -0
new file mode 100644
index 0000000..53ecbe3
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+# automount nfs server's nfsroot
+
+mkdir -p /mnt/nfs
+automount /mnt/nfs 'ifup eth0 && mount -t nfs ${eth0.serverip}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+
+#automount SD card and EMMC boot partitions
+
+if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
+	mkdir -p /mnt/mmc0.0
+	automount /mnt/mmc0.0 '[ -e /dev/mmc0.0 ] && mount /dev/mmc0.0 /mnt/mmc0.0'
+else
+	mkdir -p /mnt/mmc1.0
+	automount /mnt/mmc1.0 '[ -e /dev/mmc1.0 ] && mount /dev/mmc1.0 /mnt/mmc1.0'
+fi
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts

In reply to Daniel Schultz
Quoted 24 lines · Daniel Schultz

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.

---
 .../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
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +0 -0
new file mode 100644
index 0000000..6ad5f87

arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc line 3

Quoted 3 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +3 -0
@@ -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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

Re: [PATCH v3 4/4] arm: boards: beaglebone: Delete default env

In reply to Daniel Schultz
Quoted 16 lines · Daniel Schultz

The Beaglebone environment should be set from outside with an application specific environment.

---
 arch/arm/boards/beaglebone/Makefile                                 | 1 -
 arch/arm/boards/beaglebone/board.c                                  | 2 --
 arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd            | 6 ------
 .../arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 | 5 -----
 4 files changed, 14 deletions(-)
 delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
 delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300

arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 line 5

Quoted 5 lines
arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 deleted +0 -5
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo -n "changing USB current limit to 1300 mA... "
-i2c_write -b 0 -a 0x24 -r 0x01 0x3e
-echo "done"

We need this on the beagleboard. We can't just delete it without doing this somewhere else.

Also I still do not understand the reasoning behind this change. Where is "outside", to which application should the environment be specific to?

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script

In reply to Sascha Hauer

Hi,

Am 17.05.2017 um 08:26 schrieb Sascha Hauer:

Quoted 5 lines · Daniel Schultz
Quoted 4 lines

Each MMC boot source is mounted to /mnt/mmcN.0. To make the not-mounted boot source available in Barebox, an automount script mounts this device also to /mnt/, if the directory will be accessed.

Quoted 8 lines
Quoted 5 lines
---
  .../defaultenv-physom-am335x/init/automount         | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

create mode 100644 arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount

This should not be needed when "fs: Create automount entries for the default mount pathes" is applied, right?

If your patch will mount every mountable device to /mnt/, this patch is not necessary.

Daniel

Quoted 41 lines

Sascha

Quoted 37 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount new file +21 -0
new file mode 100644
index 0000000..53ecbe3
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+# automount nfs server's nfsroot
+
+mkdir -p /mnt/nfs
+automount /mnt/nfs 'ifup eth0 && mount -t nfs ${eth0.serverip}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+
+#automount SD card and EMMC boot partitions
+
+if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
+	mkdir -p /mnt/mmc0.0
+	automount /mnt/mmc0.0 '[ -e /dev/mmc0.0 ] && mount /dev/mmc0.0 /mnt/mmc0.0'
+else
+	mkdir -p /mnt/mmc1.0
+	automount /mnt/mmc1.0 '[ -e /dev/mmc1.0 ] && mount /dev/mmc1.0 /mnt/mmc1.0'
+fi
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 8 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts

In reply to Sascha Hauer

Hi,

Am 17.05.2017 um 08:30 schrieb Sascha Hauer:

Quoted 19 lines · Daniel Schultz
Quoted 18 lines

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.

---
  .../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

Quoted 13 lines

arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc line 3

Quoted 9 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +3 -0
new file mode 100644
index 0000000..6ad5f87
@@ -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.

Signature · 8 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts

Hi Daniel,

Quoted 36 lines · Daniel Schultz

Hi,

Am 17.05.2017 um 08:30 schrieb Sascha Hauer:

Quoted 19 lines · Daniel Schultz
Quoted 18 lines

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.

---
  .../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

Quoted 13 lines

arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc line 3

Quoted 9 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +3 -0
new file mode 100644
index 0000000..6ad5f87
@@ -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?

Quoted 7 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

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:

Quoted 44 lines

Hi Daniel,

Quoted 41 lines · Daniel Schultz

Hi,

Am 17.05.2017 um 08:30 schrieb Sascha Hauer:

Quoted 19 lines · Daniel Schultz
Quoted 18 lines

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.

---
   .../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

Quoted 13 lines

arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc line 3

Quoted 9 lines
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/boot/emmc new file +3 -0
new file mode 100644
index 0000000..6ad5f87
@@ -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.

Quoted 9 lines
Quoted 2 lines

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 ?

Signature · 8 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

Re: [PATCH v3 4/4] arm: boards: beaglebone: Delete default env

In reply to Sascha Hauer

Hi Sascha,

Am 17.05.2017 um 08:35 schrieb Sascha Hauer:

Quoted 26 lines · Daniel Schultz
Quoted 16 lines

The Beaglebone environment should be set from outside with an application specific environment.

---
  arch/arm/boards/beaglebone/Makefile                                 | 1 -
  arch/arm/boards/beaglebone/board.c                                  | 2 --
  arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd            | 6 ------
  .../arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 | 5 -----
  4 files changed, 14 deletions(-)

delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd delete mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300

arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 line 5

Quoted 5 lines
arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 deleted +0 -5
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo -n "changing USB current limit to 1300 mA... "
-i2c_write -b 0 -a 0x24 -r 0x01 0x3e
-echo "done"

We need this on the beagleboard. We can't just delete it without doing this somewhere else.

Quoted 3 lines

Also I still do not understand the reasoning behind this change. Where is "outside", to which application should the environment be specific to?

Please revoke this patch. Sorry.

Quoted 3 lines

Sascha

Signature · 8 lines
Mit freundlichen Grüßen,
With best regards,
  Daniel Schultz

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox