I don't know how I have tried to extract it with ubireader.
ok i extracted it and it has 4 files on there:
it just has the macid in there as expected
I don't know how I have tried to extract it with ubireader.
ok i extracted it and it has 4 files on there:
it just has the macid in there as expected
If there is a UBI header (hexdump -C -n 10 /dev/mtdX)
try "mount -r -t ubifs"
is there a script to mount partition read the macid and update it to the drive. as it is on there as pir pictures above.
Just rename tp_data to factory_data (and update the case statement accordingly)
And then you can utilize "get_mac_binary"
get_mac_binary
so I just call that function it will do it all its self?
That makes it so easy thanks heaps!!!!
Like so :
. /lib/functions/system.sh
preinit_set_mac_address() {
case $(board_name) in
tplink_x80-5g)
addr=$(get_mac_binary "/tmp/factory_data/default-mac" 0)
ip link set dev lan address "$(macaddr_add $addr 1)"
;;
*)
;;
esac
}
boot_hook_add preinit_main preinit_set_mac_address
}
the 09_mount_cfg_part script does not seem to work it just leaves a folder "factory_data in /tmp on boot?
I'm guessing it is trying to mount ubi1 and not ubi1_0 or something?
I don't want to alter it as it would break other devices from just dropping in their board name and working on their device what is the plan here?
I can mount it manually:
/dev/:
bus mtd11ro mtd8 ptmx
console mtd12 mtd8ro pts
cpu_dma_latency mtd12ro mtd9 random
fd mtd13 mtd9ro remoteproc0
full mtd13ro mtdblock0 shm
gpiochip0 mtd14 mtdblock1 stderr
gpiochip1 mtd14ro mtdblock10 stdin
kmsg mtd15 mtdblock11 stdout
log mtd15ro mtdblock12 switch_ssdk
loop-control mtd16 mtdblock13 tty
loop0 mtd16ro mtdblock14 ttyMSM0
loop1 mtd1ro mtdblock15 ttyS0
loop2 mtd2 mtdblock16 ttyS1
loop3 mtd2ro mtdblock2 ubi0
loop4 mtd3 mtdblock3 ubi0_0
loop5 mtd3ro mtdblock4 ubi0_1
loop6 mtd4 mtdblock5 ubi0_2
loop7 mtd4ro mtdblock6 ubi_ctrl
mtd0 mtd5 mtdblock7 ubiblock0_1
mtd0ro mtd5ro mtdblock8 urandom
mtd1 mtd6 mtdblock9 watchdog
mtd10 mtd6ro null watchdog0
mtd10ro mtd7 port zero
mtd11 mtd7ro ppp
root@OpenWrt:~# ubiattach -m 15
UBI device number 1, total 72 LEBs (9142272 bytes, 8.7 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
root@OpenWrt:~# ls /dev
bus mtd12 mtd9 remoteproc0
console mtd12ro mtd9ro shm
cpu_dma_latency mtd13 mtdblock0 stderr
fd mtd13ro mtdblock1 stdin
full mtd14 mtdblock10 stdout
gpiochip0 mtd14ro mtdblock11 switch_ssdk
gpiochip1 mtd15 mtdblock12 tty
kmsg mtd15ro mtdblock13 ttyMSM0
log mtd16 mtdblock14 ttyS0
loop-control mtd16ro mtdblock15 ttyS1
loop0 mtd1ro mtdblock16 ubi0
loop1 mtd2 mtdblock2 ubi0_0
loop2 mtd2ro mtdblock3 ubi0_1
loop3 mtd3 mtdblock4 ubi0_2
loop4 mtd3ro mtdblock5 ubi1
loop5 mtd4 mtdblock6 ubi1_0
loop6 mtd4ro mtdblock7 ubi_ctrl
loop7 mtd5 mtdblock8 ubiblock0_1
mtd0 mtd5ro mtdblock9 urandom
mtd0ro mtd6 null watchdog
mtd1 mtd6ro port watchdog0
mtd10 mtd7 ppp zero
mtd10ro mtd7ro ptmx
mtd11 mtd8 pts
mtd11ro mtd8ro random
root@OpenWrt:~# mkdir /tmp/factory_data
root@OpenWrt:~# mount -r -t ubifs /dev/ubi1_0 /tmp/factory_data
root@OpenWrt:~# cd /tmp/factory_data/
root@OpenWrt:/tmp/factory_data# ls
default-imei default-mac device-id product-info
root@OpenWrt:/tmp/factory_data#
Hiya, super excited to see this all working. One NZ wireless broadband customer and this router is absolute, absolute trash with stock firmware. Very excited for when we'll have a "no serial ports required" install method, because we are blind, and thus, basically unable to install these experimental images due to us not having the skills, tools, or eyeballs required to solder on a serial connection.
You are calling a non existing function "mount_tp_part"
That needs to be "mount_ubi_part". And BTW rm the mercusys from the case statement.
That was me playing around testing my own script when I reverted it I forgot to restore that line.
I put a second call to my own function and that did not work either I don't think it likes the_ in the name of the partition as it won't create a folder in temp if I name it factory_data but it will if I name it factory-data.
edit:
By chance is the overlay active when these init scripts run, as it seems I can't edit the script by hand on the running device and I have to build it into the device to alter it?
this would suggest that the root file system is not even active when the init occurs:
[ 4.974289] ubi1: attaching mtd15
[ 5.024873] ubi1: scanning is finished
[ 5.031923] ubi1: attached mtd15 (name "factory_data", size 9 MiB)
[ 5.031964] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 5.037126] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 5.043878] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 5.050718] ubi1: good PEBs: 72, bad PEBs: 0, corrupted PEBs: 0
[ 5.057492] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 5.063397] ubi1: max/mean erase counter: 15/8, WL threshold: 4096, image sequence number: 1097309032
[ 5.070688] ubi1: available PEBs: 0, total reserved PEBs: 72, PEBs reserved for bad PEB handling: 20
[ 5.079987] ubi1: background thread "ubi_bgt1d" started, PID 731
[ 6.402938] random: crng init done
[ 15.207337] platform phy-leds: deferred probe pending
[ 17.446097] UBIFS (ubi0:2): default file-system created
[ 17.446733] UBIFS (ubi0:2): Mounting in unauthenticated mode
[ 17.450236] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 811
[ 17.509842] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[ 17.509882] UBIFS (ubi0:2): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 17.516681] UBIFS (ubi0:2): FS size: 16506880 bytes (15 MiB, 130 LEBs), max 140 LEBs, journal size 1015809 bytes (0 MiB, 7 LEBs)
[ 17.526570] UBIFS (ubi0:2): reserved for root: 779660 bytes (761 KiB)
[ 17.538192] UBIFS (ubi0:2): media format: w5/r0 (latest is w5/r0), UUID 462E7C40-7F6B-41C3-BA9E-52EA2A033A0B, small LPT model
[ 17.546237] mount_root: overlay filesystem has not been fully initialized yet
[ 17.556259] mount_root: switching to ubifs overlay
I changed the partition name temporally to factory-data
not factory_data
and it picked up the partition and loaded the mac the script does not like the presence of a _
in the name of the partition table and needs fixing so it seems.
I created my own function as below and this does not work either but the attach command and mkdir function works but mount function does not.
Pasting the mount function is shell after boot works to prove all the rest of my script works.
All I can think now is to delay these functions later iI put in a sleep 5 but that did not work either?.
how do I make it show the operation of the preinit code in the syslog?
As it seems the preinit conf is on the fly created by the make file in package/base folder and not stored in the base files like the rest of the preinit scripts.
i will make the pre inint code show in the console in the make menu and see if it offers any hints,
any way in reguards to the system fan control i get this :
[ 1.358698] OF: /thermal-zones/cpu0-thermal/cooling-maps/map2: could not find phandle -1
[ 1.367605] thermal_sys: Add a cooling_device property with at least one device
[ 1.375839] thermal thermal_zone5: binding zone cpu0-thermal with cdev cpufreq-cpu0 failed:-2
[ 1.382974] OF: /thermal-zones/cpu1-thermal/cooling-maps/map2: could not find phandle -1
[ 1.391544] thermal_sys: Add a cooling_device property with at least one device
[ 1.399708] thermal thermal_zone6: binding zone cpu1-thermal with cdev cpufreq-cpu0 failed:-2
[ 1.406799] OF: /thermal-zones/cpu2-thermal/cooling-maps/map2: could not find phandle -1
[ 1.415423] thermal_sys: Add a cooling_device property with at least one device
[ 1.423580] thermal thermal_zone7: binding zone cpu2-thermal with cdev cpufreq-cpu0 failed:-2
[ 1.430671] OF: /thermal-zones/cpu3-thermal/cooling-maps/map2: could not find phandle -1
[ 1.439293] thermal_sys: Add a cooling_device property with at least one device
[ 1.447450] thermal thermal_zone8: binding zone cpu3-thermal with cdev cpufreq-cpu0 failed:-2
[ 1.454539] OF: /thermal-zones/cluster-thermal/cooling-maps/map2: could not find phandle -1
[ 1.463165] thermal_sys: Add a cooling_device property with at least one device
[ 1.471319] thermal thermal_zone9: binding zone cluster-thermal with cdev cpufreq-cpu0 failed:-2
and this:
[ 21.378930] OF: /thermal-zones/cpu0-thermal/cooling-maps/map2: could not find phandle -1
[ 21.378992] thermal_sys: Add a cooling_device property with at least one device
[ 21.386160] thermal thermal_zone5: binding zone cpu0-thermal with cdev ath11k_thermal failed:-2
[ 21.393323] OF: /thermal-zones/cpu1-thermal/cooling-maps/map2: could not find phandle -1
[ 21.401825] thermal_sys: Add a cooling_device property with at least one device
[ 21.410186] thermal thermal_zone6: binding zone cpu1-thermal with cdev ath11k_thermal failed:-2
[ 21.417381] OF: /thermal-zones/cpu2-thermal/cooling-maps/map2: could not find phandle -1
[ 21.425896] thermal_sys: Add a cooling_device property with at least one device
[ 21.434225] thermal thermal_zone7: binding zone cpu2-thermal with cdev ath11k_thermal failed:-2
[ 21.441422] OF: /thermal-zones/cpu3-thermal/cooling-maps/map2: could not find phandle -1
[ 21.449960] thermal_sys: Add a cooling_device property with at least one device
[ 21.458284] thermal thermal_zone8: binding zone cpu3-thermal with cdev ath11k_thermal failed:-2
[ 21.465477] OF: /thermal-zones/cluster-thermal/cooling-maps/map2: could not find phandle -1
[ 21.473987] thermal_sys: Add a cooling_device property with at least one device
[ 21.482296] thermal thermal_zone9: binding zone cluster-thermal with cdev ath11k_thermal failed:-2
[ 21.490157] OF: /thermal-zones/cpu0-thermal/cooling-maps/map2: could not find phandle -1
[ 21.498665] thermal_sys: Add a cooling_device property with at least one device
[ 21.506891] thermal thermal_zone5: binding zone cpu0-thermal with cdev ath11k_thermal failed:-2
[ 21.514092] OF: /thermal-zones/cpu1-thermal/cooling-maps/map2: could not find phandle -1
[ 21.522571] thermal_sys: Add a cooling_device property with at least one device
[ 21.530936] thermal thermal_zone6: binding zone cpu1-thermal with cdev ath11k_thermal failed:-2
[ 21.538104] OF: /thermal-zones/cpu2-thermal/cooling-maps/map2: could not find phandle -1
[ 21.546633] thermal_sys: Add a cooling_device property with at least one device
[ 21.554962] thermal thermal_zone7: binding zone cpu2-thermal with cdev ath11k_thermal failed:-2
[ 21.562131] OF: /thermal-zones/cpu3-thermal/cooling-maps/map2: could not find phandle -1
[ 21.570678] thermal_sys: Add a cooling_device property with at least one device
[ 21.579019] thermal thermal_zone8: binding zone cpu3-thermal with cdev ath11k_thermal failed:-2
[ 21.586240] OF: /thermal-zones/cluster-thermal/cooling-maps/map2: could not find phandle -1
[ 21.594735] thermal_sys: Add a cooling_device property with at least one device
[ 21.603061] thermal thermal_zone9: binding zone cluster-thermal with cdev ath11k_thermal failed:-2
I followed the reference on the linux documentation here:
thermal zones
and here:
I have enclosed the cells for the gpio and fan speed map unlike rob marco's example, I tried it the other way with no go either.
with the kmod-gpio_fan built into the kernel the fan runs
root@OpenWrt:~# cat /sys/devices/virtual/thermal/thermal_zone0/temp
58200
do I have to explicitly include them in the includes dtsi individually or is the & on the main node ok?
I just wanted to note to y'all that so thoroughly documenting what it takes to bring up a new device has been very enjoyable, and learning more, in particular, about DTS was very helpful to me. I applaud your persistence and dedication...
... and hope one day to be able to benchmark the wifi and 5g.
This is my first device from scratch porting to OpenWrt and it has been a ride for me I have learnt heaps about the underlying format of the build environment and structure and boot sequence, if it has given enjoyment and insight for others that is awesome!
I'm stumbling in reality; I know enough to understand things and a persistant enough to play till it works but @kirdes is the real hero here!!!
I use industrial Linux based routers at work and mainstream OpenWrt seems like a great path to go down in the future.
As for benchmarks I expect it to be similar to the other ipq8074 devices but an integrated 5g modem has not before seen in this platform I believe.
To be honest I can't see many people buying one it is super expensive $1100 NZD retail, but it is a device many retailers use here on a fixed contract so it is common here.
I do admit I can't believe how much quicker it is to boot the OS over stock it is under half the time, but the real problem for me was the requirement for an app on the phone to even use it there is no web interface basically and very consumer orientated..
It is really surprising how long the boot times and how slow/ sluggish the GUI can be on many qsdk/ ipq807x based (often 32-bit-) vendor firmwares, despite the really fast hardware. In your case, it's probably worse because of the vendor-mesh features, which do require a lot of mesh-link discovery/ mesh-link training.
"first device from scratch" is a very difficult experience for many not versed in this old stuff. You documenting it here is very good for future folk. A lot of times in the past this kind of work got done over irc, and the process not captured.
It seems as a lot of it is cloud-based stuff and the dts is for the qualcom reference device that and it lists broken nonexistent hardware of the manufacturer on boot.
it is a bit confusing as qualcom make their own kernel to do as they want they just get stuck in and make it happen, you can't do some stuff in OpenWrt like they can in the qsdk, but that goes both ways too.
It seems they do this so they don't have to muck around waiting for someone to accept their changes upstream and does not hinder their creative direction or time to market.
One thing that would be nice is for Openwrt to implement the kmod led group multicolor so I could somehow make the led more useful on this device but it is beyond my skill to do that.
Yeah, all the cloud integration is another topic with many modern OEM firmwares (I don't even want to imagine what will happen in 5+ years, when the cloud features for those 'old' devices have been switched off).
Fortunately the LED is by far the least important aspect. My suggestion would be to get the PR ready without that (or only a minimal/ single colour setup) - and once merged, start the discussion about multicolour in a separate (add-on) PR (obviously mention the topic in the original PR already, just detach that topic from the original device submission).