mirror of
https://abf.rosa.ru/djam/calamares.git
synced 2025-02-23 23:52:50 +00:00
add systemd services to start calamares on install boot option
This commit is contained in:
parent
40c7312c1d
commit
30ef2d33d1
3 changed files with 76 additions and 1 deletions
33
calamares-install-start
Normal file
33
calamares-install-start
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
# tpgxyz@gmail.com
|
||||
|
||||
if grep -q '\binstall\b' /proc/cmdline; then
|
||||
. /etc/locale.conf
|
||||
|
||||
# ensure plymouth really has stopped
|
||||
if pgrep "plymouthd" > /dev/null 2>&1; then
|
||||
/bin/plymouth quit
|
||||
fi
|
||||
|
||||
/bin/systemctl stop crond.service &
|
||||
|
||||
xset -dpms
|
||||
xset s off
|
||||
|
||||
if [ -e /usr/bin/startx ] && [ -x /usr/bin/calamares ]; then
|
||||
/usr/bin/startx /usr/bin/calamares $* -- -dpi 96 vt1 -background none
|
||||
else
|
||||
echo "calamares-install: critical programs are missing, check your system!"
|
||||
fi
|
||||
|
||||
# check if we are booted from cd drom to eject it
|
||||
blkid /dev/sr0 >/dev/null 2>&1
|
||||
if [[ $? -eq 0 ]]; then
|
||||
eject
|
||||
sleep 10
|
||||
fi
|
||||
|
||||
sync
|
||||
reboot
|
||||
|
||||
fi
|
27
calamares.service
Normal file
27
calamares.service
Normal file
|
@ -0,0 +1,27 @@
|
|||
[Unit]
|
||||
Description=Calamares installer
|
||||
DefaultDependencies=no
|
||||
After=livesys-late.service systemd-user-sessions.service getty@tty1.service plymouth-quit.service
|
||||
Conflicts=getty@tty1.service
|
||||
Conflicts=getty@%i.service
|
||||
Conflicts=display-manager.serivce
|
||||
Before=display-manager.serivce
|
||||
Before=getty.target
|
||||
|
||||
|
||||
[Service]
|
||||
Type=idle
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
ConditionKernelCommandLine=|install
|
||||
ExecStart=/usr/sbin/calamares-install-start
|
||||
ExecReload=/usr/bin/killall X
|
||||
ExecStop=/usr/bin/killall X
|
||||
StandardInput=null
|
||||
StandardOutput=kmsg+console
|
||||
StandardError=kmsg+console
|
||||
KillMode=process
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -8,7 +8,7 @@
|
|||
Summary: Distribution-independent installer framework
|
||||
Name: calamares
|
||||
Version: 0.17.0
|
||||
Release: 0.%{calamdate}.3
|
||||
Release: 0.%{calamdate}.4
|
||||
Group: System/Configuration/Other
|
||||
License: GPLv3+
|
||||
URL: http://calamares.io/
|
||||
|
@ -17,6 +17,8 @@ Source0: calamares-%{version}-%{calamdate}.tar.xz
|
|||
# https://github.com/calamares/partitionmanager
|
||||
Source1: calamares-partitionmanager-%{partdate}.tar.xz
|
||||
Source2: calamares.rpmlintrc
|
||||
Source3: %{name}.service
|
||||
Source4: %{name}-install-start
|
||||
Patch0: calamares-0.17.0-20150112-openmandriva-settings.patch
|
||||
Patch1: calamares-0.17.0-20150112-openmandriva-desktop-file.patch
|
||||
Patch2: calamares-0.17.0-20150112-urpmi-options.patch
|
||||
|
@ -125,6 +127,16 @@ touch %{buildroot}%{_datadir}/calamares/branding/auto/branding.desc
|
|||
mkdir -p %{buildroot}%{_sysconfdir}/calamares/modules
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/calamares/branding
|
||||
|
||||
# (tpg) service files
|
||||
mkdir -p %{buildroot}{%{_unitdir},%{_sbindir}}
|
||||
install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
|
||||
install -m 755 %{SOURCE4} %{buildroot}%{_sbindir}/%{name}-install-start
|
||||
|
||||
install -d %{buildroot}%{_presetdir}
|
||||
cat > %{buildroot}%{_presetdir}/90-%{name}.preset << EOF
|
||||
enable %{name}.service
|
||||
EOF
|
||||
|
||||
%post
|
||||
# generate the "auto" branding
|
||||
. %{_sysconfdir}/os-release
|
||||
|
@ -157,6 +169,9 @@ EOF
|
|||
%dir %{_datadir}/calamares
|
||||
%dir %{_datadir}/calamares/branding
|
||||
%dir %{_datadir}/calamares/branding/auto
|
||||
%{_presetdir}/90-%{name}.preset
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_sbindir}/%{name}-install-start
|
||||
%{_bindir}/calamares
|
||||
%{_datadir}/calamares/settings.conf
|
||||
%{_datadir}/calamares/branding/default/
|
||||
|
|
Loading…
Add table
Reference in a new issue