penguins-eggs 9.1.30 → 9.1.35

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.
Files changed (95) hide show
  1. package/README.md +59 -18
  2. package/addons/eggs/theme/applications/install-debian.desktop +2 -2
  3. package/conf/distros/buster/calamares/modules/locale.yml +3 -3
  4. package/conf/distros/rolling/calamares/modules/packages.yml +1 -0
  5. package/conf/eggs.yaml +2 -2
  6. package/conf/exclude.list +81 -96
  7. package/lib/classes/bleach.js +8 -1
  8. package/lib/classes/compressors.d.ts +7 -0
  9. package/lib/classes/compressors.js +38 -1
  10. package/lib/classes/daddy.js +6 -29
  11. package/lib/classes/distro.js +18 -4
  12. package/lib/classes/incubation/fisherman-helper/packages.js +7 -4
  13. package/lib/classes/keyboards.d.ts +10 -12
  14. package/lib/classes/keyboards.js +19 -23
  15. package/lib/classes/locales.js +15 -10
  16. package/lib/classes/ovary.js +18 -6
  17. package/lib/classes/utils.js +19 -6
  18. package/lib/commands/{install.d.ts → krill.d.ts} +1 -0
  19. package/lib/commands/{install.js → krill.js} +2 -2
  20. package/lib/commands/produce.js +8 -30
  21. package/lib/components/elements/information.js +0 -2
  22. package/lib/{classes/krill_prepare.d.ts → krill/krill-prepare.d.ts} +9 -2
  23. package/lib/{classes/krill_prepare.js → krill/krill-prepare.js} +62 -12
  24. package/lib/krill/krill-sequence.d.ts +148 -0
  25. package/lib/krill/krill-sequence.js +533 -0
  26. package/lib/krill/modules/add-user.d.ts +15 -0
  27. package/lib/krill/modules/add-user.js +41 -0
  28. package/lib/krill/modules/bootloader-config-arch.d.ts +9 -0
  29. package/lib/krill/modules/bootloader-config-arch.js +13 -0
  30. package/lib/krill/modules/bootloader-config-ubuntu.d.ts +9 -0
  31. package/lib/krill/modules/bootloader-config-ubuntu.js +93 -0
  32. package/lib/krill/modules/bootloader-config.d.ts +9 -0
  33. package/lib/krill/modules/bootloader-config.js +23 -0
  34. package/lib/krill/modules/bootloader.d.ts +10 -0
  35. package/lib/krill/modules/bootloader.js +17 -0
  36. package/lib/krill/modules/change-password.d.ts +10 -0
  37. package/lib/krill/modules/change-password.js +16 -0
  38. package/lib/krill/modules/del-live-user.d.ts +9 -0
  39. package/lib/krill/modules/del-live-user.js +37 -0
  40. package/lib/krill/modules/fstab.d.ts +9 -0
  41. package/lib/krill/modules/fstab.js +93 -0
  42. package/lib/krill/modules/grubcfg.d.ts +12 -0
  43. package/lib/krill/modules/grubcfg.js +33 -0
  44. package/lib/krill/modules/hostname.d.ts +8 -0
  45. package/lib/krill/modules/hostname.js +13 -0
  46. package/lib/krill/modules/hosts.d.ts +9 -0
  47. package/lib/krill/modules/hosts.js +30 -0
  48. package/lib/krill/modules/initramfs-cfg.d.ts +9 -0
  49. package/lib/krill/modules/initramfs-cfg.js +29 -0
  50. package/lib/krill/modules/initramfs.d.ts +8 -0
  51. package/lib/krill/modules/initramfs.js +30 -0
  52. package/lib/krill/modules/locale.d.ts +8 -0
  53. package/lib/krill/modules/locale.js +47 -0
  54. package/lib/krill/modules/l/303/262cale-cfg.d.ts +5 -0
  55. package/lib/krill/modules/l/303/262cale-cfg.js +58 -0
  56. package/lib/krill/modules/machine-id.d.ts +10 -0
  57. package/lib/krill/modules/machine-id.js +21 -0
  58. package/lib/krill/modules/mkfs.d.ts +8 -0
  59. package/lib/krill/modules/mkfs.js +33 -0
  60. package/lib/krill/modules/mount-fs.d.ts +12 -0
  61. package/lib/krill/modules/mount-fs.js +63 -0
  62. package/lib/krill/modules/mount-vfs.d.ts +12 -0
  63. package/lib/krill/modules/mount-vfs.js +40 -0
  64. package/lib/krill/modules/network-cfg.d.ts +14 -0
  65. package/lib/krill/modules/network-cfg.js +49 -0
  66. package/lib/krill/modules/partitions.d.ts +15 -0
  67. package/lib/krill/modules/partitions.js +307 -0
  68. package/lib/krill/modules/remove-installer-link.d.ts +8 -0
  69. package/lib/krill/modules/remove-installer-link.js +34 -0
  70. package/lib/krill/modules/set-keyboard.d.ts +5 -0
  71. package/lib/krill/modules/set-keyboard.js +50 -0
  72. package/lib/krill/modules/set-timezone.d.ts +9 -0
  73. package/lib/krill/modules/set-timezone.js +21 -0
  74. package/lib/krill/modules/umount.d.ts +9 -0
  75. package/lib/krill/modules/umount.js +26 -0
  76. package/lib/krill/modules/unpackfs.d.ts +8 -0
  77. package/lib/krill/modules/unpackfs.js +17 -0
  78. package/lib/lib/cli-autologin.js +3 -3
  79. package/lib/lib/select_keyboard_variant.js +1 -0
  80. package/manpages/doc/man/eggs.html +122 -90
  81. package/mkinitcpio/README.md +6 -67
  82. package/mkinitcpio/archlinux/mkinitcpio-install.conf +5 -0
  83. package/mkinitcpio/archlinux/mkinitcpio-produce.conf +13 -0
  84. package/mkinitcpio/manjaro/README.md +31 -0
  85. package/mkinitcpio/manjaro/mkinitcpio-install.conf +7 -0
  86. package/mkinitcpio/manjaro/mkinitcpio-produce.conf +7 -0
  87. package/package.json +10 -11
  88. package/scripts/_eggs +8 -8
  89. package/scripts/eggs.bash +1 -1
  90. package/scripts/mom-cli.sh +8 -8
  91. package/lib/classes/i18n.d.ts +0 -34
  92. package/lib/classes/i18n.js +0 -126
  93. package/lib/classes/krill_install.d.ts +0 -227
  94. package/lib/classes/krill_install.js +0 -1370
  95. package/mkinitcpio/manjaro/mkinitcpio.conf +0 -4
@@ -0,0 +1,148 @@
1
+ /**
2
+ * penguins-eggs: krill_sequence
3
+ *
4
+ * author: Piero Proietti
5
+ * mail: piero.proietti@gmail.com
6
+ *
7
+ */
8
+ /**
9
+ * Note: I'm using REACT here to get a TUI,
10
+ * via ink library https://github.com/vadimdemedes/ink
11
+ */
12
+ /**
13
+ * Ideally, I want to respect calamares way, remplementing the same (SEMPLIFIED) steps for CLI
14
+ *
15
+ * Phase 2 - install.
16
+ *
17
+ * - partition: partitions
18
+ * - mount: mountFs, mountVfs
19
+ * - unpackfs: unpackfs
20
+ * - _restore: eggs syncfrom --rootdir /tmp/calamares-krill-root/
21
+ * - sources-yolk: execCalamaresModule('sources-yolk')
22
+ * - machineid: machineid
23
+ * - fstab: fstab
24
+ * - locale locale
25
+ * - keyboard: keyboard
26
+ * - localecfg: localecfg
27
+ * - users: users
28
+ * - displaymanager: autologin
29
+ * - networkcfg: networkcfg
30
+ * - hwclock:
31
+ * - services-systemd:
32
+ * - bootloader-config: execCalamaresModule('bootloader-config')
33
+ * - grubcfg: grubcfg
34
+ * - bootloader: bootloaded
35
+ * - packages: removeInstaller
36
+ * - luksbootkeyfile:
37
+ * - plymouthcfg;
38
+ * - initramfscfg: initramfscfg
39
+ * - initramfs: initramfs
40
+ * - removeuser: removeuser
41
+ * - sources-yolk-unmount: execCalamaresModule('sources-yolk-unmount')
42
+ * - umount: umountVfs, this.umountFs
43
+ */
44
+ import { IRemix, IDistro, INet } from '../interfaces';
45
+ import Settings from '../classes/settings';
46
+ import { IInstaller, IDevices } from '../interfaces';
47
+ import { ILocation, IKeyboard, IPartitions, IUsers } from '../interfaces/i-krill';
48
+ import partition from './modules/partitions';
49
+ import { mountFs, umountFs } from './modules/mount-fs';
50
+ import { mountVfs, umountVfs } from './modules/mount-vfs';
51
+ import unpackfs from './modules/unpackfs';
52
+ import machineId from './modules/machine-id';
53
+ import fstab from './modules/fstab';
54
+ import locale from './modules/locale';
55
+ import setKeyboard from './modules/set-keyboard';
56
+ import localeCfg from './modules/lòcale-cfg';
57
+ import addUser from './modules/add-user';
58
+ import changePassword from './modules/change-password';
59
+ import networkCfg from './modules/network-cfg';
60
+ import bootloaderConfig from './modules/bootloader-config';
61
+ import bootloaderConfigArch from './modules/bootloader-config-arch';
62
+ import bootloaderConfigUbuntu from './modules/bootloader-config-ubuntu';
63
+ import grubcfg from './modules/grubcfg';
64
+ import bootloader from './modules/bootloader';
65
+ import removeInstallerLink from './modules/remove-installer-link';
66
+ import initramfsCfg from './modules/initramfs-cfg';
67
+ import initramfs from './modules/initramfs';
68
+ import delLiveUser from './modules/del-live-user';
69
+ import setTimezone from './modules/set-timezone';
70
+ import umount from './modules/umount';
71
+ import mkfs from './modules/mkfs';
72
+ import hostname from './modules/hostname';
73
+ import hosts from './modules/hosts';
74
+ /**
75
+ * hatching: installazione o cova!!!
76
+ */
77
+ export default class Sequence {
78
+ partition: typeof partition;
79
+ mountFs: typeof mountFs;
80
+ mountVfs: typeof mountVfs;
81
+ unpackfs: typeof unpackfs;
82
+ machineId: typeof machineId;
83
+ fstab: typeof fstab;
84
+ locale: typeof locale;
85
+ setKeyboard: typeof setKeyboard;
86
+ localeCfg: typeof localeCfg;
87
+ addUser: typeof addUser;
88
+ changePassword: typeof changePassword;
89
+ networkCfg: typeof networkCfg;
90
+ bootloaderConfig: typeof bootloaderConfig;
91
+ bootloaderConfigArch: typeof bootloaderConfigArch;
92
+ bootloaderConfigUbuntu: typeof bootloaderConfigUbuntu;
93
+ grubcfg: typeof grubcfg;
94
+ bootloader: typeof bootloader;
95
+ removeInstallerLink: typeof removeInstallerLink;
96
+ initramfsCfg: typeof initramfsCfg;
97
+ initramfs: typeof initramfs;
98
+ delLiveUser: typeof delLiveUser;
99
+ umountFs: typeof umountFs;
100
+ umountVfs: typeof umountVfs;
101
+ setTimezone: typeof setTimezone;
102
+ umount: typeof umount;
103
+ mkfs: typeof mkfs;
104
+ hostname: typeof hostname;
105
+ hosts: typeof hosts;
106
+ installer: IInstaller;
107
+ installTarget: string;
108
+ verbose: boolean;
109
+ echo: {};
110
+ efi: boolean;
111
+ devices: IDevices;
112
+ users: IUsers;
113
+ network: INet;
114
+ partitions: IPartitions;
115
+ language: string;
116
+ region: string;
117
+ zone: string;
118
+ keyboardModel: string;
119
+ keyboardLayout: string;
120
+ keyboardVariant: string;
121
+ toNull: string;
122
+ settings: Settings;
123
+ remix: IRemix;
124
+ distro: IDistro;
125
+ luksName: string;
126
+ luksFile: string;
127
+ luksDevice: string;
128
+ luksMountpoint: string;
129
+ /**
130
+ * constructor
131
+ */
132
+ constructor(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, network: INet);
133
+ /**
134
+ * install
135
+ * @param verbose
136
+ * @param umount
137
+ * @returns
138
+ */
139
+ install(verbose?: boolean): Promise<void>;
140
+ /**
141
+ *
142
+ */
143
+ execCalamaresModule(name: string): Promise<void>;
144
+ /**
145
+ * only show the result
146
+ */
147
+ finished(): Promise<void>;
148
+ }
@@ -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 l_cale_cfg_1 = tslib_1.__importDefault(require("./modules/l\u00F2cale-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 = l_cale_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
+ 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
+ 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
+ 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
+ // spinner={true}
222
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
223
+ await this.unpackfs();
224
+ }
225
+ catch (error) {
226
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
227
+ }
228
+ /**
229
+ * IF RESTORE USERS DATA
230
+ */
231
+ if (fs_1.default.existsSync(this.luksFile)) {
232
+ // restoring users data
233
+ message = "Restore private data from backup ";
234
+ percent = 0.37;
235
+ let cmd = 'eggs syncfrom --rootdir /tmp/calamares-krill-root/';
236
+ try {
237
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
238
+ await (0, utils_2.exec)(cmd, utils_1.default.setEcho(true));
239
+ }
240
+ catch (error) {
241
+ await utils_1.default.pressKeyToExit(cmd);
242
+ }
243
+ }
244
+ // sources-yolk
245
+ if (this.distro.familyId === 'debian') {
246
+ message = 'sources-yolk';
247
+ percent = 0.40;
248
+ try {
249
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
250
+ await this.execCalamaresModule('sources-yolk');
251
+ }
252
+ catch (error) {
253
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
254
+ }
255
+ }
256
+ // machineid
257
+ message = 'machineid';
258
+ percent = 0.41;
259
+ try {
260
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
261
+ await this.machineId();
262
+ }
263
+ catch (error) {
264
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
265
+ }
266
+ // fstab
267
+ message = "Creating fstab ";
268
+ percent = 0.47;
269
+ try {
270
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
271
+ await this.fstab(this.partitions.installationDevice);
272
+ }
273
+ catch (error) {
274
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
275
+ }
276
+ // locale
277
+ message = "Locale ";
278
+ percent = 0.47;
279
+ try {
280
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
281
+ await this.locale();
282
+ }
283
+ catch (error) {
284
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
285
+ }
286
+ // keyboard
287
+ message = "settings keyboard ";
288
+ percent = 0.48;
289
+ try {
290
+ this.setKeyboard();
291
+ }
292
+ catch (error) {
293
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
294
+ }
295
+ // localeCfg
296
+ message = "localeCfg";
297
+ percent = 0.50;
298
+ try {
299
+ this.localeCfg();
300
+ }
301
+ catch (error) {
302
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
303
+ }
304
+ // networkcfg
305
+ message = "networkcfg";
306
+ percent = 0.50;
307
+ try {
308
+ this.networkCfg();
309
+ }
310
+ catch (error) {
311
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
312
+ }
313
+ // hostname
314
+ message = "Create hostname ";
315
+ percent = 0.53;
316
+ try {
317
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
318
+ await this.hostname();
319
+ }
320
+ catch (error) {
321
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
322
+ }
323
+ // hosts
324
+ message = "Creating hosts ";
325
+ percent = 0.60;
326
+ try {
327
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
328
+ await this.hosts();
329
+ }
330
+ catch (error) {
331
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
332
+ }
333
+ // bootloader-config
334
+ message = "bootloader-config ";
335
+ percent = 0.62;
336
+ try {
337
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
338
+ await this.bootloaderConfig();
339
+ }
340
+ catch (error) {
341
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
342
+ }
343
+ // grubcfg
344
+ message = "grubcfg ";
345
+ percent = 0.63;
346
+ try {
347
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
348
+ await this.grubcfg();
349
+ }
350
+ catch (error) {
351
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
352
+ }
353
+ // bootloader
354
+ message = "bootloader ";
355
+ percent = 0.64;
356
+ try {
357
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
358
+ await this.bootloader();
359
+ }
360
+ catch (error) {
361
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
362
+ }
363
+ // initramfsCfg
364
+ message = "initramfs configure";
365
+ percent = 0.65;
366
+ try {
367
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
368
+ this.initramfsCfg(this.partitions.installationDevice);
369
+ }
370
+ catch (error) {
371
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
372
+ }
373
+ // initramfs
374
+ message = "initramfs ";
375
+ percent = 0.67;
376
+ try {
377
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
378
+ await this.initramfs();
379
+ }
380
+ catch (error) {
381
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
382
+ }
383
+ /**
384
+ * IF NOT RESTORE USERS DATA
385
+ */
386
+ if (!fs_1.default.existsSync(this.luksFile)) {
387
+ // delLiveUser
388
+ message = "Removing user live ";
389
+ percent = 0.70;
390
+ try {
391
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
392
+ await this.delLiveUser();
393
+ }
394
+ catch (error) {
395
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
396
+ }
397
+ // addUser
398
+ message = "Adding user ";
399
+ percent = 0.73;
400
+ try {
401
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
402
+ await this.addUser(this.users.name, this.users.password, this.users.fullname, '', '', '');
403
+ }
404
+ catch (error) {
405
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
406
+ }
407
+ // changePassword
408
+ message = "adding user password ";
409
+ percent = 0.77;
410
+ try {
411
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
412
+ await this.changePassword('root', this.users.rootPassword);
413
+ }
414
+ catch (error) {
415
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
416
+ }
417
+ }
418
+ // autologin
419
+ if (pacman_1.default.isInstalledGui()) {
420
+ try {
421
+ message = "autologin GUI";
422
+ percent = 0.80;
423
+ await xdg_1.default.autologin(utils_1.default.getPrimaryUser(), this.users.name, this.installTarget);
424
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
425
+ }
426
+ catch (error) {
427
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
428
+ }
429
+ }
430
+ else { // autologin CLI remove DEFAULT
431
+ message = "autologin CLI";
432
+ percent = 0.80;
433
+ try {
434
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
435
+ await cliAutologin.remove(this.installTarget);
436
+ }
437
+ catch (error) {
438
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
439
+ }
440
+ }
441
+ // cleanup
442
+ await cliAutologin.msgRemove(`${this.installTarget}/etc/motd`);
443
+ await cliAutologin.msgRemove(`${this.installTarget}/etc/issue`);
444
+ // removeInstaller
445
+ message = "remove installer";
446
+ percent = 0.87;
447
+ try {
448
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
449
+ await this.removeInstallerLink();
450
+ }
451
+ catch (error) {
452
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
453
+ }
454
+ // sourcesYolkUmount
455
+ if (this.distro.familyId === 'debian') {
456
+ message = "sources yolk unmount";
457
+ percent = 0.92;
458
+ try {
459
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
460
+ await this.execCalamaresModule('sources-yolk-unmount');
461
+ }
462
+ catch (error) {
463
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
464
+ }
465
+ }
466
+ // umountVfs
467
+ message = "umount VFS";
468
+ percent = 0.95;
469
+ try {
470
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
471
+ await this.umountVfs();
472
+ }
473
+ catch (error) {
474
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
475
+ }
476
+ // umount
477
+ message = "umount";
478
+ percent = 0.97;
479
+ try {
480
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
481
+ await this.umountFs();
482
+ }
483
+ catch (error) {
484
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
485
+ }
486
+ // finished
487
+ message = "finished";
488
+ percent = 100.0;
489
+ try {
490
+ redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
491
+ await this.finished();
492
+ }
493
+ catch (error) {
494
+ await utils_1.default.pressKeyToExit(JSON.stringify(error));
495
+ }
496
+ }
497
+ }
498
+ /**
499
+ *
500
+ */
501
+ async execCalamaresModule(name) {
502
+ const moduleName = this.installer.multiarchModules + name + '/module.desc';
503
+ if (fs_1.default.existsSync(moduleName)) {
504
+ const calamaresModule = js_yaml_1.default.load(fs_1.default.readFileSync(moduleName, 'utf8'));
505
+ let command = calamaresModule.command;
506
+ if (command !== '' || command !== undefined) {
507
+ command += this.toNull;
508
+ await (0, utils_2.exec)(command, this.echo);
509
+ }
510
+ }
511
+ }
512
+ /**
513
+ * only show the result
514
+ */
515
+ async finished() {
516
+ redraw(react_1.default.createElement(finished_1.default, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.name }));
517
+ utils_1.default.pressKeyToExit('Press a key to reboot...');
518
+ shelljs_1.default.exec('reboot');
519
+ }
520
+ }
521
+ exports.default = Sequence;
522
+ // const ifaces: string[] = fs.readdirSync('/sys/class/net/')
523
+ /**
524
+ *
525
+ * @param elem
526
+ */
527
+ function redraw(elem) {
528
+ let opt = {};
529
+ opt.patchConsole = false;
530
+ opt.debug = false;
531
+ shelljs_1.default.exec('clear');
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>;