[U-Boot] [PATCH 1/4] ARM: bootscript: Remove hard-coded rootpath from K+P's tpcboot.cmd

The 'rootpath' can be provided by DHCP server. Removing this line prevents from overwriting it.
To do that on the DHCP server side (isc-dhcp-server) modify dhcpd.conf and add 'option root-path "192.168.X.Y:/srv/tftp/rootfs";'
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/k+p/bootscripts/tpcboot.cmd | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index 16b93ebe3f..9290317730 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,7 +65,6 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv rootpath "/srv/tftp/KP/rootfs" setenv nfsargs "setenv bootargs root=/dev/nfs rw \ nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" setenv addip "setenv bootargs ${bootargs} \

The 'dhcp' command is more versatile as it allows working with the DHCP server to obtain serverip, ipaddress and other network parameters.
The configuration necessary to obtain the serverip (dhcpd.conf): option option-150 code 150 = ip-address;
and in the subnet definition: option option-150 192.168.X.Y;
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/k+p/bootscripts/tpcboot.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index 9290317730..ebd2d4ec2a 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -52,7 +52,7 @@ fi;" # # Provide 'boot_tftp_kernel' command #------------------------------------------------------------ -setenv download_kernel "tftpboot ${loadaddr} ${kernel_file}" +setenv download_kernel "dhcp ${loadaddr} ${kernel_file}"
setenv boot_tftp_kernel " if run download_kernel; then

The quotes around ${bootargs} were missing as we elaborate those variables twice - once when we "setenv" the command and secondly when we "run" it. Without quotes we have just empty string in the second call.
Moreover there is an issue with line breaks - as the original commands got truncated.
Signed-off-by: Lukasz Majewski lukma@denx.de
---
board/k+p/bootscripts/tpcboot.cmd | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index ebd2d4ec2a..e26fd72825 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,17 +65,14 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv nfsargs "setenv bootargs root=/dev/nfs rw \ - nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" -setenv addip "setenv bootargs ${bootargs} \ - ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:\ - ${hostname}:eth0:on" +setenv nfsargs "setenv bootargs root=/dev/nfs rw nfsroot='${serverip}':'${rootpath}',nolock,nfsvers=3" +setenv addip "setenv bootargs '${bootargs}' ip='${ipaddr}':'${serverip}':'${gatewayip}':'${netmask}':'${hostname}':eth0:on"
setenv boot_nfs " if run download_kernel; then run nfsargs; run addip; - setenv bootargs ${bootargs} console=${console}; + setenv bootargs '${bootargs}' console=${console};
run boot_fitImage; fi"

The serverip part is provided from DHCP server with 'option root-path "192.168.3.1:/srv/tftp/rootfs";' parameter in dhcpd.conf
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/k+p/bootscripts/tpcboot.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index e26fd72825..0576e81140 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,7 +65,7 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv nfsargs "setenv bootargs root=/dev/nfs rw nfsroot='${serverip}':'${rootpath}',nolock,nfsvers=3" +setenv nfsargs "setenv bootargs root=/dev/nfs rw nfsroot='${rootpath}',nolock,nfsvers=3" setenv addip "setenv bootargs '${bootargs}' ip='${ipaddr}':'${serverip}':'${gatewayip}':'${netmask}':'${hostname}':eth0:on"
setenv boot_nfs "

Dear Tom, Stefano,
The 'rootpath' can be provided by DHCP server. Removing this line prevents from overwriting it.
To do that on the DHCP server side (isc-dhcp-server) modify dhcpd.conf and add 'option root-path "192.168.X.Y:/srv/tftp/rootfs";'
Signed-off-by: Lukasz Majewski lukma@denx.de
board/k+p/bootscripts/tpcboot.cmd | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index 16b93ebe3f..9290317730 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,7 +65,6 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv rootpath "/srv/tftp/KP/rootfs" setenv nfsargs "setenv bootargs root=/dev/nfs rw \ nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" setenv addip "setenv bootargs ${bootargs} \
Is there any chance that this series would be applied before v2018.09 release?
Those are fixes related to a particular board(s), which I do maintain.
Thanks in advance.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

Hi Lukasz,
On 07/09/2018 00:53, Lukasz Majewski wrote:
Dear Tom, Stefano,
The 'rootpath' can be provided by DHCP server. Removing this line prevents from overwriting it.
To do that on the DHCP server side (isc-dhcp-server) modify dhcpd.conf and add 'option root-path "192.168.X.Y:/srv/tftp/rootfs";'
Signed-off-by: Lukasz Majewski lukma@denx.de
board/k+p/bootscripts/tpcboot.cmd | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index 16b93ebe3f..9290317730 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,7 +65,6 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv rootpath "/srv/tftp/KP/rootfs" setenv nfsargs "setenv bootargs root=/dev/nfs rw \ nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" setenv addip "setenv bootargs ${bootargs} \
Is there any chance that this series would be applied before v2018.09 release?
Those are fixes related to a particular board(s), which I do maintain.
Patches were sent just a week ago, merge window was closed. This is the same case as Otavio's and I will merge them after release.
Best regards, Stefano

Hi Stefano,
Hi Lukasz,
On 07/09/2018 00:53, Lukasz Majewski wrote:
Dear Tom, Stefano,
The 'rootpath' can be provided by DHCP server. Removing this line prevents from overwriting it.
To do that on the DHCP server side (isc-dhcp-server) modify dhcpd.conf and add 'option root-path "192.168.X.Y:/srv/tftp/rootfs";'
Signed-off-by: Lukasz Majewski lukma@denx.de
board/k+p/bootscripts/tpcboot.cmd | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/k+p/bootscripts/tpcboot.cmd b/board/k+p/bootscripts/tpcboot.cmd index 16b93ebe3f..9290317730 100644 --- a/board/k+p/bootscripts/tpcboot.cmd +++ b/board/k+p/bootscripts/tpcboot.cmd @@ -65,7 +65,6 @@ fi" # # Provide 'boot_nfs' command #------------------------------------------------------------ -setenv rootpath "/srv/tftp/KP/rootfs" setenv nfsargs "setenv bootargs root=/dev/nfs rw \ nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" setenv addip "setenv bootargs ${bootargs} \
Is there any chance that this series would be applied before v2018.09 release?
Those are fixes related to a particular board(s), which I do maintain.
Patches were sent just a week ago, merge window was closed. This is the same case as Otavio's and I will merge them after release.
Ok. No problem :-)
Best regards, Stefano
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
participants (2)
-
Lukasz Majewski
-
Stefano Babic