Auto-Configure LuCI Dependencies (i2c-tools)

Hi,

Working on a new package (luci-app), and I have added in a couple utilities that are needed. What I mean is, in the Makefile I included,
LUCI_DEPENDS:=+lua +luci-compat +i2cset +i2cget

I was assuming (hoping? :smile:) that this would trigger .config updates, to include these last two utilities. But no such luck ... when I build I get the error,

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-battstatus:
 *      i2cset
 *      i2cget
 * opkg_install_cmd: Cannot install package luci-app-battstatus.

Of course I can manually add these dependencies in .config, but I would think this should happen automatically? Or a bad assumption on my part?

Thanks!

I think, but I'm not sure, but LUCI_DEPENDS are only for other LUCI components.

If you want to depend on a non-LUCI component, you need to add a normal DEPENDS line (I think, I could be wrong here, but it would be my first guess)

The other possibility might be that you didn't do a "make oldconfig", or you added those dependencies AFTER enabling the package with an older version of the Makefile

You need to depend on a package, not the individual files inside that package.
Depend on i2c-tools

Wrong. That LUCI_DEPENDS should be ok, once the dependency actually points to a package instead of a file.

2 Likes

Thanks! That does make sense.

Hmmm ... changed it to i2c-tools, but still the same issue (just error with i2c-tools instead ... LOL). OK, this is odd - from .config,

Symbol: PACKAGE_i2c-tools [=PACKAGE_i2c-tools]
Type  : unknown
Selected by: PACKAGE_luci-app-battstatus [=y]

But, PACKAGE_i2c-tools is not selected in .config. Very strange.

Dang it! I admit, pulling my hair out here ... :frowning_face:. I add i2c-tools to LUCI_DEPENDS, and it wants to install it (build fails without it) ... but it's not showing up. Thoughts?

Thanks!

OK, this may be it ... :smile:,

make package/i2c-tools/compile
 make[1] package/i2c-tools/compile
 make[2] -C package/libs/toolchain compile
 make[2] -C feeds/packages/utils/i2c-tools compile
make -j1 V=sc package/i2c-tools/install
make[1]: Entering directory '/mnt/ProgSSD/openwrt'
make[1]: *** No rule to make target 'package/i2c-tools/install'.  Stop.
make[1]: Leaving directory '/mnt/ProgSSD/openwrt'
make: *** [/mnt/ProgSSD/openwrt/include/toplevel.mk:227: package/i2c-tools/install] Error 2

So something broken for i2c-tools?

Thanks!

Well, I haven't yet tried compiling it to an image, but the package itself compiles ok and the .ipk file can be installed ok.

Compiling:

perus@ub1910:/Openwrt/r7800$ grep -i i2c .config
# CONFIG_BUSYBOX_DEFAULT_I2CGET is not set
# CONFIG_BUSYBOX_DEFAULT_I2CSET is not set
# CONFIG_BUSYBOX_DEFAULT_I2CDUMP is not set
# CONFIG_BUSYBOX_DEFAULT_I2CDETECT is not set
# CONFIG_BUSYBOX_DEFAULT_I2CTRANSFER is not set
# CONFIG_BUSYBOX_CONFIG_I2CGET is not set
# CONFIG_BUSYBOX_CONFIG_I2CSET is not set
# CONFIG_BUSYBOX_CONFIG_I2CDUMP is not set
# CONFIG_BUSYBOX_CONFIG_I2CDETECT is not set
# CONFIG_BUSYBOX_CONFIG_I2CTRANSFER is not set
# I2C support
# CONFIG_PACKAGE_kmod-i2c-core is not set
# CONFIG_PACKAGE_kmod-iio-bme680-i2c is not set
# CONFIG_PACKAGE_kmod-iio-bmp280-i2c is not set
# CONFIG_PACKAGE_kmod-bmp085-i2c is not set
# CONFIG_PACKAGE_kmod-tpm-i2c-atmel is not set
# CONFIG_PACKAGE_kmod-tpm-i2c-infineon is not set
# CONFIG_PACKAGE_node-cylon-i2c is not set
CONFIG_PACKAGE_libi2c=m
CONFIG_PACKAGE_i2c-tools=m

perus@ub1910:/Openwrt/r7800$ make -j 5 package/i2c-tools/compile
time: target/linux/prereq#0.09#0.00#0.11
 make[1] package/i2c-tools/compile
 make[2] -C package/libs/toolchain compile
 make[2] -C feeds/packages/utils/i2c-tools compile
 make[2] -C feeds/packages/utils/i2c-tools compile

perus@ub1910:/Openwrt/r7800$ ls -l bin/packages/arm_cortex-a15_neon-vfpv4/packages/i2c-tools_4.1-3_arm_cortex-a15_neon-vfpv4.ipk 
-rw-r--r-- 1 perus perus 20134 tammi  25 10:13 bin/packages/arm_cortex-a15_neon-vfpv4/packages/i2c-tools_4.1-3_arm_cortex-a15_neon-vfpv4.ipk

Installing in live router:

root@router1:~# opkg install /tmp/libi2c_4.1-3_arm_cortex-a15_neon-vfpv4.ipk
Installing libi2c (4.1-3) to root...
Configuring libi2c.

root@router1:~# opkg install /tmp/i2c-tools_4.1-3_arm_cortex-a15_neon-vfpv4.ipk
Installing i2c-tools (4.1-3) to root...
Configuring i2c-tools.

root@router1:~# i2cget
Usage: i2cget [-f] [-y] [-a] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]
  I2CBUS is an integer or an I2C bus name
  ADDRESS is an integer (0x03 - 0x77, or 0x00 - 0x7f if -a is given)
  MODE is one of:
    b (read byte data, default)
    w (read word data)
    c (write byte/read byte)
    Append p for SMBus PEC
1 Like

That helped, thanks! I was adding i2c-tools, but not libi2c. Once I did ... my full build works now, automatically pulls in these packages. Thanks!

FYI, working on adding a battery status display on the top header, for a battery powered (travel) router. It's working now. Really appreciate all the pointers folks. Thanks!!!

So, you did not run the automatic dependency fix?

make defconfig would have selected the necessary dependencies.

Same also with make menuconfig. Simply running it after editing .config would have fixed things.

It is good practice to run make defconfig before the actual make

I did - sorry, I wasn't real clear. Once I added both of these to my (new) package Makefile, then ran defconfig ... all is working great. Thanks!

And BTW, I updated to the latest master branch, that may have had an impact as well (it does change quite quickly).

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.