From 9846976293b20daed68eb497c51a695ab07b0f99 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Aug 27 2018 18:16:43 +0000 Subject: Drop covert-to-edition script This script was originally intended to help users "upgrade" from Fedora Cloud to Fedora Server, but it was largely unused and it is difficult to keep in sync with convert-to-edition.lua Signed-off-by: Stephen Gallagher --- diff --git a/convert-to-edition b/convert-to-edition deleted file mode 100755 index 5c18634..0000000 --- a/convert-to-edition +++ /dev/null @@ -1,170 +0,0 @@ -#!/bin/bash - -# Simple script to set up Edition defaults for Fedora -# Keep this in sync with convert-to-edition.lua - -OPTIND=1 - -VARIANT_FILE=/usr/lib/variant - -# Defaults are set to provide the fewest suprises for anyone running this -# script manually to convert their own system. In nearly all cases, it should -# be possible to run `convert-to-edition -e ` and get expected results - -# By default, install new packages to ensure that all the necessary files are -# available before symlinking. This must be skipped when running this file as -# part of an RPM scriptlet. -do_installation=1 - -# By default, do not modify the enabled or disabled state of any service on the -# system. This should only be done when this script is run as part of system -# installation or if the user is certain that they want to apply the changes to -# the presets to their system. -enable_presets=0 - -exit_usage() { - echo "Usage: convert-to-edition [options] -e cloud|non-edition|server|workstation" - echo " Options:" - echo " -e: The edition to install (atomichost, cloud, non-edition, server or workstation)" - echo " -i: Skip installing additional files and just update symlinks" - echo " -p: Also enable newly-added systemd presets" - exit 1 -} - -while getopts "e:ihp" opt; do - case "$opt" in - e) - EDITION=$OPTARG - ;; - i) - do_installation=0 - ;; - p) - enable_presets=1 - ;; - h) - exit_usage - ;; - esac -done - -# None of the actions below can be run by a non-root user -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -case $EDITION in - atomichost) - if [ $do_installation -gt 0 ]; then - dnf install -y fedora-release-atomichost - fi - - echo "VARIANT_ID=atomic.host" > $VARIANT_FILE - - # Ensure that the os-release file is pointing to the correct version - ln -sf ./os.release.d/os-release-atomichost /usr/lib/os-release || : - - # Remove any presets from other Editions. - rm -f /usr/lib/systemd/system-preset/80-*.preset - ;; - - cloud) - if [ $do_installation -gt 0 ]; then - echo "Installing Fedora Cloud Packages" - dnf install -y fedora-release-cloud - fi - - echo "VARIANT_ID=cloud" > $VARIANT_FILE - - # Ensure that the os-release file is pointing to the correct version - ln -sf ./os.release.d/os-release-cloud /usr/lib/os-release || : - - # Remove any presets from other Editions. - rm -f /usr/lib/systemd/system-preset/80-*.preset - ;; - - non-edition) - echo "VARIANT_ID=nonproduct" > $VARIANT_FILE - - # Ensure that the os-release file is pointing to the correct version - ln -sf ./os.release.d/os-release-fedora /usr/lib/os-release || : - - # Remove any presets from other Editions. - rm -f /usr/lib/systemd/system-preset/80-*.preset - ;; - - server) - if [ $do_installation -gt 0 ]; then - echo "Installing Fedora Server Packages" - dnf install -y fedora-release-server - fi - - echo "VARIANT_ID=server" > $VARIANT_FILE - - # Ensure that the os-release file is pointing to the correct version - ln -sf ./os.release.d/os-release-server /usr/lib/os-release - - # Remove any presets from other Editions. This should always be a no-op, - # but it's good to be explicit. - # We reserve 80-*.preset for Editions - rm -f /usr/lib/systemd/system-preset/80-*.preset - - # Symlink in the proper preset - ln -sf ../../os.release.d/presets/80-server.preset \ - /usr/lib/systemd/system-preset/80-server.preset - - if [ $enable_presets -gt 0 ]; then - # Enable new units specified by presets - units=$(sed -n 's/^enable//p' \ - < /usr/lib/systemd/system-preset/80-server.preset) - /usr/bin/systemctl preset $units >/dev/null 2>&1 || : - - # Disable new units specified by presets - units=$(sed -n 's/^disable//p' \ - < /usr/lib/systemd/system-preset/80-server.preset) - /usr/bin/systemctl preset $units >/dev/null 2>&1 || : - fi - ;; - - workstation) - if [ $do_installation -gt 0 ]; then - echo "Installing Fedora Workstation Packages" - dnf install -y fedora-release-workstation - fi - - echo "VARIANT_ID=workstation" > $VARIANT_FILE - # Ensure that the os-release files is pointing to the correct version - ln -sf ./os.release.d/os-release-workstation /usr/lib/os-release - - # Remove any presets from other Editions. This should always be a no-op, - # but it's good to be explicit. - # We reserve 80-*.preset for Editions - rm -f /usr/lib/systemd/system-preset/80-*.preset - - # Symlink in the proper preset - ln -sf ../../os.release.d/presets/80-workstation.preset \ - /usr/lib/systemd/system-preset/80-workstation.preset - - if [ $enable_presets -gt 0 ]; then - # Enable new units specified by presets - units=$(sed -n 's/^enable//p' \ - < /usr/lib/systemd/system-preset/80-workstation.preset) - /usr/bin/systemctl preset $units >/dev/null 2>&1 || : - - # Disable new units specified by presets - units=$(sed -n 's/^disable//p' \ - < /usr/lib/systemd/system-preset/80-workstation.preset) - /usr/bin/systemctl preset $units >/dev/null 2>&1 || : - fi - ;; - - *) - exit_usage - ;; -esac - -echo This system has been converted to $EDITION - -exit 0 - diff --git a/fedora-release.spec b/fedora-release.spec index 9b3fbeb..574bce3 100644 --- a/fedora-release.spec +++ b/fedora-release.spec @@ -17,7 +17,6 @@ URL: https://fedoraproject.org/ Source1: LICENSE Source2: Fedora-Legal-README.txt -Source3: convert-to-edition Source4: convert-to-edition.lua Source10: 85-display-manager.preset @@ -31,6 +30,7 @@ Source17: org.projectatomic.rpmostree1.rules Source18: 80-iot.preset Obsoletes: redhat-release +Obsoletes: convert-to-edition < 30-0.7 Provides: redhat-release Provides: system-release Provides: system-release(%{version}) @@ -195,13 +195,6 @@ Provides a base package for Fedora Xfce specific configuration files to depend on as well as Xfce system defaults. -%package -n convert-to-edition -Summary: Script for converting between Fedora Editions -Requires: fedora-release = %{version}-%{release} - -%description -n convert-to-edition -Provides a script to convert the running system between Fedora Editions - %prep sed -i 's|@@VERSION@@|%{dist_version}|g' %{SOURCE2} @@ -379,8 +372,6 @@ install -Dm0644 %{SOURCE15} -t %{buildroot}%{_prefix}/lib/os.release.d/presets/ install -Dm0644 %{SOURCE16} -t %{buildroot}%{_datadir}/glib-2.0/schemas/ install -Dm0644 %{SOURCE17} -t %{buildroot}%{_datadir}/polkit-1/rules.d/ -# Copy the make_edition script to /usr/sbin -install -Dm0755 %{SOURCE3} -t %{buildroot}/%{_prefix}/sbin/ %post -p %include %{SOURCE4} @@ -592,9 +583,6 @@ uninstall_edition("xfce") %files xfce %attr(0644,root,root) /usr/lib/os.release.d/os-release-xfce -%files -n convert-to-edition -/usr/sbin/convert-to-edition - %changelog * Fri Aug 24 2018 Matthew Miller - 30-0.6 - add container