Commit Graph

49 Commits

Author SHA1 Message Date
Paul Fertser 0c10c224be treewide: remove AUTORELEASE
Automatically compute and substitute current values for all
$(AUTORELEASE) instances as this feature is deprecated and shouldn't be
used.

The following temporary change was made to the core:

diff --git a/rules.mk b/rules.mk
index 57d7995d4fa8..f16367de87a8 100644
--- a/rules.mk
+++ b/rules.mk
@@ -429,7 +429,7 @@ endef
 abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))

 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
+AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile))

 all:
 FORCE: ;

And this command used to fix affected packages:

for i in $(cd feeds/packages; git grep -l PKG_RELEASE:=.*AUTORELEASE | \
                              sed 's^.*/\([^/]*\)/Makefile^\1^';);
do
  make package/$i/download
done

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2023-04-21 22:46:58 +02:00
Daniel Golle 2978d4c6ee
auc: update to version 0.3.2
* fixes segfault when requesting downgrade

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-10-16 20:30:22 +01:00
Daniel Golle fd36c91db8
auc: update to 0.3.1
Remove wrongly placed 'break' statement to actually jump to the most
recent version of a release branch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-10-13 19:48:05 +01:00
Daniel Golle 36525086ce
auc: update to version 0.3.0
Most notably this brings support for processing package changes such
as suggesting to replace firewall with firewall4 when updating from
21.02.x -> 22.03.y release.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-10-13 18:04:59 +01:00
Daniel Golle f1969ab584
auc: only add filesystem type if it is known
Prevent NULL-pointer on older versions of OpenWrt.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-21 11:52:27 +00:00
Daniel Golle 6c9ab0e426
auc: bump to version 0.2.5
Request root filesystem type to since it is possible now after
9d8467a748

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-03-21 11:12:49 +00:00
Daniel Golle c0d2c82528
auc: don't segfault on invalid URL
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>
2022-03-13 23:49:25 +00:00
Daniel Golle 6b041752a0
auc: fall back to 'sdcard' image
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>
2022-02-14 14:25:54 +00:00
Daniel Golle d27ecdcc49 auc: accept both 'y' and 'Y' as confirmation from user
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>
2022-02-13 22:30:42 +00:00
Daniel Golle 19c135685f
auc: add '-n' parameter for dry-run
Add option to allow only requesting an image but not actually download
or sysupgrade anything.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-27 17:26:28 +00:00
Paul Spooren 6527d65b9b auc: remove superfluous variables
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>
2021-10-08 22:52:02 +01:00
Paul Spooren 69b5c28929 auc: use /json/v1/
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>
2021-09-24 10:17:07 -10:00
Daniel Golle 51f9df5b92
auc: fix some minor issues
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-09-15 22:32:56 +01:00
Daniel Golle bd4ad7b0ba
auc: update to version 0.2.4
A stray ')' made auc skip the check if all mandatory fields of a
branch are present. Fix paranthesis in that if-clause to actually
check for all fields.

Don't even fetch package lists if checking only for release.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-27 03:50:35 +01:00
Daniel Golle 2edbc4c805
auc: update to version 0.2.3
* 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

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-26 03:34:13 +01:00
Paul Spooren 23ce5b0e6f auc: read `detail` not `message` from server
The server API was unified and therefore the servers response is now
`detail` rather than `message`, all found under the new endpoint
/api/v1/build.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-08-23 08:47:08 -10:00
Daniel Golle 8486f64fea
auc: update to version 0.2.1
Brings support for future connexion based API.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-18 19:33:41 +01:00
Daniel Golle b1d38e7ab3
auc: update to version 0.2.0
* support for ASU server post commit aparcar/asu@bac6de18

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-15 02:33:53 +01:00
Daniel Golle 6c784dff2b
auc: move function to right place
Change order of functions defined to fix build.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-14 14:01:34 +01:00
Daniel Golle 545c93d45b
auc: improve branch selection logic
Make sure '-rcX' suffix is recognized as being a lower version than
the release.
Detect per-branch snapshot version by matching the version name string.
Clean up here and there.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-14 01:08:05 +01:00
Daniel Golle 4d789eac33
auc: handle root filesystem type
Automatically select image root filesystem type and allow the user
to override that choice using the new '-F' command line option.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-13 04:54:32 +01:00
Daniel Golle 9c491c6cbc
auc: update to version 0.1.9
Follow the @aparcar's withlist:
- [x] Print URL of used server when searching for an update
- [x] Implement `-y` option which automatically accepts changes
- [x] Implement `-r` option which doesn't check for package upgrades but only new releases
- [x] Print link or created image to be downloadable by the user from a browser/curl.

Also allow selecting branch and version manually.

Fixes: #16324
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-08-12 03:11:47 +01:00
Daniel Golle 1204cb82f9 auc: update to version 0.1.8
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>
2021-06-30 01:40:37 +01:00
Daniel Golle 9150e82768 auc: update to version 0.1.7
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>
2021-06-15 10:47:50 +01:00
Daniel Golle 02bc1fc929 auc: fix several issues
* 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>
2021-06-13 22:39:14 +01:00
Rosen Penev 2e654b19f3 treewide: back to cmake.mk
Ninja was merged to base and therefore we can now use normal cmake.mk

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-12 21:05:01 -07:00
Daniel Golle 5b7ff1ad65
auc: support queue_position status from server
Display position in queue while waiting for build.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-05-10 04:20:41 +01:00
Daniel Golle 794cf3ac59
auc: compare versions using dpkg/opkg's verrevcmp
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>
2021-04-26 19:21:43 +01:00
Rosen Penev a31b732007 treewide: build CMake projects with Ninja
faster to compile.

A small selection of packages was tested going from:

Executed in  696.30 secs   fish           external
   usr time   82.98 mins  395.00 micros   82.98 mins
   sys time    9.02 mins    0.00 micros    9.02 mins

to:

Executed in  592.20 secs   fish           external
   usr time   84.84 mins  361.00 micros   84.84 mins
   sys time    8.85 mins   57.00 micros    8.85 mins

Tested by running make -j 12 and wiping staging/build_dir/target_x

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-27 21:51:50 -07:00
Daniel Golle 004abfec75
auc: bump to version 0.1.6
Fixes running on release branches.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-18 01:39:44 +00:00
Daniel Golle fb26b424e8
auc: several improvements
* 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

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-15 00:54:23 +00:00
Daniel Golle 985b0f8f63
auc: improve CLI
Make some cosmetics improvements.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-10 03:16:21 +00:00
Daniel Golle 85ba80592b
auc: update to new server API
This updates auc to use the new API of the sysupgrade image server.
Package version updates now need to be evaluated locally.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-10 02:21:03 +00:00
Rosen Penev 67ac784f75
auc: link to libdl when needed
Fixes compilation under glibc.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-30 16:36:52 -08:00
Daniel Golle 8945a3f4d5 auc: send revision in update check
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-08 00:32:48 +01:00
Daniel Golle a903808e2c auc: adapt to server and ubus API
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-07 20:38:37 +01:00
Daniel Golle d506fc2651 auc: remove left-over subtarget string
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-07 11:56:57 +01:00
Daniel Golle 8c30ddd9dc auc: more API updates
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-06 22:28:47 +01:00
Daniel Golle af68f43147 auc: sync with server API
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>
2019-03-06 15:22:48 +01:00
Daniel Golle a7a02b4d87 auc: always send version when requesting image
Fixes #5799

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2018-03-23 01:53:09 +01:00
Daniel Golle 8162fecb37 auc: update to version 0.0.9
* 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>
2018-02-23 00:51:18 +01:00
Daniel Golle b514587011 auc: update to version 0.0.8
* 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>
2017-11-30 02:33:13 +01:00
Daniel Golle 19653e57bf auc: update to version 0.0.7
* implement using GET instead of POST requests when waiting for image

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-11-26 18:25:07 +01:00
Daniel Golle 78c699daa6 auc: update to version 0.0.6
* handle newly introduced 'initialize' server status
 * cosmetics

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-11-24 17:24:16 +01:00
Daniel Golle 7620a0d60c auc: update to version 0.0.5
* 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>
2017-11-23 18:56:58 +01:00
Daniel Golle dbcfa1618e auc: update to version 0.0.4
* 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>
2017-11-23 18:01:13 +01:00
Daniel Golle 68ae65f3bc auc: be a bit more verbose
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-11-13 01:49:04 +01:00
Daniel Golle 123ddf66ae auc: small improvements
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>
2017-11-13 00:39:46 +01:00
Daniel Golle 95d96a360f auc: add new package
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>
2017-11-12 23:33:15 +01:00