Page MenuHomePhabricator

vyos-build configure script should check /etc/issue to avoid confusion
Open, LowPublicBUG

Description

For new users (yup, I totally just wasted 2 hours troubleshooting because I didn't parse far enough into the README.md) it would be helpful when running ./configure if the build isn't occurring in a Jessie/Debian 8 environment that scripts/check-build-env would return an error and direct people to the relevant steps for setting up the debootstrap environ.

Currently any valid debian workspace, i.e. ubuntu 18.04, will pass the configure checks but then will begin to have other odd failures with other components. For instance lb config (because it's running the older a57 version) will return an error about unrecognized options:

lb config: unrecognized option '--debootstrap-options'
lb config: unrecognized option '--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown --include=apt-transport-https'
lb config: unrecognized option '--updates'

and the default live-build package can't parse the chroot correctly which will cause the system to abort with the following error:

chroot: failed to run command ‘/usr/bin/env’: No such file or directory

For Debian 8 putting this into the check-build-env after the import util call would create the conditional:

with open('/etc/issue', 'r') as f:
    if not 'Debian GNU/Linux 8' in f.read():
        print("vyos-build requires a Jessie/Debian 8 environment to properly build, please refer to README.md")
        sys.exit(1)
    else:
        print("OS environment confirmed")

Details

Difficulty level
Unknown (require assessment)
Version
1.2.X rolling
Why the issue appeared?
Will be filled on close

Event Timeline

LiquidLight updated the task description. (Show Details)
c-po added a subscriber: c-po.Nov 15 2018, 6:08 AM

Issue file con be overwritten. lsb_release -d would be a better way, as it gives you Description: Debian GNU/Linux 8.11 (jessie)

c-po added a comment.Nov 15 2018, 9:20 AM

@LiquidLight there is a Dockerfile, too to build VyOS

runar added a subscriber: runar.Nov 24 2018, 10:10 AM

Another way is to check in /etc/os-release, but that is also a changeable file.... Wondering where lsb_release reads it from ( no pc atm, so cannot check)

c-po added a comment.Nov 24 2018, 10:15 AM

man strace(1) indicates that it opens several system files until it gets a match for any known distro.

syncer triaged this task as Low priority.
pasik added a subscriber: pasik.Mar 12 2019, 6:08 PM