penguins-eggs 9.3.26 → 9.3.28
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/conf/derivatives.yaml +7 -0
- package/dist/classes/bleach.js +26 -24
- package/dist/classes/compressors.js +7 -5
- package/dist/classes/daddy.js +38 -36
- package/dist/classes/distro.js +30 -27
- package/dist/classes/family/archlinux.js +21 -19
- package/dist/classes/family/debian.js +33 -31
- package/dist/classes/family/fedora.js +19 -17
- package/dist/classes/family/suse.js +19 -17
- package/dist/classes/incubation/branding.js +8 -6
- package/dist/classes/incubation/distros/bionic.js +5 -3
- package/dist/classes/incubation/distros/buster.js +5 -3
- package/dist/classes/incubation/distros/focal.js +5 -3
- package/dist/classes/incubation/distros/jessie.js +6 -4
- package/dist/classes/incubation/distros/rolling.js +9 -7
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +5 -3
- package/dist/classes/incubation/fisherman-helper/packages.js +17 -15
- package/dist/classes/incubation/fisherman.js +19 -19
- package/dist/classes/incubation/incubator.js +37 -35
- package/dist/classes/incubation/installer.js +8 -6
- package/dist/classes/initrd.js +5 -3
- package/dist/classes/keyboards.js +25 -23
- package/dist/classes/locales.js +19 -17
- package/dist/classes/n8.js +4 -2
- package/dist/classes/network.js +9 -9
- package/dist/classes/ovary.js +280 -281
- package/dist/classes/pacman.js +128 -128
- package/dist/classes/pve-live.js +7 -5
- package/dist/classes/pxe.js +141 -138
- package/dist/classes/settings.js +34 -32
- package/dist/classes/sources_list.js +31 -31
- package/dist/classes/systemctl.js +16 -14
- package/dist/classes/tailor.js +255 -262
- package/dist/classes/tools.js +7 -5
- package/dist/classes/users.js +30 -28
- package/dist/classes/utils.js +22 -20
- package/dist/classes/xdg.js +60 -58
- package/dist/classes/yolk.js +33 -33
- package/dist/commands/adapt.js +14 -12
- package/dist/commands/analyze.js +48 -15
- package/dist/commands/calamares.js +28 -26
- package/dist/commands/config.js +77 -79
- package/dist/commands/cuckoo.js +19 -17
- package/dist/commands/dad.js +16 -14
- package/dist/commands/export/deb.js +19 -17
- package/dist/commands/export/iso.js +17 -15
- package/dist/commands/install.js +31 -29
- package/dist/commands/kill.js +17 -15
- package/dist/commands/mom.js +11 -9
- package/dist/commands/produce.js +30 -28
- package/dist/commands/status.js +7 -5
- package/dist/commands/syncfrom.js +41 -41
- package/dist/commands/syncto.js +77 -80
- package/dist/commands/tools/clean.js +13 -11
- package/dist/commands/tools/ppa.js +26 -24
- package/dist/commands/tools/skel.js +18 -16
- package/dist/commands/tools/stat.js +12 -10
- package/dist/commands/tools/yolk.js +13 -11
- package/dist/commands/update.js +29 -27
- package/dist/commands/wardrobe/get.js +14 -12
- package/dist/commands/wardrobe/list.js +25 -23
- package/dist/commands/wardrobe/show.js +25 -23
- package/dist/commands/wardrobe/wear.js +24 -22
- package/dist/components/elements/information.js +21 -19
- package/dist/components/elements/steps.js +4 -2
- package/dist/components/elements/title.js +4 -2
- package/dist/components/finished.js +10 -8
- package/dist/components/install.js +10 -8
- package/dist/components/keyboard.js +10 -8
- package/dist/components/location.js +10 -8
- package/dist/components/network.js +10 -8
- package/dist/components/partitions.js +10 -8
- package/dist/components/summary.js +10 -8
- package/dist/components/users.js +33 -8
- package/dist/components/welcome.js +10 -8
- package/dist/interfaces/i-packages.js +1 -1
- package/dist/interfaces/i-pxe.js +39 -0
- package/dist/krill/krill-prepare.js +92 -90
- package/dist/krill/krill-sequence.js +148 -145
- package/dist/krill/modules/add-user.js +11 -9
- package/dist/krill/modules/bootloader-config-ubuntu.js +25 -23
- package/dist/krill/modules/bootloader.js +11 -9
- package/dist/krill/modules/change-password.js +2 -2
- package/dist/krill/modules/del-live-user.js +8 -6
- package/dist/krill/modules/fstab.js +35 -33
- package/dist/krill/modules/grubcfg.js +8 -6
- package/dist/krill/modules/hostname.js +19 -17
- package/dist/krill/modules/initramfs-cfg.js +6 -4
- package/dist/krill/modules/initramfs.js +17 -15
- package/dist/krill/modules/locale-cfg.js +12 -10
- package/dist/krill/modules/locale.js +13 -11
- package/dist/krill/modules/m-keyboard.js +33 -31
- package/dist/krill/modules/m-timezone.js +7 -5
- package/dist/krill/modules/machine-id.js +8 -6
- package/dist/krill/modules/mkfs.js +7 -7
- package/dist/krill/modules/mount-fs.js +22 -22
- package/dist/krill/modules/mount-vfs.js +12 -12
- package/dist/krill/modules/network-cfg.js +21 -21
- package/dist/krill/modules/packages.js +20 -18
- package/dist/krill/modules/partition.js +148 -139
- package/dist/krill/modules/remove-installer-link.js +5 -3
- package/dist/krill/modules/umount.js +9 -7
- package/dist/krill/modules/unpackfs.js +8 -6
- package/dist/lib/cli-autologin.js +163 -163
- package/dist/lib/dependencies.js +10 -10
- package/dist/lib/get_address.js +6 -4
- package/dist/lib/get_dns.js +6 -4
- package/dist/lib/get_domain.js +6 -4
- package/dist/lib/get_gateway.js +6 -4
- package/dist/lib/get_hostname.js +6 -4
- package/dist/lib/get_netmask.js +6 -4
- package/dist/lib/get_password.js +8 -6
- package/dist/lib/get_root_password.js +7 -5
- package/dist/lib/get_userfullname.js +6 -4
- package/dist/lib/get_username.js +6 -4
- package/dist/lib/select_address_type.js +6 -4
- package/dist/lib/select_filesystem_type.js +8 -6
- package/dist/lib/select_installation_device.js +7 -5
- package/dist/lib/select_installation_mode.js +6 -4
- package/dist/lib/select_interface.js +6 -4
- package/dist/lib/select_keyboard_layout.js +10 -8
- package/dist/lib/select_keyboard_model.js +10 -8
- package/dist/lib/select_keyboard_option.js +10 -8
- package/dist/lib/select_keyboard_variant.js +10 -8
- package/dist/lib/select_languages.js +9 -7
- package/dist/lib/select_regions.js +6 -4
- package/dist/lib/select_user_swap_choice.js +8 -6
- package/dist/lib/select_zones.js +12 -10
- package/dist/lib/utils.js +3 -3
- package/package.json +12 -5
- package/dist/dhcpd/dhcpd.js +0 -222
- package/dist/dhcpd/index.js +0 -7
- package/dist/dhcpd/packet/converters.js +0 -377
- package/dist/dhcpd/packet/options.js +0 -2
- package/dist/dhcpd/packet/types.js +0 -2
- package/dist/dhcpd/packet.js +0 -251
- package/dist/dhcpd/proxy.js +0 -152
- package/dist/dhcpd/server.js +0 -152
- package/dist/dhcpd/sprintf.js +0 -170
- package/dist/dhcpd/utils.js +0 -190
- package/dist/interfaces/i-pxe-options.js +0 -2
package/dist/classes/ovary.js
CHANGED
|
@@ -5,35 +5,37 @@
|
|
|
5
5
|
* mail: piero.proietti@gmail.com
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const tslib_1 = require("tslib");
|
|
10
12
|
// packages
|
|
11
|
-
const fs_1 =
|
|
12
|
-
const js_yaml_1 =
|
|
13
|
-
const node_path_1 =
|
|
14
|
-
const node_os_1 =
|
|
15
|
-
const shelljs_1 =
|
|
16
|
-
const chalk_1 =
|
|
17
|
-
const mustache_1 =
|
|
18
|
-
const
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
17
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
18
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
+
const mustache_1 = __importDefault(require("mustache"));
|
|
20
|
+
const pve_live_js_1 = __importDefault(require("./pve-live.js"));
|
|
19
21
|
// libraries
|
|
20
|
-
const
|
|
22
|
+
const utils_js_1 = require("../lib/utils.js");
|
|
21
23
|
// classes
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const displaymanager_1 = require("./incubation/fisherman-helper/displaymanager");
|
|
24
|
+
const utils_js_2 = __importDefault(require("./utils.js"));
|
|
25
|
+
const n8_js_1 = __importDefault(require("./n8.js"));
|
|
26
|
+
const incubator_js_1 = __importDefault(require("./incubation/incubator.js"));
|
|
27
|
+
const xdg_js_1 = __importDefault(require("./xdg.js"));
|
|
28
|
+
const pacman_js_1 = __importDefault(require("./pacman.js"));
|
|
29
|
+
const settings_js_1 = __importDefault(require("./settings.js"));
|
|
30
|
+
const systemctl_js_1 = __importDefault(require("./systemctl.js"));
|
|
31
|
+
const bleach_js_1 = __importDefault(require("./bleach.js"));
|
|
32
|
+
const yolk_js_1 = __importDefault(require("./yolk.js"));
|
|
33
|
+
const displaymanager_js_1 = require("./incubation/fisherman-helper/displaymanager.js");
|
|
33
34
|
// backup
|
|
34
35
|
const promises_1 = require("fs/promises");
|
|
35
36
|
const fs_2 = require("fs");
|
|
36
|
-
const
|
|
37
|
+
const users_js_1 = __importDefault(require("./users.js"));
|
|
38
|
+
const cli_autologin_js_1 = __importDefault(require("../lib/cli-autologin.js"));
|
|
37
39
|
/**
|
|
38
40
|
* Ovary:
|
|
39
41
|
*/
|
|
@@ -51,12 +53,13 @@ class Ovary {
|
|
|
51
53
|
this.theme = '';
|
|
52
54
|
this.clone = false;
|
|
53
55
|
this.cryptedclone = false;
|
|
56
|
+
this.cliAutologin = new cli_autologin_js_1.default();
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* @returns {boolean} success
|
|
57
60
|
*/
|
|
58
61
|
async fertilization(snapshot_prefix = '', snapshot_basename = '', theme = '', compression = '', nointeratctive = false) {
|
|
59
|
-
this.settings = new
|
|
62
|
+
this.settings = new settings_js_1.default();
|
|
60
63
|
if (await this.settings.load()) {
|
|
61
64
|
this.familyId = this.settings.distro.familyId;
|
|
62
65
|
if (snapshot_prefix !== '') {
|
|
@@ -75,7 +78,7 @@ class Ovary {
|
|
|
75
78
|
return true;
|
|
76
79
|
}
|
|
77
80
|
this.settings.listFreeSpace();
|
|
78
|
-
if (await
|
|
81
|
+
if (await utils_js_2.default.customConfirm('Select yes to continue...')) {
|
|
79
82
|
return true;
|
|
80
83
|
}
|
|
81
84
|
}
|
|
@@ -87,73 +90,71 @@ class Ovary {
|
|
|
87
90
|
*/
|
|
88
91
|
async produce(clone = false, cryptedclone = false, scriptOnly = false, yolkRenew = false, release = false, myAddons, nointeractive = false, verbose = false) {
|
|
89
92
|
this.verbose = verbose;
|
|
90
|
-
this.echo =
|
|
93
|
+
this.echo = utils_js_2.default.setEcho(verbose);
|
|
91
94
|
if (this.verbose) {
|
|
92
95
|
this.toNull = ' > /dev/null 2>&1';
|
|
93
96
|
}
|
|
94
97
|
this.clone = clone;
|
|
95
98
|
this.cryptedclone = cryptedclone;
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
const luksName = 'luks-eggs-data';
|
|
100
|
+
const luksFile = `/tmp/${luksName}`;
|
|
98
101
|
// let luksDevice = `/dev/mapper/${this.luksName}`
|
|
99
102
|
// let luksMountpoint = `/mnt`
|
|
100
103
|
if (this.familyId === 'debian') {
|
|
101
|
-
const yolk = new
|
|
104
|
+
const yolk = new yolk_js_1.default();
|
|
102
105
|
if (!yolk.yolkExists()) {
|
|
103
|
-
|
|
106
|
+
utils_js_2.default.warning('local repository /var/local/yolk creation...');
|
|
104
107
|
await yolk.create(verbose);
|
|
105
108
|
}
|
|
106
109
|
else if (yolkRenew) {
|
|
107
|
-
|
|
110
|
+
utils_js_2.default.warning('force renew local repository /var/local/yolk...');
|
|
108
111
|
yolk.yolkClean();
|
|
109
112
|
await yolk.create(verbose);
|
|
110
113
|
}
|
|
111
114
|
else {
|
|
112
|
-
|
|
115
|
+
utils_js_2.default.warning('Using preesixent yolk...');
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
if (!fs_1.default.existsSync(this.settings.config.snapshot_dir)) {
|
|
116
119
|
shelljs_1.default.mkdir('-p', this.settings.config.snapshot_dir);
|
|
117
120
|
}
|
|
118
121
|
await this.settings.loadRemix(this.snapshot_basename, this.theme);
|
|
119
|
-
if (
|
|
122
|
+
if (utils_js_2.default.isLive()) {
|
|
120
123
|
console.log(chalk_1.default.red('>>> eggs: This is a live system! An egg cannot be produced from an egg!'));
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
123
126
|
await this.liveCreateStructure();
|
|
124
|
-
if (!nointeractive)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
await bleach.clean(verbose);
|
|
131
|
-
}
|
|
127
|
+
if (!nointeractive && this.settings.distro.isCalamaresAvailable && (pacman_js_1.default.isInstalledGui()) &&
|
|
128
|
+
this.settings.config.force_installer && !(await pacman_js_1.default.calamaresCheck())) {
|
|
129
|
+
console.log('Installing ' + chalk_1.default.bgGray('calamares') + ' due force_installer=yes.');
|
|
130
|
+
await pacman_js_1.default.calamaresInstall(verbose);
|
|
131
|
+
const bleach = new bleach_js_1.default();
|
|
132
|
+
await bleach.clean(verbose);
|
|
132
133
|
}
|
|
133
134
|
// CRYPTEDCLONE
|
|
134
135
|
if (cryptedclone) {
|
|
135
|
-
console.log(
|
|
136
|
+
console.log('Users and the user data will be saved in an encrypted LUKS volume');
|
|
136
137
|
const users = await this.usersFill();
|
|
137
|
-
for (
|
|
138
|
-
if (
|
|
138
|
+
for (const user of users) {
|
|
139
|
+
if (user.saveIt) {
|
|
139
140
|
let utype = 'user ';
|
|
140
|
-
if (parseInt(
|
|
141
|
+
if (Number.parseInt(user.uid) < 1000) {
|
|
141
142
|
utype = 'service';
|
|
142
143
|
}
|
|
143
|
-
console.log(`- ${utype}: ${
|
|
144
|
-
if (
|
|
145
|
-
this.addRemoveExclusion(true,
|
|
144
|
+
console.log(`- ${utype}: ${user.login.padEnd(16)} \thome: ${user.home}`);
|
|
145
|
+
if (user.login !== 'root') {
|
|
146
|
+
this.addRemoveExclusion(true, user.home);
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
// CLONE
|
|
150
151
|
}
|
|
151
152
|
else if (this.clone) {
|
|
152
|
-
|
|
153
|
+
utils_js_2.default.warning('eggs will SAVE users and users\' data UNCRYPTED on the live');
|
|
153
154
|
// NORMAL
|
|
154
155
|
}
|
|
155
156
|
else {
|
|
156
|
-
|
|
157
|
+
utils_js_2.default.warning('eggs will REMOVE users and users\' from live');
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* NOTE: reCreate = false
|
|
@@ -161,14 +162,14 @@ class Ovary {
|
|
|
161
162
|
* reCreate = false is just for develop
|
|
162
163
|
* put reCreate = true in release
|
|
163
164
|
*/
|
|
164
|
-
|
|
165
|
+
const reCreate = true;
|
|
165
166
|
if (reCreate) { // start pre-clone
|
|
166
167
|
/**
|
|
167
168
|
* Anche non accettando l'installazione di calamares
|
|
168
169
|
* viene creata la configurazione dell'installer: krill/calamares
|
|
169
170
|
* L'installer prende il tema da settings.remix.branding
|
|
170
171
|
*/
|
|
171
|
-
this.incubator = new
|
|
172
|
+
this.incubator = new incubator_js_1.default(this.settings.remix, this.settings.distro, this.settings.config.user_opt, this.theme, verbose);
|
|
172
173
|
await this.incubator.config(release);
|
|
173
174
|
await this.syslinux();
|
|
174
175
|
await this.isolinux(this.theme);
|
|
@@ -193,32 +194,32 @@ class Ovary {
|
|
|
193
194
|
*/
|
|
194
195
|
await this.cleanUsersAccounts();
|
|
195
196
|
await this.createUserLive();
|
|
196
|
-
if (
|
|
197
|
+
if (pacman_js_1.default.isInstalledGui()) {
|
|
197
198
|
await this.createXdgAutostart(this.settings.config.theme, myAddons);
|
|
198
199
|
/**
|
|
199
200
|
* GUI installed but NOT Desktop Manager: just create motd and issue
|
|
200
201
|
*/
|
|
201
|
-
if ((0,
|
|
202
|
-
cliAutologin.addIssue(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);
|
|
203
|
-
cliAutologin.addMotd(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);
|
|
202
|
+
if ((0, displaymanager_js_1.displaymanager)() === '') {
|
|
203
|
+
this.cliAutologin.addIssue(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);
|
|
204
|
+
this.cliAutologin.addMotd(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);
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
else {
|
|
207
|
-
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);
|
|
208
|
+
this.cliAutologin.addAutologin(this.settings.distro.distroId, this.settings.distro.codenameId, this.settings.config.user_opt, this.settings.config.user_opt_passwd, this.settings.config.root_passwd, this.settings.work_dir.merged);
|
|
208
209
|
}
|
|
209
210
|
// Here we are forcing alwats cliAutologin
|
|
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
|
+
this.cliAutologin.addAutologin(this.settings.distro.distroId, this.settings.distro.codenameId, this.settings.config.user_opt, this.settings.config.user_opt_passwd, this.settings.config.root_passwd, this.settings.work_dir.merged);
|
|
211
212
|
}
|
|
212
213
|
await this.editLiveFs(clone, cryptedclone);
|
|
213
214
|
await this.makeSquashfs(scriptOnly);
|
|
214
215
|
await this.uBindLiveFs(); // Lo smonto prima della fase di backup
|
|
215
216
|
}
|
|
216
217
|
if (cryptedclone) {
|
|
217
|
-
await (0,
|
|
218
|
-
|
|
219
|
-
await (0,
|
|
220
|
-
|
|
221
|
-
await (0,
|
|
218
|
+
await (0, utils_js_1.exec)('eggs syncto', utils_js_2.default.setEcho(true));
|
|
219
|
+
utils_js_2.default.warning(`Waiting 10s, before to move ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
220
|
+
await (0, utils_js_1.exec)('sleep 10', utils_js_2.default.setEcho(false));
|
|
221
|
+
utils_js_2.default.warning(`moving ${luksFile} in ${this.settings.config.snapshot_dir}ovarium/iso/live`);
|
|
222
|
+
await (0, utils_js_1.exec)(`mv ${luksFile} ${this.settings.config.snapshot_dir}ovarium/iso/live`, this.echo);
|
|
222
223
|
}
|
|
223
224
|
const xorrisoCommand = this.makeDotDisk(clone, cryptedclone);
|
|
224
225
|
/**
|
|
@@ -226,14 +227,14 @@ class Ovary {
|
|
|
226
227
|
*/
|
|
227
228
|
if (this.familyId === 'archlinux') {
|
|
228
229
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
229
|
-
await (0,
|
|
230
|
-
await (0,
|
|
231
|
-
await (0,
|
|
230
|
+
await (0, utils_js_1.exec)(`mkdir ${this.settings.work_dir.pathIso}manjaro/x86_64 -p`, this.echo);
|
|
231
|
+
await (0, utils_js_1.exec)(`ln ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${this.settings.work_dir.pathIso}manjaro/x86_64/livefs.sfs`, this.echo);
|
|
232
|
+
await (0, utils_js_1.exec)(`md5sum ${this.settings.work_dir.pathIso}live/filesystem.squashfs > ${this.settings.work_dir.pathIso}manjaro/x86_64/livefs.md5`, this.echo);
|
|
232
233
|
}
|
|
233
234
|
else if (this.settings.distro.distroId === 'Arch' || this.settings.distro.distroId === 'RebornOS') {
|
|
234
|
-
await (0,
|
|
235
|
-
await (0,
|
|
236
|
-
await (0,
|
|
235
|
+
await (0, utils_js_1.exec)(`mkdir ${this.settings.work_dir.pathIso}arch/x86_64 -p`, this.echo);
|
|
236
|
+
await (0, utils_js_1.exec)(`ln ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${this.settings.work_dir.pathIso}arch/x86_64/airootfs.sfs`, this.echo);
|
|
237
|
+
await (0, utils_js_1.exec)(`sha512sum ${this.settings.work_dir.pathIso}live/filesystem.squashfs > ${this.settings.work_dir.pathIso}arch/x86_64/airootfs.sha512`, this.echo);
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
240
|
await this.makeIso(xorrisoCommand, scriptOnly);
|
|
@@ -246,7 +247,7 @@ class Ovary {
|
|
|
246
247
|
if (this.verbose) {
|
|
247
248
|
console.log('Overy: liveCreateStructure');
|
|
248
249
|
}
|
|
249
|
-
|
|
250
|
+
utils_js_2.default.warning(`Creating egg in ${this.settings.work_dir.path}`);
|
|
250
251
|
let cmd;
|
|
251
252
|
if (!fs_1.default.existsSync(this.settings.work_dir.path)) {
|
|
252
253
|
cmd = `mkdir -p ${this.settings.work_dir.path}`;
|
|
@@ -277,11 +278,11 @@ class Ovary {
|
|
|
277
278
|
* precedentemente in isolinux
|
|
278
279
|
*/
|
|
279
280
|
if (!fs_1.default.existsSync(this.settings.work_dir.pathIso)) {
|
|
280
|
-
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/boot/grub/${
|
|
281
|
+
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/boot/grub/${utils_js_2.default.machineUEFI()}`;
|
|
281
282
|
this.tryCatch(cmd);
|
|
282
283
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/efi/boot`;
|
|
283
284
|
this.tryCatch(cmd);
|
|
284
|
-
|
|
285
|
+
const liveBsseDir = 'live';
|
|
285
286
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/isolinux`;
|
|
286
287
|
this.tryCatch(cmd);
|
|
287
288
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}live`;
|
|
@@ -294,11 +295,11 @@ class Ovary {
|
|
|
294
295
|
*/
|
|
295
296
|
async tryCatch(cmd = '') {
|
|
296
297
|
try {
|
|
297
|
-
await (0,
|
|
298
|
+
await (0, utils_js_1.exec)(cmd, this.echo);
|
|
298
299
|
}
|
|
299
300
|
catch (error) {
|
|
300
301
|
console.log(`Error: ${error}`);
|
|
301
|
-
await
|
|
302
|
+
await utils_js_2.default.pressKeyToExit(cmd);
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
305
|
/**
|
|
@@ -319,15 +320,15 @@ class Ovary {
|
|
|
319
320
|
* new is_clone written just on live
|
|
320
321
|
*/
|
|
321
322
|
if (clone) {
|
|
322
|
-
await (0,
|
|
323
|
+
await (0, utils_js_1.exec)(`touch ${this.settings.work_dir.merged}/etc/penguins-eggs.d/is_clone`, this.echo);
|
|
323
324
|
}
|
|
324
325
|
if (cryptedclone) {
|
|
325
|
-
await (0,
|
|
326
|
+
await (0, utils_js_1.exec)(`touch ${this.settings.work_dir.merged}/etc/penguins-eggs.d/is_crypted_clone`, this.echo);
|
|
326
327
|
}
|
|
327
328
|
/**
|
|
328
329
|
* add epoptes server just on live
|
|
329
330
|
*/
|
|
330
|
-
if (
|
|
331
|
+
if (pacman_js_1.default.packageIsInstalled('epoptes')) {
|
|
331
332
|
const file = `${this.settings.work_dir.merged}/etc/default/epoptes-client`;
|
|
332
333
|
const text = `SERVER=${node_os_1.default.hostname}.local\n`;
|
|
333
334
|
fs_1.default.writeFileSync(file, text);
|
|
@@ -336,41 +337,41 @@ class Ovary {
|
|
|
336
337
|
// Aggiungo UMASK=0077 in /etc/initramfs-tools/conf.d/calamares-safe-initramfs.conf
|
|
337
338
|
const text = 'UMASK=0077\n';
|
|
338
339
|
const file = '/etc/initramfs-tools/conf.d/eggs-safe-initramfs.conf';
|
|
339
|
-
|
|
340
|
+
utils_js_2.default.write(file, text);
|
|
340
341
|
}
|
|
341
342
|
// Truncate logs, remove archived logs.
|
|
342
343
|
let cmd = `find ${this.settings.work_dir.merged}/var/log -name "*gz" -print0 | xargs -0r rm -f`;
|
|
343
|
-
await (0,
|
|
344
|
+
await (0, utils_js_1.exec)(cmd, this.echo);
|
|
344
345
|
cmd = `find ${this.settings.work_dir.merged}/var/log/ -type f -exec truncate -s 0 {} \\;`;
|
|
345
|
-
await (0,
|
|
346
|
+
await (0, utils_js_1.exec)(cmd, this.echo);
|
|
346
347
|
// Allow all fixed drives to be mounted with pmount
|
|
347
348
|
if (this.settings.config.pmount_fixed && fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/pmount.allow`)) {
|
|
348
349
|
// MX aggiunto /etc
|
|
349
|
-
await (0,
|
|
350
|
+
await (0, utils_js_1.exec)(`sed -i 's:#/dev/sd\[a-z\]:/dev/sd\[a-z\]:' ${this.settings.work_dir.merged}/etc/pmount.allow`, this.echo);
|
|
350
351
|
}
|
|
351
352
|
// Enable or disable password login through ssh for users (not root)
|
|
352
353
|
// Remove obsolete live-config file
|
|
353
354
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}lib/live/config/1161-openssh-server`)) {
|
|
354
|
-
await (0,
|
|
355
|
+
await (0, utils_js_1.exec)('rm -f "$work_dir"/myfs/lib/live/config/1161-openssh-server', this.echo);
|
|
355
356
|
}
|
|
356
357
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/ssh/sshd_config`)) {
|
|
357
|
-
await (0,
|
|
358
|
-
await (this.settings.config.ssh_pass
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
await (0, utils_js_1.exec)(`sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo);
|
|
359
|
+
await (this.settings.config.ssh_pass ?
|
|
360
|
+
(0, utils_js_1.exec)(`sed -i 's|.*PasswordAuthentication.*no|PasswordAuthentication yes|' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo) :
|
|
361
|
+
(0, utils_js_1.exec)(`sed -i 's|.*PasswordAuthentication.*yes|PasswordAuthentication no|' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo));
|
|
361
362
|
}
|
|
362
363
|
/**
|
|
363
364
|
* /etc/fstab should exist, even if it's empty,
|
|
364
365
|
* to prevent error messages at boot
|
|
365
366
|
*/
|
|
366
|
-
await (0,
|
|
367
|
-
await (0,
|
|
367
|
+
await (0, utils_js_1.exec)(`rm ${this.settings.work_dir.merged}/etc/fstab`, this.echo);
|
|
368
|
+
await (0, utils_js_1.exec)(`touch ${this.settings.work_dir.merged}/etc/fstab`, this.echo);
|
|
368
369
|
/**
|
|
369
370
|
* Remove crypttab if exists
|
|
370
371
|
* this is crucial for tpm systems.
|
|
371
372
|
*/
|
|
372
373
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/crypttab`)) {
|
|
373
|
-
await (0,
|
|
374
|
+
await (0, utils_js_1.exec)(`rm ${this.settings.work_dir.merged}/etc/crypttab`, this.echo);
|
|
374
375
|
// await exec(`touch ${this.settings.work_dir.merged}/etc/crypttab`, echo)
|
|
375
376
|
}
|
|
376
377
|
/**
|
|
@@ -380,9 +381,9 @@ class Ovary {
|
|
|
380
381
|
* set up a new unique ID.
|
|
381
382
|
*/
|
|
382
383
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/machine-id`)) {
|
|
383
|
-
await (0,
|
|
384
|
-
await (0,
|
|
385
|
-
|
|
384
|
+
await (0, utils_js_1.exec)(`rm ${this.settings.work_dir.merged}/etc/machine-id`, this.echo);
|
|
385
|
+
await (0, utils_js_1.exec)(`touch ${this.settings.work_dir.merged}/etc/machine-id`, this.echo);
|
|
386
|
+
utils_js_2.default.write(`${this.settings.work_dir.merged}/etc/machine-id`, ':');
|
|
386
387
|
}
|
|
387
388
|
/**
|
|
388
389
|
* LMDE4: utilizza UbuntuMono16.pf2
|
|
@@ -392,13 +393,13 @@ class Ovary {
|
|
|
392
393
|
/**
|
|
393
394
|
* cleaning /etc/resolv.conf
|
|
394
395
|
*/
|
|
395
|
-
|
|
396
|
+
const resolvFile = `${this.settings.work_dir.merged}/etc/resolv.conf`;
|
|
396
397
|
shelljs_1.default.rm(resolvFile);
|
|
397
398
|
/**
|
|
398
399
|
* Per tutte le distro systemd
|
|
399
400
|
*/
|
|
400
|
-
if (
|
|
401
|
-
const systemdctl = new
|
|
401
|
+
if (utils_js_2.default.isSystemd()) {
|
|
402
|
+
const systemdctl = new systemctl_js_1.default(this.verbose);
|
|
402
403
|
/**
|
|
403
404
|
* systemd-systemd-resolved
|
|
404
405
|
*/
|
|
@@ -429,10 +430,10 @@ class Ovary {
|
|
|
429
430
|
/**
|
|
430
431
|
* All systemd distros rm
|
|
431
432
|
*/
|
|
432
|
-
await (0,
|
|
433
|
-
await (0,
|
|
434
|
-
await (0,
|
|
435
|
-
await (0,
|
|
433
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/var/lib/wicd/configurations/*`, this.echo);
|
|
434
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/wicd/wireless-settings.conf`, this.echo);
|
|
435
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/NetworkManager/system-connections/*`, this.echo);
|
|
436
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/network/wifi/*`, this.echo);
|
|
436
437
|
/**
|
|
437
438
|
* removing from /etc/network/:
|
|
438
439
|
* if-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces.d
|
|
@@ -440,7 +441,7 @@ class Ovary {
|
|
|
440
441
|
const cleanDirs = ['if-down.d', 'if-post-down.d', 'if-pre-up.d', 'if-up.d', 'interfaces.d'];
|
|
441
442
|
let cleanDir = '';
|
|
442
443
|
for (cleanDir of cleanDirs) {
|
|
443
|
-
await (0,
|
|
444
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/network/${cleanDir}/wpasupplicant`, this.echo);
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
/**
|
|
@@ -449,68 +450,68 @@ class Ovary {
|
|
|
449
450
|
*/
|
|
450
451
|
if (this.familyId === 'debian') {
|
|
451
452
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/network/interfaces`)) {
|
|
452
|
-
await (0,
|
|
453
|
-
|
|
453
|
+
await (0, utils_js_1.exec)(`rm -f ${this.settings.work_dir.merged}/etc/network/interfaces`, this.echo);
|
|
454
|
+
utils_js_2.default.write(`${this.settings.work_dir.merged}/etc/network/interfaces`, 'auto lo\niface lo inet loopback');
|
|
454
455
|
}
|
|
455
456
|
/**
|
|
456
457
|
* add some basic files to /dev
|
|
457
458
|
*/
|
|
458
459
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/console`)) {
|
|
459
|
-
await (0,
|
|
460
|
+
await (0, utils_js_1.exec)(`mknod -m 622 ${this.settings.work_dir.merged}/dev/console c 5 1`, this.echo);
|
|
460
461
|
}
|
|
461
462
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/null`)) {
|
|
462
|
-
await (0,
|
|
463
|
+
await (0, utils_js_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/null c 1 3`, this.echo);
|
|
463
464
|
}
|
|
464
465
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/zero`)) {
|
|
465
|
-
await (0,
|
|
466
|
+
await (0, utils_js_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/zero c 1 5`, this.echo);
|
|
466
467
|
}
|
|
467
468
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/ptmx`)) {
|
|
468
|
-
await (0,
|
|
469
|
+
await (0, utils_js_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/ptmx c 5 2`, this.echo);
|
|
469
470
|
}
|
|
470
471
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/tty`)) {
|
|
471
|
-
await (0,
|
|
472
|
+
await (0, utils_js_1.exec)(`mknod -m 666 ${this.settings.work_dir.merged}/dev/tty c 5 0`, this.echo);
|
|
472
473
|
}
|
|
473
474
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/random`)) {
|
|
474
|
-
await (0,
|
|
475
|
+
await (0, utils_js_1.exec)(`mknod -m 444 ${this.settings.work_dir.merged}/dev/random c 1 8`, this.echo);
|
|
475
476
|
}
|
|
476
477
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/urandom`)) {
|
|
477
|
-
await (0,
|
|
478
|
+
await (0, utils_js_1.exec)(`mknod -m 444 ${this.settings.work_dir.merged}/dev/urandom c 1 9`, this.echo);
|
|
478
479
|
}
|
|
479
480
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/{console,ptmx,tty}`)) {
|
|
480
|
-
await (0,
|
|
481
|
+
await (0, utils_js_1.exec)(`chown -v root:tty ${this.settings.work_dir.merged}/dev/{console,ptmx,tty}`, this.echo);
|
|
481
482
|
}
|
|
482
483
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/fd`)) {
|
|
483
|
-
await (0,
|
|
484
|
+
await (0, utils_js_1.exec)(`ln -sv /proc/self/fd ${this.settings.work_dir.merged}/dev/fd`, this.echo);
|
|
484
485
|
}
|
|
485
486
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stdin`)) {
|
|
486
|
-
await (0,
|
|
487
|
+
await (0, utils_js_1.exec)(`ln -sv /proc/self/fd/0 ${this.settings.work_dir.merged}/dev/stdin`, this.echo);
|
|
487
488
|
}
|
|
488
489
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stdout`)) {
|
|
489
|
-
await (0,
|
|
490
|
+
await (0, utils_js_1.exec)(`ln -sv /proc/self/fd/1 ${this.settings.work_dir.merged}/dev/stdout`, this.echo);
|
|
490
491
|
}
|
|
491
492
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/stderr`)) {
|
|
492
|
-
await (0,
|
|
493
|
+
await (0, utils_js_1.exec)(`ln -sv /proc/self/fd/2 ${this.settings.work_dir.merged}/dev/stderr`, this.echo);
|
|
493
494
|
}
|
|
494
495
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/core`)) {
|
|
495
|
-
await (0,
|
|
496
|
+
await (0, utils_js_1.exec)(`ln -sv /proc/kcore ${this.settings.work_dir.merged}/dev/core`, this.echo);
|
|
496
497
|
}
|
|
497
498
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/shm`)) {
|
|
498
|
-
await (0,
|
|
499
|
+
await (0, utils_js_1.exec)(`mkdir -v ${this.settings.work_dir.merged}/dev/shm`, this.echo);
|
|
499
500
|
}
|
|
500
501
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/pts`)) {
|
|
501
|
-
await (0,
|
|
502
|
+
await (0, utils_js_1.exec)(`mkdir -v ${this.settings.work_dir.merged}/dev/pts`, this.echo);
|
|
502
503
|
}
|
|
503
504
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/dev/shm`)) {
|
|
504
|
-
await (0,
|
|
505
|
+
await (0, utils_js_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/dev/shm`, this.echo);
|
|
505
506
|
}
|
|
506
507
|
/**
|
|
507
508
|
* Assegno 1777 a /tmp
|
|
508
509
|
* creava problemi con MXLINUX
|
|
509
510
|
*/
|
|
510
511
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/tmp`)) {
|
|
511
|
-
await (0,
|
|
512
|
+
await (0, utils_js_1.exec)(`mkdir ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
512
513
|
}
|
|
513
|
-
await (0,
|
|
514
|
+
await (0, utils_js_1.exec)(`chmod 1777 ${this.settings.work_dir.merged}/tmp`, this.echo);
|
|
514
515
|
}
|
|
515
516
|
}
|
|
516
517
|
/**
|
|
@@ -521,17 +522,17 @@ class Ovary {
|
|
|
521
522
|
console.log('ovary: syslinux');
|
|
522
523
|
console.log('syslinux path: ' + this.settings.distro.syslinuxPath);
|
|
523
524
|
}
|
|
524
|
-
await (0,
|
|
525
|
-
await (0,
|
|
525
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.syslinuxPath}/vesamenu.c32 ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
526
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.syslinuxPath}/chain.c32 ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
526
527
|
/**
|
|
527
528
|
* per openSuse non sono riusciuto a determinare
|
|
528
529
|
* quale pacchetto installi:
|
|
529
530
|
* ldllinux.c43, libcom32 e libutil.c32
|
|
530
531
|
*/
|
|
531
532
|
if (this.familyId !== 'suse') {
|
|
532
|
-
await (0,
|
|
533
|
-
await (0,
|
|
534
|
-
await (0,
|
|
533
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.syslinuxPath}/ldlinux.c32 ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
534
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.syslinuxPath}/libcom32.c32 ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
535
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.syslinuxPath}/libutil.c32 ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
535
536
|
}
|
|
536
537
|
}
|
|
537
538
|
/**
|
|
@@ -544,7 +545,7 @@ class Ovary {
|
|
|
544
545
|
/**
|
|
545
546
|
* isolinux.bin
|
|
546
547
|
*/
|
|
547
|
-
await (0,
|
|
548
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.distro.isolinuxPath}/isolinux.bin ${this.settings.work_dir.pathIso}/isolinux/`, this.echo);
|
|
548
549
|
/**
|
|
549
550
|
* isolinux.theme.cfg
|
|
550
551
|
*/
|
|
@@ -554,7 +555,7 @@ class Ovary {
|
|
|
554
555
|
isolinuxThemeSrc = `${theme}/theme/livecd/isolinux.theme.cfg`;
|
|
555
556
|
}
|
|
556
557
|
if (!fs_1.default.existsSync(isolinuxThemeSrc)) {
|
|
557
|
-
|
|
558
|
+
utils_js_2.default.warning('Cannot find: ' + isolinuxThemeSrc);
|
|
558
559
|
process.exit();
|
|
559
560
|
}
|
|
560
561
|
fs_1.default.copyFileSync(isolinuxThemeSrc, isolinuxThemeDest);
|
|
@@ -562,9 +563,9 @@ class Ovary {
|
|
|
562
563
|
* isolinux.cfg from isolinux.template.cfg
|
|
563
564
|
*/
|
|
564
565
|
const isolinuxDest = this.settings.work_dir.pathIso + 'isolinux/isolinux.cfg';
|
|
565
|
-
|
|
566
|
+
const isolinuxTemplate = node_path_1.default.resolve(__dirname, '../../addons/templates/isolinux.template');
|
|
566
567
|
if (!fs_1.default.existsSync(isolinuxTemplate)) {
|
|
567
|
-
|
|
568
|
+
utils_js_2.default.warning('Cannot find: ' + isolinuxTemplate);
|
|
568
569
|
process.exit();
|
|
569
570
|
}
|
|
570
571
|
/**
|
|
@@ -572,7 +573,7 @@ class Ovary {
|
|
|
572
573
|
*/
|
|
573
574
|
let kernel_parameters = `boot=live components locales=${process.env.LANG}`;
|
|
574
575
|
if (this.familyId === 'archlinux') {
|
|
575
|
-
|
|
576
|
+
const volid = utils_js_2.default.getVolid(this.settings.remix.name);
|
|
576
577
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
577
578
|
kernel_parameters += ` misobasedir=manjaro misolabel=${volid}`;
|
|
578
579
|
}
|
|
@@ -583,7 +584,7 @@ class Ovary {
|
|
|
583
584
|
const template = fs_1.default.readFileSync(isolinuxTemplate, 'utf8');
|
|
584
585
|
const view = {
|
|
585
586
|
fullname: this.settings.remix.fullname.toUpperCase(),
|
|
586
|
-
kernel:
|
|
587
|
+
kernel: utils_js_2.default.kernelVersion(),
|
|
587
588
|
vmlinuz: `/live${this.settings.vmlinuz}`,
|
|
588
589
|
initrdImg: `/live${this.settings.initrdImg}`,
|
|
589
590
|
kernel_parameters: kernel_parameters,
|
|
@@ -598,7 +599,7 @@ class Ovary {
|
|
|
598
599
|
splashSrc = node_path_1.default.resolve(`${theme}/theme/livecd/splash.png`);
|
|
599
600
|
}
|
|
600
601
|
if (!fs_1.default.existsSync(splashSrc)) {
|
|
601
|
-
|
|
602
|
+
utils_js_2.default.warning('Cannot find: ' + splashSrc);
|
|
602
603
|
process.exit();
|
|
603
604
|
}
|
|
604
605
|
fs_1.default.copyFileSync(splashSrc, splashDest);
|
|
@@ -612,15 +613,15 @@ class Ovary {
|
|
|
612
613
|
}
|
|
613
614
|
let lackVmlinuzImage = false;
|
|
614
615
|
if (fs_1.default.existsSync(this.settings.kernel_image)) {
|
|
615
|
-
await (0,
|
|
616
|
+
await (0, utils_js_1.exec)(`cp ${this.settings.kernel_image} ${this.settings.work_dir.pathIso}/live/`, this.echo);
|
|
616
617
|
}
|
|
617
618
|
else {
|
|
618
|
-
|
|
619
|
+
utils_js_2.default.error(`Cannot find ${this.settings.kernel_image}`);
|
|
619
620
|
lackVmlinuzImage = true;
|
|
620
621
|
}
|
|
621
622
|
if (lackVmlinuzImage) {
|
|
622
|
-
|
|
623
|
-
|
|
623
|
+
utils_js_2.default.warning('Try to edit /etc/penguins-eggs.d/eggs.yaml and check for');
|
|
624
|
+
utils_js_2.default.warning(`vmlinuz: ${this.settings.kernel_image}`);
|
|
624
625
|
process.exit(1);
|
|
625
626
|
}
|
|
626
627
|
}
|
|
@@ -628,14 +629,14 @@ class Ovary {
|
|
|
628
629
|
* necessita di echoYes
|
|
629
630
|
*/
|
|
630
631
|
async initrdCreate() {
|
|
631
|
-
let initrdImg =
|
|
632
|
-
initrdImg = initrdImg.
|
|
633
|
-
|
|
632
|
+
let initrdImg = utils_js_2.default.initrdImg();
|
|
633
|
+
initrdImg = initrdImg.slice(Math.max(0, initrdImg.lastIndexOf('/') + 1));
|
|
634
|
+
utils_js_2.default.warning(`Creating ${initrdImg} in ${this.settings.work_dir.pathIso}/live/`);
|
|
634
635
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
635
|
-
await (0,
|
|
636
|
+
await (0, utils_js_1.exec)(`mkinitcpio -c ${node_path_1.default.resolve(__dirname, '../../mkinitcpio/manjaro/mkinitcpio-produce.conf')} -g ${this.settings.work_dir.pathIso}/live/${initrdImg}`, utils_js_2.default.setEcho(true));
|
|
636
637
|
}
|
|
637
638
|
else if (this.settings.distro.distroId === 'Arch' || this.settings.distro.distroId === 'RebornOS') {
|
|
638
|
-
await (0,
|
|
639
|
+
await (0, utils_js_1.exec)(`mkinitcpio -c ${node_path_1.default.resolve(__dirname, '../../mkinitcpio/archlinux/mkinitcpio-produce.conf')} -g ${this.settings.work_dir.pathIso}/live/${initrdImg}`, utils_js_2.default.setEcho(true));
|
|
639
640
|
}
|
|
640
641
|
}
|
|
641
642
|
/**
|
|
@@ -644,17 +645,17 @@ class Ovary {
|
|
|
644
645
|
*/
|
|
645
646
|
async initrdCopy(verbose = false) {
|
|
646
647
|
let isCrypted = false;
|
|
647
|
-
|
|
648
|
-
if (fs_1.default.existsSync(
|
|
648
|
+
utils_js_2.default.warning('initrdCreate');
|
|
649
|
+
if (fs_1.default.existsSync('/etc/crypttab')) {
|
|
649
650
|
isCrypted = true;
|
|
650
|
-
await (0,
|
|
651
|
+
await (0, utils_js_1.exec)('mv /etc/crypttab /etc/crypttab.saved', this.echo);
|
|
651
652
|
}
|
|
652
|
-
await (0,
|
|
653
|
+
await (0, utils_js_1.exec)(`mkinitramfs -o ${this.settings.work_dir.pathIso}/live/initrd.img-$(uname -r) ${this.toNull}`, this.echo);
|
|
653
654
|
if (isCrypted) {
|
|
654
|
-
await (0,
|
|
655
|
+
await (0, utils_js_1.exec)('mv /etc/crypttab.saved /etc/crypttab', this.echo);
|
|
655
656
|
}
|
|
656
657
|
/*
|
|
657
|
-
|
|
658
|
+
|
|
658
659
|
Utils.warning(`initrdCopy`)
|
|
659
660
|
if (this.verbose) {
|
|
660
661
|
console.log('ovary: initrdCopy')
|
|
@@ -666,7 +667,7 @@ class Ovary {
|
|
|
666
667
|
Utils.error(`Cannot find ${this.settings.initrdImg}`)
|
|
667
668
|
lackInitrdImage = true
|
|
668
669
|
}
|
|
669
|
-
|
|
670
|
+
|
|
670
671
|
if (lackInitrdImage) {
|
|
671
672
|
Utils.warning('Try to edit /etc/penguins-eggs.d/eggs.yaml and check for')
|
|
672
673
|
Utils.warning(`initrd_img: ${this.settings.initrd_image}`)
|
|
@@ -684,14 +685,14 @@ class Ovary {
|
|
|
684
685
|
/**
|
|
685
686
|
* exclude all the accurence of cryptdisks in rc0.d, etc
|
|
686
687
|
*/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
688
|
+
const fexcludes = [
|
|
689
|
+
'/boot/efi/EFI',
|
|
690
|
+
'/etc/fstab',
|
|
691
|
+
'/etc/mtab',
|
|
692
|
+
'/etc/udev/rules.d/70-persistent-cd.rules',
|
|
693
|
+
'/etc/udev/rules.d/70-persistent-net.rules',
|
|
693
694
|
];
|
|
694
|
-
for (
|
|
695
|
+
for (const i in fexcludes) {
|
|
695
696
|
this.addRemoveExclusion(true, fexcludes[i]);
|
|
696
697
|
}
|
|
697
698
|
/**
|
|
@@ -710,7 +711,7 @@ class Ovary {
|
|
|
710
711
|
}
|
|
711
712
|
}
|
|
712
713
|
if (shelljs_1.default.exec('/usr/bin/test -L /etc/localtime', { silent: true }) && shelljs_1.default.exec('cat /etc/timezone', { silent: true }) !== 'Europe/Rome') {
|
|
713
|
-
//this.addRemoveExclusion(true, '/etc/localtime')
|
|
714
|
+
// this.addRemoveExclusion(true, '/etc/localtime')
|
|
714
715
|
}
|
|
715
716
|
this.addRemoveExclusion(true, this.settings.config.snapshot_dir /* .absolutePath() */);
|
|
716
717
|
if (fs_1.default.existsSync(`${this.settings.work_dir.pathIso}/live/filesystem.squashfs`)) {
|
|
@@ -720,10 +721,10 @@ class Ovary {
|
|
|
720
721
|
// let cmd = `mksquashfs ${this.settings.work_dir.merged} ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${compression} -wildcards -ef ${this.settings.config.snapshot_excludes} ${this.settings.session_excludes}`
|
|
721
722
|
let cmd = `mksquashfs ${this.settings.work_dir.merged} ${this.settings.work_dir.pathIso}live/filesystem.squashfs ${compression} -wildcards -ef ${this.settings.config.snapshot_excludes} ${this.settings.session_excludes}`;
|
|
722
723
|
cmd = cmd.replace(/\s\s+/g, ' ');
|
|
723
|
-
|
|
724
|
+
utils_js_2.default.writeX(`${this.settings.work_dir.path}mksquashfs`, cmd);
|
|
724
725
|
if (!scriptOnly) {
|
|
725
|
-
|
|
726
|
-
await (0,
|
|
726
|
+
utils_js_2.default.warning('squashing filesystem: ' + compression);
|
|
727
|
+
await (0, utils_js_1.exec)(cmd, utils_js_2.default.setEcho(true));
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
730
|
/**
|
|
@@ -767,7 +768,7 @@ class Ovary {
|
|
|
767
768
|
'run',
|
|
768
769
|
'sys',
|
|
769
770
|
'swapfile',
|
|
770
|
-
'tmp'
|
|
771
|
+
'tmp',
|
|
771
772
|
];
|
|
772
773
|
if (!this.clone) {
|
|
773
774
|
nomergedDirs.push('home');
|
|
@@ -805,10 +806,10 @@ class Ovary {
|
|
|
805
806
|
let cmd = '';
|
|
806
807
|
const cmds = [];
|
|
807
808
|
cmds.push('# NOTE: cdrom, dev, live, media, mnt, proc, run, sys and tmp', `# need just a mkdir in ${this.settings.work_dir.merged}`);
|
|
808
|
-
cmds.push(`# host: ${node_os_1.default.hostname()} user: ${await
|
|
809
|
+
cmds.push(`# host: ${node_os_1.default.hostname()} user: ${await utils_js_2.default.getPrimaryUser()}\n`);
|
|
809
810
|
for (const dir of dirs) {
|
|
810
811
|
cmds.push(startLine);
|
|
811
|
-
if (
|
|
812
|
+
if (n8_js_1.default.isDirectory(dir)) {
|
|
812
813
|
if (dir !== 'lost+found') {
|
|
813
814
|
cmd = `# /${dir} is a directory`;
|
|
814
815
|
if (this.mergedAndOvelay(dir)) {
|
|
@@ -842,7 +843,7 @@ class Ovary {
|
|
|
842
843
|
}
|
|
843
844
|
}
|
|
844
845
|
}
|
|
845
|
-
else if (
|
|
846
|
+
else if (n8_js_1.default.isFile(dir)) {
|
|
846
847
|
cmds.push(`# /${dir} is just a file`, titleLine);
|
|
847
848
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
848
849
|
cmds.push(await rexec(`cp /${dir} ${this.settings.work_dir.merged}`, this.verbose));
|
|
@@ -851,7 +852,7 @@ class Ovary {
|
|
|
851
852
|
cmds.push('# file exist... skip');
|
|
852
853
|
}
|
|
853
854
|
}
|
|
854
|
-
else if (
|
|
855
|
+
else if (n8_js_1.default.isSymbolicLink(dir)) {
|
|
855
856
|
lnkDest = fs_1.default.readlinkSync(`/${dir}`);
|
|
856
857
|
cmds.push(`# /${dir} is a symbolic link to /${lnkDest} in the system`, '# we need just to recreate it', `# ln -s ${this.settings.work_dir.merged}/${lnkDest} ${this.settings.work_dir.merged}/${lnkDest}`, "# but we don't know if the destination exist, and I'm too lazy today. So, for now: ", titleLine);
|
|
857
858
|
if (!fs_1.default.existsSync(`${this.settings.work_dir.merged}/${dir}`)) {
|
|
@@ -868,7 +869,7 @@ class Ovary {
|
|
|
868
869
|
}
|
|
869
870
|
cmds.push(endLine);
|
|
870
871
|
}
|
|
871
|
-
|
|
872
|
+
utils_js_2.default.writeXs(`${this.settings.work_dir.path}bind`, cmds);
|
|
872
873
|
}
|
|
873
874
|
/**
|
|
874
875
|
* ubind del fs live
|
|
@@ -880,16 +881,16 @@ class Ovary {
|
|
|
880
881
|
}
|
|
881
882
|
const cmds = [];
|
|
882
883
|
cmds.push('# NOTE: home, cdrom, dev, live, media, mnt, proc, run, sys and tmp', `# need just to be removed in ${this.settings.work_dir.merged}`);
|
|
883
|
-
cmds.push(`# host: ${node_os_1.default.hostname()} user: ${await
|
|
884
|
+
cmds.push(`# host: ${node_os_1.default.hostname()} user: ${await utils_js_2.default.getPrimaryUser()}\n`);
|
|
884
885
|
// await exec(`/usr/bin/pkill mksquashfs; /usr/bin/pkill md5sum`, {echo: true})
|
|
885
886
|
if (fs_1.default.existsSync(this.settings.work_dir.merged)) {
|
|
886
887
|
const bindDirs = fs_1.default.readdirSync(this.settings.work_dir.merged, {
|
|
887
|
-
withFileTypes: true
|
|
888
|
+
withFileTypes: true,
|
|
888
889
|
});
|
|
889
890
|
for (const dir of bindDirs) {
|
|
890
|
-
const dirname =
|
|
891
|
+
const dirname = n8_js_1.default.dirent2string(dir);
|
|
891
892
|
cmds.push('#############################################################');
|
|
892
|
-
if (
|
|
893
|
+
if (n8_js_1.default.isDirectory(dirname)) {
|
|
893
894
|
cmds.push(`\n# directory: ${dirname}`);
|
|
894
895
|
if (this.mergedAndOvelay(dirname)) {
|
|
895
896
|
cmds.push(`\n# ${dirname} has overlay`, `\n# First, umount it from ${this.settings.work_dir.path}`);
|
|
@@ -903,16 +904,16 @@ class Ovary {
|
|
|
903
904
|
/**
|
|
904
905
|
* We can't remove the nest!!!
|
|
905
906
|
*/
|
|
906
|
-
|
|
907
|
+
const nest = this.settings.work_dir.path.split('/');
|
|
907
908
|
if (dirname !== nest[1]) { // We can't remove first level nest
|
|
908
909
|
cmds.push(await rexec(`rm ${this.settings.work_dir.merged}/${dirname} -rf`, this.verbose));
|
|
909
910
|
}
|
|
910
911
|
}
|
|
911
|
-
else if (
|
|
912
|
+
else if (n8_js_1.default.isFile(dirname)) {
|
|
912
913
|
cmds.push(`\n# ${dirname} = file`);
|
|
913
914
|
cmds.push(await rexec(`rm ${this.settings.work_dir.merged}/${dirname}`, this.verbose));
|
|
914
915
|
}
|
|
915
|
-
else if (
|
|
916
|
+
else if (n8_js_1.default.isSymbolicLink(dirname)) {
|
|
916
917
|
cmds.push(`\n# ${dirname} = symbolicLink`);
|
|
917
918
|
cmds.push(await rexec(`rm ${this.settings.work_dir.merged}/${dirname}`, this.verbose));
|
|
918
919
|
}
|
|
@@ -921,7 +922,7 @@ class Ovary {
|
|
|
921
922
|
if (this.clone) {
|
|
922
923
|
cmds.push(await rexec(`umount ${this.settings.work_dir.path}/filesystem.squashfs/home`, this.verbose));
|
|
923
924
|
}
|
|
924
|
-
|
|
925
|
+
utils_js_2.default.writeXs(`${this.settings.work_dir.path}ubind`, cmds);
|
|
925
926
|
}
|
|
926
927
|
/**
|
|
927
928
|
* bind dei virtual file system
|
|
@@ -929,7 +930,7 @@ class Ovary {
|
|
|
929
930
|
async bindVfs() {
|
|
930
931
|
const cmds = [];
|
|
931
932
|
cmds.push(`mount -o bind /dev ${this.settings.work_dir.merged}/dev`, `mount -o bind /dev/pts ${this.settings.work_dir.merged}/dev/pts`, `mount -o bind /proc ${this.settings.work_dir.merged}/proc`, `mount -o bind /sys ${this.settings.work_dir.merged}/sys`, `mount -o bind /run ${this.settings.work_dir.merged}/run`);
|
|
932
|
-
|
|
933
|
+
utils_js_2.default.writeXs(`${this.settings.work_dir.path}bindvfs`, cmds);
|
|
933
934
|
}
|
|
934
935
|
/**
|
|
935
936
|
*
|
|
@@ -938,7 +939,7 @@ class Ovary {
|
|
|
938
939
|
async ubindVfs() {
|
|
939
940
|
const cmds = [];
|
|
940
941
|
cmds.push(`umount ${this.settings.work_dir.merged}/dev/pts`, `umount ${this.settings.work_dir.merged}/dev`, `umount ${this.settings.work_dir.merged}/proc`, `umount ${this.settings.work_dir.merged}/run`, `umount ${this.settings.work_dir.merged}/sys`);
|
|
941
|
-
|
|
942
|
+
utils_js_2.default.writeXs(`${this.settings.work_dir.path}ubindvfs`, cmds);
|
|
942
943
|
}
|
|
943
944
|
/**
|
|
944
945
|
*
|
|
@@ -950,10 +951,10 @@ class Ovary {
|
|
|
950
951
|
*/
|
|
951
952
|
const cmds = [];
|
|
952
953
|
const cmd = `chroot ${this.settings.work_dir.merged} getent passwd {1000..60000} |awk -F: '{print $1}'`;
|
|
953
|
-
const result = await (0,
|
|
954
|
+
const result = await (0, utils_js_1.exec)(cmd, {
|
|
954
955
|
echo: this.verbose,
|
|
955
956
|
ignore: false,
|
|
956
|
-
capture: true
|
|
957
|
+
capture: true,
|
|
957
958
|
});
|
|
958
959
|
const users = result.data.split('\n');
|
|
959
960
|
for (let i = 0; i < users.length - 1; i++) {
|
|
@@ -1021,35 +1022,33 @@ class Ovary {
|
|
|
1021
1022
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-eggs.desktop'), '/usr/share/applications/');
|
|
1022
1023
|
let installerUrl = 'install-debian.desktop';
|
|
1023
1024
|
let installerIcon = 'install-debian';
|
|
1024
|
-
if (
|
|
1025
|
+
if (pacman_js_1.default.packageIsInstalled('calamares')) {
|
|
1025
1026
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/applications/install-debian.desktop`), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1026
1027
|
}
|
|
1028
|
+
else if (pacman_js_1.default.packageIsInstalled('live-installer')) {
|
|
1029
|
+
// carico la policy per live-installer
|
|
1030
|
+
const policySource = node_path_1.default.resolve(__dirname, '../../assets/live-installer/com.github.pieroproietti.penguins-eggs.policy');
|
|
1031
|
+
const policyDest = '/usr/share/polkit-1/actions/com.github.pieroproietti.penguins-eggs.policy';
|
|
1032
|
+
shelljs_1.default.cp(policySource, policyDest);
|
|
1033
|
+
await (0, utils_js_1.exec)(`sed -i 's/auth_admin/yes/' ${policyDest}`);
|
|
1034
|
+
// carico in filesystem.live packages-remove
|
|
1035
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/live-installer/filesystem.packages-remove'), `${this.settings.work_dir.pathIso}/live/`);
|
|
1036
|
+
shelljs_1.default.touch(`${this.settings.work_dir.pathIso}/live/filesystem.packages`);
|
|
1037
|
+
installerUrl = 'penguins-live-installer.desktop';
|
|
1038
|
+
installerIcon = 'utilities-terminal';
|
|
1039
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-live-installer.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1040
|
+
}
|
|
1027
1041
|
else {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const policyDest = '/usr/share/polkit-1/actions/com.github.pieroproietti.penguins-eggs.policy';
|
|
1032
|
-
shelljs_1.default.cp(policySource, policyDest);
|
|
1033
|
-
await (0, utils_1.exec)(`sed -i 's/auth_admin/yes/' ${policyDest}`);
|
|
1034
|
-
// carico in filesystem.live packages-remove
|
|
1035
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/live-installer/filesystem.packages-remove'), `${this.settings.work_dir.pathIso}/live/`);
|
|
1036
|
-
shelljs_1.default.touch(`${this.settings.work_dir.pathIso}/live/filesystem.packages`);
|
|
1037
|
-
installerUrl = 'penguins-live-installer.desktop';
|
|
1038
|
-
installerIcon = 'utilities-terminal';
|
|
1039
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-live-installer.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1040
|
-
}
|
|
1041
|
-
else {
|
|
1042
|
-
installerUrl = 'penguins-krill.desktop';
|
|
1043
|
-
installerIcon = 'utilities-terminal';
|
|
1044
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-krill.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1045
|
-
}
|
|
1042
|
+
installerUrl = 'penguins-krill.desktop';
|
|
1043
|
+
installerIcon = 'utilities-terminal';
|
|
1044
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-krill.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1046
1045
|
}
|
|
1047
1046
|
/**
|
|
1048
1047
|
* flags
|
|
1049
1048
|
*/
|
|
1050
1049
|
// adapt
|
|
1051
1050
|
if (myAddons.adapt) {
|
|
1052
|
-
const dirAddon = node_path_1.default.resolve(__dirname,
|
|
1051
|
+
const dirAddon = node_path_1.default.resolve(__dirname, '../../addons/eggs/adapt/');
|
|
1053
1052
|
shelljs_1.default.cp(`${dirAddon}/applications/eggs-adapt.desktop`, `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1054
1053
|
shelljs_1.default.cp(`${dirAddon}/bin/adapt`, `${this.settings.work_dir.merged}/usr/bin/`);
|
|
1055
1054
|
shelljs_1.default.chmod('+x', `${this.settings.work_dir.merged}/usr/bin/adapt`);
|
|
@@ -1068,7 +1067,7 @@ class Ovary {
|
|
|
1068
1067
|
/**
|
|
1069
1068
|
* create service pve-live
|
|
1070
1069
|
*/
|
|
1071
|
-
const pve = new
|
|
1070
|
+
const pve = new pve_live_js_1.default();
|
|
1072
1071
|
pve.create(this.settings.work_dir.merged);
|
|
1073
1072
|
/**
|
|
1074
1073
|
* adding a desktop link for pve
|
|
@@ -1091,13 +1090,13 @@ class Ovary {
|
|
|
1091
1090
|
// Creo l'avviatore xdg DEVE essere add-penguins-links.desktop
|
|
1092
1091
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-links-add.desktop'), dirAutostart);
|
|
1093
1092
|
// create /usr/bin/penguins-links-add.sh
|
|
1094
|
-
const script =
|
|
1093
|
+
const script = '/usr/bin/penguins-links-add.sh';
|
|
1095
1094
|
let text = '';
|
|
1096
1095
|
text += '#!/bin/sh\n';
|
|
1097
1096
|
text += 'DESKTOP=$(xdg-user-dir DESKTOP)\n';
|
|
1098
1097
|
text += 'test -d "$DESKTOP" && mkdir -p "$DESKTOP"\n';
|
|
1099
1098
|
text += `cp /usr/share/applications/${installerUrl} "$DESKTOP"\n`;
|
|
1100
|
-
if (
|
|
1099
|
+
if (pacman_js_1.default.packageIsInstalled('lxde-core')) {
|
|
1101
1100
|
text += this.lxdeLink('penguins-eggs.desktop', "penguin's eggs", 'eggs');
|
|
1102
1101
|
if (myAddons.adapt)
|
|
1103
1102
|
text += this.lxdeLink('eggs-adapt.desktop', 'Adapt', 'video-display');
|
|
@@ -1107,34 +1106,34 @@ class Ovary {
|
|
|
1107
1106
|
text += this.lxdeLink('eggs-rsupport.desktop', 'Remote assistance', 'remote-assistance');
|
|
1108
1107
|
}
|
|
1109
1108
|
else {
|
|
1110
|
-
text +=
|
|
1109
|
+
text += 'cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n';
|
|
1111
1110
|
if (myAddons.adapt)
|
|
1112
|
-
text +=
|
|
1111
|
+
text += 'cp /usr/share/applications/eggs-adapt.desktop "$DESKTOP"\n';
|
|
1113
1112
|
if (myAddons.pve)
|
|
1114
|
-
text +=
|
|
1113
|
+
text += 'cp /usr/share/applications/eggs-pve.desktop "$DESKTOP"\n';
|
|
1115
1114
|
if (myAddons.rsupport)
|
|
1116
|
-
text +=
|
|
1115
|
+
text += 'cp /usr/share/applications/eggs-rsupport.desktop "$DESKTOP"\n';
|
|
1117
1116
|
}
|
|
1118
1117
|
/**
|
|
1119
1118
|
* enable desktop links
|
|
1120
1119
|
*/
|
|
1121
|
-
if (
|
|
1120
|
+
if (pacman_js_1.default.packageIsInstalled('gdm3') || pacman_js_1.default.packageIsInstalled('gdm')) {
|
|
1122
1121
|
// GNOME
|
|
1123
|
-
text +=
|
|
1124
|
-
text +=
|
|
1125
|
-
text +=
|
|
1122
|
+
text += 'test -f /usr/share/applications/penguins-eggs.desktop && cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n';
|
|
1123
|
+
text += 'test -f "$DESKTOP"/penguins-eggs.desktop && chmod a+x "$DESKTOP"/penguins-eggs.desktop\n';
|
|
1124
|
+
text += 'test -f "$DESKTOP"/penguins-eggs.desktop && gio set "$DESKTOP"/penguins-eggs.desktop metadata::trusted true\n';
|
|
1126
1125
|
text += `test -f /usr/share/applications/${installerUrl} && cp /usr/share/applications/${installerUrl} "$DESKTOP"\n`;
|
|
1127
1126
|
text += `test -f "$DESKTOP"/${installerUrl} && chmod a+x "$DESKTOP"/${installerUrl}\n`;
|
|
1128
1127
|
text += `test -f "$DESKTOP"/${installerUrl} && gio set "$DESKTOP"/${installerUrl} metadata::trusted true\n`;
|
|
1129
1128
|
}
|
|
1130
1129
|
else {
|
|
1131
1130
|
// OTHERS: CINNAMON/KDE/ETC
|
|
1132
|
-
text +=
|
|
1131
|
+
text += 'chmod +x "$DESKTOP"/*.desktop';
|
|
1133
1132
|
}
|
|
1134
1133
|
fs_1.default.writeFileSync(script, text, 'utf8');
|
|
1135
|
-
await (0,
|
|
1134
|
+
await (0, utils_js_1.exec)(`chmod a+x ${script}`, this.echo);
|
|
1136
1135
|
}
|
|
1137
|
-
await
|
|
1136
|
+
await xdg_js_1.default.autologin(await utils_js_2.default.getPrimaryUser(), this.settings.config.user_opt, this.settings.work_dir.merged);
|
|
1138
1137
|
}
|
|
1139
1138
|
/**
|
|
1140
1139
|
* Creazione link desktop per lxde
|
|
@@ -1186,21 +1185,21 @@ class Ovary {
|
|
|
1186
1185
|
/**
|
|
1187
1186
|
* il pachetto grub/grub2 DEVE essere presente
|
|
1188
1187
|
*/
|
|
1189
|
-
const grubName =
|
|
1188
|
+
const grubName = pacman_js_1.default.whichGrubIsInstalled();
|
|
1190
1189
|
if (grubName === '') {
|
|
1191
|
-
|
|
1190
|
+
utils_js_2.default.error('Something went wrong! Cannot find grub! Run lsb_release -a and check the result');
|
|
1192
1191
|
process.exit(1);
|
|
1193
1192
|
}
|
|
1194
1193
|
/**
|
|
1195
1194
|
* Creo o cancello e creo: memdiskDir
|
|
1196
1195
|
*/
|
|
1197
1196
|
if (fs_1.default.existsSync(memdiskDir)) {
|
|
1198
|
-
await (0,
|
|
1197
|
+
await (0, utils_js_1.exec)(`rm ${memdiskDir} -rf`, this.echo);
|
|
1199
1198
|
}
|
|
1200
|
-
|
|
1201
|
-
await (0,
|
|
1202
|
-
await (0,
|
|
1203
|
-
await (0,
|
|
1199
|
+
utils_js_2.default.warning('creating memdiskDir: ' + memdiskDir);
|
|
1200
|
+
await (0, utils_js_1.exec)(`mkdir ${memdiskDir}`);
|
|
1201
|
+
await (0, utils_js_1.exec)(`mkdir ${memdiskDir}/boot`, this.echo);
|
|
1202
|
+
await (0, utils_js_1.exec)(`mkdir ${memdiskDir}/boot/grub`, this.echo);
|
|
1204
1203
|
/**
|
|
1205
1204
|
* for initial grub.cfg in memdisk
|
|
1206
1205
|
*/
|
|
@@ -1208,22 +1207,22 @@ class Ovary {
|
|
|
1208
1207
|
let text = '';
|
|
1209
1208
|
text += 'search --file --set=root /.disk/info\n';
|
|
1210
1209
|
text += 'set prefix=($root)/boot/grub\n';
|
|
1211
|
-
text += `source $prefix/${
|
|
1212
|
-
|
|
1210
|
+
text += `source $prefix/${utils_js_2.default.machineUEFI()}/grub.cfg\n`;
|
|
1211
|
+
utils_js_2.default.write(grubCfg, text);
|
|
1213
1212
|
// #################################
|
|
1214
1213
|
/**
|
|
1215
1214
|
* start with empty efiWorkDir
|
|
1216
1215
|
*/
|
|
1217
1216
|
if (fs_1.default.existsSync(efiWorkDir)) {
|
|
1218
|
-
await (0,
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
await (0,
|
|
1222
|
-
await (0,
|
|
1223
|
-
await (0,
|
|
1224
|
-
await (0,
|
|
1225
|
-
await (0,
|
|
1226
|
-
await (0,
|
|
1217
|
+
await (0, utils_js_1.exec)(`rm ${efiWorkDir} -rf`, this.echo);
|
|
1218
|
+
}
|
|
1219
|
+
utils_js_2.default.warning('creating efiWordDir: ' + efiWorkDir);
|
|
1220
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}`, this.echo);
|
|
1221
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/boot`, this.echo);
|
|
1222
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/boot/grub`, this.echo);
|
|
1223
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/boot/grub/${utils_js_2.default.machineUEFI()}`, this.echo);
|
|
1224
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/efi`, this.echo);
|
|
1225
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/efi/boot`, this.echo);
|
|
1227
1226
|
/**
|
|
1228
1227
|
* copy splash to efiWorkDir
|
|
1229
1228
|
*/
|
|
@@ -1233,10 +1232,10 @@ class Ovary {
|
|
|
1233
1232
|
splashSrc = `${theme}/theme/livecd/splash.png`;
|
|
1234
1233
|
}
|
|
1235
1234
|
if (!fs_1.default.existsSync(splashSrc)) {
|
|
1236
|
-
|
|
1235
|
+
utils_js_2.default.warning('Cannot find: ' + splashSrc);
|
|
1237
1236
|
process.exit();
|
|
1238
1237
|
}
|
|
1239
|
-
await (0,
|
|
1238
|
+
await (0, utils_js_1.exec)(`cp ${splashSrc} ${splashDest}`, this.echo);
|
|
1240
1239
|
/**
|
|
1241
1240
|
* copy theme
|
|
1242
1241
|
*/
|
|
@@ -1246,20 +1245,20 @@ class Ovary {
|
|
|
1246
1245
|
themeSrc = `${theme}/theme/livecd/grub.theme.cfg`;
|
|
1247
1246
|
}
|
|
1248
1247
|
if (!fs_1.default.existsSync(themeSrc)) {
|
|
1249
|
-
|
|
1248
|
+
utils_js_2.default.warning('Cannot find: ' + themeSrc);
|
|
1250
1249
|
process.exit();
|
|
1251
1250
|
}
|
|
1252
|
-
await (0,
|
|
1251
|
+
await (0, utils_js_1.exec)(`cp ${themeSrc} ${themeDest}`, this.echo);
|
|
1253
1252
|
/**
|
|
1254
1253
|
* second grub.cfg file in efiWork
|
|
1255
1254
|
*/
|
|
1256
1255
|
// for i in $(ls /usr/lib/grub/x86_64-efi |grep part_|grep \.mod|sed 's/.mod//'); do echo "insmod $i" >> boot/grub/x86_64-efi/grub.cfg; done
|
|
1257
|
-
let cmd = `for i in $(ls /usr/lib/grub/${
|
|
1258
|
-
await (0,
|
|
1256
|
+
let cmd = `for i in $(ls /usr/lib/grub/${utils_js_2.default.machineUEFI()}|grep part_|grep \.mod|sed 's/.mod//'); do echo "insmod $i" >> ${efiWorkDir}boot/grub/${utils_js_2.default.machineUEFI()}/grub.cfg; done`;
|
|
1257
|
+
await (0, utils_js_1.exec)(cmd, this.echo);
|
|
1259
1258
|
// for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm ; do echo "insmod $i" >> boot/grub/x86_64-efi/grub.cfg ; done
|
|
1260
|
-
cmd = `for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm ; do echo "insmod $i" >> ${efiWorkDir}/boot/grub/${
|
|
1261
|
-
await (0,
|
|
1262
|
-
await (0,
|
|
1259
|
+
cmd = `for i in efi_gop efi_uga ieee1275_fb vbe vga video_bochs video_cirrus jpeg png gfxterm ; do echo "insmod $i" >> ${efiWorkDir}/boot/grub/${utils_js_2.default.machineUEFI()}/grub.cfg ; done`;
|
|
1260
|
+
await (0, utils_js_1.exec)(cmd, this.echo);
|
|
1261
|
+
await (0, utils_js_1.exec)(`echo "source /boot/grub/grub.cfg" >> ${efiWorkDir}/boot/grub/${utils_js_2.default.machineUEFI()}/grub.cfg`, this.echo);
|
|
1263
1262
|
/**
|
|
1264
1263
|
* andiamo in memdiskDir
|
|
1265
1264
|
*/
|
|
@@ -1270,7 +1269,7 @@ class Ovary {
|
|
|
1270
1269
|
*/
|
|
1271
1270
|
const currentDir = process.cwd();
|
|
1272
1271
|
process.chdir(memdiskDir);
|
|
1273
|
-
await (0,
|
|
1272
|
+
await (0, utils_js_1.exec)('tar -cvf memdisk boot', this.echo);
|
|
1274
1273
|
process.chdir(currentDir);
|
|
1275
1274
|
// make the grub image
|
|
1276
1275
|
// -O, --format=FORMAT
|
|
@@ -1279,41 +1278,41 @@ class Ovary {
|
|
|
1279
1278
|
// -p, --prefix=DIR set prefix directory
|
|
1280
1279
|
// --format=x86_64-efi --memdisk=memdisk --output=bootx64.efi --prefix?DIR set prefix directory
|
|
1281
1280
|
// grub-mkimage -O "x86_64-efi" -m "memdisk" -o "bootx64.efi" -p '(memdisk)/boot/grub' search iso9660 configfile normal memdisk tar cat part_msdos part_gpt fat ext2 ntfs ntfscomp hfsplus chain boot linux
|
|
1282
|
-
await (0,
|
|
1281
|
+
await (0, utils_js_1.exec)(`${grubName}-mkimage -O "${utils_js_2.default.machineUEFI()}" -m "${memdiskDir}/memdisk" -o "${memdiskDir}/bootx64.efi" -p '(memdisk)/boot/grub' search iso9660 configfile normal memdisk tar cat part_msdos part_gpt fat ext2 ntfs ntfscomp hfsplus chain boot linux`, this.echo);
|
|
1283
1282
|
// popd torna in efiWorkDir
|
|
1284
1283
|
// copy the grub image to efi/boot (to go later in the device's root)
|
|
1285
|
-
await (0,
|
|
1284
|
+
await (0, utils_js_1.exec)(`cp ${memdiskDir}/bootx64.efi ${efiWorkDir}/efi/boot`, this.echo);
|
|
1286
1285
|
// #######################
|
|
1287
1286
|
// Do the boot image "boot/grub/efiboot.img"
|
|
1288
|
-
await (0,
|
|
1289
|
-
await (0,
|
|
1290
|
-
await (0,
|
|
1291
|
-
await (0,
|
|
1292
|
-
await (0,
|
|
1293
|
-
await (0,
|
|
1287
|
+
await (0, utils_js_1.exec)(`dd if=/dev/zero of=${efiWorkDir}/boot/grub/efiboot.img bs=1K count=1440`, this.echo);
|
|
1288
|
+
await (0, utils_js_1.exec)(`/sbin/mkdosfs -F 12 ${efiWorkDir}/boot/grub/efiboot.img`, this.echo);
|
|
1289
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/img-mnt`, this.echo);
|
|
1290
|
+
await (0, utils_js_1.exec)(`mount -o loop ${efiWorkDir}/boot/grub/efiboot.img ${efiWorkDir}/img-mnt`, this.echo);
|
|
1291
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/img-mnt/efi`, this.echo);
|
|
1292
|
+
await (0, utils_js_1.exec)(`mkdir ${efiWorkDir}/img-mnt/efi/boot`, this.echo);
|
|
1294
1293
|
// era cp -r
|
|
1295
|
-
await (0,
|
|
1294
|
+
await (0, utils_js_1.exec)(`cp ${memdiskDir}/bootx64.efi ${efiWorkDir}/img-mnt/efi/boot`, this.echo);
|
|
1296
1295
|
// #######################
|
|
1297
1296
|
// copy modules and font
|
|
1298
|
-
await (0,
|
|
1297
|
+
await (0, utils_js_1.exec)(`cp -r /usr/lib/grub/${utils_js_2.default.machineUEFI()}/* ${efiWorkDir}/boot/grub/${utils_js_2.default.machineUEFI()}/`, this.echo);
|
|
1299
1298
|
// if this doesn't work try another font from the same place (grub's default, unicode.pf2, is much larger)
|
|
1300
1299
|
// Either of these will work, and they look the same to me. Unicode seems to work with qemu. -fsr
|
|
1301
1300
|
if (fs_1.default.existsSync('/usr/share/grub/unicode.pf2')) {
|
|
1302
|
-
await (0,
|
|
1301
|
+
await (0, utils_js_1.exec)(`cp /usr/share/grub/unicode.pf2 ${efiWorkDir}/boot/grub/font.pf2`, this.echo);
|
|
1303
1302
|
}
|
|
1304
1303
|
else if (fs_1.default.existsSync('/usr/share/grub/ascii.pf2')) {
|
|
1305
|
-
await (0,
|
|
1304
|
+
await (0, utils_js_1.exec)(`cp /usr/share/grub/ascii.pf2 ${efiWorkDir}/boot/grub/font.pf2`, this.echo);
|
|
1306
1305
|
}
|
|
1307
1306
|
// doesn't need to be root-owned
|
|
1308
1307
|
// chown -R 1000:1000 $(pwd) 2>/dev/null
|
|
1309
1308
|
// Cleanup efi temps
|
|
1310
|
-
await (0,
|
|
1311
|
-
await (0,
|
|
1312
|
-
await (0,
|
|
1309
|
+
await (0, utils_js_1.exec)(`umount ${efiWorkDir}/img-mnt`, this.echo);
|
|
1310
|
+
await (0, utils_js_1.exec)(`rmdir ${efiWorkDir}/img-mnt`, this.echo);
|
|
1311
|
+
await (0, utils_js_1.exec)(`rm ${memdiskDir}/img-mnt -rf`, this.echo);
|
|
1313
1312
|
// popd
|
|
1314
1313
|
// Copy efi files to iso
|
|
1315
|
-
await (0,
|
|
1316
|
-
await (0,
|
|
1314
|
+
await (0, utils_js_1.exec)(`rsync -avx ${efiWorkDir}/boot ${isoDir}/`, this.echo);
|
|
1315
|
+
await (0, utils_js_1.exec)(`rsync -avx ${efiWorkDir}/efi ${isoDir}/`, this.echo);
|
|
1317
1316
|
// Do the main grub.cfg (which gets loaded last):
|
|
1318
1317
|
// grub.theme.cfg
|
|
1319
1318
|
let grubThemeSrc = node_path_1.default.resolve(__dirname, `../../addons/${theme}/theme/livecd/grub.theme.cfg`);
|
|
@@ -1322,16 +1321,16 @@ class Ovary {
|
|
|
1322
1321
|
}
|
|
1323
1322
|
const grubThemeDest = `${isoDir}/boot/grub/theme.cfg`;
|
|
1324
1323
|
if (!fs_1.default.existsSync(grubThemeSrc)) {
|
|
1325
|
-
|
|
1324
|
+
utils_js_2.default.warning('Cannot find: ' + grubThemeSrc);
|
|
1326
1325
|
process.exit();
|
|
1327
1326
|
}
|
|
1328
1327
|
fs_1.default.copyFileSync(grubThemeSrc, grubThemeDest);
|
|
1329
1328
|
/**
|
|
1330
1329
|
* prepare grub.cfg from grub.template.cfg
|
|
1331
1330
|
*/
|
|
1332
|
-
const grubTemplate = node_path_1.default.resolve(__dirname,
|
|
1331
|
+
const grubTemplate = node_path_1.default.resolve(__dirname, '../../addons/templates/grub.template');
|
|
1333
1332
|
if (!fs_1.default.existsSync(grubTemplate)) {
|
|
1334
|
-
|
|
1333
|
+
utils_js_2.default.warning('Cannot find: ' + grubTemplate);
|
|
1335
1334
|
process.exit();
|
|
1336
1335
|
}
|
|
1337
1336
|
/**
|
|
@@ -1339,7 +1338,7 @@ class Ovary {
|
|
|
1339
1338
|
*/
|
|
1340
1339
|
let kernel_parameters = `boot=live components locales=${process.env.LANG}`;
|
|
1341
1340
|
if (this.familyId === 'archlinux') {
|
|
1342
|
-
|
|
1341
|
+
const volid = utils_js_2.default.getVolid(this.settings.remix.name);
|
|
1343
1342
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
1344
1343
|
kernel_parameters += ` misobasedir=manjaro misolabel=${volid}`;
|
|
1345
1344
|
}
|
|
@@ -1351,7 +1350,7 @@ class Ovary {
|
|
|
1351
1350
|
const template = fs_1.default.readFileSync(grubTemplate, 'utf8');
|
|
1352
1351
|
const view = {
|
|
1353
1352
|
fullname: this.settings.remix.fullname.toUpperCase(),
|
|
1354
|
-
kernel:
|
|
1353
|
+
kernel: utils_js_2.default.kernelVersion(),
|
|
1355
1354
|
vmlinuz: `/live${this.settings.vmlinuz}`,
|
|
1356
1355
|
initrdImg: `/live${this.settings.initrdImg}`,
|
|
1357
1356
|
kernel_parameters: kernel_parameters,
|
|
@@ -1376,7 +1375,7 @@ class Ovary {
|
|
|
1376
1375
|
shelljs_1.default.mkdir('-p', dotDisk);
|
|
1377
1376
|
// .disk/info
|
|
1378
1377
|
let file = dotDisk + '/info';
|
|
1379
|
-
let content =
|
|
1378
|
+
let content = utils_js_2.default.getVolid(this.settings.remix.name);
|
|
1380
1379
|
fs_1.default.writeFileSync(file, content, 'utf-8');
|
|
1381
1380
|
// .disk/mksquashfs
|
|
1382
1381
|
const scripts = this.settings.work_dir.path;
|
|
@@ -1393,33 +1392,33 @@ class Ovary {
|
|
|
1393
1392
|
* @returns cmd 4 mkiso
|
|
1394
1393
|
*/
|
|
1395
1394
|
xorrisoCommand(clone = false, cryptedclone = false) {
|
|
1396
|
-
const volid =
|
|
1397
|
-
|
|
1398
|
-
let typology =
|
|
1395
|
+
const volid = utils_js_2.default.getVolid(this.settings.remix.name);
|
|
1396
|
+
const prefix = this.settings.config.snapshot_prefix;
|
|
1397
|
+
let typology = '';
|
|
1399
1398
|
// typology is applied only with standard egg-of
|
|
1400
1399
|
if (prefix.slice(0, 7) === 'egg-of-') {
|
|
1401
1400
|
if (clone) {
|
|
1402
|
-
typology =
|
|
1401
|
+
typology = '_clone';
|
|
1403
1402
|
}
|
|
1404
1403
|
else if (cryptedclone) {
|
|
1405
|
-
typology =
|
|
1404
|
+
typology = '_crypted';
|
|
1406
1405
|
}
|
|
1407
1406
|
}
|
|
1408
|
-
const postfix =
|
|
1407
|
+
const postfix = utils_js_2.default.getPostfix();
|
|
1409
1408
|
this.settings.isoFilename = prefix + volid + typology + postfix;
|
|
1410
1409
|
const output = this.settings.config.snapshot_dir + this.settings.isoFilename;
|
|
1411
1410
|
let command = '';
|
|
1412
1411
|
// const appid = `-appid "${this.settings.distro.distroId}" `
|
|
1413
1412
|
// const publisher = `-publisher "${this.settings.distro.distroId}/${this.settings.distro.codenameId}" `
|
|
1414
1413
|
// const preparer = '-preparer "prepared by eggs <https://penguins-eggs.net>" '
|
|
1415
|
-
let isoHybridMbr =
|
|
1414
|
+
let isoHybridMbr = '';
|
|
1416
1415
|
if (this.settings.config.make_isohybrid) {
|
|
1417
1416
|
const isolinuxFile = this.settings.distro.isolinuxPath + 'isohdpfx.bin';
|
|
1418
1417
|
if (fs_1.default.existsSync(isolinuxFile)) {
|
|
1419
1418
|
isoHybridMbr = `-isohybrid-mbr ${isolinuxFile}`;
|
|
1420
1419
|
}
|
|
1421
1420
|
else {
|
|
1422
|
-
|
|
1421
|
+
utils_js_2.default.warning(`Can't create isohybrid image. File: ${isolinuxFile} not found. \nThe resulting image will be a standard iso file`);
|
|
1423
1422
|
}
|
|
1424
1423
|
}
|
|
1425
1424
|
// uefi_opt="-eltorito-alt-boot -e boot/grub/efiboot.img -isohybrid-gpt-basdat -no-emul-boot"
|
|
@@ -1469,7 +1468,7 @@ class Ovary {
|
|
|
1469
1468
|
* -isohybrid-gpt-basdat
|
|
1470
1469
|
* isohybrid-apm-hfsplus
|
|
1471
1470
|
* boot1 CD1
|
|
1472
|
-
|
|
1471
|
+
|
|
1473
1472
|
command = `xorriso -as mkisofs \
|
|
1474
1473
|
-r \
|
|
1475
1474
|
-checksum_algorithm_iso md5,sha1,sha256,sha512 \
|
|
@@ -1537,13 +1536,13 @@ class Ovary {
|
|
|
1537
1536
|
* cmd: cmd 4 xorirriso
|
|
1538
1537
|
*/
|
|
1539
1538
|
async makeIso(cmd, scriptOnly = false) {
|
|
1540
|
-
//echo = { echo: true, ignore: false }
|
|
1539
|
+
// echo = { echo: true, ignore: false }
|
|
1541
1540
|
if (this.verbose) {
|
|
1542
1541
|
console.log('ovary: makeIso');
|
|
1543
1542
|
}
|
|
1544
|
-
|
|
1543
|
+
utils_js_2.default.writeX(`${this.settings.work_dir.path}mkisofs`, cmd);
|
|
1545
1544
|
if (!scriptOnly) {
|
|
1546
|
-
await (0,
|
|
1545
|
+
await (0, utils_js_1.exec)(cmd, utils_js_2.default.setEcho(true));
|
|
1547
1546
|
}
|
|
1548
1547
|
}
|
|
1549
1548
|
/**
|
|
@@ -1551,7 +1550,7 @@ class Ovary {
|
|
|
1551
1550
|
* @param scriptOnly
|
|
1552
1551
|
*/
|
|
1553
1552
|
finished(scriptOnly = false) {
|
|
1554
|
-
|
|
1553
|
+
utils_js_2.default.titles('produce');
|
|
1555
1554
|
if (!scriptOnly) {
|
|
1556
1555
|
console.log('eggs is finished!\n\nYou can find the file iso: ' + chalk_1.default.cyanBright(this.settings.isoFilename) + '\nin the nest: ' + chalk_1.default.cyanBright(this.settings.config.snapshot_dir) + '.');
|
|
1557
1556
|
}
|
|
@@ -1578,9 +1577,9 @@ class Ovary {
|
|
|
1578
1577
|
const usersArray = [];
|
|
1579
1578
|
await (0, promises_1.access)('/etc/passwd', fs_2.constants.R_OK | fs_2.constants.W_OK);
|
|
1580
1579
|
const passwd = fs_1.default.readFileSync('/etc/passwd', 'utf-8').split('\n');
|
|
1581
|
-
for (
|
|
1582
|
-
|
|
1583
|
-
const users = new
|
|
1580
|
+
for (const element of passwd) {
|
|
1581
|
+
const line = element.split(':');
|
|
1582
|
+
const users = new users_js_1.default(line[0], line[1], line[2], line[3], line[4], line[5], line[6]);
|
|
1584
1583
|
await users.getValues();
|
|
1585
1584
|
if (users.password !== undefined) {
|
|
1586
1585
|
usersArray.push(users);
|
|
@@ -1598,11 +1597,11 @@ async function makeIfNotExist(path, verbose = false) {
|
|
|
1598
1597
|
if (verbose) {
|
|
1599
1598
|
console.log(`ovary: makeIfNotExist(${path})`);
|
|
1600
1599
|
}
|
|
1601
|
-
const echo =
|
|
1600
|
+
const echo = utils_js_2.default.setEcho(verbose);
|
|
1602
1601
|
let cmd = `# ${path} alreasy exist`;
|
|
1603
1602
|
if (!fs_1.default.existsSync(path)) {
|
|
1604
1603
|
cmd = `mkdir ${path} -p`;
|
|
1605
|
-
await (0,
|
|
1604
|
+
await (0, utils_js_1.exec)(cmd, echo);
|
|
1606
1605
|
}
|
|
1607
1606
|
return cmd;
|
|
1608
1607
|
}
|
|
@@ -1612,7 +1611,7 @@ async function makeIfNotExist(path, verbose = false) {
|
|
|
1612
1611
|
* @param echo
|
|
1613
1612
|
*/
|
|
1614
1613
|
async function rexec(cmd, verbose = false) {
|
|
1615
|
-
const echo =
|
|
1616
|
-
await (0,
|
|
1614
|
+
const echo = utils_js_2.default.setEcho(verbose);
|
|
1615
|
+
await (0, utils_js_1.exec)(cmd, echo);
|
|
1617
1616
|
return cmd;
|
|
1618
1617
|
}
|