1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-25 06:03:40 +03:00

udev: builtin - rename net_link to net_setup_link

Also add shell completions.
This commit is contained in:
Tom Gundersen 2013-10-28 20:20:59 +01:00
parent 9dc670ea76
commit 0b99c9f8f0
7 changed files with 19 additions and 19 deletions

View File

@ -2312,7 +2312,7 @@ libudev_core_la_SOURCES = \
src/udev/udev-builtin-input_id.c \ src/udev/udev-builtin-input_id.c \
src/udev/udev-builtin-keyboard.c \ src/udev/udev-builtin-keyboard.c \
src/udev/udev-builtin-net_id.c \ src/udev/udev-builtin-net_id.c \
src/udev/udev-builtin-net_link.c \ src/udev/udev-builtin-net_setup_link.c \
src/udev/udev-builtin-path_id.c \ src/udev/udev-builtin-path_id.c \
src/udev/udev-builtin-usb_id.c \ src/udev/udev-builtin-usb_id.c \
src/udev/net/link-config.h \ src/udev/net/link-config.h \

View File

@ -1,11 +1,11 @@
# do not edit this file, it will be overwritten on update # do not edit this file, it will be overwritten on update
SUBSYSTEM!="net", GOTO="net_link_end" SUBSYSTEM!="net", GOTO="net_setup_link_end"
IMPORT{builtin}="path_id" IMPORT{builtin}="path_id"
ACTION!="add", GOTO="net_link_end" ACTION!="add", GOTO="net_setup_link_end"
RUN{builtin}="net_link" RUN{builtin}="net_setup_link"
LABEL="net_link_end" LABEL="net_setup_link_end"

View File

@ -83,7 +83,7 @@ _udevadm() {
fi fi
;; ;;
'test-builtin') 'test-builtin')
comps='blkid btrfs hwdb input_id keyboard kmod net_id path_id usb_id uaccess' comps='blkid btrfs hwdb input_id keyboard kmod net_id net_setup_link path_id usb_id uaccess'
;; ;;
*) *)
comps=${VERBS[*]} comps=${VERBS[*]}

View File

@ -75,7 +75,7 @@ _udevadm_test-builtin(){
if (( CURRENT == 2 )); then if (( CURRENT == 2 )); then
_arguments \ _arguments \
'--help[Print help text]' \ '--help[Print help text]' \
'*::builtins:(blkid btrfs hwdb input_id kmod path_id usb_id uaccess)' '*::builtins:(blkid btrfs hwdb input_id net_id net_setup_link kmod path_id usb_id uaccess)'
elif (( CURRENT == 3 )); then elif (( CURRENT == 3 )); then
_arguments \ _arguments \
'--help[Print help text]' \ '--help[Print help text]' \

View File

@ -25,7 +25,7 @@
link_config_ctx *ctx; link_config_ctx *ctx;
static int builtin_net_link(struct udev_device *dev, int argc, char **argv, bool test) { static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv, bool test) {
link_config *link; link_config *link;
int r; int r;
@ -54,7 +54,7 @@ static int builtin_net_link(struct udev_device *dev, int argc, char **argv, bool
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
static int builtin_net_link_init(struct udev *udev) { static int builtin_net_setup_link_init(struct udev *udev) {
int r; int r;
if (ctx) if (ctx)
@ -72,12 +72,12 @@ static int builtin_net_link_init(struct udev *udev) {
return 0; return 0;
} }
static void builtin_net_link_exit(struct udev *udev) { static void builtin_net_setup_link_exit(struct udev *udev) {
link_config_ctx_free(ctx); link_config_ctx_free(ctx);
log_debug("Unloaded link configuration context"); log_debug("Unloaded link configuration context");
} }
static bool builtin_net_link_validate(struct udev *udev) { static bool builtin_net_setup_link_validate(struct udev *udev) {
log_debug("Check if link configuration needs reloading"); log_debug("Check if link configuration needs reloading");
if (!ctx) if (!ctx)
return false; return false;
@ -85,12 +85,12 @@ static bool builtin_net_link_validate(struct udev *udev) {
return link_config_should_reload(ctx); return link_config_should_reload(ctx);
} }
const struct udev_builtin udev_builtin_net_link = { const struct udev_builtin udev_builtin_net_setup_link = {
.name = "net_link", .name = "net_setup_link",
.cmd = builtin_net_link, .cmd = builtin_net_setup_link,
.init = builtin_net_link_init, .init = builtin_net_setup_link_init,
.exit = builtin_net_link_exit, .exit = builtin_net_setup_link_exit,
.validate = builtin_net_link_validate, .validate = builtin_net_setup_link_validate,
.help = "configure network link", .help = "configure network link",
.run_once = false, .run_once = false,
}; };

View File

@ -44,7 +44,7 @@ static const struct udev_builtin *builtins[] = {
[UDEV_BUILTIN_KMOD] = &udev_builtin_kmod, [UDEV_BUILTIN_KMOD] = &udev_builtin_kmod,
#endif #endif
[UDEV_BUILTIN_NET_ID] = &udev_builtin_net_id, [UDEV_BUILTIN_NET_ID] = &udev_builtin_net_id,
[UDEV_BUILTIN_NET_LINK] = &udev_builtin_net_link, [UDEV_BUILTIN_NET_LINK] = &udev_builtin_net_setup_link,
[UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id, [UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id,
[UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id, [UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id,
#ifdef HAVE_ACL #ifdef HAVE_ACL

View File

@ -184,7 +184,7 @@ extern const struct udev_builtin udev_builtin_keyboard;
extern const struct udev_builtin udev_builtin_kmod; extern const struct udev_builtin udev_builtin_kmod;
#endif #endif
extern const struct udev_builtin udev_builtin_net_id; extern const struct udev_builtin udev_builtin_net_id;
extern const struct udev_builtin udev_builtin_net_link; extern const struct udev_builtin udev_builtin_net_setup_link;
extern const struct udev_builtin udev_builtin_path_id; extern const struct udev_builtin udev_builtin_path_id;
extern const struct udev_builtin udev_builtin_usb_id; extern const struct udev_builtin udev_builtin_usb_id;
extern const struct udev_builtin udev_builtin_uaccess; extern const struct udev_builtin udev_builtin_uaccess;