Commit Graph

11 Commits

Author SHA1 Message Date
Newbyte c73e439d0a
pmb.sideload: Remove irrelevant output when querying architecture (MR 2286)
Previously, if this was the first time you were connecting to a device,
the output of the ssh command would contain a warning about that the
host was added to the list of trusted hosts. This causes problems as
this gets included in the output where the code previously expected the
string-representation of the architecture to be.

As such, remove the irrelevant output by splitting it into lines and
only using the last line as we assume ssh won't print anything after the
actual output of the invoked command.

Closes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2335
[ci:skip-build]: already built successfully in CI
2024-04-01 22:21:16 +02:00
Newbyte 1d515f9389
pmb.sideload: Run apk incantation in a subshell (MR 2283)
I have Nushell set up on my Librem 5, and it is not a POSIX-compatible
shell. As such, the rc=$? variable assignment in this snippet fails.
Running this in a sh subshell works around this problems and will likely
fix it for other non-POSIX shells as well given that /bin/sh should at
least be POSIX-compatible on any sensible system.
2024-03-30 14:20:13 +00:00
Newbyte c2a069b1f5
pmb.sideload: Query architecture from foreign device (MR 2282)
Instead of assuming the architecture of the foreign device to be what
the user selected in pmbootstrap init, actually query the architecture
from the device and use that.

This does mean that one extra ssh connection is necessary, which does
slow down the procedure somewhat. However, I think that is worth the
user experience improvement this brings.

Also, the deduction process can be skipped by manually specifying
--arch in the sideload invocation should it fail, or if one really wants
to skip that extra ssh roundtrip.

Related: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2317
2024-03-28 11:03:25 +01:00
Oliver Smith 20a0ccf36f
pmb.helpers.run_core: move flat_cmd here
Move pmb.helpers.run.flat_cmd to run_core, as it will be used by
pmb.helpers.run_core.core in the next patch.

Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230713182337.6185-2-ollieparanoid@postmarketos.org%3E
2023-07-21 08:54:04 +02:00
Oliver Smith 9975d373b0
Bump copyright to 2023 2023-01-22 19:18:06 +01:00
Caleb Connolly ab0aa7f956
pmb: sideload: wait for apk database lock
When installing the APK wait for a while for the APK database lock,
services like apk-polkit-server sometimes hog it for a while but there's
no point bailing out immediately.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221111212251.1360612-1-kc@postmarketos.org%3E
2022-11-12 14:28:41 +01:00
Raymond Hackley e5d580e98a
pmb: sideload: Handle ssh_install_apks() errors (MR 2195)
Even add_cmd has exited with code 99, it will be overwritten by clean_cmd
later. Exit with code returned by add_cmd to raise a runtime error when
an error occurs.
2022-08-22 09:45:30 +02:00
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
Alexey Min 2b620a0fdd
pmb.sideload: support non-standard SSH port (!2046)
This can be used for example to sideload packages to
pmbootstrap's QEMU which is running on the port 2222
by default, as follows:

  pmbootstrap sideload --host localhost --port 2222 --user user <pkg>

This adds a `--port` parameter to sideload subcommand.
If not specified, port defaults to 22.
2021-04-25 21:04:49 +03:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Martijn Braam 1921fc5f27
Add sideload command
The sideload command runs the supplied names through the pmbootstrap
buildsystem to make sure they're up-to-date, then uses scp from the host
to copy the built apks to /tmp on the phone and installs them through
ssh.

If the --install-key option is set then it will also copy over the apk
key that's used for signing the packages built by pmbootstrap in case
the postmarketOS install on the device isn't build by the same machine
as you're sideloading from.
2020-12-08 17:42:30 +01:00