tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [RFC 2] userconf(4): 2nd proposal



On Sat, 4 Nov 2023, tlaronde%kergis.com@localhost wrote:

- 1) No change to the general form of current syntax;

- 2) Selection can be as presently: by number (index in cfdata), by
name (driver name), but also (NEW) by pattern: a pattern is
between slashes, it is a fix substring, that can be optionnally
anchored at the beginning with `^' and at the end with `$';

- 3) (NEW) If the selector (will this word do?) in 2) is surrounded by
braces `{' `}', the selector is for a group of devices;

- 4) The STAR (existing) is still handled as a suffix.

Examples:

disable i915drmkms	# existing syntax

disable {drmkms}	# NEW: disable devices belonging to group "drmkms"

disable {/^drm/}*	# NEW: disable devices belonging to groups
			# whose name begins with the substr "drm" if
			# they are STARred ones.


I think you can simplify things a bit by:

1) Allowing shell-like patterns (not hard to implement):

uc> disable drm*	# all starting with `drm'
uc> disable *drm* *usb$	# all with `drm' anywhere and those ending in `usb'
uc> disable foo		# exact match `foo'
uc> disable 1		# exact match 1 (index)

2) Having an alias facility:

uc> alias drm_disable=disable i915*; disable *radeon*; ...
uc> drm_disable		# executes: RHS text (no recursive expansion)
uc> alias drm_disable=	# remove alias `drm_disable'

-RVP


Home | Main Index | Thread Index | Old Index