Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenWrt detection is faulty for custom builds #3435

Closed
adworacz opened this issue Aug 10, 2021 · 4 comments
Closed

OpenWrt detection is faulty for custom builds #3435

adworacz opened this issue Aug 10, 2021 · 4 comments

Comments

@adworacz
Copy link

adworacz commented Aug 10, 2021

I just ran into this bug using a custom build from Divested, which is effectively running OpenWRT HEAD with a few patches.

Looking at the AdguardHome code, it's checking for "OpenWrt" in /etc/*release.

However /etc/openwrt_release DOES exist, and contains the following:

DISTRIB_ID='Divested-WRT'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r17276+9-b1bff5cb57'
DISTRIB_TARGET='mvebu/cortexa9'
DISTRIB_ARCH='arm_cortex-a9_vfpv3-d16'
DISTRIB_DESCRIPTION='Divested-WRT SNAPSHOT r17276+9-b1bff5cb57'
DISTRIB_TAINTS='no-all'

Edit: Actually /etc/os-release exists as well, and contains:

NAME="Divested-WRT"
VERSION="SNAPSHOT"
ID="divested-wrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="Divested-WRT SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://divested.dev/unofficial-openwrt-builds/mvebu-linksys"
BUG_URL="https://github.com/divestedcg/Divested-WRT/issues"
SUPPORT_URL="xmpp:[email protected]?join"
BUILD_ID="r17276+9-b1bff5cb57"
OPENWRT_BOARD="mvebu/cortexa9"
OPENWRT_ARCH="arm_cortex-a9_vfpv3-d16"
OPENWRT_TAINTS="no-all"
OPENWRT_DEVICE_MANUFACTURER="Divested Computing Group"
OPENWRT_DEVICE_MANUFACTURER_URL="https://divested.dev"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="Divested-WRT SNAPSHOT r17276+9-b1bff5cb57"

In short - the detection is looking for the "OpenWrt" string (case sensitive), while there are *release files with lowercase "openwrt" strings.

Originally posted by @adworacz in #2757 (comment)

adguard pushed a commit that referenced this issue Aug 13, 2021
Merge in DNS/adguard-home from 3435-openwrt-detect to master

Updates #3435.

Squashed commit of the following:

commit 04b10f4
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 19:02:55 2021 +0300

    aghos: fix windows build

commit d387cec
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 18:22:12 2021 +0300

    aghos: imp code, tests

commit 2450b98
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 13:43:46 2021 +0300

    all: imp code, docs

commit 7fabba3
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 04:04:09 2021 +0300

    all: log changes

commit 7cc1235
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 03:33:13 2021 +0300

    querylog: repl with golibs

commit 8459208
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 03:16:37 2021 +0300

    aghos: use filewalker

commit e4f2964
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 00:34:20 2021 +0300

    aghos: mv recurrentchecker from aghnet
@EugeneOne1
Copy link
Member

@adworacz, latest build in the edge channel should fix the issue. Could you please install it and check OpenWrt detection?

@adworacz
Copy link
Author

Yup I’ll give it a shot this weekend!

@adworacz
Copy link
Author

Works like a champ!

The correct init script is installed, and the service starts correctly on reboot. Thank you for the fix!

@EugeneOne1
Copy link
Member

Glad to hear that. We'll close the issue for now.

heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 3435-openwrt-detect to master

Updates AdguardTeam#3435.

Squashed commit of the following:

commit 04b10f4
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 19:02:55 2021 +0300

    aghos: fix windows build

commit d387cec
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 18:22:12 2021 +0300

    aghos: imp code, tests

commit 2450b98
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 13:43:46 2021 +0300

    all: imp code, docs

commit 7fabba3
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 04:04:09 2021 +0300

    all: log changes

commit 7cc1235
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 03:33:13 2021 +0300

    querylog: repl with golibs

commit 8459208
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 03:16:37 2021 +0300

    aghos: use filewalker

commit e4f2964
Author: Eugene Burkov <[email protected]>
Date:   Fri Aug 13 00:34:20 2021 +0300

    aghos: mv recurrentchecker from aghnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants