diff options
89 files changed, 1045 insertions, 698 deletions
diff --git a/.gitignore b/.gitignore index 3ac956900..68214f10b 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ /target/packages/Config.in /target/config/Config.in.system.default /target/config/Config.in.system +/target/config/Config.in.scripts /target/config/Config.in.native /target/config/Config.in.arch /target/config/Config.in.prereq @@ -32,11 +32,6 @@ config ADK_CHOOSE_TARGET_SYSTEM source "target/config/Config.in" -menu "Runtime configuration" -depends on !ADK_CHOOSE_TARGET_ARCH && !ADK_CHOOSE_TARGET_SYSTEM -source "target/config/Config.in.runtime" -endmenu - menu "Package collection" depends on !ADK_CHOOSE_TARGET_ARCH && !ADK_CHOOSE_TARGET_SYSTEM source "target/packages/Config.in" @@ -89,6 +84,11 @@ source "package/Config.in.auto.global" source "package/Config.in.auto" endmenu +menu "Runtime configuration" +depends on !ADK_CHOOSE_TARGET_ARCH && !ADK_CHOOSE_TARGET_SYSTEM +source "target/config/Config.in.runtime" +endmenu + choice prompt "Kernel Version" depends on ADK_TOOLCHAIN_ONLY @@ -18,7 +18,6 @@ - add grsec kernel patch - microblaze: add cfgfs partition to dts, add partition to spartan dts - evaluate libguestfs for image creation -- port w3m - port msmtp - rutorrent porting - lms perl diff --git a/adk/tools/pkgmaker.c b/adk/tools/pkgmaker.c index 51d31aa70..6997f3def 100644 --- a/adk/tools/pkgmaker.c +++ b/adk/tools/pkgmaker.c @@ -304,13 +304,18 @@ static char *toupperstr(char *string) { int main() { - DIR *pkgdir, *pkglistdir; + DIR *pkgdir, *pkglistdir, *scriptdir; struct dirent *pkgdirp; - FILE *pkg, *cfg, *menuglobal, *section; + struct dirent *scriptdirp; + size_t len; + FILE *pkg, *cfg, *menuglobal, *section, *initscript, *icfg; char hvalue[MAXVALUE]; char buf[MAXPATH]; + char ibuf[MAXPATH]; char tbuf[MAXPATH]; char path[MAXPATH]; + char script[MAXPATH]; + char script2[MAXPATH]; char spath[MAXPATH]; char dir[MAXPATH]; char variable[2*MAXVAR]; @@ -320,9 +325,10 @@ int main() { char *pkg_need_cxx, *pkg_need_java, *pkgname, *sysname, *pkg_debug; char *pkg_libc_depends, *pkg_host_depends, *pkg_system_depends, *pkg_arch_depends, *pkg_flavours, *pkg_flavours_string, *pkg_choices, *pseudo_name; char *packages, *pkg_name_u, *pkgs, *pkg_opts, *pkg_libname; - char *saveptr, *p_ptr, *s_ptr, *pkg_helper; + char *saveptr, *p_ptr, *s_ptr, *pkg_helper, *sname, *sname2; int result; StrMap *pkgmap, *sectionmap; + const char runtime[] = "target/config/Config.in.scripts"; pkg_name = NULL; pkg_descr = NULL; @@ -355,6 +361,7 @@ int main() { s_ptr = NULL; unlink("package/Config.in.auto"); + unlink(runtime); /* open global sectionfile */ menuglobal = fopen("package/Config.in.auto.global", "w"); if (menuglobal == NULL) @@ -410,6 +417,7 @@ int main() { fprintf(cfg, "\t C library header files.\n\n"); fclose(cfg); + /* read Makefile's for all packages */ pkgdir = opendir("package"); while ((pkgdirp = readdir(pkgdir)) != NULL) { @@ -421,6 +429,57 @@ int main() { if (pkg == NULL) continue; + /* runtime configuration */ + if (snprintf(script, MAXPATH, "package/%s/files", pkgdirp->d_name) < 0) + fatal_error("script variable creation failed."); + scriptdir = opendir(script); + if (scriptdir != NULL) { + while ((scriptdirp = readdir(scriptdir)) != NULL) { + /* skip dotfiles */ + if (strncmp(scriptdirp->d_name, ".", 1) > 0) { + len = strlen(scriptdirp->d_name); + if (strlen(".init") > len) + continue; + if (strncmp(scriptdirp->d_name + len - strlen(".init"), ".init", strlen(".init")) == 0) { + if (snprintf(script, MAXPATH, "package/%s/files/%s", pkgdirp->d_name, scriptdirp->d_name) < 0) + fatal_error("script variable creation failed."); + initscript = fopen(script, "r"); + if (initscript == NULL) + continue; + + while (fgets(ibuf, MAXPATH, initscript) != NULL) { + if (strncmp("#PKG", ibuf, 4) == 0) { + sname = strdup(ibuf+5); + sname[strlen(sname)-1] = '\0'; + sname2 = strdup(scriptdirp->d_name); + sname2[strlen(sname2)-5] = '\0'; + icfg = fopen(runtime, "a"); + if (icfg == NULL) + continue; + if (strncmp("busybox", sname, 7) == 0) + fprintf(icfg, "config ADK_RUNTIME_START_%s_%s\n", toupperstr(sname), toupperstr(sname2)); + else + fprintf(icfg, "config ADK_RUNTIME_START_%s\n", toupperstr(sname)); + fprintf(icfg, "\tprompt \"Start %s on boot\"\n", sname2); + fprintf(icfg, "\tboolean\n"); + if (strncmp("busybox", sname, 7) == 0) + fprintf(icfg, "\tdepends on BUSYBOX_%s\n", toupperstr(sname2)); + else + fprintf(icfg, "\tdepends on ADK_PACKAGE_%s\n", toupperstr(sname)); + fprintf(icfg, "\tdepends on ADK_RUNTIME_START_SERVICES\n"); + fprintf(icfg, "\tdefault n\n\n"); + fclose(icfg); + } + continue; + free(sname); + free(sname2); + } + } + } + } + closedir(scriptdir); + } + /* skip manually maintained packages */ if (snprintf(path, MAXPATH, "package/%s/Config.in.manual", pkgdirp->d_name) < 0) fatal_error("can not create path variable."); @@ -621,7 +680,6 @@ int main() { fclose(cfg); free(pkgs); - /* skip packages without binary package output */ if (nobinpkgs == 1) continue; diff --git a/mk/build.mk b/mk/build.mk index af1313206..6dcf88f1a 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -18,6 +18,7 @@ DEFCONFIG= ADK_DEBUG=n \ ADK_LEAVE_ETC_ALONE=n \ ADK_SIMPLE_NETWORK_CONFIG=n \ ADK_USE_CCACHE=n \ + ADK_RUNTIME_START_SERVICES=n \ ADK_PACKAGE_BASE_FILES=y \ ADK_PACKAGE_E2FSCK_STATIC=n \ ADK_PACKAGE_KEXECINIT=n \ @@ -41,8 +42,9 @@ DEFCONFIG= ADK_DEBUG=n \ ADK_PKG_TEST=n \ ADK_PKG_MPDBOX=n \ ADK_PKG_DEVELOPMENT=n \ - ADK_TOOLCHAIN_GCC_USE_SSP=n \ - ADK_TOOLCHAIN_GCC_USE_LTO=n \ + ADK_TOOLCHAIN_USE_SSP=n \ + ADK_TOOLCHAIN_USE_LTO=n \ + ADK_TOOLCHAIN_USE_GOLD=n \ BUSYBOX_IFPLUGD=n \ BUSYBOX_EXTRA_COMPAT=n \ BUSYBOX_FEATURE_IFCONFIG_SLIP=n \ diff --git a/mk/package.mk b/mk/package.mk index eba9c446a..c23530e17 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -178,6 +178,9 @@ $$(IDIR_$(1))/CONTROL/control: ${_PATCH_COOKIE} @for file in conffiles preinst postinst prerm postrm; do \ [ ! -f ./files/$(2).$$$$file ] || cp ./files/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \ done +ifeq ($(ADK_RUNTIME_START_$(1)),y) + $(SED) "s#NO#YES#" $$(IDIR_$(1))/CONTROL/postinst +endif ifneq ($(ADK_DEBUG),y) @echo "Package: $$(shell echo $(2) | tr '_' '-')-dbg" > $(WRKDIR)/.$(2)-dbg.control @echo "Section: debug" >> $(WRKDIR)/.$(2)-dbg.control diff --git a/mk/vars.mk b/mk/vars.mk index e804ad5e6..2f2ecc134 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -111,13 +111,19 @@ TARGET_LDFLAGS+= -Wl,--secure-plt endif endif -ifneq ($(ADK_TOOLCHAIN_GCC_USE_SSP),) +ifeq ($(ADK_STATIC),y) +TARGET_CFLAGS+= -static +TARGET_CXXFLAGS+= -static +TARGET_LDFLAGS+= -static +endif + +ifneq ($(ADK_TOOLCHAIN_USE_SSP),) TARGET_CFLAGS+= -fstack-protector TARGET_CXXFLAGS+= -fstack-protector TARGET_LDFLAGS+= -fstack-protector endif -ifneq ($(ADK_TOOLCHAIN_GCC_USE_LTO),) +ifneq ($(ADK_TOOLCHAIN_USE_LTO),) TARGET_CFLAGS+= -flto TARGET_CXXFLAGS+= -flto TARGET_LDFLAGS+= -flto diff --git a/package/avahi/Makefile b/package/avahi/Makefile index bd203e79e..a79afbb20 100644 --- a/package/avahi/Makefile +++ b/package/avahi/Makefile @@ -61,7 +61,7 @@ CONFIGURE_ARGS+= --enable-glib \ --with-avahi-user=avahi \ --with-avahi-group=avahi -ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y) +ifeq ($(ADK_TOOLCHAIN_USE_SSP),y) CONFIGURE_ARGS+= --enable-stack-protector else CONFIGURE_ARGS+= --disable-stack-protector diff --git a/package/busybox/Makefile b/package/busybox/Makefile index fce16fa32..6b07623b0 100644 --- a/package/busybox/Makefile +++ b/package/busybox/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:= busybox PKG_VERSION:= 1.21.1 -PKG_RELEASE:= 5 +PKG_RELEASE:= 6 PKG_MD5SUM:= 795394f83903b5eec6567d51eebb417e PKG_DESCR:= core utilities for embedded systems PKG_SECTION:= base @@ -60,6 +60,10 @@ do-build: do-install: $(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE) $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/ +ifeq ($(BUSYBOX_IFUPDOWN),y) + $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d + $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d +endif ifeq ($(ADK_DEBUG),y) ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \ $(IDIR_BUSYBOX)/bin/busybox diff --git a/package/busybox/config/miscutils/Config.in b/package/busybox/config/miscutils/Config.in index 4c05e5dae..f13267eac 100644 --- a/package/busybox/config/miscutils/Config.in +++ b/package/busybox/config/miscutils/Config.in @@ -281,7 +281,7 @@ config BUSYBOX_CHRT config BUSYBOX_CROND bool "crond" - default y + default n select BUSYBOX_FEATURE_SYSLOG help Crond is a background daemon that parses individual crontab @@ -301,7 +301,7 @@ config BUSYBOX_FEATURE_CROND_D config BUSYBOX_FEATURE_CROND_CALL_SENDMAIL bool "Report command output via email (using sendmail)" - default y + default n depends on BUSYBOX_CROND help Command output will be sent to corresponding user via email. @@ -747,7 +747,7 @@ config BUSYBOX_WALL config BUSYBOX_WATCHDOG bool "watchdog" - default y + default n depends on !BUSYBOX_DISABLE_WATCHDOG select BUSYBOX_PLATFORM_LINUX help diff --git a/package/busybox/config/networking/Config.in b/package/busybox/config/networking/Config.in index e350a1b16..fa5a7cd47 100644 --- a/package/busybox/config/networking/Config.in +++ b/package/busybox/config/networking/Config.in @@ -748,7 +748,7 @@ config BUSYBOX_NSLOOKUP config BUSYBOX_NTPD bool "ntpd" depends on !BUSYBOX_DISABLE_NTPD - default y + default n select BUSYBOX_PLATFORM_LINUX help The NTP client/server daemon. diff --git a/package/busybox/config/networking/udhcp/Config.in b/package/busybox/config/networking/udhcp/Config.in index 6ece73097..e0f20fc49 100644 --- a/package/busybox/config/networking/udhcp/Config.in +++ b/package/busybox/config/networking/udhcp/Config.in @@ -12,7 +12,7 @@ config BUSYBOX_UDHCPC6 config BUSYBOX_UDHCPD bool "udhcp server (udhcpd)" - default y + default n select BUSYBOX_PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, diff --git a/package/busybox/files/busybox.postinst b/package/busybox/files/busybox.postinst index c71a536ce..d403ff481 100644 --- a/package/busybox/files/busybox.postinst +++ b/package/busybox/files/busybox.postinst @@ -5,7 +5,8 @@ add_rcconf network network YES add_rcconf crond crond NO add_rcconf watchdog watchdog NO add_rcconf watchdog_flags watchdog_flags '-t 10 -T 20' -add_rcconf 'use "-C32" normally, "NO" to disable' syslogd_flags '-C32' +add_rcconf syslogd NO +add_rcconf 'use "-C32" normally' syslogd_flags '-C32' add_rcconf inetd inetd NO add_rcconf ntpd ntpd NO add_rcconf ntpd_flags ntpd_flags '-p time.fu-berlin.de' diff --git a/package/busybox/files/network.init b/package/busybox/files/network index 4989fcbcb..4989fcbcb 100644 --- a/package/busybox/files/network.init +++ b/package/busybox/files/network diff --git a/package/busybox/files/syslog.init b/package/busybox/files/syslogd.init index 7a85430ca..7a85430ca 100644 --- a/package/busybox/files/syslog.init +++ b/ |