Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build]: Move Systemd service start to systemd generator #3172

Merged
merged 20 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ src/supervisor/*
!src/supervisor/patch/
src/swig/*
!src/swig/Makefile
src/systemd-sonic-generator/systemd-sonic-generator
src/systemd-sonic-generator/debian/*
!src/systemd-sonic-generator/debian/changelog
!src/systemd-sonic-generator/debian/compat
!src/systemd-sonic-generator/debian/control
!src/systemd-sonic-generator/debian/rules
src/telemetry/debian/*
!src/telemetry/debian/changelog
!src/telemetry/debian/compat
Expand Down
22 changes: 12 additions & 10 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ FILESYSTEM_ROOT_USR_SHARE="$FILESYSTEM_ROOT_USR/share"
FILESYSTEM_ROOT_USR_SHARE_SONIC="$FILESYSTEM_ROOT_USR_SHARE/sonic"
FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/templates"

GENERATED_SERVICE_FILE="$FILESYSTEM_ROOT/etc/sonic/generated_services.conf"

clean_sys() {
sudo umount $FILESYSTEM_ROOT/sys/fs/cgroup/* \
$FILESYSTEM_ROOT/sys/fs/cgroup \
Expand Down Expand Up @@ -157,21 +159,21 @@ sudo cp -f $IMAGE_CONFIGS/cron.d/* $FILESYSTEM_ROOT/etc/cron.d/

# Copy NTP configuration files and templates
sudo cp $IMAGE_CONFIGS/ntp/ntp-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable ntp-config.service
theasianpianist marked this conversation as resolved.
Show resolved Hide resolved
echo "ntp-config.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/ntp/ntp-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/ntp/ntp.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/

# Copy warmboot-finalizer files
sudo LANG=C cp $IMAGE_CONFIGS/warmboot-finalizer/finalize-warmboot.sh $FILESYSTEM_ROOT/usr/local/bin/finalize-warmboot.sh
sudo LANG=C cp $IMAGE_CONFIGS/warmboot-finalizer/warmboot-finalizer.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable warmboot-finalizer.service
theasianpianist marked this conversation as resolved.
Show resolved Hide resolved
echo "warmboot-finalizer.service" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy rsyslog configuration files and templates
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable rsyslog-config.service
theasianpianist marked this conversation as resolved.
Show resolved Hide resolved
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/
echo "rsyslog-config.service" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy logrotate.d configuration files
sudo cp -f $IMAGE_CONFIGS/logrotate/logrotate.d/* $FILESYSTEM_ROOT/etc/logrotate.d/
Expand All @@ -181,17 +183,17 @@ sudo cp -f $IMAGE_CONFIGS/systemd/journald.conf $FILESYSTEM_ROOT/etc/systemd/

# Copy interfaces configuration files and templates
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable interfaces-config.service
theasianpianist marked this conversation as resolved.
Show resolved Hide resolved
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.sh $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/
echo "interfaces-config.service" | sudo tee -a $GENERATED_SERVICE_FILE

# Copy initial interfaces configuration file, will be overwritten on first boot
sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network/interfaces
sudo mkdir -p $FILESYSTEM_ROOT/etc/network/interfaces.d

# Copy hostcfgd files
sudo cp $IMAGE_CONFIGS/hostcfgd/hostcfgd.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable hostcfgd.service
echo "hostcfgd.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/hostcfgd/hostcfgd $FILESYSTEM_ROOT/usr/bin/
sudo cp $IMAGE_CONFIGS/hostcfgd/*.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/

Expand All @@ -203,13 +205,13 @@ sudo cp $BUILD_TEMPLATES/qos_config.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATE

# Copy hostname configuration scripts
sudo cp $IMAGE_CONFIGS/hostname/hostname-config.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable hostname-config.service
echo "hostname-config.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/hostname/hostname-config.sh $FILESYSTEM_ROOT/usr/bin/

# Copy updategraph script and service file
j2 files/build_templates/updategraph.service.j2 | sudo tee $FILESYSTEM_ROOT/etc/systemd/system/updategraph.service
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable updategraph.service
sudo cp $IMAGE_CONFIGS/updategraph/updategraph $FILESYSTEM_ROOT/usr/bin/
echo "updategraph.service" | sudo tee -a $GENERATED_SERVICE_FILE
{% if enable_dhcp_graph_service == "y" %}
sudo bash -c "echo enabled=true > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
sudo bash -c "echo src=dhcp >> $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
Expand All @@ -235,12 +237,12 @@ sudo cp $IMAGE_CONFIGS/sudoers/sudoers.lecture $FILESYSTEM_ROOT/etc/

# Copy control plane ACL management daemon files
sudo cp $IMAGE_CONFIGS/caclmgrd/caclmgrd.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable caclmgrd.service
echo "caclmgrd.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/caclmgrd/caclmgrd $FILESYSTEM_ROOT/usr/bin/

# Copy process-reboot-cause service files
sudo cp $IMAGE_CONFIGS/process-reboot-cause/process-reboot-cause.service $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable process-reboot-cause.service
echo "process-reboot-cause.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/process-reboot-cause/process-reboot-cause $FILESYSTEM_ROOT/usr/bin/

## Install package without starting service
Expand Down Expand Up @@ -331,7 +333,7 @@ sudo cp {{script}} $FILESYSTEM_ROOT/usr/bin/
{% for service in installer_services.split(' ') -%}
if [ -f {{service}} ]; then
sudo cp {{service}} $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable {{service}}
echo "{{service}}" | sudo tee -a $GENERATED_SERVICE_FILE
fi
{% endfor %}
sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /sys || true
Expand Down
1 change: 1 addition & 0 deletions platform/barefoot/one-aboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_ONE_ABOOT_IMAGE = sonic-aboot-barefoot.swi
$(SONIC_ONE_ABOOT_IMAGE)_MACHINE = barefoot
$(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(BFN_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(ARISTA_PLATFORM_MODULE_DRIVERS) \
Expand Down
1 change: 1 addition & 0 deletions platform/barefoot/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_ONE_IMAGE = sonic-barefoot.bin
$(SONIC_ONE_IMAGE)_MACHINE = barefoot
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BFN_MODULE) $(PYTHON_THRIFT)
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE)
Expand Down
1 change: 1 addition & 0 deletions platform/broadcom/one-aboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ SONIC_ONE_ABOOT_IMAGE = sonic-aboot-broadcom.swi
$(SONIC_ONE_ABOOT_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL) $(ARISTA_PLATFORM_MODULE_DRIVERS) $(ARISTA_PLATFORM_MODULE_PYTHON2) $(ARISTA_PLATFORM_MODULE_PYTHON3) $(ARISTA_PLATFORM_MODULE)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_ABOOT_IMAGE)
1 change: 1 addition & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_ONE_IMAGE = sonic-broadcom.bin
$(SONIC_ONE_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(DELL_Z9264F_PLATFORM_MODULE) \
$(DELL_S5232F_PLATFORM_MODULE) \
Expand Down
1 change: 1 addition & 0 deletions platform/broadcom/raw-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_RAW_IMAGE = sonic-broadcom.raw
$(SONIC_RAW_IMAGE)_MACHINE = broadcom
$(SONIC_RAW_IMAGE)_IMAGE_TYPE = raw
$(SONIC_RAW_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in correct, please fix.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you missed platform/broadcom/aboot-image.mk as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure which file you're referring to, I don't see broadcom/aboot-image.mk , did you mean one-aboot.mk?

$(SONIC_RAW_IMAGE)_LAZY_INSTALLS += $($(SONIC_ONE_IMAGE)_LAZY_INSTALLS)
$(SONIC_RAW_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_RAW_IMAGE)
1 change: 1 addition & 0 deletions platform/cavium/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $(SONIC_ONE_IMAGE)_MACHINE = cavium
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(CAVM_PLATFORM_DEB)
$(SONIC_ONE_IMAGE)_INSTALLS += $(CAVM_XPNET_DEB)
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
1 change: 1 addition & 0 deletions platform/centec/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
SONIC_ONE_IMAGE = sonic-centec.bin
$(SONIC_ONE_IMAGE)_MACHINE = centec
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS = $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(CENTEC_E582_48X6Q_PLATFORM_MODULE) \
$(CENTEC_E582_48X2Q4Z_PLATFORM_MODULE)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
Expand Down
2 changes: 1 addition & 1 deletion platform/generic/aboot-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
SONIC_GENERIC_ABOOT_IMAGE = sonic-aboot-generic.swi
$(SONIC_GENERIC_ABOOT_IMAGE)_MACHINE = generic
$(SONIC_GENERIC_ABOOT_IMAGE)_IMAGE_TYPE = aboot
$(SONIC_GENERIC_ABOOT_IMAGE)_INSTALLS =
$(SONIC_GENERIC_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_GENERIC_ABOOT_IMAGE)_DOCKERS =
SONIC_INSTALLERS += $(SONIC_GENERIC_ABOOT_IMAGE)
2 changes: 1 addition & 1 deletion platform/generic/onie-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
SONIC_GENERIC_ONIE_IMAGE = sonic-generic.bin
$(SONIC_GENERIC_ONIE_IMAGE)_MACHINE = generic
$(SONIC_GENERIC_ONIE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_GENERIC_ONIE_IMAGE)_INSTALLS =
$(SONIC_GENERIC_ONIE_IMAGE)_INSTALLS = $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_GENERIC_ONIE_IMAGE)_DOCKERS =
SONIC_INSTALLERS += $(SONIC_GENERIC_ONIE_IMAGE)
1 change: 1 addition & 0 deletions platform/marvell/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
SONIC_ONE_IMAGE = sonic-marvell.bin
$(SONIC_ONE_IMAGE)_MACHINE = marvell
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
1 change: 1 addition & 0 deletions platform/mellanox/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_ONE_IMAGE = sonic-mellanox.bin
$(SONIC_ONE_IMAGE)_MACHINE = mellanox
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT_OEM) $(MFT) $(MLNX_HW_MANAGEMENT)
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
1 change: 1 addition & 0 deletions platform/nephos/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SONIC_ONE_IMAGE = sonic-nephos.bin
$(SONIC_ONE_IMAGE)_MACHINE = nephos
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(NEPHOS_MODULE)
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9130_32X_PLATFORM_MODULE) \
$(INGRASYS_S9230_64X_PLATFORM_MODULE) \
$(ACCTON_AS7116_54X_PLATFORM_MODULE) \
Expand Down
1 change: 1 addition & 0 deletions platform/vs/kvm-image.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sonic kvm image

SONIC_KVM_IMAGE = sonic-vs.img.gz
$(SONIC_KVM_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_KVM_IMAGE)_MACHINE = vs
$(SONIC_KVM_IMAGE)_IMAGE_TYPE = kvm
ifeq ($(INSTALL_DEBUG_TOOLS),y)
Expand Down
1 change: 1 addition & 0 deletions platform/vs/one-image.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sonic vs one image installer

SONIC_ONE_IMAGE = sonic-vs.bin
$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_MACHINE = vs
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
ifeq ($(INSTALL_DEBUG_TOOLS),y)
Expand Down
3 changes: 3 additions & 0 deletions rules/systemd-sonic-generator.mk
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)
22 changes: 22 additions & 0 deletions src/systemd-sonic-generator/Makefile
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
3 changes: 3 additions & 0 deletions src/systemd-sonic-generator/debian/changelog
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
1 change: 1 addition & 0 deletions src/systemd-sonic-generator/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
6 changes: 6 additions & 0 deletions src/systemd-sonic-generator/debian/control
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
18 changes: 18 additions & 0 deletions src/systemd-sonic-generator/debian/rules
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)
Loading