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

[BUG] "bastille boostrap" gives spurious and wrong warning about "bastille_zfs_enable" #688

Open
michael-o opened this issue Mar 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@michael-o
Copy link

michael-o commented Mar 12, 2024

Describe the bug
Running on a UFS-only host. Bootstrapping a new release (13.3-RELEASE):

# bastille bootstrap 13.3-RELEASE
$bastille_zfs_enable is not set properly - see rc.conf(5).
Bootstrapping FreeBSD distfiles...
$bastille_zfs_enable is not set properly - see rc.conf(5).
$bastille_zfs_enable is not set properly - see rc.conf(5).
/usr/local/bastille/cache/13.3-RELEASE/MANIFES        1046  B 9627 kBps    00s
/usr/local/bastille/cache/13.3-RELEASE/base.tx         205 MB 2116 kBps 01m39s
Validated checksum for 13.3-RELEASE: base.txz
MANIFEST: d10531d663cee5efeb7d696ca84ce90adacd1fae14dd249628fb74da0c7c2820
DOWNLOAD: d10531d663cee5efeb7d696ca84ce90adacd1fae14dd249628fb74da0c7c2820
Extracting FreeBSD 13.3-RELEASE base.txz.

Bootstrap successful.
See 'bastille --help' for available commands.

It is not clear why $bastille_zfs_enable is not set properly - see rc.conf(5). is displayed at all, but even if it carries out several problems.

Bastille and FreeBSD version
0.10.20231125
13.3-STABLE
13.3-STABLE
13.3-STABLE

How did you install bastille? (port/pkg/git)
pkg

Root Cause

  • bastille_zfs_enable is not part of rc.conf. It does not make sense to mention rc.conf(5), more than that it is confusing because the manpage of it does know nothing about bastille. It needs to be removed. I would understand: "see /usr/local/....bastille.conf".
  • The default value is empty:
    bastille_zfs_enable="" ## default: ""
  • The check is checkisyesno:
    checkyesno() {
    ## copied from /etc/rc.subr -- cedwards (20231125)
    ## issue #368 (lowercase values should be parsed)
    ## now used for all bastille_zfs_enable=YES|NO tests
    ## example: if checkyesno bastille_zfs_enable; then ...
    ## returns 0 for enabled; returns 1 for disabled
    eval _value=\$${1}
    case $_value in
    [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
    return 0
    ;;
    [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
    return 1
    ;;
    *)
    warn "\$${1} is not set properly - see rc.conf(5)."
    return 1
    ;;
    esac
    }
  • It is a simple copy and paste error from rc.subr

Fix

  • Fix the default value
  • change see message
@michael-o michael-o added the bug Something isn't working label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant