#!/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 some unused files # for some reason removing fils with the external script as on W721 # it results in a firmware without webinterface. # Comparing the resulting firmwares show exactly the same number of files and file size. echo2 " -- removing files for further image size reduction:" rm -f "${SRC}"/lib/modules/dect* rm -f "${SRC}"/usr/share/ctlmgr/libdect* rm -f "${SRC}"/usr/share/ctlmgr/libusb* #remove some unused files rm -fr ${SRC}/usr/www/html/de/software rm -fr ${SRC}/usr/www/html/de/usb rm -fr ${SRC}/usr/www/html/de/dect rm -rf ${SRC}/usr/www/html/de/menus/menu2_usb* rm -rf ${SRC}/usr/www/html/de/menus/menu2_usb.inc rm -rf ${SRC}/usr/www/html/de/menus/menu2_software* rm -rf ${SRC}/usr/www/html/de/home/fon1Dect* rm -rf ${SRC}/usr/www/html/de/home/usb* rm -rf ${SRC}/usr/www/html/de/fon/fon1Dect* rm -rf ${SRC}/usr/www/html/de/fon/usb* rm -fr ${SRC}//usr/www.nas rm -rf ${SRC}/lib/modules/$KernelVersion/modules.usbmap rm -fr ${SRC}/lib/modules/$KernelVersion/kernel/drivers/scsi rm -fr ${SRC}/lib/modules/$KernelVersion/kernel/drivers/usb rm -fr ${SRC}/lib/modules/$KernelVersion/kernel/drivers/cdrom rm -fr "${SRC}"/lib/modules/$KernelVersion/kernel/drivers/isdn/avm_dect rm -fr "${SRC}"/lib/modules/$KernelVersion/kernel/drivers/char/dect_io rm -f -R "${SRC}"/lib/modules/$KernelVersion//kernel/fs/vfat rm -f -R "${SRC}"/lib/modules/$KernelVersion//kernel/fs/fat rm -f -R "${SRC}"/lib/modules/$KernelVersion//kernel/fs/ext2 rm -fr "${SRC}"/lib/acgenusb* rm -fr "${SRC}"/lib/libmedia* rm -fr "${SRC}"/sbin/smb* rm -fr "${SRC}"/sbin/stop_media* rm -fr "${SRC}"/sbin/lsusb rm -fr "${SRC}"/sbin/hotplug rm -fr "${SRC}"/sbin/hd-idle rm -fr "${SRC}"/sbin/printserv rm -fr "${SRC}"/sbin/mediasrv rm -rf ${SRC}/sbin/wlan_cal rm -rf ${SRC}/sbin/tracking rm -rf ${SRC}/etc/usbclass.tab rm -rf ${SRC}/etc/usbdevice.tab rm -fr "${SRC}"/etc/hotplug rm -fr "${SRC}"/etc/usb* rm -fr "${SRC}"/etc/samba* rm -fr "${SRC}"/etc/default.049/fx_lcr.1und1 rm -fr "${SRC}"/etc/init.d/rc.media rm -fr "${SRC}"/etc/init.d/rc.usbhost rm -f -R ${SRC}/etc/default.Fritz_Box_SpeedportW503V/1und1 rm -f -R ${SRC}/etc/default.Fritz_Box_SpeedportW503V/otwo rm -fr "${SRC}"/bin/*plugin rm -fr "${SRC}"/bin/playerd_tables rm -f "${SRC}"/bin/usb* rm -rf ${SRC}/bin/usbhostchange rm -f "${SRC}"/usr/bin/dect* rm -f "${SRC}"/usr/bin/usb* rm -rf ${SRC}/usr/share/ctlmgr/libctlusb* rm -rf ${SRC}/usr/share/ctlmgr/libdect* rm -rf ${SRC}/lib/libacgenusb* rm -rf ${SRC}/lib/libusb* rm -rf ${SRC}/sbin/start_dect_update.sh rm -rf ${SRC}/sbin/start_mediasrv rm -rf ${SRC}/sbin/umount.davfs rm -fr ${SRC}/bin/inetdsamba rm -fr ${SRC}/bin/supportdata.dect rm -fr ${SRC}/bin/webdavcfginfo rm -fr ${SRC}/etc/webdav_control rm -fr ${SRC}/etc/onlinechanged/webdav_net rm -fr ${SRC}/sbin/mount.davfs rm -f "${SRC}"/etc/plugin* rm -fr ${SRC}/usr/share/ctlmgr/libctlwebdav* rm -fr "${SRC}"/bin/mini* rm -fr "${SRC}"/etc/minid rm -rf ${SRC}/lib/modules/bit* rm -f "${SRC}"/lib/modules/dect* rm -rf ${SRC}/lib/modules/microvoip_isdn_top.bit cp -fdrp "${DST}"/lib/modules/bitfile_pots.bit --target-directory="${SRC}"/lib/modules cp -fdrp "${DST}"/lib/modules/bitfile_isdn.bit --target-directory="${SRC}"/lib/modules cp -fdrp "${DST}"/lib/modules/wlan_eeprom_hw0.bin --target-directory="${SRC}"/lib/modules cp -fdrp "${DST}"/lib/modules/c55*.hex --target-directory="${SRC}"/lib/modules # .04.88 braucht das vom tcom firmware if [ ${ATA_ONLY} = "n" ]; then [ "${FORCE_TCOM_DSL}" = "y" ] && cp -fdrp "${DST}"/lib/modules/dsp_ur8/ur8-B-dsl.bin --target-directory="${SRC}"/lib/modules/dsp_ur8 &&\ echo "-- DSL driver was taken from the original base firmware!" #annex B driver mkdir -p ./addon/tmp/modules/dsp_ur8 if [ -d "${SRC}/lib/modules/dsp_ur8" ]; then [ ${SAVE_AVM_DSL} = "y" ] && [ -f "${SRC}/lib/modules/dsp_ur8/ur8-B-dsl.bin" ] && cp -fdrp "${SRC}"/lib/modules/dsp_ur8/ur8-B-dsl.bin --target-directory=./addon/tmp/modules/dsp_ur8 &&\ echo "-- AVM DSL Annex B driver saved to: ./addon/tmp/modules!" [ ${SAVE_SRC2_DSL} = "y" ] && [ -f "${SRC_2}/lib/modules/dsp_ur8/ur8-B-dsl.bin" ] && cp -fdrp "${SRC_2}"/lib/modules/dsp_ur8/ur8-B-dsl.bin --target-directory=./addon/tmp/modules/dsp_ur8 &&\ echo "-- AVM DSL Annex B driver saved to: ./addon/tmp/modules!" [ ${USE_OWN_DSL} = "y" ] && [ -f "./addon/tmp/modules/dsp_ur8/ur8-B-dsl.bin" ] && cp -fdrp ./addon/tmp/modules/dsp_ur8/ur8-B-dsl.bin --target-directory="${SRC}"/lib/modules/dsp_ur8 &&\ echo "-- DSL Annex B driver was taken from local directory ./addon/tmp/modules!" [ ${USE_SRC2_DSL} = "y" ] && [ -f "${SRC_2}/lib/modules/dsp_ur8/ur8-B-dsl.bin" ] && cp -fdrp "${SRC_2}"/lib/modules/dsp_ur8/ur8-B-dsl.bin --target-directory="${SRC}"/lib/modules/dsp_ur8 &&\ echo "-- DSL Annex B driver was taken from ${SORCE_2_PRODUKT}!" #annex A driver [ ${SAVE_AVM_DSL} = "y" ] && [ -f "${SRC}/lib/modules/dsp_ur8/ur8-A-dsl.bin" ] && cp -fdrp "${SRC}"/lib/modules/dsp_ur8/ur8-A-dsl.bin --target-directory=./addon/tmp/modules/dsp_ur8 &&\ echo "-- AVM DSL Annex A driver saved to: ./addon/tmp/modules!" [ ${SAVE_SRC2_DSL} = "y" ] && [ -f "${SRC_2}/lib/modules/dsp_ur8/ur8-A-dsl.bin" ] && cp -fdrp "${SRC_2}"/lib/modules/dsp_ur8/ur8-A-dsl.bin --target-directory=./addon/tmp/modules/dsp_ur8 &&\ echo "-- AVM DSL Annex A driver saved to: ./addon/tmp/modules!" [ ${USE_OWN_DSL} = "y" ] && [ -f "./addon/tmp/modules/dsp_ur8/ur8-A-dsl.bin" ] && cp -fdrp ./addon/tmp/modules/dsp_ur8/ur8-A-dsl.bin --target-directory="${SRC}"/lib/modules/dsp_ur8 &&\ echo "-- DSL Annex A driver was taken from local directory ./addon/tmp/modules!" [ ${USE_SRC2_DSL} = "y" ] && [ -f "${SRC_2}/lib/modules/dsp_ur8/ur8-A-dsl.bin" ] && cp -fdrp "${SRC_2}"/lib/modules/dsp_ur8/ur8-A-dsl.bin --target-directory="${SRC}"/lib/modules/dsp_ur8 &&\ echo "-- DSL Annex A driver was taken from ${SORCE_2_PRODUKT}!" fi #save space on 8MB boxes specially [ "${REMOVE_ANNEX_B_DSL_DRIVER}" = "y" ] && [ -f "${SRC}/lib/modules/dsp_ur8/ur8-B-dsl.bin" ] && rm -f "${SRC}"/lib/modules/dsp_ur8/ur8-B-dsl.bin &&\ echo "-- DSL Annex B driver was removed from ${SORCE_PRODUKT}!" #save space on 8MB boxes specially [ "${REMOVE_ANNEX_A_DSL_DRIVER}" = "y" ] && [ -f "${SRC}/lib/modules/dsp_ur8/ur8-A-dsl.bin" ] && rm -f "${SRC}"/lib/modules/dsp_ur8/ur8-A-dsl.bin &&\ echo "-- DSL Annex A driver was removed from ${SORCE_PRODUKT}!" [ ${ANNEX} == "A" ] && ! [ -f "${SRC}/lib/modules/dsp_ur8/ur8-A-dsl.bin" ] && echo "-- You must provid a 2nd AVM source to supply the missing Annex A DSL driver!" && sleep 10 && exit 0 [ ${ANNEX} != "A" ] && ! [ -f "${SRC}/lib/modules/dsp_ur8/ur8-B-dsl.bin" ] && echo "-- You must provid a 2nd AVM source to supply the missing Annex B DSL driver!" && sleep 10 && exit 0 else #remove ADSL #dont start dsl sed -i -e 's|/etc/init.d/rc.dsl.sh start||' "${SRC}/etc/init.d/rc.S" rm -fr "${SRC}"/lib/modules/dsp_ur8 #<-- ATA only fi #echo "-- matching Versions: $AVM_VERSION-$AVM_SUBVERSION - $TCOM_VERSION-$TCOM_SUBVERSION" [ ${FORCE_TCOM_PIGLET} = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers &&\ echo "-- piglet driver was taken from base firmware!" #Fon driver [ ${FORCE_TCOM_FON} = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/isdn --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers &&\ echo "-- fon driver was taken from base firmware!" #copy wlan config ######### # cp -fdrp "${DST}"/etc/init.d/rc.wlan --target-directory="${SRC}"/etc/init.d ######### #copy all modules #cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel #cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/dsld --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers #cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/dsl --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers [ "${XCHANGE_KERNEL}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers [ "${XCHANGE_KERNEL}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/isdn --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers # wlan braucht t-com kernel mit .04.88 Firmware nicht mehr [ "${XCHANGE_KERNEL}" = "y" ] && cp -fdrp "${DST}"/lib/modules/$KernelVersion/kernel/drivers/net --target-directory="${SRC}"/lib/modules/$KernelVersion/kernel/drivers &&\ echo "-- WLAN driver was taken from base firmware!" #adapt parameters for Piglet bitfile to be sed -i -e 's/Fritz_Box_7270/Fritz_Box_W503/' "${SRC}/etc/init.d/rc.S" sed -i -e "/DECT-Anlage/d" "${SRC}/etc/init.d/rc.S" sed -i -e '/Fritz_Box_W503/a \ ## Produktionsbitfile muss mit POTS-Frequenz geladen werden \ ## Anlage braucht den 96 MHz Takt (100E): 'piglet_use_pll3_clk=1' wird hier benoetigt, \ ## da es keinen DECT-Takt gibt, aus dem der fpga die 96 MHz Takt erzeugen koennte.' "${SRC}/etc/init.d/rc.S" sed -i -e 's/microvoip_isdn_top.bit${HWRevision_BitFileCount}/bitfile_isdn.bit/' "${SRC}/etc/init.d/rc.S" sed -i -e "/piglet_load_params=\"/,/dect_secondlevelfile/d" "${SRC}/etc/init.d/rc.S" sed -i -e "/dectfw_firstlevel.hex/,/dectfw_secondlevel.hex/d" "${SRC}/etc/init.d/rc.S" sed -i -e 's/piglet_bitfile=$piglet_bitfile/piglet_bitfile=$piglet_bitfile piglet_potsbitfile=$piglet_potsbitfile /' "${SRC}/etc/init.d/rc.S" sed -i -e "/\$piglet_load_params/d" "${SRC}/etc/init.d/rc.S" sed -i -e '/piglet_bitfile=/a \ piglet_potsbitfile=/lib/modules/bitfile_pots.bit\ 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_enable_button=3 \\\ piglet_bitfilemode=$piglet_bitfilemode \\\ piglet_use_pll3_clk=1 \\\ "\ modprobe Piglet_noemif piglet_bitfile=$piglet_bitfile piglet_potsbitfile=$piglet_potsbitfile $piglet_load_params' "${SRC}/etc/init.d/rc.S" # macht Fehlermeldung moglicherweise nicht mehr siehe Revision 1451 ##piglet_enable_button=3 \\\ ## remove HTTPS-Fernzugang und TR-064-SSL #sed -i -e '/mknod .var.flash.websrv_ssl_key.pem c/d' "${SRC}/etc/init.d/rc.S" #remove dect and usb # wird auch ohne usb gebraucht # sed -i -e '/mknod .var.flash.aura-usb c/d' "${SRC}/etc/init.d/rc.S" 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" #x#sed -i -e '/mknod .var.flash.configd c/d' "${SRC}/etc/init.d/rc.S" sed -i -e "/dect_misc/,/dmgr_handset_user/d" "${SRC}/etc/init.d/rc.S" #remove USB config sed -i -e "/#### USB-Host Config ####/,/#### USB-Client Config ####/d" "${SRC}/etc/init.d/rc.S" #remove DECT config #sed -i -e "s/copy_dect_defaults()/copy_dect()/" "${SRC}/etc/init.d/rc.S" sed -i -e "/modprobe dect_io/d" "${SRC}/etc/init.d/rc.S" ## pcmlink boot error, da modul nicht kompatibel ist [ "${XCHANGE_KERNEL}" = "y" ] || [ "${DISABLE_PCMLINK}" = "y" ] &&\ sed -i -e "/pcm_link/d" "${SRC}/etc/init.d/rc.S" && echo "-- pcmlink removed, phone capi not useable!" &&\ rm -f "${SRC}"/lib/modules/c55fw.hex &&\ rm -fr ${SRC}/lib/modules/$KernelVersion/kernel/drivers/isdn/capi_codec &&\ echo "-- Capi removed because it is not usabel with base kernel" && sleep 5 #grep -q 'grep .pcmlink..ko' "${SRC}/etc/init.d/rc.S" && sed -i -e "s|.pcmlink..ko.|'\^pcmlink.ko'|" "${SRC}/etc/init.d/rc.S" #grep -q "md5sum /lib/modules/c55fw.hex" "${SRC}/etc/init.d/rc.S" || sed -i -e '/pcm_link=${pcm_link%.ko}/a\ #md5sum /lib/modules/c55fw.hex' "${SRC}/etc/init.d/rc.S" ##watchdog sed -i -e "s/init-start 120/init-start 240/" "${SRC}/etc/init.d/rc.S" #dont start mediaserver sed -i -e "/rc.media start/d" "${SRC}/etc/init.d/rc.S" sed -i -e '/## cleanup - if running, stop debug/i \ ## change to external SYNC for TE-Mode\ #########################################################################\ echo isdn_reg 8 0 >\/dev\/debug\ #########################################################################' "${SRC}/etc/init.d/rc.S" # disable plugin rm -f "${SRC}/sbin/start_plugin.sh" sed -i -e "/check-plugins/d" "${SRC}/etc/init.d/rc.S" sed -i -e "/start_plugin.sh/d" "${SRC}/etc/init.d/rc.S" if [ "${ENFORCE_HWREVISION}" != "y" ]; then #workaround for HWRevision if [ -f "${SRC}/sbin/start_plugin.sh" ]; then sed -i -e "/url=\"\`\/sbin\/pluginurl\`\"/i\ export HWRevision=\"$FBHWRevision\"" "${SRC}/sbin/start_plugin.sh" sed -i -e "/url=\"\`\/sbin\/pluginurl\`\"/a\ export HWRevision=\"$HWID\"" "${SRC}/sbin/start_plugin.sh" fi fi sed -i -e "s|hardware=\${HWRevision}|hardware=${FBHWRevision}|" "${SRC}/etc/init.d/rc.conf" #tests sed -i -e '/export ANNEX_TEST/a\ if [ "$STATUS_TEST" != "0" ]; then\ /usr/bin/dsl_info.sh /&\ fi' "${SRC}/etc/init.d/rc.S" #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #copy second source internet dsl menue [ ${USE_SOURCE2_DSLMNUE} = "y" ] && $sh2_DIR/copy_dsl_tab_pages_SRC2 "${SRC}" "${SRC_2}" echo2 "New WEB GUI will be modified" #use scond source web GUI [ ${USE_SOURCE2_WEBMNUE} = "y" ] && $sh2_DIR/copy_www_SRC2 "${SRC}" "${SRC_2}" #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # set led definition #' "${SRC}/etc/init.d/rc.S" $sh_DIR/patch_leddef_W503.sh "${SRC}" "${DST}" if [ -f "${DST}"/lib/modules/$KernelVersion/kernel/drivers/char/led_module.ko ] && [ "${FORCE_TCOM_LEDDRIVER}" = "y" ]; then 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 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" fi #remove FON3 menus [ ${REMOVE_MENU_ITEM} = "y" ] && $sh_DIR/rmv_menus.sh "${SRC}" "${FBMOD}" #Add buchsend button to fon bookpage [ "${ADD_PHONESEND}" = "y" ] && $sh_DIR/patch_fonbuch.sh "${SRC}" #patch annex parameter $sh_DIR/patch_annex.sh "${SRC}" # add kapselung and annex settings page if missing $sh_DIR/add_multi_settings.sh #remove kids if [ "${REMOVE_KIDS}" = "y" ]; then $sh_DIR/rmv_kids.sh "${SRC}" rm -fr ${SRC}/usr/www/kids rm -rf ${SRC}/bin/usermand* rm -fr ${SRC}/lib/modules/$KernelVersion/kernel/drivers/userman else export CONFIG_KIDS="y" fi # This is done in sp-to-fritz.root.sh #$sh_DIR/rmv_help.sh "${SRC}" # 503 changing the CONFIG_XXX vars beyond this point has no effect $sh_DIR/patch_config_rc.conf.sh "${SRC}" "${DST}" 503 echo "********************************************************************************" grep -q "Telekom-Anlagen benoetigen hochtakten" "${SRC}/etc/init.d/rc.S" || sed -i -e '/bin.run_clock -c .dev.tffs -d/i\ ## Telekom-Anlagen benoetigen hochtakten (unabhaengig von ECO) !\ echo MODE=pd_speed_on >\/dev\/avm_power\ ' "${SRC}/etc/init.d/rc.S" #/var/flash/fx_def grep -q ".var.flash.websrv_ssl_cert.pem c" "${SRC}/etc/init.d/rc.S" || sed -i -e '/mknod .var.flash.aura-usb/a\ mknod \/var\/flash\/websrv_ssl_cert.pem c $tffs_major $((0xCA))' "${SRC}/etc/init.d/rc.S" grep -q ".var.flash.configd c" "${SRC}/etc/init.d/rc.S" || sed -i -e '/mknod .var.flash.aura-usb/a\ mknod \/var\/flash\/configd c $tffs_major $((0xA1))' "${SRC}/etc/init.d/rc.S" grep -q "copy_provider_default" "${SRC}/etc/init.d/rc.S" || sed -i -e '/Defaults fuellen/a\ ## Laden der Provider-defaults (statisch eingebunden vor rc.conf)\ ##########################################################################################\ ## P-Defaults - ingnoriert derzeit bei der WE auswahl eventuelle laufzeitparameter\ ##########################################################################################\ copy_provider_default()\ {\ local DIR=\/var\/flash\/provider_default\ mkdir -p $DIR\ mknod $DIR\/$1 c $tffs_major $2\ if checkempty \/var\/flash\/$1 && ! checkempty $DIR\/$1 ; then\ echo "P-Defaults: cp $1"\ cat $DIR\/$1 >\/var\/flash\/$1\ fi\ }\ provider_default_config()\ {\ ## In state of factory defaults ar7.cfg is always empty\ if ! checkempty \/var\/flash\/ar7.cfg ; then\ echo "P-Defaults: do nothing"\ return\ fi\ local DIR=\/var\/flash\/provider_default\ mkdir -p $DIR\ ## mindestens der OEM wird benoetigt (fuer *cfgconv,*cfgctl)\ . \/etc\/init.d\/rc.conf\ if ! [ "${CONFIG_PROV_DEFAULT}" = "y" ] ; then\ ## nicht ausf?hren, falls enthalten, jedoch aber zur laufzeit deaktiviert\ echo "P-Defaults: not configured - skip."\ return\ fi\ echo "P-Defaults: and action..."\ mknod $DIR\/ar7.cfg.diff c $tffs_major $((0x1f))\ if ! checkempty $DIR\/ar7.cfg.diff ; then\ echo "P-Defaults: merge ar7.cfg"\ allcfgconv -C ar7 -e -m $DIR\/ar7.cfg.diff\ local LANGUAGE="`echo provider_default.language | ar7cfgctl -s 2>\/dev\/null | sed s\/\\\\"\/\/g`"\ if [ "$LANGUAGE" != "" ] ; then\ if ! setlanguage $LANGUAGE ; then\ echo "P-Defaults: setlanguage failed"\ fi\ fi\ local COUNTRY="`echo provider_default.country | ar7cfgctl -s 2>\/dev\/null | sed s\/\\\\"\/\/g`"\ if [ "$COUNTRY" != "" ] ; then\ if ! setcountry $COUNTRY ; then\ echo "P-Defaults: setcountry failed"\ fi\ fi\ fi\ mknod $DIR\/voip.cfg.diff c $tffs_major $((0x22))\ if checkempty \/var\/flash\/voip.cfg && ! checkempty $DIR\/voip.cfg.diff ; then\ echo "P-Defaults: merge voip.cfg"\ allcfgconv -C voip -e -m $DIR\/voip.cfg.diff\ fi\ mknod $DIR\/wlan.cfg.diff c $tffs_major $((0x23))\ if checkempty \/var\/flash\/wlan.cfg && ! checkempty $DIR\/wlan.cfg.diff ; then\ echo "P-Defaults: merge wlan.cfg"\ wlancfgconv -e -m $DIR\/wlan.cfg.diff\ fi\ mknod $DIR\/tr069.cfg.diff c $tffs_major $((0x27))\ if checkempty \/var\/flash\/tr069.cfg && ! checkempty $DIR\/tr069.cfg.diff ; then\ echo "P-Defaults: merge tr069.cfg"\ allcfgconv -C tr069 -e -m $DIR\/tr069.cfg.diff\ fi\ mknod $DIR\/vpn.cfg.diff c $tffs_major $((0x26))\ if checkempty \/var\/flash\/vpn.cfg && ! checkempty $DIR\/vpn.cfg.diff ; then\ echo "P-Defaults: merge vpn.cfg"\ allcfgconv -C vpn -e -m $DIR\/vpn.cfg.diff\ fi\ mknod $DIR\/user.cfg.diff c $tffs_major $((0x28))\ if checkempty \/var\/flash\/user.cfg && ! checkempty $DIR\/user.cfg.diff ; then\ echo "P-Defaults: merge user.cfg"\ allcfgconv -C user -e -m $DIR\/user.cfg.diff\ fi\ copy_provider_default fx_cg $((0x34))\ copy_provider_default fx_conf $((0x31))\ copy_provider_default fx_lcr $((0x32))\ copy_provider_default telefon_misc $((0x35))\ copy_provider_default phonebook $((0x3e))\ copy_provider_default calllog $((0x3d))\ copy_provider_default fonctrl $((0x3f))\ copy_provider_default umts.cfg $((0x4c))\ copy_provider_default configd $((0x4f))\ echo "P-Defaults: ...done."\ }\ provider_default_config\ ## P-Defaults - ende\ ' "${SRC}/etc/init.d/rc.S"