Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jeos-firstboot for openSUSE:Factory checked in at 2022-01-22 08:17:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jeos-firstboot (Old) and /work/SRC/openSUSE:Factory/.jeos-firstboot.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jeos-firstboot" Sat Jan 22 08:17:59 2022 rev:40 rq:947715 version:1.1.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/jeos-firstboot/jeos-firstboot.changes 2021-09-03 21:26:46.486214483 +0200 +++ /work/SRC/openSUSE:Factory/.jeos-firstboot.new.1938/jeos-firstboot.changes 2022-01-22 08:18:25.690805095 +0100 @@ -1,0 +2,9 @@ +Thu Jan 20 15:33:06 UTC 2022 - Fabian Vogt <fv...@suse.com> + +- Update to version 1.1.0.0: + * Introduce welcome screen for console switching + (boo#1184157, jsc#SLE-18306) + * Drop redundant functions in jeos-firstboot-functions + * Drop call to snapper setup-quota, kiwi does that meanwhile + +------------------------------------------------------------------- Old: ---- jeos-firstboot-1.0.2.0.obscpio New: ---- jeos-firstboot-1.1.0.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jeos-firstboot.spec ++++++ --- /var/tmp/diff_new_pack.LjcAF3/_old 2022-01-22 08:18:26.330800782 +0100 +++ /var/tmp/diff_new_pack.LjcAF3/_new 2022-01-22 08:18:26.334800755 +0100 @@ -1,7 +1,7 @@ # # spec file for package jeos-firstboot # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: jeos-firstboot -Version: 1.0.2.0 +Version: 1.1.0.0 Release: 0 Summary: Simple text based JeOS first boot wizard License: MIT @@ -83,6 +83,7 @@ %{_sbindir}/jeos-firstboot-snapshot %{_datadir}/jeos-firstboot/jeos-firstboot-dialogs %{_datadir}/jeos-firstboot/jeos-firstboot-functions +%{_datadir}/jeos-firstboot/welcome-screen %files rpiwifi %{_datadir}/jeos-firstboot/modules/raspberrywifi ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.LjcAF3/_old 2022-01-22 08:18:26.378800458 +0100 +++ /var/tmp/diff_new_pack.LjcAF3/_new 2022-01-22 08:18:26.382800432 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/openSUSE/jeos-firstboot.git</param> - <param name="changesrevision">eb4d1647ce1671d5dac5d14dc703c76e92281f99</param></service></servicedata> + <param name="changesrevision">e2d51e6e0eb20d4d27f243b4b577b774189fa32a</param></service></servicedata> (No newline at EOF) ++++++ jeos-firstboot-1.0.2.0.obscpio -> jeos-firstboot-1.1.0.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jeos-firstboot-1.0.2.0/files/usr/lib/systemd/system/jeos-firstboot.service new/jeos-firstboot-1.1.0.0/files/usr/lib/systemd/system/jeos-firstboot.service --- old/jeos-firstboot-1.0.2.0/files/usr/lib/systemd/system/jeos-firstboot.service 2021-07-09 11:55:30.000000000 +0200 +++ new/jeos-firstboot-1.1.0.0/files/usr/lib/systemd/system/jeos-firstboot.service 2022-01-20 16:24:39.000000000 +0100 @@ -11,7 +11,7 @@ # Same as YaST2-Firstboot.service here After=apparmor.service local-fs.target plymouth-start.service YaST2-Second-Stage.service Conflicts=plymouth-start.service -Before=getty@tty1.service serial-getty@ttyS0.service serial-getty@ttyS1.service serial-getty@ttyS2.service +Before=getty@tty1.service serial-getty@hvc0.service serial-getty@ttyS0.service serial-getty@ttyS1.service serial-getty@ttyS2.service serial-getty@ttyAMA0.service Before=display-manager.service ConditionPathExists=/var/lib/YaST2/reconfig_system OnFailure=poweroff.target diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jeos-firstboot-1.0.2.0/files/usr/sbin/jeos-firstboot new/jeos-firstboot-1.1.0.0/files/usr/sbin/jeos-firstboot --- old/jeos-firstboot-1.0.2.0/files/usr/sbin/jeos-firstboot 2021-07-09 11:55:30.000000000 +0200 +++ new/jeos-firstboot-1.1.0.0/files/usr/sbin/jeos-firstboot 2022-01-20 16:24:39.000000000 +0100 @@ -26,6 +26,7 @@ . /etc/os-release . "/usr/share/jeos-firstboot/jeos-firstboot-functions" . "/usr/share/jeos-firstboot/jeos-firstboot-dialogs" +. "/usr/share/jeos-firstboot/welcome-screen" # Read the optional configuration file [ -f /usr/share/defaults/jeos-firstboot.conf ] && . /usr/share/defaults/jeos-firstboot.conf @@ -89,6 +90,7 @@ JEOS_KEYTABLE=${JEOS_KEYTABLE-} if [ -z "$JEOS_LOCALE" ]; then + welcome_screen_with_console_switch dialog_locale fi @@ -98,6 +100,7 @@ systemd_firstboot_args+=("--locale=$JEOS_LOCALE") if [ -z "$JEOS_KEYTABLE" ]; then + welcome_screen_with_console_switch dialog_keytable fi @@ -125,7 +128,7 @@ return 0 } -if [[ "$(ps h -o tty -p $$)" = tty[0-9]* ]]; then +if [[ "$(resolve_tty "$(tty)")" =~ /dev/tty[0-9]+ ]]; then # Those languages can't be displayed in the console declare -A start_kmscon start_kmscon["cs"]=1 @@ -151,6 +154,8 @@ fi if [ -z "$JEOS_EULA_ALREADY_AGREED" ]; then + welcome_screen_with_console_switch + # Find the location of the EULA # An EULA in /etc takes precedence EULA_FILE=/etc/YaST2/licenses/base/license.txt @@ -179,6 +184,7 @@ fi if [ -z "$JEOS_TIMEZONE" ]; then + welcome_screen_with_console_switch dialog_timezone fi @@ -189,12 +195,14 @@ run systemd-firstboot "${systemd_firstboot_args[@]}" if [ -z "$JEOS_PASSWORD_ALREADY_SET" ]; then + welcome_screen_with_console_switch dialog_password fi # Do not show the register on non SLE based distributions or if is # globally disabled if [ -x /usr/bin/SUSEConnect -a -z "${ID##sle*}" -a -z "${JEOS_HIDE_SUSECONNECT}" ]; then + welcome_screen_with_console_switch d --msgbox $"Please register this image using your existing SUSE entitlement. As \"root\" use the following command: @@ -226,12 +234,4 @@ fi fi -# Test if snapper is available -if [ -x /usr/bin/snapper -a "$(stat --format=%T -f /)" = "btrfs" ]; then - if ! btrfs qgroup show / &>/dev/null; then - # Run snapper to setup quota for btrfs - run /usr/bin/snapper --no-dbus setup-quota || warn $"Could not setup quota for btrfs" - fi -fi - call_module_hook post diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jeos-firstboot-1.0.2.0/files/usr/share/defaults/jeos-firstboot.conf new/jeos-firstboot-1.1.0.0/files/usr/share/defaults/jeos-firstboot.conf --- old/jeos-firstboot-1.0.2.0/files/usr/share/defaults/jeos-firstboot.conf 2021-07-09 11:55:30.000000000 +0200 +++ new/jeos-firstboot-1.1.0.0/files/usr/share/defaults/jeos-firstboot.conf 2022-01-20 16:24:39.000000000 +0100 @@ -27,3 +27,8 @@ # SUSEConnect help will not be displayed. By default this dialog is # present when SUSEConnect is installed on SLE systems. # JEOS_HIDE_SUSECONNECT='yes' + +# If enabled, jeos-firstboot shows a welcome screen on all consoles and +# continues on the console where Ok was pressed. When disabled, only the +# active console (last "console=" on the kernel cmdline) is used. +JEOS_ASK_CONSOLE=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jeos-firstboot-1.0.2.0/files/usr/share/jeos-firstboot/jeos-firstboot-functions new/jeos-firstboot-1.1.0.0/files/usr/share/jeos-firstboot/jeos-firstboot-functions --- old/jeos-firstboot-1.0.2.0/files/usr/share/jeos-firstboot/jeos-firstboot-functions 2021-07-09 11:55:30.000000000 +0200 +++ new/jeos-firstboot-1.1.0.0/files/usr/share/jeos-firstboot/jeos-firstboot-functions 2022-01-20 16:24:39.000000000 +0100 @@ -6,6 +6,9 @@ LINES=24 COLUMNS=80 fi + + let dh_menu=LINES-15 + let dh_text=LINES-5 } stty_size @@ -14,9 +17,6 @@ password='' modules=() -let dh_menu=LINES-15 -let dh_text=LINES-5 - if pushd "/usr/share/jeos-firstboot/modules" &>/dev/null; then for module in *; do if [ -f "${module}" ] && source "${module}"; then @@ -44,23 +44,6 @@ return 0 } -kmscon_available() { - # kmscon itself is installed - kmscon --help >/dev/null 2>&1 || return 1 - # At least one monospace font is available - [ -n "$(fc-match "monospace" 2>/dev/null)" ] || return 1 - - return 0 -} - -fbiterm_available() { - # fbiterm itself is installed - fbiterm --help >/dev/null 2>&1 || return 1 - # fbiterm comes with its own fallback font - - return 0 -} - dialog_out=`mktemp -qt 'firstboot-XXXXXX'` d(){ retval= @@ -160,4 +143,19 @@ run echo "root:$password" | run /usr/sbin/chpasswd fi } + +# Resolves /dev/console and /dev/tty0 +resolve_tty() { + local tty="$1" + if [ "$tty" = "/dev/console" ]; then + tty=$(awk '{printf "/dev/%s", $NF}' /sys/class/tty/console/active) + fi + + if [ "$tty" = "/dev/tty0" ]; then + printf "/dev/%s" "$(cat /sys/class/tty/tty0/active)" + else + echo -n "$tty" + fi +} + # vim: syntax=sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jeos-firstboot-1.0.2.0/files/usr/share/jeos-firstboot/welcome-screen new/jeos-firstboot-1.1.0.0/files/usr/share/jeos-firstboot/welcome-screen --- old/jeos-firstboot-1.0.2.0/files/usr/share/jeos-firstboot/welcome-screen 1970-01-01 01:00:00.000000000 +0100 +++ new/jeos-firstboot-1.1.0.0/files/usr/share/jeos-firstboot/welcome-screen 2022-01-20 16:24:39.000000000 +0100 @@ -0,0 +1,116 @@ +# Function to allow showing dialogs (or other stuff) on all consoles. +# At its core, it works by spawning processes with the given command on each +# console and waits for them to finish. If any exits with an exit status other +# than 254, the others are killed and the status returned. +# +# The inner workings are a bit complex, mostly to workaround bash not being +# able to wait for any process to exit, returning pid + status. It can either +# wait for multiple processes (PIDs) to exit or return the exit status of any +# process, but not the corresponding PID. There is no way to deal with +# background processes which exit before "wait" was called. In the case that +# there is no background process anymore, "wait" simply returns 0. +# As a workaround, the spawned background processes stay alive until killed +# explicitly and report their exit status and console through a FIFO. + +# Directory the fifo for IPC is stored in. Managed by on_all_consoles. +fifodir= +# Console of the successful console_subproc +console= + +# Internal helper used by on_all_consoles. +# This function is called for each console and basically runs "$@" on the +# console given in $1 and writes its exit status into the fifo. +# Bash doesn't forward signals to its child processes, instead that needs +# to be done explicitly. This is necessary for "dialog" to restore the tty. +# Note: When passing a function as parameter, make sure to not spawn +# subprocesses, i.e. use exec when possible. +console_subproc() { + local console="$1" + shift + "$@" <>"$console" >&0 & + pid=$! + trap 'set +e; kill $pid; wait $pid; dialog --clear <>"$console" >&0; exit 0' SIGTERM + ret=0 + wait $pid || ret=$? + # Undo the trap to not kill the already dead process and also + # avoid waiting for the current process (sleep 1) before handling it. + trap - SIGTERM + echo "$ret $console" > "${fifodir}/fifo" + # Stay around until explicitly killed. + while :; do sleep 1; done +} + +on_all_consoles() { + # Needed to tell apart errors and escape + export DIALOG_ERROR=254 + # The linux fbcon uses this, most serial consoles should be fine too + export TERM=linux + + # Create a FIFO for communicating the status + fifodir="$(mktemp -d)" + mkfifo "${fifodir}/fifo" + + # For every active console, create a background process + local pids=() + local currenttty="$(resolve_tty "$(tty)")" + for console in $(cat /sys/class/tty/console/active); do + console="/dev/${console}" + [ -r "$console" ] || continue + # Skip current tty + [ "$(resolve_tty "$console")" = "$currenttty" ] && continue + console_subproc "$console" "$@" & + pids+=($!) + done + + # Also for the current tty + console_subproc "$currenttty" "$@" & + pids+=($!) + + # Wait for either all processes to fail or one to succeed + local finished=0 + while read status console < "${fifodir}/fifo"; do + ((finished++)) || : + [ $finished -eq ${#pids[@]} ] && break + [ $status -eq 254 ] || break + done + + # All done, kill remaining processes + kill "${pids[@]}" || : + wait "${pids[@]}" || : + + rm -r "$fifodir" + fifodir= + + return $status +} + +# If JEOS_ASK_CONSOLE is not 0, show the "welcome" screen and switch to the +# console where it was acked on. +welcome_screen_with_console_switch() { + [ "${JEOS_ASK_CONSOLE-0}" -eq "0" ] && return 0 + + # Only ask once + [ "${JEOS_CONSOLE_ASKED-0}" -eq "1" ] && return 0 + export JEOS_CONSOLE_ASKED=1 + + while true; do + ret=0 + on_all_consoles dialog --backtitle "$PRETTY_NAME" --title $"JeOS Firstboot" --ok-label $"Start" --msgbox $"Welcome to $PRETTY_NAME"'!\nThe initial configuration takes just a few steps.' 0 0 || ret=$? + if [ "$ret" -eq 0 ]; then + break; + elif [ "$ret" -eq 254 ]; then + # Error? Just continue and fail later + return; + else + if on_all_consoles dialog --backtitle "$PRETTY_NAME" --yesno $"Do you really want to quit?" 0 0; then + exit 1 + fi + fi + done + + # Move stdio to the console + if [ "$console" != "$(tty)" ]; then + exec 0<>"$console" 1>&0 + stty_size + fi +} ++++++ jeos-firstboot.obsinfo ++++++ --- /var/tmp/diff_new_pack.LjcAF3/_old 2022-01-22 08:18:26.498799650 +0100 +++ /var/tmp/diff_new_pack.LjcAF3/_new 2022-01-22 08:18:26.502799623 +0100 @@ -1,6 +1,6 @@ name: jeos-firstboot -version: 1.0.2.0 -mtime: 1625824530 -commit: 29b865f9c58424dbfe5ef80885774ad060c5ee88 +version: 1.1.0.0 +mtime: 1642692279 +commit: d4578fc59d01e51e1b8dd0b7dfb84f6bc9090018