- 31 Jan, 2017 3 commits
-
-
spiiroin authored
-
Andrew den Exter authored
-
- 07 Dec, 2016 4 commits
-
-
spiiroin authored
Forgot to add bug ref to commit, so 0.86.0+mer8 got rejected by ci-bot. Make a dummy version bump and add bug ref to make ci-bot happy. [ssu] Use ssusysinfo instead of SSU D-Bus interface. Fixes JB#36841
-
spiiroin authored
-
spiiroin authored
During bootup usb-moded needs device name / model information before the system has reached a point where SSU daemon can be started. This can cause systemd deadlocks and/or timeouts as usb-moded waits for SSU daemon and the rest of the bootup is blocked until usb-moded reaches ready state. Use ssu-sysinfo C-library that can provide the device details required by usb-moded without using any IPC mechanisms. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 07 Nov, 2016 15 commits
-
-
spiiroin authored
-
spiiroin authored
Not explicitly initializing the pointer to null value makes the validity of the initial state subject to compiler/libc level implementation details. And not clearing the pointer after dropping the reference can lead to hard to debug issues if the potentially state pointer is used later on. Explicitly initialize the context to null value and set it back to null after dropping the reference. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Exiting from mainloop does not work as intended, looks like handle_exit() is meant to be called from main() function after mainloop is stopped. What happens in practice is that handle_exit() gets called from signal handler and it makes exit() without ever returning to main() function - which means some cleanup tasks are skipped. In general: Make cleanup tasks happen on the same logical level where initialization is made, re-order init/cleanup tasks according to what functional inter dependencies exist and add comments describing why things are done when they are done. Remove handle_exit() function and distribute work it used to do among: - usb_moded_stop() - exiting from mainloop - usb_moded_cleanup() - releasing usb-mode related state/config data - main() - cleaning up init steps made from main() To make possible ordering issues more visible, refuse to send usb-moded dbus signals in situations where the service name is not owned by the ubs-moded process. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Mixed use of syslog, stdout, stderr and differences in buffering of the streams causes the initial "starting up" message to end up as the final output in usb-moded journal when debug level logging is used (i.e. when freopen steps are skipped and stdout is not implicitly flushed). Use stderr and flush it before potentially switching to syslog logging. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Use of wall clock timestamps with microsecond accuracy makes it difficult to see where usb-moded is spending time during startup. Use timestamps that use millisecond accuracy and are relative to usb-moded startup time. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Usb-moded opens and closes a private peer-to-peer dbus connection for each systemd unit start/stop it needs to perform. This is relatively heavy operation and seems to cause problems with systemd v225 during bootup. Since usb-moded no longer has any reason to communicate with systemd before it can connect to SystemBus, we can drop the private connections and use cached SystemBus connection instead. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The systemd_control_service() function looks like it should return a boolean success/failure, but it is returning integer zero on success and integer one on failure - which is confusing. Make it return gboolean value so that success is TRUE and failure FALSE. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Usb-moded is making repeated blocking device state queries even when the component providing the service is not running. Use cached device state and keep it up to date fully asynchronously by tracking dsme service availability and state changes it signals. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Usb-moded is making repeated blocking devicelock state queries even when the component providing the service is not running. Use cached devicelock state and keep it up to date fully asynchronously by tracking devicelock service availability and state changes it signals. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
If ssu functionality is called in inappropriate state of usb-moded startup, it will implicitly make SystemBus connection. Use cached cached connection, so that attempts to make ssu queries will fail (with error logging) if they done before the main logic has connected to the SystemBus. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Starting/stopping appsync related systemd units is relatively expensive task to perform and can cause timing problems during bootup. As we know the appsync processes have not been started when device is booting up, we can skip the explicit stopping when usb-moded is started as part of bootup sequence. Also, when usb-moded is exiting, it should be enough to stop only those units that have been started by usb-moded. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
It is treated as a boolean, so using matching type improves readability. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Enabler for making various dbus tracking activities asynchronous. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
D-Bus SystemBus connection is made from several places. Explicitly from the main() and implicitly from various modules that do ipc with other components. This makes it hard to tell when connection actually gets made, process wide dbus initialization happens in the wrong place and setting up signal matches is delayed by the synchronous initialization activity during startup. Move dbus_threads_init_default() to more appropriate place so that it actually is the first libdbus call that gets made. Handle connecting to SystemBus and installing signal listeners as early as possible and claim usb-moded service name separately when usb-moded is ready to process requests made over D-Bus. Add usb_moded_dbus_get_connection() function that other modules can use to get reference to the SystemBus connection when/if one has been made from the main logic. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 03 Nov, 2016 5 commits
-
-
spiiroin authored
-
spiiroin authored
Discovery of usb-moded D-Bus interface is difficult since org.freedesktop.DBus.Introspectable interface is not supported for the parent objects leading to full "/com/meego/usb_moded" path. Provide Introspect xml replies also for all the parent objects to facilitate automatic interface discovery. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
spiiroin authored
Upstream sync [version] Merge changes from upstream 0.86.0 version. Fixes MER#1583 Cherry-pick commits from upstream repo that are missing from mer usb-moded. Due to version conflicts created earlier, the mer versions (that are higher than ones used by upstream) are retained in configure.ac and rpm/usb-moded.spec -files. See merge request !18
-
- 02 Nov, 2016 5 commits
-
-
Philippe De Swert authored
Make some ELF sections readonly with -z relro and -z relro now See: https://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_RELRO_.28ld_-z_relro.29Signed-off-by:
Philippe De Swert <philippe.deswert@gmail.com>
-
phdeswer authored
Signed-off-by:
Philippe De Swert <philippedeswert@gmail.com>
-
phdeswer authored
Signed-off-by:
Philippe De Swert <philippedeswert@gmail.com>
-
phdeswer authored
To get a working adb mode, we need to add the functionfs mounting, as just starting adbd is not enough anymore. Signed-off-by:
Philippe De Swert <philippedeswert@gmail.com>
-
phdeswer authored
Dynamic modes list reading should not be disabled when appsync is not there, as quite a number of them work without it. Signed-off-by:
Philippe De Swert <philippedeswert@gmail.com>
-
- 18 Oct, 2016 8 commits
-
-
spiiroin authored
-
spiiroin authored
Whether and what kind of diagnostic mode is supported varies from one device to another. Having usb-moded itself depend on diagnostic mode configuration package causes unnecessary / potentially altogether wrong data to get installed on all devices. Remove dependencies from main usb-moded package to diagnostic mode configuration package. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
spiiroin authored
The once/bootup mechanism used for terminating rescue mode leaves it permanently active if usb moded is restarted after bootup has finished. Do not activate rescue mode if init-done has been reached when usb-moded is starting up. Disable rescue mode if init-done is signaled on D-Bus SystemBus while usb-moded is running. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When charger is connected, usb-moded can see first "USB" (=cable) connection event from udev followed by "USB_CDP" (=charger) event. Due to cached something-connected flag usb moded still behaves as if pc cable were connected - which leaves ui thinking mode selection can/should be done etc. If dedicated charger is reported after pc cable, clear the low level something-connected flag before acting on charger connected info. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-