diff --git a/buildroot-external/Config.in b/buildroot-external/Config.in index 9c304a6ee..b8daf99ec 100644 --- a/buildroot-external/Config.in +++ b/buildroot-external/Config.in @@ -1,4 +1,3 @@ -source "$BR2_EXTERNAL_HASSOS_PATH/package/mingetty/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/hassos/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/libapparmor/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/apparmor/Config.in" diff --git a/buildroot-external/barebox-env/bin/init b/buildroot-external/barebox-env/bin/init index 81c766df8..c350581b1 100644 --- a/buildroot-external/barebox-env/bin/init +++ b/buildroot-external/barebox-env/bin/init @@ -2,9 +2,6 @@ export PATH=/env/bin -global linux.bootargs.base -global linux.bootargs.dyn.root - # Autostart for i in /env/init/*; do . $i diff --git a/buildroot-external/barebox-env/init/cmdline b/buildroot-external/barebox-env/init/cmdline new file mode 100644 index 000000000..b9f43f2bd --- /dev/null +++ b/buildroot-external/barebox-env/init/cmdline @@ -0,0 +1,6 @@ +#!/bin/sh + +global linux.bootargs.base="" +if [ -f /boot/cmdline.txt ]; then + readf /boot/cmdline.txt global.linux.bootargs.base +fi diff --git a/buildroot-external/barebox-env/init/global_bootargs b/buildroot-external/barebox-env/init/global_bootargs index 203baad44..a6643cbad 100644 --- a/buildroot-external/barebox-env/init/global_bootargs +++ b/buildroot-external/barebox-env/init/global_bootargs @@ -1,3 +1,4 @@ #!/bin/sh global linux.bootargs.zram="zram.enabled=1 zram.num_devices=3" +global linux.bootargs.apparmor="apparmor=1 security=apparmor" diff --git a/buildroot-external/barebox.config b/buildroot-external/barebox.config index b6e606a91..c3dd39837 100644 --- a/buildroot-external/barebox.config +++ b/buildroot-external/barebox.config @@ -31,6 +31,7 @@ CONFIG_CMD_TIMEOUT=y CONFIG_CMD_OFTREE=y CONFIG_CMD_STATE=y CONFIG_CMD_BOOTCHOOSER=y +CONFIG_CMD_READF=y CONFIG_OFTREE=y CONFIG_OFTREE_OVERLAY=y diff --git a/buildroot-external/board/rpi2/post-image.sh b/buildroot-external/board/rpi2/post-image.sh index b5b736be1..141782309 100755 --- a/buildroot-external/board/rpi2/post-image.sh +++ b/buildroot-external/board/rpi2/post-image.sh @@ -28,9 +28,6 @@ cp -r ${BINARIES_DIR}/rpi-firmware/overlays ${BOOT_DATA}/ ( echo "kernel=barebox.bin" echo "disable_splash=1" - echo "dtparam=i2c_arm=on" - echo "dtparam=spi=on" - echo "dtparam=audio=on" ) > ${BOOT_DATA}/config.txt touch ${BOOT_DATA}/cmdline.txt diff --git a/buildroot-external/busybox.config b/buildroot-external/busybox.config index 8af754c3c..6173e2ec8 100644 --- a/buildroot-external/busybox.config +++ b/buildroot-external/busybox.config @@ -511,7 +511,7 @@ CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="des" # CONFIG_DELUSER is not set # CONFIG_DELGROUP is not set # CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set -# CONFIG_GETTY is not set +CONFIG_GETTY=y CONFIG_LOGIN=y # CONFIG_LOGIN_SESSION_AS_CHILD is not set # CONFIG_LOGIN_SCRIPTS is not set diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 53ed9fdd0..e731e7604 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -71,7 +71,6 @@ BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_GPTFDISK=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_RAUC=y -BR2_PACKAGE_MINGETTY=y BR2_PACKAGE_HASSOS=y BR2_PACKAGE_HASSOS_SUPERVISOR="homeassistant/amd64-hassio-supervisor" BR2_PACKAGE_HASSOS_SUPERVISOR_VERSION="103.3" diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index 594f55fe7..02ac2c000 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -77,7 +77,6 @@ BR2_PACKAGE_HOST_E2FSPROGS=y BR2_PACKAGE_HOST_GPTFDISK=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_RAUC=y -BR2_PACKAGE_MINGETTY=y BR2_PACKAGE_HASSOS=y BR2_PACKAGE_HASSOS_SUPERVISOR="homeassistant/armhf-hassio-supervisor" BR2_PACKAGE_HASSOS_SUPERVISOR_VERSION="103.3" diff --git a/buildroot-external/kernel.config b/buildroot-external/kernel.config index 3bb3cebc0..0d526034c 100644 --- a/buildroot-external/kernel.config +++ b/buildroot-external/kernel.config @@ -83,6 +83,7 @@ CONFIG_SQUASHFS_LZ4=y # CONFIG_SECCOMP is not set CONFIG_SECURITY=y CONFIG_SECURITY_APPARMOR=y +CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 CONFIG_KEYS=y CONFIG_CRYPTO_CCM=y diff --git a/buildroot-external/package/mingetty/0001-mingetty-utf8.patch b/buildroot-external/package/mingetty/0001-mingetty-utf8.patch deleted file mode 100644 index 69ebda17d..000000000 --- a/buildroot-external/package/mingetty/0001-mingetty-utf8.patch +++ /dev/null @@ -1,156 +0,0 @@ -diff -Nru mingetty-1.07.orig/mingetty.c mingetty-1.07/mingetty.c ---- mingetty-1.07.orig/mingetty.c 2004-01-03 15:15:56.000000000 +0200 -+++ mingetty-1.07/mingetty.c 2006-11-22 22:13:26.967910100 +0200 -@@ -16,10 +16,15 @@ - * - autologin only at first login - * - /etc/mingetty.conf that can be used instead of /etc/inittab for - * command line options -- * - Can UTF-8 setup be done within mingetty? -+ * - Can UTF-8 setup be done within mingetty? Let's try now :-) (VinzC) - * - Also add /bin/login-type functionality in here? - */ - -+/* Additional comments: Vincent Cadet (2006-11-21) -+ * - Attempt to make mingetty support UTF-8. Modifications were imported -+ * from Suse migetty.c 0.9.6s. -+ */ -+ - #include - #include - #include -@@ -39,6 +44,19 @@ - #include - #include - #include -+#include -+#include -+#include -+#include -+#include -+ -+#ifndef IUTF8 -+# ifndef ASM_IUTF8 -+# error ASM_IUTF8 input flag not defined - Cannot define IUTF8 -+# else -+# define IUTF8 ASM_IUTF8 -+# endif -+#endif - - /* name of this program (argv[0]) */ - static char *progname; -@@ -74,6 +92,8 @@ - static char *autologin = NULL; - /* try to read a char before dropping to login prompt */ - static int loginpause = 0; -+/* terminal mode */ -+static int mode = K_RAW; - - /* error() - output error messages */ - static void error (const char *fmt, ...) -@@ -187,10 +207,21 @@ - if (fd > 2) - close (fd); - -+ /* Detect mode of current keyboard setup, e.g. for UTF-8 */ -+ if (ioctl(0, KDGKBMODE, &mode) < 0) -+ mode = K_RAW; -+ - /* Write a reset string to the terminal. This is very linux-specific - and should be checked for other systems. */ - if (noclear == 0) -- write (0, "\033c", 2); -+ /* don't write a full reset (ESC c) because this leaves the -+ unicode mode again if the terminal was in unicode mode -+ and also undos the ESC sequences in CONSOLE_MAGIC which -+ are needed for some languages/console-fonts. -+ Just put the cursor to the home position (ESC [ H), -+ erase everything below the cursor (ESC [ J), and set the -+ scrolling region to the full window (ESC [ r) */ -+ write (0, "\033[r\033[H\033[J", 9); - - sigaction (SIGHUP, &sa_old, NULL); - } -@@ -292,32 +323,75 @@ - - static char *get_logname (void) - { -- static char logname[40]; -+ static char logname[4*UT_NAMESIZE]; - char *bp; - unsigned char c; -+ int ascii; -+ iconv_t ic; - - tcflush (0, TCIFLUSH); /* flush pending input */ -+ -+ /* Check for UTF-8 mode */ -+ switch(mode) { -+ case K_UNICODE: -+ ascii = 0; -+ setlocale(LC_CTYPE, "en_US.UTF-8"); -+ break; -+ case K_RAW: -+ case K_MEDIUMRAW: -+ case K_XLATE: -+ default: -+ ascii = 1; -+ setlocale(LC_CTYPE, "POSIX"); -+ break; -+ } -+ - for (*logname = 0; *logname == 0;) { - do_prompt (1); - for (bp = logname;;) { - if (read (0, &c, 1) < 1) { -- if (errno == EINTR || errno == EIO -- || errno == ENOENT) -+ if (errno == EINTR || errno == EAGAIN) { -+ usleep(1000); -+ continue; -+ } -+ if (errno == EIO || errno == ENOENT) - exit (EXIT_SUCCESS); - error ("%s: read: %s", tty, strerror (errno)); - } - if (c == '\n' || c == '\r') { - *bp = 0; - break; -- } else if (!isprint (c)) -- error ("%s: invalid character 0x%x in login" -- " name", tty, c); -+ } -+ -+ if (ascii && !isprint (c)) -+ error ("%s: invalid character 0x%x in login name", tty, c); - else if ((size_t)(bp - logname) >= sizeof (logname) - 1) - error ("%s: too long login name", tty); -- else -- *bp++ = c; -+ -+ *bp++ = c; - } - } -+ -+ if (!ascii && (ic = iconv_open("WCHAR_T", "UTF-8"))) { -+ char tmpbuf[4*sizeof(logname)], *op, *lp; -+ size_t len = bp - logname; -+ size_t out = sizeof(tmpbuf) - 1; -+ size_t wcl; -+ wint_t *wcp; -+ -+ op = tmpbuf; -+ lp = logname; -+ if ((wcl = iconv(ic , &lp, &len, &op, &out)) == (size_t)-1) -+ error ("%s: invalid character conversion for login name", tty); -+ iconv_close(ic); -+ -+ wcp = (wint_t*)tmpbuf; -+ wcp[wcl] = (wint_t)0; -+ while (*wcp) { -+ if (!iswprint(*wcp++)) -+ error ("%s: invalid character for login name found", tty); -+ } -+ } - return logname; - } - diff --git a/buildroot-external/package/mingetty/Config.in b/buildroot-external/package/mingetty/Config.in deleted file mode 100644 index adc95a8d5..000000000 --- a/buildroot-external/package/mingetty/Config.in +++ /dev/null @@ -1,7 +0,0 @@ -config BR2_PACKAGE_MINGETTY - bool "mingetty" - help - mingetty is a minimal getty for use on virtual consoles and is not - suitable for use on serial lines. - - http://sourceforge.net/projects/mingetty/ diff --git a/buildroot-external/package/mingetty/mingetty.hash b/buildroot-external/package/mingetty/mingetty.hash deleted file mode 100644 index 29e72b934..000000000 --- a/buildroot-external/package/mingetty/mingetty.hash +++ /dev/null @@ -1 +0,0 @@ -sha1 283acd3dc9da2c9eb71d5d7cc01d1bd178254523 mingetty-1.08.tar.gz diff --git a/buildroot-external/package/mingetty/mingetty.mk b/buildroot-external/package/mingetty/mingetty.mk deleted file mode 100644 index 231ce2b21..000000000 --- a/buildroot-external/package/mingetty/mingetty.mk +++ /dev/null @@ -1,22 +0,0 @@ -############################################################# -# -# mingetty -# -############################################################# -MINGETTY_VERSION = 1.08 -MINGETTY_SOURCE = mingetty-$(MINGETTY_VERSION).tar.gz -MINGETTY_SITE = http://downloads.sourceforge.net/project/mingetty/mingetty/$(MINGETTY_VERSION) - -define MINGETTY_BUILD_CMDS - $(MAKE) CC=$(TARGET_CC) -C $(@D) -endef - -define MINGETTY_INSTALL_TARGET_CMDS - $(INSTALL) -D -m 0755 $(@D)/mingetty $(TARGET_DIR)/sbin -endef - -define MINGETTY_CLEAN_CMDS - $(MAKE) -C $(@D) clean -endef - -$(eval $(generic-package)) diff --git a/buildroot-external/rootfs-overlay/etc/systemd/system/getty@tty1.service.d/mingetty.conf b/buildroot-external/rootfs-overlay/etc/systemd/system/getty@tty1.service.d/mingetty.conf deleted file mode 100644 index b76ef2e1e..000000000 --- a/buildroot-external/rootfs-overlay/etc/systemd/system/getty@tty1.service.d/mingetty.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=/sbin/mingetty --noclear %I