* [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions
@ 2017-05-12 11:07 Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script Daniel Schultz
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Daniel Schultz @ 2017-05-12 11:07 UTC (permalink / raw)
To: barebox
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
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
Changes:
v3: Added symlink from rootpath to BOOT_PATH
arch/arm/mach-omap/omap_generic.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
index 1d03eac..694c951 100644
--- a/arch/arm/mach-omap/omap_generic.c
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -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);
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script
2017-05-12 11:07 [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Daniel Schultz
@ 2017-05-12 11:07 ` Daniel Schultz
2017-05-17 6:26 ` Sascha Hauer
2017-05-12 11:07 ` [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts Daniel Schultz
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Daniel Schultz @ 2017-05-12 11:07 UTC (permalink / raw)
To: barebox
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.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
.../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
diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
new file mode 100644
index 0000000..53ecbe3
--- /dev/null
+++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
@@ -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
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
2017-05-12 11:07 [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script Daniel Schultz
@ 2017-05-12 11:07 ` Daniel Schultz
2017-05-17 6:30 ` Sascha Hauer
2017-05-12 11:07 ` [PATCH v3 4/4] arm: boards: beaglebone: Delete default env Daniel Schultz
2017-05-17 6:25 ` [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Sascha Hauer
3 siblings, 1 reply; 13+ messages in thread
From: Daniel Schultz @ 2017-05-12 11:07 UTC (permalink / raw)
To: barebox
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 <d.schultz@phytec.de>
---
.../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 0000000..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 0000000..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 $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
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 4/4] arm: boards: beaglebone: Delete default env
2017-05-12 11:07 [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts Daniel Schultz
@ 2017-05-12 11:07 ` Daniel Schultz
2017-05-17 6:35 ` Sascha Hauer
2017-05-17 6:25 ` [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Sascha Hauer
3 siblings, 1 reply; 13+ messages in thread
From: Daniel Schultz @ 2017-05-12 11:07 UTC (permalink / raw)
To: barebox
The Beaglebone environment should be set from outside with an application
specific environment.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
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
diff --git a/arch/arm/boards/beaglebone/Makefile b/arch/arm/boards/beaglebone/Makefile
index 21a1a29..092c31d 100644
--- a/arch/arm/boards/beaglebone/Makefile
+++ b/arch/arm/boards/beaglebone/Makefile
@@ -1,3 +1,2 @@
lwl-y += lowlevel.o
obj-y += board.o
-bbenv-y += defaultenv-beaglebone
diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index 5717c45..fc16aea 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -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");
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd b/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
deleted file mode 100644
index aa94b2f..0000000
--- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/boot/sd
+++ /dev/null
@@ -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"
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300 b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
deleted file mode 100644
index 56313bf..0000000
--- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
+++ /dev/null
@@ -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"
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions
2017-05-12 11:07 [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Daniel Schultz
` (2 preceding siblings ...)
2017-05-12 11:07 ` [PATCH v3 4/4] arm: boards: beaglebone: Delete default env Daniel Schultz
@ 2017-05-17 6:25 ` Sascha Hauer
3 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2017-05-17 6:25 UTC (permalink / raw)
To: Daniel Schultz; +Cc: barebox
On Fri, May 12, 2017 at 01:07:16PM +0200, Daniel Schultz wrote:
> 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
>
> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
> Changes:
> v3: Added symlink from rootpath to BOOT_PATH
Applied (this patch), thanks
Sascha
>
> arch/arm/mach-omap/omap_generic.c | 36 +++++++++++++++++++++++++-----------
> 1 file changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
> index 1d03eac..694c951 100644
> --- a/arch/arm/mach-omap/omap_generic.c
> +++ b/arch/arm/mach-omap/omap_generic.c
> @@ -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);
> --
> 1.9.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script
2017-05-12 11:07 ` [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script Daniel Schultz
@ 2017-05-17 6:26 ` Sascha Hauer
2017-06-02 7:59 ` Daniel Schultz
0 siblings, 1 reply; 13+ messages in thread
From: Sascha Hauer @ 2017-05-17 6:26 UTC (permalink / raw)
To: Daniel Schultz; +Cc: barebox
On Fri, May 12, 2017 at 01:07:17PM +0200, Daniel Schultz wrote:
> 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.
>
> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
> .../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
>
> diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
> new file mode 100644
> index 0000000..53ecbe3
> --- /dev/null
> +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
> @@ -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
> --
> 1.9.1
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
2017-05-12 11:07 ` [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts Daniel Schultz
@ 2017-05-17 6:30 ` Sascha Hauer
2017-06-02 8:07 ` Daniel Schultz
0 siblings, 1 reply; 13+ messages in thread
From: Sascha Hauer @ 2017-05-17 6:30 UTC (permalink / raw)
To: Daniel Schultz; +Cc: barebox
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 <d.schultz@phytec.de>
> ---
> .../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 0000000..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-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 4/4] arm: boards: beaglebone: Delete default env
2017-05-12 11:07 ` [PATCH v3 4/4] arm: boards: beaglebone: Delete default env Daniel Schultz
@ 2017-05-17 6:35 ` Sascha Hauer
2017-06-06 10:57 ` Daniel Schultz
0 siblings, 1 reply; 13+ messages in thread
From: Sascha Hauer @ 2017-05-17 6:35 UTC (permalink / raw)
To: Daniel Schultz; +Cc: barebox
On Fri, May 12, 2017 at 01:07:19PM +0200, Daniel Schultz wrote:
> The Beaglebone environment should be set from outside with an application
> specific environment.
>
> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
> 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
>
> --- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
> +++ /dev/null
> @@ -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
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script
2017-05-17 6:26 ` Sascha Hauer
@ 2017-06-02 7:59 ` Daniel Schultz
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Schultz @ 2017-06-02 7:59 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi,
Am 17.05.2017 um 08:26 schrieb Sascha Hauer:
> On Fri, May 12, 2017 at 01:07:17PM +0200, Daniel Schultz wrote:
>> 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.
>>
>> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
>> ---
>> .../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
>
> Sascha
>
>>
>> diff --git a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
>> new file mode 100644
>> index 0000000..53ecbe3
>> --- /dev/null
>> +++ b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/automount
>> @@ -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
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> barebox mailing list
>> barebox@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox
>>
>
--
Mit freundlichen Grüßen,
With best regards,
Daniel Schultz
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
2017-05-17 6:30 ` Sascha Hauer
@ 2017-06-02 8:07 ` Daniel Schultz
2017-06-06 5:46 ` Sascha Hauer
0 siblings, 1 reply; 13+ messages in thread
From: Daniel Schultz @ 2017-06-02 8:07 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
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 <d.schultz@phytec.de>
>> ---
>> .../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 0000000..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.
--
Mit freundlichen Grüßen,
With best regards,
Daniel Schultz
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
2017-06-02 8:07 ` Daniel Schultz
@ 2017-06-06 5:46 ` Sascha Hauer
2017-06-06 9:50 ` Daniel Schultz
0 siblings, 1 reply; 13+ messages in thread
From: Sascha Hauer @ 2017-06-06 5:46 UTC (permalink / raw)
To: Daniel Schultz; +Cc: barebox
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 <d.schultz@phytec.de>
> > > ---
> > > .../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 0000000..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-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts
2017-06-06 5:46 ` Sascha Hauer
@ 2017-06-06 9:50 ` Daniel Schultz
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Schultz @ 2017-06-06 9:50 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
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 <d.schultz@phytec.de>
>>>> ---
>>>> .../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 0000000..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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 4/4] arm: boards: beaglebone: Delete default env
2017-05-17 6:35 ` Sascha Hauer
@ 2017-06-06 10:57 ` Daniel Schultz
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Schultz @ 2017-06-06 10:57 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi Sascha,
Am 17.05.2017 um 08:35 schrieb Sascha Hauer:
> On Fri, May 12, 2017 at 01:07:19PM +0200, Daniel Schultz wrote:
>> The Beaglebone environment should be set from outside with an application
>> specific environment.
>>
>> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
>> ---
>> 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
>>
>> --- a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/usb-limit-1300
>> +++ /dev/null
>> @@ -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?
Please revoke this patch. Sorry.
>
> Sascha
>
--
Mit freundlichen Grüßen,
With best regards,
Daniel Schultz
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-06-06 10:58 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-12 11:07 [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 2/4] arm: boards: phytec-som-am335x: Add automount script Daniel Schultz
2017-05-17 6:26 ` Sascha Hauer
2017-06-02 7:59 ` Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 3/4] arm: boards: phytec-som-am335x: Update boot scripts Daniel Schultz
2017-05-17 6:30 ` Sascha Hauer
2017-06-02 8:07 ` Daniel Schultz
2017-06-06 5:46 ` Sascha Hauer
2017-06-06 9:50 ` Daniel Schultz
2017-05-12 11:07 ` [PATCH v3 4/4] arm: boards: beaglebone: Delete default env Daniel Schultz
2017-05-17 6:35 ` Sascha Hauer
2017-06-06 10:57 ` Daniel Schultz
2017-05-17 6:25 ` [PATCH v3 1/4] arm: mach-omap: Change mountpoint of boot partitions Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox