#!/bin/bash #KernelVersion="2.6.19.2" #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # only executed if productname is changed if [ ! -e "${SRC}"/etc/default.${CONFIG_PRODUKT} ]; then echo -e "\033[1m${SORCE_PRODUKT} ---> ${CONFIG_PRODUKT}\033[0m " echo2 " -- move contents of OEM directory:" echo2 " move /etc/default.${SORCE_PRODUKT} --> /etc/default.${CONFIG_PRODUKT}" mkdir -m 755 "${SRC}/etc/default.${CONFIG_PRODUKT}" "$TAR" -c -C "${SRC}/etc/default.${SORCE_PRODUKT}" . | "$TAR" -x -C "${SRC}/etc/default.${CONFIG_PRODUKT}" rm -fr "${SRC}"/etc/default.${SORCE_PRODUKT} fi #remove kids and help [ "${REMOVE_KIDS}" = "y" ] && $sh_DIR/rmv_kids.sh "${SRC}" [ "${REMOVE_HELP}" = "y" ] && $sh_DIR/rmv_help.sh "${SRC}" echo "********************************************************************************" # set led definition if [ -f "${SRC_2}"/lib/modules/$KernelVersion/kernel/drivers/char/led_module.ko ] && [ "${FORCE_SRC2_LEDDRIVER}" = "y" ]; then cp -fdrp "${SRC_2}"/lib/modules/$KernelVersion/kernel/drivers/char/led_module.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char cp -fdrp "${SRC_2}"/lib/libled* --target-directory="${SRC}"/lib cp -fdrp "${SRC_2}"/bin/led* --target-directory="${SRC}"/bin cp -fr "${SRC_2}"/bin/update_led_on ${SRC}/bin/update_led_on cp -fr "${SRC_2}"/bin/update_led_off ${SRC}/bin/update_led_off echo "-- LED driver was taken from AVM source 2 firmware" else cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char/led_module.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char cp -fdrp "${DST}"/lib/libled* --target-directory="${SRC}"/lib cp -fdrp "${DST}"/bin/led* --target-directory="${SRC}"/bin cp -fr "${DST}"/bin/update_led_on ${SRC}/bin/update_led_on cp -fr "${DST}"/bin/update_led_off ${SRC}/bin/update_led_off echo "-- LED driver was taken from the original base firmware" fi cp -fdrp "${DST}"/dev --target-directory="${SRC}" #this copy is onliy usable if run as root [ "${FORCE_TCOM_KDSLDMOD}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/dsld/kdsldmod.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/dsld [ "${FORCE_TCOM_PCMLINK}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char/ubik2/pcmlink.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char/ubik2 [ "${FORCE_TCOM_USRMAN}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/userman/userman_mod.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/driver/userman [ ${FORCE_TCOM_PIGLET} = "y" ] &&\ cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char/Piglet_noemif/Piglet_noemif.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char/Piglet_noemif &&\ echo "-- Xilinx Piglet_noemif.ko driver was taken from the original base firmware" #Fon driver [ ${FORCE_TCOM_FON} = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/isdn/isdn_fon5/zzz/* --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/isdn/isdn_fon5/zzz if [ "${SAVE_SRC2_KDSLDMOD}" = "y" ]; then mkdir -p ./addon/tmp/W722/squashfs-root/lib/modules/$KernelVersion/kernel/drivers/dsld cp -fdrp "${SRC_2}"/lib/modules/$KernelVersion/kernel/drivers/dsld/kdsldmod.ko --target-directory=./addon/tmp/W920/squashfs-root/lib/modules/$KernelVersion/kernel/drivers/dsld &&\ echo "-- 2nd AVM Firmware kdslmod driver saved to: ./addon/tmp/W722" fi [ "${FORCE_SRC2_KDSLDMOD}" = "y" ] && cp -fdrp "${SRC_2}"/lib/modules/$KernelVersion/kernel/drivers/dsld/kdsldmod.ko --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers/dsld &&\ echo "-- kdslmod driver was taken from 2nd AVM source." if [ "${FORCE_OWN_KDSLDMOD}" = "y" ] && ! [ -f ./addon/tmp/W722/squashfs-root/lib/modules/$KernelVersion/kernel/drivers/dsld/kdsldmod.ko ]; then echo "You must save kdsld driver form 2nd AVM source before" && sleep 10 && exit 1 fi [ "${FORCE_OWN_KDSLDMOD}" = "y" ] && cp -fdrp ./addon/tmp/W722/squashfs-root/lib/modules/$KernelVersion/kernel/drivers/dsld/kdsldmod.ko --target-directory="${SRC}/lib/modules/$KernelVersion/kernel/drivers/dsld" &&\ echo "-- kdslmod driver was taken from local directory ./addon/tmp/W722" # 722 $sh_DIR/patch_config_rc.conf.sh "${SRC}" "${DST}" 722 # remove DECT #remove dect and usb sed -i -e '/mknod .var.flash.dect_misc c/d' "${SRC}/etc/init.d/rc.S" sed -i -e '/mknod .var.flash.dect_eeprom c/d' "${SRC}/etc/init.d/rc.S" sed -i -e '/mknod .var.flash.dmgr_handset_user c/d' "${SRC}/etc/init.d/rc.S" # sed -i -e '/mknod .var.flash.configd c/d' "${SRC}/etc/init.d/rc.S" rm -rf "${SRC}"/lib/modules/*_488.hex rm -fr "${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char/dect_io rm -fr "${SRC}"/lib/modules/$KernelVersion/kernel/drivers/isdn/avm_dect rm -fr "${SRC}"/lib/modules/$KernelVersion/kernel/drivers/net/nlaudio/nlaudio.ko rm -f "${SRC}"/usr/bin/dect* rm -f "${SRC}"/usr/share/ctlmgr/libdect* ## VDSL treiber #/squashfs-root/lib/modules/adsp0_firmware.bin #/squashfs-root/lib/modules/adsp1_firmware.bin [ -e "${DST}"/lib/modules/adsp0_firmware.bin ] && cp -fdrp "${DST}"/lib/modules/adsp0_firmware.bin --target-directory="${SRC}"/lib/modules &&\ echo "-- adsp0_firmware.bin was taken from the original base firmware" [ -e "${DST}"/lib/modules/adsp1_firmware.bin ] && cp -fdrp "${DST}"/lib/modules/adsp1_firmware.bin --target-directory="${SRC}"/lib/modules &&\ echo "-- adsp1_firmware.bin was taken from the original base firmware" [ -e "${DST}"/lib/modules/Vx180Code.cbin ] && cp -fdrp "${DST}"/lib/modules/Vx180Code.cbin --target-directory="${SRC}"/lib/modules &&\ echo "-- Vx180Codec bitfile was taken from the original base firmware" ## xilinx driver must be for the hardware in use #/squashfs-root/lib/modules/bitfile.bit #7390 #/squashfs-root/lib/modules/bitfile_isdn.bit #W722 #/squashfs-root/lib/modules/bitfile_pots.bit #W722 rm -f "${SRC}"/lib/modules/bitfile.bit [ -e "${DST}"/lib/modules/microvoip_isdn_top.bit ] && cp -fdrp "${DST}"/lib/modules/microvoip_isdn_top.bit --target-directory="${SRC}"/lib/modules &&\ echo "-- Xilinx isdn bitfile was taken from the original base firmware" [ -e "${DST}"/lib/modules/microvoip_pots_top.bit ] && cp -fdrp "${DST}"/lib/modules/microvoip_pots_top.bit --target-directory="${SRC}"/lib/modules &&\ echo "-- Xilinx pots bitfile was taken from the original base firmware" sed -i -e '/## Fritz_Box_7390/,/## DECT-Anlage/d' "${SRC}/etc/init.d/rc.S" sed -i -e '/dect_firstlevelfile=/,/modprobe Piglet_noemif/d' "${SRC}/etc/init.d/rc.S" sed -i -e '/modprobe nand/i \ piglet_bitfile=/lib/modules/bitfile_isdn.bit${HWRevision_BitFileCount}\ piglet_potsbitfile=/lib/modules/bitfile_pots.bit${HWRevision_BitFileCount}\ piglet_bitfilemode=\`/bin/testvalue /var/flash/telefon_misc 4 2638\`\ if [ -z $piglet_bitfilemode ] ; then piglet_bitfilemode=0 ; fi\ echo PigletMode: $piglet_bitfilemode\ piglet_load_params="\\\ piglet_bitfilemode=$piglet_bitfilemode \\\ "\ modprobe Piglet_noemif piglet_bitfile=$piglet_bitfile piglet_potsbitfile=$piglet_potsbitfile $piglet_load_params' "${SRC}/etc/init.d/rc.S" sed -i -e '/echo init-start 240/a \ # start loging\ /bin/dmesg > /var/dmesg-rc.S.log\ # start telnet deamon with password of web gui\ /usr/sbin/telnetd -l /sbin/ar7login\ sleep 50' "${SRC}/etc/init.d/rc.S" # disable watchdog sed -i -e 's|echo init-start 240 >/dev/watchdog|"disable" >/dev/watchdog|' "${SRC}/etc/init.d/rc.S" ## change to external SYNC for TE-Mode sed -i -e '/## cleanup - if/i \ ## change to external SYNC for TE-Mode\ echo isdn_reg 8 0 >/dev/debug' "${SRC}/etc/init.d/rc.S"