This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/lm-sensors/Makefile
lguohan ab2ae41212
[build]: fix dpkg admindir corruption issue in parallel build (#6408)
Fix #119

when parallel build is enable, multiple dpkg-buildpackage
instances are running at the same time. /var/lib/dpkg is shared
by all instances and the /var/lib/dpkg/updates could be corrupted
and cause the build failure.

the fix is to use overlay fs to mount separate /var/lib/dpkg
for each dpkg-buildpackage instance so that they are not affecting
each other.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-12 06:03:12 -08:00

34 lines
963 B
Makefile

SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e
MAIN_TARGET = $(LM_SENSORS)
DERIVED_TARGETS = fancontrol_$(LM_SENSORS_VERSION_FULL)_all.deb \
$(LIBSENSORS) \
sensord_$(LM_SENSORS_VERSION_FULL)_$(CONFIGURED_ARCH).deb \
$(LM_SENSORS_DBG) \
$(LIBSENSORS_DBG) \
$(SENSORD_DBG)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf lm-sensors-$(LM_SENSORS_VERSION)
dget -u http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_$(LM_SENSORS_VERSION_FULL).dsc
pushd lm-sensors-$(LM_SENSORS_VERSION)
# Initialize as git repository
git init
git add -f *
git commit -m "unmodified lm-sensors sources"
# Apply patches
stg init
stg import -s ../patch/series
DEB_BUILD_OPTIONS=nocheck PROG_EXTRA=sensord dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd
mv $(DERIVED_TARGETS) $* $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)