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>
34 lines
963 B
Makefile
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)
|