penguins-eggs 9.6.21 → 9.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,9 @@ class Ovary {
54
54
  this.cryptedclone = false;
55
55
  this.cliAutologin = new cli_autologin_1.default();
56
56
  this.ovarium = '';
57
+ /**
58
+ * END CLASS ovary
59
+ */
57
60
  }
58
61
  /**
59
62
  * @returns {boolean} success
@@ -86,10 +89,19 @@ class Ovary {
86
89
  return false;
87
90
  }
88
91
  /**
89
- *
90
- * @param basename
92
+ * produce
93
+ * @param clone
94
+ * @param cryptedclone
95
+ * @param scriptOnly
96
+ * @param yolkRenew
97
+ * @param release
98
+ * @param myAddons
99
+ * @param nointeractive
100
+ * @param noicons
101
+ * @param unsecure
102
+ * @param verbose
91
103
  */
92
- async produce(clone = false, cryptedclone = false, scriptOnly = false, yolkRenew = false, release = false, myAddons, nointeractive = false, noicons = false, unsecure = false, verbose = false) {
104
+ async produce(clone = false, cryptedclone = false, scriptOnly = false, yolkRenew = false, release = false, myAddons, filters, nointeractive = false, noicons = false, unsecure = false, verbose = false) {
93
105
  this.verbose = verbose;
94
106
  this.echo = utils_2.default.setEcho(verbose);
95
107
  if (this.verbose) {
@@ -104,16 +116,16 @@ class Ovary {
104
116
  if (this.familyId === 'debian' && utils_2.default.uefiArch() === 'amd64') {
105
117
  const yolk = new yolk_1.default();
106
118
  if (!yolk.exists()) {
107
- utils_2.default.warning('Create yolk');
119
+ utils_2.default.warning('creating yolk');
108
120
  await yolk.create(verbose);
109
121
  }
110
122
  else if (yolkRenew) {
111
- utils_2.default.warning('Renew yolk');
123
+ utils_2.default.warning('refreshing yolk');
112
124
  await yolk.erase();
113
125
  await yolk.create(verbose);
114
126
  }
115
127
  else {
116
- utils_2.default.warning('Using preesixent yolk');
128
+ utils_2.default.warning('using preesixent yolk');
117
129
  }
118
130
  }
119
131
  if (!fs_1.default.existsSync(this.settings.config.snapshot_dir)) {
@@ -135,7 +147,9 @@ class Ovary {
135
147
  await bleach.clean(verbose);
136
148
  }
137
149
  }
138
- // CRYPTEDCLONE
150
+ /**
151
+ * cryptedclone
152
+ */
139
153
  if (cryptedclone) {
140
154
  console.log('eggs will SAVE users and users\' data ENCRYPTED on LUKS volume within the live');
141
155
  const users = await this.usersFill();
@@ -151,21 +165,54 @@ class Ovary {
151
165
  }
152
166
  }
153
167
  }
154
- // CLONE
168
+ /**
169
+ * clone
170
+ *
171
+ * users tend to set user_opt as
172
+ * real user when create a clone,
173
+ * this is WRONG here we correct
174
+ */
155
175
  }
156
176
  else if (this.clone) {
157
- // Patch for humans users used to
158
- // set user_opt as real user when
159
- // create a clone
160
- this.settings.config.user_opt = 'live';
177
+ this.settings.config.user_opt = 'live'; // patch for humans
161
178
  this.settings.config.user_opt_passwd = 'evolution';
162
179
  this.settings.config.root_passwd = 'evolution';
163
180
  utils_2.default.warning('eggs will SAVE users and users\' data UNCRYPTED on the live');
164
- // NORMAL
181
+ /**
182
+ * normal
183
+ */
165
184
  }
166
185
  else {
167
186
  utils_2.default.warning('eggs will REMOVE users and users\' data from live');
168
187
  }
188
+ /**
189
+ * exclude.list
190
+ */
191
+ let excludeListTemplateDir = '/etc/penguins-eggs.d/exclude.list.d/';
192
+ let excludeListTemplate = excludeListTemplateDir + 'exclude.list.template';
193
+ if (!fs_1.default.existsSync(excludeListTemplate)) {
194
+ utils_2.default.warning('Cannot find: ' + excludeListTemplate);
195
+ process.exit(1);
196
+ }
197
+ let excludeCustom = '';
198
+ let excludeDev = '';
199
+ let excludeHomes = '';
200
+ if (filters.custom) {
201
+ excludeCustom = fs_1.default.readFileSync(`${excludeListTemplateDir}exclude.list.custom`, 'utf8');
202
+ }
203
+ if (filters.dev) {
204
+ excludeDev = `home/${await utils_2.default.getPrimaryUser()}/*`;
205
+ }
206
+ if (filters.homes) {
207
+ excludeHomes = fs_1.default.readFileSync(`${excludeListTemplateDir}exclude.list.homes`, 'utf8');
208
+ }
209
+ let view = {
210
+ exclude_list_custom: excludeCustom,
211
+ exclude_list_dev: excludeDev,
212
+ exclude_list_homes: excludeHomes,
213
+ };
214
+ const template = fs_1.default.readFileSync(excludeListTemplate, 'utf8');
215
+ fs_1.default.writeFileSync(this.settings.config.snapshot_excludes, mustache_1.default.render(template, view));
169
216
  /**
170
217
  * NOTE: reCreate = false
171
218
  *
@@ -188,10 +235,10 @@ class Ovary {
188
235
  * initrd for different familis
189
236
  */
190
237
  if (this.familyId === 'debian') {
191
- await this.initrdCopy();
238
+ await this.initrdDebian();
192
239
  }
193
240
  else if (this.familyId === 'archlinux') {
194
- await this.initrdCreate();
241
+ await this.initrdArch();
195
242
  }
196
243
  if (this.settings.config.make_efi) {
197
244
  await this.makeEfi(this.theme);
@@ -241,10 +288,11 @@ class Ovary {
241
288
  let uname = (await (0, utils_1.exec)('uname -r', { capture: true })).data;
242
289
  uname = uname.replaceAll('\n', '');
243
290
  let content = '';
291
+ content = '#!/usr/bin/env bash';
244
292
  content += 'mkdir /live/bin -p\n';
245
293
  content += '## \n';
246
- content += 'cp /usr/lib/penguins-eggs/scripts/non-live-cmdline /live/bin -p\n';
247
- content += 'chmod +x /live/bin/non-live-cmdline\n';
294
+ content += '# cp /usr/lib/penguins-eggs/scripts/non-live-cmdline /live/bin -p\n';
295
+ content += '# chmod +x /live/bin/non-live-cmdline\n';
248
296
  content += '## \n';
249
297
  content += 'mkdir /live/boot-dev/antiX -p\n';
250
298
  content += 'ln -s /run/live/medium/live/filesystem.squashfs /live/boot-dev/antiX/linuxfs\n';
@@ -274,7 +322,6 @@ class Ovary {
274
322
  hashExt = '.md5';
275
323
  }
276
324
  await (0, utils_1.exec)(`mkdir ${this.settings.iso_work}${pathName}/x86_64 -p`, this.echo);
277
- // await exec(`ln -s ${this.settings.iso_work}live/filesystem.squashfs ${this.settings.iso_work}${pathName}.sfs`, this.echo)
278
325
  await (0, utils_1.exec)(`mv ${this.settings.iso_work}live/filesystem.squashfs ${this.settings.iso_work}${pathName}.sfs`, this.echo);
279
326
  await (0, utils_1.exec)(`${hashCmd} ${this.settings.iso_work}${pathName}.sfs > ${this.settings.iso_work}${pathName}${hashExt}`, this.echo);
280
327
  }
@@ -288,7 +335,7 @@ class Ovary {
288
335
  if (this.verbose) {
289
336
  console.log('Ovary: liveCreateStructure');
290
337
  }
291
- utils_2.default.warning(`Creating egg in ${this.settings.config.snapshot_dir}`);
338
+ utils_2.default.warning(`creating egg in ${this.settings.config.snapshot_dir}`);
292
339
  let cmd;
293
340
  if (!fs_1.default.existsSync(this.settings.config.snapshot_dir)) {
294
341
  cmd = `mkdir -p ${this.settings.config.snapshot_dir}`;
@@ -442,7 +489,6 @@ class Ovary {
442
489
  */
443
490
  if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/crypttab`)) {
444
491
  await (0, utils_1.exec)(`rm ${this.settings.work_dir.merged}/etc/crypttab`, this.echo);
445
- // await exec(`touch ${this.settings.work_dir.merged}/etc/crypttab`, echo)
446
492
  }
447
493
  /**
448
494
  * Blank out systemd machine id.
@@ -575,12 +621,14 @@ class Ovary {
575
621
  await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/dev/shm`, this.echo);
576
622
  }
577
623
  /**
578
- * Assegno 1777 a /tmp
579
- * creava problemi con MXLINUX
624
+ * creo /tmp
580
625
  */
581
626
  if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/tmp`)) {
582
627
  await (0, utils_1.exec)(`mkdir ${this.settings.work_dir.merged}/tmp`, this.echo);
583
628
  }
629
+ /**
630
+ * Assegno 1777 a /tmp creava problemi con MXLINUX
631
+ */
584
632
  await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/tmp`, this.echo);
585
633
  }
586
634
  }
@@ -690,12 +738,10 @@ class Ovary {
690
738
  return kp;
691
739
  }
692
740
  /**
693
- * copy kernel
741
+ * kernelCopy
694
742
  */
695
743
  async kernelCopy() {
696
- if (this.verbose) {
697
- console.log('Ovary: kernelCopy');
698
- }
744
+ utils_2.default.warning(`copying ${node_path_1.default.basename(this.settings.kernel_image)} on ISO/live`);
699
745
  let lackVmlinuzImage = false;
700
746
  if (fs_1.default.existsSync(this.settings.kernel_image)) {
701
747
  await (0, utils_1.exec)(`cp ${this.settings.kernel_image} ${this.settings.iso_work}live/`, this.echo);
@@ -711,12 +757,11 @@ class Ovary {
711
757
  }
712
758
  }
713
759
  /**
760
+ * initrdArch()
714
761
  * necessita di echoYes
715
762
  */
716
- async initrdCreate() {
717
- if (this.verbose) {
718
- console.log('Ovary: initrdCreate');
719
- }
763
+ async initrdArch() {
764
+ utils_2.default.warning(`creating ${node_path_1.default.basename(this.settings.initrdImg)} on ISO/live`);
720
765
  let initrdImg = utils_2.default.initrdImg();
721
766
  initrdImg = initrdImg.slice(Math.max(0, initrdImg.lastIndexOf('/') + 1));
722
767
  utils_2.default.warning(`Creating ${initrdImg} in ${this.settings.iso_work}live/`);
@@ -732,12 +777,9 @@ class Ovary {
732
777
  * We must upgrade to initrdCreate for Debian/Ubuntu
733
778
  * @returns
734
779
  */
735
- async initrdCopy(verbose = false) {
736
- if (this.verbose) {
737
- console.log('Ovary: initrdCopy');
738
- }
780
+ async initrdDebian(verbose = false) {
781
+ utils_2.default.warning(`creating ${node_path_1.default.basename(this.settings.initrdImg)} on ISO/live`);
739
782
  let isCrypted = false;
740
- utils_2.default.warning('initrdCreate');
741
783
  if (fs_1.default.existsSync('/etc/crypttab')) {
742
784
  isCrypted = true;
743
785
  await (0, utils_1.exec)('mv /etc/crypttab /etc/crypttab.saved', this.echo);
@@ -746,26 +788,6 @@ class Ovary {
746
788
  if (isCrypted) {
747
789
  await (0, utils_1.exec)('mv /etc/crypttab.saved /etc/crypttab', this.echo);
748
790
  }
749
- /*
750
-
751
- Utils.warning(`initrdCopy`)
752
- if (this.verbose) {
753
- console.log('ovary: initrdCopy')
754
- }
755
- let lackInitrdImage = false
756
- if (fs.existsSync(this.settings.initrd_image)) {
757
- await exec(`cp ${this.settings.initrd_image} ${this.settings.iso_work}/live/`, this.echo)
758
- } else {
759
- Utils.error(`Cannot find ${this.settings.initrdImg}`)
760
- lackInitrdImage = true
761
- }
762
-
763
- if (lackInitrdImage) {
764
- Utils.warning('Try to edit /etc/penguins-eggs.d/eggs.yaml and check for')
765
- Utils.warning(`initrd_img: ${this.settings.initrd_image}`)
766
- process.exit(1)
767
- }
768
- */
769
791
  }
770
792
  /**
771
793
  * squashFs: crea in live filesystem.squashfs
@@ -806,7 +828,6 @@ class Ovary {
806
828
  * secure
807
829
  */
808
830
  if (!unsecure) {
809
- this.addRemoveExclusion(true, `home/*/*`);
810
831
  this.addRemoveExclusion(true, `root/*`);
811
832
  this.addRemoveExclusion(true, `root/.*`);
812
833
  }
@@ -825,14 +846,20 @@ class Ovary {
825
846
  if (utils_2.default.uefiArch() === 'arm64') {
826
847
  // limit = ' -processors 2 -mem 1024M'
827
848
  }
828
- // SYNTAX: mksquashfs source1 source2 ...
829
- // FILESYSTEM [OPTIONS]
830
- // [-e list of exclude dirs/files]
849
+ /**
850
+ * mksquashfs
851
+ *
852
+ * SYNTAX: mksquashfs source1 source2 ...
853
+ * FILESYSTEM [OPTIONS]
854
+ * [-ef exclude.list]
855
+ * [-e list of exclude dirs/files]
856
+ */
831
857
  let cmd = `mksquashfs ${this.settings.work_dir.merged} ${this.settings.iso_work}live/filesystem.squashfs ${compression} ${limit} -wildcards -ef ${this.settings.config.snapshot_excludes} ${this.settings.session_excludes}`;
832
858
  cmd = cmd.replace(/\s\s+/g, ' ');
833
859
  utils_2.default.writeX(`${this.settings.work_dir.ovarium}mksquashfs`, cmd);
834
860
  if (!scriptOnly) {
835
- utils_2.default.warning('squashing filesystem: ' + compression);
861
+ utils_2.default.warning('creating filesystem.squashfs on ISO/live');
862
+ // Utils.warning(`compression: ` + compression)
836
863
  const test = (await (0, utils_1.exec)(cmd, utils_2.default.setEcho(true))).code;
837
864
  if (test !== 0) {
838
865
  process.exit();
@@ -855,7 +882,8 @@ class Ovary {
855
882
  if (this.verbose) {
856
883
  console.log('Ovary: mergedAndOverlay');
857
884
  }
858
- const mountDirs = ['boot', 'etc', 'usr', 'var'];
885
+ // boot viene copiato... non ricordo perchè
886
+ const mountDirs = ['etc', 'usr', 'var'];
859
887
  let mountDir = '';
860
888
  let overlay = false;
861
889
  for (mountDir of mountDirs) {
@@ -999,6 +1027,8 @@ class Ovary {
999
1027
  }
1000
1028
  /**
1001
1029
  * copyBoot
1030
+ *
1031
+ * necessario: prima era merged
1002
1032
  */
1003
1033
  async copyBoot() {
1004
1034
  if (this.verbose) {
@@ -1362,7 +1392,7 @@ class Ovary {
1362
1392
  if (fs_1.default.existsSync(memdiskDir)) {
1363
1393
  await (0, utils_1.exec)(`rm ${memdiskDir} -rf`, this.echo);
1364
1394
  }
1365
- utils_2.default.warning('creating memdiskDir: ' + memdiskDir);
1395
+ utils_2.default.warning('creating temporary memdiskDir on ' + memdiskDir);
1366
1396
  await (0, utils_1.exec)(`mkdir ${memdiskDir}`);
1367
1397
  await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot`, this.echo);
1368
1398
  await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot/grub`, this.echo);
@@ -1382,7 +1412,7 @@ class Ovary {
1382
1412
  if (fs_1.default.existsSync(efiWorkDir)) {
1383
1413
  await (0, utils_1.exec)(`rm ${efiWorkDir} -rf`, this.echo);
1384
1414
  }
1385
- utils_2.default.warning('creating efiWordDir: ' + efiWorkDir);
1415
+ utils_2.default.warning('creating temporary efiWordDir on ' + efiWorkDir);
1386
1416
  await (0, utils_1.exec)(`mkdir ${efiWorkDir}`, this.echo);
1387
1417
  await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot`, this.echo);
1388
1418
  await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot/grub`, this.echo);
@@ -1561,9 +1591,6 @@ class Ovary {
1561
1591
  }
1562
1592
  const volid = utils_2.default.getVolid(this.settings.remix.name);
1563
1593
  let prefix = this.settings.config.snapshot_prefix;
1564
- if (prefix.endsWith('rolling-')) {
1565
- prefix = prefix.substring(0, prefix.indexOf('rolling-'));
1566
- }
1567
1594
  let typology = '';
1568
1595
  // typology is applied only with standard egg-of
1569
1596
  if (prefix.slice(0, 7) === 'egg-of_') {
@@ -1595,7 +1622,7 @@ class Ovary {
1595
1622
  utils_2.default.warning(`Can't create isohybrid image. File: ${isolinuxFile} not found. \nThe resulting image will be a standard iso file`);
1596
1623
  }
1597
1624
  }
1598
- // uefi_opt="-eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot"
1625
+ // uefi_opt="-uefi_elToritoAltBoot-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot"
1599
1626
  let uefi_elToritoAltBoot = '';
1600
1627
  let uefi_e = '';
1601
1628
  let uefi_isohybridGptBasdat = '';
@@ -1636,7 +1663,7 @@ class Ovary {
1636
1663
  * -boot-load-size 4
1637
1664
  * -boot-info-table
1638
1665
  * -no-emul-boot
1639
- * -eltorito-alt-boot
1666
+ * -uefi_elToritoAltBoot-alt-boot
1640
1667
  * -e boot/grub/efi.img
1641
1668
  * -no-emul-boot
1642
1669
  * -isohybrid-gpt-basdat
@@ -1657,7 +1684,7 @@ class Ovary {
1657
1684
  -boot-load-size 4 \
1658
1685
  -boot-info-table \
1659
1686
  -no-emul-boot \
1660
- ${uefi_elToritoAltBoot} \
1687
+ ${uefi_eltoritoAltBoot} \
1661
1688
  ${uefi_e} \
1662
1689
  ${uefi_noEmulBoot} \
1663
1690
  ${uefi_isohybridGptBasdat}
@@ -1725,9 +1752,11 @@ class Ovary {
1725
1752
  const dest = this.settings.config.snapshot_dir + this.settings.isoFilename;
1726
1753
  await (0, utils_1.exec)(`ln -s ${src} ${dest}`);
1727
1754
  // Create md5sum, sha256sum
1728
- utils_2.default.warning('creating md5, sha256');
1729
- await (0, utils_1.exec)(`md5sum ${src} > ${dest.replace('.iso', '.md5')}`);
1730
- await (0, utils_1.exec)(`sha256sum ${src} > ${dest.replace('.iso', '.sha256')}`);
1755
+ if (this.settings.config.make_md5sum) {
1756
+ utils_2.default.warning('creating md5, sha256');
1757
+ await (0, utils_1.exec)(`md5sum ${src} > ${dest.replace('.iso', '.md5')}`);
1758
+ await (0, utils_1.exec)(`sha256sum ${src} > ${dest.replace('.iso', '.sha256')}`);
1759
+ }
1731
1760
  }
1732
1761
  }
1733
1762
  /**
@@ -1777,6 +1806,9 @@ class Ovary {
1777
1806
  }
1778
1807
  }
1779
1808
  exports.default = Ovary;
1809
+ /**
1810
+ * FUNCTIONS
1811
+ */
1780
1812
  /**
1781
1813
  * Crea il path se non esiste
1782
1814
  * @param path
@@ -1820,17 +1852,4 @@ function isArchiso(distro) {
1820
1852
  found = true;
1821
1853
  }
1822
1854
  return found;
1823
- // EXCLUDED
1824
- let file = node_path_1.default.resolve(__dirname, '../../conf/archiso.yaml');
1825
- if (fs_1.default.existsSync('/etc/penguins-eggs.d/archiso.yaml')) {
1826
- file = '/etc/penguins-eggs.d/archiso.yaml';
1827
- }
1828
- const content = fs_1.default.readFileSync(file, 'utf8');
1829
- const distros = js_yaml_1.default.load(content);
1830
- for (const current of distros) {
1831
- if (current === distro) {
1832
- found = true;
1833
- }
1834
- }
1835
- return found;
1836
1855
  }
@@ -16,10 +16,10 @@ const distro_1 = tslib_1.__importDefault(require("./distro"));
16
16
  const settings_1 = tslib_1.__importDefault(require("./settings"));
17
17
  const node_child_process_1 = require("node:child_process");
18
18
  const utils_2 = require("../lib/utils");
19
- const debian_1 = tslib_1.__importDefault(require("./family/debian"));
20
- const fedora_1 = tslib_1.__importDefault(require("./family/fedora"));
21
- const archlinux_1 = tslib_1.__importDefault(require("./family/archlinux"));
22
- const suse_1 = tslib_1.__importDefault(require("./family/suse"));
19
+ const debian_1 = tslib_1.__importDefault(require("./families/debian"));
20
+ const fedora_1 = tslib_1.__importDefault(require("./families/fedora"));
21
+ const archlinux_1 = tslib_1.__importDefault(require("./families/archlinux"));
22
+ const suse_1 = tslib_1.__importDefault(require("./families/suse"));
23
23
  const config_file = '/etc/penguins-eggs.d/eggs.yaml';
24
24
  const config_tools = '/etc/penguins-eggs.d/tools.yaml';
25
25
  /**
@@ -40,6 +40,10 @@ class Pacman {
40
40
  const distro = new distro_1.default(remix);
41
41
  return distro;
42
42
  }
43
+ /**
44
+ *
45
+ * @returns grub
46
+ */
43
47
  static whichGrubIsInstalled() {
44
48
  let grubInstalled = '';
45
49
  if (this.distro().familyId === 'debian') {
@@ -64,27 +68,29 @@ class Pacman {
64
68
  }
65
69
  /**
66
70
  * check if it's installed xorg
67
- * @returns true if xorg is installed
71
+ * @returns
68
72
  */
69
73
  static isInstalledXorg() {
70
74
  let installed = false;
71
75
  if (this.distro().familyId === 'debian') {
72
- if (debian_1.default.isInstalledXorg()) {
76
+ if (debian_1.default.packageIsInstalled('xserver-xorg-core')) {
73
77
  installed = true;
74
78
  }
75
79
  }
76
80
  else if (this.distro().familyId === 'fedora') {
77
- if (fedora_1.default.isInstalledXorg()) {
81
+ if (fedora_1.default.packageIsInstalled('xorg-x11-server-Xorg.x86_64')) {
78
82
  installed = true;
79
83
  }
80
84
  }
81
85
  else if (this.distro().familyId === 'archlinux') {
82
- if (archlinux_1.default.isInstalledXorg()) {
86
+ if (archlinux_1.default.packageIsInstalled('xorg-server-common')) {
83
87
  installed = true;
84
88
  }
85
89
  }
86
- else if (this.distro().familyId === 'suse' && suse_1.default.isInstalledXorg()) {
87
- installed = true;
90
+ else if (this.distro().familyId === 'suse') {
91
+ if (suse_1.default.packageIsInstalled('xorg-x11-server')) {
92
+ installed = true;
93
+ }
88
94
  }
89
95
  return installed;
90
96
  }
@@ -95,22 +101,24 @@ class Pacman {
95
101
  static isInstalledWayland() {
96
102
  let installed = false;
97
103
  if (this.distro().familyId === 'debian') {
98
- if (debian_1.default.isInstalledWayland()) {
104
+ if (debian_1.default.packageIsInstalled('xwayland')) {
99
105
  installed = true;
100
106
  }
101
107
  }
102
108
  else if (this.distro().familyId === 'fedora') {
103
- if (fedora_1.default.isInstalledWayland()) {
109
+ if (fedora_1.default.packageIsInstalled('xorg-x11-server-Xwayland*')) {
104
110
  installed = true;
105
111
  }
106
112
  }
107
113
  else if (this.distro().familyId === 'archlinux') {
108
- if (archlinux_1.default.isInstalledWayland()) {
114
+ if (archlinux_1.default.packageIsInstalled('xwayland')) {
109
115
  installed = true;
110
116
  }
111
117
  }
112
- else if (this.distro().familyId === 'suse' && suse_1.default.isInstalledWayland()) {
113
- installed = true;
118
+ else if (this.distro().familyId === 'suse') {
119
+ if (suse_1.default.packageIsInstalled('xwayland*')) {
120
+ installed = true;
121
+ }
114
122
  }
115
123
  return installed;
116
124
  }
@@ -121,8 +129,10 @@ class Pacman {
121
129
  static isUefi() {
122
130
  let isUefi = false;
123
131
  if (this.distro().familyId === 'debian') {
124
- if (utils_1.default.uefiArch() !== 'i386' && this.packageIsInstalled('grub-efi-' + utils_1.default.uefiArch() + '-bin')) {
125
- isUefi = true;
132
+ if (utils_1.default.uefiArch() !== 'i386') {
133
+ if (this.packageIsInstalled('grub-efi-' + utils_1.default.uefiArch() + '-bin')) {
134
+ isUefi = true;
135
+ }
126
136
  }
127
137
  }
128
138
  else if (Pacman.distro().familyId === 'fedora') {
@@ -169,21 +179,23 @@ class Pacman {
169
179
  }
170
180
  /**
171
181
  * Crea array packages dei pacchetti da installare
182
+ *
183
+ * probabilmente non usata
184
+ *
172
185
  */
173
186
  static packages(remove = false, verbose = false) {
174
187
  let packages = [];
188
+ /*
175
189
  if (this.distro().familyId === 'debian') {
176
- packages = []; // Debian.packages(remove, verbose)
177
- }
178
- else if (this.distro().familyId === 'fedora') {
179
- packages = []; // Fedora.packages(remove, verbose)
180
- }
181
- else if (this.distro().familyId === 'archlinux') {
182
- packages = []; // Archlinux.packages(remove, verbose)
183
- }
184
- else if (this.distro().familyId === 'suse') {
185
- packages = []; // packages = Suse.packages(remove, verbose)
186
- }
190
+ packages = Debian.packages(remove, verbose)
191
+ } else if (this.distro().familyId === 'fedora') {
192
+ packages = Fedora.packages(remove, verbose)
193
+ } else if (this.distro().familyId === 'archlinux') {
194
+ packages = Archlinux.packages(remove, verbose)
195
+ } else if (this.distro().familyId === 'suse') {
196
+ packages = Suse.packages(remove, verbose)
197
+ }
198
+ */
187
199
  return packages;
188
200
  }
189
201
  /**
@@ -308,8 +320,7 @@ class Pacman {
308
320
  */
309
321
  static configurationCheck() {
310
322
  const confExists = node_fs_1.default.existsSync(config_file);
311
- const listExists = node_fs_1.default.existsSync('/usr/local/share/penguins-eggs/exclude.list');
312
- return confExists && listExists;
323
+ return confExists;
313
324
  }
314
325
  /**
315
326
  * Ritorna vero se machine-id è uguale
@@ -331,7 +342,7 @@ class Pacman {
331
342
  config.version = utils_1.default.getPackageVersion();
332
343
  config.snapshot_dir = '/home/eggs';
333
344
  config.snapshot_prefix = '';
334
- config.snapshot_excludes = '/usr/local/share/penguins-eggs/exclude.list';
345
+ config.snapshot_excludes = '/etc/penguins-eggs.d/exclude.list';
335
346
  config.snapshot_basename = ''; // before default was hostname
336
347
  config.user_opt = 'live';
337
348
  config.user_opt_passwd = 'evolution';
@@ -397,15 +408,16 @@ class Pacman {
397
408
  shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/tools.yaml'), config_tools);
398
409
  shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/krill.yaml'), confRoot);
399
410
  shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/derivatives.yaml'), confRoot);
400
- // shx.cp(path.resolve(__dirname, '../../conf/archiso.yaml'), confRoot)
401
411
  // init
402
412
  shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/init/unattended.sh'), '/etc/penguins-eggs.d/init');
403
413
  shelljs_1.default.chmod('+x', '/etc/penguins-eggs.d/init/unattended.sh');
404
414
  shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/init/cuckoo.sh'), '/etc/penguins-eggs.d/init');
405
415
  shelljs_1.default.chmod('+x', '/etc/penguins-eggs.d/init/cuckoo.sh');
406
- // creazione del file delle esclusioni
407
- shelljs_1.default.mkdir('-p', '/usr/local/share/penguins-eggs/');
408
- shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list'), '/usr/local/share/penguins-eggs');
416
+ // creazione cartella exclude.list.d
417
+ (0, node_child_process_1.execSync)(`mkdir -p /etc/penguins-eggs.d/exclude.list.d`);
418
+ shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.template'), '/etc/penguins-eggs.d/exclude.list.d');
419
+ shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.custom'), '/etc/penguins-eggs.d/exclude.list.d');
420
+ shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.homes'), '/etc/penguins-eggs.d/exclude.list.d');
409
421
  await this.configurationFresh();
410
422
  }
411
423
  /**
@@ -416,9 +428,6 @@ class Pacman {
416
428
  if (node_fs_1.default.existsSync('/etc/penguins-eggs.d')) {
417
429
  await (0, utils_2.exec)('rm /etc/penguins-eggs.d -rf', echo);
418
430
  }
419
- if (node_fs_1.default.existsSync('/usr/local/share/penguins-eggs/exclude.list')) {
420
- await (0, utils_2.exec)('rm /usr/local/share/penguins-eggs/exclude.list', echo);
421
- }
422
431
  if (node_fs_1.default.existsSync('/etc/calamares')) {
423
432
  await (0, utils_2.exec)('rm /etc/calamares -rf', echo);
424
433
  }
@@ -48,9 +48,6 @@ class Tools {
48
48
  settings.load();
49
49
  this.snapshot_dir = settings.config.snapshot_dir;
50
50
  let prefix = settings.config.snapshot_prefix;
51
- if (prefix.endsWith('rolling-')) {
52
- prefix = prefix.substring(0, prefix.indexOf('rolling-'));
53
- }
54
51
  this.snapshot_name = prefix + settings.config.snapshot_basename + '_' + utils_1.default.uefiArch();
55
52
  }
56
53
  else {
@@ -51,7 +51,13 @@ class Utils {
51
51
  * @param codenameId
52
52
  */
53
53
  static snapshotPrefix(distroId, codenameId) {
54
- let result = 'egg-of_' + distroId.toLowerCase() + '-' + codenameId.toLowerCase() + '-';
54
+ let result = '';
55
+ if (codenameId === 'rolling' || codenameId === '') {
56
+ result = 'egg-of_' + distroId.toLowerCase() + '-';
57
+ }
58
+ else {
59
+ result = 'egg-of_' + distroId.toLowerCase() + '-' + codenameId.toLowerCase() + '-';
60
+ }
55
61
  result = result.replace(`/`, '-');
56
62
  return result;
57
63
  }
@@ -93,6 +99,9 @@ class Utils {
93
99
  cmdline.forEach(cmd => {
94
100
  if (cmd.includes('BOOT_IMAGE')) {
95
101
  vmlinuz = cmd.substring(cmd.indexOf('=') + 1);
102
+ if (!fs_1.default.existsSync(vmlinuz) && fs_1.default.existsSync(`/boot${vmlinuz}`)) {
103
+ vmlinuz = `/boot${vmlinuz}`;
104
+ }
96
105
  }
97
106
  });
98
107
  // btrfs
@@ -136,7 +136,7 @@ class Config extends core_1.Command {
136
136
  }
137
137
  if (i.configurationInstall) {
138
138
  console.log('- creating/updating configuration');
139
- console.log(' files: ' + chalk_1.default.yellow('/etc/penguins-eggs.d/eggs.yaml') + ' and ' + chalk_1.default.yellow('/usr/local/share/penguins-eggs/exclude.list\n'));
139
+ console.log(' files: ' + chalk_1.default.yellow('/etc/penguins-eggs.d/eggs.yaml'));
140
140
  }
141
141
  else if (i.configurationRefresh) {
142
142
  console.log('- refreshing configuration for new machine');