auto config ip script

使用脚本配置本地连接IP地址
该博客展示了一段脚本代码,用于配置本地连接的IP地址。通过设置变量指定连接名称、IP地址、子网掩码、网关和DNS等信息,利用netsh命令完成配置,并进行了变量检查、临时文件处理和错误处理,最终输出配置完成信息。

@echo off
:-----------------------------
:by root_119ATmsn.com
:---------------ipconfig------
set connect=本地连接
set address=192.168.1.177
set netmask=255.255.255.0
set gateway=192.168.1.1
set dns1=192.168.1.1
set dns2=192.168.1.2
:-----------------------------

if not defined tmp (echo Variables Error %%TMP%% & goto end)
if exist %tmp%/setaddress del %TMP%/setaddress || (echo Can't deltree %TMP%/setaddress & goto end)
echo pushd interface ip > %TMP%/setaddress || (echo Can't write in %TMP%/setaddress & goto end)
echo set address name = "%connect%" source = static addr = %address% mask = %netmask% >>%tmp%/setaddress
echo set address name = "%connect%" gateway = %gateway% gwmetric = 1 >>%tmp%/setaddress
echo set dns name = "%connect%" source = static addr = %dns1% >>%tmp%/setaddress
echo add dns name = "%connect%" addr = %dns2% >>%tmp%/setaddress
echo set wins name = "%connect%" source = static addr = none >>%tmp%/setaddress
echo popd >>%TMP%/setaddress
if not exist %SYSTEMROOT%/system32/netsh.exe (echo not find netsh.exe & goto end)
@%SYSTEMROOT%/system32/netsh.exe -f %TMP%/setaddress
@del %TMP%/setaddress /q
if errorlevel 1 echo Error! & goto end
echo config ip complete!
:end
cmd /k exit

# # Automatically generated file; DO NOT EDIT. # U-Boot 2022.07 Configuration # CONFIG_CREATE_ARCH_SYMLINK=y CONFIG_SYS_CACHE_SHIFT_5=y CONFIG_SYS_CACHELINE_SIZE=32 # CONFIG_ARC is not set CONFIG_ARM=y # CONFIG_M68K is not set # CONFIG_MICROBLAZE is not set # CONFIG_MIPS is not set # CONFIG_NIOS2 is not set # CONFIG_PPC is not set # CONFIG_RISCV is not set # CONFIG_SANDBOX is not set # CONFIG_SH is not set # CONFIG_X86 is not set # CONFIG_XTENSA is not set CONFIG_SYS_ARCH="arm" CONFIG_SYS_CPU="armv7" CONFIG_SYS_SOC="luofu" CONFIG_SYS_VENDOR="hisilicon" CONFIG_SYS_BOARD="luofu" CONFIG_SYS_CONFIG_NAME="luofu" # CONFIG_SKIP_LOWLEVEL_INIT is not set # CONFIG_SKIP_LOWLEVEL_INIT_ONLY is not set # CONFIG_SYS_ICACHE_OFF is not set # CONFIG_SYS_DCACHE_OFF is not set # # ARM architecture # CONFIG_COUNTER_FREQUENCY=250000000 # CONFIG_POSITION_INDEPENDENT is not set # CONFIG_GIC_V3_ITS is not set CONFIG_HAS_VBAR=y CONFIG_HAS_THUMB2=y CONFIG_ARM_ASM_UNIFIED=y CONFIG_SYS_ARM_CACHE_CP15=y CONFIG_SYS_ARM_MMU=y # CONFIG_SYS_ARM_MPU is not set CONFIG_CPU_V7A=y CONFIG_SYS_ARM_ARCH=7 CONFIG_SYS_ARM_CACHE_WRITEBACK=y # CONFIG_SYS_ARM_CACHE_WRITETHROUGH is not set # CONFIG_SYS_ARM_CACHE_WRITEALLOC is not set # CONFIG_ARCH_CPU_INIT is not set # CONFIG_SYS_ARCH_TIMER is not set # CONFIG_ARM_SMCCC is not set # CONFIG_SEMIHOSTING is not set # CONFIG_SYS_THUMB_BUILD is not set # CONFIG_SYS_L2CACHE_OFF is not set # CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK is not set CONFIG_USE_ARCH_MEMCPY=y CONFIG_USE_ARCH_MEMSET=y # CONFIG_ARCH_AT91 is not set # CONFIG_ARCH_DAVINCI is not set # CONFIG_ARCH_KIRKWOOD is not set # CONFIG_ARCH_MVEBU is not set # CONFIG_ARCH_ORION5X is not set # CONFIG_TARGET_STV0991 is not set # CONFIG_ARCH_BCM283X is not set # CONFIG_ARCH_BCM63158 is not set # CONFIG_ARCH_BCM6753 is not set # CONFIG_ARCH_BCM68360 is not set # CONFIG_ARCH_BCM6858 is not set # CONFIG_ARCH_BCMSTB is not set # CONFIG_TARGET_VEXPRESS_CA9X4 is not set # CONFIG_TARGET_BCMCYGNUS is not set # CONFIG_TARGET_BCMNS2 is not set # CONFIG_TARGET_BCMNS3 is not set # CONFIG_ARCH_EXYNOS is not set # CONFIG_ARCH_S5PC1XX is not set # CONFIG_ARCH_HIGHBANK is not set # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_IPQ40XX is not set # CONFIG_ARCH_KEYSTONE is not set # CONFIG_ARCH_K3 is not set # CONFIG_ARCH_OMAP2PLUS is not set # CONFIG_ARCH_MESON is not set # CONFIG_ARCH_MEDIATEK is not set # CONFIG_ARCH_LPC32XX is not set # CONFIG_ARCH_IMX8 is not set # CONFIG_ARCH_IMX8M is not set # CONFIG_ARCH_IMX8ULP is not set # CONFIG_ARCH_IMXRT is not set # CONFIG_ARCH_MX23 is not set # CONFIG_ARCH_MX28 is not set # CONFIG_ARCH_MX31 is not set # CONFIG_ARCH_MX7ULP is not set # CONFIG_ARCH_MX7 is not set # CONFIG_ARCH_MX6 is not set # CONFIG_ARCH_MX5 is not set # CONFIG_ARCH_NEXELL is not set # CONFIG_ARCH_NPCM is not set # CONFIG_ARCH_APPLE is not set # CONFIG_ARCH_OWL is not set # CONFIG_ARCH_QEMU is not set # CONFIG_ARCH_RMOBILE is not set # CONFIG_ARCH_SNAPDRAGON is not set # CONFIG_ARCH_SOCFPGA is not set # CONFIG_ARCH_SUNXI is not set # CONFIG_ARCH_U8500 is not set # CONFIG_ARCH_VERSAL is not set # CONFIG_ARCH_VF610 is not set # CONFIG_ARCH_ZYNQ is not set # CONFIG_ARCH_ZYNQMP_R5 is not set # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCH_TEGRA is not set # CONFIG_ARCH_VEXPRESS64 is not set # CONFIG_TARGET_TOTAL_COMPUTE is not set # CONFIG_TARGET_LS2080A_EMU is not set # CONFIG_TARGET_LS1088AQDS is not set # CONFIG_TARGET_LS2080AQDS is not set # CONFIG_TARGET_LS2080ARDB is not set # CONFIG_TARGET_LS2081ARDB is not set # CONFIG_TARGET_LX2160ARDB is not set # CONFIG_TARGET_LX2160AQDS is not set # CONFIG_TARGET_LX2162AQDS is not set # CONFIG_TARGET_HIKEY is not set # CONFIG_TARGET_HIKEY960 is not set # CONFIG_TARGET_POPLAR is not set # CONFIG_TARGET_LS1012AQDS is not set # CONFIG_TARGET_LS1012ARDB is not set # CONFIG_TARGET_LS1012A2G5RDB is not set # CONFIG_TARGET_LS1012AFRWY is not set # CONFIG_TARGET_LS1012AFRDM is not set # CONFIG_TARGET_LS1028AQDS is not set # CONFIG_TARGET_LS1028ARDB is not set # CONFIG_TARGET_LS1088ARDB is not set # CONFIG_TARGET_LS1021AQDS is not set # CONFIG_TARGET_LS1021ATWR is not set # CONFIG_TARGET_PG_WCOM_SELI8 is not set # CONFIG_TARGET_PG_WCOM_EXPU1 is not set # CONFIG_TARGET_LS1021ATSN is not set # CONFIG_TARGET_LS1021AIOT is not set # CONFIG_TARGET_LS1043AQDS is not set # CONFIG_TARGET_LS1043ARDB is not set # CONFIG_TARGET_LS1046AQDS is not set # CONFIG_TARGET_LS1046ARDB is not set # CONFIG_TARGET_LS1046AFRWY is not set # CONFIG_TARGET_SL28 is not set # CONFIG_TARGET_TEN64 is not set # CONFIG_ARCH_UNIPHIER is not set # CONFIG_ARCH_SYNQUACER is not set # CONFIG_ARCH_STM32 is not set # CONFIG_ARCH_STI is not set # CONFIG_ARCH_STM32MP is not set # CONFIG_ARCH_ROCKCHIP is not set # CONFIG_ARCH_OCTEONTX is not set # CONFIG_ARCH_OCTEONTX2 is not set # CONFIG_TARGET_THUNDERX_88XX is not set # CONFIG_ARCH_ASPEED is not set # CONFIG_TARGET_DURIAN is not set # CONFIG_TARGET_POMELO is not set # CONFIG_TARGET_PRESIDIO_ASIC is not set # CONFIG_TARGET_XENGUEST_ARM64 is not set CONFIG_TARGET_LUOFU=y # CONFIG_TARGET_XILING is not set # CONFIG_TARGET_EMEI is not set # CONFIG_TARGET_QISHAN is not set # CONFIG_TARGET_TIANGONG2 is not set # CONFIG_TARGET_TIANGONG1 is not set CONFIG_SUPPORT_PASSING_ATAGS=y # CONFIG_SETUP_MEMORY_TAGS is not set # CONFIG_CMDLINE_TAG is not set # CONFIG_INITRD_TAG is not set # CONFIG_REVISION_TAG is not set CONFIG_SERIAL_TAG=y # CONFIG_STATIC_MACH_TYPE is not set CONFIG_SYS_TEXT_BASE=0x80040000 CONFIG_SYS_MALLOC_LEN=0x1400000 CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x20000 CONFIG_ENV_OFFSET=0x240000 CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="luofu" CONFIG_MULTI_DTB_FIT_UNCOMPRESS_SZ=0x8000 CONFIG_ERR_PTR_OFFSET=0x0 CONFIG_BOOTSTAGE_STASH_ADDR=0 CONFIG_ENV_OFFSET_REDUND=0x280000 CONFIG_IDENT_STRING=" for luofu" CONFIG_SYS_CLK_FREQ=0 # CONFIG_CHIP_DIP_SCAN is not set # CONFIG_HAS_ARMV7_SECURE_BASE is not set # CONFIG_ARMV7_LPAE is not set # CONFIG_CMD_DEKBLOB is not set # CONFIG_IMX_CAAM_DEK_ENCAP is not set # CONFIG_IMX_OPTEE_DEK_ENCAP is not set # CONFIG_IMX_SECO_DEK_ENCAP is not set # CONFIG_CMD_HDMIDETECT is not set # CONFIG_CMD_NANDBCB is not set CONFIG_IMX_DCD_ADDR=0x00910000 CONFIG_SYS_MEM_TOP_HIDE=0x0 CONFIG_SYS_LOAD_ADDR=0x83200000 # # ARM debug # # CONFIG_DEBUG_LL is not set CONFIG_HSAN=y CONFIG_MULTIUPG=y CONFIG_ACTIVE_STANDBY_BOOT=y CONFIG_CHIP_LUOFU=y CONFIG_BUILD_TARGET="" # CONFIG_DEBUG_UART is not set # CONFIG_AHCI is not set # CONFIG_OF_BOARD_FIXUP is not set # # General setup # CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_CC_OPTIMIZE_FOR_SPEED is not set # CONFIG_CC_OPTIMIZE_FOR_DEBUG is not set # CONFIG_OPTIMIZE_INLINING is not set CONFIG_ARCH_SUPPORTS_LTO=y # CONFIG_LTO is not set # CONFIG_XEN is not set # CONFIG_DISTRO_DEFAULTS is not set # CONFIG_ENV_VARS_UBOOT_CONFIG is not set # CONFIG_SYS_BOOT_GET_CMDLINE is not set # CONFIG_SYS_BOOT_GET_KBD is not set CONFIG_SYS_MALLOC_F=y # CONFIG_VALGRIND is not set CONFIG_EXPERT=y CONFIG_SYS_MALLOC_CLEAR_ON_INIT=y # CONFIG_SYS_MALLOC_DEFAULT_TO_INIT is not set # CONFIG_TOOLS_DEBUG is not set # CONFIG_PHYS_64BIT is not set # CONFIG_REMAKE_ELF is not set # CONFIG_HAS_BOARD_SIZE_LIMIT is not set # CONFIG_SYS_CUSTOM_LDSCRIPT is not set CONFIG_PLATFORM_ELFENTRY="_start" CONFIG_STACK_SIZE=0x1000000 CONFIG_SYS_SRAM_BASE=0x0 CONFIG_SYS_SRAM_SIZE=0x0 # CONFIG_MP is not set # CONFIG_EXAMPLES is not set # # API # # CONFIG_API is not set # # Boot options # # # Boot images # # CONFIG_ANDROID_BOOT_IMAGE is not set # CONFIG_FIT is not set # CONFIG_TIMESTAMP is not set CONFIG_BOOTSTD=y # CONFIG_BOOTSTD_FULL is not set CONFIG_BOOTSTD_BOOTCOMMAND=y # CONFIG_BOOTMETH_SCRIPT is not set CONFIG_LEGACY_IMAGE_FORMAT=y # CONFIG_SUPPORT_RAW_INITRD is not set # CONFIG_OF_BOARD_SETUP is not set # CONFIG_OF_SYSTEM_SETUP is not set # CONFIG_OF_STDOUT_VIA_ALIAS is not set CONFIG_SYS_EXTRA_OPTIONS="" CONFIG_HAVE_SYS_TEXT_BASE=y # CONFIG_DYNAMIC_SYS_CLK_FREQ is not set CONFIG_ARCH_FIXUP_FDT_MEMORY=y # CONFIG_CHROMEOS is not set # CONFIG_CHROMEOS_VBOOT is not set # CONFIG_RAMBOOT_PBL is not set # # Boot timing # # CONFIG_BOOTSTAGE is not set CONFIG_BOOTSTAGE_STASH_SIZE=0x1000 # CONFIG_SHOW_BOOT_PROGRESS is not set # # Boot media # # CONFIG_NAND_BOOT is not set # CONFIG_ONENAND_BOOT is not set # CONFIG_QSPI_BOOT is not set # CONFIG_SATA_BOOT is not set # CONFIG_SD_BOOT is not set # CONFIG_SD_BOOT_QSPI is not set # CONFIG_SPI_BOOT is not set # # Autoboot options # CONFIG_AUTOBOOT=y CONFIG_BOOTDELAY=3 # CONFIG_AUTOBOOT_KEYED is not set # CONFIG_AUTOBOOT_USE_MENUKEY is not set # CONFIG_AUTOBOOT_MENU_SHOW is not set # CONFIG_BOOT_RETRY is not set # # Image support # # CONFIG_IMAGE_PRE_LOAD is not set # CONFIG_USE_BOOTARGS is not set # CONFIG_BOOTARGS_SUBST is not set # CONFIG_USE_BOOTCOMMAND is not set # CONFIG_USE_PREBOOT is not set CONFIG_DEFAULT_FDT_FILE="" # CONFIG_SAVE_PREV_BL_FDT_ADDR is not set # CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR is not set # # Console # CONFIG_MENU=y # CONFIG_CONSOLE_RECORD is not set # CONFIG_DISABLE_CONSOLE is not set CONFIG_LOGLEVEL=4 CONFIG_SPL_LOGLEVEL=4 CONFIG_TPL_LOGLEVEL=4 # CONFIG_SILENT_CONSOLE is not set # CONFIG_PRE_CONSOLE_BUFFER is not set # CONFIG_CONSOLE_MUX is not set # CONFIG_SYS_CONSOLE_IS_IN_ENV is not set # CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE is not set # CONFIG_SYS_CONSOLE_ENV_OVERWRITE is not set # CONFIG_SYS_CONSOLE_INFO_QUIET is not set # CONFIG_SYS_STDIO_DEREGISTER is not set # CONFIG_SPL_SYS_STDIO_DEREGISTER is not set # CONFIG_SYS_DEVICE_NULLDEV is not set # # Logging # # CONFIG_LOG is not set # # Init options # # CONFIG_BOARD_TYPES is not set # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_DISPLAY_BOARDINFO_LATE is not set # # Start-up hooks # # CONFIG_EVENT is not set # CONFIG_ARCH_EARLY_INIT_R is not set # CONFIG_ARCH_MISC_INIT is not set # CONFIG_BOARD_EARLY_INIT_F is not set # CONFIG_BOARD_EARLY_INIT_R is not set # CONFIG_BOARD_POSTCLK_INIT is not set CONFIG_BOARD_LATE_INIT=y # CONFIG_CLOCKS is not set # CONFIG_LAST_STAGE_INIT is not set CONFIG_MISC_INIT_R=y # CONFIG_ID_EEPROM is not set # CONFIG_RESET_PHY_R is not set # # Security support # # CONFIG_STACKPROTECTOR is not set # # Update support # # CONFIG_ANDROID_AB is not set # # Blob list # # CONFIG_BLOBLIST is not set # # SPL / TPL / VPL # CONFIG_SPL_SYS_STACK_F_CHECK_BYTE=0xaa # CONFIG_SPL_SYS_REPORT_STACK_F_USAGE is not set # CONFIG_SPL_SHOW_ERRORS is not set # # PowerPC and LayerScape SPL Boot options # # CONFIG_SPL_MD5 is not set # CONFIG_FDT_SIMPLEFB is not set # # Command line interface # CONFIG_CMDLINE=y # CONFIG_HUSH_PARSER is not set CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_SYS_LONGHELP=y CONFIG_SYS_PROMPT="luofu # " CONFIG_SYS_XTRACE=y # # Commands # # # Info commands # # CONFIG_CMD_BDI is not set # CONFIG_CMD_CONFIG is not set # CONFIG_CMD_CONSOLE is not set # CONFIG_CMD_CPU is not set # CONFIG_CMD_LICENSE is not set # CONFIG_CMD_PMC is not set # # Boot commands # CONFIG_CMD_BOOTD=y CONFIG_CMD_BOOTM=y # CONFIG_CMD_BOOTDEV is not set # CONFIG_CMD_BOOTFLOW is not set # CONFIG_CMD_BOOTMETH is not set # CONFIG_CMD_BOOTZ is not set CONFIG_BOOTM_LINUX=y # CONFIG_BOOTM_NETBSD is not set # CONFIG_BOOTM_OPENRTOS is not set # CONFIG_BOOTM_OSE is not set # CONFIG_BOOTM_PLAN9 is not set # CONFIG_BOOTM_RTEMS is not set # CONFIG_BOOTM_VXWORKS is not set CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_ADTIMG is not set # CONFIG_CMD_ELF is not set CONFIG_CMD_FDT=y CONFIG_CMD_GO=y CONFIG_CMD_RUN=y # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set # CONFIG_CMD_XIMG is not set # CONFIG_CMD_THOR_DOWNLOAD is not set # CONFIG_CMD_ZBOOT is not set # # Environment commands # # CONFIG_CMD_ASKENV is not set # CONFIG_CMD_EXPORTENV is not set # CONFIG_CMD_IMPORTENV is not set # CONFIG_CMD_EDITENV is not set # CONFIG_CMD_GREPENV is not set CONFIG_CMD_SAVEENV=y # CONFIG_CMD_ERASEENV is not set # CONFIG_CMD_ENV_EXISTS is not set # CONFIG_CMD_ENV_CALLBACK is not set # CONFIG_CMD_ENV_FLAGS is not set # CONFIG_CMD_NVEDIT_INDIRECT is not set # CONFIG_CMD_NVEDIT_INFO is not set # CONFIG_CMD_NVEDIT_LOAD is not set # CONFIG_CMD_NVEDIT_SELECT is not set # # Memory commands # # CONFIG_CMD_BINOP is not set # CONFIG_CMD_BLOBLIST is not set # CONFIG_CMD_CRC32 is not set # CONFIG_CMD_EEPROM is not set # CONFIG_LOOPW is not set # CONFIG_CMD_MD5SUM is not set # CONFIG_CMD_MEMINFO is not set CONFIG_CMD_MEMORY=y # CONFIG_CMD_MEM_SEARCH is not set # CONFIG_CMD_MX_CYCLIC is not set # CONFIG_CMD_RANDOM is not set # CONFIG_CMD_MEMTEST is not set # CONFIG_CMD_SHA1SUM is not set # CONFIG_CMD_STRINGS is not set # # Compression commands # # CONFIG_CMD_LZMADEC is not set # CONFIG_CMD_UNLZ4 is not set # CONFIG_CMD_UNZIP is not set # CONFIG_CMD_ZIP is not set # # Device access commands # # CONFIG_CMD_ARMFLASH is not set # CONFIG_CMD_BIND is not set # CONFIG_CMD_CLK is not set # CONFIG_CMD_DEMO is not set # CONFIG_CMD_DFU is not set # CONFIG_CMD_DM is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGAD is not set # CONFIG_CMD_FUSE is not set CONFIG_CMD_GPIO=y # CONFIG_CMD_GPIO_READ is not set # CONFIG_CMD_GPT is not set # CONFIG_RANDOM_UUID is not set # CONFIG_CMD_IDE is not set # CONFIG_CMD_IO is not set # CONFIG_CMD_IOTRACE is not set # CONFIG_CMD_I2C is not set # CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set # CONFIG_CMD_LSBLK is not set # CONFIG_CMD_MBR is not set # CONFIG_CMD_MISC is not set # CONFIG_CMD_CLONE is not set CONFIG_CMD_MTD=y CONFIG_CMD_NAND=y # CONFIG_CMD_NAND_TRIMFFS is not set # CONFIG_CMD_NAND_LOCK_UNLOCK is not set # CONFIG_CMD_NAND_TORTURE is not set # CONFIG_CMD_ONENAND is not set # CONFIG_CMD_OSD is not set # CONFIG_CMD_PCI is not set # CONFIG_CMD_POWEROFF is not set # CONFIG_CMD_READ is not set # CONFIG_CMD_SATA is not set # CONFIG_CMD_SAVES is not set # CONFIG_CMD_SCSI is not set # CONFIG_CMD_SDRAM is not set # CONFIG_CMD_TSI148 is not set # CONFIG_CMD_UNIVERSE is not set # CONFIG_CMD_USB_SDP is not set # CONFIG_CMD_WDT is not set # # Shell scripting commands # # CONFIG_CMD_ECHO is not set # CONFIG_CMD_ITEST is not set # CONFIG_CMD_SOURCE is not set # CONFIG_CMD_SETEXPR is not set # # Android support commands # CONFIG_CMD_NET=y CONFIG_CMD_BOOTP=y # CONFIG_CMD_DHCP is not set # CONFIG_BOOTP_MAY_FAIL is not set CONFIG_BOOTP_BOOTPATH=y # CONFIG_BOOTP_VENDOREX is not set # CONFIG_BOOTP_BOOTFILESIZE is not set CONFIG_BOOTP_DNS=y # CONFIG_BOOTP_DNS2 is not set CONFIG_BOOTP_GATEWAY=y CONFIG_BOOTP_HOSTNAME=y # CONFIG_BOOTP_PREFER_SERVERIP is not set CONFIG_BOOTP_SUBNETMASK=y # CONFIG_BOOTP_NISDOMAIN is not set # CONFIG_BOOTP_NTPSERVER is not set # CONFIG_CMD_PCAP is not set CONFIG_BOOTP_VCI_STRING="U-Boot.armv7" CONFIG_CMD_TFTPBOOT=y # CONFIG_CMD_TFTPPUT is not set # CONFIG_CMD_TFTPSRV is not set CONFIG_NET_TFTP_VARS=y # CONFIG_CMD_RARP is not set # CONFIG_CMD_NFS is not set # CONFIG_CMD_MII is not set # CONFIG_CMD_MDIO is not set CONFIG_CMD_PING=y # CONFIG_CMD_CDP is not set # CONFIG_CMD_SNTP is not set # CONFIG_CMD_DNS is not set # CONFIG_CMD_LINK_LOCAL is not set # CONFIG_CMD_ETHSW is not set # CONFIG_CMD_PXE is not set # CONFIG_CMD_WOL is not set # # Misc commands # # CONFIG_CMD_BSP is not set # CONFIG_CMD_BLOCK_CACHE is not set CONFIG_CMD_CACHE=y # CONFIG_CMD_CONITRACE is not set # CONFIG_CMD_EXCEPTION is not set # CONFIG_CMD_DATE is not set # CONFIG_CMD_TIME is not set # CONFIG_CMD_GETTIME is not set # CONFIG_CMD_SLEEP is not set # CONFIG_CMD_TIMER is not set # CONFIG_CMD_SYSBOOT is not set # CONFIG_CMD_QFW is not set # CONFIG_CMD_PSTORE is not set # CONFIG_CMD_TERMINAL is not set # CONFIG_CMD_UUID is not set # # TI specific command line interface # # CONFIG_CMD_DDR3 is not set # # Power commands # # # Security commands # # CONFIG_CMD_AES is not set # CONFIG_CMD_BLOB is not set # CONFIG_CMD_HASH is not set # # Firmware commands # # # Filesystem commands # # CONFIG_CMD_BTRFS is not set # CONFIG_CMD_EROFS is not set # CONFIG_CMD_EXT2 is not set # CONFIG_CMD_EXT4 is not set # CONFIG_CMD_FAT is not set # CONFIG_CMD_SQUASHFS is not set # CONFIG_CMD_FS_GENERIC is not set # CONFIG_CMD_FS_UUID is not set # CONFIG_CMD_JFFS2 is not set CONFIG_CMD_MTDPARTS=y # CONFIG_CMD_MTDPARTS_SPREAD is not set # CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES is not set CONFIG_MTDIDS_DEFAULT="nand0=hi_nfc,nor0=hi_sfc" CONFIG_MTDPARTS_DEFAULT="" # CONFIG_CMD_REISER is not set # CONFIG_CMD_ZFS is not set # # Debug commands # # CONFIG_CMD_DIAG is not set # CONFIG_CMD_EVENT is not set # CONFIG_CMD_LOG is not set # CONFIG_CMD_UBI is not set # # Partition Types # # CONFIG_MAC_PARTITION is not set # CONFIG_DOS_PARTITION is not set # CONFIG_ISO_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_EFI_PARTITION is not set CONFIG_SUPPORT_OF_CONTROL=y # # Device Tree Control # CONFIG_OF_CONTROL=y CONFIG_OF_REAL=y # CONFIG_OF_LIVE is not set CONFIG_OF_SEPARATE=y # CONFIG_OF_EMBED is not set # CONFIG_OF_BOARD is not set CONFIG_OF_OMIT_DTB=y CONFIG_DEVICE_TREE_INCLUDES="" CONFIG_OF_LIST="luofu" # CONFIG_MULTI_DTB_FIT is not set # CONFIG_OF_DTB_PROPS_REMOVE is not set CONFIG_VPL_OF_REAL=y # # Environment # CONFIG_ENV_SUPPORT=y CONFIG_ENV_SOURCE_FILE="" CONFIG_SAVEENV=y # CONFIG_ENV_OVERWRITE is not set # CONFIG_ENV_IS_NOWHERE is not set # CONFIG_ENV_IS_IN_EEPROM is not set # CONFIG_ENV_IS_IN_FAT is not set # CONFIG_ENV_IS_IN_EXT4 is not set # CONFIG_ENV_IS_IN_FLASH is not set CONFIG_ENV_IS_IN_NAND=y # CONFIG_ENV_IS_IN_NVRAM is not set # CONFIG_ENV_IS_IN_ONENAND is not set # CONFIG_ENV_IS_IN_REMOTE is not set CONFIG_SYS_REDUNDAND_ENVIRONMENT=y # CONFIG_SYS_RELOC_GD_ENV_ADDR is not set # CONFIG_USE_DEFAULT_ENV_FILE is not set # CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG is not set # CONFIG_ENV_IMPORT_FDT is not set # CONFIG_ENV_APPEND is not set # CONFIG_ENV_WRITEABLE_LIST is not set # CONFIG_ENV_ACCESS_IGNORE_FORCE is not set # CONFIG_USE_BOOTFILE is not set # CONFIG_USE_ETHPRIME is not set # CONFIG_VERSION_VARIABLE is not set CONFIG_NET=y CONFIG_ARP_TIMEOUT=200 CONFIG_NET_RETRY_COUNT=20 # CONFIG_PROT_UDP is not set CONFIG_BOOTDEV_ETH=y # CONFIG_BOOTP_SEND_HOSTNAME is not set CONFIG_NET_RANDOM_ETHADDR=y CONFIG_NETCONSOLE=y # CONFIG_IP_DEFRAG is not set # CONFIG_SYS_FAULT_ECHO_LINK_DOWN is not set CONFIG_TFTP_BLOCKSIZE=512 # CONFIG_TFTP_PORT is not set CONFIG_TFTP_WINDOWSIZE=1 # CONFIG_TFTP_TSIZE is not set # CONFIG_SERVERIP_FROM_PROXYDHCP is not set CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS=100 # CONFIG_KEEP_SERVERADDR is not set # CONFIG_UDP_CHECKSUM is not set # CONFIG_BOOTP_SERVERIP is not set # # Device Drivers # # # Generic Driver Options # CONFIG_DM=y # CONFIG_DM_WARN is not set # CONFIG_DM_DEBUG is not set CONFIG_DM_DEVICE_REMOVE=y # CONFIG_DM_EVENT is not set CONFIG_DM_STDIO=y CONFIG_DM_SEQ_ALIAS=y # CONFIG_DM_DMA is not set CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_DEVRES is not set CONFIG_SIMPLE_BUS=y # CONFIG_SIMPLE_BUS_CORRECT_RANGE is not set # CONFIG_OF_TRANSLATE is not set # CONFIG_TRANSLATION_OFFSET is not set CONFIG_DM_DEV_READ_INLINE=y # CONFIG_ACPIGEN is not set CONFIG_BOUNCE_BUFFER=y # CONFIG_ADC is not set # CONFIG_ADC_EXYNOS is not set # CONFIG_ADC_SANDBOX is not set # CONFIG_SARADC_MESON is not set # CONFIG_SARADC_ROCKCHIP is not set # CONFIG_SATA is not set # CONFIG_SCSI_AHCI is not set # # SATA/SCSI device support # # CONFIG_AXI is not set # # Bus devices # CONFIG_BLK=y CONFIG_HAVE_BLOCK_DEVICE=y CONFIG_BLOCK_CACHE=y # CONFIG_EFI_MEDIA is not set # CONFIG_IDE is not set # CONFIG_BOOTCOUNT_LIMIT is not set # # Button Support # # CONFIG_BUTTON is not set # # Cache Controller drivers # # CONFIG_CACHE is not set CONFIG_L2X0_CACHE=y # CONFIG_NCORE_CACHE is not set # CONFIG_SIFIVE_CCACHE is not set # # Clock # CONFIG_CLK=y # CONFIG_CLK_CCF is not set # CONFIG_CLK_CDCE9XX is not set # CONFIG_CLK_ICS8N3QV01 is not set # CONFIG_CLK_K210 is not set # CONFIG_CLK_MPC83XX is not set # CONFIG_CLK_XLNX_CLKWZRD is not set # CONFIG_CLK_AT91 is not set # CONFIG_CLK_SIFIVE is not set # CONFIG_CLK_TI_AM3_DPLL is not set # CONFIG_CLK_TI_CTRL is not set # CONFIG_CLK_TI_GATE is not set # CONFIG_CLK_K3 is not set CONFIG_CPU=y # # Hardware crypto devices # # CONFIG_DM_HASH is not set # CONFIG_FSL_CAAM is not set # CONFIG_SYS_FSL_SEC_BE is not set # CONFIG_SYS_FSL_SEC_LE is not set # CONFIG_DDR_SPD is not set # # Demo for driver model # # CONFIG_DM_DEMO is not set # # DFU support # # # DMA Support # # CONFIG_DMA is not set # CONFIG_DMA_LPC32XX is not set # CONFIG_TI_EDMA3 is not set # CONFIG_DMA_LEGACY is not set # # Fastboot support # # CONFIG_UDP_FUNCTION_FASTBOOT is not set # CONFIG_FIRMWARE is not set # CONFIG_ZYNQMP_FIRMWARE is not set # # FPGA support # # CONFIG_FPGA_ALTERA is not set # CONFIG_FPGA_SOCFPGA is not set # CONFIG_FPGA_XILINX is not set CONFIG_GPIO=y # CONFIG_GPIO_HOG is not set # CONFIG_DM_GPIO_LOOKUP_LABEL is not set # CONFIG_ALTERA_PIO is not set # CONFIG_BCM2835_GPIO is not set CONFIG_DWAPB_GPIO=y # CONFIG_AT91_GPIO is not set # CONFIG_ATMEL_PIO4 is not set # CONFIG_ASPEED_GPIO is not set # CONFIG_DA8XX_GPIO is not set # CONFIG_INTEL_BROADWELL_GPIO is not set # CONFIG_INTEL_GPIO is not set # CONFIG_INTEL_ICH6_GPIO is not set # CONFIG_IMX_RGPIO2P is not set # CONFIG_IPROC_GPIO is not set # CONFIG_HSDK_CREG_GPIO is not set # CONFIG_KIRKWOOD_GPIO is not set # CONFIG_LPC32XX_GPIO is not set # CONFIG_MCP230XX_GPIO is not set # CONFIG_MSM_GPIO is not set # CONFIG_MXC_GPIO is not set # CONFIG_MXS_GPIO is not set # CONFIG_NPCM_GPIO is not set # CONFIG_CMD_PCA953X is not set # CONFIG_ROCKCHIP_GPIO is not set # CONFIG_XILINX_GPIO is not set # CONFIG_CMD_TCA642X is not set # CONFIG_TEGRA_GPIO is not set # CONFIG_TEGRA186_GPIO is not set # CONFIG_VYBRID_GPIO is not set # CONFIG_SIFIVE_GPIO is not set # CONFIG_ZYNQ_GPIO is not set # CONFIG_DM_74X164 is not set # CONFIG_SPL_DM_PCA953X is not set # CONFIG_MPC8XXX_GPIO is not set # CONFIG_NX_GPIO is not set # CONFIG_NOMADIK_GPIO is not set # CONFIG_ZYNQMP_GPIO_MODEPIN is not set # CONFIG_SLG7XL45106_I2C_GPO is not set # # Hardware Spinlock Support # # CONFIG_DM_HWSPINLOCK is not set # CONFIG_I2C is not set # CONFIG_INPUT is not set # CONFIG_DM_KEYBOARD is not set # CONFIG_KEYBOARD is not set # CONFIG_TEGRA_KEYBOARD is not set # CONFIG_TWL4030_INPUT is not set # # IOMMU device drivers # # CONFIG_IOMMU is not set # # LED Support # # CONFIG_LED is not set # CONFIG_LED_STATUS is not set # # Mailbox Controller Support # # CONFIG_DM_MAILBOX is not set # # Memory Controller drivers # # # Multifunction device drivers # CONFIG_MISC=y # CONFIG_ALTERA_SYSID is not set # CONFIG_ATSHA204A is not set # CONFIG_GATEWORKS_SC is not set # CONFIG_ROCKCHIP_EFUSE is not set # CONFIG_ROCKCHIP_OTP is not set # CONFIG_SIFIVE_OTP is not set # CONFIG_VEXPRESS_CONFIG is not set # CONFIG_CROS_EC is not set # CONFIG_DS4510 is not set # CONFIG_FSL_SEC_MON is not set # CONFIG_IRQ is not set # CONFIG_NUVOTON_NCT6102D is not set # CONFIG_PWRSEQ is not set # CONFIG_PCA9551_LED is not set # CONFIG_TEST_DRV is not set # CONFIG_TWL4030_LED is not set # CONFIG_WINBOND_W83627 is not set # CONFIG_I2C_EEPROM is not set # CONFIG_GDSYS_RXAUI_CTRL is not set # CONFIG_GDSYS_IOEP is not set # CONFIG_MPC83XX_SERDES is not set # CONFIG_FS_LOADER is not set # CONFIG_SPL_FS_LOADER is not set # CONFIG_GDSYS_SOC is not set # CONFIG_IHS_FPGA is not set # CONFIG_MICROCHIP_FLEXCOM is not set # # MMC Host controller Support # # CONFIG_MMC is not set # CONFIG_MMC_BROKEN_CD is not set # CONFIG_DM_MMC is not set # CONFIG_FSL_ESDHC is not set # CONFIG_FSL_ESDHC_IMX is not set # # MTD Support # CONFIG_MTD_PARTITIONS=y CONFIG_MTD=y CONFIG_DM_MTD=y # CONFIG_MTD_NOR_FLASH is not set # CONFIG_MTD_CONCAT is not set CONFIG_SYS_MTDPARTS_RUNTIME=y # CONFIG_FLASH_CFI_DRIVER is not set # CONFIG_CFI_FLASH is not set # CONFIG_ALTERA_QSPI is not set # CONFIG_HBMC_AM654 is not set # CONFIG_USE_SYS_MAX_FLASH_BANKS is not set CONFIG_MTD_RAW_NAND=y # CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT is not set CONFIG_SYS_NAND_USE_FLASH_BBT=y # CONFIG_NAND_ATMEL is not set # CONFIG_NAND_BRCMNAND is not set # CONFIG_NAND_DAVINCI is not set # CONFIG_NAND_DENALI_DT is not set # CONFIG_NAND_FSL_IFC is not set # CONFIG_NAND_LPC32XX_MLC is not set # CONFIG_NAND_LPC32XX_SLC is not set # CONFIG_NAND_VF610_NFC is not set # CONFIG_NAND_PXA3XX is not set # CONFIG_NAND_ARASAN is not set # CONFIG_NAND_MXIC is not set # CONFIG_NAND_ZYNQ is not set # CONFIG_NAND_OCTEONTX is not set # # Generic NAND options # # CONFIG_SYS_NAND_ONFI_DETECTION is not set # # SPI Flash Support # # CONFIG_SPI_FLASH is not set # # UBI support # # CONFIG_UBI_SILENCE_MSG is not set # CONFIG_MTD_UBI is not set # # Multiplexer drivers # # CONFIG_MULTIPLEXER is not set # CONFIG_BITBANGMII is not set # CONFIG_MV88E6352_SWITCH is not set CONFIG_PHYLIB=y # CONFIG_PHY_ADDR_ENABLE is not set # CONFIG_B53_SWITCH is not set # CONFIG_MV88E61XX_SWITCH is not set # CONFIG_PHYLIB_10G is not set # CONFIG_PHY_ADIN is not set # CONFIG_PHY_AQUANTIA is not set # CONFIG_PHY_ATHEROS is not set # CONFIG_PHY_BROADCOM is not set # CONFIG_PHY_CORTINA is not set # CONFIG_PHY_DAVICOM is not set # CONFIG_PHY_ET1011C is not set # CONFIG_PHY_LXT is not set # CONFIG_PHY_MARVELL is not set # CONFIG_PHY_MESON_GXL is not set # CONFIG_PHY_MICREL is not set # CONFIG_PHY_MSCC is not set # CONFIG_PHY_NATSEMI is not set # CONFIG_PHY_NXP_C45_TJA11XX is not set # CONFIG_PHY_NXP_TJA11XX is not set # CONFIG_PHY_REALTEK is not set # CONFIG_PHY_SMSC is not set # CONFIG_PHY_TERANETICS is not set # CONFIG_PHY_TI is not set # CONFIG_PHY_TI_DP83867 is not set # CONFIG_PHY_TI_DP83869 is not set # CONFIG_PHY_TI_GENERIC is not set # CONFIG_PHY_VITESSE is not set # CONFIG_PHY_XILINX is not set # CONFIG_PHY_XILINX_GMII2RGMII is not set # CONFIG_PHY_ETHERNET_ID is not set # CONFIG_PHY_FIXED is not set # CONFIG_PHY_NCSI is not set CONFIG_PHY_RESET_DELAY=0 # CONFIG_FSL_PFE is not set # CONFIG_BNXT_ETH is not set CONFIG_ETH=y CONFIG_DM_ETH=y # CONFIG_DM_MDIO is not set # CONFIG_DM_ETH_PHY is not set CONFIG_NETDEVICES=y # CONFIG_PHY_GIGE is not set # CONFIG_ALTERA_TSE is not set # CONFIG_BCM_SF2_ETH is not set # CONFIG_BCMGENET is not set # CONFIG_CALXEDA_XGMAC is not set # CONFIG_DRIVER_DM9000 is not set # CONFIG_DWC_ETH_QOS is not set # CONFIG_EEPRO100 is not set # CONFIG_ETH_DESIGNWARE is not set # CONFIG_ETH_DESIGNWARE_MESON8B is not set # CONFIG_ETHOC is not set # CONFIG_FMAN_ENET is not set # CONFIG_FTMAC100 is not set # CONFIG_FTGMAC100 is not set # CONFIG_MCFFEC is not set # CONFIG_FSLDMAFEC is not set # CONFIG_KS8851_MLL is not set # CONFIG_MACB is not set # CONFIG_PCH_GBE is not set # CONFIG_RGMII is not set CONFIG_MII=y # CONFIG_RMII is not set # CONFIG_PCNET is not set # CONFIG_QE_UEC is not set # CONFIG_RTL8139 is not set # CONFIG_RTL8169 is not set # CONFIG_SMC911X is not set # CONFIG_SUN7I_GMAC is not set # CONFIG_SUN4I_EMAC is not set # CONFIG_SUN8I_EMAC is not set # CONFIG_SH_ETHER is not set # CONFIG_DRIVER_TI_CPSW is not set # CONFIG_DRIVER_TI_EMAC is not set # CONFIG_DRIVER_TI_KEYSTONE_NET is not set # CONFIG_TULIP is not set # CONFIG_XILINX_AXIEMAC is not set # CONFIG_XILINX_EMACLITE is not set # CONFIG_ZYNQ_GEM is not set # CONFIG_SYS_DPAA_QBMAN is not set # CONFIG_TSEC_ENET is not set # CONFIG_MEDIATEK_ETH is not set # CONFIG_HIGMACV300_ETH is not set # CONFIG_NVME is not set # CONFIG_NVME_APPLE is not set # CONFIG_PCI is not set # # PCI Endpoint # # CONFIG_PCI_ENDPOINT is not set # CONFIG_X86_PCH7 is not set # CONFIG_X86_PCH9 is not set # # PHY Subsystem # CONFIG_PHY=y # CONFIG_NOP_PHY is not set # CONFIG_MIPI_DPHY_HELPERS is not set # CONFIG_BCM_SR_PCIE_PHY is not set # CONFIG_MSM8916_USB_PHY is not set # CONFIG_OMAP_USB2_PHY is not set # # Rockchip PHY driver # # CONFIG_PHY_CADENCE_SIERRA is not set # CONFIG_PHY_CADENCE_TORRENT is not set # CONFIG_MVEBU_COMPHY_SUPPORT is not set # # Pin controllers # # CONFIG_PINCTRL is not set # CONFIG_POWER_LEGACY is not set # CONFIG_SPL_POWER_LEGACY is not set # CONFIG_ACPI_PMC is not set # CONFIG_SPL_ACPI_PMC is not set # CONFIG_TPL_ACPI_PMC is not set # # Power Domain Support # # CONFIG_POWER_DOMAIN is not set # CONFIG_DM_PMIC is not set # CONFIG_PMIC_TPS65217 is not set # CONFIG_POWER_MC34VR500 is not set # CONFIG_DM_REGULATOR is not set # CONFIG_POWER_MT6323 is not set # CONFIG_DM_PWM is not set # CONFIG_PWM_IMX is not set # CONFIG_PWM_SANDBOX is not set # CONFIG_U_QE is not set # CONFIG_RAM is not set # # Reboot Mode Support # # CONFIG_DM_REBOOT_MODE is not set # # Remote Processor drivers # # # Reset Controller Support # CONFIG_DM_RESET=y # CONFIG_RESET_AST2500 is not set # CONFIG_RESET_AST2600 is not set # CONFIG_RESET_HISILICON is not set # CONFIG_RESET_SYSCON is not set # CONFIG_RESET_SCMI is not set # CONFIG_RESET_DRA7 is not set # CONFIG_DM_RNG is not set # # Real Time Clock # # CONFIG_DM_RTC is not set # CONFIG_RTC_ENABLE_32KHZ_OUTPUT is not set # CONFIG_RTC_PCF8563 is not set # CONFIG_RTC_PL031 is not set # CONFIG_RTC_S35392A is not set # CONFIG_RTC_MC146818 is not set # CONFIG_RTC_M41T62 is not set # CONFIG_SCSI is not set # CONFIG_DM_SCSI is not set CONFIG_SERIAL=y CONFIG_BAUDRATE=115200 CONFIG_REQUIRE_SERIAL_CONSOLE=y CONFIG_SPECIFY_CONSOLE_INDEX=y CONFIG_SERIAL_PRESENT=y CONFIG_CONS_INDEX=1 CONFIG_DM_SERIAL=y # CONFIG_SERIAL_RX_BUFFER is not set # CONFIG_SERIAL_PUTS is not set # CONFIG_SERIAL_SEARCH_ALL is not set # CONFIG_SERIAL_PROBE_ALL is not set # CONFIG_VPL_DM_SERIAL is not set # CONFIG_ALTERA_JTAG_UART is not set # CONFIG_ALTERA_UART is not set # CONFIG_ARC_SERIAL is not set # CONFIG_ARM_DCC is not set # CONFIG_ATMEL_USART is not set # CONFIG_BCM6345_SERIAL is not set # CONFIG_COREBOOT_SERIAL is not set # CONFIG_CORTINA_UART is not set # CONFIG_FSL_LINFLEXUART is not set # CONFIG_FSL_LPUART is not set # CONFIG_MVEBU_A3700_UART is not set # CONFIG_MCFUART is not set # CONFIG_NULLDEV_SERIAL is not set CONFIG_SYS_NS16550=y # CONFIG_NS16550_DYNAMIC is not set # CONFIG_PL01X_SERIAL is not set # CONFIG_ROCKCHIP_SERIAL is not set # CONFIG_XILINX_UARTLITE is not set # CONFIG_MSM_SERIAL is not set # CONFIG_MSM_GENI_SERIAL is not set # CONFIG_OMAP_SERIAL is not set # CONFIG_PXA_SERIAL is not set # CONFIG_SIFIVE_SERIAL is not set # CONFIG_ZYNQ_SERIAL is not set # CONFIG_MTK_SERIAL is not set # CONFIG_MT7620_SERIAL is not set # CONFIG_NPCM_SERIAL is not set # CONFIG_SMEM is not set # # Sound support # # CONFIG_SOUND is not set # # SOC (System On Chip) specific Drivers # # CONFIG_SOC_DEVICE is not set # CONFIG_SOC_TI is not set # CONFIG_SPI is not set # # SPMI support # # CONFIG_SPMI is not set # CONFIG_SYSINFO is not set # # System reset device drivers # # CONFIG_SYSRESET is not set # CONFIG_TEE is not set # CONFIG_DM_THERMAL is not set # # Timer Support # CONFIG_TIMER=y # CONFIG_TIMER_EARLY is not set # CONFIG_ALTERA_TIMER is not set # CONFIG_AST_TIMER is not set # CONFIG_ATCPIT100_TIMER is not set # CONFIG_ATMEL_PIT_TIMER is not set # CONFIG_CADENCE_TTC_TIMER is not set # CONFIG_DESIGNWARE_APB_TIMER is not set # CONFIG_MPC83XX_TIMER is not set # CONFIG_RENESAS_OSTM_TIMER is not set # CONFIG_NOMADIK_MTU_TIMER is not set # CONFIG_NPCM_TIMER is not set # CONFIG_OMAP_TIMER is not set # CONFIG_ROCKCHIP_TIMER is not set # CONFIG_STI_TIMER is not set # CONFIG_STM32_TIMER is not set # CONFIG_MTK_TIMER is not set # CONFIG_MCHP_PIT64B_TIMER is not set # CONFIG_IMX_GPT_TIMER is not set # # TPM support # # CONFIG_USB is not set # # UFS Host Controller Support # # CONFIG_TI_J721E_UFS is not set # # Graphics support # # CONFIG_DM_VIDEO is not set # CONFIG_SYS_WHITE_ON_BLACK is not set # CONFIG_NO_FB_CLEAR is not set # # TrueType Fonts # # CONFIG_VIDEO_VESA is not set # CONFIG_VIDEO_LCD_ANX9804 is not set # CONFIG_ATMEL_LCD_BGR555 is not set # CONFIG_VIDEO_BCM2835 is not set # CONFIG_VIDEO_LCD_SSD2828 is not set # CONFIG_VIDEO_LCD_HITACHI_TX18D42VM is not set # CONFIG_VIDEO_MVEBU is not set # CONFIG_I2C_EDID is not set # CONFIG_DISPLAY is not set # CONFIG_ATMEL_HLCD is not set # CONFIG_AM335X_LCD is not set # CONFIG_VIDEO_TEGRA20 is not set # CONFIG_VIDEO_BRIDGE is not set # CONFIG_VIDEO is not set # CONFIG_LCD is not set # CONFIG_VIDEO_SIMPLE is not set # CONFIG_VIDEO_DT_SIMPLEFB is not set # CONFIG_OSD is not set # CONFIG_SPLASH_SCREEN is not set # CONFIG_VIDEO_VCXK is not set # # VirtIO Drivers # # CONFIG_VIRTIO_MMIO is not set # # 1-Wire support # # CONFIG_W1 is not set # # 1-wire EEPROM support # # CONFIG_W1_EEPROM is not set # # Watchdog Timer Support # CONFIG_WATCHDOG=y CONFIG_WATCHDOG_AUTOSTART=y CONFIG_WATCHDOG_TIMEOUT_MSECS=60000 # CONFIG_IMX_WATCHDOG is not set # CONFIG_ULP_WATCHDOG is not set # CONFIG_DESIGNWARE_WATCHDOG is not set CONFIG_WDT=y # CONFIG_WDT_APPLE is not set # CONFIG_WDT_ASPEED is not set # CONFIG_WDT_AST2600 is not set # CONFIG_WDT_AT91 is not set # CONFIG_WDT_CDNS is not set # CONFIG_WDT_CORTINA is not set # CONFIG_WDT_GPIO is not set # CONFIG_WDT_MAX6370 is not set # CONFIG_WDT_ORION is not set # CONFIG_WDT_SBSA is not set # CONFIG_WDT_SP805 is not set # CONFIG_WDT_STM32MP is not set # CONFIG_XILINX_TB_WATCHDOG is not set # CONFIG_PVBLOCK is not set # CONFIG_PHYS_TO_BUS is not set # # File systems # # CONFIG_FS_BTRFS is not set # CONFIG_FS_CBFS is not set # CONFIG_SPL_FS_CBFS is not set # CONFIG_FS_EXT4 is not set # CONFIG_FS_FAT is not set # CONFIG_FS_JFFS2 is not set # CONFIG_UBIFS_SILENCE_MSG is not set # CONFIG_FS_CRAMFS is not set # CONFIG_YAFFS2 is not set # CONFIG_FS_SQUASHFS is not set # CONFIG_FS_EROFS is not set # # Library routines # # CONFIG_ADDR_MAP is not set # CONFIG_PHYSMEM is not set # CONFIG_BCH is not set # CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED is not set CONFIG_CHARSET=y # CONFIG_DYNAMIC_CRC_TABLE is not set CONFIG_HAVE_PRIVATE_LIBGCC=y CONFIG_PRINTF=y CONFIG_SPRINTF=y CONFIG_STRTO=y CONFIG_USE_PRIVATE_LIBGCC=y CONFIG_SYS_HZ=1000 # CONFIG_PANIC_HANG is not set # CONFIG_REGEX is not set CONFIG_LIB_RAND=y # CONFIG_LIB_HW_RAND is not set CONFIG_SUPPORT_ACPI=y # CONFIG_GENERATE_ACPI_TABLE is not set # CONFIG_SPL_TINY_MEMSET is not set # CONFIG_TPL_TINY_MEMSET is not set # CONFIG_BITREVERSE is not set # CONFIG_TRACE is not set # CONFIG_CIRCBUF is not set # CONFIG_CMD_DHRYSTONE is not set # # Security support # # CONFIG_AES is not set # CONFIG_ECDSA is not set # CONFIG_RSA is not set # CONFIG_TPM is not set # # Android Verified Boot # # # Hashing Support # # CONFIG_BLAKE2 is not set # CONFIG_SHA1 is not set # CONFIG_SHA256 is not set # CONFIG_SHA512 is not set # CONFIG_SHA384 is not set # CONFIG_SHA_HW_ACCEL is not set # CONFIG_MD5 is not set CONFIG_CRC32=y # # Compression Support # # CONFIG_LZ4 is not set # CONFIG_LZMA is not set # CONFIG_LZO is not set # CONFIG_GZIP is not set # CONFIG_ZLIB_UNCOMPRESS is not set # CONFIG_BZIP2 is not set CONFIG_ZLIB=y # CONFIG_ZSTD is not set # CONFIG_SPL_LZ4 is not set # CONFIG_SPL_LZMA is not set # CONFIG_VPL_LZMA is not set # CONFIG_SPL_LZO is not set # CONFIG_SPL_GZIP is not set # CONFIG_SPL_ZSTD is not set # CONFIG_ERRNO_STR is not set CONFIG_HEXDUMP=y # CONFIG_GETOPT is not set CONFIG_OF_LIBFDT=y CONFIG_OF_LIBFDT_ASSUME_MASK=0 CONFIG_OF_LIBFDT_OVERLAY=y # CONFIG_VPL_OF_LIBFDT is not set # CONFIG_FDT_FIXUP_PARTITIONS is not set # # System tables # # CONFIG_LIB_RATIONAL is not set # CONFIG_SMBIOS_PARSER is not set # CONFIG_EFI_LOADER is not set # CONFIG_OPTEE_LIB is not set # CONFIG_OPTEE_IMAGE is not set # CONFIG_BOOTM_OPTEE is not set # CONFIG_TEST_FDTDEC is not set # CONFIG_PHANDLE_CHECK_SEQ is not set # CONFIG_UNIT_TEST is not set # CONFIG_SPL_UNIT_TEST is not set # # Tools options # CONFIG_MKIMAGE_DTC_PATH="dtc" # CONFIG_TOOLS_MKEFICAPSULE is not set 根据以上代码,其中,CONFIG_ENV_OFFSET_REDUND=0x280000表示什么?
08-02
#!/bin/sh . /lib/functions.sh . /lib/netifd/netifd-proto.sh PPP_IPPARAM="$6" dhcp6cdir="/tmp/dhcp6c" conffile="$dhcp6cdir/dhcp6c.conf" dhcp6cpid="$dhcp6cdir/dhcp6c.pid" dhcp6cscript="/lib/netifd/pppshare-dhcp6c.script" proto_dhcp6c_create_conffile(){ local ip_mode="$1" local dns_mode="$2" local ifname="$3" local lanif="$4" local ip_config="$5" #local id=`date +%s` #id=`expr $id % 1000000` #local id2=`expr $id + 1` local id=1 local id2=$id rm -rf ${dhcp6cdir} mkdir -p ${dhcp6cdir} echo create conffile : $ip_config:$ip_mode:$ifname > /dev/console if [ "$ip_config" == "specified" ]; then echo "interface $ifname {" > "${conffile}" [ "$dns_mode" == "dynamic" ] && echo -e "\trequest domain-name-servers;" >> "${conffile}" echo -e "\tscript \"$dhcp6cscript\";" >> "${conffile}" echo "};" >> "${conffile}" else [ "$ip_mode" == "prefix" ] && { echo "interface $ifname {" > "${conffile}" [ "$ip_config" == "dhcpv6" ] && echo -e "\tsend ia-na $id;" >> "${conffile}" echo -e "\tsend ia-pd $id2;" >> "${conffile}" [ "$dns_mode" == "dynamic" ] && echo -e "\trequest domain-name-servers;" >> "${conffile}" echo -e "\tscript \"$dhcp6cscript\";" >> "${conffile}" echo -e "};\n" >> "${conffile}" echo -e "id-assoc na $id {};\n" >> "${conffile}" echo "id-assoc pd $id2 {" >> "${conffile}" echo -e "\tprefix-interface $lanif {" >> "${conffile}" echo -e "\t\tsla-id 1;" >> "${conffile}" echo -e "\t};" >> "${conffile}" echo "};" >> "${conffile}" } [ "$ip_mode" == "non_temp" ] && { echo "interface $ifname {" > "${conffile}" [ "$ip_config" == "dhcpv6" ] && echo -e "\tsend ia-na $id;" >> "${conffile}" if [ "$dns_mode" == "dynamic" ]; then echo -e "\trequest domain-name-servers;" >> "${conffile}" if [ "$ip_config" == "slaac" ]; then echo -e "\tinformation-only;" >> "${conffile}" fi fi echo -e "\tscript \"$dhcp6cscript\";" >> "${conffile}" echo "};" >> "${conffile}" echo "id-assoc na $id {};" >> "${conffile}" } fi } dhcp6c_write_duid() { local client_device="$2" local mac="${1:-$(ifconfig "$client_device" | sed -ne 's/[[:space:]]*$//; s/.*HWaddr //p')}" local pat="[0-9A-F][0-9A-F]" case "$mac" in # exactly 6 octets -> assume type 3 (DUID-LL - RFC3315, 9.4) $pat:$pat:$pat:$pat:$pat:$pat) local oIFS="$IFS"; IFS=":"; set -- $mac; IFS="$oIFS" # low endian if [ "$(printf \\1 | hexdump -n1 -ve '8/2 "" "%04x" ""')" = "0001" ]; then printf \\x0a\\x00 # big endian else printf \\x00\\x0a fi printf \\x00\\x03\\x00\\x06\\x$1\\x$2\\x$3\\x$4\\x$5\\x$6 logger -t dhcp6c "Using MAC address DUID 00:03:00:06:$1:$2:$3:$4:$5:$6" ;; # at least 7 octets -> could be type 1 or type 2 $pat:$pat:$pat:$pat:$pat:$pat:*) local len_id=":$(echo "$mac" | sed -e 's/[^:]//g')" local len_hi=$(printf "%02x" $((${#len_id} / 0xFF)) ) local len_lo=$(printf "%02x" $((${#len_id} % 0xFF)) ) # low endian if [ "$(printf \\1 | hexdump -n1 -ve '8/2 "" "%04x" ""')" = "0001" ]; then printf \\x$len_lo\\x$len_hi # big endian else printf \\x$len_hi\\x$len_lo fi printf $(echo "$mac" | sed -e 's/^/\\x/; s/:/\\x/g') logger -t dhcp6c "Using user provided DUID $mac" ;; *) logger -t dhcp6c "Unable to derive DUID from interface '$client_device' and no valid user DUID given" ;; esac } config_load /etc/config/network config_get ip_config wan ip_config config_get ipv6_mode internet ipv6_mode config_get dnsv6_mode internet dnsv6_mode config_get ip6addr wan ip6addr config_get lanif wan lanif config_get ipv4 wan ipv4 config_get dhcp_ifname wan ifname config_get iptv_type wan type config_get user_duid basic duid ppp_up="/tmp/pppv6/ppp_up" #rm -rf /tmp/pppv6 echo ppp share up: $IPREMOTE : $LLREMOTE > /dev/console [ -n "$LLREMOTE" ] || exit 1 echo ip_config: $ip_config > /dev/console if [ "$ip_config" == "specified" ]; then [ -n "$LLREMOTE" ] && { proto_init_update "$IFNAME" 1 1 proto_set_keep 1 [ -n "$PPP_IPPARAM" ] && { [ -n "$LLLOCAL" ] && proto_add_ipv6_address "$LLLOCAL" 64 [ -n "$ip6addr" ] && { ip -6 addr add "$ip6addr/64" dev "$IFNAME" proto_add_ipv6_address "$ip6addr" 64 } [ -n "$LLREMOTE" ] && proto_add_ipv6_route "::" 0 "$LLREMOTE" [ -n "$DNS1" -a "$ipv4" == "1" ] && proto_add_dns_server "$DNS1" [ -n "$DNS2" -a "$DNS1" != "$DNS2" -a "$ipv4" == "1" ] && proto_add_dns_server "$DNS2" } proto_send_update "$PPP_IPPARAM" } else [ -n "$PPP_IPPARAM" -a -n "$LLREMOTE" ] && { mkdir -p /tmp/pppv6 [ -n "$DNS1" -a "$ipv4" == "1" ] && echo "$DNS1" >> "$ppp_up" || echo "none" >> "$ppp_up" [ -n "$DNS2" -a "$DNS1" != "$DNS2" -a "$ipv4" == "1" ] && echo "$DNS2" >> "$ppp_up" || echo "none" >> "$ppp_up" [ -n "$LLLOCAL" ] && echo "$LLLOCAL" >> "$ppp_up" || echo "none" >> "$ppp_up" [ -n "$LLREMOTE" ] && echo "$LLREMOTE" >> "$ppp_up" || echo "none" >> "$ppp_up" } fi [ -n "$LLREMOTE" ] && { local mbit=-1 local count=15 if [ $ip_config == "slaac" -o $ip_config == "auto" ]; then echo "1" > /proc/sys/net/ipv6/conf/$IFNAME/accept_ra_pinfo else echo "0" > /proc/sys/net/ipv6/conf/$IFNAME/accept_ra_pinfo fi echo "-1" > /proc/sys/net/ipv6/conf/$IFNAME/ndisc_mbit # reset the mbit value to -1 echo "2" > /proc/sys/net/ipv6/conf/$IFNAME/accept_ra echo "1" > /proc/sys/net/ipv6/conf/$IFNAME/sendrs echo send RS!!! > /dev/console # [ "$ip_config" == "auto" ] && { # proto_dhcp6c_create_conffile "non_temp" "$dnsv6_mode" "$IFNAME" "$lanif" "$ip_config" # /usr/sbin/dhcp6c -f -o -p "$dhcp6cpid" -c "$conffile" -I "$dhcp_ifname" -t "$PPP_IPPARAM" "$IFNAME" # echo send Solicit and Request!!! > /dev/console # } #[ "$ip_config" = "auto" -o "$ip_config" = "slaac" ] && { # wait for RA echo mbit begin:$mbit > /dev/console mbit=`cat /proc/sys/net/ipv6/conf/$IFNAME/ndisc_mbit` while [ $count -ne 0 -a $mbit -eq -1 -a "$ip_config" != "dhcpv6" -a "$ip_config" != "non_address" ]; do echo "1" > /proc/sys/net/ipv6/conf/$IFNAME/sendrs echo mbit:$mbit > /dev/console sleep 1 mbit=`cat /proc/sys/net/ipv6/conf/$IFNAME/ndisc_mbit` let "count=count - 1" echo mbit:$mbit > /dev/console done if [ $mbit -eq -1 -a "$ip_config" != "dhcpv6" -a "$ip_config" != "non_address" ]; then sleep 3 proto_setup_failed "$PPP_IPPARAM" return fi #} [ "$ip_config" = "auto" ] && { # if timeout or mbit != 0, restart if [ $mbit -eq 0 ]; then ip_config="slaac" elif [ $mbit -eq 1 ]; then ip_config="dhcpv6" else sleep 3 proto_setup_failed "$PPP_IPPARAM" return fi } [ "$ip_config" == "dhcpv6" ] && { ip_config="dhcpv6" } [ "$ip_config" == "slaac" ] && { if [ $mbit -eq 1 ]; then sleep 3 proto_setup_failed "$PPP_IPPARAM" return else ip_config="slaac" # only set slaac address when do'not set slaac address in pppshare-dhcp6c.script if [ "$ipv6_mode" == "non_temp" ]; then proto_init_update "$IFNAME" 1 1 proto_set_keep 1 while read line do [ $IFNAME != ${line##* } ] && continue [ "fe80" = ${line:0:4} ] && continue element=${line:0:32} ip6addr=${element:0:4}:${element:4:4}:${element:8:4}:${element:12:4} new_ip6addr=$ip6addr:${element:16:4}:${element:20:4}:${element:24:4}:${element:28:4} done </proc/net/if_inet6 if [ -n "$new_ip6addr" ]; then [ ! -f "/tmp/slaac_addr" ] && echo $new_ip6addr > /tmp/slaac_addr local prefix=$(uci get network.lanv6.prefix) [ -n "$prefix" ] && { local new_64_ip6prefix=$(lua /lib/netifd/get_64_prefix.lua $prefix) local new_64_ip6addr_prefix=$(lua /lib/netifd/get_64_prefix.lua $new_ip6addr) if [ "$new_64_ip6addr_prefix" == "$new_64_ip6prefix" ]; then proto_add_ipv6_address "$new_ip6addr" "128" echo "The prefixes of wan interface and lan interface are same!" > /dev/console else proto_add_ipv6_address "$new_ip6addr" "64" fi } if [ "$dns_mode" == "dynamic" ]; then rdnss1=`cat /proc/sys/net/ipv6/conf/$IFNAME/rdnss1` rdnss2=`cat /proc/sys/net/ipv6/conf/$IFNAME/rdnss2` [ -n "$rdnss1" ] && [ -z "$(cat $DEFAULT_DNS_FILE |grep $rdnss1$)" ] && { proto_add_dns_server "$rdnss1" echo DNS1 is : $rdnss1! > /dev/console } [ -n "$rdnss1" -a -n "$rdnss2" -a "$rdnss1" != "$rdnss2" ] && [ -z "$(cat $DEFAULT_DNS_FILE |grep $rdnss2$)" ] && { proto_add_dns_server "$rdnss2" echo DNS2 is : $rdnss2! > /dev/console } fi proto_send_update "internet" fi fi echo "* * * * * sh /lib/netifd/dhcp6c_slaac.sh &" > /tmp/slaac_cron crontab -l | grep -v "/lib/netifd/dhcp6c_slaac.sh" | cat - "/tmp/slaac_cron" | crontab - rm -f /tmp/slaac_cron fi } proto_dhcp6c_create_conffile "$ipv6_mode" "$dnsv6_mode" "$IFNAME" "$lanif" "$ip_config" #local duid_file="/var/dhcp6c_duid" #dhcp6c_write_duid "$user_duid" "$dhcp_ifname" > $duid_file echo ppp:$PPP_IPPARAM $IFNAME > /dev/console if [ "$ip_config" == "dhcpv6" -o "$ipv6_mode" == "prefix" -o "$dnsv6_mode" == "dynamic" ]; then if [ "$iptv_type" == "bridge" ]; then dhcp_ifname=br-wan fi /usr/sbin/dhcp6c -f -p "$dhcp6cpid" -c "$conffile" -I "$dhcp_ifname" -t "$PPP_IPPARAM" "$IFNAME" & fi } [ -d /etc/ppp/ip-up.d -a -n "$LLREMOTE" ] && { for SCRIPT in /etc/ppp/ip-up.d/* do [ -x "$SCRIPT" ] && "$SCRIPT" "$@" done } 分析一下脚本逻辑和注释掉的这5行起什么作用
最新发布
12-04
#!/bin/sh RUN_ONCE_FILE=/var/run/upnpc_running RUN_ONCE_FILE_RESTART=/var/run/upnpc_running_restart RUN_ONCE_FILE_STOP=/var/run/upnpc_running_stop if [ -e $RUN_ONCE_FILE ]; then exit 0 fi touch $RUN_ONCE_FILE . /lib/functions.sh . /usr/share/libubox/jshn.sh __network_ipaddr() { local __var="$1" local __family="$2" local __prefix="${3:-0}" local __tmp="$(ubus -t 2 call network wan_status 2>/dev/null)" json_load "${__tmp:-{}}" json_get_type __tmp "ipv${__family}_address" if [ "$__tmp" = array ]; then json_select "ipv${__family}_address" json_get_type __tmp 1 if [ "$__tmp" = object ]; then json_select 1 json_get_var $__var address [ $__prefix -gt 0 ] && { json_get_var __tmp mask eval "export -- \"$__var=\${$__var}/$__tmp\"" } return 0 fi fi return 1 } # IP_ADDR=$(echo $(ifconfig) |cut -d ' ' -f7|cut -d ':' -f2) # IP_ADDR=$(cat /tmp/udhcpc/dhcpip) # network_get_ipaddr() { __network_ipaddr $1 4 0; } BIND_STATUS="" PUB_IP="" COMM_STATUS="" IP_ADDR="" COMPARE_RESULT=0 DELETE_STRING="" ADD_STRING="" # random method RANDOM_INDEX="" RANDOM_MIN=10000 RANDOM_MAX=30000 upnpc_mode=$(uci_get "upnpc" "upnpc_info" "mode") upnpc_enabled=$(uci_get "upnpc" "upnpc_info" "enabled") uhttpd_inner_port=$(uci_get "uhttpd" "main" "listen_https" "443") #vhttpd_inner_port=$(uci_get "cet" "vhttpd" "port" "8080") tp_live_inner_port="19443" tp_vod_inner_port="18443" tp_speaker_inner_port="17443" rtsp_inner_port=$(uci_get "cet" "rtsp" "port" "554") onvif_service_inner_port="2020" uhttpd_status=$(uci_get "upnpc" "uhttpd" "status") uhttpd_ext_port=$(uci_get "upnpc" "uhttpd" "ext_port") uhttpd_proto=$(uci_get "upnpc" "uhttpd" "proto") uhttpd_desc=$(uci_get "upnpc" "uhttpd" "desc") uhttpd_flag=1 uhttpd_mapping=0 rtsp_status=$(uci_get "upnpc" "rtsp" "status") rtsp_ext_port=$(uci_get "upnpc" "rtsp" "ext_port") rtsp_proto=$(uci_get "upnpc" "rtsp" "proto") rtsp_desc=$(uci_get "upnpc" "rtsp" "desc") rtsp_flag=2 rtsp_mapping=0 onvif_service_status=$(uci_get "upnpc" "onvif_service" "status") onvif_service_ext_port=$(uci_get "upnpc" "onvif_service" "ext_port") onvif_service_proto=$(uci_get "upnpc" "onvif_service" "proto") onvif_service_desc=$(uci_get "upnpc" "onvif_service" "desc") onvif_service_flag=4 onvif_service_mapping=0 tp_live_status=$(uci_get "upnpc" "tp_live" "status") tp_live_ext_port=$(uci_get "upnpc" "tp_live" "ext_port") tp_live_proto=$(uci_get "upnpc" "tp_live" "proto") tp_live_desc=$(uci_get "upnpc" "tp_live" "desc") tp_live_flag=8 tp_live_mapping=0 tp_vod_status=$(uci_get "upnpc" "tp_vod" "status") tp_vod_ext_port=$(uci_get "upnpc" "tp_vod" "ext_port") tp_vod_proto=$(uci_get "upnpc" "tp_vod" "proto") tp_vod_desc=$(uci_get "upnpc" "tp_vod" "desc") tp_vod_flag=16 tp_vod_mapping=0 tp_speaker_status=$(uci_get "upnpc" "tp_speaker" "status") tp_speaker_ext_port=$(uci_get "upnpc" "tp_speaker" "ext_port") tp_speaker_proto=$(uci_get "upnpc" "tp_speaker" "proto") tp_speaker_desc=$(uci_get "upnpc" "tp_speaker" "desc") tp_speaker_flag=32 tp_speaker_mapping=0 upnpc_get_mapping() { local compare_times=0 # we will try three times at most to get port mapping while [ "$compare_times" -lt 3 ] do upnpc -l > "/tmp/upnpc_output" if [ -s "/tmp/upnpc_output" ] then break; else let compare_times=$compare_times+1 sleep 1 fi done } upnpc_update_comm() { local port_status=$1 local secname=$2 local port=$3 # check status local config_status local config_ext_port local config_comm_status eval config_get config_status "${secname}" status eval config_get config_ext_port "${secname}" ext_port eval config_get config_comm_status "${secname}" comm_status if [ $config_status == $port_status ] then if [ -z $port ] then return 0 elif [ $config_ext_port == $port ] then return 0 fi fi if [ $port_status == "on" ] then if [ $PUB_IP == "null" ] then if [ $config_comm_status != "failed" ] then uci set upnpc."${secname}".comm_status='failed' timestamp=`date +%s` uci set upnpc."${secname}".timestamp=$timestamp fi else if [ $config_comm_status != "unknown" ] then uci set upnpc."${secname}".comm_status='unknown' timestamp=`date +%s` uci set upnpc."${secname}".timestamp=$timestamp fi fi elif [ $port_status == "off" ] then if [ $config_comm_status != "failed" ] then uci set upnpc."${secname}".comm_status='failed' timestamp=`date +%s` uci set upnpc."${secname}".timestamp=$timestamp fi fi } # get config values from the upnpc config file upnpc_get_config() { local secname="$1" config_get "${secname}_status" "$secname" status config_get "${secname}_ext_port" "$secname" ext_port config_get "${secname}_proto" "$secname" proto config_get "${secname}_desc" "$secname" desc } # set config values base on the "upnpc -l" results upnpc_set_config_from_real() { local secname="$1" local file_path="$2" local ip local inner_port local flag=0 while read proto ext_port ip_port desc do # divide ip_port such as 192.168.0.60:8000 into 192.168.0.60 8000 ip=$(echo $ip_port | sed 's/:.*//g') inner_port=$(echo $ip_port | sed 's/.*://g') local config_inner_port local config_proto local config_desc local config_ext_port eval config_inner_port="\${${secname}_inner_port}" eval config_proto="\${${secname}_proto}" eval config_desc="\${${secname}_desc}" eval config_ext_port="\${${secname}_ext_port}" if [ "$IP_ADDR" == "$ip" ] \ && [ "$config_inner_port" == "$inner_port" ] \ && [ "$config_proto" == "$proto" ] \ && [ "$config_desc" == "$desc" ]; then if [ "manual" == "$upnpc_mode" ] then # upnp works in manual mode # we need to keep user`s config to do port mapping again uci set upnpc."$secname".status='on' flag=1 break fi # 处理一下port变化的情况 if [ $secname == "tp_live" ] \ || [ $secname == "tp_vod" ] \ || [ $secname == "tp_speaker" ]; then upnpc_update_comm "on" $secname $ext_port fi uci set upnpc."$secname".status='on' uci set upnpc."$secname".ext_port=$ext_port flag=1 break fi done < "$file_path" if [ $flag == 0 ] then if [ $secname == "tp_live" ] \ || [ $secname == "tp_vod" ] \ || [ $secname == "tp_speaker" ]; then upnpc_update_comm "off" $secname fi uci set upnpc."$secname".status='off' fi } # compare config values with the "upnpc -l" results upnpc_compare_real_config() { local secname="$1" local file_path="$2" local mode="$3" local flag=1 local ip local inner_port while read proto ext_port ip_port desc do # divide ip_port such as 192.168.0.60:8000 into 192.168.0.60 8000 ip=$(echo $ip_port | sed 's/:.*//g') inner_port=$(echo $ip_port | sed 's/.*://g') local config_inner_port local config_ext_port local config_proto local config_desc eval config_inner_port="\${${secname}_inner_port}" eval config_ext_port="\${${secname}_ext_port}" eval config_proto="\${${secname}_proto}" eval config_desc="\${${secname}_desc}" if [ "$IP_ADDR" == "$ip" ] \ && [ "$config_inner_port" == "$inner_port" ] \ && [ "$config_ext_port" == "$ext_port" ] \ && [ "$config_proto" == "$proto" ] \ && [ "$config_desc" == "$desc" ]; then if [ "auto" == "$mode" ] \ && [ "$ext_port" -le "$RANDOM_MIN" ]; then break fi if [ $secname == "tp_live" ] \ || [ $secname == "tp_vod" ] \ || [ $secname == "tp_speaker" ]; then upnpc_update_comm "on" $secname $ext_port fi uci set upnpc."$secname".status='on' flag=0 break else # delete port, if not in config if [ "$config_desc" == "$desc" ] then upnpc -d $ext_port $proto fi fi done < "$file_path" if [ "$flag" == "1" ] then local config_flag eval config_flag="\${${secname}_flag}" let COMPARE_RESULT=$COMPARE_RESULT+$config_flag fi } # decide whether to delete certain port mapping upnpc_decide_delete_string() { local secname="$1" local proto="$2" local ext_port="$3" local ip_port="$4" local desc="$5" local mode="$6" local inner_port # divide ip_port such as 192.168.0.60:8000 into 192.168.0.60 8000 inner_port=$(echo $ip_port | sed 's/.*://g') local config_inner_port local config_ext_port local config_proto local config_desc eval config_inner_port="\${${secname}_inner_port}" eval config_ext_port="\${${secname}_ext_port}" eval config_proto="\${${secname}_proto}" eval config_desc="\${${secname}_desc}" if [ "$config_inner_port" == "$inner_port" ] \ && [ "$config_ext_port" == "$ext_port" ] \ && [ "$config_proto" == "$proto" ] \ && [ "$config_desc" == "$desc" ]; then if [ "auto" == "$mode" ] \ && [ "$ext_port" -lt "$RANDOM_MIN" ]; then # need to delete this port mapping DELETE_FLAG=1 let ${secname}_mapping=0 else # do not need to delete this port mapping DELETE_FLAG=0 # mark that the port mapping of this secname has already been done let ${secname}_mapping=1 fi fi } # build ADD_STRING upnpc_build_add_string() { local secname="$1" local mode="$2" local config_ext_port local config_proto local config_desc local config_inner_port local port_mapping eval config_inner_port="\${${secname}_inner_port}" eval config_ext_port="\${${secname}_ext_port}" eval config_proto="\${${secname}_proto}" eval config_desc="\${${secname}_desc}" eval port_mapping="\${${secname}_mapping}" if [ "0" == "$port_mapping" ] then # the port mapping of this secname has not already been done # we need to do port mapping of this secname, so add to ADD_STRING if [ "auto" != "$mode" ] \ || [ "$config_ext_port" -ge "$RANDOM_MIN" ]; then ADD_STRING=$ADD_STRING" "$config_inner_port" "$config_ext_port" "$config_proto" "$config_desc fi fi } # reconfigure port mapping in auto mode upnpc_auto_reconfigure() { #RANDOM_INDEX=$(lua -e 'math.randomseed(tostring(os.time()):reverse():sub(1, 6)); print(math.random(10000, 30000))') myrand() { if [ -z "$RANDOM" ] ; then SEED=`tr -cd 0-9 </dev/urandom | head -c 8` else SEED=$RANDOM fi RND_NUM=`echo $SEED $1 $2|awk '{srand($1);printf "%d",rand()*10000%($3-$2)+$2}'` echo $RND_NUM } RANDOM_INDEX=$(myrand 20000 30000) local compare_times=0 # we will try three times at most to do port mapping while [ "$compare_times" -lt 3 ] do COMPARE_RESULT=0 config_foreach upnpc_compare_real_config entry /tmp/upnpc_output auto if [ "0" == "$COMPARE_RESULT" ] then # the port mappings have been all successful break else # the port mappings have not been all successful # we need to build ADD_STRING based on COMPARE_RESULT ADD_STRING=$IP_ADDR local flag # randomly set the external port by +1 let flag="$COMPARE_RESULT"\&"$uhttpd_flag" if [ "$flag" -ne "0" ] then uhttpd_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$uhttpd_inner_port" "$uhttpd_ext_port" "$uhttpd_proto" "$uhttpd_desc fi let flag="$COMPARE_RESULT"\&"$rtsp_flag" if [ "$flag" -ne "0" ] then rtsp_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$rtsp_inner_port" "$rtsp_ext_port" "$rtsp_proto" "$rtsp_desc fi let flag="$COMPARE_RESULT"\&"$onvif_service_flag" if [ "$flag" -ne "0" ] then onvif_service_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$onvif_service_inner_port" "$onvif_service_ext_port" "$onvif_service_proto" "$onvif_service_desc fi let flag="$COMPARE_RESULT"\&"$tp_live_flag" if [ "$flag" -ne "0" ] then tp_live_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$tp_live_inner_port" "$tp_live_ext_port" "$tp_live_proto" "$tp_live_desc fi let flag="$COMPARE_RESULT"\&"$tp_vod_flag" if [ "$flag" -ne "0" ] then tp_vod_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$tp_vod_inner_port" "$tp_vod_ext_port" "$tp_vod_proto" "$tp_vod_desc fi let flag="$COMPARE_RESULT"\&"$tp_speaker_flag" if [ "$flag" -ne "0" ] then tp_speaker_ext_port=$RANDOM_INDEX let RANDOM_INDEX=$RANDOM_INDEX+1 ADD_STRING=$ADD_STRING" "$tp_speaker_inner_port" "$tp_speaker_ext_port" "$tp_speaker_proto" "$tp_speaker_desc fi # execute the upnpc comand to do the port mapping # grep the "upnpc -l" results to get only map values that are belonged to current_ip upnpc -a $ADD_STRING \ -l | grep $IP_ADDR > /tmp/upnpc_output let compare_times=$compare_times+1 fi done } # reconfigure port mapping upnpc_reconfigure() { config_load upnpc config_get upnpc_mode upnpc_info mode config_get PUB_IP pub_ip ip IP_ADDR=$(echo $(ifconfig) |cut -d ' ' -f7|cut -d ':' -f2) if [ -e /tmp/upnpc_pre_ip ] then PRE_IP=`cat /tmp/upnpc_pre_ip` else PRE_IP="" fi if [ -z "$IP_ADDR" ] \ && [ -z "$PRE_IP" ]; then # current ip and preview ip are all empty cat /tmp/upnpc_output > /tmp/upnpc_output1 elif [ "$IP_ADDR" == "$PRE_IP" ] \ || [ -z "$PRE_IP" ] then # preview_ip is equal to current_ip # so we do not need to check PRE_IP PRE_IP="" # grep the "upnpc -l" results to get only map values that are belonged to current_ip cat /tmp/upnpc_output | grep "$IP_ADDR" > /tmp/upnpc_output1 elif [ -z "$IP_ADDR" ] then # grep the "upnpc -l" results to get only map values that are belonged to preview_ip cat /tmp/upnpc_output | grep "$PRE_IP" > /tmp/upnpc_output1 else # grep the "upnpc -l" results to get only map values that are belonged to preview_ip and current_ip cat /tmp/upnpc_output | grep -E "$IP_ADDR|$PRE_IP" > /tmp/upnpc_output1 fi # grep the "upnpc -l" results to get only map values that are belonged to preview_ip and current_ip cat /tmp/upnpc_output | grep -E "$IP_ADDR|$PRE_IP" > /tmp/upnpc_output1 config_foreach upnpc_get_config entry local ip while read proto ext_port ip_port desc do # divide ip_port such as 192.168.0.60:8000 into 192.168.0.60 8000 # and get the ip value such as "192.168.0.60" ip=$(echo $ip_port | sed 's/:.*//g') if [ "$IP_ADDR" == "$ip" ] then # this port mapping is belonged to IP_ADDR DELETE_FLAG=1 config_foreach upnpc_decide_delete_string entry $proto $ext_port $ip_port $desc $upnpc_mode if [ "1" == "$DELETE_FLAG" ] then # this port mapping is not useful, delete it # package the DELETE_STRING with the form: ext_port proto DELETE_STRING=$DELETE_STRING" "$ext_port" "$proto fi fi if [ "$PRE_IP" == "$ip" ] then # this port mapping is belonged to PRE_IP, delete it # package the DELETE_STRING with the form: ext_port proto DELETE_STRING=$DELETE_STRING" "$ext_port" "$proto fi done < "/tmp/upnpc_output1" # begin to build ADD_STRING ADD_STRING=$IP_ADDR config_foreach upnpc_build_add_string entry $upnpc_mode # begin to build upnpc_string local upnpc_string if [ -n "$DELETE_STRING" ] then # DELETE_STRING is not empty, add to upnpc_string upnpc_string=$upnpc_string" -d "$DELETE_STRING fi if [ "$IP_ADDR" != "$ADD_STRING" ] then # ADD_STRING is not default, add to upnpc_string upnpc_string=$upnpc_string" -a "$ADD_STRING fi # add -l to upnpc_string to list all the port mappings upnpc_string=$upnpc_string" -l" # execute the upnpc comand to do the port mapping # grep the "upnpc -l" results to get only map values that are belonged to current_ip upnpc $upnpc_string | grep $IP_ADDR > /tmp/upnpc_output # save current ip into /tmp/upnpc_pre_ip echo $IP_ADDR > /tmp/upnpc_pre_ip if [ "auto" == "$upnpc_mode" ] then # upnp works in auto mode, if failed # we need to use randomly port to do port mapping again upnpc_auto_reconfigure fi # set upnpc config file based on the "upnpc -l" results config_foreach upnpc_set_config_from_real entry /tmp/upnpc_output uci commit upnpc rm -f "/tmp/upnpc_output1" rm -f "/tmp/upnpc_output" } # the following function will be called outside asynchronously # so we need to add lock to prevent them from being called at the same time # maintain port mapping upnpc_maintain() { config_load cloud_brd config_get BIND_STATUS bind status config_load upnpc config_get upnpc_enabled upnpc_info enabled config_get upnpc_mode upnpc_info mode config_get PUB_IP pub_ip ip timestamp=`date +%s` echo $timestamp >/dev/console if [ "$BIND_STATUS" == "1" ] then if [ "$upnpc_enabled" == "on" ] then IP_ADDR=$(echo $(ifconfig) |cut -d ' ' -f7|cut -d ':' -f2) if [ -n "$IP_ADDR" ] then lock "/var/run/upnpc" #upnpc -l > "/tmp/upnpc_output" upnpc_get_mapping # grep the "upnpc -l" results to get only map values that are belonged to current_ip cat /tmp/upnpc_output | grep $IP_ADDR > /tmp/upnpc_output1 COMPARE_RESULT=0 config_foreach upnpc_compare_real_config entry /tmp/upnpc_output1 $upnpc_mode if [ $COMPARE_RESULT == 0 ] then uci commit upnpc # do not need to maintain # save current ip into /tmp/upnpc_pre_ip echo $IP_ADDR > /tmp/upnpc_pre_ip rm -f "/tmp/upnpc_output1" rm -f "/tmp/upnpc_output" else # need to maintain, reconfigure upnpc upnpc_reconfigure fi lock -u "/var/run/upnpc" fi fi else upnpc_stop fi } # stop port mapping upnpc_stop() { if [ -e $RUN_ONCE_FILE_STOP ]; then exit 0 fi touch $RUN_ONCE_FILE_STOP lock "/var/run/upnpc" config_load upnpc config_get PUB_IP pub_ip ip # network_get_ipaddr IP_ADDR IP_ADDR=$(echo $(ifconfig) |cut -d ' ' -f7|cut -d ':' -f2) local DELETE_STRING local PRE_IP local ip if [ -e /tmp/upnpc_pre_ip ] then PRE_IP=`cat /tmp/upnpc_pre_ip` else PRE_IP="" fi # grep the "upnpc -l" results to get only map values that are belonged to preview_ip and current_ip upnpc -l | grep -E "$IP_ADDR|$PRE_IP" > "/tmp/upnpc_output" while read proto ext_port ip_port desc do # divide ip_port such as 192.168.0.60:8000 into 192.168.0.60 8000 # and get the ip value such as "192.168.0.60" ip=$(echo $ip_port | sed 's/:.*//g') if [ "$ip" == "$IP_ADDR" ] \ || [ "$ip" == "$PRE_IP" ]; then DELETE_STRING=$DELETE_STRING" "$ext_port" "$proto fi done < "/tmp/upnpc_output" if [ -n "$DELETE_STRING" ] then upnpc -d $DELETE_STRING \ -l | grep $IP_ADDR > "/tmp/upnpc_output" fi config_foreach upnpc_set_config_from_real entry /tmp/upnpc_output uci commit upnpc rm -f /tmp/upnpc_output lock -u "/var/run/upnpc" rm $RUN_ONCE_FILE_STOP } # restart port mapping upnpc_restart() { if [ -e $RUN_ONCE_FILE_RESTART ]; then exit 0 fi touch $RUN_ONCE_FILE_RESTART config_load cloud_brd config_get BIND_STATUS bind status config_load upnpc config_get upnpc_enabled upnpc_info enabled if [ "$BIND_STATUS" == "1" ] then if [ "$upnpc_enabled" == "on" ] then lock "/var/run/upnpc" upnpc -l > "/tmp/upnpc_output" upnpc_reconfigure lock -u "/var/run/upnpc" else upnpc_stop fi else upnpc_stop fi rm $RUN_ONCE_FILE_RESTART } case "$1" in maintain) upnpc_maintain ;; esac rm $RUN_ONCE_FILE 运行这个脚本有什么作用?
09-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值