Compare commits

...

7 Commits

Author SHA1 Message Date
Rocka 79ac19ae61 hwdb: add cube i7 2020-02-28 02:16:32 +09:00
Balint Reczey 287f506c32 pstore: Don't start systemd-pstore.service in containers
Usually it is not useful and can also fail making
boot-and-services autopkgtest fail.
2020-02-27 14:26:34 +01:00
Yu Watanabe 81eb5bc5cc network: remove redundant %m in error message 2020-02-27 20:28:29 +09:00
Peter Hutterer 3d7ac1c655 udev-builtin-input_id: any i2c mouse is a pointing stick
Where we have a device that looks like a mouse and is connected over i2c, tag
it as pointing stick. There is no such thing as a i2c mouse.

Even touchpads that aren't recognized by the kernel will not show up as i2c
mouse - either the touchpad follows the Win8.1 specs in which case the kernel
switches it to multitouch mode and it shows up like a touchpad. The built-in
trackpoint, if any, is then the i2c mouse device.

Where the touchpad doesn't follow the spec, the kernel will not handle it and
the touchpad remains on the PS/2 legacy bus - not i2c. Hence we can assume
that any i2c mouse device is really a pointing stick.
2020-02-27 19:53:46 +09:00
Yu Watanabe 15db1f3d2e
Merge pull request #14953 from yuwata/userdb-fix-groupdb
userdb: make groupdb_all() always set iterator when it returns >= 0
2020-02-27 19:53:20 +09:00
Yu Watanabe 443876d8dc userdb: make groupdb_all() always set iterator when it returns >= 0 2020-02-27 18:05:14 +09:00
Yu Watanabe 0ffbe10b81 userdb: drop unnecessary goto 2020-02-27 18:04:47 +09:00
5 changed files with 35 additions and 14 deletions

View File

@ -209,6 +209,10 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnConnect:pnTablet9:*
sensor:modalias:acpi:KIOX000A*:dmi:*:svncube:pni1-TF:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
# Cube i7
sensor:modalias:acpi:SMO8500*:dmi:*:svncube:pni7:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
# Cube i7 Stylus
sensor:modalias:acpi:KIOX000A*:dmi:*:svnCube:pni7Stylus:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1

View File

@ -74,11 +74,11 @@ static int dhcp4_route_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *li
/* It seems kernel does not support that the prefix route cannot be configured with
* route table. Let's once drop the config and reconfigure them later. */
log_link_message_debug_errno(link, m, r, "Could not set DHCPv4 route, retrying later: %m");
log_link_message_debug_errno(link, m, r, "Could not set DHCPv4 route, retrying later");
link->dhcp4_route_failed = true;
link->manager->dhcp4_prefix_root_cannot_set_table = true;
} else if (r < 0 && r != -EEXIST) {
log_link_message_warning_errno(link, m, r, "Could not set DHCPv4 route: %m");
log_link_message_warning_errno(link, m, r, "Could not set DHCPv4 route");
link_enter_failed(link);
return 1;
}

View File

@ -699,11 +699,9 @@ int userdb_all(UserDBFlags flags, UserDBIterator **ret) {
setpwent();
iterator->nss_iterating = true;
goto finish;
} else if (r < 0)
return r;
finish:
*ret = TAKE_PTR(iterator);
return 0;
}
@ -905,15 +903,9 @@ int groupdb_all(UserDBFlags flags, UserDBIterator **ret) {
setgrent();
iterator->nss_iterating = true;
goto finish;
}
} if (r < 0)
return r;
if (!FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE))
goto finish;
return r;
finish:
*ret = TAKE_PTR(iterator);
return 0;
}

View File

@ -16,6 +16,7 @@
#include "device-util.h"
#include "fd-util.h"
#include "missing_input.h"
#include "parse-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "udev-builtin.h"
@ -123,8 +124,25 @@ static void get_cap_mask(sd_device *pdev, const char* attr,
}
}
static struct input_id get_input_id(sd_device *dev) {
const char *v;
struct input_id id = {};
if (sd_device_get_sysattr_value(dev, "id/bustype", &v) >= 0)
(void) safe_atoux16(v, &id.bustype);
if (sd_device_get_sysattr_value(dev, "id/vendor", &v) >= 0)
(void) safe_atoux16(v, &id.vendor);
if (sd_device_get_sysattr_value(dev, "id/product", &v) >= 0)
(void) safe_atoux16(v, &id.product);
if (sd_device_get_sysattr_value(dev, "id/version", &v) >= 0)
(void) safe_atoux16(v, &id.version);
return id;
}
/* pointer devices */
static bool test_pointers(sd_device *dev,
const struct input_id *id,
const unsigned long* bitmask_ev,
const unsigned long* bitmask_abs,
const unsigned long* bitmask_key,
@ -149,7 +167,7 @@ static bool test_pointers(sd_device *dev,
bool is_tablet = false;
bool is_joystick = false;
bool is_accelerometer = false;
bool is_pointing_stick= false;
bool is_pointing_stick = false;
has_keys = test_bit(EV_KEY, bitmask_ev);
has_abs_coordinates = test_bit(ABS_X, bitmask_abs) && test_bit(ABS_Y, bitmask_abs);
@ -229,6 +247,10 @@ static bool test_pointers(sd_device *dev,
!has_abs_coordinates)) /* mouse buttons and no axis */
is_mouse = true;
/* There is no such thing as an i2c mouse */
if (is_mouse && id->bustype == BUS_I2C)
is_pointing_stick = true;
if (is_pointing_stick)
udev_builtin_add_property(dev, test, "ID_INPUT_POINTINGSTICK", "1");
if (is_mouse)
@ -326,6 +348,8 @@ static int builtin_input_id(sd_device *dev, int argc, char *argv[], bool test) {
}
if (pdev) {
struct input_id id = get_input_id(pdev);
/* Use this as a flag that input devices were detected, so that this
* program doesn't need to be called more than once per device */
udev_builtin_add_property(dev, test, "ID_INPUT", "1");
@ -334,7 +358,7 @@ static int builtin_input_id(sd_device *dev, int argc, char *argv[], bool test) {
get_cap_mask(pdev, "capabilities/rel", bitmask_rel, sizeof(bitmask_rel), test);
get_cap_mask(pdev, "capabilities/key", bitmask_key, sizeof(bitmask_key), test);
get_cap_mask(pdev, "properties", bitmask_props, sizeof(bitmask_props), test);
is_pointer = test_pointers(dev, bitmask_ev, bitmask_abs,
is_pointer = test_pointers(dev, &id, bitmask_ev, bitmask_abs,
bitmask_key, bitmask_rel,
bitmask_props, test);
is_key = test_key(dev, bitmask_ev, bitmask_key, test);

View File

@ -11,6 +11,7 @@
Description=Platform Persistent Storage Archival
Documentation=man:systemd-pstore(8)
ConditionDirectoryNotEmpty=/sys/fs/pstore
ConditionVirtualization=!container
DefaultDependencies=no
Wants=systemd-remount-fs.service
After=systemd-remount-fs.service