*****************************************************************************
* Основные изменения:
*
* 1. В систему установлены российские корневые сертификаты.
* 
* 2. Обновлена подсистема автоматического определения графического драйвера.
*
* 3. Обновлена тема оформления рабочего стола ULBSD.
*
*****************************************************************************

1. Откройте терминал под учетной записью root (Администратор)

2. Извлеките из архива каталог files в каталог /root/

3. Скопируйте файлы из каталога /root/files (БУДЬТЕ ВНИМАТЕЛЬНЫ!
   ВОЗМОЖНО ВЫ САМОСТОЯТЕЛЬНО ДЕЛАЛИ КАКИЕ-ЛИБО ИЗМЕНЕНИЯ В ЭТИХ ФАЙЛАХ,
   ИЗМЕНЕНИЯ БУДУТ УТЕРЯНЫ), выполнив в терминале следующие команды:

    cp /root/files/cert9.db /usr/local/share/ulbsd/skel/.mozilla/firefox/0kndijbb.default/
    cp /root/files/key4.db /usr/local/share/ulbsd/skel/.mozilla/firefox/0kndijbb.default/
    cp /root/files/xorg.cfg /usr/local/etc/initgfx/
    cp /root/files/initgfx /usr/local/etc/rc.d/
    cp /root/files/load_acpi /usr/local/etc/rc.d/
    cp /root/files/ulbsd-update /usr/local/share/ulbsd/scripts/
    cp /root/files/sesman.ini /usr/local/etc/xrdp/
    cp /root/files/kscreenlockerrc /usr/local/share/ulbsd/skel/.config/

    cp /root/files/load_iichid /usr/local/etc/rc.d/
    chmod +x /usr/local/etc/rc.d/load_iichid

    rm -R /usr/local/share/plasma/desktoptheme/ulbsd/*
    cp -R /root/files/desktoptheme/ulbsd/* /usr/local/share/plasma/desktoptheme/ulbsd/

    rm -R /usr/local/share/plasma/look-and-feel/org.kde.ulbsd/*
    cp -R /root/files/look-and-feel/org.kde.ulbsd/* /usr/local/share/plasma/look-and-feel/org.kde.ulbsd/

    rm -R /usr/local/share/sddm/themes/ulbsd/*
    cp -R /root/files/sddm/themes/ulbsd/* /usr/local/share/sddm/themes/ulbsd/

    cp /root/files/plasma-org.kde.plasma.desktop-appletsrc /usr/local/share/ulbsd/skel/.config/
    cp /root/files/ulbsd.conf /usr/local/etc/pkg/repos/
    cp /root/files/KickoffListView.qml /usr/local/share/ulbsd/compile/kickoff/package/contents/ui/

    rm /usr/local/share/ulbsd/compile/cfgs/usr/local/etc/sddm.conf
    rm -R /usr/local/share/ulbsd/compile/cfgs/usr/local/etc/pam.d
    rm -R /usr/local/etc/sddm
    cp /usr/local/etc/pam.d/sddm.default /usr/local/etc/pam.d/sddm
    cp /usr/local/etc/pam.d/sddm-autologin.default /usr/local/etc/pam.d/sddm-autologin
    mkdir -p /usr/local/etc/sddm.conf.d
    rm /usr/local/etc/sddm.conf
    cp /root/files/sddm.conf /usr/local/etc/sddm.conf.d/

4. Выполните в терминале следующие команды:

    echo 'hint.psm.0.flags="0x3000"' >> /boot/device.hints
    echo 'hw.pci.do_power_nodriver=3' >> /boot/loader.conf

    sysrc kld_list-="ig4"
    sysrc kld_list-="iicbus"
    sysrc kld_list-="iichid"
    sysrc load_iichid_enable="YES"

    sed -i '' -e '/hint.p4tcc.0.disabled/Id' /boot/loader.conf
    sed -i '' -e '/hint.acpi_throttle.0.disabled/Id' /boot/loader.conf

    sed -i '' -e '/kern.evdev.rcpt_mask/Id' /etc/sysctl.conf
    echo 'hw.acpi.verbose=1' >> /etc/sysctl.conf
    echo '#hw.acpi.suspend_state=S3' >> /etc/sysctl.conf
    echo '#hw.acpi.lid_switch_state=S3' >> /etc/sysctl.conf

    echo '#efi_max_resolution="5120x2880"' >> /boot/loader.conf
    echo '#vbe_max_resolution="1920x1080"' >> /boot/loader.conf

    cd /usr/local/share/ulbsd/compile/kickoff
    make install clean

    rm /usr/local/share/ulbsd/scripts/ulbsd-clone*

    pkg delete plasma5-oxygen
    pkg delete kmix
    pkg delete pavucontrol
    pkg autoremove

    pkg install -r latest plasma5-plasma-pa
    pkg install -r latest libva-intel-driver
    pkg install -r latest libva-intel-media-driver
    pkg install -r latest libva-vdpau-driver
    pkg install -r latest octopkg
    pkg install -r latest iwmbt-firmware
    pkg install -r latest plasma5-sddm-kcm

    cp -R /root/files/oxygen-sounds /usr/local/share/ulbsd/commpile/
    cd /usr/local/share/ulbsd/compile/oxygen-sounds/
    pkg install -r latest cmake qt5-buildtools qt5-qmake
    cmake .
    make install clean
    pkg delete cmake qt5-buildtools qt5-qmake
    pkg autoremove

    cd /usr/share/certs/trusted/
    fetch https://gu-st.ru/content/lending/russian_trusted_root_ca_pem.crt -o russian_trusted_root_ca.pem
    fetch https://gu-st.ru/content/lending/russian_trusted_sub_ca_pem.crt -o russian_trusted_sub_ca.pem
    sh -c 'hash=`openssl x509 -noout -hash -in  russian_trusted_root_ca.pem`; ln -s ../../../usr/share/certs/trusted/russian_trusted_root_ca.pem "/etc/ssl/certs/${hash}.0"'
    sh -c 'hash=`openssl x509 -noout -hash -in  russian_trusted_sub_ca.pem`; ln -s ../../../usr/share/certs/trusted/russian_trusted_sub_ca.pem "/etc/ssl/certs/${hash}.0"'

    service ntpd onefetch

    sed -i '' -e '/Variant=/Id' /usr/local/share/ulbsd/compile/cfgs/usr/local/etc/xdg/kcm-about-distrorc
    echo "Variant=2023.02.27" >> /usr/local/share/ulbsd/compile/cfgs/usr/local/etc/xdg/kcm-about-distrorc
    ulbsd-update cfgs

5. Выполните обновление базовой системы и программного обеспечения, как
   описано в документе по ссылке http://www.ulbsd.ru/shop/view/article/56.
