diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index 8d8ae5255efe58068546db1be9fec93a46426197..8330fa5713640169fd648693fdea341c5c272248 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -106,7 +106,7 @@ sha512sums=" c0233d22858a5901db64e1d2fe1f6d39a2e2cfd1b94a10932483f55fed9461e9b8aa2d73b154b9d99a7a8b49ee02abfbddfe917ce0c6d7576601ba2668589c01 00-initramfs-base.files 0e1a9e8964d69622699f2aa37da0a1b2e8203bfd3d442e6f6b672daf917692b07903765b43d47f1708e05c7d31b637a2a9a3c8315f987df0870da0b5af53a4d8 00-initramfs-extra-base.files 966284e8ef8f840258a84019db4a6ddd436cdc50193e0673532f70fef86a6e4c1bfd21b682f3708251b6b670ca569c90016926d0926babc5a0257bb33ae55d79 init.sh -bbfbec0690386e81d1a43420e7898a1e32fdf10eab88dc8d1d500a5def84c60a6dbb7055f66dc163429faf46d540dd4e8e44642b27743ea783eed6b41e0ff019 init_functions.sh +eab20e07a632f814a1b36426a7b4087ac9195c9ed7cb22fb0b386b93a5be07c0b1a677e228d7bf3ff8e6d5e4307596848f743aec25d138d1a6625b3d885e0454 init_functions.sh 18a0ca97bca094aeb8cb1c2582205ac0aff131085c39f1715246541cacfb35434aba515cd5d338703843efb36b9effd494a51361c51fb39be6052ad866346d3d init_2nd.sh 30fb52456376020e70116169752582d25a011a858111a347c2e53eccaddea8765fab502371cfdc0c2a8ca93034795b7e689e4cd3393ad601268c02024c4e84ab init_functions_2nd.sh 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index 5653a9213ea565a7c9f55dd7058cac971df0a078..88990e7dbf6c77cd2070047a5e5f83d67f303b24 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -22,7 +22,6 @@ deviceinfo_create_initfs_extra="${deviceinfo_create_initfs_extra:-}" setup_log() { local console console="$(cat /sys/devices/virtual/tty/console/active)" - local warn_null_console="" # Stash fd1/2 so we can restore them before switch_root, but only if the # console is not null @@ -34,14 +33,14 @@ setup_log() { else # Setting console=null is a trick used on quite a few pmOS devices. However it is generally a really # bad idea since it makes it impossible to debug kernel panics, and it makes our job logging in the - # initramfs a lot harder. Let's encourage people to stop using this by printing a warning to dmesg - # and logging to every console we can. - # Instead folks should add 'quiet' or 'silent' to the kernel cmdline to disable logging. + # initramfs a lot harder. We ban this in pmaports but some (usually android) bootloaders like to add it + # anyway. We ought to have some special handling here to use /dev/zero for stdin instead + # to avoid weird bugs in daemons that read from stdin (e.g. syslog) + # See related: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2989 console="/dev/$(echo "$deviceinfo_getty" | cut -d';' -f1)" if ! [ -e "$console" ]; then console="/dev/null" fi - warn_null_console="true" fi # Disable kmsg ratelimiting for userspace (it gets re-enabled again before switch_root) @@ -61,15 +60,6 @@ setup_log() { # Process substitution is technically non-POSIX, but is supported by busybox # shellcheck disable=SC3001 exec > >(tee /pmOS_init.log "$pmsg" "$console" | logger -t "$LOG_PREFIX" -p user.info) 2>&1 - - if [ -n "$warn_null_console" ]; then - # Log to the display as well just to be sure. - echo "postmarketOS: ****************************************************" | tee /dev/tty1 - echo "WARNING: 'console=null' on kernel cmdline. This is NOT supported!" | tee /dev/tty1 - echo "WARNING: Use 'quiet' instead if you want to disable logging." | tee /dev/tty1 - echo "WARNING: Logging initramfs output to $console, as a fallback." | tee /dev/tty1 - echo "postmarketOS: ****************************************************" | tee /dev/tty1 - fi } mount_proc_sys_dev() {