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
|
@@ -7,54 +7,63 @@
|
|
|
7
7
|
*
|
|
8
8
|
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
9
|
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
10
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
14
|
exports.lvmPartInfo = void 0;
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const os_1 = tslib_1.__importDefault(require("os"));
|
|
15
|
+
const utils_js_1 = require("../../lib/utils.js");
|
|
16
|
+
const utils_js_2 = __importDefault(require("../../classes/utils.js"));
|
|
17
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
18
|
+
const os_1 = __importDefault(require("os"));
|
|
17
19
|
/**
|
|
18
20
|
*
|
|
19
21
|
* @param this
|
|
20
22
|
*/
|
|
21
23
|
async function partition() {
|
|
22
|
-
|
|
24
|
+
const echoYes = utils_js_2.default.setEcho(true);
|
|
23
25
|
let retVal = false;
|
|
24
26
|
const installDevice = this.partitions.installationDevice;
|
|
25
27
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
* Support for NVMe
|
|
29
|
+
*
|
|
30
|
+
* /dev/sda1 = /dev/nvme0n1p1
|
|
31
|
+
*/
|
|
30
32
|
let p = '';
|
|
31
33
|
if (installDevice.includes('nvme')) {
|
|
32
34
|
p = 'p';
|
|
33
35
|
}
|
|
34
36
|
const installMode = this.partitions.installationMode;
|
|
35
37
|
let swapSize = Math.round(os_1.default.totalmem() / 1073741824) * 1024;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
switch (this.partitions.userSwapChoice) {
|
|
39
|
+
case 'none': {
|
|
40
|
+
swapSize = 256;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case 'small': {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case 'suspend': {
|
|
47
|
+
swapSize *= 2;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 'file': {
|
|
51
|
+
swapSize = 0;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
// No default
|
|
46
55
|
}
|
|
47
56
|
if (installMode === 'standard' && !this.efi) {
|
|
48
57
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
await (0,
|
|
54
|
-
await (0,
|
|
55
|
-
await (0,
|
|
56
|
-
await (0,
|
|
57
|
-
await (0,
|
|
58
|
+
* ===========================================================================================
|
|
59
|
+
* BIOS: working
|
|
60
|
+
* ===========================================================================================
|
|
61
|
+
*/
|
|
62
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel msdos`, this.echo);
|
|
63
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap 1MiB ${swapSize + 1}MiB`, this.echo); // dev/sda1 swap
|
|
64
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 ${swapSize + 1}MiB 100%`, this.echo); // dev/sda2 root
|
|
65
|
+
await (0, utils_js_1.exec)(`parted ${installDevice} set 1 boot on`, this.echo);
|
|
66
|
+
await (0, utils_js_1.exec)(`parted ${installDevice} set 1 esp on`, this.echo);
|
|
58
67
|
// SWAP
|
|
59
68
|
this.devices.swap.name = `${installDevice}${p}1`;
|
|
60
69
|
this.devices.swap.fsType = 'swap';
|
|
@@ -64,38 +73,38 @@ async function partition() {
|
|
|
64
73
|
this.devices.root.fsType = 'ext4';
|
|
65
74
|
this.devices.root.mountPoint = '/';
|
|
66
75
|
// BOOT/DATA/EFI
|
|
67
|
-
this.devices.boot.name =
|
|
68
|
-
this.devices.data.name =
|
|
69
|
-
this.devices.efi.name =
|
|
76
|
+
this.devices.boot.name = 'none';
|
|
77
|
+
this.devices.data.name = 'none';
|
|
78
|
+
this.devices.efi.name = 'none';
|
|
70
79
|
retVal = true;
|
|
71
80
|
}
|
|
72
81
|
else if (installMode === 'full-encrypted' && !this.efi) {
|
|
73
82
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
await (0,
|
|
79
|
-
await (0,
|
|
80
|
-
await (0,
|
|
81
|
-
await (0,
|
|
82
|
-
await (0,
|
|
83
|
-
await (0,
|
|
83
|
+
* ===========================================================================================
|
|
84
|
+
* BIOS: full-encrypt:
|
|
85
|
+
* ===========================================================================================
|
|
86
|
+
*/
|
|
87
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel msdos`, this.echo);
|
|
88
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 1MiB 512MiB`, this.echo); // sda1
|
|
89
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap 512MiB ${swapSize + 512}MiB`, this.echo); // sda2
|
|
90
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 ${swapSize + 512}MiB 100%`, this.echo); // sda3
|
|
91
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
92
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
84
93
|
// BOOT 512M
|
|
85
|
-
this.devices.boot.name = `${installDevice}${p}1`; // 'boot'
|
|
94
|
+
this.devices.boot.name = `${installDevice}${p}1`; // 'boot'
|
|
86
95
|
this.devices.boot.fsType = 'ext4';
|
|
87
96
|
this.devices.boot.mountPoint = '/boot';
|
|
88
97
|
// SWAP 8G
|
|
89
98
|
// this.redraw(<Install message={`Formatting LUKS ${installDevice}2`} percent={0} />)
|
|
90
|
-
|
|
99
|
+
const crytoSwap = await (0, utils_js_1.exec)(`cryptsetup -y -v luksFormat --type luks2 ${installDevice}${p}2`, echoYes);
|
|
91
100
|
if (crytoSwap.code !== 0) {
|
|
92
|
-
|
|
101
|
+
utils_js_2.default.warning(`Error: ${crytoSwap.code} ${crytoSwap.data}`);
|
|
93
102
|
process.exit(1);
|
|
94
103
|
}
|
|
95
104
|
// this.redraw(<Install message={`Opening ${installDevice}${p}2 as swap_crypted`} percent={0} />)
|
|
96
|
-
|
|
105
|
+
const crytoSwapOpen = await (0, utils_js_1.exec)(`cryptsetup luksOpen --type luks2 ${installDevice}${p}2 swap_crypted`, echoYes);
|
|
97
106
|
if (crytoSwapOpen.code !== 0) {
|
|
98
|
-
|
|
107
|
+
utils_js_2.default.warning(`Error: ${crytoSwapOpen.code} ${crytoSwapOpen.data}`);
|
|
99
108
|
process.exit(1);
|
|
100
109
|
}
|
|
101
110
|
this.devices.swap.name = '/dev/mapper/swap_crypted';
|
|
@@ -104,15 +113,15 @@ async function partition() {
|
|
|
104
113
|
this.devices.swap.mountPoint = 'none';
|
|
105
114
|
// ROOT
|
|
106
115
|
// this.redraw(<Install message={`Formatting LUKS ${installDevice}${p}3`} percent={0} />)
|
|
107
|
-
|
|
116
|
+
const crytoRoot = await (0, utils_js_1.exec)(`cryptsetup -y -v luksFormat --type luks2 ${installDevice}${p}3`, echoYes);
|
|
108
117
|
if (crytoRoot.code !== 0) {
|
|
109
|
-
|
|
118
|
+
utils_js_2.default.warning(`Error: ${crytoRoot.code} ${crytoRoot.data}`);
|
|
110
119
|
process.exit(1);
|
|
111
120
|
}
|
|
112
121
|
// this.redraw(<Install message={`Opening ${installDevice}${p}3 as root_crypted`} percent={0} />)
|
|
113
|
-
|
|
122
|
+
const crytoRootOpen = await (0, utils_js_1.exec)(`cryptsetup luksOpen --type luks2 ${installDevice}${p}3 root_crypted`, echoYes);
|
|
114
123
|
if (crytoRootOpen.code !== 0) {
|
|
115
|
-
|
|
124
|
+
utils_js_2.default.warning(`Error: ${crytoRootOpen.code} ${crytoRootOpen.data}`);
|
|
116
125
|
process.exit(1);
|
|
117
126
|
}
|
|
118
127
|
this.devices.root.name = '/dev/mapper/root_crypted';
|
|
@@ -120,80 +129,80 @@ async function partition() {
|
|
|
120
129
|
this.devices.root.fsType = 'ext4';
|
|
121
130
|
this.devices.root.mountPoint = '/';
|
|
122
131
|
// BOOT/DATA/EFI
|
|
123
|
-
this.devices.data.name =
|
|
124
|
-
this.devices.efi.name =
|
|
132
|
+
this.devices.data.name = 'none';
|
|
133
|
+
this.devices.efi.name = 'none';
|
|
125
134
|
retVal = true;
|
|
126
135
|
}
|
|
127
136
|
else if (installMode === 'standard' && this.efi) {
|
|
128
137
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
await (0,
|
|
134
|
-
await (0,
|
|
135
|
-
await (0,
|
|
136
|
-
await (0,
|
|
137
|
-
await (0,
|
|
138
|
-
await (0,
|
|
138
|
+
* ===========================================================================================
|
|
139
|
+
* UEFI: working
|
|
140
|
+
* ===========================================================================================
|
|
141
|
+
*/
|
|
142
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel gpt`, this.echo);
|
|
143
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart efi fat32 34s 256MiB`, this.echo); // sda1 EFI
|
|
144
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap 256MiB ${swapSize + 256}Mib`, this.echo); // sda2 swap
|
|
145
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart root ext4 ${swapSize + 256}MiB 100%`, this.echo); // sda3 root
|
|
146
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
147
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
139
148
|
this.devices.efi.name = `${installDevice}${p}1`;
|
|
140
149
|
this.devices.efi.fsType = 'F 32 -I';
|
|
141
150
|
this.devices.efi.mountPoint = '/boot/efi';
|
|
142
|
-
this.devices.boot.name =
|
|
151
|
+
this.devices.boot.name = 'none';
|
|
143
152
|
this.devices.swap.name = `${installDevice}${p}2`;
|
|
144
153
|
this.devices.swap.fsType = 'swap';
|
|
145
154
|
this.devices.root.name = `${installDevice}${p}3`;
|
|
146
155
|
this.devices.root.fsType = 'ext4';
|
|
147
156
|
this.devices.root.mountPoint = '/';
|
|
148
157
|
// BOOT/DATA/EFI
|
|
149
|
-
this.devices.boot.name =
|
|
150
|
-
this.devices.data.name =
|
|
158
|
+
this.devices.boot.name = 'none';
|
|
159
|
+
this.devices.data.name = 'none';
|
|
151
160
|
// this.devices.efi.name = `none`
|
|
152
161
|
retVal = true;
|
|
153
162
|
}
|
|
154
163
|
else if (installMode === 'full-encrypted' && this.efi) {
|
|
155
164
|
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
await (0,
|
|
161
|
-
await (0,
|
|
162
|
-
await (0,
|
|
163
|
-
await (0,
|
|
164
|
-
await (0,
|
|
165
|
-
await (0,
|
|
166
|
-
await (0,
|
|
165
|
+
* ===========================================================================================
|
|
166
|
+
* UEFI, full-encrypt
|
|
167
|
+
* ===========================================================================================
|
|
168
|
+
*/
|
|
169
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel gpt`, this.echo);
|
|
170
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart efi fat32 34s 256MiB`, this.echo); // sda1 EFI
|
|
171
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart boot ext4 256MiB 768MiB`, this.echo); // sda2 boot
|
|
172
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap 768MiB ${swapSize + 768}MiB`, this.echo); // sda3 swap
|
|
173
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart root ext4 ${swapSize + 768}MiB 100%`, this.echo); // sda4 root
|
|
174
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
175
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
167
176
|
// EFI 256M
|
|
168
|
-
this.devices.efi.name = `${installDevice}${p}1`; // 'efi'
|
|
177
|
+
this.devices.efi.name = `${installDevice}${p}1`; // 'efi'
|
|
169
178
|
this.devices.efi.fsType = 'F 32 -I';
|
|
170
179
|
this.devices.efi.mountPoint = '/boot/efi';
|
|
171
180
|
// BOOT 512M
|
|
172
|
-
this.devices.boot.name = `${installDevice}${p}2`; // 'boot'
|
|
181
|
+
this.devices.boot.name = `${installDevice}${p}2`; // 'boot'
|
|
173
182
|
this.devices.boot.fsType = 'ext4';
|
|
174
183
|
this.devices.boot.mountPoint = '/boot';
|
|
175
184
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
* cryptsetup return codes are:
|
|
186
|
+
*
|
|
187
|
+
* 1 wrong parameters,
|
|
188
|
+
* 2 no permission (bad passphrase),
|
|
189
|
+
* 3 out of memory,
|
|
190
|
+
* 4 wrong device specified,
|
|
191
|
+
* 5 device already exists or device is busy.
|
|
192
|
+
*
|
|
193
|
+
* sometime due scarce memory 2GB, we can have the process killed
|
|
194
|
+
*/
|
|
186
195
|
// SWAP 8G
|
|
187
196
|
// redraw(<Install message={`Formatting LUKS ${installDevice}${p}3`} percent={0} />)
|
|
188
|
-
|
|
197
|
+
const crytoSwap = await (0, utils_js_1.exec)(`cryptsetup -y -v luksFormat --type luks2 ${installDevice}${p}3`, echoYes);
|
|
189
198
|
if (crytoSwap.code !== 0) {
|
|
190
|
-
|
|
199
|
+
utils_js_2.default.warning(`Error: ${crytoSwap.code} ${crytoSwap.data}`);
|
|
191
200
|
process.exit(1);
|
|
192
201
|
}
|
|
193
202
|
// this.redraw(<Install message={`Opening ${installDevice}${p}3 as swap_crypted`} percent={0} />)
|
|
194
|
-
|
|
203
|
+
const crytoSwapOpen = await (0, utils_js_1.exec)(`cryptsetup luksOpen --type luks2 ${installDevice}${p}3 swap_crypted`, echoYes);
|
|
195
204
|
if (crytoSwapOpen.code !== 0) {
|
|
196
|
-
|
|
205
|
+
utils_js_2.default.warning(`Error: ${crytoSwapOpen.code} ${crytoSwapOpen.data}`);
|
|
197
206
|
process.exit(1);
|
|
198
207
|
}
|
|
199
208
|
this.devices.swap.name = '/dev/mapper/swap_crypted';
|
|
@@ -202,15 +211,15 @@ async function partition() {
|
|
|
202
211
|
this.devices.swap.mountPoint = 'none';
|
|
203
212
|
// ROOT
|
|
204
213
|
// this.redraw(<Install message={`Formatting LUKS ${installDevice}${p}4`} percent={0} />)
|
|
205
|
-
|
|
214
|
+
const crytoRoot = await (0, utils_js_1.exec)(`cryptsetup -y -v luksFormat --type luks2 ${installDevice}${p}4`, echoYes);
|
|
206
215
|
if (crytoRoot.code !== 0) {
|
|
207
|
-
|
|
216
|
+
utils_js_2.default.warning(`Error: ${crytoRoot.code} ${crytoRoot.data}`);
|
|
208
217
|
process.exit(1);
|
|
209
218
|
}
|
|
210
219
|
// this.redraw(<Install message={`Opening ${installDevice}${p}4 as root_crypted`} percent={0} />)
|
|
211
|
-
|
|
220
|
+
const crytoRootOpen = await (0, utils_js_1.exec)(`cryptsetup luksOpen --type luks2 ${installDevice}${p}4 root_crypted`, echoYes);
|
|
212
221
|
if (crytoRootOpen.code !== 0) {
|
|
213
|
-
|
|
222
|
+
utils_js_2.default.warning(`Error: ${crytoRootOpen.code} ${crytoRootOpen.data}`);
|
|
214
223
|
process.exit(1);
|
|
215
224
|
}
|
|
216
225
|
this.devices.root.name = '/dev/mapper/root_crypted';
|
|
@@ -219,83 +228,83 @@ async function partition() {
|
|
|
219
228
|
this.devices.root.mountPoint = '/';
|
|
220
229
|
// BOOT/DATA/EFI
|
|
221
230
|
// this.devices.boot.name = `none`
|
|
222
|
-
this.devices.data.name =
|
|
231
|
+
this.devices.data.name = 'none';
|
|
223
232
|
// this.devices.efi.name = `none`
|
|
224
233
|
retVal = true;
|
|
225
234
|
}
|
|
226
235
|
else if (installMode === 'lvm2' && !this.efi) {
|
|
227
236
|
/**
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
* ===========================================================================================
|
|
238
|
+
* PROXMOX VE: BIOS and lvm2
|
|
239
|
+
* ===========================================================================================
|
|
240
|
+
*/
|
|
232
241
|
// Creo partizioni
|
|
233
|
-
await (0,
|
|
234
|
-
await (0,
|
|
235
|
-
await (0,
|
|
236
|
-
await (0,
|
|
237
|
-
await (0,
|
|
242
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel msdos`, this.echo);
|
|
243
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart primary ext2 1 512`, this.echo); // sda1
|
|
244
|
+
await (0, utils_js_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext2 512 100%`, this.echo); // sda2
|
|
245
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
246
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 2 lvm on`, this.echo); // sda2
|
|
238
247
|
const partInfo = await lvmPartInfo(installDevice);
|
|
239
248
|
const lvmPartname = partInfo[0];
|
|
240
249
|
const lvmSwapSize = partInfo[1];
|
|
241
250
|
const lvmRootSize = partInfo[2];
|
|
242
|
-
await (0,
|
|
243
|
-
await (0,
|
|
244
|
-
await (0,
|
|
245
|
-
await (0,
|
|
246
|
-
await (0,
|
|
247
|
-
await (0,
|
|
248
|
-
await (0,
|
|
249
|
-
this.devices.efi.name =
|
|
251
|
+
await (0, utils_js_1.exec)(`pvcreate /dev/${lvmPartname}`, this.echo);
|
|
252
|
+
await (0, utils_js_1.exec)(`vgcreate pve /dev/${lvmPartname}`, this.echo);
|
|
253
|
+
await (0, utils_js_1.exec)('vgchange -an', this.echo);
|
|
254
|
+
await (0, utils_js_1.exec)(`lvcreate -L ${lvmSwapSize} -nswap pve`, this.echo);
|
|
255
|
+
await (0, utils_js_1.exec)(`lvcreate -L ${lvmRootSize} -nroot pve`, this.echo);
|
|
256
|
+
await (0, utils_js_1.exec)('lvcreate -l 100%FREE -ndata pve', this.echo);
|
|
257
|
+
await (0, utils_js_1.exec)('vgchange -a y pve', this.echo);
|
|
258
|
+
this.devices.efi.name = 'none';
|
|
250
259
|
this.devices.boot.name = `${installDevice}${p}1`;
|
|
251
260
|
this.devices.root.fsType = 'ext2';
|
|
252
261
|
this.devices.root.mountPoint = '/boot';
|
|
253
|
-
this.devices.root.name =
|
|
262
|
+
this.devices.root.name = '/dev/pve/root';
|
|
254
263
|
this.devices.root.fsType = 'ext4';
|
|
255
264
|
this.devices.root.mountPoint = '/';
|
|
256
|
-
this.devices.data.name =
|
|
265
|
+
this.devices.data.name = '/dev/pve/data';
|
|
257
266
|
this.devices.data.fsType = 'ext4';
|
|
258
267
|
this.devices.data.mountPoint = '/var/lib/vz';
|
|
259
|
-
this.devices.swap.name =
|
|
268
|
+
this.devices.swap.name = '/dev/pve/swap';
|
|
260
269
|
retVal = true;
|
|
261
270
|
}
|
|
262
271
|
else if (this.partitions.installationMode === 'lvm2' && this.efi) {
|
|
263
272
|
/**
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
await (0,
|
|
269
|
-
await (0,
|
|
270
|
-
await (0,
|
|
271
|
-
await (0,
|
|
272
|
-
await (0,
|
|
273
|
-
await (0,
|
|
274
|
-
await (0,
|
|
273
|
+
* ===========================================================================================
|
|
274
|
+
* PROXMOX VE: lvm2 and UEFI
|
|
275
|
+
* ===========================================================================================
|
|
276
|
+
*/
|
|
277
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mklabel gpt`, this.echo);
|
|
278
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart efi fat32 34s 256MiB`, this.echo); // sda1 EFI
|
|
279
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart boot ext2 256MiB 768MiB`, this.echo); // sda2 boot
|
|
280
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} mkpart lvm ext4 768MiB 100%`, this.echo); // sda3 lmv2
|
|
281
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
282
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
283
|
+
await (0, utils_js_1.exec)(`parted --script ${installDevice} set 3 lvm on`, this.echo); // sda3
|
|
275
284
|
const partInfo = await lvmPartInfo(installDevice);
|
|
276
285
|
const lvmPartname = partInfo[0];
|
|
277
286
|
const lvmSwapSize = partInfo[1];
|
|
278
287
|
const lvmRootSize = partInfo[2];
|
|
279
|
-
await (0,
|
|
280
|
-
await (0,
|
|
281
|
-
await (0,
|
|
282
|
-
await (0,
|
|
283
|
-
await (0,
|
|
284
|
-
await (0,
|
|
285
|
-
await (0,
|
|
288
|
+
await (0, utils_js_1.exec)(`pvcreate /dev/${lvmPartname}`, this.echo);
|
|
289
|
+
await (0, utils_js_1.exec)(`vgcreate pve /dev/${lvmPartname}`, this.echo);
|
|
290
|
+
await (0, utils_js_1.exec)('vgchange -an', this.echo);
|
|
291
|
+
await (0, utils_js_1.exec)(`lvcreate -L ${lvmSwapSize} -nswap pve`, this.echo);
|
|
292
|
+
await (0, utils_js_1.exec)(`lvcreate -L ${lvmRootSize} -nroot pve`, this.echo);
|
|
293
|
+
await (0, utils_js_1.exec)('lvcreate -l 100%FREE -ndata pve', this.echo);
|
|
294
|
+
await (0, utils_js_1.exec)('vgchange -a y pve', this.echo);
|
|
286
295
|
this.devices.efi.name = `${installDevice}${p}1`;
|
|
287
296
|
this.devices.efi.fsType = 'F 32 -I';
|
|
288
297
|
this.devices.efi.mountPoint = '/boot/efi';
|
|
289
298
|
this.devices.boot.name = `${installDevice}${p}2`;
|
|
290
299
|
this.devices.boot.fsType = 'ext4';
|
|
291
300
|
this.devices.boot.mountPoint = '/boot';
|
|
292
|
-
this.devices.root.name =
|
|
301
|
+
this.devices.root.name = '/dev/pve/root';
|
|
293
302
|
this.devices.root.fsType = 'ext4';
|
|
294
303
|
this.devices.root.mountPoint = '/';
|
|
295
|
-
this.devices.data.name =
|
|
304
|
+
this.devices.data.name = '/dev/pve/data';
|
|
296
305
|
this.devices.data.fsType = 'ext4';
|
|
297
306
|
this.devices.data.mountPoint = '/var/lib/vz';
|
|
298
|
-
this.devices.swap.name =
|
|
307
|
+
this.devices.swap.name = '/dev/pve/swap';
|
|
299
308
|
retVal = true;
|
|
300
309
|
}
|
|
301
310
|
return retVal;
|
|
@@ -7,14 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
9
|
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
10
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const
|
|
12
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
14
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
15
|
/**
|
|
14
16
|
* removeInstallerLink
|
|
15
17
|
*/
|
|
16
18
|
async function removeInstallerLink() {
|
|
17
|
-
|
|
19
|
+
const file = `${this.installTarget}/usr/bin/penguins-links-add.sh`;
|
|
18
20
|
let lines = [];
|
|
19
21
|
let content = '';
|
|
20
22
|
if (fs_1.default.existsSync(file)) {
|
|
@@ -7,24 +7,26 @@
|
|
|
7
7
|
*
|
|
8
8
|
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
9
|
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
10
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const utils_2 = require("../../lib/utils");
|
|
14
|
+
const utils_js_1 = __importDefault(require("../../classes/utils.js"));
|
|
15
|
+
const utils_js_2 = require("../../lib/utils.js");
|
|
14
16
|
/**
|
|
15
17
|
*
|
|
16
18
|
* @param mountpoint
|
|
17
19
|
*/
|
|
18
20
|
async function umount(mountPoint = '') {
|
|
19
21
|
let message = 'umount: ' + mountPoint;
|
|
20
|
-
if (
|
|
22
|
+
if (utils_js_1.default.isMountpoint(mountPoint)) {
|
|
21
23
|
try {
|
|
22
|
-
await (0,
|
|
23
|
-
await (0,
|
|
24
|
+
await (0, utils_js_2.exec)(`umount ${mountPoint} ${this.toNull}`, this.echo);
|
|
25
|
+
await (0, utils_js_2.exec)('sleep 1', this.echo);
|
|
24
26
|
}
|
|
25
27
|
catch (error) {
|
|
26
28
|
message += +mountPoint + JSON.stringify(error);
|
|
27
|
-
await
|
|
29
|
+
await utils_js_1.default.pressKeyToExit(message);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -7,17 +7,19 @@
|
|
|
7
7
|
*
|
|
8
8
|
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
9
|
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
10
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const utils_2 = require("../../lib/utils");
|
|
14
|
+
const utils_js_1 = __importDefault(require("../../classes/utils.js"));
|
|
15
|
+
const utils_js_2 = require("../../lib/utils.js");
|
|
14
16
|
/**
|
|
15
17
|
* unpackfs
|
|
16
18
|
*/
|
|
17
19
|
async function unpackfs() {
|
|
18
|
-
//const cmd = `unsquashfs -d ${this.installTarget} -f ${this.distro.liveMediumPath}`
|
|
20
|
+
// const cmd = `unsquashfs -d ${this.installTarget} -f ${this.distro.liveMediumPath}`
|
|
19
21
|
const cmd = `unsquashfs -d ${this.installTarget} -f ${this.distro.liveMediumPath}${this.distro.squashfs}`;
|
|
20
|
-
const echoYes =
|
|
21
|
-
await (0,
|
|
22
|
+
const echoYes = utils_js_1.default.setEcho(true);
|
|
23
|
+
await (0, utils_js_2.exec)(cmd, echoYes);
|
|
22
24
|
}
|
|
23
25
|
exports.default = unpackfs;
|