First Commit

This commit is contained in:
Daniel Pätzold
2026-01-02 11:24:52 +01:00
commit f48c656997
18 changed files with 999 additions and 0 deletions
+93
View File
@@ -0,0 +1,93 @@
# Fedora Install Pre- Script
#
# SPDX-FileCopyrightText: Daniel Pätzold
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# This script is meant to be executed from Fedora install ks.cfg in the pre-section
# It should reside on the Partition named OEMDRV formated as BTRFS or EXT4
# The Location inside the OEMDRV- Partition should be /ks_base_profiles/basic_pre_script.inc
# When running from ks.cfg pre-section, the OEMDRV should be mountet by Anaconda to /mnt/tmp
# It will be run as root and will use sh to execute, the pre-section should look somewhat like this:
# %pre
# /bin/sh /mnt/tmp/ks_base_profiles/basic_pre_script.inc
# %end
# The Script will search for the drive with the Partition OEMDRV on it and
# REMOVE ANY OTHER PARTITIONS ON THAT DRIVE
# As Anacondas scripts are non interactive, it will do so without asking or stopping.
# We need to be root
if [ "$EUID" -ne 0 ]
then echo "* Error: Please run as root"
exit 1
fi
# Usually, the pre section is run in the sh- shell, the OEMDRV will be mountet at /mnt/tmp
# So we need to check if this is the case
FQFILENAME="/mnt/tmp/ks_base_profiles/basic_pre_script.inc"
if [ ! -f ${FQFILENAME} ]; then
echo "* Error finding the expeted Directory/File structure: Missing File"
echo "${FQFILENAME}"
echo "* Please check to run from Kickstart- Installation, or mount the OEMDRV with this File in /mnt/tmp before."
exit 1
fi
# Check if there is a Partition OEMDRV and on which Drive
source /mnt/tmp/system_setup/setup_system.conf
OEMDRVINFO=$(blkid | grep 'LABEL="OEMDRV"')
if [ "${OEMDRVINFO}." == "." ] ; then
echo "* Error: Required partition with label 'OEMDRV' is not found."
echo "It seems like this PC has never been setup to this Domain before."
echo "Please Check your Documentation at"
echo "${INSTALLDOCS}"
echo "on how to create a new setup on this PC"
exit 1
fi
OEMDRVPART=$(echo "${OEMDRVINFO}" | cut -d ':' -f 1)
echo "Found Label OEMDRV on ${OEMDRVPART}"
#Checking which is the Drive that the Partition is on
SYSDRIVE=$(lsblk -l | grep ":0" | while IFS= read -r SYSDRIVETMP; do
SYSDRIVE='/dev/'$(echo "${SYSDRIVETMP}" | cut -d ' ' -f 1)
# echo "Check ${SYSDRIVE}"
if echo "${OEMDRVPART}" | grep -q "${SYSDRIVE}"; then
echo ${SYSDRIVE}
break;
fi
done)
echo "Found Disk for Installation: ${SYSDRIVE} with Partition ${OEMDRVPART}"
#Check if the Drive has a GPT
if [ "$(fdisk -l ${SYSDRIVE} | grep 'type: gpt')." == "." ]; then
echo "* Error: The Drive ${SYSDRIVE} does not look like it has a GPT. Installation cannot proceed."
exit 1
else
echo "The Drive ${SYSDRIVE} contains a GPT."
fi
OEMDRVPARTSHORT=${OEMDRVPART:5}
ALLPARTS=$(lsblk -n -l -o NAME "${SYSDRIVE}" -Q 'TYPE=="part"')
REMPARTS=$(echo "$ALLPARTS" | grep -v "${OEMDRVPARTSHORT}")
if [ "${REMPARTS}." != "." ]; then
echo
echo "The Following Partitions were found and are now going to be deleted:"
# echo "${REMPARTS}"
echo "${REMPARTS}" | while IFS= read -r REMPART; do
# Find the Last Number
PARTNR=""
for (( i=0; i<${#REMPART}; i++ )); do
CHAR="${REMPART:$i:1}"
if [[ "${CHAR}" =~ [0-9] ]]; then
PARTNR+="${CHAR}" # Append if it's a digit
else
PARTNR="" # Reset if a non-digit is encountered
fi
done
echo "${SYSDRIVE}: Part ${PARTNR}"
blkid /dev/${REMPART}
if [ $? -eq 0 ]; then
parted ${SYSDRIVE} rm ${PARTNR}
fi
done
fi
sync
+63
View File
@@ -0,0 +1,63 @@
# Generated by Anaconda 43.44
%pre
/bin/sh /mnt/tmp/ks_base_profiles/basic_pre_script.inc
%end
# Keyboard layouts
keyboard --vckeymap=de-nodeadkeys --xlayouts='de (nodeadkeys)'
# System language
lang de_DE.UTF-8
%packages
@^kde-desktop-environment
@admin-tools
@development-tools
@domain-client
@editors
@firefox
@kde-apps
@kde-desktop
@kde-media
@kde-spin-initial-setup
@libreoffice
@office
@sound-and-video
@system-tools
@vlc
%end
# System authorization information
authselect enable-feature with-fingerprint
# Run the Setup Agent on first boot
firstboot --enable
# Generated using Blivet version 3.12.1
ignoredisk --only-use=nvme0n1
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part /boot/efi --fstype="efi" --ondisk=nvme0n1 --size=600 --fsoptions="umask=0077,shortname=winnt"
#part /sys_config --fstype="ext4" --noformat --onpart=UUID=3f9837da-5a46-4da1-a98b-62a8899e63cb --label=OEMDRV
part /sys_config --fstype="ext4" --noformat --label=OEMDRV
part /boot --fstype="ext4" --ondisk=nvme0n1 --size=2048
#part btrfs.115 --fstype="btrfs" --ondisk=nvme0n1 --size=485249
# Make the Install have 100GB at the beginning
part btrfs.115 --fstype="btrfs" --ondisk=nvme0n1 --size=100000
btrfs none --label=fedora_fedora btrfs.115
btrfs / --subvol --name=root LABEL=fedora_fedora
btrfs /home --subvol --name=home LABEL=fedora_fedora
timesource --ntp-server=_gateway
# System timezone
timezone Europe/Berlin --utc
# Root password
# This Password is completely unknown to anyone. After installation, the PC should be Member of Domain and the users may use sudo to become superuser.
rootpw --iscrypted $y$j9T$jpKVkxaFqL6GH6GAgB0Yb/$oc.rfZgnHNlTAIj/boJeI.ZFf1QHvMF7fymZww9bzE3
%post
/bin/sh /mnt/tmp/system_setup/setup_system_full.sh install
%end
+50
View File
@@ -0,0 +1,50 @@
# Generated by Anaconda 43.44
# Keyboard layouts
keyboard --vckeymap=de-nodeadkeys --xlayouts='de (nodeadkeys)'
# System language
lang de_DE.UTF-8
%packages
@^kde-desktop-environment
@admin-tools
@development-tools
@domain-client
@editors
@firefox
@kde-apps
@kde-desktop
@kde-media
@kde-spin-initial-setup
@libreoffice
@office
@sound-and-video
@system-tools
@vlc
%end
# System authorization information
authselect enable-feature with-fingerprint
# Run the Setup Agent on first boot
firstboot --enable
# Generated using Blivet version 3.12.1
ignoredisk --only-use=nvme0n1
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part /boot/efi --fstype="efi" --ondisk=nvme0n1 --size=600 --fsoptions="umask=0077,shortname=winnt"
part /sys_config --fstype="ext4" --noformat --onpart=UUID=3f9837da-5a46-4da1-a98b-62a8899e63cb --label=OEMDRV
part /boot --fstype="ext4" --ondisk=nvme0n1 --size=2048
part btrfs.115 --fstype="btrfs" --ondisk=nvme0n1 --size=485249
btrfs none --label=fedora_fedora btrfs.115
btrfs / --subvol --name=root LABEL=fedora_fedora
btrfs /home --subvol --name=home LABEL=fedora_fedora
timesource --ntp-server=_gateway
# System timezone
timezone Europe/Berlin --utc
# Root password
rootpw --iscrypted $y$j9T$SYQgSGCnU.FUaT7BKMEI9TKz$nLPf1uHlzpoBCmEndvVRK2FnY67wUY2TyxiMUIufH7A