[neon/neon/calamares-settings/Neon/stable] oem-prepare/usr/sbin: remove unsued oem code
Harald Sitter
null at kde.org
Wed Nov 4 14:50:04 GMT 2020
Git commit 15b407afdc42cb8ce0dcc9de0b1ec4f32908b126 by Harald Sitter.
Committed on 04/11/2020 at 14:29.
Pushed by sitter into branch 'Neon/stable'.
remove unsued oem code
was never used and left from attempting to recycle the ubiquity oem
system, an idea that was eventually thrown out but I forgot to clean up
the tree properly
D +0 -154 oem-prepare/usr/sbin/oem-config-firstboot
D +0 -63 oem-prepare/usr/sbin/oem-config-prepare
D +0 -63 oem-prepare/usr/sbin/oem-prepare
https://invent.kde.org/neon/neon/calamares-settings/commit/15b407afdc42cb8ce0dcc9de0b1ec4f32908b126
diff --git a/oem-prepare/usr/sbin/oem-config-firstboot b/oem-prepare/usr/sbin/oem-config-firstboot
deleted file mode 100755
index 99e0438..0000000
--- a/oem-prepare/usr/sbin/oem-config-firstboot
+++ /dev/null
@@ -1,154 +0,0 @@
-#! /bin/bash
-# Run oem-config on the first boot after shipping to the end user.
-set -e
-
-DEBUG=
-AUTOMATIC=
-for option;do
- case $option in
- --debug)
- DEBUG=--debug
- ;;
- --automatic)
- AUTOMATIC=--automatic
- ;;
- esac
-done
-
-# KDM stores the default user here, and apparently gets upset that we've
-# just removed its previous default user.
-rm -f /var/lib/kdm/kdmsts
-# Revert to creating a user at uid 1000.
-echo RESET passwd/user-uid | debconf-communicate >/dev/null
-if [ -z "$AUTOMATIC" ]; then
- # These two templates have been preseeded, which does nasty things
- # to their templates. It's probably a bug in cdebconf's
- # debconf-copydb that they end up still registered to
- # debian-installer/dummy at this point, but let's just work around
- # it for now so that we get sensible translated descriptions.
- for q in passwd/user-fullname passwd/username; do
- echo REGISTER "$q" "$q"
- echo RESET "$q"
- done | debconf-communicate oem-config >/dev/null
-fi
-
-# if sddm.conf exists, add a comment to show that this is the original
-# version which existed before end user setup was run
-if [ -f "/etc/sddm.conf" ]; then
- echo "#original_oem_version" >> /etc/sddm.conf
-fi
-
-# Remove the oem-config-prepare menu item.
-rm -f /usr/share/applications/oem-config-prepare-gtk.desktop \
- /usr/share/applications/kde4/oem-config-prepare-kde.desktop
-# Run a command just before starting oem-config.
-RET="$(echo GET oem-config/early_command | debconf-communicate)" || true
-if [ "${RET%% *}" = 0 ]; then
- command="${RET#* }"
- log-output sh -c "$command" || true
-fi
-
-# TODO: will this work for X-based frontends when X isn't up yet?
-if [ -z "$FRONTEND" ]; then
- FRONTEND="$(/usr/sbin/oem-config -q)"
-fi
-
-if [ ! -e '/var/log/installer' ]; then
- mkdir -p /var/log/installer
-fi
-
-if [ "$DEBUG" ]; then
- TRY=1
-else
- TRY=5
-fi
-for try in $(seq 1 $TRY); do
- CODE=0
- if [ "$FRONTEND" = debconf_ui ]; then
- plymouth quit || true
- LANG=en_US.UTF-8 FRONTEND="$FRONTEND" \
- /usr/sbin/oem-config-wrapper $DEBUG $AUTOMATIC --only \
- 2>>/var/log/oem-config.log \
- || CODE=$?
- else
- FRONTEND="$FRONTEND" \
- /usr/bin/ubiquity-dm vt7 :0 oem \
- /usr/sbin/oem-config-wrapper $DEBUG $AUTOMATIC --only || CODE=$?
- fi
- if [ "$CODE" -eq 0 ]; then
- # if we still have the original sddm.conf, instead of a new version
- # added in user setup to enable auto-login, remove the original
- # which will break sddm startup if left in place
- grep -q '#original_oem_version' /etc/sddm.conf && rm -f /etc/sddm.conf
- # Remove the temporary OEM configuration user, if possible
- # and desired.
- RET="$(echo GET oem-config/remove | debconf-communicate)"
- if [ "${RET#* }" = true ] && getent passwd oem >/dev/null; then
- pkill -u oem || true
- userdel --force --remove oem || true
- fi
- /bin/systemctl set-default graphical.target || true
- /bin/systemctl disable oem-config.service || true
- /bin/systemctl disable oem-config.target || true
- rm -f /lib/systemd/system/oem-config.* || true
- /bin/systemctl --no-block isolate graphical.target || true
- exit 0
- elif [ "$CODE" -eq 10 ]; then
- cat <<EOF
-Your system is not yet configured. Press 'a' to try again, 's' for a
-recovery shell, or 'r' to reboot.
-EOF
- while :; do
- read -p '[asr] ' -n 1 REPLY
- echo
- case $REPLY in
- A|a) continue 2 ;;
- S|s)
- cat <<EOF
-After you type 'exit', your system will reboot.
-EOF
- bash
- reboot
- sleep 3600
- exit 1
- ;;
- R|r) reboot; sleep 3600; exit 1 ;;
- esac
- done
- exit 1
- fi
-done
-
-if [ -z "$DEBUG" ]; then
- # Panic. At this point, probably the best thing we can do is drop to
- # a shell so that the user has some hope of fixing things up.
- cat <<EOF
-ERROR: The OEM installer failed. Your system may not be usable yet. Please
-report this as a bug to your vendor.
-
-To create a user so that you can use your new system normally, type:
-
- adduser USERNAME
-
-... replacing USERNAME with the username you would like to use (your first
-name in lower case is normally a reasonable choice), and follow the prompts.
-If this succeeds, type 'exit' to reboot the system.
-
-EOF
- bash
-
- # Don't run again.
- rm -f /var/lib/oem-config/run
- RET="$(echo GET oem-config/remove | debconf-communicate)"
- if [ "${RET#* }" = true ]; then
- if getent passwd oem >/dev/null; then
- pkill -u oem || true
- userdel --force --remove oem || true
- fi
- apt-get -y purge ubiquity >>/var/log/oem-config.log 2>&1
- fi
-
- reboot
-fi
-
-exit 0
diff --git a/oem-prepare/usr/sbin/oem-config-prepare b/oem-prepare/usr/sbin/oem-config-prepare
deleted file mode 100755
index fba5680..0000000
--- a/oem-prepare/usr/sbin/oem-config-prepare
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-set -e
-
-# Try to detect which frontend will be used by looking for a frontend
-# module.
-frontend=
-for f in gtk_ui kde_ui debconf_ui; do
- if [ -f "/usr/lib/ubiquity/ubiquity/frontend/$f.py" ]; then
- frontend="$f"
- break
- fi
-done
-
-quiet=
-if [ "$1" = --quiet ]; then
- quiet=1
- shift
-fi
-
-if [ "$(id -u)" = 0 ]; then
- # Machine-specific, so remove in case this system is going to be
- # cloned. These will be regenerated on the first boot.
- rm -f /etc/udev/rules.d/70-persistent-cd.rules \
- /etc/udev/rules.d/70-persistent-net.rules
-
- rm -f /etc/NetworkManager/system-connections/*
-
- # Potentially sensitive.
- rm -f /home/oem/.ssh/known_hosts
-
- cp -a /usr/lib/oem-config/oem-config.service /lib/systemd/system
- cp -a /usr/lib/oem-config/oem-config.target /lib/systemd/system
- /bin/systemctl enable oem-config.service
- /bin/systemctl enable oem-config.target
- /bin/systemctl set-default oem-config.target
-else
- pkexec "$0" ${quiet:+--quiet} "$@"
- exit 0
-fi
-
-if [ -z "$quiet" ]; then
- MESSAGE='oem-config will run the next time the system boots.'
- case $frontend in
- gtk_ui)
- if [ "$DISPLAY" ] && type zenity >/dev/null 2>&1; then
- # Drop privileges to the oem user so the dialog is not blocked
- # by wayland
- sudo -u oem zenity --title oem-config-prepare --info --text \
- "$MESSAGE"
- exit 0
- fi
- ;;
- kde_ui)
- if [ "$DISPLAY" ] && type kdialog >/dev/null 2>&1; then
- kdialog --title oem-config-prepare --msgbox "$MESSAGE"
- exit 0
- fi
- ;;
- esac
- echo "$MESSAGE"
-fi
-
-exit 0
diff --git a/oem-prepare/usr/sbin/oem-prepare b/oem-prepare/usr/sbin/oem-prepare
deleted file mode 100644
index fba5680..0000000
--- a/oem-prepare/usr/sbin/oem-prepare
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-set -e
-
-# Try to detect which frontend will be used by looking for a frontend
-# module.
-frontend=
-for f in gtk_ui kde_ui debconf_ui; do
- if [ -f "/usr/lib/ubiquity/ubiquity/frontend/$f.py" ]; then
- frontend="$f"
- break
- fi
-done
-
-quiet=
-if [ "$1" = --quiet ]; then
- quiet=1
- shift
-fi
-
-if [ "$(id -u)" = 0 ]; then
- # Machine-specific, so remove in case this system is going to be
- # cloned. These will be regenerated on the first boot.
- rm -f /etc/udev/rules.d/70-persistent-cd.rules \
- /etc/udev/rules.d/70-persistent-net.rules
-
- rm -f /etc/NetworkManager/system-connections/*
-
- # Potentially sensitive.
- rm -f /home/oem/.ssh/known_hosts
-
- cp -a /usr/lib/oem-config/oem-config.service /lib/systemd/system
- cp -a /usr/lib/oem-config/oem-config.target /lib/systemd/system
- /bin/systemctl enable oem-config.service
- /bin/systemctl enable oem-config.target
- /bin/systemctl set-default oem-config.target
-else
- pkexec "$0" ${quiet:+--quiet} "$@"
- exit 0
-fi
-
-if [ -z "$quiet" ]; then
- MESSAGE='oem-config will run the next time the system boots.'
- case $frontend in
- gtk_ui)
- if [ "$DISPLAY" ] && type zenity >/dev/null 2>&1; then
- # Drop privileges to the oem user so the dialog is not blocked
- # by wayland
- sudo -u oem zenity --title oem-config-prepare --info --text \
- "$MESSAGE"
- exit 0
- fi
- ;;
- kde_ui)
- if [ "$DISPLAY" ] && type kdialog >/dev/null 2>&1; then
- kdialog --title oem-config-prepare --msgbox "$MESSAGE"
- exit 0
- fi
- ;;
- esac
- echo "$MESSAGE"
-fi
-
-exit 0
More information about the Neon-commits
mailing list