diff options
-rw-r--r-- | docs/customize-rootfs.txt | 6 | ||||
-rw-r--r-- | mk/build.mk | 2 | ||||
-rw-r--r-- | mk/host-bottom.mk | 2 | ||||
-rw-r--r-- | mk/pkg-bottom.mk | 2 | ||||
-rw-r--r-- | package/autologin/Makefile | 33 | ||||
-rw-r--r-- | package/autologin/src/autologin.c | 10 | ||||
-rw-r--r-- | package/base-files/Makefile | 19 | ||||
-rw-r--r-- | package/base-files/files/inittab.serial | 2 | ||||
-rw-r--r-- | package/base-files/files/rcdev.mdev | 1 | ||||
-rw-r--r-- | package/bcm2835/Makefile | 27 | ||||
-rw-r--r-- | package/cmake/Makefile | 6 | ||||
-rw-r--r-- | package/gdb/Makefile | 1 | ||||
-rw-r--r-- | package/glib/Makefile | 2 | ||||
-rw-r--r-- | package/glib/patches/patch-configure | 11 | ||||
-rw-r--r-- | package/util-linux/Makefile | 6 | ||||
-rw-r--r-- | target/Makefile | 6 | ||||
-rw-r--r-- | target/config/Config.in.adk | 4 | ||||
-rw-r--r-- | target/config/Config.in.runtime | 15 |
18 files changed, 146 insertions, 9 deletions
diff --git a/docs/customize-rootfs.txt b/docs/customize-rootfs.txt index 3518d15bb..54846dba5 100644 --- a/docs/customize-rootfs.txt +++ b/docs/customize-rootfs.txt @@ -21,3 +21,9 @@ You can also point to another directory via: You can start with the example configuration files from +root_*+. The +extra+ directory will never be deleted by any clean target to avoid loss of customized configuration data. + +Another option is to configure a post-build action. This is available +in +Global settings+. It must point to a script relative to the root +of your openadk working copy. It will be invoked as part of the ++*-imageinstall+ step with $ADK_TOPDIR as first argument. You can use +it e.g. to modify the +root_*+ filesystem before bundling it. diff --git a/mk/build.mk b/mk/build.mk index ed40042d1..5c0dbf761 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -674,4 +674,6 @@ info: @printf "TOOLCHAIN_DIR=$(TOOLCHAIN_DIR)\n" @printf "TARGET_PATH=$(TARGET_PATH)\n" @printf "LINUX_DIR=$(LINUX_DIR)\n" + @printf "TARGET_DIR=$(TARGET_DIR)\n" @printf -- "---OPENADK-INFO---\n" + diff --git a/mk/host-bottom.mk b/mk/host-bottom.mk index a8f6db773..29cfc57ea 100644 --- a/mk/host-bottom.mk +++ b/mk/host-bottom.mk @@ -78,7 +78,7 @@ host-build: ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE} @$(CMD_TRACE) "compiling.. " ifneq (${HOST_STYLE},manual) - cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \ ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE) endif ${MAKE} host-build $(MAKE_TRACE) diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk index c95572141..b46e381de 100644 --- a/mk/pkg-bottom.mk +++ b/mk/pkg-bottom.mk @@ -158,7 +158,7 @@ spkg-install: ${ALL_POSTINST} ${_FAKE_COOKIE}: ${_BUILD_COOKIE} @-rm -f ${_ALL_CONTROLS} @mkdir -p '${STAGING_PKG_DIR}/stamps' ${WRKINST} '${STAGING_TARGET_DIR}/scripts' - @${MAKE} ${_ALL_CONTROLS} $(MAKE_TRACE) + @${MAKE} -j${ADK_MAKE_JOBS} ${_ALL_CONTROLS} $(MAKE_TRACE) @env ${MAKE_ENV} ${MAKE} pre-install $(MAKE_TRACE) ifneq ($(filter meson,${INSTALL_STYLE}),) DESTDIR='$(WRKINST)' PATH='$(HOST_PATH)' \ diff --git a/package/autologin/Makefile b/package/autologin/Makefile new file mode 100644 index 000000000..cc6fdb66a --- /dev/null +++ b/package/autologin/Makefile @@ -0,0 +1,33 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= autologin +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= tool to automatically login a user with getty +PKG_SECTION:= sys/misc + +PKG_NOPARALLEL:= 1 +NO_DISTFILES:= 1 + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,AUTOLOGIN,autologin,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +CONFIG_STYLE:= manual +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +TARGET_CPPFLAGS+= -I../autologin +TARGET_CPPFLAGS+= -D_GNU_SOURCE + +do-build: + $(CC) src/autologin.c -o $(WRKBUILD)/autologin + +autologin-install: + $(INSTALL_DIR) $(IDIR_AUTOLOGIN)/bin + $(INSTALL_BIN) $(WRKBUILD)/autologin $(IDIR_AUTOLOGIN)/bin + +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/autologin/src/autologin.c b/package/autologin/src/autologin.c new file mode 100644 index 000000000..14c7eeb56 --- /dev/null +++ b/package/autologin/src/autologin.c @@ -0,0 +1,10 @@ +// This file is part of the OpenADK project. OpenADK is copyrighted +// material, please see the LICENCE file in the top-level directory. + +#include <unistd.h> +#include <stdio.h> + +int main() +{ + return execlp("login\0","login\0","-f\0", "root\0" ,0); +} diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 78da71657..95f22f6f0 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -21,6 +21,18 @@ CONFIG_STYLE:= manual BUILD_STYLE:= manual INSTALL_STYLE:= manual +ifeq ($(ADK_RUNTIME_DEV_MDEV_LOGGING),y) +ADK_RUNTIME_DEV_MDEV_LOGGING_LINE:='echo >/dev/mdev.log' +else +ADK_RUNTIME_DEV_MDEV_LOGGING_LINE:='' +endif + +ifeq ($(ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN),y) +ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA:= -n -l autologin +else +ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA:= +endif + do-install: $(CP) ./src/* $(IDIR_BASE_FILES) mkdir -p $(IDIR_BASE_FILES)/{etc,dev,boot,root,sys,proc,tmp,run,var,mnt,media} @@ -55,9 +67,11 @@ endif endif ifeq ($(ADK_RUNTIME_DEV_MDEV),y) $(CP) ./files/rcdev.mdev $(IDIR_BASE_FILES)/etc/init.d/rcdev + $(SED) "s#@ADK_RUNTIME_DEV_MDEV_LOGGING@#"$(ADK_RUNTIME_DEV_MDEV_LOGGING_LINE)"#g" $(IDIR_BASE_FILES)/etc/init.d/rcdev $(CP) ./files/mdev.conf $(IDIR_BASE_FILES)/etc $(CP) ./files/mdev $(IDIR_BASE_FILES)/etc endif + ifeq ($(ADK_RUNTIME_DEV_UDEV),y) $(CP) ./files/rcdev.udev $(IDIR_BASE_FILES)/etc/init.d/rcdev endif @@ -75,10 +89,15 @@ endif cat ./files/inittab.serial >> $(IDIR_BASE_FILES)/etc/inittab $(SED) 's#@DEVICE@#$(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)#g' $(IDIR_BASE_FILES)/etc/inittab $(SED) 's#@SPEED@#$(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)#' $(IDIR_BASE_FILES)/etc/inittab + $(SED) 's#@AUTOLOGIN@#$(ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN_STANZA)#' $(IDIR_BASE_FILES)/etc/inittab endif ifeq ($(ADK_RUNTIME_INIT_SYSVINIT),y) cp ./files/inittab.sysvinit $(IDIR_BASE_FILES)/etc/inittab endif +ifeq ($(ADK_RUNTIME_MOUNT_DEBUGFS),y) + echo debugfs /sys/kernel/debug debugfs defaults 0 0 >> $(IDIR_BASE_FILES)/etc/fstab + echo null::sysinit:/bin/mount -a -t debugfs >> $(IDIR_BASE_FILES)/etc/inittab +endif test -z $(ADK_RUNTIME_HOSTNAME) || \ echo $(ADK_RUNTIME_HOSTNAME) > $(IDIR_BASE_FILES)/etc/hostname; \ echo "127.0.0.1 localhost" > $(IDIR_BASE_FILES)/etc/hosts diff --git a/package/base-files/files/inittab.serial b/package/base-files/files/inittab.serial index dcb09e438..ef31f1599 100644 --- a/package/base-files/files/inittab.serial +++ b/package/base-files/files/inittab.serial @@ -1 +1 @@ -@DEVICE@::respawn:/sbin/getty -i -L @DEVICE@ @SPEED@ vt100 +@DEVICE@::respawn:/sbin/getty -i -L @DEVICE@ @SPEED@ vt100 @AUTOLOGIN@ diff --git a/package/base-files/files/rcdev.mdev b/package/base-files/files/rcdev.mdev index 9af4535c1..b8afd453c 100644 --- a/package/base-files/files/rcdev.mdev +++ b/package/base-files/files/rcdev.mdev @@ -2,6 +2,7 @@ mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev # start mdev dynamic device node management echo >/dev/mdev.seq +@ADK_RUNTIME_DEV_MDEV_LOGGING@ if [ -f /proc/sys/kernel/hotplug ];then echo "/sbin/mdev" >/proc/sys/kernel/hotplug fi diff --git a/package/bcm2835/Makefile b/package/bcm2835/Makefile new file mode 100644 index 000000000..49d9ada74 --- /dev/null +++ b/package/bcm2835/Makefile @@ -0,0 +1,27 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= bcm2835 +PKG_VERSION:= 1.52 +PKG_RELEASE:= 1 +PKG_HASH:= b9fd10f7a80aadaed28a77168709b7c519568a63b6e98d0a50e9c5fe31bea6bb +PKG_DESCR:= the BCM2835 direct hardware access library +PKG_SECTION:= libs/misc +PKG_URL:= http://www.airspayce.com/mikem/bcm2835/ +PKG_SITES:= http://www.airspayce.com/mikem/bcm2835/ + +PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi2 raspberry-pi3 + +DISTFILES:= bcm2835-${PKG_VERSION}.tar.gz + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,LIBBCM2835,libbcm2835,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) + +bcm2835-install: + $(INSTALL_DIR) $(IDIR_LIBBCM2835)/usr/lib + $(INSTALL_DIR) $(IDIR_LIBBCM2835)/usr/include + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/cmake/Makefile b/package/cmake/Makefile index fc9e919f0..431d0850b 100644 --- a/package/cmake/Makefile +++ b/package/cmake/Makefile @@ -25,14 +25,14 @@ $(eval $(call HOST_template,CMAKE,cmake,$(PKG_VERSION)-${PKG_RELEASE})) HOST_STYLE:= manual host-configure: - (cd $(WRKBUILD); ./configure --prefix=${STAGING_HOST_DIR}/usr --system-curl) + (cd $(WRKBUILD); ./configure --prefix=${STAGING_HOST_DIR}/usr --system-curl --parallel=${ADK_MAKE_JOBS} ) host-build: - (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \ ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET}) $(MAKE_TRACE) cmake-hostinstall: - cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \ ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE) include ${ADK_TOPDIR}/mk/host-bottom.mk diff --git a/package/gdb/Makefile b/package/gdb/Makefile index ab525a6c2..34e973f12 100644 --- a/package/gdb/Makefile +++ b/package/gdb/Makefile @@ -29,6 +29,7 @@ CONFIGURE_ARGS+= --enable-static \ --disable-gdbtk \ --disable-gdbserver \ --without-x \ + --with-expat \ --disable-sim \ --disable-plugins \ --disable-werror \ diff --git a/package/glib/Makefile b/package/glib/Makefile index 6cf4b874e..a90f8f08d 100644 --- a/package/glib/Makefile +++ b/package/glib/Makefile @@ -11,7 +11,7 @@ PKG_HASH:= 40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d PKG_DESCR:= low-level core library that forms the basis of gtk+ PKG_SECTION:= libs/misc PKG_DEPENDS:= libpcre zlib -PKG_BUILDDEP:= glib-host libffi zlib libelf dbus pcre +PKG_BUILDDEP:= glib-host libffi zlib dbus pcre HOST_BUILDDEP:= pkgconf-host libiconv-host libffi-host python2-host gettext-host util-linux-host PKG_NEEDS:= threads intl iconv PKG_URL:= http://www.gtk.org/ diff --git a/package/glib/patches/patch-configure b/package/glib/patches/patch-configure new file mode 100644 index 000000000..e7dea094f --- /dev/null +++ b/package/glib/patches/patch-configure @@ -0,0 +1,11 @@ +- glib-2.48.2.orig/configure 2016-08-17 18:37:42.000000000 +0200 ++++ glib-2.48.2/configure 2017-12-14 14:37:31.000000000 +0100 +@@ -6027,7 +6027,7 @@ if test "x$glib_have_cocoa" = "xyes"; th + + $as_echo "#define HAVE_COCOA 1" >>confdefs.h + +- COCOA_LIBS="-Wl,-framework,Foundation" ++ COCOA_LIBS="-Wl,-framework,Foundation,-framework,Cocoa" + LDFLAGS="$LDFLAGS $COCOA_LIBS" + + osx_version=`sw_vers -productVersion` diff --git a/package/util-linux/Makefile b/package/util-linux/Makefile index f95599fcd..86e84ec31 100644 --- a/package/util-linux/Makefile +++ b/package/util-linux/Makefile @@ -108,11 +108,13 @@ endif TARGET_CFLAGS+= -fPIC FAKE_FLAGS+= INSTALLSUID="install -m 4755" -HOST_CONFIGURE_ARGS+= --enable-libuuid \ - --enable-libblkid \ +HOST_CONFIGURE_ARGS+= --enable-libblkid \ --enable-libmount \ --disable-all-programs \ --disable-use-tty-group +ifneq ($(OS_FOR_BUILD),Darwin) +HOST_CONFIGURE_ARGS+= --enable-libuuid +endif fdisk-install: $(INSTALL_DIR) $(IDIR_FDISK)/usr/sbin diff --git a/target/Makefile b/target/Makefile index 846620d6c..128d272de 100644 --- a/target/Makefile +++ b/target/Makefile @@ -228,6 +228,12 @@ endif $(MAKE) -C $(patsubst %-targethelp,%,$@) targethelp %-imageinstall: %-imageprepare +ifdef ADK_POST_BUILD_ACTION +ifneq ($(ADK_POST_BUILD_ACTION),"") + @printf "running post build action '$(ADK_POST_BUILD_ACTION)'\n" + $(ADK_TOPDIR)/$(ADK_POST_BUILD_ACTION) $(ADK_TOPDIR) +endif +endif $(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall @for x in $$(ls $(ADK_TOPDIR)/scripts/postimage/*.sh 2>/dev/null); do \ [[ -x "$$x" ]] && $$x; \ diff --git a/target/config/Config.in.adk b/target/config/Config.in.adk index b414b70fd..060ee78e4 100644 --- a/target/config/Config.in.adk +++ b/target/config/Config.in.adk @@ -112,4 +112,8 @@ config ADK_TARGET_PORT help Port to use for SSH when running make check. +config ADK_POST_BUILD_ACTION + string "Path to script run post build. Must be relative to ADK_TOPDIR." + default "" + endmenu diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime index 6d5a460ab..9c9b9cd49 100644 --- a/target/config/Config.in.runtime +++ b/target/config/Config.in.runtime @@ -64,6 +64,10 @@ config ADK_RUNTIME_DEV_MDEV depends on ADK_PACKAGE_BUSYBOX depends on !ADK_RUNTIME_INIT_SYSTEMD +config ADK_RUNTIME_DEV_MDEV_LOGGING + bool "Log mdev events into /dev/mdev.log" + depends on ADK_RUNTIME_DEV_MDEV + config ADK_RUNTIME_DEV_UDEV bool "Use udev" select ADK_PACKAGE_UDEV @@ -184,6 +188,12 @@ config ADK_RUNTIME_USER_SHELL help Set the shell to use. +config ADK_RUNTIME_MOUNT_DEBUGFS + bool "mount debugfs" + depends on !ADK_RUNTIME_INIT_SYSTEMD + help + mount debugfs under /sys/kernel/debug + config ADK_RUNTIME_START_SERVICES bool "start services by default" default n @@ -363,6 +373,11 @@ config ADK_RUNTIME_GETTY_SERIAL help Start getty on serial console. +config ADK_RUNTIME_GETTY_SERIAL_AUTOLOGIN + bool "run autologin on serial getty" + depends on ADK_RUNTIME_GETTY_SERIAL + select ADK_PACKAGE_AUTOLOGIN + config ADK_RUNTIME_CONSOLE_VGA_DEVICE string "VGA console device" depends on ADK_TARGET_WITH_VGA || ADK_TARGET_GENERIC |