https://www.cnblogs.com/yylei/p/12330340.html
https://www.moewah.com/archives/4003.html

修改默认登录密码
diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadow
index 4b4154f21f..6e6b6196a5 100644
--- a/package/base-files/files/etc/shadow
+++ b/package/base-files/files/etc/shadow
@@ -1,4 +1,4 @@
-root::0:0:99999:7:::
+root:$1$9mRyN/xp$hNAaaasS12aaYN7qimco3/:0:0:99999:7:::
 daemon:*:0:0:99999:7:::
 ftp:*:0:0:99999:7:::
 network:*:0:0:99999:7:::
修改默认LAN IP地址
sed -i 's/192.168.1.1/192.168.199.1/g' package/base-files/files/bin/config_generate
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 5acecfb665..9371c3a214 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -161,7 +161,7 @@ generate_network() {
                static)
                        local ipad
                        case "$1" in
-                               lan) ipad=${ipaddr:-"192.168.1.1"} ;;
+                               lan) ipad=${ipaddr:-"10.0.0.1"} ;;
                                *) ipad=${ipaddr:-"192.168.$((addr_offset++)).1"} ;;
修改固件软件源
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 8a1ddf96f5..1de6f9316c 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -199,7 +199,8 @@ define Package/base-files/install
        $(if $(CONFIG_CLEAN_IPKG),, \
                mkdir -p $(1)/etc/opkg; \
                $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
-               $(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
+               $(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf; \
+               $(SED) 's_downloads.openwrt.org_mirrors.tuna.tsinghua.edu.cn/openwrt_' $(1)/etc/opkg/distfeeds.conf)
        $(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
                rm -f $(1)/sbin/pkg_check)
修改固件时区
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 596fcf41fa..5acecfb665 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -302,7 +302,8 @@ generate_static_system() {
                delete system.@system[0]
                add system system
                set system.@system[-1].hostname='OpenWrt'
-               set system.@system[-1].timezone='UTC'
+               set system.@system[-1].timezone='CST-8'
+               set system.@system[-1].zonename='Asia/Shanghai'
                set system.@system[-1].ttylogin='0'
                set system.@system[-1].log_size='64'
                set system.@system[-1].urandom_seed='0'
修改开启登录验证功能
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 9371c3a214..dbfd73abbc 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -304,7 +304,7 @@ generate_static_system() {
                set system.@system[-1].hostname='OpenWrt'
                set system.@system[-1].timezone='CST-8'
                set system.@system[-1].zonename='Asia/Shanghai'
-               set system.@system[-1].ttylogin='0'
+               set system.@system[-1].ttylogin='1'
                set system.@system[-1].log_size='64'
                set system.@system[-1].urandom_seed='0'
调整固件大小

make menuconfig

| |*** Image Options ***| |  
  | |(128) Kernel partition size (in MB)| |  
  | |(1024) Root filesystem partition size (in MB)| |

在config配置文件中对应修改:

CONFIG_TARGET_KERNEL_PARTSIZE=128
CONFIG_TARGET_ROOTFS_PARTSIZE=1024
                    https://www.cnblogs.com/yylei/p/12330340.htmlhttps://www.moewah.com/archives/4003.html修改默认登录密码diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadowindex 4b4154f21f..6e6b6196a5 100644--- a/package/base-files/files/etc/s
				
当学会了搭建openwrt编译环境,肯定是想编译有一些自己想要的东西固件,要知道官方给的固件是很简洁的,不仅没有web界面(Luci-web),连无线默认都不是开启的,这也太不像个无线路由器的样子了。 我们会使用make kernelconfig和make menuconfig这种方法来自定义软件包,不过,这样编译出来的固件仍然不具个性化,因为,无线仍然没有开启,像SSID、路由主机名、默认
主机为 ubuntu 14 x64 硬件: 优酷土豆宝 cpuMT7620A,内存128M,flash 32M 有2个源,用哪个也可以 git clone https://github.com/openwrt/openwrt.git git clone https://git.openwrt.org/openwrt/openwrt.git 安装的插件 gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip, gawk,
最近在研究Openwrt,有的时候因为批量配置方便需要,想把一个设置好的路由器的Firmware备份下来。不过恢复到同型号的另一个路由器上会出现路由器配置页面里网络-无线里面变成两个无线网卡的现象,我研究了一段时间,发现大家的解决方案都是重新编译固件。不过我现在手头的电脑比较老旧,开不了虚拟机,无法重新编译。 首先查看分区 cat /proc/mtd mtd0: 00020000 00010