penguins-eggs 9.3.26 → 9.3.27
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/compressors.js +3 -3
- package/dist/classes/daddy.js +8 -8
- package/dist/classes/distro.js +23 -22
- package/dist/classes/family/archlinux.js +1 -1
- package/dist/classes/family/debian.js +5 -5
- package/dist/classes/incubation/branding.js +4 -4
- package/dist/classes/incubation/distros/jessie.js +1 -1
- package/dist/classes/incubation/distros/rolling.js +4 -4
- package/dist/classes/incubation/fisherman-helper/packages.js +8 -8
- package/dist/classes/incubation/fisherman.js +5 -7
- package/dist/classes/incubation/incubator.js +7 -7
- package/dist/classes/keyboards.js +16 -16
- package/dist/classes/locales.js +9 -9
- package/dist/classes/network.js +5 -7
- package/dist/classes/ovary.js +80 -84
- package/dist/classes/pacman.js +2 -4
- package/dist/classes/pxe.js +131 -131
- package/dist/classes/settings.js +2 -2
- package/dist/classes/sources_list.js +20 -22
- package/dist/classes/systemctl.js +2 -2
- package/dist/classes/tailor.js +216 -225
- package/dist/classes/users.js +24 -24
- package/dist/classes/xdg.js +17 -17
- package/dist/classes/yolk.js +2 -4
- package/dist/commands/adapt.js +2 -2
- package/dist/commands/analyze.js +34 -3
- package/dist/commands/calamares.js +6 -6
- package/dist/commands/config.js +8 -12
- package/dist/commands/cuckoo.js +8 -8
- package/dist/commands/dad.js +4 -4
- package/dist/commands/export/deb.js +7 -7
- package/dist/commands/export/iso.js +6 -6
- package/dist/commands/install.js +15 -15
- package/dist/commands/kill.js +3 -3
- package/dist/commands/mom.js +2 -2
- package/dist/commands/produce.js +9 -9
- package/dist/commands/status.js +2 -2
- package/dist/commands/syncfrom.js +11 -13
- package/dist/commands/syncto.js +36 -41
- package/dist/commands/tools/clean.js +3 -3
- package/dist/commands/tools/ppa.js +10 -10
- package/dist/commands/tools/skel.js +3 -3
- package/dist/commands/tools/stat.js +5 -5
- package/dist/commands/tools/yolk.js +2 -2
- package/dist/commands/update.js +4 -4
- package/dist/commands/wardrobe/get.js +5 -5
- package/dist/commands/wardrobe/list.js +13 -13
- package/dist/commands/wardrobe/show.js +12 -12
- package/dist/commands/wardrobe/wear.js +8 -8
- package/dist/interfaces/i-packages.js +1 -1
- package/dist/interfaces/i-pxe.js +39 -0
- package/dist/krill/modules/add-user.js +2 -2
- package/dist/krill/modules/bootloader-config-ubuntu.js +1 -1
- package/dist/krill/modules/bootloader.js +2 -2
- package/dist/krill/modules/fstab.js +21 -21
- package/dist/krill/modules/grubcfg.js +1 -1
- package/dist/krill/modules/hostname.js +15 -15
- package/dist/krill/modules/initramfs.js +4 -4
- package/dist/krill/modules/locale-cfg.js +8 -8
- package/dist/krill/modules/locale.js +6 -6
- package/dist/krill/modules/m-keyboard.js +20 -20
- package/dist/krill/modules/machine-id.js +1 -1
- package/dist/krill/modules/mkfs.js +1 -1
- package/dist/krill/modules/mount-fs.js +7 -9
- package/dist/krill/modules/network-cfg.js +15 -17
- package/dist/krill/modules/packages.js +6 -6
- package/dist/krill/modules/partition.js +91 -84
- package/dist/krill/modules/remove-installer-link.js +1 -1
- package/dist/krill/modules/unpackfs.js +1 -1
- package/dist/lib/cli-autologin.js +7 -7
- package/dist/lib/dependencies.js +10 -10
- package/dist/lib/get_address.js +2 -2
- package/dist/lib/get_dns.js +2 -2
- package/dist/lib/get_domain.js +2 -2
- package/dist/lib/get_gateway.js +2 -2
- package/dist/lib/get_hostname.js +2 -2
- package/dist/lib/get_netmask.js +2 -2
- package/dist/lib/get_password.js +4 -4
- package/dist/lib/get_root_password.js +3 -3
- package/dist/lib/get_userfullname.js +2 -2
- package/dist/lib/get_username.js +2 -2
- package/dist/lib/select_address_type.js +2 -2
- package/dist/lib/select_filesystem_type.js +2 -2
- package/dist/lib/select_installation_device.js +2 -2
- package/dist/lib/select_installation_mode.js +2 -2
- package/dist/lib/select_interface.js +2 -2
- package/dist/lib/select_keyboard_layout.js +4 -4
- package/dist/lib/select_keyboard_model.js +4 -4
- package/dist/lib/select_keyboard_option.js +4 -4
- package/dist/lib/select_keyboard_variant.js +4 -4
- package/dist/lib/select_languages.js +3 -3
- package/dist/lib/select_regions.js +2 -2
- package/dist/lib/select_user_swap_choice.js +2 -2
- package/dist/lib/select_zones.js +8 -8
- package/dist/lib/utils.js +3 -3
- package/dist/types/etrick.js +1 -0
- package/package.json +8 -2
- 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
|
@@ -25,26 +25,26 @@ class Keyboard {
|
|
|
25
25
|
let isVariant = false;
|
|
26
26
|
let isOption = false;
|
|
27
27
|
for (let i = 0; i < lenght; i++) {
|
|
28
|
-
if (lines[i].
|
|
29
|
-
if (lines[i] ===
|
|
28
|
+
if (lines[i].slice(0, 1) === '!') {
|
|
29
|
+
if (lines[i] === '! model') {
|
|
30
30
|
isModel = true;
|
|
31
31
|
isLayout = false;
|
|
32
32
|
isVariant = false;
|
|
33
33
|
isOption = false;
|
|
34
34
|
}
|
|
35
|
-
else if (lines[i] ===
|
|
35
|
+
else if (lines[i] === '! layout') {
|
|
36
36
|
isModel = false;
|
|
37
37
|
isLayout = true;
|
|
38
38
|
isVariant = false;
|
|
39
39
|
isOption = false;
|
|
40
40
|
}
|
|
41
|
-
else if (lines[i] ===
|
|
41
|
+
else if (lines[i] === '! variant') {
|
|
42
42
|
isModel = false;
|
|
43
43
|
isLayout = false;
|
|
44
44
|
isVariant = true;
|
|
45
45
|
isOption = false;
|
|
46
46
|
}
|
|
47
|
-
else if (lines[i] ===
|
|
47
|
+
else if (lines[i] === '! option') {
|
|
48
48
|
isModel = false;
|
|
49
49
|
isLayout = false;
|
|
50
50
|
isVariant = false;
|
|
@@ -75,9 +75,9 @@ class Keyboard {
|
|
|
75
75
|
// pc101 Generic 101-key PC
|
|
76
76
|
const oModels = [];
|
|
77
77
|
for (const model of this.models) {
|
|
78
|
-
|
|
79
|
-
m.code = model.
|
|
80
|
-
m.description = model.
|
|
78
|
+
const m = {};
|
|
79
|
+
m.code = model.slice(0, 15).trim();
|
|
80
|
+
m.description = model.slice(16);
|
|
81
81
|
oModels.push(m);
|
|
82
82
|
}
|
|
83
83
|
return oModels;
|
|
@@ -89,8 +89,8 @@ class Keyboard {
|
|
|
89
89
|
const oLayouts = [];
|
|
90
90
|
for (const layout of this.layouts) {
|
|
91
91
|
const l = {};
|
|
92
|
-
l.code = layout.
|
|
93
|
-
l.description = layout.
|
|
92
|
+
l.code = layout.slice(0, 15).trim();
|
|
93
|
+
l.description = layout.slice(16);
|
|
94
94
|
oLayouts.push(l);
|
|
95
95
|
}
|
|
96
96
|
return oLayouts;
|
|
@@ -100,13 +100,13 @@ class Keyboard {
|
|
|
100
100
|
*/
|
|
101
101
|
getVariants(layout) {
|
|
102
102
|
// 0123456789012345678901234567890123456789
|
|
103
|
-
// chr us: Cherokee
|
|
103
|
+
// chr us: Cherokee
|
|
104
104
|
const aoVariants = [];
|
|
105
105
|
for (const variant of this.variants) {
|
|
106
106
|
const v = {};
|
|
107
|
-
v.code = variant.
|
|
107
|
+
v.code = variant.slice(0, 15).trim();
|
|
108
108
|
v.lang = variant.substring(16, variant.indexOf(':')).trim();
|
|
109
|
-
v.description = variant.
|
|
109
|
+
v.description = variant.slice(Math.max(0, variant.indexOf(':')));
|
|
110
110
|
if (v.lang === layout) {
|
|
111
111
|
aoVariants.push(v);
|
|
112
112
|
}
|
|
@@ -122,8 +122,8 @@ class Keyboard {
|
|
|
122
122
|
const aoOptions = [];
|
|
123
123
|
for (const option of this.options) {
|
|
124
124
|
const o = {};
|
|
125
|
-
o.code = option.
|
|
126
|
-
o.description = option.
|
|
125
|
+
o.code = option.slice(0, 15).trim();
|
|
126
|
+
o.description = option.slice(21);
|
|
127
127
|
aoOptions.push(o);
|
|
128
128
|
}
|
|
129
129
|
return aoOptions;
|
|
@@ -148,7 +148,7 @@ class Keyboard {
|
|
|
148
148
|
*/
|
|
149
149
|
async getLayout() {
|
|
150
150
|
const file = '/etc/default/keyboard';
|
|
151
|
-
const cmd =
|
|
151
|
+
const cmd = 'grep XKBLAYOUT < /etc/default/keyboard | cut -f2 -d= | cut -f2 "-d\\""';
|
|
152
152
|
let keyboardLayout = 'us';
|
|
153
153
|
if (fs_1.default.existsSync(file)) {
|
|
154
154
|
const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
|
package/dist/classes/locales.js
CHANGED
|
@@ -6,13 +6,13 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
|
6
6
|
const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
7
7
|
class Locales {
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
11
|
async getEnabled() {
|
|
12
12
|
// Restituisce i locales abilitati in Debian, per manjaro quelli presenti
|
|
13
13
|
// in /etc/locale.gen anche se #disabilitati
|
|
14
|
-
const cmd =
|
|
15
|
-
|
|
14
|
+
const cmd = 'localectl list-locales';
|
|
15
|
+
const enabledLocales = [];
|
|
16
16
|
const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
|
|
17
17
|
if (result.code === 0) {
|
|
18
18
|
const lines = result.data.split('\n');
|
|
@@ -23,8 +23,8 @@ class Locales {
|
|
|
23
23
|
return enabledLocales;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
28
|
async getSupported() {
|
|
29
29
|
const distro = new distro_1.default();
|
|
30
30
|
let supporteds = [];
|
|
@@ -41,12 +41,12 @@ class Locales {
|
|
|
41
41
|
return elements;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
46
|
async getDefault() {
|
|
47
47
|
const file = '/etc/default/locale';
|
|
48
48
|
const cmd = `grep LANG < ${file}|cut -f2 -d=`;
|
|
49
|
-
let defaultLanguage =
|
|
49
|
+
let defaultLanguage = '';
|
|
50
50
|
if (fs_1.default.existsSync(file)) {
|
|
51
51
|
const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
|
|
52
52
|
if (result.code === 0) {
|
package/dist/classes/network.js
CHANGED
|
@@ -19,7 +19,7 @@ class Network {
|
|
|
19
19
|
this.netmask = '';
|
|
20
20
|
this.o = {};
|
|
21
21
|
const interfaces = os_1.default.networkInterfaces();
|
|
22
|
-
|
|
22
|
+
const address = '';
|
|
23
23
|
if (interfaces !== undefined) {
|
|
24
24
|
for (const devName in interfaces) {
|
|
25
25
|
const iface = interfaces[devName];
|
|
@@ -32,10 +32,8 @@ class Network {
|
|
|
32
32
|
if (this.address === '') {
|
|
33
33
|
this.address = alias.address;
|
|
34
34
|
}
|
|
35
|
-
if (this.cidr === '') {
|
|
36
|
-
|
|
37
|
-
this.cidr = alias.cidr;
|
|
38
|
-
}
|
|
35
|
+
if (this.cidr === '' && alias.cidr !== null) {
|
|
36
|
+
this.cidr = alias.cidr;
|
|
39
37
|
}
|
|
40
38
|
if (this.family === '') {
|
|
41
39
|
this.family = alias.family;
|
|
@@ -51,8 +49,8 @@ class Network {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
* valori da netmask
|
|
53
|
+
*/
|
|
56
54
|
this.o = new netmask_1.Netmask(this.cidr);
|
|
57
55
|
}
|
|
58
56
|
}
|
package/dist/classes/ovary.js
CHANGED
|
@@ -93,8 +93,8 @@ class Ovary {
|
|
|
93
93
|
}
|
|
94
94
|
this.clone = clone;
|
|
95
95
|
this.cryptedclone = cryptedclone;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const luksName = 'luks-eggs-data';
|
|
97
|
+
const luksFile = `/tmp/${luksName}`;
|
|
98
98
|
// let luksDevice = `/dev/mapper/${this.luksName}`
|
|
99
99
|
// let luksMountpoint = `/mnt`
|
|
100
100
|
if (this.familyId === 'debian') {
|
|
@@ -121,28 +121,26 @@ class Ovary {
|
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
123
|
await this.liveCreateStructure();
|
|
124
|
-
if (!nointeractive)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
await bleach.clean(verbose);
|
|
131
|
-
}
|
|
124
|
+
if (!nointeractive && this.settings.distro.isCalamaresAvailable && (pacman_1.default.isInstalledGui()) &&
|
|
125
|
+
this.settings.config.force_installer && !(await pacman_1.default.calamaresCheck())) {
|
|
126
|
+
console.log('Installing ' + chalk_1.default.bgGray('calamares') + ' due force_installer=yes.');
|
|
127
|
+
await pacman_1.default.calamaresInstall(verbose);
|
|
128
|
+
const bleach = new bleach_1.default();
|
|
129
|
+
await bleach.clean(verbose);
|
|
132
130
|
}
|
|
133
131
|
// CRYPTEDCLONE
|
|
134
132
|
if (cryptedclone) {
|
|
135
|
-
console.log(
|
|
133
|
+
console.log('Users and the user data will be saved in an encrypted LUKS volume');
|
|
136
134
|
const users = await this.usersFill();
|
|
137
|
-
for (
|
|
138
|
-
if (
|
|
135
|
+
for (const user of users) {
|
|
136
|
+
if (user.saveIt) {
|
|
139
137
|
let utype = 'user ';
|
|
140
|
-
if (parseInt(
|
|
138
|
+
if (Number.parseInt(user.uid) < 1000) {
|
|
141
139
|
utype = 'service';
|
|
142
140
|
}
|
|
143
|
-
console.log(`- ${utype}: ${
|
|
144
|
-
if (
|
|
145
|
-
this.addRemoveExclusion(true,
|
|
141
|
+
console.log(`- ${utype}: ${user.login.padEnd(16)} \thome: ${user.home}`);
|
|
142
|
+
if (user.login !== 'root') {
|
|
143
|
+
this.addRemoveExclusion(true, user.home);
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
146
|
}
|
|
@@ -161,7 +159,7 @@ class Ovary {
|
|
|
161
159
|
* reCreate = false is just for develop
|
|
162
160
|
* put reCreate = true in release
|
|
163
161
|
*/
|
|
164
|
-
|
|
162
|
+
const reCreate = true;
|
|
165
163
|
if (reCreate) { // start pre-clone
|
|
166
164
|
/**
|
|
167
165
|
* Anche non accettando l'installazione di calamares
|
|
@@ -281,7 +279,7 @@ class Ovary {
|
|
|
281
279
|
this.tryCatch(cmd);
|
|
282
280
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/efi/boot`;
|
|
283
281
|
this.tryCatch(cmd);
|
|
284
|
-
|
|
282
|
+
const liveBsseDir = 'live';
|
|
285
283
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}/isolinux`;
|
|
286
284
|
this.tryCatch(cmd);
|
|
287
285
|
cmd = `mkdir -p ${this.settings.work_dir.pathIso}live`;
|
|
@@ -355,9 +353,9 @@ class Ovary {
|
|
|
355
353
|
}
|
|
356
354
|
if (fs_1.default.existsSync(`${this.settings.work_dir.merged}/etc/ssh/sshd_config`)) {
|
|
357
355
|
await (0, utils_1.exec)(`sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo);
|
|
358
|
-
await (this.settings.config.ssh_pass
|
|
359
|
-
|
|
360
|
-
|
|
356
|
+
await (this.settings.config.ssh_pass ?
|
|
357
|
+
(0, utils_1.exec)(`sed -i 's|.*PasswordAuthentication.*no|PasswordAuthentication yes|' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo) :
|
|
358
|
+
(0, utils_1.exec)(`sed -i 's|.*PasswordAuthentication.*yes|PasswordAuthentication no|' ${this.settings.work_dir.merged}/etc/ssh/sshd_config`, this.echo));
|
|
361
359
|
}
|
|
362
360
|
/**
|
|
363
361
|
* /etc/fstab should exist, even if it's empty,
|
|
@@ -392,7 +390,7 @@ class Ovary {
|
|
|
392
390
|
/**
|
|
393
391
|
* cleaning /etc/resolv.conf
|
|
394
392
|
*/
|
|
395
|
-
|
|
393
|
+
const resolvFile = `${this.settings.work_dir.merged}/etc/resolv.conf`;
|
|
396
394
|
shelljs_1.default.rm(resolvFile);
|
|
397
395
|
/**
|
|
398
396
|
* Per tutte le distro systemd
|
|
@@ -562,7 +560,7 @@ class Ovary {
|
|
|
562
560
|
* isolinux.cfg from isolinux.template.cfg
|
|
563
561
|
*/
|
|
564
562
|
const isolinuxDest = this.settings.work_dir.pathIso + 'isolinux/isolinux.cfg';
|
|
565
|
-
|
|
563
|
+
const isolinuxTemplate = node_path_1.default.resolve(__dirname, '../../addons/templates/isolinux.template');
|
|
566
564
|
if (!fs_1.default.existsSync(isolinuxTemplate)) {
|
|
567
565
|
utils_2.default.warning('Cannot find: ' + isolinuxTemplate);
|
|
568
566
|
process.exit();
|
|
@@ -572,7 +570,7 @@ class Ovary {
|
|
|
572
570
|
*/
|
|
573
571
|
let kernel_parameters = `boot=live components locales=${process.env.LANG}`;
|
|
574
572
|
if (this.familyId === 'archlinux') {
|
|
575
|
-
|
|
573
|
+
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
576
574
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
577
575
|
kernel_parameters += ` misobasedir=manjaro misolabel=${volid}`;
|
|
578
576
|
}
|
|
@@ -629,7 +627,7 @@ class Ovary {
|
|
|
629
627
|
*/
|
|
630
628
|
async initrdCreate() {
|
|
631
629
|
let initrdImg = utils_2.default.initrdImg();
|
|
632
|
-
initrdImg = initrdImg.
|
|
630
|
+
initrdImg = initrdImg.slice(Math.max(0, initrdImg.lastIndexOf('/') + 1));
|
|
633
631
|
utils_2.default.warning(`Creating ${initrdImg} in ${this.settings.work_dir.pathIso}/live/`);
|
|
634
632
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
635
633
|
await (0, utils_1.exec)(`mkinitcpio -c ${node_path_1.default.resolve(__dirname, '../../mkinitcpio/manjaro/mkinitcpio-produce.conf')} -g ${this.settings.work_dir.pathIso}/live/${initrdImg}`, utils_2.default.setEcho(true));
|
|
@@ -644,17 +642,17 @@ class Ovary {
|
|
|
644
642
|
*/
|
|
645
643
|
async initrdCopy(verbose = false) {
|
|
646
644
|
let isCrypted = false;
|
|
647
|
-
utils_2.default.warning(
|
|
648
|
-
if (fs_1.default.existsSync(
|
|
645
|
+
utils_2.default.warning('initrdCreate');
|
|
646
|
+
if (fs_1.default.existsSync('/etc/crypttab')) {
|
|
649
647
|
isCrypted = true;
|
|
650
|
-
await (0, utils_1.exec)(
|
|
648
|
+
await (0, utils_1.exec)('mv /etc/crypttab /etc/crypttab.saved', this.echo);
|
|
651
649
|
}
|
|
652
650
|
await (0, utils_1.exec)(`mkinitramfs -o ${this.settings.work_dir.pathIso}/live/initrd.img-$(uname -r) ${this.toNull}`, this.echo);
|
|
653
651
|
if (isCrypted) {
|
|
654
|
-
await (0, utils_1.exec)(
|
|
652
|
+
await (0, utils_1.exec)('mv /etc/crypttab.saved /etc/crypttab', this.echo);
|
|
655
653
|
}
|
|
656
654
|
/*
|
|
657
|
-
|
|
655
|
+
|
|
658
656
|
Utils.warning(`initrdCopy`)
|
|
659
657
|
if (this.verbose) {
|
|
660
658
|
console.log('ovary: initrdCopy')
|
|
@@ -666,7 +664,7 @@ class Ovary {
|
|
|
666
664
|
Utils.error(`Cannot find ${this.settings.initrdImg}`)
|
|
667
665
|
lackInitrdImage = true
|
|
668
666
|
}
|
|
669
|
-
|
|
667
|
+
|
|
670
668
|
if (lackInitrdImage) {
|
|
671
669
|
Utils.warning('Try to edit /etc/penguins-eggs.d/eggs.yaml and check for')
|
|
672
670
|
Utils.warning(`initrd_img: ${this.settings.initrd_image}`)
|
|
@@ -684,14 +682,14 @@ class Ovary {
|
|
|
684
682
|
/**
|
|
685
683
|
* exclude all the accurence of cryptdisks in rc0.d, etc
|
|
686
684
|
*/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
685
|
+
const fexcludes = [
|
|
686
|
+
'/boot/efi/EFI',
|
|
687
|
+
'/etc/fstab',
|
|
688
|
+
'/etc/mtab',
|
|
689
|
+
'/etc/udev/rules.d/70-persistent-cd.rules',
|
|
690
|
+
'/etc/udev/rules.d/70-persistent-net.rules',
|
|
693
691
|
];
|
|
694
|
-
for (
|
|
692
|
+
for (const i in fexcludes) {
|
|
695
693
|
this.addRemoveExclusion(true, fexcludes[i]);
|
|
696
694
|
}
|
|
697
695
|
/**
|
|
@@ -710,7 +708,7 @@ class Ovary {
|
|
|
710
708
|
}
|
|
711
709
|
}
|
|
712
710
|
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')
|
|
711
|
+
// this.addRemoveExclusion(true, '/etc/localtime')
|
|
714
712
|
}
|
|
715
713
|
this.addRemoveExclusion(true, this.settings.config.snapshot_dir /* .absolutePath() */);
|
|
716
714
|
if (fs_1.default.existsSync(`${this.settings.work_dir.pathIso}/live/filesystem.squashfs`)) {
|
|
@@ -767,7 +765,7 @@ class Ovary {
|
|
|
767
765
|
'run',
|
|
768
766
|
'sys',
|
|
769
767
|
'swapfile',
|
|
770
|
-
'tmp'
|
|
768
|
+
'tmp',
|
|
771
769
|
];
|
|
772
770
|
if (!this.clone) {
|
|
773
771
|
nomergedDirs.push('home');
|
|
@@ -884,7 +882,7 @@ class Ovary {
|
|
|
884
882
|
// await exec(`/usr/bin/pkill mksquashfs; /usr/bin/pkill md5sum`, {echo: true})
|
|
885
883
|
if (fs_1.default.existsSync(this.settings.work_dir.merged)) {
|
|
886
884
|
const bindDirs = fs_1.default.readdirSync(this.settings.work_dir.merged, {
|
|
887
|
-
withFileTypes: true
|
|
885
|
+
withFileTypes: true,
|
|
888
886
|
});
|
|
889
887
|
for (const dir of bindDirs) {
|
|
890
888
|
const dirname = n8_1.default.dirent2string(dir);
|
|
@@ -903,7 +901,7 @@ class Ovary {
|
|
|
903
901
|
/**
|
|
904
902
|
* We can't remove the nest!!!
|
|
905
903
|
*/
|
|
906
|
-
|
|
904
|
+
const nest = this.settings.work_dir.path.split('/');
|
|
907
905
|
if (dirname !== nest[1]) { // We can't remove first level nest
|
|
908
906
|
cmds.push(await rexec(`rm ${this.settings.work_dir.merged}/${dirname} -rf`, this.verbose));
|
|
909
907
|
}
|
|
@@ -953,7 +951,7 @@ class Ovary {
|
|
|
953
951
|
const result = await (0, utils_1.exec)(cmd, {
|
|
954
952
|
echo: this.verbose,
|
|
955
953
|
ignore: false,
|
|
956
|
-
capture: true
|
|
954
|
+
capture: true,
|
|
957
955
|
});
|
|
958
956
|
const users = result.data.split('\n');
|
|
959
957
|
for (let i = 0; i < users.length - 1; i++) {
|
|
@@ -1024,32 +1022,30 @@ class Ovary {
|
|
|
1024
1022
|
if (pacman_1.default.packageIsInstalled('calamares')) {
|
|
1025
1023
|
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
1024
|
}
|
|
1025
|
+
else if (pacman_1.default.packageIsInstalled('live-installer')) {
|
|
1026
|
+
// carico la policy per live-installer
|
|
1027
|
+
const policySource = node_path_1.default.resolve(__dirname, '../../assets/live-installer/com.github.pieroproietti.penguins-eggs.policy');
|
|
1028
|
+
const policyDest = '/usr/share/polkit-1/actions/com.github.pieroproietti.penguins-eggs.policy';
|
|
1029
|
+
shelljs_1.default.cp(policySource, policyDest);
|
|
1030
|
+
await (0, utils_1.exec)(`sed -i 's/auth_admin/yes/' ${policyDest}`);
|
|
1031
|
+
// carico in filesystem.live packages-remove
|
|
1032
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/live-installer/filesystem.packages-remove'), `${this.settings.work_dir.pathIso}/live/`);
|
|
1033
|
+
shelljs_1.default.touch(`${this.settings.work_dir.pathIso}/live/filesystem.packages`);
|
|
1034
|
+
installerUrl = 'penguins-live-installer.desktop';
|
|
1035
|
+
installerIcon = 'utilities-terminal';
|
|
1036
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-live-installer.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1037
|
+
}
|
|
1027
1038
|
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
|
-
}
|
|
1039
|
+
installerUrl = 'penguins-krill.desktop';
|
|
1040
|
+
installerIcon = 'utilities-terminal';
|
|
1041
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-krill.desktop'), `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1046
1042
|
}
|
|
1047
1043
|
/**
|
|
1048
1044
|
* flags
|
|
1049
1045
|
*/
|
|
1050
1046
|
// adapt
|
|
1051
1047
|
if (myAddons.adapt) {
|
|
1052
|
-
const dirAddon = node_path_1.default.resolve(__dirname,
|
|
1048
|
+
const dirAddon = node_path_1.default.resolve(__dirname, '../../addons/eggs/adapt/');
|
|
1053
1049
|
shelljs_1.default.cp(`${dirAddon}/applications/eggs-adapt.desktop`, `${this.settings.work_dir.merged}/usr/share/applications/`);
|
|
1054
1050
|
shelljs_1.default.cp(`${dirAddon}/bin/adapt`, `${this.settings.work_dir.merged}/usr/bin/`);
|
|
1055
1051
|
shelljs_1.default.chmod('+x', `${this.settings.work_dir.merged}/usr/bin/adapt`);
|
|
@@ -1091,7 +1087,7 @@ class Ovary {
|
|
|
1091
1087
|
// Creo l'avviatore xdg DEVE essere add-penguins-links.desktop
|
|
1092
1088
|
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../assets/penguins-links-add.desktop'), dirAutostart);
|
|
1093
1089
|
// create /usr/bin/penguins-links-add.sh
|
|
1094
|
-
const script =
|
|
1090
|
+
const script = '/usr/bin/penguins-links-add.sh';
|
|
1095
1091
|
let text = '';
|
|
1096
1092
|
text += '#!/bin/sh\n';
|
|
1097
1093
|
text += 'DESKTOP=$(xdg-user-dir DESKTOP)\n';
|
|
@@ -1107,29 +1103,29 @@ class Ovary {
|
|
|
1107
1103
|
text += this.lxdeLink('eggs-rsupport.desktop', 'Remote assistance', 'remote-assistance');
|
|
1108
1104
|
}
|
|
1109
1105
|
else {
|
|
1110
|
-
text +=
|
|
1106
|
+
text += 'cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n';
|
|
1111
1107
|
if (myAddons.adapt)
|
|
1112
|
-
text +=
|
|
1108
|
+
text += 'cp /usr/share/applications/eggs-adapt.desktop "$DESKTOP"\n';
|
|
1113
1109
|
if (myAddons.pve)
|
|
1114
|
-
text +=
|
|
1110
|
+
text += 'cp /usr/share/applications/eggs-pve.desktop "$DESKTOP"\n';
|
|
1115
1111
|
if (myAddons.rsupport)
|
|
1116
|
-
text +=
|
|
1112
|
+
text += 'cp /usr/share/applications/eggs-rsupport.desktop "$DESKTOP"\n';
|
|
1117
1113
|
}
|
|
1118
1114
|
/**
|
|
1119
1115
|
* enable desktop links
|
|
1120
1116
|
*/
|
|
1121
1117
|
if (pacman_1.default.packageIsInstalled('gdm3') || pacman_1.default.packageIsInstalled('gdm')) {
|
|
1122
1118
|
// GNOME
|
|
1123
|
-
text +=
|
|
1124
|
-
text +=
|
|
1125
|
-
text +=
|
|
1119
|
+
text += 'test -f /usr/share/applications/penguins-eggs.desktop && cp /usr/share/applications/penguins-eggs.desktop "$DESKTOP"\n';
|
|
1120
|
+
text += 'test -f "$DESKTOP"/penguins-eggs.desktop && chmod a+x "$DESKTOP"/penguins-eggs.desktop\n';
|
|
1121
|
+
text += 'test -f "$DESKTOP"/penguins-eggs.desktop && gio set "$DESKTOP"/penguins-eggs.desktop metadata::trusted true\n';
|
|
1126
1122
|
text += `test -f /usr/share/applications/${installerUrl} && cp /usr/share/applications/${installerUrl} "$DESKTOP"\n`;
|
|
1127
1123
|
text += `test -f "$DESKTOP"/${installerUrl} && chmod a+x "$DESKTOP"/${installerUrl}\n`;
|
|
1128
1124
|
text += `test -f "$DESKTOP"/${installerUrl} && gio set "$DESKTOP"/${installerUrl} metadata::trusted true\n`;
|
|
1129
1125
|
}
|
|
1130
1126
|
else {
|
|
1131
1127
|
// OTHERS: CINNAMON/KDE/ETC
|
|
1132
|
-
text +=
|
|
1128
|
+
text += 'chmod +x "$DESKTOP"/*.desktop';
|
|
1133
1129
|
}
|
|
1134
1130
|
fs_1.default.writeFileSync(script, text, 'utf8');
|
|
1135
1131
|
await (0, utils_1.exec)(`chmod a+x ${script}`, this.echo);
|
|
@@ -1270,7 +1266,7 @@ class Ovary {
|
|
|
1270
1266
|
*/
|
|
1271
1267
|
const currentDir = process.cwd();
|
|
1272
1268
|
process.chdir(memdiskDir);
|
|
1273
|
-
await (0, utils_1.exec)(
|
|
1269
|
+
await (0, utils_1.exec)('tar -cvf memdisk boot', this.echo);
|
|
1274
1270
|
process.chdir(currentDir);
|
|
1275
1271
|
// make the grub image
|
|
1276
1272
|
// -O, --format=FORMAT
|
|
@@ -1329,7 +1325,7 @@ class Ovary {
|
|
|
1329
1325
|
/**
|
|
1330
1326
|
* prepare grub.cfg from grub.template.cfg
|
|
1331
1327
|
*/
|
|
1332
|
-
const grubTemplate = node_path_1.default.resolve(__dirname,
|
|
1328
|
+
const grubTemplate = node_path_1.default.resolve(__dirname, '../../addons/templates/grub.template');
|
|
1333
1329
|
if (!fs_1.default.existsSync(grubTemplate)) {
|
|
1334
1330
|
utils_2.default.warning('Cannot find: ' + grubTemplate);
|
|
1335
1331
|
process.exit();
|
|
@@ -1339,7 +1335,7 @@ class Ovary {
|
|
|
1339
1335
|
*/
|
|
1340
1336
|
let kernel_parameters = `boot=live components locales=${process.env.LANG}`;
|
|
1341
1337
|
if (this.familyId === 'archlinux') {
|
|
1342
|
-
|
|
1338
|
+
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
1343
1339
|
if (this.settings.distro.distroId === 'ManjaroLinux') {
|
|
1344
1340
|
kernel_parameters += ` misobasedir=manjaro misolabel=${volid}`;
|
|
1345
1341
|
}
|
|
@@ -1394,15 +1390,15 @@ class Ovary {
|
|
|
1394
1390
|
*/
|
|
1395
1391
|
xorrisoCommand(clone = false, cryptedclone = false) {
|
|
1396
1392
|
const volid = utils_2.default.getVolid(this.settings.remix.name);
|
|
1397
|
-
|
|
1398
|
-
let typology =
|
|
1393
|
+
const prefix = this.settings.config.snapshot_prefix;
|
|
1394
|
+
let typology = '';
|
|
1399
1395
|
// typology is applied only with standard egg-of
|
|
1400
1396
|
if (prefix.slice(0, 7) === 'egg-of-') {
|
|
1401
1397
|
if (clone) {
|
|
1402
|
-
typology =
|
|
1398
|
+
typology = '_clone';
|
|
1403
1399
|
}
|
|
1404
1400
|
else if (cryptedclone) {
|
|
1405
|
-
typology =
|
|
1401
|
+
typology = '_crypted';
|
|
1406
1402
|
}
|
|
1407
1403
|
}
|
|
1408
1404
|
const postfix = utils_2.default.getPostfix();
|
|
@@ -1412,7 +1408,7 @@ class Ovary {
|
|
|
1412
1408
|
// const appid = `-appid "${this.settings.distro.distroId}" `
|
|
1413
1409
|
// const publisher = `-publisher "${this.settings.distro.distroId}/${this.settings.distro.codenameId}" `
|
|
1414
1410
|
// const preparer = '-preparer "prepared by eggs <https://penguins-eggs.net>" '
|
|
1415
|
-
let isoHybridMbr =
|
|
1411
|
+
let isoHybridMbr = '';
|
|
1416
1412
|
if (this.settings.config.make_isohybrid) {
|
|
1417
1413
|
const isolinuxFile = this.settings.distro.isolinuxPath + 'isohdpfx.bin';
|
|
1418
1414
|
if (fs_1.default.existsSync(isolinuxFile)) {
|
|
@@ -1469,7 +1465,7 @@ class Ovary {
|
|
|
1469
1465
|
* -isohybrid-gpt-basdat
|
|
1470
1466
|
* isohybrid-apm-hfsplus
|
|
1471
1467
|
* boot1 CD1
|
|
1472
|
-
|
|
1468
|
+
|
|
1473
1469
|
command = `xorriso -as mkisofs \
|
|
1474
1470
|
-r \
|
|
1475
1471
|
-checksum_algorithm_iso md5,sha1,sha256,sha512 \
|
|
@@ -1537,7 +1533,7 @@ class Ovary {
|
|
|
1537
1533
|
* cmd: cmd 4 xorirriso
|
|
1538
1534
|
*/
|
|
1539
1535
|
async makeIso(cmd, scriptOnly = false) {
|
|
1540
|
-
//echo = { echo: true, ignore: false }
|
|
1536
|
+
// echo = { echo: true, ignore: false }
|
|
1541
1537
|
if (this.verbose) {
|
|
1542
1538
|
console.log('ovary: makeIso');
|
|
1543
1539
|
}
|
|
@@ -1578,8 +1574,8 @@ class Ovary {
|
|
|
1578
1574
|
const usersArray = [];
|
|
1579
1575
|
await (0, promises_1.access)('/etc/passwd', fs_2.constants.R_OK | fs_2.constants.W_OK);
|
|
1580
1576
|
const passwd = fs_1.default.readFileSync('/etc/passwd', 'utf-8').split('\n');
|
|
1581
|
-
for (
|
|
1582
|
-
|
|
1577
|
+
for (const element of passwd) {
|
|
1578
|
+
const line = element.split(':');
|
|
1583
1579
|
const users = new users_1.default(line[0], line[1], line[2], line[3], line[4], line[5], line[6]);
|
|
1584
1580
|
await users.getValues();
|
|
1585
1581
|
if (users.password !== undefined) {
|
package/dist/classes/pacman.js
CHANGED
|
@@ -436,10 +436,8 @@ class Pacman {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
else if (this.distro().familyId === 'archlinux') {
|
|
440
|
-
|
|
441
|
-
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
442
|
-
}
|
|
439
|
+
else if (this.distro().familyId === 'archlinux' && Pacman.packageIsInstalled('bash-completion')) {
|
|
440
|
+
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
443
441
|
}
|
|
444
442
|
}
|
|
445
443
|
/**
|