Skip to content

init file sources functions too early? #14

Description

@rucketeg

When building custom firmware using the imagebuilder following errors are reported (not fatal):

Finalizing root filesystem...
add alternative: /sbin/logread -> /usr/libexec/logread-ubox
(...)
add alternative: /usr/bin/wget -> /bin/uclient-fetch
/builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/usteer: line 10: /lib/functions/network.sh: No such file or directory
/builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/usteer: line 11: /usr/share/libubox/jshn.sh: No such file or directory
/builder/build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/usteer: line 12: /lib/functions.sh: No such file or directory
Enabling boot
(...)
Enabling urngd
./etc/init.d/usteer: line 10: /lib/functions/network.sh: No such file or directory
./etc/init.d/usteer: line 11: /usr/share/libubox/jshn.sh: No such file or directory
./etc/init.d/usteer: line 12: /lib/functions.sh: No such file or directory
Enabling usteer
Enabling wpad

Seems that the ustreer initscript is executed from inside of the imagebuilder environment to enable this service by default in the image. However because certain files are sourced outside of any function the error is produced.

. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh

Is it possible and does it make sense to move those lines inside the functions that need them?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions