penguins-eggs 9.1.31 → 9.1.37
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/README.md +61 -20
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
- package/addons/eggs/adapt/bin/adapt +0 -0
- package/addons/eggs/ichoice/bin/eggs-ichoice.sh +0 -0
- package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
- package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
- package/addons/eggs/theme/applications/install-debian.desktop +2 -2
- package/addons/neon/theme/applications/install-debian.desktop +0 -0
- package/addons/telos/theme/applications/install-debian.desktop +0 -0
- package/addons/ufficiozero/theme/applications/install-debian.desktop +0 -0
- package/addons/waydroid/theme/applications/install-debian.desktop +0 -0
- package/assets/calamares/install-debian +0 -0
- package/assets/penguins-eggs.desktop +0 -0
- package/assets/penguins-krill.desktop +0 -0
- package/assets/penguins-links-add.desktop +0 -0
- package/assets/penguins-live-installer.desktop +0 -0
- package/bin/dev +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/after-bootloader/after-bootloader.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/before-bootloader/before-bootloader.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/before-bootloader-mkdirs/before-bootloader-mkdirs.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/bug/bug.sh +0 -0
- package/conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py +0 -0
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/buster/calamares/modules/locale.yml +3 -3
- package/conf/distros/focal/calamares/calamares-modules/automirror/main.py +0 -0
- package/conf/eggs.yaml +2 -2
- package/conf/exclude.list +81 -96
- package/conf/tools.yaml +1 -1
- package/lib/classes/compressors.d.ts +7 -0
- package/lib/classes/compressors.js +38 -1
- package/lib/classes/daddy.js +6 -29
- package/lib/classes/distro.js +25 -12
- package/lib/classes/incubation/fisherman-helper/packages.js +6 -3
- package/lib/classes/keyboards.d.ts +10 -12
- package/lib/classes/keyboards.js +19 -23
- package/lib/classes/locales.js +15 -10
- package/lib/classes/ovary.js +53 -17
- package/lib/classes/utils.js +20 -6
- package/lib/commands/{install.d.ts → krill.d.ts} +1 -0
- package/lib/commands/{install.js → krill.js} +2 -2
- package/lib/commands/produce.js +8 -30
- package/lib/components/elements/information.js +0 -2
- package/lib/{classes/krill_prepare.d.ts → krill/krill-prepare.d.ts} +9 -2
- package/lib/{classes/krill_prepare.js → krill/krill-prepare.js} +62 -12
- package/lib/krill/krill-sequence.d.ts +148 -0
- package/lib/krill/krill-sequence.js +533 -0
- package/lib/krill/modules/add-user.d.ts +15 -0
- package/lib/krill/modules/add-user.js +41 -0
- package/lib/krill/modules/bootloader-config-arch.d.ts +9 -0
- package/lib/krill/modules/bootloader-config-arch.js +13 -0
- package/lib/krill/modules/bootloader-config-ubuntu.d.ts +9 -0
- package/lib/krill/modules/bootloader-config-ubuntu.js +93 -0
- package/lib/krill/modules/bootloader-config.d.ts +9 -0
- package/lib/krill/modules/bootloader-config.js +23 -0
- package/lib/krill/modules/bootloader.d.ts +10 -0
- package/lib/krill/modules/bootloader.js +43 -0
- package/lib/krill/modules/change-password.d.ts +10 -0
- package/lib/krill/modules/change-password.js +16 -0
- package/lib/krill/modules/del-live-user.d.ts +9 -0
- package/lib/krill/modules/del-live-user.js +37 -0
- package/lib/krill/modules/fstab.d.ts +9 -0
- package/lib/krill/modules/fstab.js +93 -0
- package/lib/krill/modules/grubcfg.d.ts +12 -0
- package/lib/krill/modules/grubcfg.js +33 -0
- package/lib/krill/modules/hostname.d.ts +8 -0
- package/lib/krill/modules/hostname.js +13 -0
- package/lib/krill/modules/hosts.d.ts +9 -0
- package/lib/krill/modules/hosts.js +30 -0
- package/lib/krill/modules/initramfs-cfg.d.ts +9 -0
- package/lib/krill/modules/initramfs-cfg.js +29 -0
- package/lib/krill/modules/initramfs.d.ts +8 -0
- package/lib/krill/modules/initramfs.js +42 -0
- package/lib/krill/modules/locale-cfg.d.ts +5 -0
- package/lib/krill/modules/locale-cfg.js +58 -0
- package/lib/krill/modules/locale.d.ts +8 -0
- package/lib/krill/modules/locale.js +47 -0
- package/lib/krill/modules/machine-id.d.ts +10 -0
- package/lib/krill/modules/machine-id.js +21 -0
- package/lib/krill/modules/mkfs.d.ts +8 -0
- package/lib/krill/modules/mkfs.js +33 -0
- package/lib/krill/modules/mount-fs.d.ts +12 -0
- package/lib/krill/modules/mount-fs.js +63 -0
- package/lib/krill/modules/mount-vfs.d.ts +12 -0
- package/lib/krill/modules/mount-vfs.js +40 -0
- package/lib/krill/modules/network-cfg.d.ts +14 -0
- package/lib/krill/modules/network-cfg.js +49 -0
- package/lib/krill/modules/partitions.d.ts +15 -0
- package/lib/krill/modules/partitions.js +307 -0
- package/lib/krill/modules/remove-installer-link.d.ts +8 -0
- package/lib/krill/modules/remove-installer-link.js +34 -0
- package/lib/krill/modules/set-keyboard.d.ts +5 -0
- package/lib/krill/modules/set-keyboard.js +50 -0
- package/lib/krill/modules/set-timezone.d.ts +9 -0
- package/lib/krill/modules/set-timezone.js +21 -0
- package/lib/krill/modules/umount.d.ts +9 -0
- package/lib/krill/modules/umount.js +26 -0
- package/lib/krill/modules/unpackfs.d.ts +8 -0
- package/lib/krill/modules/unpackfs.js +17 -0
- package/lib/lib/cli-autologin.js +3 -3
- package/lib/lib/select_keyboard_variant.js +1 -0
- package/lib/lib/utils.d.ts +27 -0
- package/lib/lib/utils.js +54 -19
- package/manpages/doc/man/eggs.html +122 -90
- package/mkinitcpio/README.md +8 -1
- package/mkinitcpio/archlinux/README.md +116 -0
- package/mkinitcpio/archlinux/mkinitcpio-install.conf +5 -0
- package/mkinitcpio/archlinux/mkinitcpio-produce.conf +13 -0
- package/mkinitcpio/manjaro/README.md +31 -11
- package/mkinitcpio/manjaro/mkinitcpio-install.conf +7 -0
- package/mkinitcpio/manjaro/{mkinitcpio.conf → mkinitcpio-produce.conf} +1 -1
- package/package.json +117 -112
- package/scripts/_eggs +8 -8
- package/scripts/bros/waydroid-helper.sh +0 -0
- package/scripts/eggs-adapt.sh +0 -0
- package/scripts/eggs.bash +1 -1
- package/scripts/install-eggs-ppa.sh +0 -0
- package/scripts/mom-cli.sh +8 -8
- package/scripts/pve-live.service +0 -0
- package/scripts/pve-live.sh +0 -0
- package/scripts/resy.sh +0 -0
- package/scripts/userexist.sh +0 -0
- package/lib/classes/i18n.d.ts +0 -34
- package/lib/classes/i18n.js +0 -126
- package/lib/classes/krill_install.d.ts +0 -227
- package/lib/classes/krill_install.js +0 -1370
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* penguins-eggs: krill_sequence
|
|
4
|
+
*
|
|
5
|
+
* author: Piero Proietti
|
|
6
|
+
* mail: piero.proietti@gmail.com
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const settings_1 = tslib_1.__importDefault(require("../classes/settings"));
|
|
12
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
13
|
+
const ink_1 = require("ink");
|
|
14
|
+
const install_1 = tslib_1.__importDefault(require("../components/install"));
|
|
15
|
+
const finished_1 = tslib_1.__importDefault(require("../components/finished"));
|
|
16
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
17
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
18
|
+
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
19
|
+
const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
|
|
20
|
+
const cliAutologin = require("../lib/cli-autologin");
|
|
21
|
+
const pacman_1 = tslib_1.__importDefault(require("../classes/pacman"));
|
|
22
|
+
const installer_1 = require("../classes/incubation/installer");
|
|
23
|
+
const xdg_1 = tslib_1.__importDefault(require("../classes/xdg"));
|
|
24
|
+
const distro_1 = tslib_1.__importDefault(require("../classes/distro"));
|
|
25
|
+
const utils_2 = require("../lib/utils");
|
|
26
|
+
// import krill modules
|
|
27
|
+
const partitions_1 = tslib_1.__importDefault(require("./modules/partitions"));
|
|
28
|
+
const mount_fs_1 = require("./modules/mount-fs");
|
|
29
|
+
const mount_vfs_1 = require("./modules/mount-vfs");
|
|
30
|
+
const unpackfs_1 = tslib_1.__importDefault(require("./modules/unpackfs"));
|
|
31
|
+
const machine_id_1 = tslib_1.__importDefault(require("./modules/machine-id"));
|
|
32
|
+
const fstab_1 = tslib_1.__importDefault(require("./modules/fstab"));
|
|
33
|
+
const locale_1 = tslib_1.__importDefault(require("./modules/locale"));
|
|
34
|
+
const set_keyboard_1 = tslib_1.__importDefault(require("./modules/set-keyboard"));
|
|
35
|
+
const locale_cfg_1 = tslib_1.__importDefault(require("./modules/locale-cfg"));
|
|
36
|
+
// users
|
|
37
|
+
const add_user_1 = tslib_1.__importDefault(require("./modules/add-user"));
|
|
38
|
+
const change_password_1 = tslib_1.__importDefault(require("./modules/change-password"));
|
|
39
|
+
// displaymanager: autologin
|
|
40
|
+
const network_cfg_1 = tslib_1.__importDefault(require("./modules/network-cfg"));
|
|
41
|
+
// hwclock:
|
|
42
|
+
// services-systemd:
|
|
43
|
+
// bootloader-config
|
|
44
|
+
const bootloader_config_1 = tslib_1.__importDefault(require("./modules/bootloader-config"));
|
|
45
|
+
const bootloader_config_arch_1 = tslib_1.__importDefault(require("./modules/bootloader-config-arch"));
|
|
46
|
+
const bootloader_config_ubuntu_1 = tslib_1.__importDefault(require("./modules/bootloader-config-ubuntu"));
|
|
47
|
+
//
|
|
48
|
+
const grubcfg_1 = tslib_1.__importDefault(require("./modules/grubcfg"));
|
|
49
|
+
const bootloader_1 = tslib_1.__importDefault(require("./modules/bootloader"));
|
|
50
|
+
// packages: removeInstallerLink
|
|
51
|
+
const remove_installer_link_1 = tslib_1.__importDefault(require("./modules/remove-installer-link"));
|
|
52
|
+
// luksbootkeyfile:
|
|
53
|
+
// plymouthcfg;
|
|
54
|
+
const initramfs_cfg_1 = tslib_1.__importDefault(require("./modules/initramfs-cfg"));
|
|
55
|
+
const initramfs_1 = tslib_1.__importDefault(require("./modules/initramfs"));
|
|
56
|
+
const del_live_user_1 = tslib_1.__importDefault(require("./modules/del-live-user"));
|
|
57
|
+
// umount already imported
|
|
58
|
+
// to order in same wat
|
|
59
|
+
const set_timezone_1 = tslib_1.__importDefault(require("./modules/set-timezone"));
|
|
60
|
+
const umount_1 = tslib_1.__importDefault(require("./modules/umount"));
|
|
61
|
+
const mkfs_1 = tslib_1.__importDefault(require("./modules/mkfs"));
|
|
62
|
+
const hostname_1 = tslib_1.__importDefault(require("./modules/hostname"));
|
|
63
|
+
const hosts_1 = tslib_1.__importDefault(require("./modules/hosts"));
|
|
64
|
+
/**
|
|
65
|
+
* hatching: installazione o cova!!!
|
|
66
|
+
*/
|
|
67
|
+
class Sequence {
|
|
68
|
+
/**
|
|
69
|
+
* constructor
|
|
70
|
+
*/
|
|
71
|
+
constructor(location, keyboard, partitions, users, network) {
|
|
72
|
+
this.partition = partitions_1.default;
|
|
73
|
+
// mount
|
|
74
|
+
this.mountFs = mount_fs_1.mountFs;
|
|
75
|
+
this.mountVfs = mount_vfs_1.mountVfs;
|
|
76
|
+
//
|
|
77
|
+
this.unpackfs = unpackfs_1.default;
|
|
78
|
+
this.machineId = machine_id_1.default;
|
|
79
|
+
this.fstab = fstab_1.default;
|
|
80
|
+
this.locale = locale_1.default;
|
|
81
|
+
this.setKeyboard = set_keyboard_1.default;
|
|
82
|
+
this.localeCfg = locale_cfg_1.default;
|
|
83
|
+
// users
|
|
84
|
+
this.addUser = add_user_1.default;
|
|
85
|
+
this.changePassword = change_password_1.default;
|
|
86
|
+
// displaumanager: autologin
|
|
87
|
+
this.networkCfg = network_cfg_1.default;
|
|
88
|
+
// hwclock:
|
|
89
|
+
// services-systemd:
|
|
90
|
+
// bootloader-config
|
|
91
|
+
this.bootloaderConfig = bootloader_config_1.default;
|
|
92
|
+
this.bootloaderConfigArch = bootloader_config_arch_1.default;
|
|
93
|
+
this.bootloaderConfigUbuntu = bootloader_config_ubuntu_1.default;
|
|
94
|
+
//
|
|
95
|
+
this.grubcfg = grubcfg_1.default;
|
|
96
|
+
this.bootloader = bootloader_1.default;
|
|
97
|
+
// packages: removeInstallerLink
|
|
98
|
+
this.removeInstallerLink = remove_installer_link_1.default;
|
|
99
|
+
// luksbootkeyfile:
|
|
100
|
+
// plymouthcfg;
|
|
101
|
+
this.initramfsCfg = initramfs_cfg_1.default;
|
|
102
|
+
this.initramfs = initramfs_1.default;
|
|
103
|
+
this.delLiveUser = del_live_user_1.default;
|
|
104
|
+
this.umountFs = mount_fs_1.umountFs;
|
|
105
|
+
this.umountVfs = mount_vfs_1.umountVfs;
|
|
106
|
+
// to order in same wat
|
|
107
|
+
this.setTimezone = set_timezone_1.default;
|
|
108
|
+
this.umount = umount_1.default;
|
|
109
|
+
this.mkfs = mkfs_1.default;
|
|
110
|
+
this.hostname = hostname_1.default;
|
|
111
|
+
this.hosts = hosts_1.default;
|
|
112
|
+
this.installer = {};
|
|
113
|
+
this.installTarget = '/tmp/calamares-krill-root';
|
|
114
|
+
this.verbose = false;
|
|
115
|
+
this.echo = {};
|
|
116
|
+
this.efi = false;
|
|
117
|
+
this.devices = {};
|
|
118
|
+
this.users = {};
|
|
119
|
+
this.network = {};
|
|
120
|
+
this.partitions = {};
|
|
121
|
+
this.language = '';
|
|
122
|
+
this.region = '';
|
|
123
|
+
this.zone = '';
|
|
124
|
+
this.keyboardModel = '';
|
|
125
|
+
this.keyboardLayout = '';
|
|
126
|
+
this.keyboardVariant = '';
|
|
127
|
+
this.toNull = ' > /dev/null 2>&1';
|
|
128
|
+
this.settings = {};
|
|
129
|
+
this.remix = {};
|
|
130
|
+
this.distro = {};
|
|
131
|
+
this.luksName = '';
|
|
132
|
+
this.luksFile = '';
|
|
133
|
+
this.luksDevice = '';
|
|
134
|
+
this.luksMountpoint = '';
|
|
135
|
+
this.installer = (0, installer_1.installer)();
|
|
136
|
+
this.settings = new settings_1.default();
|
|
137
|
+
this.language = location.language;
|
|
138
|
+
this.region = location.region;
|
|
139
|
+
this.zone = location.zone;
|
|
140
|
+
this.keyboardModel = keyboard.keyboardModel;
|
|
141
|
+
this.keyboardLayout = keyboard.keyboardLayout;
|
|
142
|
+
this.keyboardVariant = keyboard.keyboardVariant;
|
|
143
|
+
this.network = network;
|
|
144
|
+
this.partitions = partitions;
|
|
145
|
+
this.users = users;
|
|
146
|
+
this.devices.efi = {};
|
|
147
|
+
this.devices.boot = {};
|
|
148
|
+
this.devices.root = {};
|
|
149
|
+
this.devices.data = {};
|
|
150
|
+
this.devices.swap = {};
|
|
151
|
+
this.distro = new distro_1.default(this.remix);
|
|
152
|
+
this.efi = fs_1.default.existsSync('/sys/firmware/efi/efivars');
|
|
153
|
+
// Per il restore dei dati
|
|
154
|
+
this.luksName = 'luks-eggs-backup';
|
|
155
|
+
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
156
|
+
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
157
|
+
this.luksMountpoint = `/mnt`;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* install
|
|
161
|
+
* @param verbose
|
|
162
|
+
* @param umount
|
|
163
|
+
* @returns
|
|
164
|
+
*/
|
|
165
|
+
async install(verbose = false) {
|
|
166
|
+
this.verbose = verbose;
|
|
167
|
+
this.echo = utils_1.default.setEcho(this.verbose);
|
|
168
|
+
if (this.verbose) {
|
|
169
|
+
this.toNull = '';
|
|
170
|
+
}
|
|
171
|
+
// start
|
|
172
|
+
await this.settings.load();
|
|
173
|
+
// partition
|
|
174
|
+
let percent = 0.0;
|
|
175
|
+
let message = "";
|
|
176
|
+
let isPartitioned = false;
|
|
177
|
+
message = "Creating partitions";
|
|
178
|
+
percent = 0.01;
|
|
179
|
+
try {
|
|
180
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
181
|
+
isPartitioned = await this.partition();
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
185
|
+
}
|
|
186
|
+
if (isPartitioned) {
|
|
187
|
+
// formatting
|
|
188
|
+
message = "Formatting file system ";
|
|
189
|
+
percent = 0.02;
|
|
190
|
+
try {
|
|
191
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
192
|
+
await this.mkfs();
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
196
|
+
}
|
|
197
|
+
// mountFs
|
|
198
|
+
message = "Mounting target file system ";
|
|
199
|
+
percent = 0.03;
|
|
200
|
+
try {
|
|
201
|
+
redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
202
|
+
await this.mountFs();
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
206
|
+
}
|
|
207
|
+
// mountVfs
|
|
208
|
+
message = "Mounting on target VFS ";
|
|
209
|
+
percent = 0.06;
|
|
210
|
+
try {
|
|
211
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
212
|
+
await this.mountVfs();
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
216
|
+
}
|
|
217
|
+
// unpackfs
|
|
218
|
+
message = "Unpacking filesystem ";
|
|
219
|
+
percent = 0.10;
|
|
220
|
+
try {
|
|
221
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
222
|
+
await this.unpackfs();
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* IF RESTORE USERS DATA
|
|
229
|
+
*/
|
|
230
|
+
if (fs_1.default.existsSync(this.luksFile)) {
|
|
231
|
+
// restoring users data
|
|
232
|
+
message = "Restore private data from backup ";
|
|
233
|
+
percent = 0.37;
|
|
234
|
+
let cmd = 'eggs syncfrom --rootdir /tmp/calamares-krill-root/';
|
|
235
|
+
try {
|
|
236
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
237
|
+
await (0, utils_2.exec)(cmd, utils_1.default.setEcho(true));
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
await utils_1.default.pressKeyToExit(cmd);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// sources-yolk
|
|
244
|
+
if (this.distro.familyId === 'debian') {
|
|
245
|
+
message = 'sources-yolk';
|
|
246
|
+
percent = 0.40;
|
|
247
|
+
try {
|
|
248
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
249
|
+
await this.execCalamaresModule('sources-yolk');
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// machineid
|
|
256
|
+
message = 'machineid';
|
|
257
|
+
percent = 0.41;
|
|
258
|
+
try {
|
|
259
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
260
|
+
await this.machineId();
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
264
|
+
}
|
|
265
|
+
// fstab
|
|
266
|
+
message = "Creating fstab ";
|
|
267
|
+
percent = 0.47;
|
|
268
|
+
try {
|
|
269
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
270
|
+
await this.fstab(this.partitions.installationDevice);
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
274
|
+
}
|
|
275
|
+
// locale
|
|
276
|
+
message = "Locale ";
|
|
277
|
+
percent = 0.47;
|
|
278
|
+
try {
|
|
279
|
+
redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
280
|
+
await this.locale();
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
284
|
+
}
|
|
285
|
+
// keyboard
|
|
286
|
+
message = "settings keyboard ";
|
|
287
|
+
percent = 0.48;
|
|
288
|
+
try {
|
|
289
|
+
this.setKeyboard();
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
293
|
+
}
|
|
294
|
+
// localeCfg
|
|
295
|
+
message = "localeCfg";
|
|
296
|
+
percent = 0.50;
|
|
297
|
+
try {
|
|
298
|
+
this.localeCfg();
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
302
|
+
}
|
|
303
|
+
// networkcfg
|
|
304
|
+
message = "networkcfg";
|
|
305
|
+
percent = 0.50;
|
|
306
|
+
try {
|
|
307
|
+
this.networkCfg();
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
311
|
+
}
|
|
312
|
+
// hostname
|
|
313
|
+
message = "Create hostname ";
|
|
314
|
+
percent = 0.53;
|
|
315
|
+
try {
|
|
316
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
317
|
+
await this.hostname();
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
321
|
+
}
|
|
322
|
+
// hosts
|
|
323
|
+
message = "Creating hosts ";
|
|
324
|
+
percent = 0.60;
|
|
325
|
+
try {
|
|
326
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
327
|
+
await this.hosts();
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
331
|
+
}
|
|
332
|
+
// bootloader-config
|
|
333
|
+
message = "bootloader-config ";
|
|
334
|
+
percent = 0.62;
|
|
335
|
+
try {
|
|
336
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
337
|
+
await this.bootloaderConfig();
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
341
|
+
}
|
|
342
|
+
// grubcfg
|
|
343
|
+
message = "grubcfg ";
|
|
344
|
+
percent = 0.63;
|
|
345
|
+
try {
|
|
346
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
347
|
+
await this.grubcfg();
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
351
|
+
}
|
|
352
|
+
// bootloader
|
|
353
|
+
message = "bootloader ";
|
|
354
|
+
percent = 0.64;
|
|
355
|
+
try {
|
|
356
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
357
|
+
await this.bootloader();
|
|
358
|
+
}
|
|
359
|
+
catch (error) {
|
|
360
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
361
|
+
}
|
|
362
|
+
// initramfsCfg
|
|
363
|
+
message = "initramfs configure";
|
|
364
|
+
percent = 0.65;
|
|
365
|
+
try {
|
|
366
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
367
|
+
this.initramfsCfg(this.partitions.installationDevice);
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
371
|
+
}
|
|
372
|
+
// initramfs
|
|
373
|
+
message = "initramfs ";
|
|
374
|
+
percent = 0.67;
|
|
375
|
+
try {
|
|
376
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
377
|
+
await this.initramfs();
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* IF NOT RESTORE USERS DATA
|
|
384
|
+
*/
|
|
385
|
+
if (!fs_1.default.existsSync(this.luksFile)) {
|
|
386
|
+
// delLiveUser
|
|
387
|
+
message = "Removing user live ";
|
|
388
|
+
percent = 0.70;
|
|
389
|
+
try {
|
|
390
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
391
|
+
await this.delLiveUser();
|
|
392
|
+
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
395
|
+
}
|
|
396
|
+
// addUser
|
|
397
|
+
message = "Adding user ";
|
|
398
|
+
percent = 0.73;
|
|
399
|
+
try {
|
|
400
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
401
|
+
await this.addUser(this.users.name, this.users.password, this.users.fullname, '', '', '');
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
405
|
+
}
|
|
406
|
+
// changePassword
|
|
407
|
+
message = "adding user password ";
|
|
408
|
+
percent = 0.77;
|
|
409
|
+
try {
|
|
410
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
411
|
+
await this.changePassword('root', this.users.rootPassword);
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
// autologin
|
|
418
|
+
if (pacman_1.default.isInstalledGui()) {
|
|
419
|
+
try {
|
|
420
|
+
message = "autologin GUI";
|
|
421
|
+
percent = 0.80;
|
|
422
|
+
await xdg_1.default.autologin(utils_1.default.getPrimaryUser(), this.users.name, this.installTarget);
|
|
423
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else { // autologin CLI remove DEFAULT
|
|
430
|
+
message = "autologin CLI";
|
|
431
|
+
percent = 0.80;
|
|
432
|
+
try {
|
|
433
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
434
|
+
await cliAutologin.remove(this.installTarget);
|
|
435
|
+
}
|
|
436
|
+
catch (error) {
|
|
437
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// cleanup
|
|
441
|
+
await cliAutologin.msgRemove(`${this.installTarget}/etc/motd`);
|
|
442
|
+
await cliAutologin.msgRemove(`${this.installTarget}/etc/issue`);
|
|
443
|
+
// removeInstaller
|
|
444
|
+
message = "remove installer";
|
|
445
|
+
percent = 0.87;
|
|
446
|
+
try {
|
|
447
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
448
|
+
await this.removeInstallerLink();
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
452
|
+
}
|
|
453
|
+
// sourcesYolkUmount
|
|
454
|
+
if (this.distro.familyId === 'debian') {
|
|
455
|
+
message = "sources yolk unmount";
|
|
456
|
+
percent = 0.92;
|
|
457
|
+
try {
|
|
458
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
459
|
+
await this.execCalamaresModule('sources-yolk-unmount');
|
|
460
|
+
}
|
|
461
|
+
catch (error) {
|
|
462
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
// umountVfs
|
|
466
|
+
message = "umount VFS";
|
|
467
|
+
percent = 0.95;
|
|
468
|
+
try {
|
|
469
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
470
|
+
await this.umountVfs();
|
|
471
|
+
}
|
|
472
|
+
catch (error) {
|
|
473
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
474
|
+
}
|
|
475
|
+
// umount
|
|
476
|
+
message = "umount";
|
|
477
|
+
percent = 0.97;
|
|
478
|
+
try {
|
|
479
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
480
|
+
await this.umountFs();
|
|
481
|
+
}
|
|
482
|
+
catch (error) {
|
|
483
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
484
|
+
}
|
|
485
|
+
// finished
|
|
486
|
+
message = "finished";
|
|
487
|
+
percent = 100.0;
|
|
488
|
+
try {
|
|
489
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
490
|
+
await this.finished();
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
*
|
|
499
|
+
*/
|
|
500
|
+
async execCalamaresModule(name) {
|
|
501
|
+
const moduleName = this.installer.multiarchModules + name + '/module.desc';
|
|
502
|
+
if (fs_1.default.existsSync(moduleName)) {
|
|
503
|
+
const calamaresModule = js_yaml_1.default.load(fs_1.default.readFileSync(moduleName, 'utf8'));
|
|
504
|
+
let command = calamaresModule.command;
|
|
505
|
+
if (command !== '' || command !== undefined) {
|
|
506
|
+
command += this.toNull;
|
|
507
|
+
await (0, utils_2.exec)(command, this.echo);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* only show the result
|
|
513
|
+
*/
|
|
514
|
+
async finished() {
|
|
515
|
+
await redraw(react_1.default.createElement(finished_1.default, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.name }));
|
|
516
|
+
utils_1.default.pressKeyToExit('Press a key to reboot...');
|
|
517
|
+
shelljs_1.default.exec('reboot');
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
exports.default = Sequence;
|
|
521
|
+
// const ifaces: string[] = fs.readdirSync('/sys/class/net/')
|
|
522
|
+
/**
|
|
523
|
+
*
|
|
524
|
+
* @param elem
|
|
525
|
+
*/
|
|
526
|
+
async function redraw(elem) {
|
|
527
|
+
let opt = {};
|
|
528
|
+
opt.patchConsole = false;
|
|
529
|
+
opt.debug = false;
|
|
530
|
+
console.clear();
|
|
531
|
+
// await exec('clear', Utils.setEcho(false))
|
|
532
|
+
(0, ink_1.render)(elem, opt);
|
|
533
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
* @param name
|
|
9
|
+
* @param password
|
|
10
|
+
* @param fullName
|
|
11
|
+
* @param roomNumber
|
|
12
|
+
* @param workPhone
|
|
13
|
+
* @param homePhone
|
|
14
|
+
*/
|
|
15
|
+
export default function addUser(this: Sequence, name?: string, password?: string, fullName?: string, roomNumber?: string, workPhone?: string, homePhone?: string): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
8
|
+
const utils_2 = require("../../lib/utils");
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param this
|
|
12
|
+
* @param name
|
|
13
|
+
* @param password
|
|
14
|
+
* @param fullName
|
|
15
|
+
* @param roomNumber
|
|
16
|
+
* @param workPhone
|
|
17
|
+
* @param homePhone
|
|
18
|
+
*/
|
|
19
|
+
async function addUser(name = 'live', password = 'evolution', fullName = '', roomNumber = '', workPhone = '', homePhone = '') {
|
|
20
|
+
// Debian
|
|
21
|
+
let cmd = `chroot ${this.installTarget} adduser ${name} --home /home/${name} --shell /bin/bash --disabled-password --gecos "${fullName},${roomNumber},${workPhone},${homePhone}" ${this.toNull}`;
|
|
22
|
+
if (this.distro.familyId === 'archlinux') {
|
|
23
|
+
cmd = `chroot ${this.installTarget} useradd --create-home --shell /bin/bash ${name} ${this.toNull}`;
|
|
24
|
+
}
|
|
25
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
26
|
+
cmd = `echo ${name}:${password} | chroot ${this.installTarget} chpasswd ${this.toNull}`;
|
|
27
|
+
// echo ${name}:${password} | chroot ${this.installTarget} chpasswd ${this.toNull}
|
|
28
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
29
|
+
// Debian
|
|
30
|
+
cmd = `chroot ${this.installTarget} usermod -aG sudo ${name} ${this.toNull}`;
|
|
31
|
+
if (this.distro.familyId === 'archlinux') {
|
|
32
|
+
cmd = `chroot ${this.installTarget} usermod -aG wheel ${name}`;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
await utils_1.default.pressKeyToExit(cmd);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = addUser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
*/
|
|
9
|
+
export default function bootloaderConfigArch(this: Sequence): Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*/
|
|
10
|
+
async function bootloaderConfigArch() {
|
|
11
|
+
console.log('bootloader Arch to do!');
|
|
12
|
+
}
|
|
13
|
+
exports.default = bootloaderConfigArch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
3
|
+
*/
|
|
4
|
+
import Sequence from '../krill-sequence';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
*/
|
|
9
|
+
export default function bootloaderConfigUbuntu(this: Sequence): Promise<void>;
|