diff --git a/make/bootstrap.mk b/make/bootstrap.mk index e0dc123c..f32ba469 100644 --- a/make/bootstrap.mk +++ b/make/bootstrap.mk @@ -18,7 +18,7 @@ BOOTSTRAP += target-dir BOOTSTRAP += libs-static BOOTSTRAP += libs-cross -ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2)) +ifeq ($(BOXTYPE), $(filter $(BOXTYPE), coolstream)) BOOTSTRAP += var-update endif @@ -34,9 +34,6 @@ bootstrap: $(BOOTSTRAP) skeleton: | $(TARGET_DIR) $(INSTALL_COPY) --remove-destination $(SKEL-ROOT)/. $(TARGET_DIR)/ -ifneq ($(wildcard $(SKEL-ROOT)-$(BOXFAMILY)),) - $(INSTALL_COPY) --remove-destination $(SKEL-ROOT)-$(BOXFAMILY)/. $(TARGET_DIR)/ -endif find $(TARGET_DIR) -type f -print0 | xargs --no-run-if-empty -0 \ sed -i 's|%(BOXMODEL)|$(BOXMODEL)|' sed -i 's|%(BOOT_PARTITION)|$(BOOT_PARTITION)|' $(TARGET_DIR)/etc/mdev.conf @@ -121,17 +118,25 @@ endif # ----------------------------------------------------------------------------- +ifeq ($(BOXTYPE), $(filter $(BOXTYPE), coolstream)) + var-update: $(TARGET_DIR)/var/update $(TARGET_DIR)/var/update: | $(TARGET_DIR) mkdir -p $(@) -ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2)) - $(INSTALL_COPY) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/uldr.bin $(@) +ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd1)) + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/zImage $(@) +else ifeq ($(BOXSERIES), $(filter $(BOXSERIES), hd2)) + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/vmlinux.ub.gz $(@) + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/uldr.bin $(@) ifeq ($(BOXMODEL), kronos_v2) - $(INSTALL_COPY) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/u-boot.bin.kronos_v2 $(@)/u-boot.bin + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/u-boot.bin.kronos_v2 $(@)/u-boot.bin else - $(INSTALL_COPY) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/u-boot.bin $(@) + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/u-boot.bin $(@) endif +endif + $(INSTALL_DATA) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/stb_update.data $(@) + endif # ----------------------------------------------------------------------------- diff --git a/make/linux-kernel.mk b/make/linux-kernel.mk index 31051f8d..11d47fc3 100644 --- a/make/linux-kernel.mk +++ b/make/linux-kernel.mk @@ -331,21 +331,17 @@ endif # ----------------------------------------------------------------------------- -# install coolstream kernels to skel-root - -ifneq ($(wildcard $(SKEL-ROOT)-$(BOXFAMILY)),) - KERNEL_DESTDIR = $(SKEL-ROOT)-$(BOXFAMILY)/var/update -else - KERNEL_DESTDIR = $(SKEL-ROOT)/var/update -endif +# install coolstream kernels into ni-drivers-bin repository kernel-install-coolstream: kernel-install-coolstream-$(BOXSERIES) kernel-install-coolstream-hd1: kernel-coolstream-hd1 - $(INSTALL_DATA) $(IMAGE_DIR)/kernel-$(BOXTYPE_SC)-$(BOXMODEL)-zImage.img $(KERNEL_DESTDIR)/zImage + $(INSTALL_DATA) $(IMAGE_DIR)/kernel-$(BOXTYPE_SC)-$(BOXMODEL)-zImage.img \ + $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/zImage kernel-install-coolstream-hd2: kernel-coolstream-hd2 - $(INSTALL_DATA) $(IMAGE_DIR)/kernel-$(BOXTYPE_SC)-$(BOXMODEL)-vmlinux.ub.gz $(KERNEL_DESTDIR)/vmlinux.ub.gz + $(INSTALL_DATA) $(IMAGE_DIR)/kernel-$(BOXTYPE_SC)-$(BOXMODEL)-vmlinux.ub.gz \ + $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR)/vmlinux.ub.gz kernel-install-coolstream-all: make clean BOXFAMILY=nevis @@ -370,6 +366,9 @@ kernel-install-coolstream-all: make get-update-info-hd2 BOXFAMILY=kronos # make clean > /dev/null 2>&1 + # + @echo -e "$(TERM_YELLOW)Align stb_update.data in $(SOURCE_DIR)/$(NI-DRIVERS-BIN)$(TERM_NORMAL)" + @echo -e "$(TERM_YELLOW)and commit your changes in $(SOURCE_DIR)/$(NI-DRIVERS-BIN)$(TERM_NORMAL)" # ----------------------------------------------------------------------------- diff --git a/make/target-rootfs.mk b/make/target-rootfs.mk index ca94b584..59eb92c5 100644 --- a/make/target-rootfs.mk +++ b/make/target-rootfs.mk @@ -151,37 +151,40 @@ endif # ----------------------------------------------------------------------------- +ifeq ($(BOXTYPE), $(filter $(BOXTYPE), coolstream)) + get-update-info: get-update-info-$(BOXSERIES) get-update-info-hd2: $(call draw_line); - @echo "Get update info for model $(shell echo $(BOXMODEL) | sed 's/.*/\u&/')" + @echo "Get update info for boxmodel $(BOXMODEL)" @echo @$(CD) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR); \ - test -e ./u-boot.bin && ( \ + if [ -e vmlinux.ub.gz ]; then \ + dd status=none if=vmlinux.ub.gz bs=1 skip=$$(LC_ALL=C grep -a -b -o $$'\x1f\x8b\x08\x00\x00\x00\x00\x00' vmlinux.ub.gz \ + | cut -d ':' -f 1) | zcat -q | grep -a "Linux version"; \ + fi; \ + if [ -e u-boot.bin ]; then \ strings u-boot.bin | grep -m1 "U-Boot "; \ - ); \ - test -e ./uldr.bin && ( \ + fi; \ + if [ -e uldr.bin ]; then \ strings uldr.bin | grep -m1 "Microloader "; \ - ); \ - $(CD) $(TARGET_DIR)/var/update; \ - test -e ./vmlinux.ub.gz && ( \ - dd if=./vmlinux.ub.gz bs=1 skip=$$(LC_ALL=C grep -a -b -o $$'\x1f\x8b\x08\x00\x00\x00\x00\x00' ./vmlinux.ub.gz \ - | cut -d ':' -f 1) | zcat | grep -a "Linux version"; \ - ); + fi $(call draw_line); get-update-info-hd1: $(call draw_line); - @echo "Get update info for model $(shell echo $(BOXMODEL) | sed 's/.*/\u&/')" + @echo "Get update info for boxmodel $(BOXMODEL)" @echo - @$(CD) $(TARGET_DIR)/var/update; \ - test -e ./zImage && ( \ - dd if=./zImage bs=1 skip=$$(LC_ALL=C grep -a -b -o $$'\x1f\x8b\x08\x00\x00\x00\x00\x00' ./zImage \ - | cut -d ':' -f 1) | zcat | grep -a "Linux version"; \ - ); + @$(CD) $(SOURCE_DIR)/$(NI-DRIVERS-BIN)/$(DRIVERS-BIN_DIR); \ + if [ -e zImage ]; then \ + dd if=zImage bs=1 skip=$$(LC_ALL=C grep -a -b -o $$'\x1f\x8b\x08\x00\x00\x00\x00\x00' zImage \ + | cut -d ':' -f 1) | zcat -q | grep -a "Linux version"; \ + fi $(call draw_line); +endif + # ----------------------------------------------------------------------------- PHONY += target-finish diff --git a/skel-root/hd1/etc/init.d/stb_update.data b/skel-root/hd1/etc/init.d/stb_update.data deleted file mode 100644 index 89ad08d2..00000000 --- a/skel-root/hd1/etc/init.d/stb_update.data +++ /dev/null @@ -1,2 +0,0 @@ -# get this info with "make get-update-info" -V_KERNEL="Sat Jun 24 19:32:15 CEST 2017" diff --git a/skel-root/hd1/etc/init.d/stb_update.sh b/skel-root/hd1/etc/init.d/stb_update.sh index 79b774c3..93681312 100755 --- a/skel-root/hd1/etc/init.d/stb_update.sh +++ b/skel-root/hd1/etc/init.d/stb_update.sh @@ -4,8 +4,8 @@ DO_REBOOT=0 -if [ -e /etc/init.d/stb_update.data ]; then - . /etc/init.d/stb_update.data 2> /dev/null +if [ -e /var/update/stb_update.data ]; then + . /var/update/stb_update.data 2> /dev/null fi if [ -e /var/etc/.stb_update ]; then diff --git a/skel-root/hd1/var/update/zImage b/skel-root/hd1/var/update/zImage deleted file mode 100644 index d6721a1c..00000000 Binary files a/skel-root/hd1/var/update/zImage and /dev/null differ diff --git a/skel-root/hd2-kronos/etc/init.d/stb_update.data b/skel-root/hd2-kronos/etc/init.d/stb_update.data deleted file mode 100644 index 7570dcc1..00000000 --- a/skel-root/hd2-kronos/etc/init.d/stb_update.data +++ /dev/null @@ -1,2 +0,0 @@ -# get this info with "make get-update-info" -V_KERNEL="Sun Nov 5 18:47:49 CET 2017" diff --git a/skel-root/hd2-kronos/var/update/vmlinux.ub.gz b/skel-root/hd2-kronos/var/update/vmlinux.ub.gz deleted file mode 100644 index 3b76bdf1..00000000 Binary files a/skel-root/hd2-kronos/var/update/vmlinux.ub.gz and /dev/null differ diff --git a/skel-root/hd2/etc/init.d/stb_update.data b/skel-root/hd2/etc/init.d/stb_update.data deleted file mode 100755 index 0dce2bee..00000000 --- a/skel-root/hd2/etc/init.d/stb_update.data +++ /dev/null @@ -1,2 +0,0 @@ -# get this info with "make get-update-info" -V_KERNEL="Sun Nov 5 18:47:11 CET 2017" diff --git a/skel-root/hd2/etc/init.d/stb_update.sh b/skel-root/hd2/etc/init.d/stb_update.sh index 204494ad..d7599e21 100755 --- a/skel-root/hd2/etc/init.d/stb_update.sh +++ b/skel-root/hd2/etc/init.d/stb_update.sh @@ -4,16 +4,16 @@ DO_REBOOT=0 -if [ -e /etc/init.d/stb_update.data ]; then - . /etc/init.d/stb_update.data 2> /dev/null +if [ -e /var/update/stb_update.data ]; then + . /var/update/stb_update.data 2> /dev/null fi if [ -e /var/etc/.stb_update ]; then rm /var/etc/.stb_update # force an update with a bogus date V_KERNEL="Sun Jan 1 00:00:00 CET 2042" - V_UBOOT="Sun Jan 01 2042 - 00:00:00" - V_ULDR="Sun Jan 01 2042 00:00:00" + #V_UBOOT="Sun Jan 01 2042 - 00:00:00" + #V_ULDR="Sun Jan 01 2042 00:00:00" fi if [ -f /var/update/vmlinux.ub.gz ]; then diff --git a/skel-root/hd2/var/update/vmlinux.ub.gz b/skel-root/hd2/var/update/vmlinux.ub.gz deleted file mode 100644 index 85181ffe..00000000 Binary files a/skel-root/hd2/var/update/vmlinux.ub.gz and /dev/null differ