- 13 Mar, 2017 1 commit
-
-
spiiroin authored
The is_in_user_state() is used unconditionally, but it is available only when --enable-meegodevlock option has been passed to configure. Also, the related "usb_moded-dsme.h" is included both unconditionally and from withing a #ifdef MEEGOLOCK block - which hides the configuration problem until build proceeds to linking phase. Make the call is_in_user_state() only if MEEGOLOCK is defined. Remove the extraneous "usb_moded-dsme.h" include to make such errors visible already in compilation stage due to missing prototypes. Also, make sure the "usb_moded-dsme.h" can't be included without warnings unless MEEGOLOCK is defined. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 06 Mar, 2017 1 commit
-
-
Matti Kosola authored
Update project URL See merge request !22
-
- 14 Feb, 2017 6 commits
-
-
spiiroin authored
-
spiiroin authored
Whether and when we can switch for example from charging fallback to developer mode depends on multiple triggers - the order of which might vary from one device/bootup to another. Using custom state evaluation code at each possible trigger location easily causes unexpected results like device staying in fallback charging mode until the cable is re-attached. Add a state evaluation function and call it from those triggers that potentially allow exit from the charging fallback mode. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
It is confusing to have a function called usb_moded_get_export_permission() that returns true when exporting is *not* permitted. Flip the return value to increase code readability. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Having possibility to log wakelocking activity is useful in some special circumstance, but it creates a lot of noise and usb-moded is lacking fine tuned logging control. Disable wakelock logging altogether by default. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Remove -Wdeclaration-after-statement as first using -std=gnu99 to allow c99 features and then explicitly requesting warnings about using c99 features makes little sense. Remove -W option as it is just backwards compatibility alias for -Wextra. Remove -Wformat as it is implied by having -Wall present. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 31 Jan, 2017 3 commits
-
-
spiiroin authored
-
Andrew den Exter authored
-
- 07 Dec, 2016 5 commits
-
-
Lourens-Rich authored
-
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 4 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>
-