Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision Next revisionBoth sides next revision | ||
| zh:docs:guide-user:additional-software:saving_space [2019/03/16 21:26] – created hgao | zh:docs:guide-user:additional-software:saving_space [2020/01/05 04:21] – [Build image for devices with only 4MB flash] lujimmy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove | + | ====== 节省固件空间 ====== |
| + | ===== 移除软件包 ===== | ||
| + | 对于仅有4M闪存的设备,闪存空间是稀有的。您在使用[[docs: | ||
| + | ^ 指令 | ||
| + | |remove | ||
| + | |remove IPv6 |'' | ||
| + | |remove dhcp server | ||
| + | |remove | ||
| + | |remove opkg |'' | ||
| + | |add LuCI minimal | ||
| + | |add zram¹ | ||
| - | ====== 节省固件空间占用 ====== | + | ¹ 备注: 4M闪存的设备请不要使用 zram-swap,因为这会// |
| - | ===== 去除以下packages | + | ==== 为仅有4M闪存的设备构建镜像 |
| - | 自己编译镜像以减少空间占用(e.g. with the [[docs: | + | |
| - | In order to completely remove IPv6 support and related packages you also need to ask the imagebuilder to do so by also passing this option to the make command: " | + | |
| - | ^ Action | + | **镜像构建命令行示例**\\ |
| - | | remove pppoe | + | **备注:** 您需要根据设备修改下方命令行中的'' |
| - | | remove IPv6 | '' | + | |
| - | | remove dhcp server | + | |
| - | | remove | + | |
| - | | remove opkg | '' | + | |
| - | | add LuCI minimal | + | |
| - | | add zram¹ | + | |
| - | ¹ Note: Do not use zram-swap for 4MB flash devices as it // | + | ^ 是否集成LuCI ^ 作用 |
| - | + | | 集成LuCI | |
| - | + | ||
| - | ==== 为4MB flash的设备编译镜像 ==== | + | |
| - | + | ||
| - | **Example image builder command line**\\ | + | |
| - | **Note:** In the command line shown below, you need to adjust '' | + | |
| - | + | ||
| - | ^ LuCI ^ Action | + | |
| - | | with LuCI | - remove | + | |
| PACKAGES=" | PACKAGES=" | ||
| -ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' | -ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only"'' | ||
| - | | without | + | | 不集成LuCI |
| - | + | 相关资源: | |
| - | Resources: | + | |
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| - | + | * [[https:// | |
| - | + | ==== Build image for devices with only 16/32MB RAM ==== | |
| - | ==== 为16/32MB RAM的设备编译镜像 | + | |
| If the device has 16MB or less of RAM, then it should only be used as Internal AP (e.g. to extend Wi-Fi coverage).\\ | If the device has 16MB or less of RAM, then it should only be used as Internal AP (e.g. to extend Wi-Fi coverage).\\ | ||
| Line 60: | Line 52: | ||
| This option compiles the kernel modules inside the kernel, you can either pick what modules you think can be integrated and make them built-in by pressing " | This option compiles the kernel modules inside the kernel, you can either pick what modules you think can be integrated and make them built-in by pressing " | ||
| - | < | + | |
| + | < | ||
| + | sed -i -e "s/=m/=y/g" | ||
| + | </ | ||
| This will work only if your device' | This will work only if your device' | ||
| Line 78: | Line 73: | ||
| //Some hardware (it’s rare but not unheard of) can only be reset by unloading and reloading the module that controls it. Otherwise, you have to reboot the box. If you build all of your drivers in, then rebooting is all you have.// | //Some hardware (it’s rare but not unheard of) can only be reset by unloading and reloading the module that controls it. Otherwise, you have to reboot the box. If you build all of your drivers in, then rebooting is all you have.// | ||
| - | ===== 修改编译配置变量 | + | ===== Modifying build configuration variables |
| You can also save space by changing configuration variables using '' | You can also save space by changing configuration variables using '' | ||
| Line 91: | Line 86: | ||
| | CONFIG_KERNEL_DEBUG_INFO | Global build settings / Kernel build options / Compile the kernel with debug information | | | CONFIG_KERNEL_DEBUG_INFO | Global build settings / Kernel build options / Compile the kernel with debug information | | ||
| | CONFIG_KERNEL_ELF_CORE | | CONFIG_KERNEL_ELF_CORE | ||
| - | | IPV6 | Global build settings / Enable IPv6 support in packages | | + | | CONFIG_IPV6 |
| | CONFIG_KERNEL_MAGIC_SYSRQ | Global build settings / Kernel build options / Compile the kernel with SysRq support | | | CONFIG_KERNEL_MAGIC_SYSRQ | Global build settings / Kernel build options / Compile the kernel with SysRq support | | ||
| | CONFIG_KERNEL_PRINTK_TIME | Global build settings / Kernel build options / Enable printk timestamps | | | CONFIG_KERNEL_PRINTK_TIME | Global build settings / Kernel build options / Enable printk timestamps | | ||
| - | | PACKAGE_MAC80211_DEBUGFS | + | | CONFIG_PACKAGE_MAC80211_DEBUGFS |
| - | | PACKAGE_MAC80211_MESH | + | | CONFIG_PACKAGE_MAC80211_MESH |
| Options that can be enabled to save space. | Options that can be enabled to save space. | ||
| Line 128: | Line 123: | ||
| - | ===== 将LuCI的图标替换成空icon | + | ===== Replace |
| The icons in LuCI are not strictly necessary and replacing them with a blank image will save about 15 KB. This bash script will take an OpenWrt git path as parameter and replace the images with a blank using the [[docs: | The icons in LuCI are not strictly necessary and replacing them with a blank image will save about 15 KB. This bash script will take an OpenWrt git path as parameter and replace the images with a blank using the [[docs: | ||
| Line 150: | Line 145: | ||
| </ | </ | ||
| </ | </ | ||
| - | |||