penguins-eggs 9.6.21 → 9.6.23
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.
- package/.oclif.manifest.json +1 -1
- package/README.md +59 -36
- package/conf/eggs.yaml +1 -1
- package/conf/exclude.list.custom +3 -0
- package/conf/exclude.list.homes +67 -0
- package/conf/exclude.list.template +99 -0
- package/conf/exclude.list.usr +43 -0
- package/dist/classes/compressors.js +33 -14
- package/dist/classes/daddy.js +0 -2
- package/dist/classes/distro.js +2 -2
- package/dist/classes/{family → families}/archlinux.js +17 -17
- package/dist/classes/{family → families}/debian.js +33 -28
- package/dist/classes/{family → families}/fedora.js +2 -1
- package/dist/classes/families/mockup.js +100 -0
- package/dist/classes/{family → families}/suse.js +1 -1
- package/dist/classes/ovary.js +110 -86
- package/dist/classes/pacman.js +48 -38
- package/dist/classes/tools.js +0 -3
- package/dist/classes/utils.js +14 -5
- package/dist/commands/config.js +1 -1
- package/dist/commands/produce.js +24 -3
- package/dist/interfaces/i-addons.js +1 -0
- package/dist/interfaces/i-filters.js +3 -0
- package/dist/lib/dependencies.js +18 -18
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +11 -12
- package/package.json +1 -1
- package/scripts/_eggs +9 -8
- package/scripts/eggs.bash +3 -3
- package/conf/exclude.list +0 -211
- package/scripts/non-live-cmdline +0 -194
package/dist/classes/ovary.js
CHANGED
|
@@ -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
|
|
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('
|
|
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('
|
|
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('
|
|
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
|
-
|
|
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,59 @@ class Ovary {
|
|
|
151
165
|
}
|
|
152
166
|
}
|
|
153
167
|
}
|
|
154
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
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
|
+
let excludeUsr = '';
|
|
201
|
+
if (filters.custom) {
|
|
202
|
+
excludeCustom = fs_1.default.readFileSync(`${excludeListTemplateDir}exclude.list.custom`, 'utf8');
|
|
203
|
+
}
|
|
204
|
+
if (filters.dev) {
|
|
205
|
+
excludeDev = `home/${await utils_2.default.getPrimaryUser()}/*`;
|
|
206
|
+
}
|
|
207
|
+
if (filters.homes) {
|
|
208
|
+
excludeHomes = fs_1.default.readFileSync(`${excludeListTemplateDir}exclude.list.homes`, 'utf8');
|
|
209
|
+
}
|
|
210
|
+
if (filters.usr) {
|
|
211
|
+
excludeUsr = fs_1.default.readFileSync(`${excludeListTemplateDir}exclude.list.usr`, 'utf8');
|
|
212
|
+
}
|
|
213
|
+
let view = {
|
|
214
|
+
exclude_list_custom: excludeCustom,
|
|
215
|
+
exclude_list_dev: excludeDev,
|
|
216
|
+
exclude_list_homes: excludeHomes,
|
|
217
|
+
exclude_list_usr: excludeUsr
|
|
218
|
+
};
|
|
219
|
+
const template = fs_1.default.readFileSync(excludeListTemplate, 'utf8');
|
|
220
|
+
fs_1.default.writeFileSync(this.settings.config.snapshot_excludes, mustache_1.default.render(template, view));
|
|
169
221
|
/**
|
|
170
222
|
* NOTE: reCreate = false
|
|
171
223
|
*
|
|
@@ -188,10 +240,10 @@ class Ovary {
|
|
|
188
240
|
* initrd for different familis
|
|
189
241
|
*/
|
|
190
242
|
if (this.familyId === 'debian') {
|
|
191
|
-
await this.
|
|
243
|
+
await this.initrdDebian();
|
|
192
244
|
}
|
|
193
245
|
else if (this.familyId === 'archlinux') {
|
|
194
|
-
await this.
|
|
246
|
+
await this.initrdArch();
|
|
195
247
|
}
|
|
196
248
|
if (this.settings.config.make_efi) {
|
|
197
249
|
await this.makeEfi(this.theme);
|
|
@@ -241,10 +293,11 @@ class Ovary {
|
|
|
241
293
|
let uname = (await (0, utils_1.exec)('uname -r', { capture: true })).data;
|
|
242
294
|
uname = uname.replaceAll('\n', '');
|
|
243
295
|
let content = '';
|
|
296
|
+
content = '#!/usr/bin/env bash';
|
|
244
297
|
content += 'mkdir /live/bin -p\n';
|
|
245
298
|
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';
|
|
299
|
+
content += '# cp /usr/lib/penguins-eggs/scripts/non-live-cmdline /live/bin -p\n';
|
|
300
|
+
content += '# chmod +x /live/bin/non-live-cmdline\n';
|
|
248
301
|
content += '## \n';
|
|
249
302
|
content += 'mkdir /live/boot-dev/antiX -p\n';
|
|
250
303
|
content += 'ln -s /run/live/medium/live/filesystem.squashfs /live/boot-dev/antiX/linuxfs\n';
|
|
@@ -274,7 +327,6 @@ class Ovary {
|
|
|
274
327
|
hashExt = '.md5';
|
|
275
328
|
}
|
|
276
329
|
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
330
|
await (0, utils_1.exec)(`mv ${this.settings.iso_work}live/filesystem.squashfs ${this.settings.iso_work}${pathName}.sfs`, this.echo);
|
|
279
331
|
await (0, utils_1.exec)(`${hashCmd} ${this.settings.iso_work}${pathName}.sfs > ${this.settings.iso_work}${pathName}${hashExt}`, this.echo);
|
|
280
332
|
}
|
|
@@ -288,7 +340,7 @@ class Ovary {
|
|
|
288
340
|
if (this.verbose) {
|
|
289
341
|
console.log('Ovary: liveCreateStructure');
|
|
290
342
|
}
|
|
291
|
-
utils_2.default.warning(`
|
|
343
|
+
utils_2.default.warning(`creating egg in ${this.settings.config.snapshot_dir}`);
|
|
292
344
|
let cmd;
|
|
293
345
|
if (!fs_1.default.existsSync(this.settings.config.snapshot_dir)) {
|
|
294
346
|
cmd = `mkdir -p ${this.settings.config.snapshot_dir}`;
|
|
@@ -442,7 +494,6 @@ class Ovary {
|
|
|
442
494
|
*/
|
|
443
495
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/crypttab`)) {
|
|
444
496
|
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
497
|
}
|
|
447
498
|
/**
|
|
448
499
|
* Blank out systemd machine id.
|
|
@@ -575,12 +626,14 @@ class Ovary {
|
|
|
575
626
|
await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/dev/shm`, this.echo);
|
|
576
627
|
}
|
|
577
628
|
/**
|
|
578
|
-
*
|
|
579
|
-
* creava problemi con MXLINUX
|
|
629
|
+
* creo /tmp
|
|
580
630
|
*/
|
|
581
631
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/tmp`)) {
|
|
582
632
|
await (0, utils_1.exec)(`mkdir ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
583
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* Assegno 1777 a /tmp creava problemi con MXLINUX
|
|
636
|
+
*/
|
|
584
637
|
await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
585
638
|
}
|
|
586
639
|
}
|
|
@@ -690,12 +743,10 @@ class Ovary {
|
|
|
690
743
|
return kp;
|
|
691
744
|
}
|
|
692
745
|
/**
|
|
693
|
-
*
|
|
746
|
+
* kernelCopy
|
|
694
747
|
*/
|
|
695
748
|
async kernelCopy() {
|
|
696
|
-
|
|
697
|
-
console.log('Ovary: kernelCopy');
|
|
698
|
-
}
|
|
749
|
+
utils_2.default.warning(`copying ${node_path_1.default.basename(this.settings.kernel_image)} on ISO/live`);
|
|
699
750
|
let lackVmlinuzImage = false;
|
|
700
751
|
if (fs_1.default.existsSync(this.settings.kernel_image)) {
|
|
701
752
|
await (0, utils_1.exec)(`cp ${this.settings.kernel_image} ${this.settings.iso_work}live/`, this.echo);
|
|
@@ -711,12 +762,11 @@ class Ovary {
|
|
|
711
762
|
}
|
|
712
763
|
}
|
|
713
764
|
/**
|
|
765
|
+
* initrdArch()
|
|
714
766
|
* necessita di echoYes
|
|
715
767
|
*/
|
|
716
|
-
async
|
|
717
|
-
|
|
718
|
-
console.log('Ovary: initrdCreate');
|
|
719
|
-
}
|
|
768
|
+
async initrdArch() {
|
|
769
|
+
utils_2.default.warning(`creating ${node_path_1.default.basename(this.settings.initrdImg)} on ISO/live`);
|
|
720
770
|
let initrdImg = utils_2.default.initrdImg();
|
|
721
771
|
initrdImg = initrdImg.slice(Math.max(0, initrdImg.lastIndexOf('/') + 1));
|
|
722
772
|
utils_2.default.warning(`Creating ${initrdImg} in ${this.settings.iso_work}live/`);
|
|
@@ -732,12 +782,9 @@ class Ovary {
|
|
|
732
782
|
* We must upgrade to initrdCreate for Debian/Ubuntu
|
|
733
783
|
* @returns
|
|
734
784
|
*/
|
|
735
|
-
async
|
|
736
|
-
|
|
737
|
-
console.log('Ovary: initrdCopy');
|
|
738
|
-
}
|
|
785
|
+
async initrdDebian(verbose = false) {
|
|
786
|
+
utils_2.default.warning(`creating ${node_path_1.default.basename(this.settings.initrdImg)} on ISO/live`);
|
|
739
787
|
let isCrypted = false;
|
|
740
|
-
utils_2.default.warning('initrdCreate');
|
|
741
788
|
if (fs_1.default.existsSync('/etc/crypttab')) {
|
|
742
789
|
isCrypted = true;
|
|
743
790
|
await (0, utils_1.exec)('mv /etc/crypttab /etc/crypttab.saved', this.echo);
|
|
@@ -746,26 +793,6 @@ class Ovary {
|
|
|
746
793
|
if (isCrypted) {
|
|
747
794
|
await (0, utils_1.exec)('mv /etc/crypttab.saved /etc/crypttab', this.echo);
|
|
748
795
|
}
|
|
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
796
|
}
|
|
770
797
|
/**
|
|
771
798
|
* squashFs: crea in live filesystem.squashfs
|
|
@@ -806,7 +833,6 @@ class Ovary {
|
|
|
806
833
|
* secure
|
|
807
834
|
*/
|
|
808
835
|
if (!unsecure) {
|
|
809
|
-
this.addRemoveExclusion(true, `home/*/*`);
|
|
810
836
|
this.addRemoveExclusion(true, `root/*`);
|
|
811
837
|
this.addRemoveExclusion(true, `root/.*`);
|
|
812
838
|
}
|
|
@@ -825,14 +851,20 @@ class Ovary {
|
|
|
825
851
|
if (utils_2.default.uefiArch() === 'arm64') {
|
|
826
852
|
// limit = ' -processors 2 -mem 1024M'
|
|
827
853
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
854
|
+
/**
|
|
855
|
+
* mksquashfs
|
|
856
|
+
*
|
|
857
|
+
* SYNTAX: mksquashfs source1 source2 ...
|
|
858
|
+
* FILESYSTEM [OPTIONS]
|
|
859
|
+
* [-ef exclude.list]
|
|
860
|
+
* [-e list of exclude dirs/files]
|
|
861
|
+
*/
|
|
831
862
|
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
863
|
cmd = cmd.replace(/\s\s+/g, ' ');
|
|
833
864
|
utils_2.default.writeX(`${this.settings.work_dir.ovarium}mksquashfs`, cmd);
|
|
834
865
|
if (!scriptOnly) {
|
|
835
|
-
utils_2.default.warning('
|
|
866
|
+
utils_2.default.warning('creating filesystem.squashfs on ISO/live');
|
|
867
|
+
// Utils.warning(`compression: ` + compression)
|
|
836
868
|
const test = (await (0, utils_1.exec)(cmd, utils_2.default.setEcho(true))).code;
|
|
837
869
|
if (test !== 0) {
|
|
838
870
|
process.exit();
|
|
@@ -855,7 +887,8 @@ class Ovary {
|
|
|
855
887
|
if (this.verbose) {
|
|
856
888
|
console.log('Ovary: mergedAndOverlay');
|
|
857
889
|
}
|
|
858
|
-
|
|
890
|
+
// boot viene copiato... non ricordo perchè
|
|
891
|
+
const mountDirs = ['etc', 'usr', 'var'];
|
|
859
892
|
let mountDir = '';
|
|
860
893
|
let overlay = false;
|
|
861
894
|
for (mountDir of mountDirs) {
|
|
@@ -885,7 +918,7 @@ class Ovary {
|
|
|
885
918
|
}
|
|
886
919
|
else {
|
|
887
920
|
const noMergeDirs = [
|
|
888
|
-
'boot',
|
|
921
|
+
'boot', // will be copied now
|
|
889
922
|
'cdrom',
|
|
890
923
|
'dev',
|
|
891
924
|
'media',
|
|
@@ -999,6 +1032,8 @@ class Ovary {
|
|
|
999
1032
|
}
|
|
1000
1033
|
/**
|
|
1001
1034
|
* copyBoot
|
|
1035
|
+
*
|
|
1036
|
+
* necessario: prima era merged
|
|
1002
1037
|
*/
|
|
1003
1038
|
async copyBoot() {
|
|
1004
1039
|
if (this.verbose) {
|
|
@@ -1362,7 +1397,7 @@ class Ovary {
|
|
|
1362
1397
|
if (fs_1.default.existsSync(memdiskDir)) {
|
|
1363
1398
|
await (0, utils_1.exec)(`rm ${memdiskDir} -rf`, this.echo);
|
|
1364
1399
|
}
|
|
1365
|
-
utils_2.default.warning('creating memdiskDir
|
|
1400
|
+
utils_2.default.warning('creating temporary memdiskDir on ' + memdiskDir);
|
|
1366
1401
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}`);
|
|
1367
1402
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot`, this.echo);
|
|
1368
1403
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot/grub`, this.echo);
|
|
@@ -1382,7 +1417,7 @@ class Ovary {
|
|
|
1382
1417
|
if (fs_1.default.existsSync(efiWorkDir)) {
|
|
1383
1418
|
await (0, utils_1.exec)(`rm ${efiWorkDir} -rf`, this.echo);
|
|
1384
1419
|
}
|
|
1385
|
-
utils_2.default.warning('creating efiWordDir
|
|
1420
|
+
utils_2.default.warning('creating temporary efiWordDir on ' + efiWorkDir);
|
|
1386
1421
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}`, this.echo);
|
|
1387
1422
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot`, this.echo);
|
|
1388
1423
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot/grub`, this.echo);
|
|
@@ -1561,9 +1596,6 @@ class Ovary {
|
|
|
1561
1596
|
}
|
|
1562
1597
|
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
1563
1598
|
let prefix = this.settings.config.snapshot_prefix;
|
|
1564
|
-
if (prefix.endsWith('rolling-')) {
|
|
1565
|
-
prefix = prefix.substring(0, prefix.indexOf('rolling-'));
|
|
1566
|
-
}
|
|
1567
1599
|
let typology = '';
|
|
1568
1600
|
// typology is applied only with standard egg-of
|
|
1569
1601
|
if (prefix.slice(0, 7) === 'egg-of_') {
|
|
@@ -1595,7 +1627,7 @@ class Ovary {
|
|
|
1595
1627
|
utils_2.default.warning(`Can't create isohybrid image. File: ${isolinuxFile} not found. \nThe resulting image will be a standard iso file`);
|
|
1596
1628
|
}
|
|
1597
1629
|
}
|
|
1598
|
-
// uefi_opt="-
|
|
1630
|
+
// uefi_opt="-uefi_elToritoAltBoot-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot"
|
|
1599
1631
|
let uefi_elToritoAltBoot = '';
|
|
1600
1632
|
let uefi_e = '';
|
|
1601
1633
|
let uefi_isohybridGptBasdat = '';
|
|
@@ -1636,7 +1668,7 @@ class Ovary {
|
|
|
1636
1668
|
* -boot-load-size 4
|
|
1637
1669
|
* -boot-info-table
|
|
1638
1670
|
* -no-emul-boot
|
|
1639
|
-
* -
|
|
1671
|
+
* -uefi_elToritoAltBoot-alt-boot
|
|
1640
1672
|
* -e boot/grub/efi.img
|
|
1641
1673
|
* -no-emul-boot
|
|
1642
1674
|
* -isohybrid-gpt-basdat
|
|
@@ -1657,7 +1689,7 @@ class Ovary {
|
|
|
1657
1689
|
-boot-load-size 4 \
|
|
1658
1690
|
-boot-info-table \
|
|
1659
1691
|
-no-emul-boot \
|
|
1660
|
-
${
|
|
1692
|
+
${uefi_eltoritoAltBoot} \
|
|
1661
1693
|
${uefi_e} \
|
|
1662
1694
|
${uefi_noEmulBoot} \
|
|
1663
1695
|
${uefi_isohybridGptBasdat}
|
|
@@ -1725,9 +1757,11 @@ class Ovary {
|
|
|
1725
1757
|
const dest = this.settings.config.snapshot_dir + this.settings.isoFilename;
|
|
1726
1758
|
await (0, utils_1.exec)(`ln -s ${src} ${dest}`);
|
|
1727
1759
|
// Create md5sum, sha256sum
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1760
|
+
if (this.settings.config.make_md5sum) {
|
|
1761
|
+
utils_2.default.warning('creating md5, sha256');
|
|
1762
|
+
await (0, utils_1.exec)(`md5sum ${src} > ${dest.replace('.iso', '.md5')}`);
|
|
1763
|
+
await (0, utils_1.exec)(`sha256sum ${src} > ${dest.replace('.iso', '.sha256')}`);
|
|
1764
|
+
}
|
|
1731
1765
|
}
|
|
1732
1766
|
}
|
|
1733
1767
|
/**
|
|
@@ -1777,6 +1811,9 @@ class Ovary {
|
|
|
1777
1811
|
}
|
|
1778
1812
|
}
|
|
1779
1813
|
exports.default = Ovary;
|
|
1814
|
+
/**
|
|
1815
|
+
* FUNCTIONS
|
|
1816
|
+
*/
|
|
1780
1817
|
/**
|
|
1781
1818
|
* Crea il path se non esiste
|
|
1782
1819
|
* @param path
|
|
@@ -1820,17 +1857,4 @@ function isArchiso(distro) {
|
|
|
1820
1857
|
found = true;
|
|
1821
1858
|
}
|
|
1822
1859
|
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
1860
|
}
|
package/dist/classes/pacman.js
CHANGED
|
@@ -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("./
|
|
20
|
-
const fedora_1 = tslib_1.__importDefault(require("./
|
|
21
|
-
const archlinux_1 = tslib_1.__importDefault(require("./
|
|
22
|
-
const suse_1 = tslib_1.__importDefault(require("./
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
86
|
+
if (archlinux_1.default.packageIsInstalled('xorg-server-common')) {
|
|
83
87
|
installed = true;
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
|
-
else if (this.distro().familyId === 'suse'
|
|
87
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
114
|
+
if (archlinux_1.default.packageIsInstalled('xwayland')) {
|
|
109
115
|
installed = true;
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
|
-
else if (this.distro().familyId === 'suse'
|
|
113
|
-
|
|
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'
|
|
125
|
-
|
|
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
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
else if (this.distro().familyId === '
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
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
|
-
|
|
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 = '/
|
|
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,17 @@ 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
|
|
407
|
-
|
|
408
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list'), '/
|
|
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');
|
|
421
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.usr'), '/etc/penguins-eggs.d/exclude.list.d');
|
|
409
422
|
await this.configurationFresh();
|
|
410
423
|
}
|
|
411
424
|
/**
|
|
@@ -416,9 +429,6 @@ class Pacman {
|
|
|
416
429
|
if (node_fs_1.default.existsSync('/etc/penguins-eggs.d')) {
|
|
417
430
|
await (0, utils_2.exec)('rm /etc/penguins-eggs.d -rf', echo);
|
|
418
431
|
}
|
|
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
432
|
if (node_fs_1.default.existsSync('/etc/calamares')) {
|
|
423
433
|
await (0, utils_2.exec)('rm /etc/calamares -rf', echo);
|
|
424
434
|
}
|
package/dist/classes/tools.js
CHANGED
|
@@ -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 {
|
package/dist/classes/utils.js
CHANGED
|
@@ -51,7 +51,13 @@ class Utils {
|
|
|
51
51
|
* @param codenameId
|
|
52
52
|
*/
|
|
53
53
|
static snapshotPrefix(distroId, codenameId) {
|
|
54
|
-
let result = '
|
|
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
|
|
@@ -523,10 +532,10 @@ class Utils {
|
|
|
523
532
|
static isLive() {
|
|
524
533
|
let retVal = false;
|
|
525
534
|
const paths = [
|
|
526
|
-
'/lib/live/mount',
|
|
527
|
-
'/lib/live/mount/rootfs/filesystem.squashfs',
|
|
528
|
-
'/live/aufs',
|
|
529
|
-
'/run/miso/sfs/livefs',
|
|
535
|
+
'/lib/live/mount', // debian-live
|
|
536
|
+
'/lib/live/mount/rootfs/filesystem.squashfs', // ubuntu bionic
|
|
537
|
+
'/live/aufs', // mx-linux
|
|
538
|
+
'/run/miso/sfs/livefs', // ManjaroLinux
|
|
530
539
|
'/run/archiso/airootfs' // Arch
|
|
531
540
|
];
|
|
532
541
|
for (let i = 0; i < paths.length; i++) {
|