Hurdle 7: Backtracking on ucode Files
Previously:
After some realization, it was discovered that ucode files were being omitted from the search results.
Luckily, LuCI on ucode is still in its early stages, so only a minimal amount of files were missed:
-
uciresults:- modules/luci-base/ucode/zoneinfo.uc
- Result by mistake. (does not need to be ported)
- modules/luci-base/ucode/dispatcher.uc
- This is the current HTTP Router for LuCI
- Will definitely have to be ported to LuMI
- modules/luci-base/ucode/runtime.uc
- Handles .ut template file generation
- Adds a Lua bridge to the ucode runtime
- modules/luci-base/ucode/controller/admin/uci.uc
- Adds low-level
uciandubusinterop to LuCI's ucode runtime - Will definitely have to be ported to LuMI
-
/etc/configresults: none noteworthy -
luci.configresults: none noteworthy
Hurdle 8: Identifying Any rpc Interop
Here are the results of the rpc code search:
-
libs/luci-lib-nixio/axTLS/www/lua/test_lib.lua
- This is a legacy test file that can probably be dropped
-
libs/luci-lib-px5g/src/library/timing.c
- This was returned by mistake. It references assembly instructions for the
px5glibrary, which hasrpccas part of the instruction set.
- This was returned by mistake. It references assembly instructions for the
-
libs/rpcd-mod-luci/src/luci.c and libs/rpcd-mod-rrdns/src/rrdns.c
-
rpc-mod-luciis arpcdplugin written by LuCI developers that exposes some functions that LuCI was worth sharing withrpcd. - This is already planned for porting.
-
-
modules/luci-base/ucode/dispatcher.uc
- This is the current HTTP Router for LuCI
- This is already planned for porting.
-
modules/luci-base/ucode/controller/admin/index.uc
- This serves as the LuCI API gateway.
- This is a high-value target for porting.
-
modules/luci-base/ucode/controller/admin/uci.uc
- Adds low-level
uciandubusinterop to LuCI's ucode runtime - Already planned for porting. modules/luci-lua-runtime/luasrc/dispatcher.lua
- This is the older HTTP Router for LuCI
- This is already planned for porting.
- Adds low-level
-
modules/luci-lua-runtime/luasrc/model/uci.lua
- This is a wrapper around the
ucimodule that provides a more Lua-like interface. - Already planned for porting. modules/luci-mod-rpc/luasrc/jsonrpc.lua
- This is the JSON-RPC implementation for LuCI.
- High-value target for porting.
- This is a wrapper around the
-
modules/luci-mod-rpc/luasrc/controller/rpc.lua
- This is a utility for doing RPC calls in LuCI.
- Already planned for porting. modules/luci-mod-rpc/luasrc/jsonrpcbind/uci.lua
- A convenience wrapper around
uci. Honestly seems kind of redundant withluci.model.uci. - Already planned for porting.
Hurdle 9: Identifying Any ubus Interop
Here are the results of the ubus code search:
-
libs/luci-lib-nixio/axTLS/config/scripts/config/mconf.c
- Resulted by mistake. For some reason axTLS includes menuconfig.
-
libs/luci-lib-nixio/axTLS/crypto/bigint.c
- Also resulted by mistake.
-
libs/luci-lib-nixio/src/poll.c
- Also resulted by mistake.
-
modules/luci-compat/luasrc/model/network/proto_modemmanager.lua
- Also resulted by mistake.
-
modules/luci-compat/luasrc/model/network/proto_qmi.lua
- Also resulted by mistake.
-
libs/luci-lib-base/luasrc/util.lua
- provides string manipulation and serialization functions as well as methods to interact with the
ubus - High-value target for porting.
- provides string manipulation and serialization functions as well as methods to interact with the
-
libs/rpcd-mod-luci/src/luci.c and libs/rpcd-mod-rrdns/src/rrdns.c
-
rpc-mod-luciis arpcdplugin written by LuCI developers that exposes some functions that LuCI was worth sharing withrpcd. - This is already planned for porting.
-
-
modules/luci-base/ucode/dispatcher.uc
- This is the current HTTP Router for LuCI
- This is already planned for porting.
-
modules/luci-base/ucode/controller/admin/index.uc
- This serves as the LuCI API gateway.
- This is already planned for porting.
-
modules/luci-base/ucode/controller/admin/uci.uc
- Adds low-level
uciandubusinterop to LuCI's ucode runtime - Already planned for porting.
- Adds low-level
-
modules/luci-compat/luasrc/model/network.lua
- Provides a model for configuring network interfaces, devices, and L2 (sometimes L3) protocols.
- Already planned for porting.
-
modules/luci-compat/luasrc/tools/webadmin.lua
- Minimally interacts with
ubus - Provides a small set of utility tools for LuCI.
- Already planned for porting.
- Minimally interacts with
-
modules/luci-lua-runtime/luasrc/dispatcher.lua
- This is the older HTTP Router for LuCI
- Already planned for porting.
-
modules/luci-lua-runtime/luasrc/sys.lua
- This module provides a set of system utilities for LuCI.
- It minimally interacts with
uci. In fact its only interaction appears to be pulling IPs from it. - Already planned for porting.
-
modules/luci-lua-runtime/luasrc/model/uci.lua
- This is a wrapper around the
ucimodule that provides a more Lua-like interface. - Already planned for porting.
- This is a wrapper around the
-
modules/luci-mod-rpc/luasrc/controller/rpc.lua
- This is a utility for doing RPC calls in LuCI.
- I believe that
mgmtuses a different RPC mechanism, so any ubus and RPC functionality may also have to be ported. - Already planned for porting.
Hurdle 10: Identifying Any Other Languages Used
At this point, we need to ensure that we have identified all languages used in LuCI.
For this, we will be adding Enry to our dev chain. We will be using temporary installs to avoid polluting the system with Go dependencies.
Task 1: Setup Enry
$languages = & {
$tmp = New-TemporaryFile | % { rm $_; ni $_ -ItemType Directory }
& {
pushd $tmp
go mod init tempmod
go get github.com/go-enry/enry
go build -o ./enry github.com/go-enry/enry
popd
} | Write-Host
& {
pushd luci
& "$tmp/enry" -all -json
popd
}
rm -r $tmp -Force | Out-Null
} | ConvertFrom-Json
When enry is used like this, it is only good for summarizing the languages within cwd. I will have to iterate over each file in order to create the language mapping that I want.
... (6 hours later) ...
Took a lot to get language detection working, but ~search.ps1 has been updated to use Enry to detect languages.
This should be the final hurdle in the research phase of porting LuCI to LuMI. A quick review of the updated results will be needed to make that determination.
Task 2: Reviewing the new results
A few new results were found:
- modules/luci-base/root/usr/share/rpcd/ucode/luci
- modules/luci-base/ucode/template/sysauth.ut
- modules/luci-lua-runtime/luasrc/model/uci.luadoc
- protocols/luci-proto-wireguard/root/usr/share/rpcd/ucode/luci.wireguard
- modules/luci-base/ucode/template/header.ut
- libs/luci-lib-base/luasrc/util.luadoc
- themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut
- themes/luci-theme-material/ucode/template/themes/material/header.ut
- themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut
- themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut
At this point, we have a pretty good idea of what needs to be ported. We can even treat the search results as a sort of "porting roadmap."
The next 2 challenges are to organize the ports then also ensure that changes from LuCI can be propagated to LuMI.
Top comments (0)