-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build]: Move Systemd service start to systemd generator (#3172)
- What I did Move the enabling of Systemd services from sonic_debian_extension to a new systemd generator - How I did it Create a new systemd generator to manually create symlinks to enable systemd services Add rules/Makefile to build generator Add services to be enabled to /etc/sonic/generated_services.conf to be read by the generator at boot time Signed-off-by: Lawrence Lee <[email protected]>
- Loading branch information
Showing
23 changed files
with
394 additions
and
12 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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SYSTEMD_SONIC_GENERATOR = systemd-sonic-generator_1.0.0_$(CONFIGURED_ARCH).deb | ||
$(SYSTEMD_SONIC_GENERATOR)_SRC_PATH = $(SRC_PATH)/systemd-sonic-generator | ||
SONIC_MAKE_DEBS += $(SYSTEMD_SONIC_GENERATOR) |
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,22 @@ | ||
CC=gcc | ||
CFLAGS=-std=gnu99 | ||
|
||
BINARY = systemd-sonic-generator | ||
MAIN_TARGET = $(BINARY)_1.0.0_$(CONFIGURED_ARCH).deb | ||
|
||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : | ||
dpkg-buildpackage -us -uc -b | ||
mv ../$(MAIN_TARGET) $(DEST)/ | ||
rm ../$(BINARY)-* ../$(BINARY)_* | ||
|
||
$(BINARY): systemd-sonic-generator.c | ||
rm -f ./systemd-sonic-generator | ||
|
||
$(CC) $(CFLAGS) -o $@ $^ | ||
|
||
install: $(BINARY) | ||
mkdir -p $(DESTDIR) | ||
mkdir -p $(DESTDIR)/lib | ||
mkdir -p $(DESTDIR)/lib/systemd | ||
mkdir -p $(DESTDIR)/lib/systemd/system-generators | ||
cp ./systemd-sonic-generator $(DESTDIR)/lib/systemd/system-generators |
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,3 @@ | ||
systemd-sonic-generator (1.0.0) UNRELEASED; urgency=medium | ||
* Initial version | ||
-- Lawrence Lee <[email protected]> Tue, 23 Jul 2019 16:00:00 -0800 |
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 @@ | ||
11 |
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,6 @@ | ||
Source: systemd-sonic-generator | ||
Maintainer: Lawrence Lee <[email protected]> | ||
|
||
Package: systemd-sonic-generator | ||
Architecture: any | ||
Description: Systemd generator for SONiC services |
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,18 @@ | ||
#!/usr/bin/make -f | ||
|
||
DISTRIBUTION = $(shell sed -n "s/^VERSION_CODENAME=//p" /etc/os-release) | ||
VERSION = 1.0.0 | ||
PACKAGEVERSION = $(VERSION) | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_auto_clean: | ||
override_dh_auto_test: | ||
override_dh_auto_build: | ||
override_dh_auto_install: | ||
make systemd-sonic-generator | ||
make install DESTDIR=debian/systemd-sonic-generator | ||
|
||
override_dh_gencontrol: | ||
dh_gencontrol -- -v$(PACKAGEVERSION) |
Oops, something went wrong.