Compare commits

..

11 Commits

Author SHA1 Message Date
obel1x c061b6434f Merge pull request 'Improved configure.sh and fixing KDE on Fedora 44 kickstarter' (#26) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: #26
2026-05-06 09:20:47 +02:00
Daniel unbrot Pätzold b978771206 confige: source dists defaults to for robustnes
and docs
2026-05-06 09:06:30 +02:00
Daniel unbrot Pätzold ab7dc208ad configure: Better detection and choice between predefined configs 2026-05-06 08:42:53 +02:00
Daniel unbrot Pätzold 559e913c0f install: if config was found with other repourl as the user specified, use users repourl for configure call 2026-05-06 08:07:31 +02:00
Daniel unbrot Pätzold bc4c50218f kde: exclude kde spin initial setup, so that akanadi can be skipped 2026-05-05 21:53:12 +02:00
Daniel unbrot Pätzold 9fed049222 configure: comment if existing config was found 2026-05-05 21:33:25 +02:00
Daniel unbrot Pätzold 0dadf36230 Baseprofilenames and configure checks for existing preconfigure 2026-05-05 21:07:48 +02:00
Daniel unbrot Pätzold cf784b56a6 kde_fullsetup: expand akonadi exclusions to full chain
@kde-pim is optional and not selected, so all KDE PIM packages are
safe to exclude. Replaces the previous partial -akonadi-server/mysql
with the complete exclusion list matching cinnamon_fullsetup.cfg.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 14:18:03 +02:00
Daniel unbrot Pätzold c3c0a6ac85 cinnamon_fullsetup: exclude akonadi and all dependent KDE PIM packages
Anaconda's depsolve pulls in akonadi-server via kmymoney-libs (kmymoney
is an optional package in @office). Exclude the entire akonadi chain
so neither akonadi-server nor any package requiring it gets installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 14:14:09 +02:00
Daniel unbrot Pätzold 6876c06ead nextcloud/user_run: centralise Flatpak app ID and data dir path
Introduce NC_FLATPAK_APP and NC_FLATPAK_DIR variables so the app ID
and ~/.var/app path are defined once and referenced everywhere, rather
than repeated as literals. Also fixes a stray leading '/' in the
nextcloud.cfg grep path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 08:50:21 +02:00
Daniel unbrot Pätzold b5462e4781 NC: remove autostart from installed Version 2026-05-05 08:35:00 +02:00
6 changed files with 193 additions and 35 deletions
@@ -10,7 +10,9 @@
echo "Setup Nextcloud- Sync" echo "Setup Nextcloud- Sync"
#Local Vars #Local Vars
BASECMD="/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud" NC_FLATPAK_APP="com.nextcloud.desktopclient.nextcloud"
NC_FLATPAK_DIR="${HOME}/.var/app/${NC_FLATPAK_APP}"
BASECMD="/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud ${NC_FLATPAK_APP}"
#Check Token #Check Token
if [ "${DAVTOKEN_USER}." = "." ]; then if [ "${DAVTOKEN_USER}." = "." ]; then
@@ -21,15 +23,20 @@ fi
#Remove Nextcloud from autostart anyway! Must be started by this script manually, because if it was started befor the ecrypted mount, #Remove Nextcloud from autostart anyway! Must be started by this script manually, because if it was started befor the ecrypted mount,
#it will never sync and always throw an error that the local dir is missing #it will never sync and always throw an error that the local dir is missing
if [ -f "$SUDO_HOME/.config/autostart/com.nextcloud.desktopclient.nextcloud.desktop" ]; then if [ -f "$HOME/.config/autostart/${NC_FLATPAK_APP}.desktop" ]; then
echo "Remove Autostart Nextcloud" echo "Remove Autostart Nextcloud (old)"
rm $SUDO_HOME/.config/autostart/com.nextcloud.desktopclient.nextcloud.desktop rm $HOME/.config/autostart/${NC_FLATPAK_APP}.desktop
fi
# Same for NCs nuild-in autostart
if [ -f "$HOME/.config/autostart/Nextcloud.desktop" ]; then
echo "Remove Autostart Nextcloud (from installed binary)"
rm $HOME/.config/autostart/Nextcloud.desktop
fi fi
NC_PID=$( pgrep -u $USER nextcloud ) NC_PID=$( pgrep -u $USER nextcloud )
if [ -n "${NC_PID}" ]; then if [ -n "${NC_PID}" ]; then
echo "Stopping Nextcloud with PID ${NC_PID}" echo "Stopping Nextcloud with PID ${NC_PID}"
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud --quit >/dev/null /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud ${NC_FLATPAK_APP} --quit >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Service could not be stopped, please check why." echo "Service could not be stopped, please check why."
exit 1 exit 1
@@ -40,14 +47,14 @@ fi
NC_PID=$( pgrep -u $USER nextcloud ) NC_PID=$( pgrep -u $USER nextcloud )
if [ -n "${NC_PID}" ]; then if [ -n "${NC_PID}" ]; then
echo "Nextcloud still running with PID ${NC_PID}. Force stop" echo "Nextcloud still running with PID ${NC_PID}. Force stop"
# Kill does not remove lockfiles in ~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/ which will prevent next start # Kill does not remove lockfiles in ${NC_FLATPAK_DIR}/cache/tmp/ which will prevent next start
kill ${NC_PID} kill ${NC_PID}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Service could not be stopped, please check why." echo "Service could not be stopped, please check why."
exit 1 exit 1
fi fi
sleep 0.5 sleep 0.5
rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/cache/temp/* rm -rif ${NC_FLATPAK_DIR}/cache/temp/*
fi fi
#Check if Option is Configured to use Nextcloud Desktop Data- Sync #Check if Option is Configured to use Nextcloud Desktop Data- Sync
@@ -90,7 +97,7 @@ for CLIENT_DATA_DECLARE_LINE in "${CLIENT_DATA_SYNC[@]}"; do
eval "${CLIENT_DATA_DECLARE_LINE}" eval "${CLIENT_DATA_DECLARE_LINE}"
# echo "DEBUG user_run.sh(0020)_2: ${CLIENT_DATA_SYNC_LINE[@]}" # echo "DEBUG user_run.sh(0020)_2: ${CLIENT_DATA_SYNC_LINE[@]}"
# Now, CLIENT_DATA_SYNC_LINE[0] contains the local path and CLIENT_DATA_SYNC_LINE[1] contains the remote path # Now, CLIENT_DATA_SYNC_LINE[0] contains the local path and CLIENT_DATA_SYNC_LINE[1] contains the remote path
if grep -q "localPath=${CLIENT_DATA_SYNC_LINE[0]}" "/${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud/nextcloud.cfg"; then if grep -q "localPath=${CLIENT_DATA_SYNC_LINE[0]}" "${NC_FLATPAK_DIR}/config/Nextcloud/nextcloud.cfg"; then
echo "Already found configured local folder ${CLIENT_DATA_SYNC_LINE[0]} syncing with ${CLIENT_DATA_SYNC_LINE[1]} . Leaving it unchanged." echo "Already found configured local folder ${CLIENT_DATA_SYNC_LINE[0]} syncing with ${CLIENT_DATA_SYNC_LINE[1]} . Leaving it unchanged."
_nc_first=0 _nc_first=0
else else
@@ -111,8 +118,8 @@ for CLIENT_DATA_DECLARE_LINE in "${CLIENT_DATA_SYNC[@]}"; do
echo "Exec: ${SYNCCMD_HIDDENPW}" echo "Exec: ${SYNCCMD_HIDDENPW}"
if [ "${_nc_wipe_done}" -eq 0 ]; then if [ "${_nc_wipe_done}" -eq 0 ]; then
# Autoprovisioning only works when no configuration is existent — wipe once before first new setup # Autoprovisioning only works when no configuration is existent — wipe once before first new setup
rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/data/Nextcloud rm -rif ${NC_FLATPAK_DIR}/data/Nextcloud
rm -rif ${HOME}/.var/app/com.nextcloud.desktopclient.nextcloud/config/Nextcloud rm -rif ${NC_FLATPAK_DIR}/config/Nextcloud
_nc_wipe_done=1 _nc_wipe_done=1
fi fi
#Now, execute Nextcloud autoprovisionig #Now, execute Nextcloud autoprovisionig
+18 -5
View File
@@ -37,24 +37,37 @@ curl -fsSL ${REPO_URL%.git}/raw/branch/${REPO_BRANCH:-main}/system_setup/install
sudo -E bash /tmp/install.sh sudo -E bash /tmp/install.sh
``` ```
Both are optional. That way, install.sh should know what to pull. Both are export parameters are optional. That way, install.sh should know what to pull and use it for your new setup.
## After the script completes ## After the script completes
Configure your environment before running any installation: At the end of the installation, you will be asked wheter to run configure.sh . You are encouraged to do this always.
But bevor letting `configure.sh` start, there are some options for making your life easier:
1. You can either get some `setup_system.conf` file from your system admin and put it to `/opt/sys_config/config` . That way all your settings will be prefilled the right way.
2. You may also use some preconfigured file from `config.d/configure.conf(.bak)` and put it to `config.d/configure.conf` - if thats existing from the first setup of this pc.
Pleas mind, that in the meantime your config may have changed dramatically, so this may be only a good choice if your last configure was not that long ago.
3. You may also configure your environment before manually:
```sh ```sh
cp /opt/sys_config/system_setup/config.dist/setup_system.conf.dist /opt/sys_config/config/setup_system.conf cp /opt/sys_config/system_setup/config.dist/setup_system.conf.dist /opt/sys_config/config/setup_system.conf
# Edit setup_system.conf — set TLDOMAIN, SERVERFQDN_IPA, SERVERFQDN_NC, and paths. # Edit setup_system.conf — set TLDOMAIN, SERVERFQDN_IPA, SERVERFQDN_NC, paths and all you need
``` ```
Optionally add local per-machine overrides in `config.d/`: Mind, that this would be the job of `configure.sh`
4. Optionally add additional local per-machine overrides in `config.d/`:
```sh ```sh
# Example: use the devel branch on this machine # Example: always use the devel branch on this machine, no matter what was specified anywhere
echo 'export REPO_BRANCH="devel"' > /opt/sys_config/config.d/system_defines.conf echo 'export REPO_BRANCH="devel"' > /opt/sys_config/config.d/system_defines.conf
``` ```
5. Otherwise, let `configure.sh` do it's job.
Once configured, boot the Fedora installer from USB — Anaconda will detect the `OEMDRV` partition and run the Kickstart automatically. Once configured, boot the Fedora installer from USB — Anaconda will detect the `OEMDRV` partition and run the Kickstart automatically.
## Supported filesystems for shrinking ## Supported filesystems for shrinking
@@ -68,6 +68,49 @@ android-tools
-samba-client -samba-client
-samba-usershares -samba-usershares
-BackupPC -BackupPC
#Exclude akonadi and all packages requiring it (pulled in via @office optional: kmymoney)
-akonadi-server
-akonadi-server-mysql
-akonadi-calendar
-akonadi-calendar-tools
-akonadi-contacts
-akonadi-mime
-akonadi-search
-akonadi-import-wizard
-akonadiconsole
-kdepim-runtime
-kdepim-runtime-libs
-kdepim-addons
-kalarm
-kgpg
-kleopatra
-kmail
-kmail-libs
-kmail-account-wizard
-kaddressbook
-kaddressbook-libs
-korganizer
-korganizer-libs
-kontact
-akregator
-merkuro
-zanshin
-kjots
-knotes
-knotes-libs
-pimcommon
-calendarsupport
-eventviews
-incidenceeditor
-mailcommon
-mailimporter-akonadi
-mbox-importer
-pim-data-exporter
-pim-data-exporter-libs
-messagelib
-maui-mauikit-calendar
-kmymoney
-kmymoney-libs
#Needed by SSSD #Needed by SSSD
oddjob-mkhomedir oddjob-mkhomedir
nss-pam-ldapd nss-pam-ldapd
@@ -27,7 +27,6 @@ mount -L OEMDRV /mnt/anaconda_pre
@domain-client @domain-client
@system-tools @system-tools
@kde-media @kde-media
@kde-spin-initial-setup
@libreoffice @libreoffice
@office @office
@sound-and-video @sound-and-video
@@ -68,9 +67,50 @@ android-tools
-kmines -kmines
#Annoying plasmoids #Annoying plasmoids
-kdeplasma-addons -kdeplasma-addons
#Search - Powerful, but slow #Exclude akonadi and all packages requiring it (@kde-pim is optional and not selected)
# @kde-spin-initial-setup
-akonadi-server -akonadi-server
-akonadi-server-mysql -akonadi-server-mysql
-akonadi-calendar
-akonadi-calendar-tools
-akonadi-contacts
-akonadi-mime
-akonadi-search
-akonadi-import-wizard
-akonadiconsole
-kdepim-runtime
-kdepim-runtime-libs
-kdepim-addons
-kalarm
-kgpg
-kleopatra
-kmail
-kmail-libs
-kmail-account-wizard
-kaddressbook
-kaddressbook-libs
-korganizer
-korganizer-libs
-kontact
-akregator
-merkuro
-zanshin
-kjots
-knotes
-knotes-libs
-pimcommon
-calendarsupport
-eventviews
-incidenceeditor
-mailcommon
-mailimporter-akonadi
-mbox-importer
-pim-data-exporter
-pim-data-exporter-libs
-messagelib
-maui-mauikit-calendar
-kmymoney
-kmymoney-libs
-dragon -dragon
-kdeconnectd -kdeconnectd
-kde-connect -kde-connect
+67 -18
View File
@@ -5,14 +5,9 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)" SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
CONF_FILE="${SCRIPTDIR}/../config.d/configure.conf" CONF_DIST="${SCRIPTDIR}/config.dist/setup_system.conf.dist"
CONF_FILE="${SCRIPTDIR}/../config/setup_system.conf"
CONF_EXISTING="${SCRIPTDIR}/../config/setup_system.conf" CONF_PRE="${SCRIPTDIR}/../config.d/configure.conf"
if [[ -f "$CONF_EXISTING" ]]; then
CONF_DIST="$CONF_EXISTING"
else
CONF_DIST="${SCRIPTDIR}/config.dist/setup_system.conf.dist"
fi
# Prompt for a single value; returns the old value unchanged if the user presses Enter. # Prompt for a single value; returns the old value unchanged if the user presses Enter.
prompt_value() { prompt_value() {
@@ -25,22 +20,70 @@ prompt_value() {
# Replace the first matching simple export line in configure.conf. # Replace the first matching simple export line in configure.conf.
set_conf_var() { set_conf_var() {
local varname="$1" value="$2" local varname="$1" value="$2"
sed -i "s|^[[:space:]]*export ${varname}=.*|export ${varname}=\"${value}\"|" "$CONF_FILE" sed -i "s|^[[:space:]]*export ${varname}=.*|export ${varname}=\"${value}\"|" "$CONF_PRE"
} }
# Update an existing bare "export VAR=…" line at the top level, or append one. # Update an existing bare "export VAR=…" line at the top level, or append one.
override_conf_var() { override_conf_var() {
local varname="$1" value="$2" local varname="$1" value="$2"
if grep -q "^export ${varname}=" "$CONF_FILE"; then if grep -q "^export ${varname}=" "$CONF_PRE"; then
sed -i "s|^export ${varname}=.*|export ${varname}=\"${value}\"|" "$CONF_FILE" sed -i "s|^export ${varname}=.*|export ${varname}=\"${value}\"|" "$CONF_PRE"
else else
printf 'export %s="%s"\n' "$varname" "$value" >> "$CONF_FILE" printf 'export %s="%s"\n' "$varname" "$value" >> "$CONF_PRE"
fi fi
} }
do_configure() { do_configure() {
mkdir -p "$(dirname "$CONF_FILE")" # Possibilities:
cp "$CONF_DIST" "$CONF_FILE" # Either setup_system.conf or setup_system.conf.dist to config.d/configure.conf # 1 Found CONF_FILE="${SCRIPTDIR}/../config/setup_system.conf": This is a preinstalled company-value filled complete conf file
# 2 Found CONF_PRE="${SCRIPTDIR}/../config.d/configure.conf": This a a configure file from a previous configure run
# 3 Found none of these: use CONF_DIST="${SCRIPTDIR}/config.dist/setup_system.conf.dist"
# -> if 1 or 2 found, ask the user if to use one of them
# -> either choice, the CONF_PRE="${SCRIPTDIR}/../config.d/configure.conf" is written from it and used for further setup
if [ -f "$CONF_FILE" ] || [ -f "$CONF_PRE" ]; then
echo "Some alternatives found for configure source:"
if [[ -f "$CONF_PRE" ]]; then
echo " Choice (p): Another config run result was found in $CONF_PRE ."
echo " Hint: May contain Values that already were setup different for your details"
else
unset CONF_PRE
fi
if [[ -f "$CONF_FILE" ]]; then
echo " Choice (c): Found companys full config in $CONF_FILE ."
echo " This may be a full config, that is valid for your company."
else
unset CONF_FILE
fi
# Always possible: Use new dist
echo " Choice (d): You may discard all, and use distributed defaults from the maintainers."
echo " Hint: Will always start from scratch which guaranties to have a valid config for your current version"
while true; do
read -r -p " Please make a coice: " CHOICE
case "${CHOICE}" in
"p")
if [[ -f "$CONF_PRE" ]]; then
echo "Using the existing config run file."
break
fi
;;
"c")
if [[ -f "$CONF_FILE" ]]; then
rm "$CONF_PRE" >/dev/null 2>&1
cp "$CONF_FILE" "$CONF_PRE" && break
fi
;;
"d")
rm "$CONF_PRE" >/dev/null 2>&1
cp "$CONF_DIST" "$CONF_PRE" && break
;;
esac
echo "Invalid choice or error in selection made."
done
else
cp "${CONF_DIST}" "$CONF_PRE"
fi
echo "" echo ""
echo "=== System Configuration ===" echo "=== System Configuration ==="
@@ -58,7 +101,12 @@ do_configure() {
set_conf_var "REPO_BRANCH" "$REPO_BRANCH" set_conf_var "REPO_BRANCH" "$REPO_BRANCH"
fi fi
source "$( dirname "$0" )/setup_system.inc.sh" # Now there should all starting values be defined in $CONF_PRE file.
# We will additionally first read the dists defaults again to make sure, that all relevant settings that may be new to existing configs are predefined
# Could be no good idea when sysadmins are only deleting lines instead of unsettings its value, but makes sure there is not missing something for setup
source "$CONF_DIST"
#Now, read the users setting
source "$CONF_PRE"
VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "IPAVAULTNAME" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" ) VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "IPAVAULTNAME" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" )
for ELE in "${VARS[@]}" for ELE in "${VARS[@]}"
do do
@@ -66,7 +114,7 @@ do_configure() {
echo "" echo ""
new_ELE=$(prompt_value "${ELE}" "${!ELE}") new_ELE=$(prompt_value "${ELE}" "${!ELE}")
set_conf_var "${ELE}" "${new_ELE}" set_conf_var "${ELE}" "${new_ELE}"
source "$( dirname "$0" )/setup_system.inc.sh" source "$CONF_PRE"
REPEAT_TEST=1 REPEAT_TEST=1
case ${ELE} in case ${ELE} in
"SERVERFQDN_NC") echo "=== Testing: Nextcloud server ===" "SERVERFQDN_NC") echo "=== Testing: Nextcloud server ==="
@@ -130,7 +178,8 @@ do_configure() {
fi fi
fi fi
;; ;;
*) REPEAT_TEST=0 *) echo "Not tests available."
REPEAT_TEST=0
;; ;;
esac esac
[[ $REPEAT_TEST == 0 ]] && break [[ $REPEAT_TEST == 0 ]] && break
@@ -138,7 +187,7 @@ do_configure() {
done done
echo "" echo ""
echo "Configuration written to: ${CONF_FILE}" echo "Configuration written to: ${CONF_PRE}"
} }
while true; do while true; do
+6
View File
@@ -408,7 +408,13 @@ if [[ -n "$EXISTING_OEMDRV_DEV" ]]; then
|| die "git fetch failed." || die "git fetch failed."
git -C "$MOUNT_POINT" checkout -B "$REPO_BRANCH" FETCH_HEAD \ git -C "$MOUNT_POINT" checkout -B "$REPO_BRANCH" FETCH_HEAD \
|| die "git checkout failed." || die "git checkout failed."
#Backup Repovalues if the config was read from existing config with production values and we configured
#devel values above
BACK_REPO_URL="$REPO_URL"
BACK_REPO_BRANCH="$REPO_BRANCH"
source "$MOUNT_POINT/system_setup/setup_system.inc.sh" --missingconfok source "$MOUNT_POINT/system_setup/setup_system.inc.sh" --missingconfok
export REPO_URL="$EXIST_URL"
export REPO_BRANCH="$BACK_REPO_BRANCH"
finish_install "$EXISTING_OEMDRV_DEV" finish_install "$EXISTING_OEMDRV_DEV"
exit 0 exit 0
fi fi