| # Copyright 2022 The ChromiumOS Authors | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # | |
| # udev rules for zram writeback dm devices. | |
| # | |
| # This rule will only apply to dm devices which are prefixed with zram-. | |
| # Additionally, since zram devices are not "ready" until the table has been | |
| # installed we are only concerned with the change event. Because zram-writeback | |
| # is a swap device without a normal filesystem on it we don't want to continue | |
| # running udev rules. So when we encounter either zram-writeback or | |
| # zram-integrity we will set the DM environment variables which prevent | |
| # further udev action. | |
| SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ENV{DM_NAME}=="zram-?*", \ | |
| ACTION=="change", GOTO="zram_writeback_disable_further_udev" | |
| GOTO="zram_writeback_end" | |
| LABEL="zram_writeback_disable_further_udev" | |
| ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="1" | |
| ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1" | |
| ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" | |
| LABEL="zram_writeback_end" |