Files
os-installer/example_config/scripts/install.sh
Peter Eisenmann eddcfd4bf0 Add desktop page
2024-10-09 00:56:47 -05:00

53 lines
1.8 KiB
Bash
Executable File

#! /bin/sh
# This is an example installer script. For OS-Installer to use it, place it at:
# /etc/os-installer/scripts/install.sh
# The script gets called with the following environment variables set:
# OSI_DESKTOP : Desktop keyword, or empty if 'desktop' was not configured
# OSI_LOCALE : Locale to be used in the new system
# OSI_DEVICE_PATH : Device path at which to install
# OSI_DEVICE_IS_PARTITION : 1 if the specified device is a partition (0 -> disk)
# OSI_DEVICE_EFI_PARTITION: Set if device is partition and system uses EFI boot.
# OSI_USE_ENCRYPTION : 1 if the installation is to be encrypted
# OSI_ENCRYPTION_PIN : The encryption pin to use (if encryption is set)
# sanity check that all variables were set
if [ -z ${OSI_DESKTOP+x} ] || \
[ -z ${OSI_LOCALE+x} ] || \
[ -z ${OSI_KEYBOARD_LAYOUT+x} ] || \
[ -z ${OSI_DEVICE_PATH+x} ] || \
[ -z ${OSI_DEVICE_IS_PARTITION+x} ] || \
[ -z ${OSI_DEVICE_EFI_PARTITION+x} ] || \
[ -z ${OSI_USE_ENCRYPTION+x} ] || \
[ -z ${OSI_ENCRYPTION_PIN+x} ]
then
echo "Installer script called without all environment variables set!"
exit 1
fi
echo 'Installation started.'
echo ''
echo 'Variables set to:'
echo 'OSI_DESKTOP ' $OSI_DESKTOP
echo 'OSI_LOCALE ' $OSI_LOCALE
echo 'OSI_KEYBOARD_LAYOUT ' $OSI_KEYBOARD_LAYOUT
echo 'OSI_DEVICE_PATH ' $OSI_DEVICE_PATH
echo 'OSI_DEVICE_IS_PARTITION ' $OSI_DEVICE_IS_PARTITION
echo 'OSI_DEVICE_EFI_PARTITION ' $OSI_DEVICE_EFI_PARTITION
echo 'OSI_USE_ENCRYPTION ' $OSI_USE_ENCRYPTION
echo 'OSI_ENCRYPTION_PIN ' $OSI_ENCRYPTION_PIN
echo ''
# Pretending to do something
echo 'Pretending to do something'
for i in {1..20}
do
sleep 1
echo -n '.'
done
echo
echo 'Installation completed.'
exit 0