penguins-eggs 9.0.35 → 9.0.48
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 +442 -17
- package/conf/distros/buster/calamares/modules/bootloader.yml +3 -1
- package/conf/eggs.yaml +9 -2
- package/lib/classes/basket.js +4 -4
- package/lib/classes/bleach.js +2 -2
- package/lib/classes/compressors.js +1 -1
- package/lib/classes/daddy.js +6 -6
- package/lib/classes/distro.js +17 -3
- package/lib/classes/family/archlinux.js +4 -4
- package/lib/classes/family/debian.js +4 -4
- package/lib/classes/family/fedora.js +4 -4
- package/lib/classes/family/suse.js +4 -4
- package/lib/classes/i18n.d.ts +28 -4
- package/lib/classes/i18n.js +112 -84
- package/lib/classes/incubation/branding.js +13 -7
- package/lib/classes/incubation/distros/bionic.js +1 -1
- package/lib/classes/incubation/distros/buster.js +1 -1
- package/lib/classes/incubation/distros/focal.js +1 -1
- package/lib/classes/incubation/distros/jessie.js +1 -1
- package/lib/classes/incubation/distros/rolling.js +1 -1
- package/lib/classes/incubation/fisherman-helper/displaymanager.js +1 -1
- package/lib/classes/incubation/fisherman-helper/packages.js +1 -1
- package/lib/classes/incubation/fisherman.js +5 -5
- package/lib/classes/incubation/incubator.js +4 -4
- package/lib/classes/incubation/installer.js +2 -2
- package/lib/classes/initrd.js +2 -2
- package/lib/classes/keyboards.d.ts +45 -0
- package/lib/classes/keyboards.js +196 -0
- package/lib/classes/krill_install.d.ts +4 -0
- package/lib/classes/krill_install.js +28 -10
- package/lib/classes/krill_prepare.d.ts +4 -0
- package/lib/classes/krill_prepare.js +56 -77
- package/lib/classes/locales.d.ts +14 -0
- package/lib/classes/locales.js +54 -0
- package/lib/classes/n8.js +1 -1
- package/lib/classes/ovary.js +17 -17
- package/lib/classes/pacman.js +19 -19
- package/lib/classes/pve-live.js +3 -3
- package/lib/classes/settings.d.ts +6 -0
- package/lib/classes/settings.js +11 -13
- package/lib/classes/systemctl.js +1 -1
- package/lib/classes/tailor.d.ts +20 -0
- package/lib/classes/tailor.js +460 -0
- package/lib/classes/tools.js +4 -4
- package/lib/classes/users.js +1 -1
- package/lib/classes/utils.js +9 -9
- package/lib/classes/xdg.js +5 -5
- package/lib/classes/yolk.js +5 -5
- package/lib/commands/adapt.js +1 -1
- package/lib/commands/analyze.js +2 -2
- package/lib/commands/bro.js +2 -2
- package/lib/commands/calamares.js +4 -4
- package/lib/commands/config.js +4 -4
- package/lib/commands/dad.js +2 -2
- package/lib/commands/export/deb.js +2 -2
- package/lib/commands/export/docs.js +2 -2
- package/lib/commands/export/iso.js +2 -2
- package/lib/commands/info.js +1 -1
- package/lib/commands/install.js +5 -5
- package/lib/commands/kill.js +2 -2
- package/lib/commands/mom.js +2 -2
- package/lib/commands/produce.js +8 -8
- package/lib/commands/remove.js +2 -2
- package/lib/commands/syncfrom.js +1 -1
- package/lib/commands/syncto.js +2 -2
- package/lib/commands/tools/clean.js +2 -2
- package/lib/commands/tools/locales.js +9 -4
- package/lib/commands/tools/skel.js +2 -2
- package/lib/commands/tools/stat.js +3 -3
- package/lib/commands/tools/yolk.js +4 -4
- package/lib/commands/update.js +5 -5
- package/lib/commands/wardrobe/ironing.d.ts +14 -0
- package/lib/commands/wardrobe/ironing.js +123 -0
- package/lib/commands/wardrobe/list.d.ts +13 -0
- package/lib/commands/wardrobe/list.js +46 -0
- package/lib/commands/wardrobe/show.d.ts +15 -0
- package/lib/commands/wardrobe/show.js +55 -0
- package/lib/commands/wardrobe/wear.d.ts +11 -0
- package/lib/commands/wardrobe/wear.js +42 -0
- package/lib/components/elements/information.js +6 -6
- package/lib/components/elements/steps.js +1 -1
- package/lib/components/elements/title.js +2 -2
- package/lib/components/finished.js +5 -5
- package/lib/components/install.js +5 -5
- package/lib/components/keyboard.js +5 -8
- package/lib/components/location.js +5 -5
- package/lib/components/network.js +5 -5
- package/lib/components/partitions.js +5 -5
- package/lib/components/summary.js +5 -5
- package/lib/components/users.js +5 -5
- package/lib/components/welcome.js +6 -6
- package/lib/interfaces/i-costume.d.ts +43 -0
- package/lib/interfaces/i-costume.js +2 -0
- package/lib/interfaces/i-krill.d.ts +1 -0
- package/lib/interfaces/i-packages.d.ts +13 -0
- package/lib/interfaces/i-packages.js +2 -0
- package/lib/interfaces/i-xkb-model.d.ts +17 -0
- package/lib/interfaces/i-xkb-model.js +2 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/lib/cli-autologin.js +3 -3
- package/lib/lib/select_address_type.js +1 -1
- package/lib/lib/select_filesystem_type.js +2 -2
- package/lib/lib/select_installation_device.js +1 -1
- package/lib/lib/select_interface.js +1 -1
- package/lib/lib/select_keyboard_layout.d.ts +1 -28
- package/lib/lib/select_keyboard_layout.js +18 -33
- package/lib/lib/select_keyboard_model.d.ts +4 -0
- package/lib/lib/select_keyboard_model.js +36 -0
- package/lib/lib/select_keyboard_option.d.ts +4 -0
- package/lib/lib/select_keyboard_option.js +36 -0
- package/lib/lib/select_keyboard_variant.d.ts +1 -5
- package/lib/lib/select_keyboard_variant.js +32 -5
- package/lib/lib/select_languages.d.ts +1 -1
- package/lib/lib/select_languages.js +8 -7
- package/lib/lib/select_regions.d.ts +1 -1
- package/lib/lib/select_regions.js +2 -2
- package/lib/lib/select_user_swap_choice.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +3 -2
- package/scripts/_eggs +43 -2
- package/scripts/eggs.bash +6 -2
- package/scripts/resy.sh +8 -0
- package/wardrobe.d/external.yml +7 -0
- package/wardrobe.d/hen/control.template +10 -0
- package/wardrobe.d/hen/index.yml +212 -0
- package/wardrobe.d/kde/index.yml +41 -0
- package/wardrobe.d/lamp/index.yml +35 -0
- package/wardrobe.d/xfce4/index.yml +53 -0
- package/conf/distros/buster/locales/locale.gen.template +0 -10
- package/conf/distros/buster/locales/locale.template +0 -11
- package/conf/distros/focal/locale.gen.template +0 -8
package/lib/classes/pacman.js
CHANGED
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
|
-
const node_fs_1 =
|
|
11
|
-
const node_path_1 =
|
|
12
|
-
const shelljs_1 =
|
|
13
|
-
const utils_1 =
|
|
14
|
-
const distro_1 =
|
|
15
|
-
const settings_1 =
|
|
10
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
11
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
12
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
13
|
+
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
14
|
+
const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
15
|
+
const settings_1 = tslib_1.__importDefault(require("./settings"));
|
|
16
16
|
const node_child_process_1 = require("node:child_process");
|
|
17
17
|
const utils_2 = require("../lib/utils");
|
|
18
|
-
const debian_1 =
|
|
19
|
-
const fedora_1 =
|
|
20
|
-
const archlinux_1 =
|
|
21
|
-
const suse_1 =
|
|
18
|
+
const debian_1 = tslib_1.__importDefault(require("./family/debian"));
|
|
19
|
+
const fedora_1 = tslib_1.__importDefault(require("./family/fedora"));
|
|
20
|
+
const archlinux_1 = tslib_1.__importDefault(require("./family/archlinux"));
|
|
21
|
+
const suse_1 = tslib_1.__importDefault(require("./family/suse"));
|
|
22
22
|
const config_file = '/etc/penguins-eggs.d/eggs.yaml';
|
|
23
23
|
const config_tools = '/etc/penguins-eggs.d/tools.yaml';
|
|
24
24
|
/**
|
|
@@ -341,10 +341,10 @@ class Pacman {
|
|
|
341
341
|
config.compression = 'xz';
|
|
342
342
|
config.ssh_pass = true;
|
|
343
343
|
config.timezone = 'Europe/Rome';
|
|
344
|
-
config.pmount_fixed = false;
|
|
345
344
|
const env = process.env;
|
|
346
345
|
config.locales_default = env.LANG !== undefined ? env.LANG : 'en_US.UTF-8';
|
|
347
346
|
config.locales = config.locales_default === 'en_US.UTF-8' ? ['en_US.UTF-8'] : [config.locales_default, 'en_US.UTF-8'];
|
|
347
|
+
config.pmount_fixed = false;
|
|
348
348
|
if (!this.packageIsInstalled('calamares')) {
|
|
349
349
|
config.force_installer = false;
|
|
350
350
|
console.log('Due the lacks of calamares package set force_installer = false');
|
|
@@ -469,7 +469,7 @@ class Pacman {
|
|
|
469
469
|
*/
|
|
470
470
|
if (this.distro().codenameLikeId === 'jessie') {
|
|
471
471
|
const dest = '/etc/penguins-eggs.d/distros/jessie';
|
|
472
|
-
await
|
|
472
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
473
473
|
await (0, utils_2.exec)(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
474
474
|
/**
|
|
475
475
|
* Debian 9 stretch: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
|
|
@@ -477,7 +477,7 @@ class Pacman {
|
|
|
477
477
|
}
|
|
478
478
|
else if (this.distro().codenameLikeId === 'stretch') {
|
|
479
479
|
const dest = '/etc/penguins-eggs.d/distros/stretch';
|
|
480
|
-
await
|
|
480
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
481
481
|
await (0, utils_2.exec)(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
482
482
|
/**
|
|
483
483
|
* Debian 10 buster: eredita tutto da buster
|
|
@@ -485,7 +485,7 @@ class Pacman {
|
|
|
485
485
|
}
|
|
486
486
|
else if (this.distro().codenameLikeId === 'buster') {
|
|
487
487
|
const dest = '/etc/penguins-eggs.d/distros/buster';
|
|
488
|
-
await
|
|
488
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
489
489
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
490
490
|
/**
|
|
491
491
|
* Debian 11 bullseye: eredita tutto da buster
|
|
@@ -493,7 +493,7 @@ class Pacman {
|
|
|
493
493
|
}
|
|
494
494
|
else if (this.distro().codenameLikeId === 'bullseye') {
|
|
495
495
|
const dest = '/etc/penguins-eggs.d/distros/bullseye';
|
|
496
|
-
await
|
|
496
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
497
497
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
498
498
|
/**
|
|
499
499
|
* Debian 12 bookworm: eredita tutto da buster
|
|
@@ -501,7 +501,7 @@ class Pacman {
|
|
|
501
501
|
}
|
|
502
502
|
else if (this.distro().codenameLikeId === 'bookworm') {
|
|
503
503
|
const dest = '/etc/penguins-eggs.d/distros/bookworm';
|
|
504
|
-
await
|
|
504
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
505
505
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
506
506
|
/***********************************************************************************
|
|
507
507
|
* Devuan
|
|
@@ -512,7 +512,7 @@ class Pacman {
|
|
|
512
512
|
}
|
|
513
513
|
else if (this.distro().codenameLikeId === 'beowulf') {
|
|
514
514
|
const dest = '/etc/penguins-eggs.d/distros/beowulf';
|
|
515
|
-
await
|
|
515
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
516
516
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
517
517
|
/**
|
|
518
518
|
* Devuan chimaera: eredita tutto da buster
|
|
@@ -520,7 +520,7 @@ class Pacman {
|
|
|
520
520
|
}
|
|
521
521
|
else if (this.distro().codenameLikeId === 'chimaera') {
|
|
522
522
|
const dest = '/etc/penguins-eggs.d/distros/chimaera';
|
|
523
|
-
await
|
|
523
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
524
524
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
525
525
|
/**
|
|
526
526
|
* Devuan daedalus: eredita tutto da buster
|
|
@@ -528,7 +528,7 @@ class Pacman {
|
|
|
528
528
|
}
|
|
529
529
|
else if (this.distro().codenameLikeId === 'daedalus') {
|
|
530
530
|
const dest = '/etc/penguins-eggs.d/distros/daedalus';
|
|
531
|
-
await
|
|
531
|
+
// await exec(`cp -r ${buster}/locales ${dest}/locales`, echo)
|
|
532
532
|
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
533
533
|
/***********************************************************************************
|
|
534
534
|
* Ubuntu
|
package/lib/classes/pve-live.js
CHANGED
|
@@ -16,9 +16,9 @@ const tslib_1 = require("tslib");
|
|
|
16
16
|
* sudo systemctl disable application.service
|
|
17
17
|
* This will remove the symbolic link that indicated that the service should be started automatically.
|
|
18
18
|
*/
|
|
19
|
-
const systemctl_1 =
|
|
20
|
-
const path_1 =
|
|
21
|
-
const shelljs_1 =
|
|
19
|
+
const systemctl_1 = tslib_1.__importDefault(require("./systemctl"));
|
|
20
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
21
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
22
22
|
class PveLive {
|
|
23
23
|
constructor() {
|
|
24
24
|
this.systemctl = {};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* penguins-eggs: ovary.ts VERSIONE DEBIAN-LIVE
|
|
3
|
+
* author: Piero Proietti
|
|
4
|
+
* mail: piero.proietti@gmail.com
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
1
7
|
import { IRemix, IDistro, IApp, IWorkDir } from '../interfaces';
|
|
2
8
|
import Incubator from './incubation/incubator';
|
|
3
9
|
import { IConfig } from '../interfaces';
|
package/lib/classes/settings.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable valid-jsdoc */
|
|
3
|
-
/* eslint-disable no-console */
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
2
|
/**
|
|
7
3
|
* penguins-eggs: ovary.ts VERSIONE DEBIAN-LIVE
|
|
8
4
|
* author: Piero Proietti
|
|
9
5
|
* mail: piero.proietti@gmail.com
|
|
10
6
|
*
|
|
11
7
|
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
12
10
|
// packages
|
|
13
|
-
const node_fs_1 =
|
|
14
|
-
const node_os_1 =
|
|
15
|
-
const js_yaml_1 =
|
|
16
|
-
const shelljs_1 =
|
|
17
|
-
const pjson_1 =
|
|
18
|
-
const chalk_1 =
|
|
11
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
12
|
+
const node_os_1 = tslib_1.__importDefault(require("node:os"));
|
|
13
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
14
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
15
|
+
const pjson_1 = tslib_1.__importDefault(require("pjson"));
|
|
16
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
19
17
|
// libraries
|
|
20
18
|
// classes
|
|
21
|
-
const utils_1 =
|
|
22
|
-
const distro_1 =
|
|
23
|
-
const pacman_1 =
|
|
19
|
+
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
20
|
+
const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
21
|
+
const pacman_1 = tslib_1.__importDefault(require("./pacman"));
|
|
24
22
|
const config_file = '/etc/penguins-eggs.d/eggs.yaml';
|
|
25
23
|
/**
|
|
26
24
|
* Setting
|
package/lib/classes/systemctl.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const utils_1 = require("../lib/utils");
|
|
13
|
-
const utils_2 =
|
|
13
|
+
const utils_2 = tslib_1.__importDefault(require("./utils"));
|
|
14
14
|
class SistemdCtl {
|
|
15
15
|
constructor(verbose = false) {
|
|
16
16
|
this.echo = {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ICostume } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export default class Tailor {
|
|
6
|
+
private verbose;
|
|
7
|
+
private echo;
|
|
8
|
+
private costume;
|
|
9
|
+
private wardrobe;
|
|
10
|
+
materials: ICostume;
|
|
11
|
+
constructor(wardrobe: string, costume: string, verbose?: boolean);
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
prepare(verbose?: boolean): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* hostname and hosts
|
|
18
|
+
*/
|
|
19
|
+
private hostname;
|
|
20
|
+
}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
|
+
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
6
|
+
const utils_2 = require("../lib/utils");
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
9
|
+
const pacman_1 = tslib_1.__importDefault(require("./pacman"));
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
class Tailor {
|
|
14
|
+
constructor(wardrobe, costume, verbose = false) {
|
|
15
|
+
this.verbose = false;
|
|
16
|
+
this.echo = {};
|
|
17
|
+
this.costume = '';
|
|
18
|
+
this.wardrobe = '';
|
|
19
|
+
this.materials = {};
|
|
20
|
+
this.costume = costume;
|
|
21
|
+
this.wardrobe = wardrobe;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
async prepare(verbose = false) {
|
|
27
|
+
this.verbose = verbose;
|
|
28
|
+
this.echo = utils_1.default.setEcho(verbose);
|
|
29
|
+
utils_1.default.warning(`preparing ${this.costume}`);
|
|
30
|
+
/**
|
|
31
|
+
* check curl presence
|
|
32
|
+
*/
|
|
33
|
+
if (!pacman_1.default.packageIsInstalled('curl')) {
|
|
34
|
+
utils_1.default.pressKeyToExit('In this tailoring shop we use curl. sudo apt update | apt install curl');
|
|
35
|
+
process.exit();
|
|
36
|
+
}
|
|
37
|
+
const tailorList = `${this.wardrobe}/${this.costume}/index.yml`;
|
|
38
|
+
if (fs_1.default.existsSync(tailorList)) {
|
|
39
|
+
this.materials = js_yaml_1.default.load(fs_1.default.readFileSync(tailorList, 'utf-8'));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.log('costume ' + chalk_1.default.cyan(this.costume) + ' not found in wardrobe: ' + chalk_1.default.green(this.wardrobe));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Repositories
|
|
46
|
+
*/
|
|
47
|
+
if (this.materials.sequence.repositories === undefined) {
|
|
48
|
+
console.log('repositiories, and repositories.update MUST be defined on sequence ');
|
|
49
|
+
process.exit();
|
|
50
|
+
}
|
|
51
|
+
utils_1.default.warning(`analyzing repositories`);
|
|
52
|
+
/**
|
|
53
|
+
* sources.list
|
|
54
|
+
*/
|
|
55
|
+
if (this.materials.sequence.repositories.sourcesList !== undefined) {
|
|
56
|
+
let step = '/etc/apt/sources.list';
|
|
57
|
+
utils_1.default.warning(step);
|
|
58
|
+
let components = '';
|
|
59
|
+
if (this.materials.sequence.repositories.sourcesList.main) {
|
|
60
|
+
components += ' main';
|
|
61
|
+
}
|
|
62
|
+
if (this.materials.sequence.repositories.sourcesList.contrib) {
|
|
63
|
+
components += ' contrib';
|
|
64
|
+
}
|
|
65
|
+
if (this.materials.sequence.repositories.sourcesList.nonFree) {
|
|
66
|
+
components += ' non-free';
|
|
67
|
+
}
|
|
68
|
+
console.log(`using: ${components}`);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* sources.list.d
|
|
72
|
+
*/
|
|
73
|
+
if (this.materials.sequence.repositories.sourcesListD !== undefined) {
|
|
74
|
+
if (this.materials.sequence.repositories.sourcesListD[0] !== null) {
|
|
75
|
+
let step = `adding repositories to /etc/apt/sources.list.d`;
|
|
76
|
+
utils_1.default.warning(step);
|
|
77
|
+
for (const cmd of this.materials.sequence.repositories.sourcesListD) {
|
|
78
|
+
try {
|
|
79
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* apt-get update
|
|
89
|
+
*/
|
|
90
|
+
if (this.materials.sequence.repositories.update === undefined) {
|
|
91
|
+
console.log('repositiories, and repositories.update MUDE be defined on sequence ');
|
|
92
|
+
process.exit();
|
|
93
|
+
}
|
|
94
|
+
let step = `updating repositories`;
|
|
95
|
+
utils_1.default.warning(step);
|
|
96
|
+
if (this.materials.sequence.repositories.update) {
|
|
97
|
+
await (0, utils_2.exec)('apt-get update', utils_1.default.setEcho(false));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* apt-get full-upgrade
|
|
101
|
+
*/
|
|
102
|
+
if (this.materials.sequence.repositories.fullUpgrade !== undefined) {
|
|
103
|
+
let step = `apt-get full-upgrade`;
|
|
104
|
+
utils_1.default.warning(step);
|
|
105
|
+
if (this.materials.sequence.repositories.fullUpgrade) {
|
|
106
|
+
await (0, utils_2.exec)('apt-get full-upgrade -y', utils_1.default.setEcho(false));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* checking dependencies
|
|
111
|
+
*/
|
|
112
|
+
if (this.materials.sequence.dependencies !== undefined) {
|
|
113
|
+
if (this.materials.sequence.dependencies[0] !== null) {
|
|
114
|
+
let cmd = 'apt-get install -y ';
|
|
115
|
+
let dependencies = '';
|
|
116
|
+
for (const dependence of this.materials.sequence.dependencies) {
|
|
117
|
+
cmd += ` ${dependence}`;
|
|
118
|
+
dependencies += `, ${dependence}`;
|
|
119
|
+
}
|
|
120
|
+
let step = `installing dependencies: ${dependencies.substring(2)}`;
|
|
121
|
+
utils_1.default.warning(step);
|
|
122
|
+
if (verbose) {
|
|
123
|
+
utils_1.default.titles();
|
|
124
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
125
|
+
}
|
|
126
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* apt-get install packages
|
|
131
|
+
*/
|
|
132
|
+
if (this.materials.sequence.packages !== undefined) {
|
|
133
|
+
if (this.materials.sequence.packages[0] !== null) {
|
|
134
|
+
let packages = '';
|
|
135
|
+
let cmd = 'apt-get install -y ';
|
|
136
|
+
for (const elem of this.materials.sequence.packages) {
|
|
137
|
+
cmd += ` ${elem}`;
|
|
138
|
+
packages += `, ${elem}`;
|
|
139
|
+
}
|
|
140
|
+
let step = `installing packages: ${packages.substring(2)}`;
|
|
141
|
+
utils_1.default.warning(step);
|
|
142
|
+
if (verbose) {
|
|
143
|
+
utils_1.default.titles();
|
|
144
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
145
|
+
}
|
|
146
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* apt-get install --no-install-recommends --no-install-suggests
|
|
151
|
+
*/
|
|
152
|
+
if (this.materials.sequence.noInstallRecommends !== undefined) {
|
|
153
|
+
if (this.materials.sequence.noInstallRecommends[0] !== null) {
|
|
154
|
+
let cmd = 'apt-get install --no-install-recommends --no-install-suggests -y ';
|
|
155
|
+
let noInstallRecommends = '';
|
|
156
|
+
for (const elem of this.materials.sequence.noInstallRecommends) {
|
|
157
|
+
cmd += ` ${elem}`;
|
|
158
|
+
noInstallRecommends += `, ${elem}`;
|
|
159
|
+
}
|
|
160
|
+
let step = `installing packages --no-install-recommends --no-install-suggests ${noInstallRecommends.substring(2)}`;
|
|
161
|
+
utils_1.default.warning(step);
|
|
162
|
+
if (verbose) {
|
|
163
|
+
utils_1.default.titles();
|
|
164
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
165
|
+
}
|
|
166
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* pip packages
|
|
171
|
+
*/
|
|
172
|
+
if (this.materials.sequence.packagesPip !== undefined) {
|
|
173
|
+
if (this.materials.sequence.packagesPip[0] !== null) {
|
|
174
|
+
let cmd = 'pip install ';
|
|
175
|
+
let pip = '';
|
|
176
|
+
for (const elem of this.materials.sequence.packagesPip) {
|
|
177
|
+
cmd += ` ${elem}`;
|
|
178
|
+
pip += `, ${elem}`;
|
|
179
|
+
}
|
|
180
|
+
let step = `installing python packages pip ${pip.substring(2)}`;
|
|
181
|
+
utils_1.default.warning(step);
|
|
182
|
+
if (verbose) {
|
|
183
|
+
utils_1.default.titles();
|
|
184
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
185
|
+
}
|
|
186
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* firmwares
|
|
191
|
+
*/
|
|
192
|
+
if (this.materials.sequence.firmwares !== undefined) {
|
|
193
|
+
/**
|
|
194
|
+
* codecs
|
|
195
|
+
*/
|
|
196
|
+
if (this.materials.sequence.firmwares.codecs !== undefined) {
|
|
197
|
+
if (this.materials.sequence.firmwares.codecs[0] !== null) {
|
|
198
|
+
let cmd = 'apt-get install -y ';
|
|
199
|
+
let codecs = '';
|
|
200
|
+
for (const elem of this.materials.sequence.firmwares.codecs) {
|
|
201
|
+
cmd += ` ${elem}`;
|
|
202
|
+
codecs += `, ${elem}`;
|
|
203
|
+
}
|
|
204
|
+
let step = `installing packages firmware codecs ${codecs.substring(2)}`;
|
|
205
|
+
utils_1.default.warning(step);
|
|
206
|
+
if (verbose) {
|
|
207
|
+
utils_1.default.titles();
|
|
208
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
209
|
+
}
|
|
210
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* drivers_graphics_tablet
|
|
215
|
+
*/
|
|
216
|
+
if (this.materials.sequence.firmwares.drivers_graphics_tablet !== undefined) {
|
|
217
|
+
if (this.materials.sequence.firmwares.drivers_graphics_tablet[0] !== null) {
|
|
218
|
+
let cmd = 'apt-get install -y ';
|
|
219
|
+
let drivers_graphics_tablet = '';
|
|
220
|
+
for (const elem of this.materials.sequence.firmwares.drivers_graphics_tablet) {
|
|
221
|
+
cmd += ` ${elem}`;
|
|
222
|
+
drivers_graphics_tablet += `, ${elem}`;
|
|
223
|
+
}
|
|
224
|
+
let step = `installing packages firmware drivers_graphics_tablet ${drivers_graphics_tablet.substring(2)}`;
|
|
225
|
+
utils_1.default.warning(step);
|
|
226
|
+
if (verbose) {
|
|
227
|
+
utils_1.default.titles();
|
|
228
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
229
|
+
}
|
|
230
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* drivers_network
|
|
235
|
+
*/
|
|
236
|
+
if (this.materials.sequence.firmwares.drivers_network !== undefined) {
|
|
237
|
+
if (this.materials.sequence.firmwares.drivers_network[0] !== null) {
|
|
238
|
+
let cmd = 'apt-get install -y ';
|
|
239
|
+
let drivers_network = '';
|
|
240
|
+
for (const elem of this.materials.sequence.firmwares.drivers_network) {
|
|
241
|
+
cmd += ` ${elem}`;
|
|
242
|
+
drivers_network += `, ${elem}`;
|
|
243
|
+
}
|
|
244
|
+
let step = `installing packages firmware drivers_network ${drivers_network.substring(2)}`;
|
|
245
|
+
utils_1.default.warning(step);
|
|
246
|
+
if (verbose) {
|
|
247
|
+
utils_1.default.titles();
|
|
248
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
249
|
+
}
|
|
250
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* drivers_various
|
|
254
|
+
*/
|
|
255
|
+
if (this.materials.sequence.firmwares.drivers_various !== undefined) {
|
|
256
|
+
if (this.materials.sequence.firmwares.drivers_various[0] !== null) {
|
|
257
|
+
let cmd = 'apt-get install -y ';
|
|
258
|
+
let drivers_various = '';
|
|
259
|
+
for (const elem of this.materials.sequence.firmwares.drivers_various) {
|
|
260
|
+
cmd += ` ${elem}`;
|
|
261
|
+
drivers_various += `, ${elem}`;
|
|
262
|
+
}
|
|
263
|
+
let step = `installing packages firmware drivers_network ${drivers_various.substring(2)}`;
|
|
264
|
+
utils_1.default.warning(step);
|
|
265
|
+
if (verbose) {
|
|
266
|
+
utils_1.default.titles();
|
|
267
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
268
|
+
}
|
|
269
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* drivers_video_amd
|
|
275
|
+
*/
|
|
276
|
+
if (this.materials.sequence.firmwares.drivers_video_amd !== undefined) {
|
|
277
|
+
if (this.materials.sequence.firmwares.drivers_video_amd[0] !== null) {
|
|
278
|
+
let cmd = 'apt-get install -y ';
|
|
279
|
+
let drivers_video_amd = '';
|
|
280
|
+
for (const elem of this.materials.sequence.firmwares.drivers_video_amd) {
|
|
281
|
+
cmd += ` ${elem}`;
|
|
282
|
+
drivers_video_amd += `, ${elem}`;
|
|
283
|
+
}
|
|
284
|
+
let step = `installing packages firmware drivers_network ${drivers_video_amd.substring(2)}`;
|
|
285
|
+
utils_1.default.warning(step);
|
|
286
|
+
if (verbose) {
|
|
287
|
+
utils_1.default.titles();
|
|
288
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
289
|
+
}
|
|
290
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* drivers_video_nvidia
|
|
295
|
+
*/
|
|
296
|
+
if (this.materials.sequence.firmwares.drivers_video_nvidia !== undefined) {
|
|
297
|
+
if (this.materials.sequence.firmwares.drivers_video_nvidia[0] !== null) {
|
|
298
|
+
let cmd = 'apt-get install -y ';
|
|
299
|
+
let drivers_video_nvidia = '';
|
|
300
|
+
for (const elem of this.materials.sequence.firmwares.drivers_video_nvidia) {
|
|
301
|
+
cmd += ` ${elem}`;
|
|
302
|
+
drivers_video_nvidia += `, ${elem}`;
|
|
303
|
+
}
|
|
304
|
+
let step = `installing packages firmware drivers_network ${drivers_video_nvidia.substring(2)}`;
|
|
305
|
+
utils_1.default.warning(step);
|
|
306
|
+
if (verbose) {
|
|
307
|
+
utils_1.default.titles();
|
|
308
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
309
|
+
}
|
|
310
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* drivers_wifi
|
|
315
|
+
*/
|
|
316
|
+
if (this.materials.sequence.firmwares.drivers_wifi !== undefined) {
|
|
317
|
+
if (this.materials.sequence.firmwares.drivers_wifi[0] !== null) {
|
|
318
|
+
let cmd = 'apt-get install -y ';
|
|
319
|
+
let drivers_wifi = '';
|
|
320
|
+
for (const elem of this.materials.sequence.firmwares.drivers_wifi) {
|
|
321
|
+
cmd += ` ${elem}`;
|
|
322
|
+
drivers_wifi += `, ${elem}`;
|
|
323
|
+
}
|
|
324
|
+
let step = `installing packages firmware drivers_network ${drivers_wifi.substring(2)}`;
|
|
325
|
+
utils_1.default.warning(step);
|
|
326
|
+
if (verbose) {
|
|
327
|
+
utils_1.default.titles();
|
|
328
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
329
|
+
}
|
|
330
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* drivers_printer
|
|
335
|
+
*/
|
|
336
|
+
if (this.materials.sequence.firmwares.drivers_printer !== undefined) {
|
|
337
|
+
if (this.materials.sequence.firmwares.drivers_printer[0] !== null) {
|
|
338
|
+
let cmd = 'apt-get install -y ';
|
|
339
|
+
let drivers_printer = '';
|
|
340
|
+
for (const elem of this.materials.sequence.firmwares.drivers_printer) {
|
|
341
|
+
cmd += ` ${elem}`;
|
|
342
|
+
drivers_printer += `, ${elem}`;
|
|
343
|
+
}
|
|
344
|
+
let step = `installing packages firmware drivers_network ${drivers_printer.substring(2)}`;
|
|
345
|
+
utils_1.default.warning(step);
|
|
346
|
+
if (verbose) {
|
|
347
|
+
utils_1.default.titles();
|
|
348
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
349
|
+
}
|
|
350
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* dpkg -i *.deb
|
|
356
|
+
*/
|
|
357
|
+
if (this.materials.sequence.debs !== undefined) {
|
|
358
|
+
if (this.materials.sequence.debs) {
|
|
359
|
+
let step = `installing local packages`;
|
|
360
|
+
utils_1.default.warning(step);
|
|
361
|
+
let cmd = `dpkg -i ${this.wardrobe}\*.deb`;
|
|
362
|
+
if (verbose) {
|
|
363
|
+
utils_1.default.titles();
|
|
364
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
365
|
+
}
|
|
366
|
+
await (0, utils_2.exec)(cmd);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* dirs
|
|
371
|
+
*/
|
|
372
|
+
if (this.materials.sequence.dirs !== undefined) {
|
|
373
|
+
if (this.materials.sequence.dirs) {
|
|
374
|
+
if (fs_1.default.existsSync(`${this.wardrobe}/${this.costume}/dirs`)) {
|
|
375
|
+
let step = `copying dirs`;
|
|
376
|
+
let cmd = `rsync -avx ${this.wardrobe}/${this.costume}/dirs/* /`;
|
|
377
|
+
if (verbose) {
|
|
378
|
+
utils_1.default.titles();
|
|
379
|
+
utils_1.default.pressKeyToExit(cmd, true);
|
|
380
|
+
}
|
|
381
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
382
|
+
/**
|
|
383
|
+
* Copyng skel in /home/user
|
|
384
|
+
*/
|
|
385
|
+
const user = utils_1.default.getPrimaryUser();
|
|
386
|
+
cmd = `rsync -avx ${this.wardrobe}/${this.costume}/dirs/etc/skel/.* /home/${user}/`;
|
|
387
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
388
|
+
await (0, utils_2.exec)(`chown ${user}:${user} /home/${user}/ -R`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* hostname and hosts
|
|
394
|
+
*/
|
|
395
|
+
if (this.materials.sequence.hostname !== undefined) {
|
|
396
|
+
if (this.materials.sequence.hostname) {
|
|
397
|
+
utils_1.default.warning(`changing hostname = ${this.materials.name}`);
|
|
398
|
+
await this.hostname();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* customizations
|
|
403
|
+
*/
|
|
404
|
+
if (this.materials.sequence.customizations !== undefined) {
|
|
405
|
+
/**
|
|
406
|
+
* customizations/scripts
|
|
407
|
+
*/
|
|
408
|
+
if (this.materials.sequence.customizations.scripts !== undefined) {
|
|
409
|
+
if (this.materials.sequence.customizations.scripts[0] !== null) {
|
|
410
|
+
let step = `customizations scripts`;
|
|
411
|
+
utils_1.default.warning(step);
|
|
412
|
+
for (const script of this.materials.sequence.customizations.scripts) {
|
|
413
|
+
await (0, utils_2.exec)(`${this.wardrobe}/${this.costume}/${script}`, utils_1.default.setEcho(true));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* reboot
|
|
420
|
+
* mandatory
|
|
421
|
+
*/
|
|
422
|
+
if (this.materials.sequence.reboot === undefined) {
|
|
423
|
+
this.materials.sequence.reboot = true;
|
|
424
|
+
}
|
|
425
|
+
if (this.materials.sequence.reboot) {
|
|
426
|
+
utils_1.default.warning(`Reboot`);
|
|
427
|
+
await utils_1.default.pressKeyToExit('system need to reboot', true);
|
|
428
|
+
await (0, utils_2.exec)('reboot');
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* hostname and hosts
|
|
433
|
+
*/
|
|
434
|
+
async hostname() {
|
|
435
|
+
/**
|
|
436
|
+
* hostname
|
|
437
|
+
*/
|
|
438
|
+
let file = '/etc/hostname';
|
|
439
|
+
let text = this.materials.name;
|
|
440
|
+
await (0, utils_2.exec)(`rm ${file} `, this.echo);
|
|
441
|
+
fs_1.default.writeFileSync(file, text);
|
|
442
|
+
/**
|
|
443
|
+
* hosts
|
|
444
|
+
*/
|
|
445
|
+
file = '/etc/hosts';
|
|
446
|
+
text = '';
|
|
447
|
+
text += '127.0.0.1 localhost localhost.localdomain\n';
|
|
448
|
+
text += `127.0.1.1 ${this.materials.name} \n`;
|
|
449
|
+
text += `# The following lines are desirable for IPv6 capable hosts\n`;
|
|
450
|
+
text += `:: 1 ip6 - localhost ip6 - loopback\n`;
|
|
451
|
+
text += `fe00:: 0 ip6 - localnet\n`;
|
|
452
|
+
text += `ff00:: 0 ip6 - mcastprefix\n`;
|
|
453
|
+
text += `ff02:: 1 ip6 - allnodes\n`;
|
|
454
|
+
text += `ff02:: 2 ip6 - allrouters\n`;
|
|
455
|
+
text += `ff02:: 3 ip6 - allhosts\n`;
|
|
456
|
+
await (0, utils_2.exec)(`rm ${file} `, this.echo);
|
|
457
|
+
fs_1.default.writeFileSync(file, text);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
exports.default = Tailor;
|