penguins-eggs 9.2.2 → 9.2.5

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 (88) hide show
  1. package/README.md +147 -132
  2. package/addons/eggs/theme/livecd/isolinux.theme.cfg +36 -41
  3. package/conf/eggs.yaml +41 -73
  4. package/conf/exclude.list +1 -0
  5. package/conf/krill.yaml +38 -0
  6. package/lib/classes/daddy.d.ts +2 -2
  7. package/lib/classes/distro.d.ts +2 -0
  8. package/lib/classes/distro.js +6 -0
  9. package/lib/classes/incubation/fisherman.js +1 -1
  10. package/lib/classes/pacman.js +3 -2
  11. package/lib/classes/pxe.d.ts +64 -0
  12. package/lib/classes/pxe.js +352 -0
  13. package/lib/classes/settings.d.ts +3 -3
  14. package/lib/classes/settings.js +2 -1
  15. package/lib/classes/tools.d.ts +2 -2
  16. package/lib/classes/utils.d.ts +1 -1
  17. package/lib/classes/utils.js +1 -1
  18. package/lib/commands/cuckoo.d.ts +24 -0
  19. package/lib/commands/cuckoo.js +70 -0
  20. package/lib/commands/install.d.ts +2 -2
  21. package/lib/commands/install.js +8 -14
  22. package/lib/commands/produce.js +3 -3
  23. package/lib/commands/{info.d.ts → status.d.ts} +1 -1
  24. package/lib/commands/{info.js → status.js} +5 -5
  25. package/lib/components/summary.d.ts +6 -1
  26. package/lib/components/summary.js +25 -8
  27. package/lib/components/users.js +3 -4
  28. package/lib/interfaces/i-config-tools.d.ts +1 -1
  29. package/lib/interfaces/i-distro.d.ts +2 -0
  30. package/lib/interfaces/{i-config.d.ts → i-eggs-config.d.ts} +2 -4
  31. package/lib/interfaces/{i-config.js → i-eggs-config.js} +0 -0
  32. package/lib/interfaces/i-krill-config.d.ts +26 -0
  33. package/lib/interfaces/i-krill-config.js +2 -0
  34. package/lib/interfaces/i-packages.d.ts +6 -9
  35. package/lib/interfaces/i-packages.js +3 -0
  36. package/lib/interfaces/index.d.ts +1 -1
  37. package/lib/krill/krill-prepare.d.ts +5 -3
  38. package/lib/krill/krill-prepare.js +159 -35
  39. package/lib/krill/krill-sequence.d.ts +5 -3
  40. package/lib/krill/krill-sequence.js +26 -12
  41. package/lib/krill/modules/fstab.d.ts +5 -0
  42. package/lib/krill/modules/fstab.js +5 -0
  43. package/lib/krill/modules/grubcfg.d.ts +5 -0
  44. package/lib/krill/modules/grubcfg.js +5 -0
  45. package/lib/krill/modules/hostname.d.ts +5 -0
  46. package/lib/krill/modules/hostname.js +5 -0
  47. package/lib/krill/modules/hosts.d.ts +5 -0
  48. package/lib/krill/modules/hosts.js +5 -0
  49. package/lib/krill/modules/initramfs-cfg.d.ts +5 -0
  50. package/lib/krill/modules/initramfs-cfg.js +5 -0
  51. package/lib/krill/modules/initramfs.d.ts +5 -0
  52. package/lib/krill/modules/initramfs.js +5 -0
  53. package/lib/krill/modules/locale-cfg.d.ts +5 -0
  54. package/lib/krill/modules/locale-cfg.js +5 -0
  55. package/lib/krill/modules/locale.d.ts +5 -0
  56. package/lib/krill/modules/locale.js +5 -0
  57. package/lib/krill/modules/machine-id.d.ts +5 -0
  58. package/lib/krill/modules/machine-id.js +5 -0
  59. package/lib/krill/modules/mkfs.d.ts +5 -0
  60. package/lib/krill/modules/mkfs.js +5 -0
  61. package/lib/krill/modules/mount-fs.d.ts +5 -0
  62. package/lib/krill/modules/mount-fs.js +5 -0
  63. package/lib/krill/modules/mount-vfs.d.ts +5 -0
  64. package/lib/krill/modules/mount-vfs.js +5 -0
  65. package/lib/krill/modules/network-cfg.d.ts +5 -0
  66. package/lib/krill/modules/network-cfg.js +5 -0
  67. package/lib/krill/modules/packages.d.ts +14 -0
  68. package/lib/krill/modules/packages.js +65 -0
  69. package/lib/krill/modules/{partitions.d.ts → partition.d.ts} +5 -0
  70. package/lib/krill/modules/{partitions.js → partition.js} +5 -0
  71. package/lib/krill/modules/remove-installer-link.d.ts +5 -0
  72. package/lib/krill/modules/remove-installer-link.js +5 -0
  73. package/lib/krill/modules/set-keyboard.d.ts +5 -0
  74. package/lib/krill/modules/set-keyboard.js +37 -18
  75. package/lib/krill/modules/set-timezone.d.ts +5 -0
  76. package/lib/krill/modules/set-timezone.js +5 -0
  77. package/lib/krill/modules/umount.d.ts +5 -0
  78. package/lib/krill/modules/umount.js +5 -0
  79. package/lib/krill/modules/unpackfs.d.ts +5 -0
  80. package/lib/krill/modules/unpackfs.js +5 -0
  81. package/manpages/doc/man/eggs.1.gz +0 -0
  82. package/manpages/doc/man/eggs.html +72 -83
  83. package/package.json +6 -2
  84. package/scripts/_eggs +19 -19
  85. package/scripts/eggs.bash +3 -3
  86. package/scripts/mom-cli.sh +11 -11
  87. package/scripts/netgrub.sh +39 -0
  88. package/manpages/doc/man/eggs.roll.gz +0 -0
@@ -10,7 +10,7 @@ const title_1 = tslib_1.__importDefault(require("./elements/title"));
10
10
  const steps_1 = tslib_1.__importDefault(require("./elements/steps"));
11
11
  const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
12
12
  const fs_1 = tslib_1.__importDefault(require("fs"));
13
- function Summary({ region, zone, language, keyboardModel, keyboardLayout, installationDevice }) {
13
+ function Summary({ name, password, rootPassword, hostname, region, zone, language, keyboardModel, keyboardLayout, installationDevice, message }) {
14
14
  let productName = 'unknown';
15
15
  let version = 'x.x.x';
16
16
  let configRoot = '/etc/penguins-eggs.d/krill/';
@@ -34,6 +34,22 @@ function Summary({ region, zone, language, keyboardModel, keyboardLayout, instal
34
34
  react_1.default.createElement(ink_1.Box, { flexDirection: "row" },
35
35
  react_1.default.createElement(steps_1.default, { step: 7 }),
36
36
  react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
37
+ react_1.default.createElement(ink_1.Box, null,
38
+ react_1.default.createElement(ink_1.Text, null, "Installing "),
39
+ react_1.default.createElement(ink_1.Text, { color: "green" }, productName)),
40
+ react_1.default.createElement(ink_1.Box, null,
41
+ react_1.default.createElement(ink_1.Text, null, "User "),
42
+ react_1.default.createElement(ink_1.Text, { color: "green" }, name),
43
+ react_1.default.createElement(ink_1.Text, null, "/"),
44
+ react_1.default.createElement(ink_1.Text, { color: "green" },
45
+ password,
46
+ " "),
47
+ react_1.default.createElement(ink_1.Text, null, "root pwd "),
48
+ react_1.default.createElement(ink_1.Text, { color: "green" },
49
+ rootPassword,
50
+ " "),
51
+ react_1.default.createElement(ink_1.Text, null, "hostname "),
52
+ react_1.default.createElement(ink_1.Text, { color: "green" }, hostname)),
37
53
  react_1.default.createElement(ink_1.Box, null,
38
54
  react_1.default.createElement(ink_1.Text, null, "Set timezone to "),
39
55
  react_1.default.createElement(ink_1.Text, { color: "green" },
@@ -44,18 +60,19 @@ function Summary({ region, zone, language, keyboardModel, keyboardLayout, instal
44
60
  react_1.default.createElement(ink_1.Text, null, "The system language will be set to "),
45
61
  react_1.default.createElement(ink_1.Text, { color: "green" }, language)),
46
62
  react_1.default.createElement(ink_1.Box, null,
47
- react_1.default.createElement(ink_1.Text, null, "The numbers and date locale will be set to "),
63
+ react_1.default.createElement(ink_1.Text, null, "Numbers and date locale will be set to "),
48
64
  react_1.default.createElement(ink_1.Text, { color: "green" }, language)),
49
65
  react_1.default.createElement(ink_1.Box, null,
50
66
  react_1.default.createElement(ink_1.Text, null, "Set keyboard model to "),
51
- react_1.default.createElement(ink_1.Text, { color: "green" }, keyboardModel)),
52
- react_1.default.createElement(ink_1.Box, null,
53
- react_1.default.createElement(ink_1.Text, null, "Set keyboard layout to "),
67
+ react_1.default.createElement(ink_1.Text, { color: "green" },
68
+ keyboardModel,
69
+ " "),
70
+ react_1.default.createElement(ink_1.Text, null, "layout "),
54
71
  react_1.default.createElement(ink_1.Text, { color: "green" }, keyboardLayout)),
55
72
  react_1.default.createElement(ink_1.Box, null,
56
73
  react_1.default.createElement(ink_1.Text, { bold: true }, "Erase disk "),
57
- react_1.default.createElement(ink_1.Text, { color: "green" }, installationDevice),
58
- react_1.default.createElement(ink_1.Text, null, ", install "),
59
- react_1.default.createElement(ink_1.Text, { color: "green" }, productName))))))));
74
+ react_1.default.createElement(ink_1.Text, { color: "green" }, installationDevice)),
75
+ react_1.default.createElement(ink_1.Box, null,
76
+ react_1.default.createElement(ink_1.Text, { color: "red" }, message))))))));
60
77
  }
61
78
  exports.default = Summary;
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const tslib_1 = require("tslib");
7
7
  const react_1 = tslib_1.__importStar(require("react"));
8
8
  const ink_1 = require("ink");
9
- // import Spinner from 'ink-spinner';
10
9
  const title_1 = tslib_1.__importDefault(require("./elements/title"));
11
10
  const steps_1 = tslib_1.__importDefault(require("./elements/steps"));
12
11
  const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
13
12
  const fs_1 = tslib_1.__importDefault(require("fs"));
14
- //create your forceUpdate hook
13
+ // create your forceUpdate hook
15
14
  function useForceUpdate() {
16
15
  const [value, setValue] = (0, react_1.useState)(0); // integer state
17
16
  return () => setValue((value) => value + 1); // update the state to force render
@@ -38,9 +37,9 @@ function Users({ name, fullname, password, rootPassword, hostname, autologin, sa
38
37
  * step width=15
39
38
  * finestra with=59
40
39
  */
41
- let charAutologin = " ";
40
+ let charAutologin = "[x] ";
42
41
  if (autologin) {
43
- charAutologin = "x";
42
+ charAutologin = "[ ]";
44
43
  }
45
44
  if (sameUserPassword) {
46
45
  rootPassword = password;
@@ -1,4 +1,4 @@
1
- export interface IConfigTools {
1
+ export interface IEggsConfigTools {
2
2
  remoteHost: string;
3
3
  remoteUser: string;
4
4
  remotePathDeb: string;
@@ -9,6 +9,8 @@ export interface IDistro {
9
9
  usrLibPath: string;
10
10
  isolinuxPath: string;
11
11
  syslinuxPath: string;
12
+ pxelinuxPath: string;
13
+ liveMediumPath: string;
12
14
  mountpointSquashFs: string;
13
15
  homeUrl: string;
14
16
  supportUrl: string;
@@ -1,4 +1,4 @@
1
- export interface IConfig {
1
+ export interface IEggsConfig {
2
2
  version: string;
3
3
  snapshot_dir: string;
4
4
  snapshot_basename: string;
@@ -15,11 +15,9 @@ export interface IConfig {
15
15
  compression: string;
16
16
  ssh_pass: boolean;
17
17
  timezone: string;
18
- locales: string[];
19
18
  locales_default: string;
19
+ locales: string[];
20
20
  pmount_fixed: boolean;
21
- netconfig_opt: string;
22
- ifnames_opt: string;
23
21
  machine_id: string;
24
22
  vmlinuz: string;
25
23
  initrd_img: string;
File without changes
@@ -0,0 +1,26 @@
1
+ export interface IKrillConfig {
2
+ language: string;
3
+ region: string;
4
+ zone: string;
5
+ keyboardModel: string;
6
+ keyboardLayout: string;
7
+ keyboardVariant: string;
8
+ keyboardOption: string;
9
+ installationDevice: string;
10
+ installationMode: string;
11
+ filesystemType: string;
12
+ userSwapChoice: string;
13
+ name: string;
14
+ fullname: string;
15
+ password: string;
16
+ rootPassword: string;
17
+ autologin: boolean;
18
+ hostname: string;
19
+ iface: string;
20
+ addressType: string;
21
+ address: string;
22
+ netmask: string;
23
+ gateway: string;
24
+ domain: string;
25
+ dns: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +1,10 @@
1
1
  /**
2
- * packages.ts
2
+ * calamares module packages
3
3
  */
4
- export interface Packages {
5
- name: string;
6
- version: string;
7
- mantainer: string;
8
- architecture: string;
9
- description: string;
10
- binaryDependencies: {
11
- depends: string[];
4
+ export interface IPackages {
5
+ backend: string;
6
+ operations: {
7
+ remove: string[];
8
+ try_install: string[];
12
9
  };
13
10
  }
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
+ /**
3
+ * calamares module packages
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,8 +9,8 @@ export { IInitrd } from './i-initrd';
9
9
  export { IWorkDir } from './i-workdir';
10
10
  export { IInstall } from './i-install';
11
11
  export { IExec } from './i-exec';
12
- export { IConfig } from './i-config';
13
12
  export { IInstaller } from './i-installer';
13
+ export { IEggsConfig } from './i-eggs-config';
14
14
  export { IBranding } from './i-branding';
15
15
  export { ISettings } from './i-settings';
16
16
  export { IPartitions } from './i-partitions';
@@ -5,6 +5,7 @@
5
5
  * mail: piero.proietti@gmail.com
6
6
  *
7
7
  */
8
+ import { IKrillConfig } from '../interfaces/i-krill-config';
8
9
  import Locales from '../classes/locales';
9
10
  import Keyboards from '../classes/keyboards';
10
11
  import { INet } from '../interfaces';
@@ -13,12 +14,13 @@ import { IWelcome, ILocation, IKeyboard, IPartitions, IUsers } from '../interfac
13
14
  *
14
15
  */
15
16
  export default class Krill {
17
+ krillConfig: IKrillConfig;
16
18
  locales: Locales;
17
19
  keyboards: Keyboards;
18
20
  /**
19
21
  * @param cryped
20
22
  */
21
- prepare(cryped?: boolean, pve?: boolean, verbose?: boolean): Promise<void>;
23
+ prepare(unattended?: boolean, cryped?: boolean, pve?: boolean, verbose?: boolean): Promise<void>;
22
24
  /**
23
25
  * WELCOME
24
26
  */
@@ -46,11 +48,11 @@ export default class Krill {
46
48
  /**
47
49
  * SUMMARY
48
50
  */
49
- summary(location: ILocation, keyboard: IKeyboard, partitions: IPartitions): Promise<void>;
51
+ summary(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, unattended?: boolean): Promise<void>;
50
52
  /**
51
53
  * INSTALL
52
54
  */
53
- install(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, network: INet, verbose?: boolean): Promise<void>;
55
+ install(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, network: INet, unattended?: boolean, verbose?: boolean): Promise<void>;
54
56
  /**
55
57
  * return true if pv exist
56
58
  */
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const tslib_1 = require("tslib");
11
11
  /**
12
12
  * Ideally, I want to respect calamares way, remplementing the same (SEMPLIFIED) steps
13
- * for CLI
13
+ * in a TUI interface
14
14
  *
15
15
  * Phase 1 - prepare.
16
16
  * View modules are shown as UI pages, jobs from job modules
@@ -24,10 +24,7 @@ const tslib_1 = require("tslib");
24
24
  * - network
25
25
  * - summary
26
26
  */
27
- /**
28
- * problems:
29
- *
30
- */
27
+ const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
31
28
  const react_1 = tslib_1.__importDefault(require("react"));
32
29
  const ink_1 = require("ink");
33
30
  const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
@@ -69,18 +66,20 @@ const get_gateway_1 = tslib_1.__importDefault(require("../lib/get_gateway"));
69
66
  const get_domain_1 = tslib_1.__importDefault(require("../lib/get_domain"));
70
67
  const get_dns_1 = tslib_1.__importDefault(require("../lib/get_dns"));
71
68
  const krill_sequence_1 = tslib_1.__importDefault(require("./krill-sequence"));
69
+ const config_file = '/etc/penguins-eggs.d/krill.yaml';
72
70
  /**
73
71
  *
74
72
  */
75
73
  class Krill {
76
74
  constructor() {
75
+ this.krillConfig = {};
77
76
  this.locales = new locales_1.default();
78
77
  this.keyboards = new keyboards_1.default();
79
78
  }
80
79
  /**
81
80
  * @param cryped
82
81
  */
83
- async prepare(cryped = false, pve = false, verbose = false) {
82
+ async prepare(unattended = false, cryped = false, pve = false, verbose = false) {
84
83
  /**
85
84
  * Check for disk presence
86
85
  */
@@ -101,21 +100,92 @@ class Krill {
101
100
  if (await systemdCtl.isActive('udisks2.service')) {
102
101
  await systemdCtl.stop('udisks2.service');
103
102
  }
104
- const oWelcome = await this.welcome();
105
- const oLocation = await this.location(oWelcome.language);
106
- const oKeyboard = await this.keyboard();
107
- const oPartitions = await this.partitions(cryped, pve);
108
- const oUsers = await this.users();
109
- const oNetwork = await this.network();
110
- await this.summary(oLocation, oKeyboard, oPartitions);
111
- // installation
112
- await this.install(oLocation, oKeyboard, oPartitions, oUsers, oNetwork, verbose);
103
+ let oWelcome = {};
104
+ let oLocation = {};
105
+ let oKeyboard = {};
106
+ let oPartitions = {};
107
+ let oUsers = {};
108
+ let oNetwork = {};
109
+ /**
110
+ * load default values
111
+ */
112
+ if (!fs_1.default.existsSync(config_file)) {
113
+ console.log(`cannot find configuration file ${config_file},`);
114
+ process.exit(1);
115
+ }
116
+ this.krillConfig = js_yaml_1.default.load(fs_1.default.readFileSync(config_file, 'utf-8'));
117
+ if (unattended) {
118
+ oWelcome = { language: this.krillConfig.language };
119
+ oLocation = {
120
+ language: this.krillConfig.language,
121
+ region: this.krillConfig.region,
122
+ zone: this.krillConfig.zone
123
+ };
124
+ oKeyboard = {
125
+ keyboardModel: this.krillConfig.keyboardModel,
126
+ keyboardLayout: this.krillConfig.keyboardLayout,
127
+ keyboardVariant: this.krillConfig.keyboardVariant,
128
+ keyboardOption: this.krillConfig.keyboardOption
129
+ };
130
+ const drives = shelljs_1.default.exec('lsblk |grep disk|cut -f 1 "-d "', { silent: true }).stdout.trim().split('\n');
131
+ const driveList = [];
132
+ drives.forEach((element) => {
133
+ driveList.push('/dev/' + element);
134
+ });
135
+ oPartitions = {
136
+ installationDevice: driveList[0],
137
+ installationMode: this.krillConfig.installationMode,
138
+ filesystemType: this.krillConfig.filesystemType,
139
+ userSwapChoice: this.krillConfig.userSwapChoice
140
+ };
141
+ let hostname = this.krillConfig.hostname;
142
+ if (hostname === '') {
143
+ hostname = shelljs_1.default.exec('cat /etc/hostname').trim();
144
+ }
145
+ oUsers = {
146
+ name: this.krillConfig.name,
147
+ fullname: this.krillConfig.fullname,
148
+ password: this.krillConfig.password,
149
+ rootPassword: this.krillConfig.rootPassword,
150
+ autologin: this.krillConfig.autologin,
151
+ hostname: hostname
152
+ };
153
+ oNetwork =
154
+ {
155
+ iface: await utils_1.default.iface(),
156
+ addressType: this.krillConfig.addressType,
157
+ address: utils_1.default.address(),
158
+ netmask: utils_1.default.netmask(),
159
+ gateway: utils_1.default.gateway(),
160
+ dns: utils_1.default.getDns(),
161
+ domain: utils_1.default.getDomain()
162
+ };
163
+ }
164
+ else {
165
+ oWelcome = await this.welcome();
166
+ oLocation = await this.location(oWelcome.language);
167
+ oKeyboard = await this.keyboard();
168
+ oPartitions = await this.partitions(cryped, pve);
169
+ oUsers = await this.users();
170
+ oNetwork = await this.network();
171
+ }
172
+ /**
173
+ * summary
174
+ */
175
+ await this.summary(oLocation, oKeyboard, oPartitions, oUsers, unattended);
176
+ /**
177
+ * installation
178
+ */
179
+ await this.install(oLocation, oKeyboard, oPartitions, oUsers, oNetwork, unattended, verbose);
113
180
  }
114
181
  /**
115
182
  * WELCOME
116
183
  */
117
184
  async welcome() {
118
- let language = 'en_US.UTF-8'; // await this.locales.getDefault()
185
+ let language = this.krillConfig.language;
186
+ if (language === '') {
187
+ language = await this.locales.getDefault(); // 'en_US.UTF-8'
188
+ }
119
189
  let welcomeElem;
120
190
  while (true) {
121
191
  welcomeElem = react_1.default.createElement(welcome_1.default, { language: language });
@@ -130,9 +200,14 @@ class Krill {
130
200
  * LOCATION
131
201
  */
132
202
  async location(language) {
133
- // get timezone local
134
- let region = shelljs_1.default.exec('cut -f1 -d/ < /etc/timezone', { silent: true }).stdout.trim();
135
- let zone = shelljs_1.default.exec('cut -f2 -d/ < /etc/timezone', { silent: true }).stdout.trim();
203
+ let region = this.krillConfig.region;
204
+ if (region === '') {
205
+ let region = shelljs_1.default.exec('cut -f1 -d/ < /etc/timezone', { silent: true }).stdout.trim();
206
+ }
207
+ let zone = this.krillConfig.zone;
208
+ if (zone === '') {
209
+ zone = shelljs_1.default.exec('cut -f2 -d/ < /etc/timezone', { silent: true }).stdout.trim();
210
+ }
136
211
  // Try to auto-configure timezone by internet
137
212
  const url = `https://geoip.kde.org/v1/calamares`;
138
213
  try {
@@ -166,10 +241,22 @@ class Krill {
166
241
  * KEYBOARD
167
242
  */
168
243
  async keyboard() {
169
- let keyboardModel = await this.keyboards.getModel();
170
- let keyboardLayout = await this.keyboards.getLayout();
171
- let keyboardVariant = await this.keyboards.getVariant();
172
- let keyboardOption = await this.keyboards.getOption();
244
+ let keyboardModel = this.krillConfig.keyboardModel;
245
+ if (keyboardModel === '') {
246
+ keyboardModel = await this.keyboards.getModel();
247
+ }
248
+ let keyboardLayout = this.krillConfig.keyboardLayout;
249
+ if (keyboardLayout === '') {
250
+ keyboardLayout = await this.keyboards.getLayout();
251
+ }
252
+ let keyboardVariant = this.krillConfig.keyboardVariant;
253
+ if (keyboardVariant === '') {
254
+ keyboardVariant = await this.keyboards.getVariant();
255
+ }
256
+ let keyboardOption = this.krillConfig.keyboardOption;
257
+ if (keyboardOption === '') {
258
+ keyboardOption = await this.keyboards.getOption();
259
+ }
173
260
  let keyboardElem;
174
261
  while (true) {
175
262
  keyboardElem = react_1.default.createElement(keyboard_1.default, { keyboardModel: keyboardModel, keyboardLayout: keyboardLayout, keyboardVariant: keyboardVariant, keyboardOptions: keyboardOption });
@@ -207,7 +294,10 @@ class Krill {
207
294
  driveList.push('/dev/' + element);
208
295
  });
209
296
  let installationDevice = driveList[0]; // it was just /dev/sda before
210
- let installationMode = 'standard';
297
+ let installationMode = this.krillConfig.installationMode;
298
+ if (installationMode === '') {
299
+ installationMode = 'standard';
300
+ }
211
301
  if (crypted) {
212
302
  installationMode = 'full-encrypted';
213
303
  }
@@ -250,11 +340,26 @@ class Krill {
250
340
  * USERS
251
341
  */
252
342
  async users() {
253
- let name = 'artisan';
254
- let fullname = 'artisan';
255
- let password = 'evolution';
256
- let rootPassword = 'evolution';
257
- let hostname = shelljs_1.default.exec('cat /etc/hostname').trim();
343
+ let name = this.krillConfig.name;
344
+ if (name === '') {
345
+ name = 'artisan';
346
+ }
347
+ let fullname = this.krillConfig.fullname;
348
+ if (fullname === '') {
349
+ fullname = 'artisan';
350
+ }
351
+ let password = this.krillConfig.password;
352
+ if (password === '') {
353
+ password = 'evolution';
354
+ }
355
+ let rootPassword = this.krillConfig.rootPassword;
356
+ if (rootPassword === '') {
357
+ rootPassword = 'evolution';
358
+ }
359
+ let hostname = this.krillConfig.hostname;
360
+ if (hostname === '') {
361
+ hostname = shelljs_1.default.exec('cat /etc/hostname').trim();
362
+ }
258
363
  let autologin = true;
259
364
  let sameUserPassword = true;
260
365
  let usersElem;
@@ -283,7 +388,7 @@ class Krill {
283
388
  async network() {
284
389
  const i = {};
285
390
  const ifaces = fs_1.default.readdirSync('/sys/class/net/');
286
- i.iface = utils_1.default.iface();
391
+ i.iface = await utils_1.default.iface();
287
392
  i.addressType = 'dhcp';
288
393
  i.address = utils_1.default.address();
289
394
  i.netmask = utils_1.default.netmask();
@@ -325,11 +430,20 @@ class Krill {
325
430
  /**
326
431
  * SUMMARY
327
432
  */
328
- async summary(location, keyboard, partitions) {
433
+ async summary(location, keyboard, partitions, users, unattended = false) {
329
434
  let summaryElem;
435
+ let message = "";
436
+ if (unattended) {
437
+ message = "Unattended installation will start in 30 seconds, press CTRL-C to abort!";
438
+ }
330
439
  while (true) {
331
- summaryElem = react_1.default.createElement(summary_1.default, { region: location.region, zone: location.zone, language: location.language, keyboardModel: keyboard.keyboardModel, keyboardLayout: keyboard.keyboardLayout, installationDevice: partitions.installationDevice });
332
- if (await confirm(summaryElem, "Confirm Summary datas?")) {
440
+ summaryElem = react_1.default.createElement(summary_1.default, { name: users.name, password: users.password, rootPassword: users.rootPassword, hostname: users.hostname, region: location.region, zone: location.zone, language: location.language, keyboardModel: keyboard.keyboardModel, keyboardLayout: keyboard.keyboardLayout, installationDevice: partitions.installationDevice, message: message });
441
+ if (unattended) {
442
+ redraw(summaryElem);
443
+ await sleep(30000);
444
+ break;
445
+ }
446
+ else if (await confirm(summaryElem, "Confirm Summary datas?")) {
333
447
  break;
334
448
  }
335
449
  }
@@ -337,9 +451,9 @@ class Krill {
337
451
  /**
338
452
  * INSTALL
339
453
  */
340
- async install(location, keyboard, partitions, users, network, verbose = false) {
454
+ async install(location, keyboard, partitions, users, network, unattended = false, verbose = false) {
341
455
  const sequence = new krill_sequence_1.default(location, keyboard, partitions, users, network);
342
- await sequence.install(verbose);
456
+ await sequence.install(unattended, verbose);
343
457
  }
344
458
  /**
345
459
  * return true if pv exist
@@ -394,3 +508,13 @@ function netmask2CIDR(mask) {
394
508
  .map(part => decimalToBinary(part))
395
509
  .join(''), '1');
396
510
  }
511
+ /**
512
+ *
513
+ * @param ms
514
+ * @returns
515
+ */
516
+ function sleep(ms = 0) {
517
+ return new Promise((resolve) => {
518
+ setTimeout(resolve, ms);
519
+ });
520
+ }
@@ -45,7 +45,7 @@ import { IRemix, IDistro, INet } from '../interfaces';
45
45
  import Settings from '../classes/settings';
46
46
  import { IInstaller, IDevices } from '../interfaces';
47
47
  import { ILocation, IKeyboard, IPartitions, IUsers } from '../interfaces/i-krill';
48
- import partition from './modules/partitions';
48
+ import partition from './modules/partition';
49
49
  import { mountFs, umountFs } from './modules/mount-fs';
50
50
  import { mountVfs, umountVfs } from './modules/mount-vfs';
51
51
  import unpackfs from './modules/unpackfs';
@@ -62,6 +62,7 @@ import bootloaderConfigArch from './modules/bootloader-config-arch';
62
62
  import bootloaderConfigUbuntu from './modules/bootloader-config-ubuntu';
63
63
  import grubcfg from './modules/grubcfg';
64
64
  import bootloader from './modules/bootloader';
65
+ import packages from './modules/packages';
65
66
  import removeInstallerLink from './modules/remove-installer-link';
66
67
  import initramfsCfg from './modules/initramfs-cfg';
67
68
  import initramfs from './modules/initramfs';
@@ -92,6 +93,7 @@ export default class Sequence {
92
93
  bootloaderConfigUbuntu: typeof bootloaderConfigUbuntu;
93
94
  grubcfg: typeof grubcfg;
94
95
  bootloader: typeof bootloader;
96
+ packages: typeof packages;
95
97
  removeInstallerLink: typeof removeInstallerLink;
96
98
  initramfsCfg: typeof initramfsCfg;
97
99
  initramfs: typeof initramfs;
@@ -137,7 +139,7 @@ export default class Sequence {
137
139
  * @param umount
138
140
  * @returns
139
141
  */
140
- install(verbose?: boolean): Promise<void>;
142
+ install(unattended?: boolean, verbose?: boolean): Promise<void>;
141
143
  /**
142
144
  *
143
145
  */
@@ -145,5 +147,5 @@ export default class Sequence {
145
147
  /**
146
148
  * only show the result
147
149
  */
148
- finished(): Promise<void>;
150
+ finished(unattended?: boolean): Promise<void>;
149
151
  }