penguins-eggs 9.0.25 → 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 +448 -22
- package/addons/telos/theme/applications/install-debian.desktop +28 -0
- package/addons/telos/theme/artwork/install-debian.png +0 -0
- package/addons/telos/theme/calamares/branding/banner.png +0 -0
- package/addons/telos/theme/calamares/branding/branding.desc +25 -0
- package/addons/telos/theme/calamares/branding/show.qml +51 -0
- package/addons/telos/theme/calamares/branding/slide1.png +0 -0
- package/addons/telos/theme/calamares/branding/telos-logo.png +0 -0
- package/addons/telos/theme/calamares/branding/welcome.png +0 -0
- package/addons/telos/theme/calamares/modules/partition.yml +233 -0
- package/addons/telos/theme/livecd/grub.theme.cfg +43 -0
- package/addons/telos/theme/livecd/isolinux.theme.cfg +45 -0
- package/addons/telos/theme/livecd/splash.png +0 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +57 -38
- 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 +13 -13
- package/lib/classes/distro.d.ts +4 -2
- package/lib/classes/distro.js +77 -79
- package/lib/classes/family/archlinux.js +4 -4
- package/lib/classes/family/debian.js +6 -6
- 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 +2 -2
- package/lib/classes/incubation/fisherman.js +5 -5
- package/lib/classes/incubation/incubator.js +5 -5
- package/lib/classes/incubation/installer.d.ts +1 -1
- package/lib/classes/incubation/installer.js +4 -4
- 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 +12 -1
- package/lib/classes/krill_install.js +300 -312
- package/lib/classes/krill_prepare.d.ts +4 -0
- package/lib/classes/krill_prepare.js +81 -83
- 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.d.ts +27 -27
- package/lib/classes/ovary.js +356 -387
- package/lib/classes/pacman.d.ts +1 -1
- package/lib/classes/pacman.js +40 -40
- package/lib/classes/pve-live.js +12 -16
- package/lib/classes/settings.d.ts +6 -0
- package/lib/classes/settings.js +11 -13
- package/lib/classes/systemctl.d.ts +36 -7
- package/lib/classes/systemctl.js +63 -28
- 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.d.ts +14 -3
- package/lib/classes/utils.js +75 -28
- package/lib/classes/xdg.js +23 -39
- package/lib/classes/yolk.d.ts +12 -10
- package/lib/classes/yolk.js +54 -56
- 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 +11 -11
- package/lib/commands/remove.js +2 -2
- package/lib/commands/syncfrom.d.ts +9 -3
- package/lib/commands/syncfrom.js +39 -32
- package/lib/commands/syncto.d.ts +26 -6
- package/lib/commands/syncto.js +73 -50
- 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 +37 -18
- 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-distro.d.ts +4 -2
- package/lib/interfaces/i-installer.d.ts +1 -1
- 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 +2 -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 +6 -5
- package/scripts/_eggs +43 -2
- package/scripts/bros/waydroid-helper.sh +1 -1
- package/scripts/eggs.bash +6 -2
- package/scripts/{not-used/install-eggs-ppa.sh → install-eggs-ppa.sh} +1 -0
- package/scripts/mom-cli.sh +1 -1
- package/scripts/pve-live.sh +2 -6
- package/scripts/resy.sh +8 -0
- package/scripts/userexist.sh +6 -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/scripts/not-used/eggs-cleanup.sh +0 -7
- package/scripts/not-used/mkinitramfs +0 -469
- package/scripts/update-initramfs +0 -94
|
@@ -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;
|
package/lib/classes/tools.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
|
-
const node_fs_1 =
|
|
11
|
-
const js_yaml_1 =
|
|
12
|
-
const settings_1 =
|
|
13
|
-
const utils_1 =
|
|
10
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
11
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
12
|
+
const settings_1 = tslib_1.__importDefault(require("./settings"));
|
|
13
|
+
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
14
14
|
/**
|
|
15
15
|
* Utils: general porpourse utils
|
|
16
16
|
* @remarks all the utilities
|
package/lib/classes/users.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
5
|
const utils_1 = require("../lib/utils");
|
|
6
6
|
/**
|
|
7
7
|
*
|
package/lib/classes/utils.d.ts
CHANGED
|
@@ -12,19 +12,26 @@ export default class Utils {
|
|
|
12
12
|
/**
|
|
13
13
|
* Restituisce il prefisso della iso
|
|
14
14
|
* @param distroId
|
|
15
|
-
* @param
|
|
15
|
+
* @param codenameId
|
|
16
16
|
*/
|
|
17
|
-
static snapshotPrefix(distroId: string,
|
|
17
|
+
static snapshotPrefix(distroId: string, codenameId: string): string;
|
|
18
18
|
/**
|
|
19
19
|
* Controlla se il sistema è avviato con systemd
|
|
20
20
|
* funziona anche in MX che utilizza systemd
|
|
21
21
|
* ma viene avviato con init
|
|
22
22
|
*/
|
|
23
23
|
static isSystemd(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
24
28
|
static isSysvinit(): boolean;
|
|
25
29
|
/**
|
|
26
30
|
* ricava path per vmlinuz
|
|
27
|
-
*
|
|
31
|
+
* Normalmente cerca BOOT_IMAGE
|
|
32
|
+
* BOOT_IMAGE=/boot/vmlinuz-5.16.0-3-amd64 root=UUID=13768873-d6ba-4ae5-9e14-b5011f5aa31c ro quiet splash resume=UUID=beafb9b4-c429-4e1f-a268-4270b63a14e6
|
|
33
|
+
* se non è presente, come nel caso di Franco, cerca initrd e ricostruisce vmlinuz
|
|
34
|
+
* ro root=UUID=3dc0f202-8ac8-4686-9316-dddcec060c48 initrd=boot\initrd.img-5.15.0-0.bpo.3-amd64 // Conidi
|
|
28
35
|
*/
|
|
29
36
|
static vmlinuz(): string;
|
|
30
37
|
/**
|
|
@@ -258,6 +265,10 @@ export default class Utils {
|
|
|
258
265
|
* @param msg
|
|
259
266
|
*/
|
|
260
267
|
static customConfirmAbort(msg?: string): Promise<any>;
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
static pressKeyToExit(warming?: string, canContinue?: boolean): Promise<void>;
|
|
261
272
|
/**
|
|
262
273
|
* titles
|
|
263
274
|
* Penguin's are gettings alive!
|
package/lib/classes/utils.js
CHANGED
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
|
-
const shelljs_1 =
|
|
12
|
-
const fs_1 =
|
|
13
|
-
const dns_1 =
|
|
14
|
-
const path_1 =
|
|
15
|
-
const os_1 =
|
|
16
|
-
const pjson_1 =
|
|
17
|
-
const inquirer_1 =
|
|
18
|
-
const chalk_1 =
|
|
19
|
-
const pacman_1 =
|
|
11
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
12
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
13
|
+
const dns_1 = tslib_1.__importDefault(require("dns"));
|
|
14
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
15
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
16
|
+
const pjson_1 = tslib_1.__importDefault(require("pjson"));
|
|
17
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
18
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
19
|
+
const pacman_1 = tslib_1.__importDefault(require("./pacman"));
|
|
20
|
+
const child_process_1 = require("child_process");
|
|
20
21
|
/**
|
|
21
22
|
* Utils: general porpourse utils
|
|
22
23
|
* @remarks all the utilities
|
|
@@ -25,10 +26,10 @@ class Utils {
|
|
|
25
26
|
/**
|
|
26
27
|
* Restituisce il prefisso della iso
|
|
27
28
|
* @param distroId
|
|
28
|
-
* @param
|
|
29
|
+
* @param codenameId
|
|
29
30
|
*/
|
|
30
|
-
static snapshotPrefix(distroId,
|
|
31
|
-
let result = 'egg-of-' + distroId.toLowerCase() + '-' +
|
|
31
|
+
static snapshotPrefix(distroId, codenameId) {
|
|
32
|
+
let result = 'egg-of-' + distroId.toLowerCase() + '-' + codenameId.toLowerCase() + '-';
|
|
32
33
|
result = result.replace(`/`, '-');
|
|
33
34
|
return result;
|
|
34
35
|
}
|
|
@@ -38,31 +39,62 @@ class Utils {
|
|
|
38
39
|
* ma viene avviato con init
|
|
39
40
|
*/
|
|
40
41
|
static isSystemd() {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const checkFile = '/tmp/checksystemd';
|
|
43
|
+
shelljs_1.default.exec(`ps -p 1 -o comm= >${checkFile}`);
|
|
44
|
+
const isSystemd = fs_1.default.readFileSync(checkFile).includes('systemd');
|
|
45
|
+
shelljs_1.default.exec(`rm ${checkFile}`);
|
|
46
|
+
return isSystemd;
|
|
43
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
44
52
|
static isSysvinit() {
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
const checkFile = '/tmp/checkinit';
|
|
54
|
+
shelljs_1.default.exec(`ps -p 1 -o comm= >${checkFile}`);
|
|
55
|
+
const isSysvinit = fs_1.default.readFileSync(checkFile).includes('init');
|
|
56
|
+
shelljs_1.default.exec(`rm ${checkFile}`);
|
|
57
|
+
return isSysvinit;
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
60
|
* ricava path per vmlinuz
|
|
50
|
-
*
|
|
61
|
+
* Normalmente cerca BOOT_IMAGE
|
|
62
|
+
* BOOT_IMAGE=/boot/vmlinuz-5.16.0-3-amd64 root=UUID=13768873-d6ba-4ae5-9e14-b5011f5aa31c ro quiet splash resume=UUID=beafb9b4-c429-4e1f-a268-4270b63a14e6
|
|
63
|
+
* se non è presente, come nel caso di Franco, cerca initrd e ricostruisce vmlinuz
|
|
64
|
+
* ro root=UUID=3dc0f202-8ac8-4686-9316-dddcec060c48 initrd=boot\initrd.img-5.15.0-0.bpo.3-amd64 // Conidi
|
|
51
65
|
*/
|
|
52
66
|
static vmlinuz() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
if (!fs_1.default.existsSync(result)) {
|
|
61
|
-
if (fs_1.default.existsSync('/boot' + result)) {
|
|
62
|
-
result = '/boot' + result;
|
|
67
|
+
let vmlinuz = '';
|
|
68
|
+
// find vmlinuz in /proc/cmdline
|
|
69
|
+
const cmdline = fs_1.default.readFileSync('/proc/cmdline', 'utf8').split(" ");
|
|
70
|
+
cmdline.forEach(cmd => {
|
|
71
|
+
if (cmd.includes('BOOT_IMAGE')) {
|
|
72
|
+
vmlinuz = cmd.substring(cmd.indexOf('=') + 1);
|
|
63
73
|
}
|
|
74
|
+
});
|
|
75
|
+
// If vmlinuz not found in /proc/cmdline, try to find version in initrd.img
|
|
76
|
+
if (vmlinuz === '') {
|
|
77
|
+
cmdline.forEach(cmd => {
|
|
78
|
+
if (cmd.includes('initrd.img')) {
|
|
79
|
+
vmlinuz = '/boot/vmlinuz' + cmd.substring(cmd.indexOf('initrd.img') + 10);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
64
82
|
}
|
|
65
|
-
|
|
83
|
+
// if vmlinuz exist in /boot
|
|
84
|
+
if (!fs_1.default.existsSync(vmlinuz)) {
|
|
85
|
+
if (fs_1.default.existsSync('/boot' + vmlinuz)) {
|
|
86
|
+
vmlinuz = '/boot' + vmlinuz;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// if vmlinux don't exist
|
|
90
|
+
if (!fs_1.default.existsSync(vmlinuz)) {
|
|
91
|
+
vmlinuz = '/path/to/vmlinuz';
|
|
92
|
+
}
|
|
93
|
+
// btrfs
|
|
94
|
+
if (vmlinuz.indexOf('@') > 0) {
|
|
95
|
+
vmlinuz = vmlinuz.substring(vmlinuz.indexOf(' ') + 1);
|
|
96
|
+
}
|
|
97
|
+
return vmlinuz;
|
|
66
98
|
}
|
|
67
99
|
/**
|
|
68
100
|
* ricava path per initrdImg
|
|
@@ -685,6 +717,21 @@ class Utils {
|
|
|
685
717
|
});
|
|
686
718
|
});
|
|
687
719
|
}
|
|
720
|
+
/**
|
|
721
|
+
*
|
|
722
|
+
*/
|
|
723
|
+
static async pressKeyToExit(warming = 'Process will end', canContinue = true) {
|
|
724
|
+
Utils.warning(warming);
|
|
725
|
+
let msg = 'Press a key to exit...';
|
|
726
|
+
if (canContinue) {
|
|
727
|
+
msg = 'Press a key to continue...';
|
|
728
|
+
}
|
|
729
|
+
console.log(msg);
|
|
730
|
+
const pressKeyToExit = (0, child_process_1.spawnSync)('read _ ', { shell: true, stdio: [0, 1, 2] });
|
|
731
|
+
if (!canContinue) {
|
|
732
|
+
process.exit(0);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
688
735
|
/**
|
|
689
736
|
* titles
|
|
690
737
|
* Penguin's are gettings alive!
|