-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from microsoft/removextraargs
Simplify running systemd services from development environment
- Loading branch information
Showing
6 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,56 @@ | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/hostapd.example.conf | ||
${CMAKE_CURRENT_BINARY_DIR}/hostapd.example.conf | ||
${CMAKE_CURRENT_SOURCE_DIR}/hostapd-example.conf.in | ||
${CMAKE_CURRENT_BINARY_DIR}/hostapd-example.conf | ||
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
@ONLY | ||
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
@ONLY | ||
) | ||
|
||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
@ONLY | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/hostapd.example.conf | ||
${CMAKE_CURRENT_BINARY_DIR}/hostapd-example.conf | ||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/hostapd | ||
COMPONENT hostapd | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Release | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
RENAME [email protected] | ||
COMPONENT hostapd | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
RENAME [email protected] | ||
COMPONENT hostapd | ||
) | ||
|
||
install( | ||
FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/[email protected] | ||
CONFIGURATIONS Debug RelWithDebInfo MinSizeRel | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/systemd/system | ||
COMPONENT hostapd | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Hostapd Daemon | ||
Requires=sys-subsystem-net-devices-%i.device hostapd-genconfig@%i.service | ||
After=sys-subsystem-net-devices-%i.device hostapd-genconfig@%i.service | ||
AssertPathExists=@CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
|
||
[Service] | ||
Type=simple | ||
Restart=on-failure | ||
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/hostapd -i %i @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
|
||
[Install] | ||
WantedBy=default.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,12 @@ | |
# To use this with the provided systemd service unit template [email protected], | ||
# (eg. via 'systemctl enable hostapd@wlan0'), copy this file to | ||
# /etc/hostapd/hostapd-<interface>.conf. For example, to use it with wlan0, copy this file to | ||
# /etc/hostapd/hostapd-wlan0.conf. | ||
# | ||
# /etc/hostapd/hostapd-wlan0.conf and specify the desired SSID after the 'ssid' property below. | ||
# | ||
|
||
driver=nl80211 | ||
ctrl_interface=${CMAKE_INSTALL_FULL_RUNSTATEDIR}/hostapd | ||
ssid=wificontrollertest | ||
ssid= | ||
hw_mode=g | ||
channel=1 | ||
auth_algs=3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Generate default hostapd configuration file | ||
AssertPathExists=@CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-example.conf | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=true | ||
ExecStart=/usr/bin/cp @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-example.conf @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf | ||
ExecStart=/usr/bin/sed -i 's/ssid=/ssid=%l-ap-%i/' @CMAKE_INSTALL_FULL_SYSCONFDIR@/hostapd/hostapd-%i.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters