penguins-eggs 9.6.20 → 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.
- package/.oclif.manifest.json +1 -1
- package/README.md +55 -29
- 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 +140 -0
- package/dist/classes/compressors.js +32 -13
- package/dist/classes/daddy.js +0 -2
- package/dist/classes/distro.js +2 -2
- package/dist/classes/{family → families}/archlinux.js +15 -16
- 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 +113 -86
- package/dist/classes/pacman.js +47 -38
- package/dist/classes/tools.js +0 -3
- package/dist/classes/utils.js +10 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/produce.js +24 -4
- package/dist/interfaces/i-addons.js +1 -0
- package/dist/interfaces/i-filters.js +3 -0
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +8 -6
- package/package.json +1 -1
- package/scripts/_eggs +24 -2
- package/scripts/eggs.bash +2 -1
- package/conf/exclude.list +0 -84
- 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, 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,54 @@ 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
|
+
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.
|
|
238
|
+
await this.initrdDebian();
|
|
192
239
|
}
|
|
193
240
|
else if (this.familyId === 'archlinux') {
|
|
194
|
-
await this.
|
|
241
|
+
await this.initrdArch();
|
|
195
242
|
}
|
|
196
243
|
if (this.settings.config.make_efi) {
|
|
197
244
|
await this.makeEfi(this.theme);
|
|
@@ -221,7 +268,7 @@ class Ovary {
|
|
|
221
268
|
this.cliAutologin.addAutologin(this.settings.distro.distroId, this.settings.distro.codenameId, this.settings.config.user_opt, this.settings.config.user_opt_passwd, this.settings.config.root_passwd, this.settings.work_dir.merged);
|
|
222
269
|
}
|
|
223
270
|
await this.editLiveFs(clone, cryptedclone);
|
|
224
|
-
mksquashfsCmd = await this.makeSquashfs(scriptOnly);
|
|
271
|
+
mksquashfsCmd = await this.makeSquashfs(scriptOnly, unsecure);
|
|
225
272
|
await this.uBindLiveFs(); // Lo smonto prima della fase di backup
|
|
226
273
|
}
|
|
227
274
|
if (cryptedclone) {
|
|
@@ -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(`
|
|
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
|
-
*
|
|
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
|
-
*
|
|
741
|
+
* kernelCopy
|
|
694
742
|
*/
|
|
695
743
|
async kernelCopy() {
|
|
696
|
-
|
|
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
|
|
717
|
-
|
|
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
|
|
736
|
-
|
|
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,31 +788,11 @@ 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
|
|
772
794
|
*/
|
|
773
|
-
async makeSquashfs(scriptOnly = false) {
|
|
795
|
+
async makeSquashfs(scriptOnly = false, unsecure = false) {
|
|
774
796
|
if (this.verbose) {
|
|
775
797
|
console.log('Ovary: makeSquashfs');
|
|
776
798
|
}
|
|
@@ -802,6 +824,13 @@ class Ovary {
|
|
|
802
824
|
}
|
|
803
825
|
}
|
|
804
826
|
}
|
|
827
|
+
/**
|
|
828
|
+
* secure
|
|
829
|
+
*/
|
|
830
|
+
if (!unsecure) {
|
|
831
|
+
this.addRemoveExclusion(true, `root/*`);
|
|
832
|
+
this.addRemoveExclusion(true, `root/.*`);
|
|
833
|
+
}
|
|
805
834
|
if (shelljs_1.default.exec('/usr/bin/test -L /etc/localtime', { silent: true }) && shelljs_1.default.exec('cat /etc/timezone', { silent: true }) !== 'Europe/Rome') {
|
|
806
835
|
// this.addRemoveExclusion(true, '/etc/localtime')
|
|
807
836
|
}
|
|
@@ -817,14 +846,20 @@ class Ovary {
|
|
|
817
846
|
if (utils_2.default.uefiArch() === 'arm64') {
|
|
818
847
|
// limit = ' -processors 2 -mem 1024M'
|
|
819
848
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
849
|
+
/**
|
|
850
|
+
* mksquashfs
|
|
851
|
+
*
|
|
852
|
+
* SYNTAX: mksquashfs source1 source2 ...
|
|
853
|
+
* FILESYSTEM [OPTIONS]
|
|
854
|
+
* [-ef exclude.list]
|
|
855
|
+
* [-e list of exclude dirs/files]
|
|
856
|
+
*/
|
|
823
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}`;
|
|
824
858
|
cmd = cmd.replace(/\s\s+/g, ' ');
|
|
825
859
|
utils_2.default.writeX(`${this.settings.work_dir.ovarium}mksquashfs`, cmd);
|
|
826
860
|
if (!scriptOnly) {
|
|
827
|
-
utils_2.default.warning('
|
|
861
|
+
utils_2.default.warning('creating filesystem.squashfs on ISO/live');
|
|
862
|
+
// Utils.warning(`compression: ` + compression)
|
|
828
863
|
const test = (await (0, utils_1.exec)(cmd, utils_2.default.setEcho(true))).code;
|
|
829
864
|
if (test !== 0) {
|
|
830
865
|
process.exit();
|
|
@@ -847,7 +882,8 @@ class Ovary {
|
|
|
847
882
|
if (this.verbose) {
|
|
848
883
|
console.log('Ovary: mergedAndOverlay');
|
|
849
884
|
}
|
|
850
|
-
|
|
885
|
+
// boot viene copiato... non ricordo perchè
|
|
886
|
+
const mountDirs = ['etc', 'usr', 'var'];
|
|
851
887
|
let mountDir = '';
|
|
852
888
|
let overlay = false;
|
|
853
889
|
for (mountDir of mountDirs) {
|
|
@@ -991,6 +1027,8 @@ class Ovary {
|
|
|
991
1027
|
}
|
|
992
1028
|
/**
|
|
993
1029
|
* copyBoot
|
|
1030
|
+
*
|
|
1031
|
+
* necessario: prima era merged
|
|
994
1032
|
*/
|
|
995
1033
|
async copyBoot() {
|
|
996
1034
|
if (this.verbose) {
|
|
@@ -1354,7 +1392,7 @@ class Ovary {
|
|
|
1354
1392
|
if (fs_1.default.existsSync(memdiskDir)) {
|
|
1355
1393
|
await (0, utils_1.exec)(`rm ${memdiskDir} -rf`, this.echo);
|
|
1356
1394
|
}
|
|
1357
|
-
utils_2.default.warning('creating memdiskDir
|
|
1395
|
+
utils_2.default.warning('creating temporary memdiskDir on ' + memdiskDir);
|
|
1358
1396
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}`);
|
|
1359
1397
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot`, this.echo);
|
|
1360
1398
|
await (0, utils_1.exec)(`mkdir ${memdiskDir}/boot/grub`, this.echo);
|
|
@@ -1374,7 +1412,7 @@ class Ovary {
|
|
|
1374
1412
|
if (fs_1.default.existsSync(efiWorkDir)) {
|
|
1375
1413
|
await (0, utils_1.exec)(`rm ${efiWorkDir} -rf`, this.echo);
|
|
1376
1414
|
}
|
|
1377
|
-
utils_2.default.warning('creating efiWordDir
|
|
1415
|
+
utils_2.default.warning('creating temporary efiWordDir on ' + efiWorkDir);
|
|
1378
1416
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}`, this.echo);
|
|
1379
1417
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot`, this.echo);
|
|
1380
1418
|
await (0, utils_1.exec)(`mkdir ${efiWorkDir}boot/grub`, this.echo);
|
|
@@ -1553,9 +1591,6 @@ class Ovary {
|
|
|
1553
1591
|
}
|
|
1554
1592
|
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
1555
1593
|
let prefix = this.settings.config.snapshot_prefix;
|
|
1556
|
-
if (prefix.endsWith('rolling-')) {
|
|
1557
|
-
prefix = prefix.substring(0, prefix.indexOf('rolling-'));
|
|
1558
|
-
}
|
|
1559
1594
|
let typology = '';
|
|
1560
1595
|
// typology is applied only with standard egg-of
|
|
1561
1596
|
if (prefix.slice(0, 7) === 'egg-of_') {
|
|
@@ -1587,7 +1622,7 @@ class Ovary {
|
|
|
1587
1622
|
utils_2.default.warning(`Can't create isohybrid image. File: ${isolinuxFile} not found. \nThe resulting image will be a standard iso file`);
|
|
1588
1623
|
}
|
|
1589
1624
|
}
|
|
1590
|
-
// uefi_opt="-
|
|
1625
|
+
// uefi_opt="-uefi_elToritoAltBoot-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot"
|
|
1591
1626
|
let uefi_elToritoAltBoot = '';
|
|
1592
1627
|
let uefi_e = '';
|
|
1593
1628
|
let uefi_isohybridGptBasdat = '';
|
|
@@ -1628,7 +1663,7 @@ class Ovary {
|
|
|
1628
1663
|
* -boot-load-size 4
|
|
1629
1664
|
* -boot-info-table
|
|
1630
1665
|
* -no-emul-boot
|
|
1631
|
-
* -
|
|
1666
|
+
* -uefi_elToritoAltBoot-alt-boot
|
|
1632
1667
|
* -e boot/grub/efi.img
|
|
1633
1668
|
* -no-emul-boot
|
|
1634
1669
|
* -isohybrid-gpt-basdat
|
|
@@ -1649,7 +1684,7 @@ class Ovary {
|
|
|
1649
1684
|
-boot-load-size 4 \
|
|
1650
1685
|
-boot-info-table \
|
|
1651
1686
|
-no-emul-boot \
|
|
1652
|
-
${
|
|
1687
|
+
${uefi_eltoritoAltBoot} \
|
|
1653
1688
|
${uefi_e} \
|
|
1654
1689
|
${uefi_noEmulBoot} \
|
|
1655
1690
|
${uefi_isohybridGptBasdat}
|
|
@@ -1717,9 +1752,11 @@ class Ovary {
|
|
|
1717
1752
|
const dest = this.settings.config.snapshot_dir + this.settings.isoFilename;
|
|
1718
1753
|
await (0, utils_1.exec)(`ln -s ${src} ${dest}`);
|
|
1719
1754
|
// Create md5sum, sha256sum
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
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
|
+
}
|
|
1723
1760
|
}
|
|
1724
1761
|
}
|
|
1725
1762
|
/**
|
|
@@ -1769,6 +1806,9 @@ class Ovary {
|
|
|
1769
1806
|
}
|
|
1770
1807
|
}
|
|
1771
1808
|
exports.default = Ovary;
|
|
1809
|
+
/**
|
|
1810
|
+
* FUNCTIONS
|
|
1811
|
+
*/
|
|
1772
1812
|
/**
|
|
1773
1813
|
* Crea il path se non esiste
|
|
1774
1814
|
* @param path
|
|
@@ -1812,17 +1852,4 @@ function isArchiso(distro) {
|
|
|
1812
1852
|
found = true;
|
|
1813
1853
|
}
|
|
1814
1854
|
return found;
|
|
1815
|
-
// EXCLUDED
|
|
1816
|
-
let file = node_path_1.default.resolve(__dirname, '../../conf/archiso.yaml');
|
|
1817
|
-
if (fs_1.default.existsSync('/etc/penguins-eggs.d/archiso.yaml')) {
|
|
1818
|
-
file = '/etc/penguins-eggs.d/archiso.yaml';
|
|
1819
|
-
}
|
|
1820
|
-
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
1821
|
-
const distros = js_yaml_1.default.load(content);
|
|
1822
|
-
for (const current of distros) {
|
|
1823
|
-
if (current === distro) {
|
|
1824
|
-
found = true;
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
return found;
|
|
1828
1855
|
}
|
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,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
|
|
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');
|
|
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
|
}
|
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
|
package/dist/commands/config.js
CHANGED
|
@@ -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')
|
|
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');
|