diff options
author | Antoine Jacoutot <ajacoutot@bsdfrog.org> | 2014-08-17 00:11:00 +0800 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@bsdfrog.org> | 2014-08-17 00:11:00 +0800 |
commit | 3d6bffb8877bb40df1095c6966985c3ccd543548 (patch) | |
tree | d8e6f38a2ad99ee31c8096686c02bb2d24e263c5 | |
parent | 87847f0744093f8b2db4e415755d5e1054a68cee (diff) | |
download | systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar.gz systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar.bz2 systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar.lz systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar.xz systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.tar.zst systembsd-3d6bffb8877bb40df1095c6966985c3ccd543548.zip |
Get/set info into /etc/machine-info.
discussed with Ian
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | conf/systemd_compat.conf | 4 | ||||
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 18 |
3 files changed, 9 insertions, 15 deletions
@@ -95,11 +95,9 @@ _generate_servicefiles: _install_conf: _generate_servicefiles ${INSTALL_DATA_DIR} $(DESTDIR)$(DBUS_POLICYDIR) ${INSTALL_DATA_DIR} $(DESTDIR)$(DBUS_CONFIGDIR) - ${INSTALL_DATA_DIR} $(DESTDIR)$(SYSCONFDIR) ${INSTALL_DATA_DIR} $(DESTDIR)$(POLKIT_POLICYDIR) ${INSTALL_DATA} $(POLICYDIR)/*-dbus.conf $(DESTDIR)$(DBUS_POLICYDIR)/ ${INSTALL_DATA} $(SERVICEFDIR)/*.service $(DESTDIR)$(DBUS_CONFIGDIR)/ - ${INSTALL_DATA} $(CONFDIR)/systemd_compat.conf $(DESTDIR)$(SYSCONFDIR)/ ${INSTALL_DATA} $(POLKITDIR)/*.policy $(DESTDIR)$(POLKIT_POLICYDIR)/ _install_interface_binaries: $(LINKHN) diff --git a/conf/systemd_compat.conf b/conf/systemd_compat.conf deleted file mode 100644 index d59df78..0000000 --- a/conf/systemd_compat.conf +++ /dev/null @@ -1,4 +0,0 @@ -[hostnamed] -PrettyHostname= -IconName= -ChassisType= diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 162cf5d..9bc1f9e 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -339,9 +339,9 @@ on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf, hostname1_complete_set_pretty_hostname(hn1_passed_interf, invoc); ret = TRUE; - if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL)) { + if(g_key_file_load_from_file(config, "/etc/machine-info", G_KEY_FILE_NONE, NULL)) { - g_key_file_set_string(config, "hostnamed", "PrettyHostname", valid_pretty_hostname_buf); + g_key_file_set_string(config, "hostnamed", "PRETTY_HOSTNAME", valid_pretty_hostname_buf); if((computed_static_hostname = g_hostname_to_ascii(PRETTY_HOSTNAME))) { @@ -358,7 +358,7 @@ on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf, } } - g_key_file_save_to_file(config, "/etc/systemd_compat.conf", NULL); + g_key_file_save_to_file(config, "/etc/machine-info", NULL); g_key_file_unref(config); return ret; @@ -436,7 +436,7 @@ on_handle_set_chassis(Hostname1 *hn1_passed_interf, g_ptr_array_add(hostnamed_freeable, valid_chassis_name_buf); hostname1_complete_set_chassis(hn1_passed_interf, invoc); - if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL)) { + if(g_key_file_load_from_file(config, "/etc/machine-info", G_KEY_FILE_NONE, NULL)) { ret = TRUE; g_key_file_set_string(config, "hostnamed", "ChassisType", valid_chassis_name_buf); @@ -445,7 +445,7 @@ on_handle_set_chassis(Hostname1 *hn1_passed_interf, } } - g_key_file_save_to_file(config, "/etc/systemd_compat.conf", NULL); + g_key_file_save_to_file(config, "/etc/machine-info", NULL); g_key_file_unref(config); return ret; @@ -517,7 +517,7 @@ on_handle_set_icon_name(Hostname1 *hn1_passed_interf, g_ptr_array_add(hostnamed_freeable, valid_icon_name_buf); hostname1_complete_set_icon_name(hn1_passed_interf, invoc); - if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL)) { + if(g_key_file_load_from_file(config, "/etc/machine-info", G_KEY_FILE_NONE, NULL)) { ret = TRUE; g_key_file_set_string(config, "hostnamed", "IconName", valid_icon_name_buf); @@ -526,7 +526,7 @@ on_handle_set_icon_name(Hostname1 *hn1_passed_interf, } } - g_key_file_save_to_file(config, "/etc/systemd_compat.conf", NULL); + g_key_file_save_to_file(config, "/etc/machine-info", NULL); g_key_file_unref(config); return ret; @@ -807,8 +807,8 @@ gboolean set_names() { strncpy(ret, hostname_buf, hostname_divider); */ /* (3) set PRETTY_HOSTNAME */ - if(g_key_file_load_from_file(config, "/etc/systemd_compat.conf", G_KEY_FILE_NONE, NULL) - && (pretty_hostname_buf = g_key_file_get_value(config, "hostnamed", "PrettyHostname", NULL))) + if(g_key_file_load_from_file(config, "/etc/machine-info", G_KEY_FILE_NONE, NULL) + && (pretty_hostname_buf = g_key_file_get_value(config, "hostnamed", "PRETTY_HOSTNAME", NULL))) PRETTY_HOSTNAME = pretty_hostname_buf; else PRETTY_HOSTNAME = ""; |