Modify

Opened 3 years ago

Closed 3 years ago

#17633 closed defect (fixed)

/etc/board.d/02_network broken

Reported by: lsoltero Owned by: developers
Priority: high Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: 02_network broken Cc:

Description

Short description: in CC r42229 the 02_network script is not executing to completion failing to generate /etc/config/network on new OpenWRT installations.

Long description:

  1. Added a new board and modified the script
  2. confirmed that the board is being identified correctly by looking at variables in /tmp/sysinfo
  3. noticed an error when running the script in sh -x mode... here is the error.

+ jshn -i -w
jshn: invalid option -- i

Usage: jshn [-n] -r <message>w

here is the patch to 02_network to add our board.
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index e027b3b..4ab6f44 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -70,6 +70,13 @@ ramips_setup_interfaces()

ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
;;


+ gemini7620a)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
+ ucidef_add_switch_vlan "switch0" "2" "0 6t"
+ ;;
+

awapn2403)

ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"

here is the patch to ramips

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index bb42ace..4db3a4a 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -166,6 +166,9 @@ ramips_board_detect() {

*"Kingston MLW221")

name="mlw221"
;;

+ *"MT7620a GEMINI")
+ name="gemini7620a"
+ ;;

*"Planex MZK-750DHP")

name="mzk-750dhp"
;;

here is proof that the board is being detected correctly.
root@OpenWrt:/etc/config# cat /tmp/sysinfo/*
gemini7620a
Ralink MT7620a GEMINI

attached you will find the complete output of
sh -x /etc/board.d/02_network
showing that the board was detected and the appropriate routines called...

yet no /etc/config/network appears after the script runs.

--luis

Attachments (1)

board.out (51.7 KB) - added by lsoltero 3 years ago.
output for sh -x /etc/board.d/02_network

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by lsoltero

output for sh -x /etc/board.d/02_network

comment:1 Changed 3 years ago by lsoltero

the following patch fixes the problem. It seems that the jhsn command does not (and has never) support the '-i' option. It seems that previous versions of the network script did not pass on arguments to jhsn. Now they do. Anyway... the fix for this issue is simple. Just need to remove the '-i' option in the call. the following patch fixes the problem.

diff --git a/package/base-files/files/lib/functions/uci-defaults-new.sh b/package/base-files/files/lib/functions/uci-defaults-new.sh
index 528835b..0f5a013 100755
--- a/package/base-files/files/lib/functions/uci-defaults-new.sh
+++ b/package/base-files/files/lib/functions/uci-defaults-new.sh
@@ -297,6 +297,6 @@ board_config_update() {
 }
 
 board_config_flush() {
-       json_dump -i > /tmp/.board.json
+       json_dump  > /tmp/.board.json
        mv /tmp/.board.json ${CFG}
 }

Last edited 3 years ago by lsoltero (previous) (diff)

comment:2 Changed 3 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

The jshn "-i" flag has been implemented with http://git.openwrt.org/?p=project/libubox.git;a=commitdiff;h=dffbc09baf71b294185a36048166d00066d433b5 and the update was pulled into trunk with r42230

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.