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
package/dist/classes/pxe.js
CHANGED
|
@@ -6,16 +6,16 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
* author: Piero Proietti
|
|
7
7
|
* mail: piero.proietti@gmail.com
|
|
8
8
|
*/
|
|
9
|
+
const utils_1 = require("../lib/utils");
|
|
10
|
+
const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
9
11
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
10
|
-
const node_static_1 = tslib_1.__importDefault(require("node-static"));
|
|
11
12
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
13
|
+
const node_static_1 = tslib_1.__importDefault(require("node-static"));
|
|
12
14
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
13
|
-
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
14
|
-
const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
15
15
|
const settings_1 = tslib_1.__importDefault(require("./settings"));
|
|
16
|
-
const utils_2 = require("
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
const utils_2 = tslib_1.__importDefault(require("./utils"));
|
|
17
|
+
const tftp_1 = tslib_1.__importDefault(require("tftp"));
|
|
18
|
+
const etrick_1 = tslib_1.__importDefault(require("etrick"));
|
|
19
19
|
/**
|
|
20
20
|
* Pxe:
|
|
21
21
|
*/
|
|
@@ -40,75 +40,75 @@ class Pxe {
|
|
|
40
40
|
async fertilization() {
|
|
41
41
|
this.settings = new settings_1.default();
|
|
42
42
|
await this.settings.load();
|
|
43
|
-
if (
|
|
43
|
+
if (utils_2.default.isLive()) {
|
|
44
44
|
this.eggRoot = this.settings.distro.liveMediumPath;
|
|
45
45
|
if (this.settings.distro.distroId === 'Arch' || this.settings.distro.distroId === 'RebornOS') {
|
|
46
46
|
this.eggRoot = '/run/archiso/bootmnt/';
|
|
47
|
-
await (0,
|
|
48
|
-
await (0,
|
|
47
|
+
await (0, utils_1.exec)(`mkdir ${this.eggRoot} -p`);
|
|
48
|
+
await (0, utils_1.exec)(`mount /dev/sr0 ${this.eggRoot}`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
this.eggRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/ovarium/iso/';
|
|
53
53
|
}
|
|
54
|
-
if (!
|
|
54
|
+
if (!utils_2.default.isLive() && !fs_1.default.existsSync(this.settings.work_dir.path)) {
|
|
55
55
|
console.log('no image available, build an image with: sudo eggs produce');
|
|
56
56
|
process.exit();
|
|
57
57
|
}
|
|
58
58
|
this.nest = '/home/eggs';
|
|
59
59
|
this.pxeRoot = this.nest + '/pxe';
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
* se pxeRoot non esiste viene creato
|
|
62
|
+
*/
|
|
63
63
|
if (!fs_1.default.existsSync(this.pxeRoot)) {
|
|
64
|
-
await (0,
|
|
64
|
+
await (0, utils_1.exec)(`mkdir ${this.pxeRoot} -p`);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!
|
|
71
|
-
|
|
67
|
+
* Ricerca delle uova
|
|
68
|
+
*/
|
|
69
|
+
const isos = [];
|
|
70
|
+
if (!utils_2.default.isLive()) {
|
|
71
|
+
const isos = fs_1.default.readdirSync(this.nest);
|
|
72
72
|
for (const iso of isos) {
|
|
73
|
-
if (node_path_1.default.extname(iso) ===
|
|
73
|
+
if (node_path_1.default.extname(iso) === '.iso') {
|
|
74
74
|
this.isos.push(iso);
|
|
75
75
|
}
|
|
76
76
|
this.isos = this.isos.sort();
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
* installed: /home/eggs/ovarium/iso/live
|
|
81
|
+
* live: this.iso/live
|
|
82
|
+
*/
|
|
83
|
+
const pathFiles = this.eggRoot + 'live';
|
|
84
|
+
const files = fs_1.default.readdirSync(pathFiles);
|
|
85
85
|
for (const file of files) {
|
|
86
86
|
if (this.settings.distro.familyId === 'debian') {
|
|
87
|
-
if (node_path_1.default.basename(file).
|
|
87
|
+
if (node_path_1.default.basename(file).slice(0, 7) === 'vmlinuz') {
|
|
88
88
|
this.vmlinuz = node_path_1.default.basename(file);
|
|
89
89
|
}
|
|
90
|
-
if (node_path_1.default.basename(file).
|
|
90
|
+
if (node_path_1.default.basename(file).slice(0, 6) === 'initrd') {
|
|
91
91
|
this.initrdImg = node_path_1.default.basename(file);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
else if (this.settings.distro.familyId === 'archlinux') {
|
|
95
|
-
if (node_path_1.default.basename(file).
|
|
95
|
+
if (node_path_1.default.basename(file).slice(0, 7) === 'vmlinuz') {
|
|
96
96
|
this.vmlinuz = node_path_1.default.basename(file);
|
|
97
97
|
}
|
|
98
|
-
if (node_path_1.default.basename(file).
|
|
98
|
+
if (node_path_1.default.basename(file).slice(0, 9) === 'initramfs') {
|
|
99
99
|
this.initrdImg = node_path_1.default.basename(file);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
* bootLabel
|
|
105
|
+
*/
|
|
106
106
|
this.bootLabel = 'not found';
|
|
107
107
|
if (fs_1.default.existsSync(this.eggRoot + '/.disk/mkisofs')) {
|
|
108
|
-
const a = fs_1.default.readFileSync(this.eggRoot + '/.disk/mkisofs',
|
|
109
|
-
const b = a.
|
|
110
|
-
const c = b.
|
|
111
|
-
this.bootLabel = c.
|
|
108
|
+
const a = fs_1.default.readFileSync(this.eggRoot + '/.disk/mkisofs', 'utf-8');
|
|
109
|
+
const b = a.slice(Math.max(0, a.indexOf('-o ') + 3));
|
|
110
|
+
const c = b.slice(0, Math.max(0, b.indexOf(' ')));
|
|
111
|
+
this.bootLabel = c.slice(Math.max(0, c.lastIndexOf('/') + 1));
|
|
112
112
|
}
|
|
113
113
|
console.log(`bootLabel: ${this.bootLabel}`);
|
|
114
114
|
console.log(`vmlinuz: ${this.vmlinuz}`);
|
|
@@ -153,8 +153,8 @@ class Pxe {
|
|
|
153
153
|
await this.tryCatch(`cp ${__dirname}/../../addons/eggs/theme/livecd/isolinux.theme.cfg ${this.pxeRoot}/isolinux.theme.cfg`);
|
|
154
154
|
await this.tryCatch(`cp ${__dirname}/../../addons/eggs/theme/livecd/splash.png ${this.pxeRoot}/splash.png`);
|
|
155
155
|
/**
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
* ipxe.efi
|
|
157
|
+
*/
|
|
158
158
|
await this.tryCatch(`ln -s ${__dirname}/../../ipxe/ipxe.efi ${this.pxeRoot}/ipxe.efi`);
|
|
159
159
|
// pxe
|
|
160
160
|
const distro = new distro_1.default();
|
|
@@ -167,58 +167,58 @@ class Pxe {
|
|
|
167
167
|
await this.tryCatch(`ln -s ${distro.syslinuxPath}libutil.c32 ${this.pxeRoot}/libutil.c32`);
|
|
168
168
|
await this.tryCatch(`ln -s ${distro.memdiskPath}memdisk ${this.pxeRoot}/memdisk`);
|
|
169
169
|
await this.tryCatch(`mkdir ${this.pxeRoot}/pxelinux.cfg`);
|
|
170
|
-
let content =
|
|
171
|
-
content +=
|
|
172
|
-
content +=
|
|
173
|
-
content +=
|
|
174
|
-
content +=
|
|
175
|
-
content +=
|
|
176
|
-
content +=
|
|
177
|
-
content += `menu title cuckoo: when you need a flying PXE server! ${
|
|
178
|
-
content +=
|
|
179
|
-
content +=
|
|
180
|
-
content +=
|
|
181
|
-
content +=
|
|
170
|
+
let content = '';
|
|
171
|
+
content += '# eggs: pxelinux.cfg/default\n';
|
|
172
|
+
content += '# search path for the c32 support libraries (libcom32, libutil etc.)\n';
|
|
173
|
+
content += 'path\n';
|
|
174
|
+
content += 'include isolinux.theme.cfg\n';
|
|
175
|
+
content += 'UI vesamenu.c32\n';
|
|
176
|
+
content += '\n';
|
|
177
|
+
content += `menu title cuckoo: when you need a flying PXE server! ${utils_2.default.address()}\n`;
|
|
178
|
+
content += 'PROMPT 0\n';
|
|
179
|
+
content += 'TIMEOUT 200\n';
|
|
180
|
+
content += '\n';
|
|
181
|
+
content += 'label egg\n';
|
|
182
182
|
content += `menu label ${this.bootLabel.replace('.iso', '')}\n`;
|
|
183
183
|
if (this.settings.distro.familyId === 'debian') {
|
|
184
184
|
/**
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
* DEBIAN
|
|
186
|
+
*/
|
|
187
|
+
const clid = this.settings.distro.codenameLikeId;
|
|
188
188
|
if (clid === 'bionic' || clid === 'stretch' || clid === 'jessie') {
|
|
189
|
-
content +=
|
|
190
|
-
content += `append initrd=initrd boot=live config noswap noprompt fetch=http://${
|
|
189
|
+
content += 'kernel vmlinuz\n';
|
|
190
|
+
content += `append initrd=initrd boot=live config noswap noprompt fetch=http://${utils_2.default.address()}/live/filesystem.squashfs\n`;
|
|
191
191
|
}
|
|
192
192
|
else {
|
|
193
|
-
content += `kernel http://${
|
|
194
|
-
content += `append initrd=http://${
|
|
193
|
+
content += `kernel http://${utils_2.default.address()}/vmlinuz\n`;
|
|
194
|
+
content += `append initrd=http://${utils_2.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_2.default.address()}/live/filesystem.squashfs\n`;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
else if (distro.familyId === 'archlinux') {
|
|
198
198
|
/**
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
* ARCH LINUX
|
|
200
|
+
*/
|
|
201
201
|
let tool = 'archiso';
|
|
202
202
|
if (distro.codenameId === 'Qonos' || distro.codenameId === 'Ruah' || distro.codenameId === 'Sikaris') {
|
|
203
203
|
tool = 'miso';
|
|
204
204
|
}
|
|
205
|
-
content += `kernel http://${
|
|
206
|
-
content += `append initrd=http://${
|
|
207
|
-
content +=
|
|
208
|
-
content +=
|
|
205
|
+
content += `kernel http://${utils_2.default.address()}/vmlinuz\n`;
|
|
206
|
+
content += `append initrd=http://${utils_2.default.address()}/initrd boot=live config noswap noprompt ${tool}_http_srv=http://${utils_2.default.address()}/\n`;
|
|
207
|
+
content += 'sysappend 3\n';
|
|
208
|
+
content += '\n';
|
|
209
209
|
}
|
|
210
210
|
if (this.isos.length > 0) {
|
|
211
|
-
content +=
|
|
211
|
+
content += 'menu separator\n';
|
|
212
212
|
for (const iso of this.isos) {
|
|
213
|
-
content +=
|
|
213
|
+
content += '\n';
|
|
214
214
|
content += `label ${iso}\n`;
|
|
215
215
|
content += `menu label ${iso}\n`;
|
|
216
|
-
content += `kernel http://${
|
|
217
|
-
content += `initrd http://${
|
|
218
|
-
content +=
|
|
216
|
+
content += `kernel http://${utils_2.default.address()}/memdisk\n`;
|
|
217
|
+
content += `initrd http://${utils_2.default.address()}/${iso}\n`;
|
|
218
|
+
content += 'append iso raw sysappend 3\n';
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
const file = `${this.pxeRoot}/pxelinux.cfg/default`;
|
|
222
222
|
fs_1.default.writeFileSync(file, content);
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
@@ -226,16 +226,16 @@ class Pxe {
|
|
|
226
226
|
*/
|
|
227
227
|
async ipxe() {
|
|
228
228
|
console.log('creating cuckoo configuration pxe: UEFI');
|
|
229
|
-
let content =
|
|
230
|
-
content +=
|
|
231
|
-
content +=
|
|
232
|
-
content += `console --picture http://${
|
|
233
|
-
content +=
|
|
234
|
-
content +=
|
|
229
|
+
let content = '#!ipxe\n';
|
|
230
|
+
content += 'dhcp\n';
|
|
231
|
+
content += 'set net0/ip=dhcp\n';
|
|
232
|
+
content += `console --picture http://${utils_2.default.address()}/splash.png -x 1024 -y 768\n`;
|
|
233
|
+
content += 'goto start ||\n';
|
|
234
|
+
content += '\n';
|
|
235
235
|
content += ':start\n';
|
|
236
|
-
content += `set server_root http://${
|
|
236
|
+
content += `set server_root http://${utils_2.default.address()}:80/\n`;
|
|
237
237
|
const serverRootVars = '${server_root}';
|
|
238
|
-
content += `menu cuckoo: when you need a flying PXE server! ${
|
|
238
|
+
content += `menu cuckoo: when you need a flying PXE server! ${utils_2.default.address()}\n`;
|
|
239
239
|
content += 'item --gap boot from ovarium\n';
|
|
240
240
|
content += `item egg-menu \${space} ${this.bootLabel.replaceAll('.iso', '')}\n\n`;
|
|
241
241
|
if (this.isos.length > 0) {
|
|
@@ -247,55 +247,55 @@ class Pxe {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
content += 'item --gap boot from internet\n';
|
|
250
|
-
content +=
|
|
250
|
+
content += 'item netboot ${space} netboot\n';
|
|
251
251
|
content += 'choose target || goto start\n';
|
|
252
252
|
content += 'goto ${target}\n';
|
|
253
253
|
content += '\n';
|
|
254
|
-
content +=
|
|
255
|
-
content += `kernel http://${
|
|
256
|
-
content += `initrd http://${
|
|
254
|
+
content += ':egg-menu\n';
|
|
255
|
+
content += `kernel http://${utils_2.default.address()}/vmlinuz\n`;
|
|
256
|
+
content += `initrd http://${utils_2.default.address()}/initrd\n`;
|
|
257
257
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
* CORRECT:
|
|
259
|
+
* content += `imgargs vmlinuz fetch=http://${Utils.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`
|
|
260
|
+
*/
|
|
261
261
|
if (this.settings.distro.familyId === 'debian') {
|
|
262
262
|
/**
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
content += `imgargs vmlinuz fetch=http://${
|
|
263
|
+
* DEBIAN
|
|
264
|
+
*/
|
|
265
|
+
content += `imgargs vmlinuz fetch=http://${utils_2.default.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`;
|
|
266
266
|
}
|
|
267
267
|
else if (this.settings.distro.familyId === 'archlinux') {
|
|
268
268
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
* ARCH LINUX
|
|
270
|
+
*/
|
|
271
271
|
let tool = 'archiso';
|
|
272
272
|
if (this.settings.distro.codenameId === 'Qonos' || this.settings.distro.codenameId === 'Ruah' || this.settings.distro.codenameId === 'Sikaris') {
|
|
273
273
|
tool = 'miso';
|
|
274
274
|
}
|
|
275
|
-
content += `imgargs vmlinuz ${tool}_http_srv=http://${
|
|
276
|
-
//content += 'ipappend 3\n'
|
|
275
|
+
content += `imgargs vmlinuz ${tool}_http_srv=http://${utils_2.default.address()}/ boot=live dhcp initrd=initrd ro\n`;
|
|
276
|
+
// content += 'ipappend 3\n'
|
|
277
277
|
}
|
|
278
|
-
content +=
|
|
279
|
-
content +=
|
|
278
|
+
content += 'sleep 5\n';
|
|
279
|
+
content += 'boot || goto start\n\n';
|
|
280
280
|
if (this.isos.length > 0) {
|
|
281
281
|
for (const iso of this.isos) {
|
|
282
282
|
const menu = iso.replace('.iso', '');
|
|
283
283
|
content += `:${menu}\n`;
|
|
284
284
|
content += `sanboot ${serverRootVars}/${iso}\n`;
|
|
285
|
-
content +=
|
|
285
|
+
content += 'boot || goto start\n\n';
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
content +=
|
|
292
|
-
content +=
|
|
293
|
-
content +=
|
|
294
|
-
content +=
|
|
295
|
-
content +=
|
|
296
|
-
content +=
|
|
297
|
-
content +=
|
|
298
|
-
|
|
289
|
+
* netboot.xyz
|
|
290
|
+
*/
|
|
291
|
+
content += ':netboot\n';
|
|
292
|
+
content += 'ifopen net0\n';
|
|
293
|
+
content += 'set conn_type https\n';
|
|
294
|
+
content += 'chain --autofree https://boot.netboot.xyz/menu.ipxe || echo HTTPS failed... attempting HTTP...\n';
|
|
295
|
+
content += 'set conn_type http\n';
|
|
296
|
+
content += 'chain --autofree http://boot.netboot.xyz/menu.ipxe || echo HTTP failed, localbooting...\n';
|
|
297
|
+
content += 'goto start\n\n';
|
|
298
|
+
const file = `${this.pxeRoot}/autoexec.ipxe`;
|
|
299
299
|
fs_1.default.writeFileSync(file, content);
|
|
300
300
|
}
|
|
301
301
|
/**
|
|
@@ -303,25 +303,25 @@ class Pxe {
|
|
|
303
303
|
*/
|
|
304
304
|
async http() {
|
|
305
305
|
console.log('creating cuckoo configuration: PXE html');
|
|
306
|
-
|
|
307
|
-
let content =
|
|
308
|
-
content +=
|
|
309
|
-
content +=
|
|
310
|
-
content +=
|
|
311
|
-
content += `<body>address: <a href=http://${
|
|
312
|
-
if (!
|
|
313
|
-
content +=
|
|
306
|
+
const file = `${this.pxeRoot}/index.html`;
|
|
307
|
+
let content = '';
|
|
308
|
+
content += '<html><title>Penguin\'s eggs PXE server</title>';
|
|
309
|
+
content += '<div style="background-image:url(\'/splash.png\');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">';
|
|
310
|
+
content += '<h1>Cucko PXE server</h1>';
|
|
311
|
+
content += `<body>address: <a href=http://${utils_2.default.address()}>${utils_2.default.address()}</a><br/>`;
|
|
312
|
+
if (!utils_2.default.isLive()) {
|
|
313
|
+
content += 'Serving:<li>';
|
|
314
314
|
for (const iso of this.isos) {
|
|
315
|
-
content += `<ul><a href='http://${
|
|
315
|
+
content += `<ul><a href='http://${utils_2.default.address()}/${iso}'>${iso}</a></ul>`;
|
|
316
316
|
}
|
|
317
|
-
content +=
|
|
317
|
+
content += '</li>';
|
|
318
318
|
}
|
|
319
319
|
else {
|
|
320
|
-
content +=
|
|
320
|
+
content += 'started from live iso image<br/>';
|
|
321
321
|
}
|
|
322
|
-
content +=
|
|
323
|
-
content +=
|
|
324
|
-
content +=
|
|
322
|
+
content += 'source: <a href=\'https://github.com/pieroproietti/penguins-eggs\'>https://github.com/pieroproietti/penguins-eggs</a><br/>';
|
|
323
|
+
content += 'manual: <a href=\'https://penguins-eggs.net/book/italiano9.2.html\'>italiano</a>, <a href=\'https://penguins--eggs-net.translate.goog/book/italiano9.2?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en\'>translated</a><br/>';
|
|
324
|
+
content += 'discuss: <a href=\'https://t.me/penguins_eggs\'>Telegram group<br/></body</html>';
|
|
325
325
|
fs_1.default.writeFileSync(file, content);
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
@@ -329,7 +329,7 @@ class Pxe {
|
|
|
329
329
|
* @param dhcpOptions
|
|
330
330
|
*/
|
|
331
331
|
dhcpStart(dhcpOptions) {
|
|
332
|
-
|
|
332
|
+
new etrick_1.default(dhcpOptions);
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* start http server for images
|
|
@@ -337,9 +337,9 @@ class Pxe {
|
|
|
337
337
|
*/
|
|
338
338
|
async httpStart() {
|
|
339
339
|
const port = 80;
|
|
340
|
-
const httpRoot = this.pxeRoot +
|
|
341
|
-
console.log(
|
|
342
|
-
|
|
340
|
+
const httpRoot = this.pxeRoot + '/';
|
|
341
|
+
console.log('http listening: 0.0.0.0:' + port);
|
|
342
|
+
const file = new (node_static_1.default.Server)(httpRoot);
|
|
343
343
|
http_1.default.createServer(function (req, res) {
|
|
344
344
|
file.serve(req, res);
|
|
345
345
|
}).listen(port);
|
|
@@ -348,17 +348,17 @@ class Pxe {
|
|
|
348
348
|
* start tftp
|
|
349
349
|
*/
|
|
350
350
|
async tftpStart(tftpOptions) {
|
|
351
|
-
|
|
352
|
-
tftpServer.on(
|
|
353
|
-
// Errors from the main socket
|
|
354
|
-
// The current transfers are not aborted
|
|
351
|
+
const tftpServer = tftp_1.default.createServer(tftpOptions);
|
|
352
|
+
tftpServer.on('error', function (error) {
|
|
353
|
+
// Errors from the main socket
|
|
354
|
+
// The current transfers are not aborted
|
|
355
355
|
console.error(error);
|
|
356
356
|
});
|
|
357
|
-
tftpServer.on(
|
|
358
|
-
req.on(
|
|
359
|
-
//Error from the request
|
|
360
|
-
//The connection is already closed
|
|
361
|
-
console.error(
|
|
357
|
+
tftpServer.on('request', function (req, res) {
|
|
358
|
+
req.on('error', function (error) {
|
|
359
|
+
// Error from the request
|
|
360
|
+
// The connection is already closed
|
|
361
|
+
console.error('[' + req.stats.remoteAddress + ':' + req.stats.remotePort + '] (' + req.file + ') ' + error.message);
|
|
362
362
|
});
|
|
363
363
|
});
|
|
364
364
|
tftpServer.listen();
|
|
@@ -372,11 +372,11 @@ class Pxe {
|
|
|
372
372
|
if (echo) {
|
|
373
373
|
console.log(cmd);
|
|
374
374
|
}
|
|
375
|
-
await (0,
|
|
375
|
+
await (0, utils_1.exec)(cmd, this.echo);
|
|
376
376
|
}
|
|
377
377
|
catch (error) {
|
|
378
378
|
console.log(`Error: ${error}`);
|
|
379
|
-
await
|
|
379
|
+
await utils_2.default.pressKeyToExit(cmd);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
}
|
package/dist/classes/settings.js
CHANGED
|
@@ -186,7 +186,7 @@ class Settings {
|
|
|
186
186
|
}
|
|
187
187
|
spaceAvailable = Number(shelljs_1.default
|
|
188
188
|
.exec(`df "${path}" | /usr/bin/awk 'NR==2 {print $4}'`, {
|
|
189
|
-
silent: true
|
|
189
|
+
silent: true,
|
|
190
190
|
})
|
|
191
191
|
.stdout.trim());
|
|
192
192
|
console.log(`Space available: ${Math.round((spaceAvailable / gb) * 10) / 10} GB`);
|
|
@@ -211,7 +211,7 @@ class Settings {
|
|
|
211
211
|
async loadRemix(basename = '', theme = '') {
|
|
212
212
|
this.remix.versionNumber = utils_1.default.getPackageVersion();
|
|
213
213
|
this.remix.kernel = utils_1.default.kernelVersion();
|
|
214
|
-
this.remix.branding = theme === '' ? 'eggs' : this.remix.branding = theme.
|
|
214
|
+
this.remix.branding = theme === '' ? 'eggs' : this.remix.branding = theme.slice(Math.max(0, theme.lastIndexOf('/') + 1));
|
|
215
215
|
this.remix.name = this.config.snapshot_basename;
|
|
216
216
|
let name = this.config.snapshot_prefix + this.config.snapshot_basename;
|
|
217
217
|
name = name.replace(/-/g, ' ').replace('egg of ', '');
|
|
@@ -16,14 +16,14 @@ const distro_1 = tslib_1.__importDefault(require("./distro"));
|
|
|
16
16
|
*/
|
|
17
17
|
class SourcesList {
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
*
|
|
20
|
+
* @param repos
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
23
|
async distribution(distributions) {
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* Linuxmint non ha nessuna configurazione in /etc/apt/sources.list
|
|
26
|
+
*/
|
|
27
27
|
let checked = true;
|
|
28
28
|
checked = false;
|
|
29
29
|
const distro = new distro_1.default();
|
|
@@ -35,25 +35,23 @@ class SourcesList {
|
|
|
35
35
|
return checked;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
*
|
|
39
|
+
* @param repos
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
42
|
async components(components) {
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
* Linuxmint non ha nessuna configurazione in /etc/apt/sources.list
|
|
45
|
+
*/
|
|
46
46
|
let checked = true;
|
|
47
47
|
const repos = await this.get();
|
|
48
|
-
if (repos.length
|
|
48
|
+
if (repos.length > 0) {
|
|
49
49
|
for (const repo of repos) {
|
|
50
50
|
for (const component of components) {
|
|
51
51
|
// On security we need just main
|
|
52
|
-
if (!repo.includes('security')) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
checked = false;
|
|
56
|
-
}
|
|
52
|
+
if (!repo.includes('security') && !repo.includes(component)) {
|
|
53
|
+
console.log('component: ' + chalk_1.default.green(component) + ' is not included in repo: ' + chalk_1.default.green(repo));
|
|
54
|
+
checked = false;
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
}
|
|
@@ -67,8 +65,8 @@ class SourcesList {
|
|
|
67
65
|
return checked;
|
|
68
66
|
}
|
|
69
67
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
72
70
|
async get() {
|
|
73
71
|
let universalSourcesList = '/etc/apt/sources.list';
|
|
74
72
|
const distro = new distro_1.default();
|
|
@@ -76,13 +74,13 @@ class SourcesList {
|
|
|
76
74
|
universalSourcesList = '/etc/apt/sources.list.d/official-package-repositories.list';
|
|
77
75
|
}
|
|
78
76
|
// deb uri distribution [component1] [component2] [...]
|
|
79
|
-
|
|
77
|
+
const checkRepos = await (0, utils_2.exec)(`grep "deb http"<${universalSourcesList}`, { echo: false, capture: true });
|
|
80
78
|
let tmp = [];
|
|
81
79
|
if (checkRepos.code === 0) {
|
|
82
80
|
tmp = checkRepos.data.split('\n');
|
|
83
81
|
}
|
|
84
82
|
// remove empty line
|
|
85
|
-
|
|
83
|
+
const repos = [];
|
|
86
84
|
for (const repo of tmp) {
|
|
87
85
|
if (repo !== '') {
|
|
88
86
|
repos.push(repo);
|
|
@@ -63,7 +63,7 @@ class SistemdCtl {
|
|
|
63
63
|
async isActive(service) {
|
|
64
64
|
return new Promise((resolve, reject) => {
|
|
65
65
|
(0, utils_1.exec)(`systemctl is-active ${service}`, this.echo)
|
|
66
|
-
.then(
|
|
66
|
+
.then(result => {
|
|
67
67
|
resolve(!result.data.includes('inactive'));
|
|
68
68
|
})
|
|
69
69
|
.catch(function (error) {
|
|
@@ -77,7 +77,7 @@ class SistemdCtl {
|
|
|
77
77
|
async isEnabled(service) {
|
|
78
78
|
return new Promise((resolve, reject) => {
|
|
79
79
|
(0, utils_1.exec)(`systemctl is-enabled ${service}`, this.echo)
|
|
80
|
-
.then(
|
|
80
|
+
.then(result => {
|
|
81
81
|
resolve(result.data.includes('enabled'));
|
|
82
82
|
})
|
|
83
83
|
.catch(function (error) {
|