Compare commits

...

9 Commits

Author SHA1 Message Date
Lukas K e9b0b64f77 fix ACCEL_MOUNT_MATRIX for Thinkpad Yoga 11e 3rd gen
the modalias reported by udev is acpi:BOSC0200:BOSC0200: but the rules
only matched acpi:BOSC0200:BOSC0200 (without the trailing colon)

change to acpi:BOSC0200* as in other models
2020-02-27 08:49:08 +01:00
Mike Gilbert 19bb96759a userdb: allow dots in username
This prevents an error in pam_systemd when logging in.

sshd[2623165]: pam_unix(sshd:session): session opened for user tony.stark(uid=10001) by (uid=0)
sshd[2623165]: pam_systemd(sshd:session): Failed to get user record: Invalid argument

Bug: https://bugs.gentoo.org/708824
2020-02-27 08:47:52 +01:00
James Buren 2a5180945a hwdb: Fix rotation for Nuvision Encite Split 11
Model number NES11-C432SSA
2020-02-27 08:43:57 +01:00
HATAYAMA Daisuke 9c1f969d40 swap: finish the secondary swap units' jobs if deactivation of the primary swap unit fails
Currently, if deactivation of the primary swap unit fails:

    # LANG=C systemctl --no-pager stop dev-mapper-fedora\\x2dswap.swap
    Job for dev-mapper-fedora\x2dswap.swap failed.
    See "systemctl status "dev-mapper-fedora\\x2dswap.swap"" and "journalctl -xe" for details.

then there are still the running stop jobs for all the secondary swap units
that follow the primary one:

    # systemctl list-jobs
     JOB UNIT                                                                                                         TYPE STATE
     3233 dev-disk-by\x2duuid-2dc8b9b1\x2da0a5\x2d44d8\x2d89c4\x2d6cdd26cd5ce0.swap                                    stop running
     3232 dev-dm\x2d1.swap                                                                                             stop running
     3231 dev-disk-by\x2did-dm\x2duuid\x2dLVM\x2dyuXWpCCIurGzz2nkGCVnUFSi7GH6E3ZcQjkKLnF0Fil0RJmhoLN8fcOnDybWCMTj.swap stop running
     3230 dev-disk-by\x2did-dm\x2dname\x2dfedora\x2dswap.swap                                                          stop running
     3234 dev-fedora-swap.swap                                                                                         stop running

    5 jobs listed.

This remains endlessly because their JobTimeoutUSec is infinity:

    # LANG=C systemctl show -p JobTimeoutUSec dev-fedora-swap.swap
    JobTimeoutUSec=infinity

If this issue happens during system shutdown, the system shutdown appears to
get hang and the system will be forcibly shutdown or rebooted 30 minutes later
by the following configuration:

    # grep -E "^JobTimeout" /usr/lib/systemd/system/reboot.target
    JobTimeoutSec=30min
    JobTimeoutAction=reboot-force

The scenario in the real world seems that there is some service unit with
KillMode=none, processes whose memory is being swapped out are not killed
during stop operation in the service unit and then swapoff command fails.

On the other hand, it works well in successful case of swapoff command because
the secondary jobs monitor /proc/swaps file and can detect deletion of the
corresponding swap file.

This commit fixes the issue by finishing the secondary swap units' jobs if
deactivation of the primary swap unit fails.

Fixes: #11577
2020-02-27 08:40:51 +01:00
Ryan Attard 06654d1225
ata_id: Add support for host managed zone block devices (#14933)
If the peripheral device type is that of a host managed zone block device (0x14),
the device supports the same identification mechanisms as conventional disks (0x00).
2020-02-27 16:29:41 +09:00
Anita Zhang 1e84031952
Merge pull request #14950 from keszybz/kernel-install-script-boot_image
kernel-install: strip BOOT_IMAGE= from kernel options
2020-02-26 23:04:57 -08:00
Anita Zhang 54a2f5e69c
Merge pull request #14944 from yuwata/userdb-fix-iterator
userdb: make userdb_all() always set iterator when it returns >= 0
2020-02-26 22:46:17 -08:00
Zbigniew Jędrzejewski-Szmek e60228bf68 kernel-install: strip BOOT_IMAGE= from kernel options
https://bugzilla.redhat.com/show_bug.cgi?id=1716164.
2020-02-26 23:34:41 +01:00
Yu Watanabe 662d74daf7 userdb: make userdb_all() always set iterator when it returns >= 0
Fixes #14868.
2020-02-26 23:57:13 +09:00
7 changed files with 23 additions and 16 deletions

View File

@ -384,7 +384,7 @@ sensor:modalias:acpi:KIOX000A*:dmi:*svnLAMINA:pnT-1016BNORD*
sensor:modalias:acpi:NCPE0388*:dmi:*:rnLenovoYOGA510-14IKB:* sensor:modalias:acpi:NCPE0388*:dmi:*:rnLenovoYOGA510-14IKB:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, 1
sensor:modalias:acpi:BOSC0200:BOSC0200:dmi:*ThinkPadYoga11e3rdGen* sensor:modalias:acpi:BOSC0200*:dmi:*ThinkPadYoga11e3rdGen*
ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=0, 1, 0; -1, 0, 0; 0, 0, 1
# Miix3-1030 # Miix3-1030
@ -473,6 +473,10 @@ sensor:modalias:acpi:KIOX000A*:dmi:*:svnTMAX:pnTM800W560L:*
sensor:modalias:acpi:KIOX000A*:dmi:*:svnTMAX:pnTM101W610L:* sensor:modalias:acpi:KIOX000A*:dmi:*:svnTMAX:pnTM101W610L:*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1 ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
# Nuvision Encite Split 11. NES11-C432SSA
sensor:modalias:acpi:BOSC0200*:dmi:*:svnNuvision:pnNES11:*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
######################################### #########################################
# Onda # Onda
######################################### #########################################

View File

@ -724,9 +724,15 @@ static void swap_enter_active(Swap *s, SwapResult f) {
static void swap_enter_dead_or_active(Swap *s, SwapResult f) { static void swap_enter_dead_or_active(Swap *s, SwapResult f) {
assert(s); assert(s);
if (s->from_proc_swaps) if (s->from_proc_swaps) {
Swap *other;
swap_enter_active(s, f); swap_enter_active(s, f);
else
LIST_FOREACH_OTHERS(same_devnode, other, s)
if (UNIT(other)->job)
swap_enter_dead_or_active(other, f);
} else
swap_enter_dead(s, f); swap_enter_dead(s, f);
} }

View File

@ -55,6 +55,7 @@ else
read -r -d '' -a line < /proc/cmdline read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue [[ "${i#initrd=*}" != "$i" ]] && continue
[[ "${i#BOOT_IMAGE=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i") BOOT_OPTIONS+=("$i")
done done
fi fi

View File

@ -4107,7 +4107,7 @@ int json_dispatch_user_group_name(const char *name, JsonVariant *variant, JsonDi
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a string.", strna(name)); return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a string.", strna(name));
n = json_variant_string(variant); n = json_variant_string(variant);
if (!valid_user_group_name(n)) if (!valid_user_group_name_compat(n))
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a valid user/group name.", strna(name)); return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a valid user/group name.", strna(name));
r = free_and_strdup(s, n); r = free_and_strdup(s, n);

View File

@ -600,7 +600,7 @@ int json_dispatch_user_group_list(const char *name, JsonVariant *variant, JsonDi
if (!json_variant_is_string(e)) if (!json_variant_is_string(e))
return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a string."); return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a string.");
if (!valid_user_group_name(json_variant_string(e))) if (!valid_user_group_name_compat(json_variant_string(e)))
return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a valid user/group name: %s", json_variant_string(e)); return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a valid user/group name: %s", json_variant_string(e));
r = strv_extend(&l, json_variant_string(e)); r = strv_extend(&l, json_variant_string(e));

View File

@ -587,7 +587,7 @@ int userdb_by_name(const char *name, UserDBFlags flags, UserRecord **ret) {
_cleanup_(json_variant_unrefp) JsonVariant *query = NULL; _cleanup_(json_variant_unrefp) JsonVariant *query = NULL;
int r; int r;
if (!valid_user_group_name(name)) if (!valid_user_group_name_compat(name))
return -EINVAL; return -EINVAL;
r = json_build(&query, JSON_BUILD_OBJECT( r = json_build(&query, JSON_BUILD_OBJECT(
@ -700,12 +700,8 @@ int userdb_all(UserDBFlags flags, UserDBIterator **ret) {
setpwent(); setpwent();
iterator->nss_iterating = true; iterator->nss_iterating = true;
goto finish; goto finish;
} } else if (r < 0)
return r;
if (!FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE))
goto finish;
return r;
finish: finish:
*ret = TAKE_PTR(iterator); *ret = TAKE_PTR(iterator);
@ -801,7 +797,7 @@ int groupdb_by_name(const char *name, UserDBFlags flags, GroupRecord **ret) {
_cleanup_(json_variant_unrefp) JsonVariant *query = NULL; _cleanup_(json_variant_unrefp) JsonVariant *query = NULL;
int r; int r;
if (!valid_user_group_name(name)) if (!valid_user_group_name_compat(name))
return -EINVAL; return -EINVAL;
r = json_build(&query, JSON_BUILD_OBJECT( r = json_build(&query, JSON_BUILD_OBJECT(
@ -994,7 +990,7 @@ int membershipdb_by_user(const char *name, UserDBFlags flags, UserDBIterator **r
assert(ret); assert(ret);
if (!valid_user_group_name(name)) if (!valid_user_group_name_compat(name))
return -EINVAL; return -EINVAL;
r = json_build(&query, JSON_BUILD_OBJECT( r = json_build(&query, JSON_BUILD_OBJECT(
@ -1037,7 +1033,7 @@ int membershipdb_by_group(const char *name, UserDBFlags flags, UserDBIterator **
assert(ret); assert(ret);
if (!valid_user_group_name(name)) if (!valid_user_group_name_compat(name))
return -EINVAL; return -EINVAL;
r = json_build(&query, JSON_BUILD_OBJECT( r = json_build(&query, JSON_BUILD_OBJECT(

View File

@ -354,7 +354,7 @@ static int disk_identify(int fd,
ret = disk_identify_packet_device_command(fd, out_identify, 512); ret = disk_identify_packet_device_command(fd, out_identify, 512);
goto check_nul_bytes; goto check_nul_bytes;
} }
if (peripheral_device_type != 0x00) { if (!IN_SET(peripheral_device_type, 0x00, 0x14)) {
ret = -1; ret = -1;
errno = EIO; errno = EIO;
goto out; goto out;