penguins-eggs 9.1.12 → 9.1.30
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/README.md +57 -83
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +1 -1
- package/addons/eggs/adapt/bin/{eggs-adapt.sh → adapt} +1 -0
- package/addons/eggs/ichoice/bin/eggs-ichoice.sh +0 -0
- package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
- package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
- package/addons/eggs/theme/applications/install-debian.desktop +235 -22
- package/addons/neon/theme/applications/install-debian.desktop +0 -0
- package/addons/telos/theme/applications/install-debian.desktop +0 -0
- package/addons/ufficiozero/theme/applications/install-debian.desktop +0 -0
- package/addons/waydroid/theme/applications/install-debian.desktop +0 -0
- package/assets/calamares/install-debian +2 -2
- package/assets/penguins-eggs.desktop +0 -0
- package/assets/penguins-krill.desktop +0 -0
- package/assets/penguins-live-installer.desktop +0 -0
- package/bin/dev +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/after-bootloader/after-bootloader.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/before-bootloader/before-bootloader.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/before-bootloader-mkdirs/before-bootloader-mkdirs.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/bug/bug.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py +0 -0
- package/conf/distros/bionic/calamares/settings.yml +3 -3
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +12 -0
- package/conf/distros/buster/calamares/calamares-modules/cleanup/module.yml +9 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +13 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/module.yml +6 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +6 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/buster/calamares/modules/bootloader.yml +6 -6
- package/conf/distros/buster/calamares/modules/displaymanager.yml +3 -2
- package/conf/distros/buster/calamares/modules/finished.yml +2 -2
- package/conf/distros/buster/calamares/modules/fstab.yml +1 -2
- package/conf/distros/buster/calamares/modules/luksopenswaphookcfg.yml +1 -2
- package/conf/distros/buster/calamares/modules/machineid.yml +9 -2
- package/conf/distros/buster/calamares/modules/mount.yml +1 -2
- package/conf/distros/buster/calamares/modules/packages.yml +1 -1
- package/conf/distros/buster/calamares/modules/unpackfs.yml +1 -2
- package/conf/distros/buster/calamares/modules/users.yml +3 -4
- package/conf/distros/buster/calamares/modules/welcome.yml +1 -1
- package/conf/distros/buster/calamares/settings.yml +40 -12
- package/conf/distros/focal/calamares/calamares-modules/automirror/main.py +0 -0
- package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +2 -3
- package/conf/distros/focal/calamares/modules/automirror.yml +6 -0
- package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +13 -14
- package/conf/distros/focal/calamares/modules/before_bootloader_mkdirs_context.yml +3 -4
- package/conf/distros/focal/calamares/modules/bootloader.yml +1 -2
- package/conf/distros/focal/calamares/modules/finished.yml +1 -2
- package/conf/distros/focal/calamares/modules/fstab.yml +1 -2
- package/conf/distros/focal/calamares/modules/grubcfg.yml +2 -3
- package/conf/distros/focal/calamares/modules/locale.yml +6 -7
- package/conf/distros/focal/calamares/modules/machineid.yml +1 -2
- package/conf/distros/focal/calamares/modules/mount.yml +19 -20
- package/conf/distros/focal/calamares/modules/partition.yml +5 -3
- package/conf/distros/focal/calamares/modules/shellprocess_add386arch.yml +2 -3
- package/conf/distros/focal/calamares/modules/shellprocess_bug-LP#1829805.yml +1 -3
- package/conf/distros/focal/calamares/modules/shellprocess_logs.yml +2 -3
- package/conf/distros/focal/calamares/modules/unpackfs.yml +2 -2
- package/conf/distros/focal/calamares/modules/users.yml +37 -16
- package/conf/distros/focal/calamares/modules/welcome.yml +21 -22
- package/conf/distros/focal/calamares/settings.yml +5 -6
- package/conf/distros/jammy/README.md +32 -0
- package/conf/distros/jessie/krill/settings.yml +1 -1
- package/conf/distros/rolling/calamares/modules/packages.yml +2 -2
- package/conf/distros/rolling/calamares/settings.yml +3 -3
- package/conf/exclude.list +3 -0
- package/lib/classes/daddy.js +7 -4
- package/lib/classes/distro.js +3 -2
- package/lib/classes/family/archlinux.js +1 -0
- package/lib/classes/family/debian.js +15 -29
- package/lib/classes/i18n.d.ts +0 -4
- package/lib/classes/i18n.js +15 -27
- package/lib/classes/incubation/distros/bionic.js +1 -1
- package/lib/classes/incubation/distros/buster.js +4 -3
- package/lib/classes/incubation/distros/focal.js +1 -1
- package/lib/classes/incubation/distros/rolling.js +0 -1
- package/lib/classes/incubation/fisherman-helper/displaymanager.js +5 -3
- package/lib/classes/incubation/fisherman-helper/packages.js +39 -67
- package/lib/classes/incubation/incubator.js +1 -0
- package/lib/classes/krill_install.d.ts +0 -1
- package/lib/classes/krill_install.js +19 -19
- package/lib/classes/ovary.js +97 -101
- package/lib/classes/pacman.js +5 -46
- package/lib/classes/sources_list.js +11 -20
- package/lib/classes/tailor.d.ts +13 -11
- package/lib/classes/tailor.js +266 -102
- package/lib/classes/users.js +63 -60
- package/lib/classes/utils.d.ts +1 -1
- package/lib/classes/utils.js +16 -12
- package/lib/classes/xdg.js +38 -21
- package/lib/classes/yolk.js +1 -1
- package/lib/commands/analyze.js +4 -4
- package/lib/commands/calamares.d.ts +1 -1
- package/lib/commands/calamares.js +7 -7
- package/lib/commands/config.d.ts +1 -1
- package/lib/commands/config.js +7 -5
- package/lib/commands/dad.js +2 -2
- package/lib/commands/produce.js +2 -1
- package/lib/commands/syncfrom.js +9 -9
- package/lib/commands/syncto.js +20 -20
- package/lib/commands/tools/skel.js +2 -2
- package/lib/commands/wardrobe/ironing.d.ts +3 -0
- package/lib/commands/wardrobe/ironing.js +22 -4
- package/lib/commands/wardrobe/wear.d.ts +1 -0
- package/lib/commands/wardrobe/wear.js +7 -2
- package/lib/interfaces/i-materia.d.ts +3 -0
- package/lib/interfaces/index.d.ts +0 -1
- package/lib/lib/cli-autologin.js +24 -24
- package/lib/lib/dependencies.js +4 -13
- package/lib/lib/get_address.js +3 -2
- package/lib/lib/get_dns.js +3 -2
- package/lib/lib/get_domain.js +3 -2
- package/lib/lib/get_gateway.js +3 -2
- package/lib/lib/get_hostname.js +3 -2
- package/lib/lib/get_netmask.js +3 -2
- package/lib/lib/get_password.js +3 -2
- package/lib/lib/get_root_password.js +3 -2
- package/lib/lib/get_userfullname.js +3 -2
- package/lib/lib/get_username.js +3 -2
- package/lib/lib/select_filesystem_type.js +2 -2
- package/lib/lib/select_installation_device.js +2 -2
- package/lib/lib/select_installation_mode.js +3 -2
- package/lib/lib/select_regions.js +3 -2
- package/lib/lib/select_user_swap_choice.js +2 -2
- package/lib/lib/select_zones.js +3 -2
- package/mkinitcpio/README.md +77 -0
- package/mkinitcpio/garuda/README.md +29 -0
- package/mkinitcpio/manjaro/mkinitcpio.conf +4 -0
- package/package.json +113 -114
- package/scripts/_eggs +3 -11
- package/scripts/bros/waydroid-helper.sh +0 -0
- package/scripts/eggs-adapt.sh +5 -0
- package/scripts/eggs.bash +2 -3
- package/scripts/install-eggs-ppa.sh +0 -0
- package/scripts/mom-cli.sh +0 -0
- package/scripts/pve-live.service +0 -0
- package/scripts/pve-live.sh +0 -0
- package/scripts/resy.sh +0 -0
- package/scripts/userexist.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/remove-link/module.yml +0 -9
- package/conf/distros/buster/calamares/calamares-modules/remove-link/remove-link.sh +0 -3
- package/conf/distros/buster/calamares/modules/shellprocess_eggs-cleanup.yml +0 -6
- package/lib/commands/tools/locales.d.ts +0 -13
- package/lib/commands/tools/locales.js +0 -43
- package/lib/interfaces/i-costume.d.ts +0 -27
- package/lib/interfaces/i-costume.js +0 -2
- package/oclif.manifest.json +0 -1
package/lib/classes/ovary.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
10
|
// packages
|
|
11
|
-
const
|
|
11
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
12
12
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
13
13
|
const node_os_1 = tslib_1.__importDefault(require("node:os"));
|
|
14
14
|
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
@@ -31,7 +31,7 @@ const cliAutologin = require("../lib/cli-autologin");
|
|
|
31
31
|
const displaymanager_1 = require("./incubation/fisherman-helper/displaymanager");
|
|
32
32
|
// backup
|
|
33
33
|
const promises_1 = require("fs/promises");
|
|
34
|
-
const
|
|
34
|
+
const fs_2 = require("fs");
|
|
35
35
|
const users_1 = tslib_1.__importDefault(require("./users"));
|
|
36
36
|
/**
|
|
37
37
|
* Ovary:
|
|
@@ -86,8 +86,6 @@ class Ovary {
|
|
|
86
86
|
}
|
|
87
87
|
let luksName = 'luks-eggs-backup';
|
|
88
88
|
let luksFile = `/tmp/${luksName}`;
|
|
89
|
-
// let luksDevice = `/dev/mapper/${luksName}`
|
|
90
|
-
// let luksMountpoint = `/mnt`
|
|
91
89
|
if (this.familyId === 'debian') {
|
|
92
90
|
const yolk = new yolk_1.default();
|
|
93
91
|
if (!yolk.yolkExists()) {
|
|
@@ -103,7 +101,7 @@ class Ovary {
|
|
|
103
101
|
utils_2.default.warning('Using preesixent yolk...');
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
|
-
if (!
|
|
104
|
+
if (!fs_1.default.existsSync(this.settings.config.snapshot_dir)) {
|
|
107
105
|
shelljs_1.default.mkdir('-p', this.settings.config.snapshot_dir);
|
|
108
106
|
}
|
|
109
107
|
await this.settings.loadRemix(this.snapshot_basename, this.settings.config.theme);
|
|
@@ -118,8 +116,9 @@ class Ovary {
|
|
|
118
116
|
const bleach = new bleach_1.default();
|
|
119
117
|
await bleach.clean(verbose);
|
|
120
118
|
}
|
|
119
|
+
utils_2.default.warning('eggs will remove users accounts and datas from live');
|
|
121
120
|
if (backup) {
|
|
122
|
-
console.log(`
|
|
121
|
+
console.log(`Follow users' data and accounts will be saved in a crypted LUKS volume:`);
|
|
123
122
|
const users = await this.usersFill();
|
|
124
123
|
for (let i = 0; i < users.length; i++) {
|
|
125
124
|
if (users[i].saveIt) {
|
|
@@ -134,9 +133,6 @@ class Ovary {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
|
-
else {
|
|
138
|
-
utils_2.default.warning('eggs will remove all the users data from live, but all services data will be included uncrypted');
|
|
139
|
-
}
|
|
140
136
|
/**
|
|
141
137
|
* NOTE: reCreate = false
|
|
142
138
|
*
|
|
@@ -188,6 +184,8 @@ class Ovary {
|
|
|
188
184
|
}
|
|
189
185
|
if (backup) {
|
|
190
186
|
await (0, utils_1.exec)('eggs syncto', utils_2.default.setEcho(true));
|
|
187
|
+
utils_2.default.warning(`Waiting 10s, before to move ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
188
|
+
await (0, utils_1.exec)('sleep 10', utils_2.default.setEcho(false));
|
|
191
189
|
utils_2.default.warning(`moving ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
192
190
|
await (0, utils_1.exec)(`mv ${luksFile} ${this.settings.config.snapshot_dir}ovarium/iso/live`, this.echo);
|
|
193
191
|
}
|
|
@@ -211,27 +209,27 @@ class Ovary {
|
|
|
211
209
|
}
|
|
212
210
|
utils_2.default.warning(`Creating egg in ${this.settings.work_dir.path}`);
|
|
213
211
|
let cmd;
|
|
214
|
-
if (!
|
|
212
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.path)) {
|
|
215
213
|
cmd = `mkdir -p ${this.settings.work_dir.path}`;
|
|
216
214
|
this.tryCatch(cmd);
|
|
217
215
|
}
|
|
218
|
-
if (!
|
|
216
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.path + '/README.md')) {
|
|
219
217
|
cmd = `cp ${node_path_1.default.resolve(__dirname, '../../conf/README.md')} ${this.settings.work_dir.path}README.md}`;
|
|
220
218
|
this.tryCatch(cmd);
|
|
221
219
|
}
|
|
222
|
-
if (!
|
|
220
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.lowerdir)) {
|
|
223
221
|
cmd = `mkdir -p ${this.settings.work_dir.lowerdir}`;
|
|
224
222
|
this.tryCatch(cmd);
|
|
225
223
|
}
|
|
226
|
-
if (!
|
|
224
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.upperdir)) {
|
|
227
225
|
cmd = `mkdir -p ${this.settings.work_dir.upperdir}`;
|
|
228
226
|
this.tryCatch(cmd);
|
|
229
227
|
}
|
|
230
|
-
if (!
|
|
228
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.workdir)) {
|
|
231
229
|
cmd = `mkdir -p ${this.settings.work_dir.workdir}`;
|
|
232
230
|
this.tryCatch(cmd);
|
|
233
231
|
}
|
|
234
|
-
if (!
|
|
232
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.merged)) {
|
|
235
233
|
cmd = `mkdir -p ${this.settings.work_dir.merged}`;
|
|
236
234
|
this.tryCatch(cmd);
|
|
237
235
|
}
|
|
@@ -239,7 +237,7 @@ class Ovary {
|
|
|
239
237
|
* Creo le directory di destinazione per boot, efi, isolinux e live
|
|
240
238
|
* precedentemente in isolinux
|
|
241
239
|
*/
|
|
242
|
-
if (!
|
|
240
|
+
if (!fs_1.default.existsSync(this.settings.work_dir.pathIso)) {
|
|
243
241
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/boot/grub/${utils_2.default.machineUEFI()}`;
|
|
244
242
|
this.tryCatch(cmd);
|
|
245
243
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/efi/boot`;
|
|
@@ -289,16 +287,16 @@ class Ovary {
|
|
|
289
287
|
cmd = `find ${this.settings.work_dir.merged}/var/log/ -type f -exec truncate -s 0 {} \\;`;
|
|
290
288
|
await (0, utils_1.exec)(cmd, this.echo);
|
|
291
289
|
// Allow all fixed drives to be mounted with pmount
|
|
292
|
-
if (this.settings.config.pmount_fixed &&
|
|
290
|
+
if (this.settings.config.pmount_fixed && fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/pmount.allow`)) {
|
|
293
291
|
// MX aggiunto /etc
|
|
294
292
|
await (0, utils_1.exec)(`sed -i 's:#/dev/sd\[a-z\]:/dev/sd\[a-z\]:' ${this.settings.work_dir.merged}/etc/pmount.allow`, this.echo);
|
|
295
293
|
}
|
|
296
294
|
// Enable or disable password login through ssh for users (not root)
|
|
297
295
|
// Remove obsolete live-config file
|
|
298
|
-
if (
|
|
296
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}lib/live/config/1161-openssh-server`)) {
|
|
299
297
|
await (0, utils_1.exec)('rm -f "$work_dir"/myfs/lib/live/config/1161-openssh-server', this.echo);
|
|
300
298
|
}
|
|
301
|
-
if (
|
|
299
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/ssh/sshd_config`)) {
|
|
302
300
|
await (0, utils_1.exec)(`sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo);
|
|
303
301
|
await (this.settings.config.ssh_pass
|
|
304
302
|
? (0, utils_1.exec)(`sed -i 's|.*PasswordAuthentication.*no|PasswordAuthentication yes|' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo)
|
|
@@ -314,7 +312,7 @@ class Ovary {
|
|
|
314
312
|
* Remove crypttab if exists
|
|
315
313
|
* this is crucial for tpm systems.
|
|
316
314
|
*/
|
|
317
|
-
if (
|
|
315
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/crypttab`)) {
|
|
318
316
|
await (0, utils_1.exec)(`rm ${this.settings.work_dir.merged}/etc/crypttab`, this.echo);
|
|
319
317
|
// await exec(`touch ${this.settings.work_dir.merged}/etc/crypttab`, echo)
|
|
320
318
|
}
|
|
@@ -324,7 +322,7 @@ class Ovary {
|
|
|
324
322
|
* but if it exists and is empty, systemd will automatically
|
|
325
323
|
* set up a new unique ID.
|
|
326
324
|
*/
|
|
327
|
-
if (
|
|
325
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/machine-id`)) {
|
|
328
326
|
await (0, utils_1.exec)(`rm ${this.settings.work_dir.merged}/etc/machine-id`, this.echo);
|
|
329
327
|
await (0, utils_1.exec)(`touch ${this.settings.work_dir.merged}/etc/machine-id`, this.echo);
|
|
330
328
|
utils_2.default.write(`${this.settings.work_dir.merged}/etc/machine-id`, ':');
|
|
@@ -334,20 +332,25 @@ class Ovary {
|
|
|
334
332
|
* aggiungo un link a /boot/grub/fonts/UbuntuMono16.pf2
|
|
335
333
|
*/
|
|
336
334
|
shelljs_1.default.cp(`${this.settings.work_dir.merged}/boot/grub/fonts/unicode.pf2`, `${this.settings.work_dir.merged}/boot/grub/fonts/UbuntuMono16.pf2`);
|
|
335
|
+
/**
|
|
336
|
+
* cleaning /etc/resolv.conf
|
|
337
|
+
*/
|
|
338
|
+
let resolvFile = `${this.settings.work_dir.merged}/etc/resolv.conf`;
|
|
339
|
+
shelljs_1.default.rm(resolvFile);
|
|
337
340
|
/**
|
|
338
341
|
* Per tutte le distro systemd
|
|
339
342
|
*/
|
|
340
343
|
if (utils_2.default.isSystemd()) {
|
|
341
|
-
utils_2.default.warning('systemd');
|
|
342
344
|
const systemdctl = new systemctl_1.default(this.verbose);
|
|
343
345
|
/**
|
|
344
|
-
*
|
|
346
|
+
* systemd-systemd-resolved
|
|
345
347
|
*/
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
let resolvContent = '';
|
|
349
|
+
if (await systemdctl.isActive('systemd-resolved.service')) {
|
|
350
|
+
await systemdctl.stop('systemd-resolved.service');
|
|
351
|
+
resolvContent = 'nameserver 127.0.0.53\noptions edns0 trust-ad\nsearch .\n';
|
|
350
352
|
}
|
|
353
|
+
fs_1.default.writeFileSync(resolvFile, resolvContent);
|
|
351
354
|
if (await systemdctl.isEnabled('systemd-networkd.service')) {
|
|
352
355
|
await systemdctl.disable('systemd-networkd.service', this.settings.work_dir.merged, true);
|
|
353
356
|
}
|
|
@@ -383,18 +386,12 @@ class Ovary {
|
|
|
383
386
|
await (0, utils_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/network/${cleanDir}/wpasupplicant`, this.echo);
|
|
384
387
|
}
|
|
385
388
|
}
|
|
386
|
-
/**
|
|
387
|
-
* cleaning /etc/resolv.conf
|
|
388
|
-
* /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
|
|
389
|
-
*/
|
|
390
|
-
shelljs_1.default.rm(`${this.settings.work_dir.merged}/etc/resolv.conf`);
|
|
391
|
-
shelljs_1.default.touch(`${this.settings.work_dir.merged}/etc/resolv.conf`);
|
|
392
389
|
/**
|
|
393
390
|
* Clear configs from /etc/network/interfaces, wicd and NetworkManager
|
|
394
391
|
* and netman, so they aren't stealthily included in the snapshot.
|
|
395
392
|
*/
|
|
396
393
|
if (this.familyId === 'debian') {
|
|
397
|
-
if (
|
|
394
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/network/interfaces`)) {
|
|
398
395
|
await (0, utils_1.exec)(`rm ${this.settings.work_dir.merged}/etc/network/interfaces`, this.echo);
|
|
399
396
|
}
|
|
400
397
|
await (0, utils_1.exec)(`touch ${this.settings.work_dir.merged}/etc/network/interfaces`, this.echo);
|
|
@@ -403,59 +400,59 @@ class Ovary {
|
|
|
403
400
|
/**
|
|
404
401
|
* add some basic files to /dev
|
|
405
402
|
*/
|
|
406
|
-
if (!
|
|
403
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/console`)) {
|
|
407
404
|
await (0, utils_1.exec)(`mknod -m 622 ${this.settings.work_dir.merged}/dev/console c 5 1`, this.echo);
|
|
408
405
|
}
|
|
409
|
-
if (!
|
|
406
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/null`)) {
|
|
410
407
|
await (0, utils_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/null c 1 3`, this.echo);
|
|
411
408
|
}
|
|
412
|
-
if (!
|
|
409
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/zero`)) {
|
|
413
410
|
await (0, utils_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/zero c 1 5`, this.echo);
|
|
414
411
|
}
|
|
415
|
-
if (!
|
|
412
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/ptmx`)) {
|
|
416
413
|
await (0, utils_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/ptmx c 5 2`, this.echo);
|
|
417
414
|
}
|
|
418
|
-
if (!
|
|
415
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/tty`)) {
|
|
419
416
|
await (0, utils_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/tty c 5 0`, this.echo);
|
|
420
417
|
}
|
|
421
|
-
if (!
|
|
418
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/random`)) {
|
|
422
419
|
await (0, utils_1.exec)(`mknod -m 444 ${this.settings.work_dir.merged}/dev/random c 1 8`, this.echo);
|
|
423
420
|
}
|
|
424
|
-
if (!
|
|
421
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/urandom`)) {
|
|
425
422
|
await (0, utils_1.exec)(`mknod -m 444 ${this.settings.work_dir.merged}/dev/urandom c 1 9`, this.echo);
|
|
426
423
|
}
|
|
427
|
-
if (!
|
|
424
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/{console,ptmx,tty}`)) {
|
|
428
425
|
await (0, utils_1.exec)(`chown -v root:tty ${this.settings.work_dir.merged}/dev/{console,ptmx,tty}`, this.echo);
|
|
429
426
|
}
|
|
430
|
-
if (!
|
|
427
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/fd`)) {
|
|
431
428
|
await (0, utils_1.exec)(`ln -sv /proc/self/fd ${this.settings.work_dir.merged}/dev/fd`, this.echo);
|
|
432
429
|
}
|
|
433
|
-
if (!
|
|
430
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stdin`)) {
|
|
434
431
|
await (0, utils_1.exec)(`ln -sv /proc/self/fd/0 ${this.settings.work_dir.merged}/dev/stdin`, this.echo);
|
|
435
432
|
}
|
|
436
|
-
if (!
|
|
433
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stdout`)) {
|
|
437
434
|
await (0, utils_1.exec)(`ln -sv /proc/self/fd/1 ${this.settings.work_dir.merged}/dev/stdout`, this.echo);
|
|
438
435
|
}
|
|
439
|
-
if (!
|
|
436
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stderr`)) {
|
|
440
437
|
await (0, utils_1.exec)(`ln -sv /proc/self/fd/2 ${this.settings.work_dir.merged}/dev/stderr`, this.echo);
|
|
441
438
|
}
|
|
442
|
-
if (!
|
|
439
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/core`)) {
|
|
443
440
|
await (0, utils_1.exec)(`ln -sv /proc/kcore ${this.settings.work_dir.merged}/dev/core`, this.echo);
|
|
444
441
|
}
|
|
445
|
-
if (!
|
|
442
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/shm`)) {
|
|
446
443
|
await (0, utils_1.exec)(`mkdir -v ${this.settings.work_dir.merged}/dev/shm`, this.echo);
|
|
447
444
|
}
|
|
448
|
-
if (!
|
|
445
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/pts`)) {
|
|
449
446
|
await (0, utils_1.exec)(`mkdir -v ${this.settings.work_dir.merged}/dev/pts`, this.echo);
|
|
450
447
|
}
|
|
451
|
-
if (!
|
|
448
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/shm`)) {
|
|
452
449
|
await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/dev/shm`, this.echo);
|
|
453
450
|
}
|
|
454
451
|
/**
|
|
455
452
|
* Assegno 1777 a /tmp
|
|
456
453
|
* creava problemi con MXLINUX
|
|
457
454
|
*/
|
|
458
|
-
if (!
|
|
455
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/tmp`)) {
|
|
459
456
|
await (0, utils_1.exec)(`mkdir ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
460
457
|
}
|
|
461
458
|
await (0, utils_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
@@ -497,17 +494,17 @@ class Ovary {
|
|
|
497
494
|
*/
|
|
498
495
|
const isolinuxThemeDest = this.settings.work_dir.pathIso + 'isolinux/isolinux.theme.cfg';
|
|
499
496
|
const isolinuxThemeSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/isolinux.theme.cfg`);
|
|
500
|
-
if (!
|
|
497
|
+
if (!fs_1.default.existsSync(isolinuxThemeSrc)) {
|
|
501
498
|
utils_2.default.warning('Cannot find: ' + isolinuxThemeSrc);
|
|
502
499
|
process.exit();
|
|
503
500
|
}
|
|
504
|
-
|
|
501
|
+
fs_1.default.copyFileSync(isolinuxThemeSrc, isolinuxThemeDest);
|
|
505
502
|
/**
|
|
506
503
|
* isolinux.cfg from isolinux.template.cfg
|
|
507
504
|
*/
|
|
508
505
|
const isolinuxDest = this.settings.work_dir.pathIso + 'isolinux/isolinux.cfg';
|
|
509
506
|
let isolinuxTemplate = node_path_1.default.resolve(__dirname, `../../addons/templates/isolinux.template`);
|
|
510
|
-
if (!
|
|
507
|
+
if (!fs_1.default.existsSync(isolinuxTemplate)) {
|
|
511
508
|
utils_2.default.warning('Cannot find: ' + isolinuxTemplate);
|
|
512
509
|
process.exit();
|
|
513
510
|
}
|
|
@@ -516,7 +513,7 @@ class Ovary {
|
|
|
516
513
|
if (this.familyId === "archlinux") {
|
|
517
514
|
kernel_parameters = `misobasedir=live misolabel=${volid} boot=live locales=${process.env.LANG}`;
|
|
518
515
|
}
|
|
519
|
-
const template =
|
|
516
|
+
const template = fs_1.default.readFileSync(isolinuxTemplate, 'utf8');
|
|
520
517
|
const view = {
|
|
521
518
|
fullname: this.settings.remix.fullname.toUpperCase(),
|
|
522
519
|
kernel: utils_2.default.kernelVersion(),
|
|
@@ -524,17 +521,17 @@ class Ovary {
|
|
|
524
521
|
initrdImg: `/live${this.settings.initrdImg}`,
|
|
525
522
|
kernel_parameters: kernel_parameters,
|
|
526
523
|
};
|
|
527
|
-
|
|
524
|
+
fs_1.default.writeFileSync(isolinuxDest, mustache_1.default.render(template, view));
|
|
528
525
|
/**
|
|
529
526
|
* splash
|
|
530
527
|
*/
|
|
531
528
|
const splashDest = `${this.settings.work_dir.pathIso}/isolinux/splash.png`;
|
|
532
529
|
const splashSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/splash.png`);
|
|
533
|
-
if (!
|
|
530
|
+
if (!fs_1.default.existsSync(splashSrc)) {
|
|
534
531
|
utils_2.default.warning('Cannot find: ' + splashSrc);
|
|
535
532
|
process.exit();
|
|
536
533
|
}
|
|
537
|
-
|
|
534
|
+
fs_1.default.copyFileSync(splashSrc, splashDest);
|
|
538
535
|
}
|
|
539
536
|
/**
|
|
540
537
|
* copy kernel
|
|
@@ -544,7 +541,7 @@ class Ovary {
|
|
|
544
541
|
console.log('ovary: kernelCopy');
|
|
545
542
|
}
|
|
546
543
|
let lackVmlinuzImage = false;
|
|
547
|
-
if (
|
|
544
|
+
if (fs_1.default.existsSync(this.settings.kernel_image)) {
|
|
548
545
|
await (0, utils_1.exec)(`cp ${this.settings.kernel_image} ${this.settings.work_dir.pathIso}/live/`, this.echo);
|
|
549
546
|
}
|
|
550
547
|
else {
|
|
@@ -573,7 +570,7 @@ class Ovary {
|
|
|
573
570
|
async initrdCopy(verbose = false) {
|
|
574
571
|
let isCrypted = false;
|
|
575
572
|
utils_2.default.warning(`initrdCreate`);
|
|
576
|
-
if (
|
|
573
|
+
if (fs_1.default.existsSync(`/etc/crypttab`)) {
|
|
577
574
|
isCrypted = true;
|
|
578
575
|
await (0, utils_1.exec)(`mv /etc/crypttab /etc/crypttab.saved`, this.echo);
|
|
579
576
|
}
|
|
@@ -623,7 +620,7 @@ class Ovary {
|
|
|
623
620
|
const rcd = ['rc0.d', 'rc1.d', 'rc2.d', 'rc3.d', 'rc4.d', 'rc5.d', 'rc6.d', 'rcS.d'];
|
|
624
621
|
let files;
|
|
625
622
|
for (const i in rcd) {
|
|
626
|
-
files =
|
|
623
|
+
files = fs_1.default.readdirSync(`${this.settings.work_dir.merged}/etc/${rcd[i]}`);
|
|
627
624
|
for (const n in files) {
|
|
628
625
|
if (files[n].includes('cryptdisks')) {
|
|
629
626
|
this.addRemoveExclusion(true, `/etc/${rcd[i]}${files[n]}`);
|
|
@@ -636,8 +633,8 @@ class Ovary {
|
|
|
636
633
|
}
|
|
637
634
|
this.addRemoveExclusion(true, this.settings.config.snapshot_dir /* .absolutePath() */);
|
|
638
635
|
const compression = `-comp ${this.settings.config.compression}`;
|
|
639
|
-
if (
|
|
640
|
-
|
|
636
|
+
if (fs_1.default.existsSync(`${this.settings.work_dir.pathIso}/live/filesystem.squashfs`)) {
|
|
637
|
+
fs_1.default.unlinkSync(`${this.settings.work_dir.pathIso}/live/filesystem.squashfs`);
|
|
641
638
|
}
|
|
642
639
|
// let cmd = `mksquashfs ${this.settings.work_dir.merged} ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${compression} -wildcards -ef ${this.settings.config.snapshot_excludes} ${this.settings.session_excludes} `
|
|
643
640
|
let cmd = `mksquashfs ${this.settings.work_dir.merged} ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${compression} -wildcards -ef ${this.settings.config.snapshot_excludes} ${this.settings.session_excludes} `;
|
|
@@ -717,7 +714,7 @@ class Ovary {
|
|
|
717
714
|
* fs.readdirSync('/', { withFileTypes: true })
|
|
718
715
|
* viene ignorato da Node8, ma da problemi da Node10 in poi
|
|
719
716
|
*/
|
|
720
|
-
const dirs =
|
|
717
|
+
const dirs = fs_1.default.readdirSync('/');
|
|
721
718
|
const startLine = '#############################################################';
|
|
722
719
|
const titleLine = '# -----------------------------------------------------------';
|
|
723
720
|
const endLine = '# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n';
|
|
@@ -764,7 +761,7 @@ class Ovary {
|
|
|
764
761
|
}
|
|
765
762
|
else if (n8_1.default.isFile(dir)) {
|
|
766
763
|
cmds.push(`# /${dir} is just a file`, titleLine);
|
|
767
|
-
if (!
|
|
764
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
768
765
|
cmds.push(await rexec(`cp /${dir} ${this.settings.work_dir.merged}`, this.verbose));
|
|
769
766
|
}
|
|
770
767
|
else {
|
|
@@ -772,10 +769,10 @@ class Ovary {
|
|
|
772
769
|
}
|
|
773
770
|
}
|
|
774
771
|
else if (n8_1.default.isSymbolicLink(dir)) {
|
|
775
|
-
lnkDest =
|
|
772
|
+
lnkDest = fs_1.default.readlinkSync(`/${dir}`);
|
|
776
773
|
cmds.push(`# /${dir} is a symbolic link to /${lnkDest} in the system`, '# we need just to recreate it', `# ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`, "# but we don't know if the destination exist, and I'm too lazy today. So, for now: ", titleLine);
|
|
777
|
-
if (!
|
|
778
|
-
if (
|
|
774
|
+
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
775
|
+
if (fs_1.default.existsSync(lnkDest)) {
|
|
779
776
|
cmds.push(`ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`);
|
|
780
777
|
}
|
|
781
778
|
else {
|
|
@@ -802,8 +799,8 @@ class Ovary {
|
|
|
802
799
|
cmds.push('# NOTE: home, cdrom, dev, live, media, mnt, proc, run, sys and tmp', `# need just to be removed in ${this.settings.work_dir.merged}`);
|
|
803
800
|
cmds.push(`# host: ${node_os_1.default.hostname()} user: ${utils_2.default.getPrimaryUser()}\n`);
|
|
804
801
|
// await exec(`/usr/bin/pkill mksquashfs; /usr/bin/pkill md5sum`, {echo: true})
|
|
805
|
-
if (
|
|
806
|
-
const bindDirs =
|
|
802
|
+
if (fs_1.default.existsSync(this.settings.work_dir.merged)) {
|
|
803
|
+
const bindDirs = fs_1.default.readdirSync(this.settings.work_dir.merged, {
|
|
807
804
|
withFileTypes: true
|
|
808
805
|
});
|
|
809
806
|
for (const dir of bindDirs) {
|
|
@@ -966,11 +963,10 @@ class Ovary {
|
|
|
966
963
|
*/
|
|
967
964
|
// adapt
|
|
968
965
|
if (myAddons.adapt) {
|
|
969
|
-
// if (Pacman.packageIsInstalled('lxde-core') || Pacman.packageIsInstalled('deepin-desktop-base') || Pacman.packageIsInstalled('mate-desktop') || Pacman.packageIsInstalled('ubuntu-mate-core') || Pacman.packageIsInstalled('xfce4')) {
|
|
970
966
|
const dirAddon = node_path_1.default.resolve(__dirname, `../../addons/eggs/adapt/`);
|
|
971
967
|
shelljs_1.default.cp(`${dirAddon}/applications/eggs-adapt.desktop`, `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
972
|
-
|
|
973
|
-
|
|
968
|
+
shelljs_1.default.cp(`${dirAddon}/bin/adapt`, `${this.settings.work_dir.merged}/usr/local/bin/`);
|
|
969
|
+
shelljs_1.default.chmod('+x', `${this.settings.work_dir.merged}/usr/local/bin/adapt`);
|
|
974
970
|
}
|
|
975
971
|
// ichoice
|
|
976
972
|
if (myAddons.ichoice) {
|
|
@@ -979,6 +975,7 @@ class Ovary {
|
|
|
979
975
|
const dirAddon = node_path_1.default.resolve(__dirname, '../../addons/eggs/ichoice/');
|
|
980
976
|
shelljs_1.default.cp(`${dirAddon}/applications/eggs-ichoice.desktop`, `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
981
977
|
shelljs_1.default.cp(`${dirAddon}/bin/eggs-ichoice.sh`, `${this.settings.work_dir.merged}/usr/local/bin/`);
|
|
978
|
+
shelljs_1.default.chmod('+x', `${this.settings.work_dir.merged}/usr/local/bin/eggs-ichoice.sh`);
|
|
982
979
|
}
|
|
983
980
|
// pve
|
|
984
981
|
if (myAddons.pve) {
|
|
@@ -1005,7 +1002,7 @@ class Ovary {
|
|
|
1005
1002
|
*/
|
|
1006
1003
|
const dirAutostart = `${this.settings.work_dir.merged}/etc/xdg/autostart`;
|
|
1007
1004
|
const dirRun = '/usr/bin';
|
|
1008
|
-
if (
|
|
1005
|
+
if (fs_1.default.existsSync(dirAutostart)) {
|
|
1009
1006
|
// Creo l'avviatore xdg DEVE essere add-penguins-links.desktop
|
|
1010
1007
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-links-add.desktop'), dirAutostart);
|
|
1011
1008
|
// Creo lo script add-penguins-links.sh
|
|
@@ -1036,16 +1033,11 @@ class Ovary {
|
|
|
1036
1033
|
if (myAddons.rsupport)
|
|
1037
1034
|
text += 'cp /usr/share/applications/eggs-rsupport.desktop $DESKTOP\n';
|
|
1038
1035
|
}
|
|
1039
|
-
// enable desktop links in gnome
|
|
1040
1036
|
/**
|
|
1041
|
-
*
|
|
1042
|
-
* test -f "$DESKTOP/penguins-eggs.desktop" && chmod a+x "$DESKTOP/penguins-eggs.desktop"
|
|
1043
|
-
* test -f "$DESKTOP/penguins-eggs.desktop" && gio set "$DESKTOP/penguins-eggs.desktop" metadata::trusted true
|
|
1044
|
-
* test -f /usr/share/applications/install-debian.desktop && cp /usr/share/applications/install-debian.desktop $DESKTOP
|
|
1045
|
-
* test -f "$DESKTOP/install-debian.desktop" && chmod a+x $DESKTOP/install-debian.desktop
|
|
1046
|
-
* test -f "$DESKTOP/install-debian.desktop" && gio set "$DESKTOP/install-debian.desktop" metadata::trusted true
|
|
1037
|
+
* enable desktop links
|
|
1047
1038
|
*/
|
|
1048
1039
|
if (pacman_1.default.packageIsInstalled('gdm3') || pacman_1.default.packageIsInstalled('gdm')) {
|
|
1040
|
+
// GNOME
|
|
1049
1041
|
text += `test -f /usr/share/applications/penguins-eggs.desktop && cp /usr/share/applications/penguins-eggs.desktop $DESKTOP\n`;
|
|
1050
1042
|
text += `test -f "$DESKTOP/penguins-eggs.desktop" && chmod a+x "$DESKTOP/penguins-eggs.desktop"\n`;
|
|
1051
1043
|
text += `test -f "$DESKTOP/penguins-eggs.desktop" && gio set "$DESKTOP/penguins-eggs.desktop" metadata::trusted true\n`;
|
|
@@ -1053,7 +1045,11 @@ class Ovary {
|
|
|
1053
1045
|
text += `test -f "$DESKTOP/install-debian.desktop" && chmod a+x $DESKTOP/install-debian.desktop\n`;
|
|
1054
1046
|
text += `test -f "$DESKTOP/install-debian.desktop" && gio set "$DESKTOP/install-debian.desktop" metadata::trusted true\n`;
|
|
1055
1047
|
}
|
|
1056
|
-
|
|
1048
|
+
else {
|
|
1049
|
+
// OTHERS: CINNAMON/KDE/ETC
|
|
1050
|
+
text += `chmod +x $DESKTOP/*.desktop`;
|
|
1051
|
+
}
|
|
1052
|
+
fs_1.default.writeFileSync(script, text, 'utf8');
|
|
1057
1053
|
await (0, utils_1.exec)(`chmod a+x ${script}`, this.echo);
|
|
1058
1054
|
}
|
|
1059
1055
|
await xdg_1.default.autologin(utils_2.default.getPrimaryUser(), this.settings.config.user_opt, this.settings.work_dir.merged);
|
|
@@ -1116,7 +1112,7 @@ class Ovary {
|
|
|
1116
1112
|
/**
|
|
1117
1113
|
* Creo o cancello e creo: memdiskDir
|
|
1118
1114
|
*/
|
|
1119
|
-
if (
|
|
1115
|
+
if (fs_1.default.existsSync(memdiskDir)) {
|
|
1120
1116
|
await (0, utils_1.exec)(`rm ${memdiskDir} -rf`, this.echo);
|
|
1121
1117
|
}
|
|
1122
1118
|
utils_2.default.warning('creating memdiskDir: ' + memdiskDir);
|
|
@@ -1136,7 +1132,7 @@ class Ovary {
|
|
|
1136
1132
|
/**
|
|
1137
1133
|
* start with empty efiWorkDir
|
|
1138
1134
|
*/
|
|
1139
|
-
if (
|
|
1135
|
+
if (fs_1.default.existsSync(efiWorkDir)) {
|
|
1140
1136
|
await (0, utils_1.exec)(`rm ${efiWorkDir} -rf`, this.echo);
|
|
1141
1137
|
}
|
|
1142
1138
|
utils_2.default.warning('creating efiWordDir: ' + efiWorkDir);
|
|
@@ -1151,7 +1147,7 @@ class Ovary {
|
|
|
1151
1147
|
*/
|
|
1152
1148
|
const splashDest = `${efiWorkDir}/boot/grub/splash.png`;
|
|
1153
1149
|
const splashSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/splash.png`);
|
|
1154
|
-
if (!
|
|
1150
|
+
if (!fs_1.default.existsSync(splashSrc)) {
|
|
1155
1151
|
utils_2.default.warning('Cannot find: ' + splashSrc);
|
|
1156
1152
|
process.exit();
|
|
1157
1153
|
}
|
|
@@ -1161,7 +1157,7 @@ class Ovary {
|
|
|
1161
1157
|
*/
|
|
1162
1158
|
const themeDest = `${efiWorkDir}/boot/grub/theme.cfg`;
|
|
1163
1159
|
const themeSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/grub.theme.cfg`);
|
|
1164
|
-
if (!
|
|
1160
|
+
if (!fs_1.default.existsSync(themeSrc)) {
|
|
1165
1161
|
utils_2.default.warning('Cannot find: ' + themeSrc);
|
|
1166
1162
|
process.exit();
|
|
1167
1163
|
}
|
|
@@ -1214,10 +1210,10 @@ class Ovary {
|
|
|
1214
1210
|
await (0, utils_1.exec)(`cp -r /usr/lib/grub/${utils_2.default.machineUEFI()}/* ${efiWorkDir}/boot/grub/${utils_2.default.machineUEFI()}/`, this.echo);
|
|
1215
1211
|
// if this doesn't work try another font from the same place (grub's default, unicode.pf2, is much larger)
|
|
1216
1212
|
// Either of these will work, and they look the same to me. Unicode seems to work with qemu. -fsr
|
|
1217
|
-
if (
|
|
1213
|
+
if (fs_1.default.existsSync('/usr/share/grub/unicode.pf2')) {
|
|
1218
1214
|
await (0, utils_1.exec)(`cp /usr/share/grub/unicode.pf2 ${efiWorkDir}/boot/grub/font.pf2`, this.echo);
|
|
1219
1215
|
}
|
|
1220
|
-
else if (
|
|
1216
|
+
else if (fs_1.default.existsSync('/usr/share/grub2/ascii.pf2')) {
|
|
1221
1217
|
await (0, utils_1.exec)(`cp /usr/share/grub2/ascii.pf2 ${efiWorkDir}/boot/grub/font.pf2`, this.echo);
|
|
1222
1218
|
}
|
|
1223
1219
|
// doesn't need to be root-owned
|
|
@@ -1234,16 +1230,16 @@ class Ovary {
|
|
|
1234
1230
|
// grub.theme.cfg
|
|
1235
1231
|
const grubThemeSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/grub.theme.cfg`);
|
|
1236
1232
|
const grubThemeDest = `${isoDir}/boot/grub/theme.cfg`;
|
|
1237
|
-
if (!
|
|
1233
|
+
if (!fs_1.default.existsSync(grubThemeSrc)) {
|
|
1238
1234
|
utils_2.default.warning('Cannot find: ' + grubThemeSrc);
|
|
1239
1235
|
process.exit();
|
|
1240
1236
|
}
|
|
1241
|
-
|
|
1237
|
+
fs_1.default.copyFileSync(grubThemeSrc, grubThemeDest);
|
|
1242
1238
|
/**
|
|
1243
1239
|
* prepare grub.cfg from grub.template.cfg
|
|
1244
1240
|
*/
|
|
1245
1241
|
const grubTemplate = node_path_1.default.resolve(__dirname, `../../addons/templates/grub.template`);
|
|
1246
|
-
if (!
|
|
1242
|
+
if (!fs_1.default.existsSync(grubTemplate)) {
|
|
1247
1243
|
utils_2.default.warning('Cannot find: ' + grubTemplate);
|
|
1248
1244
|
process.exit();
|
|
1249
1245
|
}
|
|
@@ -1253,7 +1249,7 @@ class Ovary {
|
|
|
1253
1249
|
kernel_parameters = `misobasedir=live misolabel=${volid} boot=live locales=${process.env.LANG}`;
|
|
1254
1250
|
}
|
|
1255
1251
|
const grubDest = `${isoDir}/boot/grub/grub.cfg`;
|
|
1256
|
-
const template =
|
|
1252
|
+
const template = fs_1.default.readFileSync(grubTemplate, 'utf8');
|
|
1257
1253
|
// let rmModules = ''
|
|
1258
1254
|
// if (this.settings.distro.codenameLikeId === 'focal') {
|
|
1259
1255
|
// rmModules = 'rmmod tpm'
|
|
@@ -1266,11 +1262,11 @@ class Ovary {
|
|
|
1266
1262
|
kernel_parameters: kernel_parameters,
|
|
1267
1263
|
// rmModules: rmModules,
|
|
1268
1264
|
};
|
|
1269
|
-
|
|
1265
|
+
fs_1.default.writeFileSync(grubDest, mustache_1.default.render(template, view));
|
|
1270
1266
|
/**
|
|
1271
1267
|
* loopback.cfg
|
|
1272
1268
|
*/
|
|
1273
|
-
|
|
1269
|
+
fs_1.default.writeFileSync(`${isoDir}/boot/grub/loopback.cfg`, 'source /boot/grub/grub.cfg\n');
|
|
1274
1270
|
}
|
|
1275
1271
|
// #######################################################################################
|
|
1276
1272
|
/**
|
|
@@ -1280,21 +1276,21 @@ class Ovary {
|
|
|
1280
1276
|
*/
|
|
1281
1277
|
makeDotDisk(backup = false) {
|
|
1282
1278
|
const dotDisk = this.settings.work_dir.pathIso + '/.disk';
|
|
1283
|
-
if (
|
|
1279
|
+
if (fs_1.default.existsSync(dotDisk)) {
|
|
1284
1280
|
shelljs_1.default.rm('-rf', dotDisk);
|
|
1285
1281
|
}
|
|
1286
1282
|
shelljs_1.default.mkdir('-p', dotDisk);
|
|
1287
1283
|
// .disk/info
|
|
1288
1284
|
let file = dotDisk + '/info';
|
|
1289
1285
|
let content = utils_2.default.getVolid(this.settings.remix.name);
|
|
1290
|
-
|
|
1286
|
+
fs_1.default.writeFileSync(file, content, 'utf-8');
|
|
1291
1287
|
// .disk/mksquashfs
|
|
1292
1288
|
const scripts = this.settings.work_dir.path;
|
|
1293
1289
|
shelljs_1.default.cp(scripts + '/mksquashfs', dotDisk + '/mksquashfs');
|
|
1294
1290
|
// .disk/mkisofs
|
|
1295
1291
|
content = this.xorrisoCommand(backup).replace(/\s\s+/g, ' ');
|
|
1296
1292
|
file = dotDisk + '/mkisofs';
|
|
1297
|
-
|
|
1293
|
+
fs_1.default.writeFileSync(file, content, 'utf-8');
|
|
1298
1294
|
return content;
|
|
1299
1295
|
}
|
|
1300
1296
|
/**
|
|
@@ -1318,7 +1314,7 @@ class Ovary {
|
|
|
1318
1314
|
let isoHybridMbr = ``;
|
|
1319
1315
|
if (this.settings.config.make_isohybrid) {
|
|
1320
1316
|
const isolinuxFile = this.settings.distro.isolinuxPath + 'isohdpfx.bin';
|
|
1321
|
-
if (
|
|
1317
|
+
if (fs_1.default.existsSync(isolinuxFile)) {
|
|
1322
1318
|
isoHybridMbr = `-isohybrid-mbr ${isolinuxFile}`;
|
|
1323
1319
|
}
|
|
1324
1320
|
else {
|
|
@@ -1479,8 +1475,8 @@ class Ovary {
|
|
|
1479
1475
|
*/
|
|
1480
1476
|
async usersFill() {
|
|
1481
1477
|
const usersArray = [];
|
|
1482
|
-
await (0, promises_1.access)('/etc/passwd',
|
|
1483
|
-
const passwd =
|
|
1478
|
+
await (0, promises_1.access)('/etc/passwd', fs_2.constants.R_OK | fs_2.constants.W_OK);
|
|
1479
|
+
const passwd = fs_1.default.readFileSync('/etc/passwd', 'utf-8').split('\n');
|
|
1484
1480
|
for (let i = 0; i < passwd.length; i++) {
|
|
1485
1481
|
var line = passwd[i].split(':');
|
|
1486
1482
|
const users = new users_1.default(line[0], line[1], line[2], line[3], line[4], line[5], line[6]);
|
|
@@ -1503,7 +1499,7 @@ async function makeIfNotExist(path, verbose = false) {
|
|
|
1503
1499
|
}
|
|
1504
1500
|
const echo = utils_2.default.setEcho(verbose);
|
|
1505
1501
|
let cmd = `# ${path} alreasy exist`;
|
|
1506
|
-
if (!
|
|
1502
|
+
if (!fs_1.default.existsSync(path)) {
|
|
1507
1503
|
cmd = `mkdir ${path} -p`;
|
|
1508
1504
|
await (0, utils_1.exec)(cmd, echo);
|
|
1509
1505
|
}
|