环境:
openwrt18.06 linux4.14.123;MT7688, lighttpd1.4.54
具体步骤如下:
1. 更新及安装feeds:
./scrips/feeds update -a
...........
./scrips/feeds install -a
2. 由于我当前feeds更新的lighttpd是1.4.48版本的,而我要移植的是lighttpd1.4.54,为了从零开始移植搭建环境,所以选择了手动下载编译的方式,为了防止和openwrt自带的lighttpd冲突,需要先删除package/feeds/package目录下的lighttpd文件!注意先保存该目录下的主makefile文件,以后用的到。
3. 在openwrt根目录下的package目录下建立lighttpd1.4.54文件夹,在lighttpd1.4.54文件夹下再建立个空Makefile文件,和src文件夹,将下载的lighttpd1.4.54源文件全部拷贝到src文件夹下,然后修改之前保存的makefile到我们刚才新建的Makefile文件


# # Copyright (C) 2006-2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk PKG_NAME:=lighttpd PKG_VERSION:=1.4.54 PKG_RELEASE:=1.4.54 PKG_SOURCE:= PKG_SOURCE_URL:= PKG_MD5SUM:= PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) #PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz #PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x #PKG_HASH:=0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36 PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 REBUILD_MODULES=authn_gssapi authn_ldap authn_mysql cml magnet mysql_vhost trigger_b4_dl webdav PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL $(patsubst %,CONFIG_PACKAGE_lighttpd-mod-%,$(REBUILD_MODULES)) include $(INCLUDE_DIR)/package.mk define Package/lighttpd/Default SECTION:=Application CATEGORY:=Extra packages URL:=http://www.lighttpd.net/ MAINTAINER:=sean endef define Package/lighttpd $(call Package/lighttpd/Default) MENU:=1 DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread TITLE:=A flexible and lightweight web server endef define Package/lighttpd/config config LIGHTTPD_SSL bool "SSL support" depends on PACKAGE_lighttpd default y help Implements SSL support in lighttpd (using libopenssl). This option is required if you enable the SSL engine in your lighttpd confguration file. endef BASE_MODULES:=dirlisting indexfile staticfile CONFIGURE_ARGS+= \ --libdir=/usr/lib/lighttpd \ --sysconfdir=/etc/lighttpd \ --enable-shared \ --enable-static \ --disable-rpath \ --without-attr \ --without-bzip2 \ --without-fam \ --with-pcre \ --without-valgrind \ $(call autoconf_bool,CONFIG_IPV6,ipv6) CONFIGURE_VARS+= \ PCRE_LIB="-lpcre" \ ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),) CONFIGURE_ARGS+= \ --with-openssl="$(STAGING_DIR)/usr" BASE_MODULES+= openssl else CONFIGURE_ARGS+= \ --without-openssl endif ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),) CONFIGURE_ARGS+= --with-krb5 else CONFIGURE_ARGS+= --without-krb5 endif ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_ldap),) CONFIGURE_ARGS+= --with-ldap else CONFIGURE_ARGS+= --without-ldap endif ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-authn_mysql),) CONFIGURE_ARGS+= --with-mysql