Skip to content

Commit 9c85fe7

Browse files
authored
Merge branch '17g-installer:master' into master
2 parents ca0d9a8 + cb73afa commit 9c85fe7

9 files changed

Lines changed: 1128 additions & 389 deletions

File tree

live-installer/configs/distribution/debian.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: debian
22
check_this_dir: /etc/debian_version
33
grub_prepare:
44
- bash scripts/fetch-pkg-debian.sh
5-
grub_installation_efi: chroot||grub-install --bootloader-id={distro_codename} --force {disk}
5+
grub_installation_efi: chroot||grub-install --bootloader-id={distro_codename} --force {disk} || grub-install --removable --force {disk}
66
grub_installation_legacy: chroot||grub-install --force {disk}
77
run_before_user_creation:
88
- echo "Creating users"

live-installer/configs/package_managers/apt.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ check_this_dir: /var/lib/dpkg
33
create_rootfs: debootstrap --no-merged-usr stable /target
44
install_package: apt install {packages} --yes
55
remove_package: apt remove {packages} --yes
6-
remove_package_with_unusing_deps: apt purge {packages} --yes && apt autoremove --yes
6+
remove_package_with_unusing_deps: apt autoremove --purge {packages} --yes
77
remove_package_with_needed_packages: apt purge {packages} --yes
88
full_system_update: chroot /target apt update -yq && chroot /target apt -yq -o Dpkg::Options::="--force-confnew" full-upgrade

live-installer/frontend/gtk_interface.py

Lines changed: 250 additions & 89 deletions
Large diffs are not rendered by default.

live-installer/frontend/partitioning.py

Lines changed: 286 additions & 29 deletions
Large diffs are not rendered by default.

live-installer/installer.py

Lines changed: 97 additions & 71 deletions
Large diffs are not rendered by default.

live-installer/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
def set_logfile(path):
88
if os.getuid() != 0:
99
return
10-
global logfile
10+
global logfile, _file
1111
if logfile:
1212
logfile.flush()
1313
logfile.close()
1414
if os.path.isfile(path):
1515
os.unlink(path)
16+
_file=path
1617
logfile = open(path,"a")
1718

1819
if os.getuid() != 0:

live-installer/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from frontend import *
66
from frontend.dialogs import ErrorDialog
77

8+
single_instance()
9+
10+
811
gettext.install("live-installer", "/usr/share/locale")
912
sys.path.insert(1, '/lib/live-installer')
1013
if (os.path.isdir("/lib/live-installer")):

live-installer/resources/interface.ui

Lines changed: 471 additions & 196 deletions
Large diffs are not rendered by default.

live-installer/utils.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import os
32
import subprocess
43
import sys
@@ -134,3 +133,20 @@ def set_governor(governor):
134133
while os.path.exists("{}cpu{}{}".format(path, str(i), node)):
135134
os.system("echo {} > {}cpu{}{}".format(governor, path, str(i), node))
136135
i += 1
136+
137+
def single_instance():
138+
pidfile = "/run/live-installer.pid"
139+
def writepid():
140+
with open(pidfile, "w") as f:
141+
f.write(str(os.getpid()))
142+
143+
try:
144+
if os.path.isfile(pidfile):
145+
with open(pidfile, "r") as f:
146+
pid = f.read()
147+
if os.path.isdir(f"/proc/{pid}"):
148+
exit(0)
149+
writepid()
150+
except Exception as e:
151+
print(e)
152+
sys.exit(0)

0 commit comments

Comments
 (0)