jerrykuku / luci-app-argon-config

Argon Theme Config Plugin
Apache License 2.0
193 stars 79 forks source link

Argon config page not working in the last master build or snapshot #20

Open okibcn opened 2 years ago

okibcn commented 2 years ago

When opening the Argon config page, the browser displays this error page:

/usr/lib/lua/luci/model/cbi/argon-config.lua:3: module 'luci.model.ipkg' not found:
    no field package.preload['luci.model.ipkg']
    no file './luci/model/ipkg.lua'
    no file '/usr/share/lua/luci/model/ipkg.lua'
    no file '/usr/share/lua/luci/model/ipkg/init.lua'
    no file '/usr/lib/lua/luci/model/ipkg.lua'
    no file '/usr/lib/lua/luci/model/ipkg/init.lua'
    no file './luci/model/ipkg.so'
    no file '/usr/lib/lua/luci/model/ipkg.so'
    no file '/usr/lib/lua/loadall.so'
    no file './luci.so'
    no file '/usr/lib/lua/luci.so'
    no file '/usr/lib/lua/loadall.so'
stack traceback:
    [C]: in function 'require'
    /usr/lib/lua/luci/model/cbi/argon-config.lua:3: in function 'func'
    /usr/lib/lua/luci/cbi.lua:66: in function 'load'
    /usr/lib/lua/luci/dispatcher.lua:1526: in function '_form'
    /usr/lib/lua/luci/dispatcher.lua:1054: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:479: in function </usr/lib/lua/luci/dispatcher.lua:478>

STEPS TO REPRODUCE:

  1. Build OpenWrt with Argon from sources using these commands in a build-ready system:

    git clone -b master https://github.com/openwrt/openwrt.git openwrt
    cd openwrt
    ./scripts/feeds update -a
    ./scripts/feeds install -a
    git clone -b master https://github.com/jerrykuku/luci-theme-argon package/luci-theme-argon
    git clone -b master https://github.com/jerrykuku/luci-app-argon-config package/luci-app-argon-config
    #     vvvvvvv   select your device with make menuconfig
    make menuconfig
    echo "CONFIG_PACKAGE_luci=y" >> .config
    echo "CONFIG_PACKAGE_luci-compat=y" >> .config
    echo "CONFIG_PACKAGE_luci-theme-argon=y" >> .config
    echo "CONFIG_PACKAGE_luci-app-argon-config=y" >> .config
    make defconfig
    make -j$(nproc) 
  2. Then, flash the sysupgrade under openwrt/bin/target// in your router without saving previous settings (default behaviour).

  3. After the system boots up go to system>Argon Config

EXPECTED RESULT: The Argon config page shows up properly.

OBTAINED RESULT: The error message shown above shows up.

Using the packages available for download in https://github.com/jerrykuku/luci-theme-argon repo shows the same behavior when installed in a system using a SNAPSHOT image.

okibcn commented 2 years ago

@jerrykuku I have tracked the problem to a missing package dependency luci-lib-ipkg

An easy fix would be adding the dependency to Makefile

  PKG_MAINTAINER:=jerrykuku <jerrykuku@qq.com>

  LUCI_TITLE:=LuCI page for Argon Config
  LUCI_PKGARCH:=all
- LUCI_DEPENDS:=+luci-compat
+ LUCI_DEPENDS:=+luci-compat +luci-lib-ipkg

  define Package/$(PKG_NAME)/conffiles
  /etc/config/argon
jerrykuku commented 2 years ago

Great

okibcn commented 2 years ago

@jerrykuku, when are you planning on fixing the issue? I am automating some images for my routers and I am adding the missing dependency manually, but it would be much better to maintain proper dependencies. I am now patching the Makefile manually before building the images.

Thanks