penguins-eggs 9.3.24 → 9.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oclif.manifest.json +1 -1
- package/README.md +65 -62
- package/addons/templates/isolinux.template +1 -1
- package/conf/distros/buster/calamares/calamares-modules/bootloader-config/bootloader-config.sh +2 -2
- package/conf/distros/jessie/krill/krill-modules/bootloader-config/bootloader-config.sh +2 -2
- package/dist/classes/incubation/fisherman.js +3 -6
- package/dist/classes/ovary.js +78 -58
- package/dist/classes/pxe.js +1 -1
- package/dist/classes/tools.js +1 -2
- package/dist/classes/utils.js +1 -1
- package/dist/commands/calamares.js +3 -1
- package/dist/commands/config.js +7 -6
- package/dist/commands/export/iso.js +0 -5
- package/dist/commands/install.js +4 -4
- package/dist/commands/kill.js +4 -2
- package/dist/commands/produce.js +17 -19
- package/dist/commands/syncfrom.js +8 -8
- package/dist/commands/syncto.js +2 -2
- package/dist/commands/tools/clean.js +3 -1
- package/dist/commands/tools/ppa.js +4 -2
- package/dist/components/elements/title.js +1 -1
- package/dist/krill/krill-prepare.js +6 -6
- package/dist/krill/krill-sequence.js +126 -114
- package/dist/krill/modules/remove-installer-link.js +2 -2
- package/eui/README.md +72 -0
- package/eui/eui-create-image.sh +12 -0
- package/eui/eui-start.sh +32 -0
- package/eui/eui-users +2 -0
- package/eui/eui.desktop +10 -0
- package/package.json +2 -1
- package/scripts/_eggs +55 -52
- package/scripts/eggs.bash +18 -18
- package/scripts/mom.sh +6 -7
package/dist/classes/ovary.js
CHANGED
|
@@ -50,11 +50,12 @@ class Ovary {
|
|
|
50
50
|
this.compression = '';
|
|
51
51
|
this.theme = '';
|
|
52
52
|
this.clone = false;
|
|
53
|
+
this.cryptedclone = false;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* @returns {boolean} success
|
|
56
57
|
*/
|
|
57
|
-
async fertilization(snapshot_prefix = '', snapshot_basename = '', theme = '', compression = '',
|
|
58
|
+
async fertilization(snapshot_prefix = '', snapshot_basename = '', theme = '', compression = '', nointeratctive = false) {
|
|
58
59
|
this.settings = new settings_1.default();
|
|
59
60
|
if (await this.settings.load()) {
|
|
60
61
|
this.familyId = this.settings.distro.familyId;
|
|
@@ -70,7 +71,7 @@ class Ovary {
|
|
|
70
71
|
if (compression !== '') {
|
|
71
72
|
this.settings.config.compression = compression;
|
|
72
73
|
}
|
|
73
|
-
if (!
|
|
74
|
+
if (!nointeratctive) {
|
|
74
75
|
return true;
|
|
75
76
|
}
|
|
76
77
|
this.settings.listFreeSpace();
|
|
@@ -84,15 +85,18 @@ class Ovary {
|
|
|
84
85
|
*
|
|
85
86
|
* @param basename
|
|
86
87
|
*/
|
|
87
|
-
async produce(
|
|
88
|
+
async produce(clone = false, cryptedclone = false, scriptOnly = false, yolkRenew = false, release = false, myAddons, nointeractive = false, verbose = false) {
|
|
88
89
|
this.verbose = verbose;
|
|
89
|
-
this.clone = clone;
|
|
90
90
|
this.echo = utils_2.default.setEcho(verbose);
|
|
91
91
|
if (this.verbose) {
|
|
92
92
|
this.toNull = ' > /dev/null 2>&1';
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
this.clone = clone;
|
|
95
|
+
this.cryptedclone = cryptedclone;
|
|
96
|
+
let luksName = 'luks-eggs-data';
|
|
95
97
|
let luksFile = `/tmp/${luksName}`;
|
|
98
|
+
// let luksDevice = `/dev/mapper/${this.luksName}`
|
|
99
|
+
// let luksMountpoint = `/mnt`
|
|
96
100
|
if (this.familyId === 'debian') {
|
|
97
101
|
const yolk = new yolk_1.default();
|
|
98
102
|
if (!yolk.yolkExists()) {
|
|
@@ -117,15 +121,18 @@ class Ovary {
|
|
|
117
121
|
}
|
|
118
122
|
else {
|
|
119
123
|
await this.liveCreateStructure();
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
if (!nointeractive) {
|
|
125
|
+
if (this.settings.distro.isCalamaresAvailable && (pacman_1.default.isInstalledGui()) &&
|
|
126
|
+
this.settings.config.force_installer && !(await pacman_1.default.calamaresCheck())) {
|
|
127
|
+
console.log('Installing ' + chalk_1.default.bgGray('calamares') + ' due force_installer=yes.');
|
|
128
|
+
await pacman_1.default.calamaresInstall(verbose);
|
|
129
|
+
const bleach = new bleach_1.default();
|
|
130
|
+
await bleach.clean(verbose);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// CRYPTEDCLONE
|
|
134
|
+
if (cryptedclone) {
|
|
135
|
+
console.log(`Users and the user data will be saved in an encrypted LUKS volume`);
|
|
129
136
|
const users = await this.usersFill();
|
|
130
137
|
for (let i = 0; i < users.length; i++) {
|
|
131
138
|
if (users[i].saveIt) {
|
|
@@ -142,11 +149,11 @@ class Ovary {
|
|
|
142
149
|
// CLONE
|
|
143
150
|
}
|
|
144
151
|
else if (this.clone) {
|
|
145
|
-
utils_2.default.warning('eggs will SAVE
|
|
152
|
+
utils_2.default.warning('eggs will SAVE users and users\' data UNCRYPTED on the live');
|
|
146
153
|
// NORMAL
|
|
147
154
|
}
|
|
148
155
|
else {
|
|
149
|
-
utils_2.default.warning('eggs will REMOVE users
|
|
156
|
+
utils_2.default.warning('eggs will REMOVE users and users\' from live');
|
|
150
157
|
}
|
|
151
158
|
/**
|
|
152
159
|
* NOTE: reCreate = false
|
|
@@ -155,10 +162,7 @@ class Ovary {
|
|
|
155
162
|
* put reCreate = true in release
|
|
156
163
|
*/
|
|
157
164
|
let reCreate = true;
|
|
158
|
-
if (reCreate) { // start pre-
|
|
159
|
-
if (this.clone) {
|
|
160
|
-
await (0, utils_1.exec)(`touch ${this.settings.config.snapshot_dir}ovarium/iso/live/is-clone.md`, this.echo);
|
|
161
|
-
}
|
|
165
|
+
if (reCreate) { // start pre-clone
|
|
162
166
|
/**
|
|
163
167
|
* Anche non accettando l'installazione di calamares
|
|
164
168
|
* viene creata la configurazione dell'installer: krill/calamares
|
|
@@ -183,16 +187,12 @@ class Ovary {
|
|
|
183
187
|
await this.makeEfi(this.theme);
|
|
184
188
|
}
|
|
185
189
|
await this.bindLiveFs();
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
await (0, utils_1.exec)(`touch ${this.settings.config.snapshot_dir}ovarium/iso/live/is-clone.md`, this.echo);
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
190
|
+
if (!this.clone) {
|
|
191
|
+
/**
|
|
192
|
+
* ANCHE per cryptedclone
|
|
193
|
+
*/
|
|
193
194
|
await this.cleanUsersAccounts();
|
|
194
195
|
await this.createUserLive();
|
|
195
|
-
// create XdgAutostart
|
|
196
196
|
if (pacman_1.default.isInstalledGui()) {
|
|
197
197
|
await this.createXdgAutostart(this.settings.config.theme, myAddons);
|
|
198
198
|
/**
|
|
@@ -209,18 +209,18 @@ class Ovary {
|
|
|
209
209
|
// Here we are forcing alwats cliAutologin
|
|
210
210
|
cliAutologin.addAutologin(this.settings.distro.distroId, this.settings.distro.codenameId, this.settings.config.user_opt, this.settings.config.user_opt_passwd, this.settings.config.root_passwd, this.settings.work_dir.merged);
|
|
211
211
|
}
|
|
212
|
-
await this.editLiveFs();
|
|
212
|
+
await this.editLiveFs(clone, cryptedclone);
|
|
213
213
|
await this.makeSquashfs(scriptOnly);
|
|
214
214
|
await this.uBindLiveFs(); // Lo smonto prima della fase di backup
|
|
215
215
|
}
|
|
216
|
-
if (
|
|
216
|
+
if (cryptedclone) {
|
|
217
217
|
await (0, utils_1.exec)('eggs syncto', utils_2.default.setEcho(true));
|
|
218
218
|
utils_2.default.warning(`Waiting 10s, before to move ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
219
219
|
await (0, utils_1.exec)('sleep 10', utils_2.default.setEcho(false));
|
|
220
220
|
utils_2.default.warning(`moving ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
221
221
|
await (0, utils_1.exec)(`mv ${luksFile} ${this.settings.config.snapshot_dir}ovarium/iso/live`, this.echo);
|
|
222
222
|
}
|
|
223
|
-
const xorrisoCommand = this.makeDotDisk(
|
|
223
|
+
const xorrisoCommand = this.makeDotDisk(clone, cryptedclone);
|
|
224
224
|
/**
|
|
225
225
|
* patch to emulate miso/archiso on archilinux
|
|
226
226
|
*/
|
|
@@ -311,10 +311,27 @@ class Ovary {
|
|
|
311
311
|
* - Add some basic files to /dev
|
|
312
312
|
* - Clear configs from /etc/network/interfaces, wicd and NetworkManager and netman
|
|
313
313
|
*/
|
|
314
|
-
async editLiveFs() {
|
|
314
|
+
async editLiveFs(clone = false, cryptedclone = false) {
|
|
315
315
|
if (this.verbose) {
|
|
316
316
|
console.log('ovary: editLiveFs');
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* new is_clone written just on live
|
|
320
|
+
*/
|
|
321
|
+
if (clone) {
|
|
322
|
+
await (0, utils_1.exec)(`touch ${this.settings.work_dir.merged}/etc/penguins-eggs.d/is_clone`, this.echo);
|
|
323
|
+
}
|
|
324
|
+
if (cryptedclone) {
|
|
325
|
+
await (0, utils_1.exec)(`touch ${this.settings.work_dir.merged}/etc/penguins-eggs.d/is_crypted_clone`, this.echo);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* add epoptes server just on live
|
|
329
|
+
*/
|
|
330
|
+
if (pacman_1.default.packageIsInstalled('epoptes')) {
|
|
331
|
+
const file = `${this.settings.work_dir.merged}/etc/default/epoptes-client`;
|
|
332
|
+
const text = `SERVER=${node_os_1.default.hostname}.local\n`;
|
|
333
|
+
fs_1.default.writeFileSync(file, text);
|
|
334
|
+
}
|
|
318
335
|
if (this.familyId === 'debian') {
|
|
319
336
|
// Aggiungo UMASK=0077 in /etc/initramfs-tools/conf.d/calamares-safe-initramfs.conf
|
|
320
337
|
const text = 'UMASK=0077\n';
|
|
@@ -1070,20 +1087,16 @@ class Ovary {
|
|
|
1070
1087
|
* configuro add-penguins-desktop-icons in /etc/xdg/autostart
|
|
1071
1088
|
*/
|
|
1072
1089
|
const dirAutostart = `${this.settings.work_dir.merged}/etc/xdg/autostart`;
|
|
1073
|
-
const dirRun = '/usr/bin';
|
|
1074
1090
|
if (fs_1.default.existsSync(dirAutostart)) {
|
|
1075
1091
|
// Creo l'avviatore xdg DEVE essere add-penguins-links.desktop
|
|
1076
1092
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-links-add.desktop'), dirAutostart);
|
|
1077
|
-
//
|
|
1078
|
-
const script =
|
|
1093
|
+
// create /usr/bin/penguins-links-add.sh
|
|
1094
|
+
const script = `/usr/bin/penguins-links-add.sh`;
|
|
1079
1095
|
let text = '';
|
|
1080
1096
|
text += '#!/bin/sh\n';
|
|
1081
1097
|
text += 'DESKTOP=$(xdg-user-dir DESKTOP)\n';
|
|
1082
|
-
text += '
|
|
1083
|
-
text +=
|
|
1084
|
-
// Anche se in lxde rimane il problema della conferma dell'avvio
|
|
1085
|
-
// per l'installer, lo tolgo altrimenti su LXDE riappare comunque
|
|
1086
|
-
text += `cp /usr/share/applications/${installerUrl} $DESKTOP\n`;
|
|
1098
|
+
text += 'test -d "$DESKTOP" && mkdir -p "$DESKTOP"\n';
|
|
1099
|
+
text += `cp /usr/share/applications/${installerUrl} "$DESKTOP"\n`;
|
|
1087
1100
|
if (pacman_1.default.packageIsInstalled('lxde-core')) {
|
|
1088
1101
|
text += this.lxdeLink('penguins-eggs.desktop', "penguin's eggs", 'eggs');
|
|
1089
1102
|
if (myAddons.adapt)
|
|
@@ -1094,29 +1107,29 @@ class Ovary {
|
|
|
1094
1107
|
text += this.lxdeLink('eggs-rsupport.desktop', 'Remote assistance', 'remote-assistance');
|
|
1095
1108
|
}
|
|
1096
1109
|
else {
|
|
1097
|
-
text +=
|
|
1110
|
+
text += `cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n`;
|
|
1098
1111
|
if (myAddons.adapt)
|
|
1099
|
-
text +=
|
|
1112
|
+
text += `cp /usr/share/applications/eggs-adapt.desktop "$DESKTOP"\n`;
|
|
1100
1113
|
if (myAddons.pve)
|
|
1101
|
-
text +=
|
|
1114
|
+
text += `cp /usr/share/applications/eggs-pve.desktop "$DESKTOP"\n`;
|
|
1102
1115
|
if (myAddons.rsupport)
|
|
1103
|
-
text +=
|
|
1116
|
+
text += `cp /usr/share/applications/eggs-rsupport.desktop "$DESKTOP"\n`;
|
|
1104
1117
|
}
|
|
1105
1118
|
/**
|
|
1106
1119
|
* enable desktop links
|
|
1107
1120
|
*/
|
|
1108
1121
|
if (pacman_1.default.packageIsInstalled('gdm3') || pacman_1.default.packageIsInstalled('gdm')) {
|
|
1109
1122
|
// GNOME
|
|
1110
|
-
text += `test -f /usr/share/applications/penguins-eggs.desktop && cp /usr/share/applications/penguins-eggs.desktop $DESKTOP\n`;
|
|
1111
|
-
text += `test -f "$DESKTOP/penguins-eggs.desktop
|
|
1112
|
-
text += `test -f "$DESKTOP/penguins-eggs.desktop
|
|
1113
|
-
text += `test -f /usr/share/applications
|
|
1114
|
-
text += `test -f "$DESKTOP
|
|
1115
|
-
text += `test -f "$DESKTOP
|
|
1123
|
+
text += `test -f /usr/share/applications/penguins-eggs.desktop && cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n`;
|
|
1124
|
+
text += `test -f "$DESKTOP"/penguins-eggs.desktop && chmod a+x "$DESKTOP"/penguins-eggs.desktop\n`;
|
|
1125
|
+
text += `test -f "$DESKTOP"/penguins-eggs.desktop && gio set "$DESKTOP"/penguins-eggs.desktop metadata::trusted true\n`;
|
|
1126
|
+
text += `test -f /usr/share/applications/${installerUrl} && cp /usr/share/applications/${installerUrl} "$DESKTOP"\n`;
|
|
1127
|
+
text += `test -f "$DESKTOP"/${installerUrl} && chmod a+x "$DESKTOP"/${installerUrl}\n`;
|
|
1128
|
+
text += `test -f "$DESKTOP"/${installerUrl} && gio set "$DESKTOP"/${installerUrl} metadata::trusted true\n`;
|
|
1116
1129
|
}
|
|
1117
1130
|
else {
|
|
1118
1131
|
// OTHERS: CINNAMON/KDE/ETC
|
|
1119
|
-
text += `chmod +x $DESKTOP/*.desktop`;
|
|
1132
|
+
text += `chmod +x "$DESKTOP"/*.desktop`;
|
|
1120
1133
|
}
|
|
1121
1134
|
fs_1.default.writeFileSync(script, text, 'utf8');
|
|
1122
1135
|
await (0, utils_1.exec)(`chmod a+x ${script}`, this.echo);
|
|
@@ -1355,7 +1368,7 @@ class Ovary {
|
|
|
1355
1368
|
* create .disk/info, .disk/mksquashfs, .disk/mkiso
|
|
1356
1369
|
* return mkiso
|
|
1357
1370
|
*/
|
|
1358
|
-
makeDotDisk(
|
|
1371
|
+
makeDotDisk(clone = false, cryptedclone = false) {
|
|
1359
1372
|
const dotDisk = this.settings.work_dir.pathIso + '/.disk';
|
|
1360
1373
|
if (fs_1.default.existsSync(dotDisk)) {
|
|
1361
1374
|
shelljs_1.default.rm('-rf', dotDisk);
|
|
@@ -1369,24 +1382,31 @@ class Ovary {
|
|
|
1369
1382
|
const scripts = this.settings.work_dir.path;
|
|
1370
1383
|
shelljs_1.default.cp(scripts + '/mksquashfs', dotDisk + '/mksquashfs');
|
|
1371
1384
|
// .disk/mkisofs
|
|
1372
|
-
content = this.xorrisoCommand(
|
|
1385
|
+
content = this.xorrisoCommand(clone, cryptedclone).replace(/\s\s+/g, ' ');
|
|
1373
1386
|
file = dotDisk + '/mkisofs';
|
|
1374
1387
|
fs_1.default.writeFileSync(file, content, 'utf-8');
|
|
1375
1388
|
return content;
|
|
1376
1389
|
}
|
|
1377
1390
|
/**
|
|
1378
1391
|
*
|
|
1379
|
-
* @param
|
|
1392
|
+
* @param cryptedclone
|
|
1380
1393
|
* @returns cmd 4 mkiso
|
|
1381
1394
|
*/
|
|
1382
|
-
xorrisoCommand(
|
|
1395
|
+
xorrisoCommand(clone = false, cryptedclone = false) {
|
|
1383
1396
|
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
1384
1397
|
let prefix = this.settings.config.snapshot_prefix;
|
|
1385
|
-
|
|
1386
|
-
|
|
1398
|
+
let typology = "";
|
|
1399
|
+
// typology is applied only with standard egg-of
|
|
1400
|
+
if (prefix.slice(0, 7) === 'egg-of-') {
|
|
1401
|
+
if (clone) {
|
|
1402
|
+
typology = "_clone";
|
|
1403
|
+
}
|
|
1404
|
+
else if (cryptedclone) {
|
|
1405
|
+
typology = "_crypted";
|
|
1406
|
+
}
|
|
1387
1407
|
}
|
|
1388
1408
|
const postfix = utils_2.default.getPostfix();
|
|
1389
|
-
this.settings.isoFilename = prefix + volid + postfix;
|
|
1409
|
+
this.settings.isoFilename = prefix + volid + typology + postfix;
|
|
1390
1410
|
const output = this.settings.config.snapshot_dir + this.settings.isoFilename;
|
|
1391
1411
|
let command = '';
|
|
1392
1412
|
// const appid = `-appid "${this.settings.distro.distroId}" `
|
package/dist/classes/pxe.js
CHANGED
|
@@ -176,7 +176,7 @@ class Pxe {
|
|
|
176
176
|
content += `\n`;
|
|
177
177
|
content += `menu title cuckoo: when you need a flying PXE server! ${utils_1.default.address()}\n`;
|
|
178
178
|
content += `PROMPT 0\n`;
|
|
179
|
-
content += `TIMEOUT
|
|
179
|
+
content += `TIMEOUT 200\n`;
|
|
180
180
|
content += `\n`;
|
|
181
181
|
content += `label egg\n`;
|
|
182
182
|
content += `menu label ${this.bootLabel.replace('.iso', '')}\n`;
|
package/dist/classes/tools.js
CHANGED
|
@@ -10,7 +10,6 @@ const tslib_1 = require("tslib");
|
|
|
10
10
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
11
11
|
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
12
12
|
const settings_1 = tslib_1.__importDefault(require("./settings"));
|
|
13
|
-
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
14
13
|
/**
|
|
15
14
|
* Utils: general porpourse utils
|
|
16
15
|
* @remarks all the utilities
|
|
@@ -46,7 +45,7 @@ class Tools {
|
|
|
46
45
|
const settings = new settings_1.default();
|
|
47
46
|
settings.load();
|
|
48
47
|
this.snapshot_dir = settings.config.snapshot_dir;
|
|
49
|
-
this.snapshot_name = settings.config.snapshot_prefix + settings.config.snapshot_basename + '
|
|
48
|
+
this.snapshot_name = settings.config.snapshot_prefix + settings.config.snapshot_basename + '_'; // + Utils.machineArch() + '_'
|
|
50
49
|
}
|
|
51
50
|
else {
|
|
52
51
|
console.log(`Can't find: ${this.tools_yaml}`);
|
package/dist/classes/utils.js
CHANGED
|
@@ -347,7 +347,7 @@ class Utils {
|
|
|
347
347
|
* @returns eggName
|
|
348
348
|
*/
|
|
349
349
|
static getPostfix() {
|
|
350
|
-
let postfix = '
|
|
350
|
+
let postfix = '_' + this.machineArch() + '_' + Utils.formatDate(new Date()) + '.iso';
|
|
351
351
|
return postfix;
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
@@ -43,6 +43,7 @@ class Calamares extends core_1.Command {
|
|
|
43
43
|
if (flags.theme !== undefined) {
|
|
44
44
|
theme = flags.theme;
|
|
45
45
|
}
|
|
46
|
+
let nointeractive = flags.nointeractive;
|
|
46
47
|
console.log(`theme: ${theme}`);
|
|
47
48
|
if (utils_1.default.isRoot(this.id)) {
|
|
48
49
|
let installer = 'krill';
|
|
@@ -51,7 +52,7 @@ class Calamares extends core_1.Command {
|
|
|
51
52
|
}
|
|
52
53
|
if (installer === 'calamares') {
|
|
53
54
|
if (!remove) {
|
|
54
|
-
if (await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
55
|
+
if (!nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
55
56
|
/**
|
|
56
57
|
* Install calamares
|
|
57
58
|
*/
|
|
@@ -102,6 +103,7 @@ exports.default = Calamares;
|
|
|
102
103
|
Calamares.flags = {
|
|
103
104
|
help: core_1.Flags.help({ char: 'h' }),
|
|
104
105
|
install: core_1.Flags.boolean({ char: 'i', description: "install calamares and it's dependencies" }),
|
|
106
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
105
107
|
release: core_1.Flags.boolean({ char: 'r', description: "release: remove calamares and all it's dependencies after the installation" }),
|
|
106
108
|
remove: core_1.Flags.boolean({ description: "remove calamares and it's dependencies" }),
|
|
107
109
|
theme: core_1.Flags.string({ description: 'theme/branding for eggs and calamares' }),
|
package/dist/commands/config.js
CHANGED
|
@@ -67,17 +67,18 @@ class Config extends core_1.Command {
|
|
|
67
67
|
*
|
|
68
68
|
* @param verbose
|
|
69
69
|
*/
|
|
70
|
-
static async thatWeNeed(nointeractive = false, verbose = false,
|
|
70
|
+
static async thatWeNeed(nointeractive = false, verbose = false, cryptedclone = false) {
|
|
71
71
|
const i = {};
|
|
72
72
|
i.distroTemplate = !pacman_1.default.distroTemplateCheck();
|
|
73
73
|
if (utils_1.default.machineArch() !== 'i386') {
|
|
74
74
|
i.efi = !pacman_1.default.isUefi();
|
|
75
75
|
}
|
|
76
|
-
if (!
|
|
76
|
+
if (!cryptedclone) {
|
|
77
77
|
if (!(await pacman_1.default.calamaresCheck()) && pacman_1.default.isInstalledGui() && pacman_1.default.isCalamaresAvailable()) {
|
|
78
78
|
if (!pacman_1.default.packageIsInstalled('live-installer')) {
|
|
79
|
-
utils_1.default.warning('
|
|
80
|
-
|
|
79
|
+
utils_1.default.warning('Config: you are on a graphic system, I suggest to install the GUI installer calamares');
|
|
80
|
+
// se nointeractive i.calamares=false
|
|
81
|
+
i.calamares = nointeractive ? false : await utils_1.default.customConfirm('Want You install calamares?');
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -209,12 +210,12 @@ exports.default = Config;
|
|
|
209
210
|
Config.flags = {
|
|
210
211
|
clean: core_1.Flags.boolean({ char: 'c', description: 'remove old configuration before to create new one' }),
|
|
211
212
|
help: core_1.Flags.help({ char: 'h' }),
|
|
212
|
-
nointeractive: core_1.Flags.boolean({ char: 'n', description: '
|
|
213
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
213
214
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
214
215
|
};
|
|
215
216
|
Config.description = 'Configure and install prerequisites deb packages to run it';
|
|
216
217
|
Config.examples = [
|
|
217
218
|
"sudo eggs config",
|
|
218
219
|
"sudo eggs config --clean",
|
|
219
|
-
"sudo eggs config --clean --
|
|
220
|
+
"sudo eggs config --clean --nointeractive"
|
|
220
221
|
];
|
|
@@ -16,9 +16,6 @@ class ExportIso extends core_1.Command {
|
|
|
16
16
|
const Tu = new tools_1.default();
|
|
17
17
|
await Tu.loadSettings();
|
|
18
18
|
const echo = utils_1.default.setEcho(flags.verbose);
|
|
19
|
-
if (flags.backup) {
|
|
20
|
-
Tu.snapshot_name = Tu.snapshot_name.slice(0, 7) === 'egg-of-' ? 'egg-eb-' + Tu.snapshot_name.slice(7) : 'backup-' + Tu.snapshot_name;
|
|
21
|
-
}
|
|
22
19
|
const rmount = `/tmp/eggs-${(Math.random() + 1).toString(36).substring(7)}`;
|
|
23
20
|
let cmd = `rm -f ${rmount}\n`;
|
|
24
21
|
let filter = '*.iso';
|
|
@@ -42,7 +39,6 @@ class ExportIso extends core_1.Command {
|
|
|
42
39
|
}
|
|
43
40
|
exports.default = ExportIso;
|
|
44
41
|
ExportIso.flags = {
|
|
45
|
-
backup: core_1.Flags.boolean({ char: 'b', description: 'export backup ISOs' }),
|
|
46
42
|
clean: core_1.Flags.boolean({ char: 'c', description: 'delete old ISOs before to copy' }),
|
|
47
43
|
help: core_1.Flags.help({ char: 'h' }),
|
|
48
44
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
@@ -51,5 +47,4 @@ ExportIso.description = 'export iso in the destination host';
|
|
|
51
47
|
ExportIso.examples = [
|
|
52
48
|
"eggs export iso",
|
|
53
49
|
"eggs export iso --clean",
|
|
54
|
-
"eggs export iso --backup"
|
|
55
50
|
];
|
package/dist/commands/install.js
CHANGED
|
@@ -49,8 +49,8 @@ class Install extends core_1.Command {
|
|
|
49
49
|
krillConfig = js_yaml_1.default.load(content);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
//
|
|
53
|
-
let
|
|
52
|
+
// nointeractive
|
|
53
|
+
let nointeractive = flags.nointeractive;
|
|
54
54
|
// hostname
|
|
55
55
|
let ip = flags.ip;
|
|
56
56
|
let random = flags.random;
|
|
@@ -71,7 +71,7 @@ class Install extends core_1.Command {
|
|
|
71
71
|
if (utils_1.default.isRoot()) {
|
|
72
72
|
if (utils_1.default.isLive()) {
|
|
73
73
|
const krill = new krill_prepare_1.default();
|
|
74
|
-
await krill.prepare(unattended,
|
|
74
|
+
await krill.prepare(unattended, nointeractive, krillConfig, ip, random, domain, suspend, small, none, crypted, pve, verbose);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
utils_1.default.warning('You are in an installed system!');
|
|
@@ -89,7 +89,7 @@ Install.flags = {
|
|
|
89
89
|
domain: core_1.Flags.string({ char: 'd', description: 'Domain name, defult: .local' }),
|
|
90
90
|
help: core_1.Flags.help({ char: 'h' }),
|
|
91
91
|
ip: core_1.Flags.boolean({ char: 'i', description: 'hostname as ip, eg: ip-192-168-1-33' }),
|
|
92
|
-
nointeractive: core_1.Flags.boolean({ char: 'n', description: '
|
|
92
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
93
93
|
none: core_1.Flags.boolean({ char: 'N', description: 'Swap none: 256M' }),
|
|
94
94
|
pve: core_1.Flags.boolean({ char: 'p', description: 'Proxmox VE install' }),
|
|
95
95
|
random: core_1.Flags.boolean({ char: 'r', description: 'Add random to hostname, eg: colibri-ay412dt' }),
|
package/dist/commands/kill.js
CHANGED
|
@@ -19,19 +19,20 @@ class Kill extends core_1.Command {
|
|
|
19
19
|
this.work_dir = {};
|
|
20
20
|
}
|
|
21
21
|
async run() {
|
|
22
|
-
|
|
22
|
+
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
23
23
|
const { flags } = await this.parse(Kill);
|
|
24
24
|
let verbose = false;
|
|
25
25
|
if (flags.verbose) {
|
|
26
26
|
verbose = true;
|
|
27
27
|
}
|
|
28
|
+
let nointeractive = flags.nointeractive;
|
|
28
29
|
const echo = utils_1.default.setEcho(verbose);
|
|
29
30
|
if (utils_1.default.isRoot()) {
|
|
30
31
|
// Utils.warning('Cleaning the nest...')
|
|
31
32
|
const settings = new settings_1.default();
|
|
32
33
|
await settings.load();
|
|
33
34
|
await settings.listFreeSpace();
|
|
34
|
-
if (await utils_1.default.customConfirm()) {
|
|
35
|
+
if (nointeractive || await utils_1.default.customConfirm()) {
|
|
35
36
|
await (0, utils_2.exec)(`rm ${settings.work_dir.path}/* -rf`, echo);
|
|
36
37
|
await (0, utils_2.exec)(`rm ${settings.config.snapshot_dir} -rf`, echo);
|
|
37
38
|
}
|
|
@@ -44,6 +45,7 @@ class Kill extends core_1.Command {
|
|
|
44
45
|
exports.default = Kill;
|
|
45
46
|
Kill.flags = {
|
|
46
47
|
help: core_1.Flags.help({ char: 'h' }),
|
|
48
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
47
49
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
48
50
|
};
|
|
49
51
|
Kill.description = 'kill the eggs/free the nest';
|
package/dist/commands/produce.js
CHANGED
|
@@ -58,18 +58,15 @@ class Produce extends core_1.Command {
|
|
|
58
58
|
}
|
|
59
59
|
const compressors = new compressors_1.default();
|
|
60
60
|
await compressors.populate();
|
|
61
|
-
let compression = compressors.
|
|
61
|
+
let compression = compressors.fast();
|
|
62
62
|
if (flags.max) {
|
|
63
63
|
compression = compressors.max();
|
|
64
64
|
}
|
|
65
|
-
else if (flags.
|
|
66
|
-
compression = compressors.
|
|
65
|
+
else if (flags.standard) {
|
|
66
|
+
compression = compressors.normal();
|
|
67
67
|
}
|
|
68
68
|
const release = flags.release;
|
|
69
|
-
|
|
70
|
-
// compression = compressors.max()
|
|
71
|
-
// }
|
|
72
|
-
const backup = flags.backup;
|
|
69
|
+
const cryptedclone = flags.cryptedclone;
|
|
73
70
|
const clone = flags.clone;
|
|
74
71
|
const verbose = flags.verbose;
|
|
75
72
|
const scriptOnly = flags.script;
|
|
@@ -91,9 +88,9 @@ class Produce extends core_1.Command {
|
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
|
-
const i = await config_1.default.thatWeNeed(nointeractive, verbose,
|
|
91
|
+
const i = await config_1.default.thatWeNeed(nointeractive, verbose, cryptedclone);
|
|
95
92
|
if ((i.needApt || i.configurationInstall || i.configurationRefresh || i.distroTemplate) && (await utils_1.default.customConfirm('Select yes to continue...'))) {
|
|
96
|
-
await config_1.default.install(i, verbose);
|
|
93
|
+
await config_1.default.install(i, nointeractive, verbose);
|
|
97
94
|
}
|
|
98
95
|
const myAddons = {};
|
|
99
96
|
if (flags.addons != undefined) {
|
|
@@ -114,7 +111,7 @@ class Produce extends core_1.Command {
|
|
|
114
111
|
const ovary = new ovary_1.default();
|
|
115
112
|
utils_1.default.warning('Produce an egg...');
|
|
116
113
|
if (await ovary.fertilization(prefix, basename, theme, compression, !nointeractive)) {
|
|
117
|
-
await ovary.produce(
|
|
114
|
+
await ovary.produce(clone, cryptedclone, scriptOnly, yolkRenew, release, myAddons, nointeractive, verbose);
|
|
118
115
|
ovary.finished(scriptOnly);
|
|
119
116
|
}
|
|
120
117
|
}
|
|
@@ -126,16 +123,16 @@ class Produce extends core_1.Command {
|
|
|
126
123
|
exports.default = Produce;
|
|
127
124
|
Produce.flags = {
|
|
128
125
|
addons: core_1.Flags.string({ multiple: true, description: 'addons to be used: adapt, ichoice, pve, rsupport' }),
|
|
129
|
-
backup: core_1.Flags.boolean({ char: 'b', description: 'backup mode (CRYPTED)' }),
|
|
130
126
|
basename: core_1.Flags.string({ description: 'basename' }),
|
|
131
|
-
clone: core_1.Flags.boolean({ char: 'c', description: 'clone
|
|
132
|
-
|
|
127
|
+
clone: core_1.Flags.boolean({ char: 'c', description: 'clone' }),
|
|
128
|
+
cryptedclone: core_1.Flags.boolean({ char: 'C', description: 'crypted clone' }),
|
|
133
129
|
help: core_1.Flags.help({ char: 'h' }),
|
|
134
130
|
max: core_1.Flags.boolean({ char: 'm', description: 'max compression' }),
|
|
135
|
-
nointeractive: core_1.Flags.boolean({ char: 'n', description: '
|
|
131
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
136
132
|
prefix: core_1.Flags.string({ char: 'p', description: 'prefix' }),
|
|
137
133
|
release: core_1.Flags.boolean({ description: 'release: max compression, remove penguins-eggs and calamares after installation' }),
|
|
138
134
|
script: core_1.Flags.boolean({ char: 's', description: 'script mode. Generate scripts to manage iso build' }),
|
|
135
|
+
standard: core_1.Flags.boolean({ char: 'f', description: 'standard compression' }),
|
|
139
136
|
theme: core_1.Flags.string({ description: 'theme for livecd, calamares branding and partitions' }),
|
|
140
137
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
|
|
141
138
|
yolk: core_1.Flags.boolean({ char: 'y', description: '-y force yolk renew' }),
|
|
@@ -143,10 +140,11 @@ Produce.flags = {
|
|
|
143
140
|
Produce.description = 'produce a live image from your system whithout your data';
|
|
144
141
|
Produce.examples = [
|
|
145
142
|
"sudo eggs produce",
|
|
146
|
-
"sudo eggs produce --
|
|
143
|
+
"sudo eggs produce --standard",
|
|
147
144
|
"sudo eggs produce --max",
|
|
148
|
-
"sudo eggs produce --
|
|
149
|
-
"sudo eggs produce --
|
|
150
|
-
"sudo eggs produce --
|
|
151
|
-
"sudo eggs produce --
|
|
145
|
+
"sudo eggs produce --max --basename=colibri",
|
|
146
|
+
"sudo eggs produce --cryptedclone",
|
|
147
|
+
"sudo eggs produce --clone",
|
|
148
|
+
"sudo eggs produce --basename=colibri",
|
|
149
|
+
"sudo eggs produce --basename=colibri --theme /path/to/theme --addons adapt",
|
|
152
150
|
];
|
|
@@ -21,10 +21,10 @@ class Syncfrom extends core_1.Command {
|
|
|
21
21
|
this.verbose = false;
|
|
22
22
|
this.echo = {};
|
|
23
23
|
this.rootDir = '/';
|
|
24
|
-
this.luksName = 'luks-eggs-
|
|
24
|
+
this.luksName = 'luks-eggs-data';
|
|
25
25
|
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
26
26
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
27
|
-
this.luksMountpoint = '/tmp/eggs-
|
|
27
|
+
this.luksMountpoint = '/tmp/eggs-data';
|
|
28
28
|
}
|
|
29
29
|
async run() {
|
|
30
30
|
const { flags } = await this.parse(Syncfrom);
|
|
@@ -50,7 +50,7 @@ class Syncfrom extends core_1.Command {
|
|
|
50
50
|
}
|
|
51
51
|
if (utils_1.default.isRoot()) {
|
|
52
52
|
if (fileVolume === '') {
|
|
53
|
-
fileVolume = '/run/live/medium/live/luks-eggs-
|
|
53
|
+
fileVolume = '/run/live/medium/live/luks-eggs-dada';
|
|
54
54
|
}
|
|
55
55
|
if (!utils_1.default.isLive()) {
|
|
56
56
|
/**
|
|
@@ -60,7 +60,7 @@ class Syncfrom extends core_1.Command {
|
|
|
60
60
|
this.luksName = path_1.default.basename(fileVolume);
|
|
61
61
|
this.luksFile = fileVolume;
|
|
62
62
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
63
|
-
this.luksMountpoint = '/tmp/eggs-
|
|
63
|
+
this.luksMountpoint = '/tmp/eggs-data';
|
|
64
64
|
await this.restorePrivateData();
|
|
65
65
|
if (await utils_1.default.customConfirm(`Your system was updated! Press a key to reboot`)) {
|
|
66
66
|
await (0, utils_2.exec)('reboot');
|
|
@@ -77,7 +77,7 @@ class Syncfrom extends core_1.Command {
|
|
|
77
77
|
this.luksName = path_1.default.basename(fileVolume);
|
|
78
78
|
this.luksFile = fileVolume;
|
|
79
79
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
80
|
-
this.luksMountpoint = '/tmp/eggs-
|
|
80
|
+
this.luksMountpoint = '/tmp/eggs-data';
|
|
81
81
|
await this.restorePrivateData();
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -108,7 +108,7 @@ class Syncfrom extends core_1.Command {
|
|
|
108
108
|
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/group ${this.rootDir}/etc/`, this.echo);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
utils_1.default.warning('Restoring
|
|
111
|
+
utils_1.default.warning('Restoring crypted data');
|
|
112
112
|
let cmd = `rsync -a ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
|
|
113
113
|
if (destDelete) {
|
|
114
114
|
cmd = `rsync --archive --delete ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
|
|
@@ -161,6 +161,6 @@ Syncfrom.flags = {
|
|
|
161
161
|
};
|
|
162
162
|
Syncfrom.description = 'restore users and user data from a LUKS volumes';
|
|
163
163
|
Syncfrom.examples = [
|
|
164
|
-
'sudo eggs
|
|
165
|
-
'sudo eggs
|
|
164
|
+
'sudo eggs syncfrom',
|
|
165
|
+
'sudo eggs syncfrom --file /path/to/fileLUKS',
|
|
166
166
|
];
|
package/dist/commands/syncto.js
CHANGED
|
@@ -67,12 +67,12 @@ class Syncto extends core_1.Command {
|
|
|
67
67
|
* restore con file
|
|
68
68
|
*/
|
|
69
69
|
if (fileVolume === '') {
|
|
70
|
-
fileVolume = '/tmp/luks-eggs-
|
|
70
|
+
fileVolume = '/tmp/luks-eggs-data';
|
|
71
71
|
}
|
|
72
72
|
this.luksName = path_1.default.basename(fileVolume);
|
|
73
73
|
this.luksFile = fileVolume;
|
|
74
74
|
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
75
|
-
this.luksMountpoint = '/tmp/eggs-
|
|
75
|
+
this.luksMountpoint = '/tmp/eggs-data';
|
|
76
76
|
if (!fs_1.default.existsSync(fileVolume)) {
|
|
77
77
|
await this.luksCreate();
|
|
78
78
|
}
|