--- zzzz-none-000/linux-3.10.107/drivers/rtc/Makefile 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/drivers/rtc/Makefile 2021-11-10 11:53:55.000000000 +0000 @@ -128,3 +128,35 @@ obj-$(CONFIG_RTC_DRV_WM831X) += rtc-wm831x.o obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o +obj-$(CONFIG_RTC_DRV_AVM_REF_CLOCK) += rtc-avm.o + +ifeq ($(CONFIG_RTC_DRV_AVM_REF_CLOCK),m) +CFLAGS_rtc-avm.o += -DRTC_AVM_DEVICE_COUNT=1 # -DRTC_AVM_DEBUG=1 + +extra-y += install-S09-rtc + +$(obj)/S09-rtc: FORCE + $(Q)echo " GEN $@" >&2 + $(Q)echo "#!/bin/sh" >$@ + $(Q)echo "/sbin/modprobe rtc-avm" >>$@ + $(Q)echo 'rtc_major=`grep rtc /proc/devices`' >>$@ + $(Q)echo 'rtc_major=$${rtc_major%% rtc}' >>$@ + $(Q)echo 'mknod /dev/rtc0 c $${rtc_major} 0' >>$@ +# $(Q)echo 'mknod /dev/rtc1 c $${rtc_major} 1' >>$@ + +ifeq ($(INSTALL_MOD_PATH),) +export INSTALL_MOD_PATH = $(realpath $(srctree)/../../filesystem) +$(info avmnet/common: Guessing INSTALL_MOD_PATH: $(INSTALL_MOD_PATH)) +endif + +$(INSTALL_MOD_PATH)/etc/init.d/S09-rtc: $(obj)/S09-rtc + $(Q)mkdir -p $(dir $@) + $(Q)if ! test -s $@ || ! cmp -s $< $@ ; then \ + echo " INSTALL $@ <- $<" >&2 ; \ + cp $< $@ ; \ + fi + +PHONY += install-S09-rtc +$(obj)/install-S09-rtc: $(INSTALL_MOD_PATH)/etc/init.d/S09-rtc + +endif