Skip to content

bootstrap: Fix TLS, check if .entware exists, and improve error messages#423

Merged
matteodelabre merged 2 commits into
testingfrom
bootstrap/fixes
Sep 2, 2021
Merged

bootstrap: Fix TLS, check if .entware exists, and improve error messages#423
matteodelabre merged 2 commits into
testingfrom
bootstrap/fixes

Conversation

@matteodelabre
Copy link
Copy Markdown
Member

This PR contains several fixes for the bootstrap script.

Test plan (on rM1 and rM2):

INFO:  Fetching secure wget
wget: bad address 'toltec-dev.org'
ERROR: Could not fetch wget, make sure you have a stable Wi-Fi connection
  • Try to run it with 127.0.0.1 toltec-dev.org in /etc/hosts. Expected output:
INFO:  Fetching secure wget
wget: can't connect to remote host (127.0.0.1): Connection refused
ERROR: Could not fetch wget, make sure you have a stable Wi-Fi connection
  • Starting from a complete Toltec install, unmount /opt (systemctl stop opt.mount) and remove the /opt folder. Try to run the script. Expected output:
INFO:  Toltec is already installed or partially installed
INFO:  To re-enable Toltec after a system upgrade, run 'toltecctl reenable'
INFO:  To reinstall Toltec, run 'toltecctl uninstall' first

This PR contains several fixes for the bootstrap script.

* If the standalone `wget` binary cannot be fetched, a more helpful error message is printed instead of the catch-all error message (see #422).
* The standalone `wget` binary is fetched over HTTP instead of HTTPS, since the implementation of TLS in Busybox’s wget causes issues with the latest version of nginx. This does not reduce security since the checksum is still verified after fetching the binary (fixes #422, I believe).
* Abort installation if `/home/root/.entware` already exists. Previously, only the existence of `/opt` was checked, leading to #409.

Test plan (on rM1 and rM2):

* Try to run the script normally. Issue #422 should be fixed and the install should proceed.
* Try to run the script while not being connected to Wi-Fi. Expected output:

```sh
INFO:  Fetching secure wget
wget: bad address 'toltec-dev.org'
ERROR: Could not fetch wget, make sure you have a stable Wi-Fi connection
```

* Try to run it with `127.0.0.1 toltec-dev.org` in `/etc/hosts`. Expected output:

```sh
INFO:  Fetching secure wget
wget: can't connect to remote host (127.0.0.1): Connection refused
ERROR: Could not fetch wget, make sure you have a stable Wi-Fi connection
```

* Starting from a complete Toltec install, unmount /opt (`systemctl stop opt.mount`) and remove the /opt folder. Try to run the script. Expected output:

```sh
INFO:  Toltec is already installed or partially installed
INFO:  To re-enable Toltec after a system upgrade, run 'toltecctl reenable'
INFO:  To reinstall Toltec, run 'toltecctl uninstall' first
```
Copy link
Copy Markdown
Contributor

@raisjn raisjn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept to unblock

@matteodelabre
Copy link
Copy Markdown
Member Author

Thanks!

@matteodelabre matteodelabre merged commit 4a17b57 into testing Sep 2, 2021
@matteodelabre matteodelabre deleted the bootstrap/fixes branch September 2, 2021 08:02
matteodelabre added a commit that referenced this pull request Sep 25, 2021
Fixes:

* TLS issues with the bootstrap script (#422, #423)
* Bootstrap script could overwrite existing installs (#409, #423)

Updated packages:

* fbink, fbdepth, fbink-doom - 1.24.0-1 (#425)
* innernet - 1.4.1-2 (#420)
* koreader - 2021.09-1 (#436)
* remux - 0.1.9-5 (#431) (fixes 2.9 issues)
* toltec-bootstrap - 0.2.0-1
matteodelabre added a commit that referenced this pull request Oct 4, 2021
Fixes:

* TLS issues with the bootstrap script (#422, #423)
* Bootstrap script could overwrite existing installs (#409, #423)

Updated packages:

* fbink, fbdepth, fbink-doom - 1.24.0-1 (#425)
* innernet - 1.4.1-2 (#420)
* koreader - 2021.09-1 (#436)
* remux - 0.1.9-5 (#431) (fixes 2.9 issues)
* toltec-bootstrap - 0.2.0-1
@matteodelabre matteodelabre mentioned this pull request Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working install Installation scripts

Projects

None yet

2 participants