d.patch 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. diff -Nuar calamares-3.1.7/src/modules/dracut/main.py calamares-3.1.71/src/modules/dracut/main.py
  2. --- calamares-3.1.7/src/modules/dracut/main.py 2017-10-23 23:22:25.000000000 +0300
  3. +++ calamares-3.1.71/src/modules/dracut/main.py 1970-01-01 02:00:00.000000000 +0200
  4. @@ -1,47 +0,0 @@
  5. -#!/usr/bin/env python3
  6. -# -*- coding: utf-8 -*-
  7. -#
  8. -# === This file is part of Calamares - <http://github.com/calamares> ===
  9. -#
  10. -# Copyright 2014-2015, Philip Müller <philm@manjaro.org>
  11. -# Copyright 2014, Teo Mrnjavac <teo@kde.org>
  12. -# Copyright 2017, Alf Gaida <agaid@siduction.org>
  13. -#
  14. -# Calamares is free software: you can redistribute it and/or modify
  15. -# it under the terms of the GNU General Public License as published by
  16. -# the Free Software Foundation, either version 3 of the License, or
  17. -# (at your option) any later version.
  18. -#
  19. -# Calamares is distributed in the hope that it will be useful,
  20. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. -# GNU General Public License for more details.
  23. -#
  24. -# You should have received a copy of the GNU General Public License
  25. -# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
  26. -
  27. -import libcalamares
  28. -from libcalamares.utils import target_env_call
  29. -
  30. -
  31. -def run_dracut():
  32. - """
  33. - Creates initramfs, even when initramfs already exists.
  34. -
  35. - :return:
  36. - """
  37. - return target_env_call(['dracut', '-f'])
  38. -
  39. -
  40. -def run():
  41. - """
  42. - Starts routine to create initramfs. It passes back the exit code
  43. - if it fails.
  44. -
  45. - :return:
  46. - """
  47. - return_code = run_dracut()
  48. -
  49. - if return_code != 0:
  50. - return ("Failed to run dracut on the target",
  51. - "The exit code was {}".format(return_code))
  52. diff -Nuar calamares-3.1.7/src/modules/dracut/module.desc calamares-3.1.71/src/modules/dracut/module.desc
  53. --- calamares-3.1.7/src/modules/dracut/module.desc 2017-10-23 23:22:25.000000000 +0300
  54. +++ calamares-3.1.71/src/modules/dracut/module.desc 1970-01-01 02:00:00.000000000 +0200
  55. @@ -1,5 +0,0 @@
  56. ----
  57. -type: "job"
  58. -name: "dracut"
  59. -interface: "python"
  60. -script: "main.py"
  61. diff -Nuar calamares-3.1.7/src/modules/dracutlukscfg/CMakeLists.txt calamares-3.1.71/src/modules/dracutlukscfg/CMakeLists.txt
  62. --- calamares-3.1.7/src/modules/dracutlukscfg/CMakeLists.txt 2017-10-23 23:22:25.000000000 +0300
  63. +++ calamares-3.1.71/src/modules/dracutlukscfg/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
  64. @@ -1,9 +0,0 @@
  65. -calamares_add_plugin( dracutlukscfg
  66. - TYPE job
  67. - EXPORT_MACRO PLUGINDLLEXPORT_PRO
  68. - SOURCES
  69. - DracutLuksCfgJob.cpp
  70. - LINK_PRIVATE_LIBRARIES
  71. - calamares
  72. - SHARED_LIB
  73. -)
  74. diff -Nuar calamares-3.1.7/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp calamares-3.1.71/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp
  75. --- calamares-3.1.7/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp 2017-10-23 23:22:25.000000000 +0300
  76. +++ calamares-3.1.71/src/modules/dracutlukscfg/DracutLuksCfgJob.cpp 1970-01-01 02:00:00.000000000 +0200
  77. @@ -1,168 +0,0 @@
  78. -/* === This file is part of Calamares - <http://github.com/calamares> ===
  79. - *
  80. - * Copyright 2016, Kevin Kofler <kevin.kofler@chello.at>
  81. - *
  82. - * Calamares is free software: you can redistribute it and/or modify
  83. - * it under the terms of the GNU General Public License as published by
  84. - * the Free Software Foundation, either version 3 of the License, or
  85. - * (at your option) any later version.
  86. - *
  87. - * Calamares is distributed in the hope that it will be useful,
  88. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  89. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  90. - * GNU General Public License for more details.
  91. - *
  92. - * You should have received a copy of the GNU General Public License
  93. - * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
  94. - */
  95. -
  96. -#include "DracutLuksCfgJob.h"
  97. -
  98. -#include <QDir>
  99. -#include <QFile>
  100. -#include <QFileInfo>
  101. -#include <QTextStream>
  102. -
  103. -#include "CalamaresVersion.h"
  104. -#include "JobQueue.h"
  105. -#include "GlobalStorage.h"
  106. -
  107. -#include "utils/Logger.h"
  108. -
  109. -// static
  110. -const QLatin1Literal DracutLuksCfgJob::CONFIG_FILE( "/etc/dracut.conf.d/calamares-luks.conf" );
  111. -
  112. -// static
  113. -const char *DracutLuksCfgJob::CONFIG_FILE_HEADER =
  114. - "# Configuration file automatically written by the Calamares system installer\n"
  115. - "# (This file is written once at install time and should be safe to edit.)\n"
  116. - "# Enables support for LUKS full disk encryption with single sign on from GRUB.\n"
  117. - "\n";
  118. -
  119. -// static
  120. -const char *DracutLuksCfgJob::CONFIG_FILE_CRYPTTAB_KEYFILE_LINE =
  121. - "# force installing /etc/crypttab even if hostonly=\"no\", install the keyfile\n"
  122. - "install_items+=\" /etc/crypttab /crypto_keyfile.bin \"\n";
  123. -
  124. -// static
  125. -const char *DracutLuksCfgJob::CONFIG_FILE_CRYPTTAB_LINE =
  126. - "# force installing /etc/crypttab even if hostonly=\"no\"\n"
  127. - "install_items+=\" /etc/crypttab \"\n";
  128. -
  129. -// static
  130. -const QLatin1Literal DracutLuksCfgJob::CONFIG_FILE_SWAPLINE( "# enable automatic resume from swap\nadd_device+=\" /dev/disk/by-uuid/%1 \"\n" );
  131. -
  132. -// static
  133. -QString
  134. -DracutLuksCfgJob::rootMountPoint()
  135. -{
  136. - Calamares::GlobalStorage *globalStorage = Calamares::JobQueue::instance()->globalStorage();
  137. - return globalStorage->value( QStringLiteral( "rootMountPoint" ) ).toString();
  138. -}
  139. -
  140. -// static
  141. -QVariantList
  142. -DracutLuksCfgJob::partitions()
  143. -{
  144. - Calamares::GlobalStorage *globalStorage = Calamares::JobQueue::instance()->globalStorage();
  145. - return globalStorage->value( QStringLiteral( "partitions" ) ).toList();
  146. -}
  147. -
  148. -// static
  149. -bool
  150. -DracutLuksCfgJob::isRootEncrypted()
  151. -{
  152. - const QVariantList partitions = DracutLuksCfgJob::partitions();
  153. - for ( const QVariant &partition : partitions )
  154. - {
  155. - QVariantMap partitionMap = partition.toMap();
  156. - QString mountPoint = partitionMap.value( QStringLiteral( "mountPoint" ) ).toString();
  157. - if ( mountPoint == QStringLiteral( "/" ) )
  158. - return partitionMap.contains( QStringLiteral( "luksMapperName" ) );
  159. - }
  160. - return false;
  161. -}
  162. -
  163. -// static
  164. -bool
  165. -DracutLuksCfgJob::hasUnencryptedSeparateBoot()
  166. -{
  167. - const QVariantList partitions = DracutLuksCfgJob::partitions();
  168. - for ( const QVariant &partition : partitions )
  169. - {
  170. - QVariantMap partitionMap = partition.toMap();
  171. - QString mountPoint = partitionMap.value( QStringLiteral( "mountPoint" ) ).toString();
  172. - if ( mountPoint == QStringLiteral( "/boot" ) )
  173. - return !partitionMap.contains( QStringLiteral( "luksMapperName" ) );
  174. - }
  175. - return false;
  176. -}
  177. -
  178. -// static
  179. -QString
  180. -DracutLuksCfgJob::swapOuterUuid()
  181. -{
  182. - const QVariantList partitions = DracutLuksCfgJob::partitions();
  183. - for ( const QVariant &partition : partitions )
  184. - {
  185. - QVariantMap partitionMap = partition.toMap();
  186. - QString fsType = partitionMap.value( QStringLiteral( "fs" ) ).toString();
  187. - if ( fsType == QStringLiteral( "linuxswap" ) && partitionMap.contains( QStringLiteral( "luksMapperName" ) ) )
  188. - return partitionMap.value( QStringLiteral( "luksUuid" ) ).toString();
  189. - }
  190. - return QString();
  191. -}
  192. -
  193. -DracutLuksCfgJob::DracutLuksCfgJob( QObject* parent )
  194. - : Calamares::CppJob( parent )
  195. -{
  196. -}
  197. -
  198. -
  199. -DracutLuksCfgJob::~DracutLuksCfgJob()
  200. -{
  201. -}
  202. -
  203. -
  204. -QString
  205. -DracutLuksCfgJob::prettyName() const
  206. -{
  207. - if ( isRootEncrypted() )
  208. - return tr( "Write LUKS configuration for Dracut to %1" ).arg( CONFIG_FILE );
  209. - else
  210. - return tr( "Skip writing LUKS configuration for Dracut: \"/\" partition is not encrypted" );
  211. -}
  212. -
  213. -
  214. -Calamares::JobResult
  215. -DracutLuksCfgJob::exec()
  216. -{
  217. - if ( isRootEncrypted() )
  218. - {
  219. - const QString realConfigFilePath = rootMountPoint() + CONFIG_FILE;
  220. - cDebug() << "[DRACUTLUKSCFG]: Writing" << realConfigFilePath;
  221. - QDir( QStringLiteral( "/" ) ).mkpath( QFileInfo( realConfigFilePath ).absolutePath() );
  222. - QFile configFile( realConfigFilePath );
  223. - if ( ! configFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
  224. - {
  225. - cDebug() << "[DRACUTLUKSCFG]: Failed to open" << realConfigFilePath;
  226. - return Calamares::JobResult::error( tr( "Failed to open %1" ).arg( realConfigFilePath ) );
  227. - }
  228. - QTextStream outStream( &configFile );
  229. - outStream << CONFIG_FILE_HEADER
  230. - << ( hasUnencryptedSeparateBoot() ? CONFIG_FILE_CRYPTTAB_LINE
  231. - : CONFIG_FILE_CRYPTTAB_KEYFILE_LINE );
  232. - const QString swapOuterUuid = DracutLuksCfgJob::swapOuterUuid();
  233. - if ( ! swapOuterUuid.isEmpty() )
  234. - {
  235. - cDebug() << "[DRACUTLUKSCFG]: Swap outer UUID" << swapOuterUuid;
  236. - outStream << QString(CONFIG_FILE_SWAPLINE).arg( swapOuterUuid ).toLatin1();
  237. - }
  238. - cDebug() << "[DRACUTLUKSCFG]: Wrote config to" << realConfigFilePath;
  239. - } else
  240. - cDebug() << "[DRACUTLUKSCFG]: / not encrypted, skipping";
  241. -
  242. - return Calamares::JobResult::ok();
  243. -}
  244. -
  245. -CALAMARES_PLUGIN_FACTORY_DEFINITION( DracutLuksCfgJobFactory, registerPlugin<DracutLuksCfgJob>(); )
  246. diff -Nuar calamares-3.1.7/src/modules/dracutlukscfg/DracutLuksCfgJob.h calamares-3.1.71/src/modules/dracutlukscfg/DracutLuksCfgJob.h
  247. --- calamares-3.1.7/src/modules/dracutlukscfg/DracutLuksCfgJob.h 2017-10-23 23:22:25.000000000 +0300
  248. +++ calamares-3.1.71/src/modules/dracutlukscfg/DracutLuksCfgJob.h 1970-01-01 02:00:00.000000000 +0200
  249. @@ -1,60 +0,0 @@
  250. -/* === This file is part of Calamares - <http://github.com/calamares> ===
  251. - *
  252. - * Copyright 2016, Kevin Kofler <kevin.kofler@chello.at>
  253. - * Copyright 2017, Adriaan de Groot <groot@kde.org>
  254. - *
  255. - * Calamares is free software: you can redistribute it and/or modify
  256. - * it under the terms of the GNU General Public License as published by
  257. - * the Free Software Foundation, either version 3 of the License, or
  258. - * (at your option) any later version.
  259. - *
  260. - * Calamares is distributed in the hope that it will be useful,
  261. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  262. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  263. - * GNU General Public License for more details.
  264. - *
  265. - * You should have received a copy of the GNU General Public License
  266. - * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
  267. - */
  268. -
  269. -#ifndef DRACUTLUKSCFGJOB_H
  270. -#define DRACUTLUKSCFGJOB_H
  271. -
  272. -#include <QObject>
  273. -#include <QVariantMap>
  274. -
  275. -#include <CppJob.h>
  276. -
  277. -#include <utils/PluginFactory.h>
  278. -
  279. -#include <PluginDllMacro.h>
  280. -
  281. -class PLUGINDLLEXPORT DracutLuksCfgJob : public Calamares::CppJob
  282. -{
  283. - Q_OBJECT
  284. -
  285. -public:
  286. - explicit DracutLuksCfgJob( QObject* parent = nullptr );
  287. - virtual ~DracutLuksCfgJob() override;
  288. -
  289. - QString prettyName() const override;
  290. -
  291. - Calamares::JobResult exec() override;
  292. -
  293. -private:
  294. - static const QLatin1Literal CONFIG_FILE;
  295. - static const char *CONFIG_FILE_HEADER;
  296. - static const char *CONFIG_FILE_CRYPTTAB_KEYFILE_LINE;
  297. - static const char *CONFIG_FILE_CRYPTTAB_LINE;
  298. - static const QLatin1Literal CONFIG_FILE_SWAPLINE;
  299. -
  300. - static QString rootMountPoint();
  301. - static QVariantList partitions();
  302. - static bool isRootEncrypted();
  303. - static bool hasUnencryptedSeparateBoot();
  304. - static QString swapOuterUuid();
  305. -};
  306. -
  307. -CALAMARES_PLUGIN_FACTORY_DECLARATION( DracutLuksCfgJobFactory )
  308. -
  309. -#endif // DRACUTLUKSCFGJOB_H
  310. diff -Nuar calamares-3.1.7/src/modules/locale/LocalePage.cpp calamares-3.1.71/src/modules/locale/LocalePage.cpp
  311. --- calamares-3.1.7/src/modules/locale/LocalePage.cpp 2017-10-23 23:22:25.000000000 +0300
  312. +++ calamares-3.1.71/src/modules/locale/LocalePage.cpp 2017-11-14 02:27:55.108042084 +0300
  313. @@ -320,7 +320,7 @@
  314. << ". Assuming the supported languages are already built into "
  315. "the locale archive.";
  316. QProcess localeA;
  317. - localeA.start( "locale", QStringList() << "-a" );
  318. + localeA.start( "cat", QStringList() << "/etc/languages" );
  319. localeA.waitForFinished();
  320. ba = localeA.readAllStandardOutput();
  321. }
  322. diff -Nuar calamares-3.1.7/src/modules/localecfg/main.py calamares-3.1.71/src/modules/localecfg/main.py
  323. --- calamares-3.1.7/src/modules/localecfg/main.py 2017-10-23 23:22:25.000000000 +0300
  324. +++ calamares-3.1.71/src/modules/localecfg/main.py 2017-11-14 03:07:20.726123018 +0300
  325. @@ -83,13 +83,14 @@
  326. locale_conf_path = os.path.join(install_path, "etc/locale.conf")
  327. with open(locale_conf_path, "w") as lcf:
  328. for k, v in locale_conf.items():
  329. - lcf.write("{!s}={!s}\n".format(k, v))
  330. + lcf.write("{!s}\n".format( v))
  331. # write /etc/default/locale if /etc/default exists and is a dir
  332. etc_default_path = os.path.join(install_path, "etc/default")
  333. if os.path.isdir(etc_default_path):
  334. with open(os.path.join(etc_default_path, "locale"), "w") as edl:
  335. for k, v in locale_conf.items():
  336. - edl.write("{!s}={!s}\n".format(k, v))
  337. + edl.write("{!s}\n".format( v))
  338. +
  339. return None
  340. diff -Nuar calamares-3.1.7/src/modules/mudur/main.py calamares-3.1.71/src/modules/mudur/main.py
  341. --- calamares-3.1.7/src/modules/mudur/main.py 1970-01-01 02:00:00.000000000 +0200
  342. +++ calamares-3.1.71/src/modules/mudur/main.py 2017-11-14 02:10:42.000000000 +0300
  343. @@ -0,0 +1,64 @@
  344. +#!/usr/bin/env python3
  345. +# -*- coding: utf-8 -*-
  346. +#
  347. +# === This file is part of Calamares - <http://github.com/calamares> ===
  348. +#
  349. +# Copyright 2014, Anke Boersma <demm@kaosx.us>
  350. +# Copyright 2015, Philip Müller <philm@manjaro.org>
  351. +#
  352. +# Calamares is free software: you can redistribute it and/or modify
  353. +# it under the terms of the GNU General Public License as published by
  354. +# the Free Software Foundation, either version 3 of the License, or
  355. +# (at your option) any later version.
  356. +#
  357. +# Calamares is distributed in the hope that it will be useful,
  358. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  359. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  360. +# GNU General Public License for more details.
  361. +#
  362. +# You should have received a copy of the GNU General Public License
  363. +# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
  364. +
  365. +import os
  366. +import shutil
  367. +
  368. +import libcalamares
  369. +
  370. +
  371. +
  372. +def run():
  373. +
  374. + install_path = libcalamares.globalstorage.value("rootMountPoint")
  375. +
  376. +
  377. + path = os.path.join(install_path, "etc/locale.conf")
  378. +
  379. + mloc = open(path,"r")
  380. +
  381. + languages = mloc.readline(2)
  382. +
  383. +
  384. + mudur_file_path = os.path.join(install_path, "etc/conf.d/mudur")
  385. + lines = []
  386. + for l in open(mudur_file_path, "r").readlines():
  387. + if l.strip().startswith('language=') or l.strip().startswith('# language='):
  388. + if languages == "pt":
  389. + l = 'language="pt_BR"\n'
  390. + else:
  391. + l = 'language="%s"\n' % languages
  392. + lines.append(l)
  393. +
  394. + open(mudur_file_path, "w").writelines(lines)
  395. +
  396. + if os.path.exists(os.path.join(install_path, "etc/sudoers")):
  397. + os.unlink(os.path.join(install_path, "etc/sudoers"))
  398. +
  399. +
  400. + source = os.path.join(install_path, "etc/sudoers.orig")
  401. + target = os.path.join(install_path, "etc/sudoers")
  402. +
  403. + shutil.copy(source, target)
  404. +
  405. + libcalamares.utils.target_env_call(['chmod', '440', '/etc/sudoers'])
  406. +
  407. + return None
  408. diff -Nuar calamares-3.1.7/src/modules/mudur/module.desc calamares-3.1.71/src/modules/mudur/module.desc
  409. --- calamares-3.1.7/src/modules/mudur/module.desc 1970-01-01 02:00:00.000000000 +0200
  410. +++ calamares-3.1.71/src/modules/mudur/module.desc 2017-11-14 02:10:42.000000000 +0300
  411. @@ -0,0 +1,5 @@
  412. +---
  413. +type: "job"
  414. +name: "mudur"
  415. +interface: "python"
  416. +script: "main.py"
  417. diff -Nuar calamares-3.1.7/src/modules/services/main.py calamares-3.1.71/src/modules/services/main.py
  418. --- calamares-3.1.7/src/modules/services/main.py 2017-10-23 23:22:25.000000000 +0300
  419. +++ calamares-3.1.71/src/modules/services/main.py 1970-01-01 02:00:00.000000000 +0200
  420. @@ -1,101 +0,0 @@
  421. -#!/usr/bin/env python3
  422. -# -*- coding: utf-8 -*-
  423. -#
  424. -# === This file is part of Calamares - <http://github.com/calamares> ===
  425. -#
  426. -# Copyright 2014, Philip Müller <philm@manjaro.org>
  427. -# Copyright 2014, Teo Mrnjavac <teo@kde.org>
  428. -# Copyright 2017, Alf Gaida <agaida@siduction.org>
  429. -#
  430. -# Calamares is free software: you can redistribute it and/or modify
  431. -# it under the terms of the GNU General Public License as published by
  432. -# the Free Software Foundation, either version 3 of the License, or
  433. -# (at your option) any later version.
  434. -#
  435. -# Calamares is distributed in the hope that it will be useful,
  436. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  437. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  438. -# GNU General Public License for more details.
  439. -#
  440. -# You should have received a copy of the GNU General Public License
  441. -# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
  442. -
  443. -import libcalamares
  444. -
  445. -
  446. -def run():
  447. - """
  448. - Setup systemd services
  449. - """
  450. - services = libcalamares.job.configuration['services']
  451. - targets = libcalamares.job.configuration['targets']
  452. - disable = libcalamares.job.configuration['disable']
  453. -
  454. - # note that the "systemctl enable" and "systemctl disable" commands used
  455. - # here will work in a chroot; in fact, they are the only systemctl commands
  456. - # that support that, see:
  457. - # http://0pointer.de/blog/projects/changing-roots.html
  458. -
  459. - # enable services
  460. - for svc in services:
  461. - ec = libcalamares.utils.target_env_call(
  462. - ['systemctl', 'enable', '{}.service'.format(svc['name'])]
  463. - )
  464. -
  465. - if ec != 0:
  466. - if svc['mandatory']:
  467. - return ("Cannot enable systemd service {}".format(svc['name']),
  468. - "systemctl enable call in chroot returned error code "
  469. - "{}".format(ec)
  470. - )
  471. - else:
  472. - libcalamares.utils.debug(
  473. - "Cannot enable systemd service {}".format(svc['name'])
  474. - )
  475. - libcalamares.utils.debug(
  476. - "systemctl enable call in chroot returned error code "
  477. - "{}".format(ec)
  478. - )
  479. -
  480. - # enable targets
  481. - for tgt in targets:
  482. - ec = libcalamares.utils.target_env_call(
  483. - ['systemctl', 'enable', '{}.target'.format(tgt['name'])]
  484. - )
  485. -
  486. - if ec != 0:
  487. - if tgt['mandatory']:
  488. - return ("Cannot enable systemd target {}".format(tgt['name']),
  489. - "systemctl enable call in chroot returned error code"
  490. - "{}".format(ec)
  491. - )
  492. - else:
  493. - libcalamares.utils.debug(
  494. - "Cannot enable systemd target {}".format(tgt['name'])
  495. - )
  496. - libcalamares.utils.debug(
  497. - "systemctl enable call in chroot returned error code "
  498. - "{}".format(ec)
  499. - )
  500. -
  501. - for dbl in disable:
  502. - ec = libcalamares.utils.target_env_call(
  503. - ['systemctl', 'disable', '{}.service'.format(dbl['name'])]
  504. - )
  505. -
  506. - if ec != 0:
  507. - if dbl['mandatory']:
  508. - return ("Cannot disable systemd service"
  509. - "{}".format(dbl['name']),
  510. - "systemctl disable call in chroot returned error code"
  511. - "{}".format(ec))
  512. - else:
  513. - libcalamares.utils.debug(
  514. - "Cannot disable systemd service {}".format(dbl['name'])
  515. - )
  516. - libcalamares.utils.debug(
  517. - "systemctl disable call in chroot returned error code "
  518. - "{}".format(ec)
  519. - )
  520. -
  521. - return None
  522. diff -Nuar calamares-3.1.7/src/modules/services/module.desc calamares-3.1.71/src/modules/services/module.desc
  523. --- calamares-3.1.7/src/modules/services/module.desc 2017-10-23 23:22:25.000000000 +0300
  524. +++ calamares-3.1.71/src/modules/services/module.desc 1970-01-01 02:00:00.000000000 +0200
  525. @@ -1,6 +0,0 @@
  526. ----
  527. -type: "job"
  528. -name: "services"
  529. -interface: "python"
  530. -requires: []
  531. -script: "main.py"
  532. diff -Nuar calamares-3.1.7/src/modules/services/services.conf calamares-3.1.71/src/modules/services/services.conf
  533. --- calamares-3.1.7/src/modules/services/services.conf 2017-10-23 23:22:25.000000000 +0300
  534. +++ calamares-3.1.71/src/modules/services/services.conf 1970-01-01 02:00:00.000000000 +0200
  535. @@ -1,20 +0,0 @@
  536. ----
  537. -#systemd services and targets are enabled in this precise order
  538. -
  539. -services:
  540. - - name: "NetworkManager" #name of the service file
  541. - mandatory: false #true=> if enabling fails the installer errors out and quits
  542. - #false=>if enabling fails print warning to console and continue
  543. - - name: "cups"
  544. - mandatory: false
  545. -
  546. -targets:
  547. - - name: "graphical"
  548. - mandatory: true
  549. -
  550. -disable:
  551. - - name: "pacman-init"
  552. - mandatory: false
  553. -
  554. -# Example to express an empty list:
  555. -# disable: []