Sync auc with main branch.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 6c9ab0e426)
(cherry picked from commit f1969ab584)
(cherry picked from commit 36525086ce)
(cherry picked from commit fd36c91db8)
Show error message instead of segfaulting in case of an invalid URL
being read from UCI config.
Fixes: #17971
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit c0d2c82528)
Fallback to use 'sdcard' image in case there is neither 'sysupgrade'
nor 'combined' image available.
This allows using 'auc' on targets where 'sdcard' image is also used
for sysupgrade (such as some mvebu-based devices with eMMC).
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 6b041752a0)
Accept both 'y' and 'Y' as positive confirmation when asking the user
if auc should proceed with requesting and installing an upgrade.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d27ecdcc49)
Add option to allow only requesting an image but not actually download
or sysupgrade anything.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 19c135685f)
Remove parsing of data which is not used within `auc`. Later iterations
may use these but they can be gradually added whenever needed.
Also remove HTTP code handling of error codes no longer used by the
backend. Early iterations of the server where infinitely complex to
figure out created images and announce them to clients but ever since
everything is stored in JSON, things got better (aka simpler).
If a package is missing on the upstream server, color it in red.
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 6527d65b9b)
Currently `auc` uses the outdated /json/ path, this commit uses
/json/v1/ to be more future proof.
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 69b5c28929)
* Brings support for future connexion based API.
* read `detail` not `message` from server
* use regular verrevcmp for branch names, fixes update indication
* break out usage() from main() function
* require '-f' in case installed package is missing in remote lists
* don't use ENETUNREACH for unlrelated error
* Fix check for mandatory fields (stray parenthesis)
* Don't even fetch package lists if checking only for release.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 8486f64fea)
(cherry picked from commit 23ce5b0e6f)
(cherry picked from commit 2edbc4c805)
(cherry picked from commit bd4ad7b0ba)
Cherry-picked from
9c491c6cb auc: update to version 0.1.9
4d789eac3 auc: handle root filesystem type
545c93d45 auc: improve branch selection logic
6c784dff2 auc: move function to right place
b1d38e7ab auc: update to version 0.2.0
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This fixes support for x86, auc now selects the right combined image
depending on the system being booted in EFI mode or not.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 1204cb82f9)
Using strcmp() to compare a version string doesn't work well.
Use verrevcmp() function from opkg instead.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 794cf3ac59,
as it was previously skipped also switch PKG_REVISION back to manual
to keep it in sync with master branch)
No longer fail in case a package is part of multiple lists (which may
happen temporarily in case it becomes 'nonshared').
Bump version to prepare for sync accross branches.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9150e82768)
* don't segfault if server reply is incomplete
* always request 'generic' image on x86/generic and x86/64
* make SNAPSHOT branches sticky, eg. stay on 21.02-SNAPSHOT and do
not 'upgrade' to 21.02.0-rc2.
* output requested server URL when debugging
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 02bc1fc929)
* update to new server API
* include version_code in request
* include versions of selected packages in request
* add SHA256 verification via busybox sha256sum
* sort attributes in policies alphabetically
* move all API-specific string constants to precompiler macros
* set correct MIME type for JSON post request (application/json)
* output string error message if something goes wrong
* auto-generate version string
(cherry squashed from commit 85ba80592b,
commit 985b0f8f63 and
commit fb26b424e8)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Drop pre-ucert signature verification.
HTTPS is optional now as integrity can also be provided using ucert.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* use full package list when checking for upgrades
* verify sha256sums and usign signature of sha256sums.sig
* introduce '-c' option to only check if system is up-to-date
* introduce '-F' option to ignore the signature verification result
* return -1 on locally caused and -2 on server-side errors
* don't include locally appended attributes in debug output of a
server reply
* output bug report note on 412 target not found
* use content-length header instead of filesize field in JSON content
* suppress duplicate error messages
* drop unused attributes
* make debug messages optional at compile-time
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* fix multiple read_data_cb calls from uclient, otherwise hickups
happend when receiving a large JSON reply
* add minimal help message (-h)
* pretify package update output
* fix infinite retry of upgrade-check which happened in some cases
* add sleep in case of check-request retry
* lots of cosmetics
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* use HTTP headers to know ImageBuilder status and queue position
* use pretty (ie. indented) JSON output for debugging
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* implement '-d' cmdline option to output json requests
* switch to new server API
* implement upgrade_packages
Read upgrade_packages UCI option and ask for either only release
upgrades or also builds based on updated packages depending on whether
upgrade_packages is '0' or '1'.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Detect if calling rpc-sys packagelist fails due to the method not
being provided by rpcd.
Mark package as experimental.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The Attended sysUpgrade CLI is a full-featured client for the
attended-sysupgrade service which works directly on the target device.
It requires libustream-ssl as well as at least the CA certificate
needed to contact the sysupgrade server.
It has only been tested briefly and is by no means ready for
production!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>