penguins-eggs 9.0.16 → 9.0.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 (85) hide show
  1. package/README.md +49 -27
  2. package/addons/{blissos → telos}/theme/applications/install-debian.desktop +0 -0
  3. package/addons/{blissos → telos}/theme/artwork/install-debian.png +0 -0
  4. package/addons/telos/theme/calamares/branding/banner.png +0 -0
  5. package/addons/telos/theme/calamares/branding/branding.desc +25 -0
  6. package/addons/telos/theme/calamares/branding/show.qml +51 -0
  7. package/addons/telos/theme/calamares/branding/slide1.png +0 -0
  8. package/addons/telos/theme/calamares/branding/telos-logo.png +0 -0
  9. package/addons/telos/theme/calamares/branding/welcome.png +0 -0
  10. package/addons/{blissos → telos}/theme/calamares/modules/partition.yml +0 -0
  11. package/addons/{blissos → telos}/theme/livecd/grub.theme.cfg +1 -1
  12. package/addons/{blissos → telos}/theme/livecd/isolinux.theme.cfg +1 -1
  13. package/addons/telos/theme/livecd/splash.png +0 -0
  14. package/addons/templates/grub.template +2 -0
  15. package/addons/waydroid/theme/applications/install-debian.desktop +28 -0
  16. package/addons/waydroid/theme/artwork/install-debian.png +0 -0
  17. package/addons/{blissos → waydroid}/theme/calamares/branding/branding.desc +0 -0
  18. package/addons/{blissos → waydroid}/theme/calamares/branding/languages.png +0 -0
  19. package/addons/{blissos → waydroid}/theme/calamares/branding/show.qml +0 -0
  20. package/addons/{blissos → waydroid}/theme/calamares/branding/slide1.png +0 -0
  21. package/addons/{blissos → waydroid}/theme/calamares/branding/slide2.png +0 -0
  22. package/addons/{blissos → waydroid}/theme/calamares/branding/slide3.png +0 -0
  23. package/addons/{blissos/theme/calamares/branding/blissos-logo.png → waydroid/theme/calamares/branding/waydroid-logo.png} +0 -0
  24. package/addons/{blissos → waydroid}/theme/calamares/branding/welcome.png +0 -0
  25. package/addons/waydroid/theme/calamares/modules/partition.yml +233 -0
  26. package/addons/waydroid/theme/livecd/grub.theme.cfg +43 -0
  27. package/addons/waydroid/theme/livecd/isolinux.theme.cfg +45 -0
  28. package/addons/{blissos → waydroid}/theme/livecd/splash.png +0 -0
  29. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +57 -38
  30. package/lib/classes/daddy.js +7 -7
  31. package/lib/classes/distro.d.ts +4 -2
  32. package/lib/classes/distro.js +60 -76
  33. package/lib/classes/family/debian.js +2 -2
  34. package/lib/classes/i18n.js +2 -2
  35. package/lib/classes/incubation/fisherman-helper/packages.js +1 -1
  36. package/lib/classes/incubation/incubator.js +6 -1
  37. package/lib/classes/incubation/installer.d.ts +1 -1
  38. package/lib/classes/incubation/installer.js +2 -2
  39. package/lib/classes/krill_install.d.ts +56 -26
  40. package/lib/classes/krill_install.js +598 -357
  41. package/lib/classes/krill_prepare.d.ts +7 -3
  42. package/lib/classes/krill_prepare.js +62 -22
  43. package/lib/classes/ovary.d.ts +27 -27
  44. package/lib/classes/ovary.js +344 -370
  45. package/lib/classes/pacman.d.ts +1 -1
  46. package/lib/classes/pacman.js +21 -21
  47. package/lib/classes/pve-live.js +10 -14
  48. package/lib/classes/systemctl.d.ts +36 -7
  49. package/lib/classes/systemctl.js +63 -28
  50. package/lib/classes/utils.d.ts +14 -3
  51. package/lib/classes/utils.js +66 -19
  52. package/lib/classes/xdg.js +18 -34
  53. package/lib/classes/yolk.d.ts +12 -10
  54. package/lib/classes/yolk.js +50 -52
  55. package/lib/commands/install.d.ts +1 -0
  56. package/lib/commands/install.js +14 -3
  57. package/lib/commands/kill.js +1 -1
  58. package/lib/commands/produce.js +4 -4
  59. package/lib/commands/syncfrom.d.ts +9 -3
  60. package/lib/commands/syncfrom.js +38 -31
  61. package/lib/commands/syncto.d.ts +26 -6
  62. package/lib/commands/syncto.js +71 -48
  63. package/lib/components/elements/information.js +31 -12
  64. package/lib/components/partitions.d.ts +1 -2
  65. package/lib/components/partitions.js +1 -4
  66. package/lib/interfaces/i-devices.d.ts +1 -0
  67. package/lib/interfaces/i-distro.d.ts +4 -2
  68. package/lib/interfaces/i-installer.d.ts +1 -1
  69. package/lib/interfaces/i-krill.d.ts +0 -1
  70. package/lib/lib/cli-autologin.js +8 -3
  71. package/lib/lib/select_installation_device.js +1 -0
  72. package/lib/lib/select_installation_mode.js +1 -1
  73. package/manpages/doc/man/eggs.html +65 -6
  74. package/oclif.manifest.json +1 -1
  75. package/package.json +14 -13
  76. package/scripts/_eggs +9 -8
  77. package/scripts/bros/waydroid-helper.sh +1 -1
  78. package/scripts/eggs.bash +3 -3
  79. package/scripts/{not-used/install-eggs-ppa.sh → install-eggs-ppa.sh} +1 -0
  80. package/scripts/mom-cli.sh +1 -1
  81. package/scripts/{not-used/pve-live.sh → pve-live.sh} +2 -6
  82. package/scripts/userexist.sh +6 -0
  83. package/scripts/not-used/eggs-cleanup.sh +0 -7
  84. package/scripts/not-used/mkinitramfs +0 -469
  85. package/scripts/update-initramfs +0 -94
@@ -5,7 +5,7 @@ export default class Krill {
5
5
  *
6
6
  * @param cryped
7
7
  */
8
- prepare(cryped?: boolean): Promise<void>;
8
+ prepare(cryped?: boolean, pve?: boolean, verbose?: boolean): Promise<void>;
9
9
  /**
10
10
  * WELCOME
11
11
  */
@@ -21,7 +21,7 @@ export default class Krill {
21
21
  /**
22
22
  * PARTITIONS
23
23
  */
24
- partitions(crypted?: boolean): Promise<IPartitions>;
24
+ partitions(crypted?: boolean, pve?: boolean): Promise<IPartitions>;
25
25
  /**
26
26
  * USERS
27
27
  */
@@ -37,5 +37,9 @@ export default class Krill {
37
37
  /**
38
38
  * INSTALL
39
39
  */
40
- install(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, network: INet): Promise<void>;
40
+ install(location: ILocation, keyboard: IKeyboard, partitions: IPartitions, users: IUsers, network: INet, verbose?: boolean): Promise<void>;
41
+ /**
42
+ * return true if pv exist
43
+ */
44
+ private pvExist;
41
45
  }
@@ -6,6 +6,7 @@ const ink_1 = require("ink");
6
6
  const utils_1 = (0, tslib_1.__importDefault)(require("./utils"));
7
7
  const shelljs_1 = (0, tslib_1.__importDefault)(require("shelljs"));
8
8
  const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
9
+ const systemctl_1 = (0, tslib_1.__importDefault)(require("./systemctl"));
9
10
  // libraries
10
11
  const exec = require('../lib/utils').exec;
11
12
  const welcome_1 = (0, tslib_1.__importDefault)(require("../components/welcome"));
@@ -40,21 +41,41 @@ class Krill {
40
41
  *
41
42
  * @param cryped
42
43
  */
43
- async prepare(cryped = false) {
44
+ async prepare(cryped = false, pve = false, verbose = false) {
45
+ /**
46
+ * Check for disk presence
47
+ */
48
+ const drives = shelljs_1.default.exec('lsblk |grep disk|cut -f 1 "-d "', { silent: true }).stdout.trim().split('\n');
49
+ if (drives[0] === '') {
50
+ await utils_1.default.pressKeyToExit(`No disk to install the system in this machine.\nkrill installer refuses to continue`);
51
+ }
52
+ /**
53
+ * check for lvm2
54
+ */
55
+ if (await this.pvExist()) {
56
+ await utils_1.default.pressKeyToExit(`There is a lvm2 volume in the system, remove it manually before installation.\nkrill installer refuses to continue`);
57
+ }
58
+ /**
59
+ * stop udisks2.service
60
+ */
61
+ const systemdCtl = new systemctl_1.default(verbose);
62
+ if (await systemdCtl.isActive('udisks2.service')) {
63
+ await systemdCtl.stop('udisks2.service');
64
+ }
44
65
  const oWelcome = await this.welcome();
45
66
  const oLocation = await this.location(oWelcome.language);
46
67
  const oKeyboard = await this.keyboard();
47
- const oPartitions = await this.partitions(cryped);
68
+ const oPartitions = await this.partitions(cryped, pve);
48
69
  const oUsers = await this.users();
49
70
  const oNetwork = await this.network();
50
71
  await this.summary(oLocation, oKeyboard, oPartitions);
51
- await this.install(oLocation, oKeyboard, oPartitions, oUsers, oNetwork);
72
+ await this.install(oLocation, oKeyboard, oPartitions, oUsers, oNetwork, verbose);
52
73
  }
53
74
  /**
54
75
  * WELCOME
55
76
  */
56
77
  async welcome() {
57
- let language = shelljs_1.default.exec('cat /etc/default/locale |grep LANG=| cut -f2 -d=|cut -f1 -d.', { silent: true }).stdout.trim();
78
+ let language = shelljs_1.default.exec(`grep LANG= < /etc/default/locale| cut -f2 -d=|cut -f1 -d.`, { silent: true }).stdout.trim();
58
79
  let welcomeElem;
59
80
  while (true) {
60
81
  welcomeElem = react_1.default.createElement(welcome_1.default, { language: language });
@@ -74,8 +95,8 @@ class Krill {
74
95
  * LOCATION
75
96
  */
76
97
  async location(language) {
77
- let region = shelljs_1.default.exec('cat /etc/timezone |cut -f1 -d/', { silent: true }).stdout.trim();
78
- let zone = shelljs_1.default.exec('cat /etc/timezone |cut -f2 -d/', { silent: true }).stdout.trim();
98
+ let region = shelljs_1.default.exec('cut -f1 -d/ < /etc/timezone', { silent: true }).stdout.trim();
99
+ let zone = shelljs_1.default.exec('cut -f2 -d/ < /etc/timezone', { silent: true }).stdout.trim();
79
100
  let locationElem;
80
101
  while (true) {
81
102
  locationElem = react_1.default.createElement(location_1.default, { language: language, region: region, zone: zone });
@@ -103,13 +124,13 @@ class Krill {
103
124
  * KEYBOARD
104
125
  */
105
126
  async keyboard() {
106
- let keyboardModel = shelljs_1.default.exec('cat /etc/default/keyboard |grep XKBMODEL|cut -f2 -d=|cut -f2 "-d\\""', { silent: true }).stdout.trim();
127
+ let keyboardModel = shelljs_1.default.exec('grep XKBMODEL < /etc/default/keyboard |cut -f2 -d= | cut -f2 "-d\\""', { silent: true }).stdout.trim();
107
128
  if (keyboardModel === '') {
108
129
  keyboardModel = "pc105";
109
130
  }
110
- let keyboardLayout = shelljs_1.default.exec('cat /etc/default/keyboard |grep XKBLAYOUT|cut -f2 -d=|cut -f2 "-d\\""', { silent: true }).stdout.trim();
111
- let keyboardVariant = shelljs_1.default.exec('/etc/default/keyboard |grep XKBVARIANT|cut -f2 -d=|cut -f2 "-d\\""', { silent: true }).stdout.trim();
112
- let keyboardOptions = shelljs_1.default.exec('cat /etc/default/keyboard |grep XKBOPTIONS|cut -f2 -d=|cut -f2 "-d\\""', { silent: true }).stdout.trim();
131
+ let keyboardLayout = shelljs_1.default.exec('grep XKBLAYOUT < /etc/default/keyboard | cut -f2 -d= | cut -f2 "-d\\""', { silent: true }).stdout.trim();
132
+ let keyboardVariant = shelljs_1.default.exec('grep XKBVARIANT < /etc/default/keyboard | cut -f2 -d=|cut -f2 "-d\\""', { silent: true }).stdout.trim();
133
+ let keyboardOptions = shelljs_1.default.exec('grep XKBOPTIONS < /etc/default/keyboard | cut -f2 -d= | cut -f2 "-d\\""', { silent: true }).stdout.trim();
113
134
  let keyboardElem;
114
135
  while (true) {
115
136
  keyboardElem = react_1.default.createElement(keyboard_1.default, { keyboardModel: keyboardModel, keyboardLayout: keyboardLayout, keyboardVariant: keyboardVariant });
@@ -132,18 +153,25 @@ class Krill {
132
153
  /**
133
154
  * PARTITIONS
134
155
  */
135
- async partitions(crypted = false) {
136
- let installationDevice = '/dev/sda';
156
+ async partitions(crypted = false, pve = false) {
157
+ const drives = shelljs_1.default.exec('lsblk |grep disk|cut -f 1 "-d "', { silent: true }).stdout.trim().split('\n');
158
+ const driveList = [];
159
+ drives.forEach((element) => {
160
+ driveList.push('/dev/' + element);
161
+ });
162
+ let installationDevice = driveList[0]; // it was just /dev/sda before
137
163
  let installationMode = 'standard';
138
164
  if (crypted) {
139
165
  installationMode = 'full-encrypted';
140
166
  }
141
- let luksPassphrase = 'evolution';
167
+ else if (pve) {
168
+ installationMode = 'lvm2';
169
+ }
142
170
  let filesystemType = 'ext4';
143
171
  let userSwapChoice = 'small';
144
172
  let partitionsElem;
145
173
  while (true) {
146
- partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, luksPassphrase: luksPassphrase, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
174
+ partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
147
175
  if (await confirm(partitionsElem, "Confirm Partitions datas?")) {
148
176
  break;
149
177
  }
@@ -153,27 +181,28 @@ class Krill {
153
181
  if (crypted) {
154
182
  installationMode = 'full-encrypted';
155
183
  }
156
- luksPassphrase = 'evolution';
184
+ else if (pve) {
185
+ installationMode = 'lvm2';
186
+ }
157
187
  filesystemType = '';
158
188
  userSwapChoice = '';
159
189
  }
160
- partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, luksPassphrase: luksPassphrase, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
190
+ partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
161
191
  redraw(partitionsElem);
162
192
  installationDevice = await (0, select_installation_device_1.default)();
163
- partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, luksPassphrase: luksPassphrase, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
193
+ partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
164
194
  redraw(partitionsElem);
165
195
  installationMode = await (0, select_installation_mode_1.default)();
166
- partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, luksPassphrase: luksPassphrase, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
196
+ partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
167
197
  redraw(partitionsElem);
168
198
  filesystemType = await (0, select_filesystem_type_1.default)();
169
- partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, luksPassphrase: luksPassphrase, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
199
+ partitionsElem = react_1.default.createElement(partitions_1.default, { installationDevice: installationDevice, installationMode: installationMode, filesystemType: filesystemType, userSwapChoice: userSwapChoice });
170
200
  redraw(partitionsElem);
171
201
  userSwapChoice = await (0, select_user_swap_choice_1.default)();
172
202
  }
173
203
  return {
174
204
  installationDevice: installationDevice,
175
205
  installationMode: installationMode,
176
- luksPassphrase: luksPassphrase,
177
206
  filesystemType: filesystemType,
178
207
  userSwapChoice: userSwapChoice
179
208
  };
@@ -277,9 +306,20 @@ class Krill {
277
306
  /**
278
307
  * INSTALL
279
308
  */
280
- async install(location, keyboard, partitions, users, network) {
309
+ async install(location, keyboard, partitions, users, network, verbose = false) {
281
310
  const hatching = new krill_install_1.default(location, keyboard, partitions, users, network);
282
- hatching.install(true);
311
+ hatching.install(verbose);
312
+ }
313
+ /**
314
+ * return true if pv exist
315
+ */
316
+ async pvExist() {
317
+ let exist = false;
318
+ const check = `#!/bin/sh\npvdisplay |grep "PV Name" >/dev/null && echo 1|| echo 0`;
319
+ if (shelljs_1.default.exec(check).stdout.trim() === '1') {
320
+ exist = true;
321
+ }
322
+ return exist;
283
323
  }
284
324
  }
285
325
  exports.default = Krill;
@@ -6,23 +6,19 @@ import Users from './users';
6
6
  * Ovary:
7
7
  */
8
8
  export default class Ovary {
9
+ verbose: boolean;
10
+ echo: {};
9
11
  toNull: string;
10
12
  incubator: Incubator;
11
13
  settings: Settings;
12
14
  familyId: string;
13
15
  snapshot_prefix: string;
14
16
  snapshot_basename: string;
15
- theme: string;
16
17
  compression: string;
17
- /**
18
- * Egg
19
- * @param compression
20
- */
21
- constructor(snapshot_prefix?: string, snapshot_basename?: string, theme?: string, compression?: string);
22
18
  /**
23
19
  * @returns {boolean} success
24
20
  */
25
- fertilization(): Promise<boolean>;
21
+ fertilization(snapshot_prefix?: string, snapshot_basename?: string, theme?: string, compression?: string): Promise<boolean>;
26
22
  /**
27
23
  *
28
24
  * @param basename
@@ -31,7 +27,12 @@ export default class Ovary {
31
27
  /**
32
28
  * Crea la struttura della workdir
33
29
  */
34
- liveCreateStructure(verbose?: boolean): Promise<void>;
30
+ liveCreateStructure(): Promise<void>;
31
+ /**
32
+ *
33
+ * @param cmd
34
+ */
35
+ tryCatch(cmd?: string): Promise<void>;
35
36
  /**
36
37
  * editLiveFs
37
38
  * - Truncate logs, remove archived log
@@ -42,33 +43,32 @@ export default class Ovary {
42
43
  * - Add some basic files to /dev
43
44
  * - Clear configs from /etc/network/interfaces, wicd and NetworkManager and netman
44
45
  */
45
- editLiveFs(verbose?: boolean): Promise<void>;
46
+ editLiveFs(): Promise<void>;
46
47
  /**
47
48
  * syslinux
48
49
  */
49
- syslinux(verbose?: boolean): Promise<void>;
50
+ syslinux(): Promise<void>;
50
51
  /**
51
52
  * async isolinux
52
53
  */
53
- isolinux(theme?: string, verbose?: boolean): Promise<void>;
54
+ isolinux(theme?: string): Promise<void>;
54
55
  /**
55
56
  * copy kernel
56
57
  */
57
- kernelCopy(verbose?: boolean): Promise<void>;
58
+ kernelCopy(): Promise<void>;
58
59
  /**
59
- * necessita di verbose
60
+ * necessita di echoYes
60
61
  */
61
- initrdCreate(verbose?: boolean): Promise<void>;
62
+ initrdCreate(): Promise<void>;
62
63
  /**
63
- *
64
- * @param verbose
64
+ * We must upgrade to initrdCreate for Debian/Ubuntu
65
65
  * @returns
66
66
  */
67
67
  initrdCopy(verbose?: boolean): Promise<void>;
68
68
  /**
69
69
  * squashFs: crea in live filesystem.squashfs
70
70
  */
71
- makeSquashfs(scriptOnly?: boolean, verbose?: boolean): Promise<void>;
71
+ makeSquashfs(scriptOnly?: boolean): Promise<void>;
72
72
  /**
73
73
  * Restituisce true per le direcory da montare con overlay
74
74
  *
@@ -97,36 +97,36 @@ export default class Ovary {
97
97
  *
98
98
  * @param verbose
99
99
  */
100
- bindLiveFs(verbose?: boolean): Promise<void>;
100
+ bindLiveFs(): Promise<void>;
101
101
  /**
102
102
  * ubind del fs live
103
103
  * @param verbose
104
104
  */
105
- uBindLiveFs(verbose?: boolean): Promise<void>;
105
+ uBindLiveFs(): Promise<void>;
106
106
  /**
107
107
  * bind dei virtual file system
108
108
  */
109
- bindVfs(verbose?: boolean): Promise<void>;
109
+ bindVfs(): Promise<void>;
110
110
  /**
111
111
  *
112
112
  * @param verbose
113
113
  */
114
- ubindVfs(verbose?: boolean): Promise<void>;
114
+ ubindVfs(): Promise<void>;
115
115
  /**
116
116
  *
117
117
  * @param verbose
118
118
  */
119
- cleanUsersAccounts(verbose?: boolean): Promise<void>;
119
+ cleanUsersAccounts(): Promise<void>;
120
120
  /**
121
121
  * list degli utenti: grep -E 1[0-9]{3} /etc/passwd | sed s/:/\ / | awk '{print $1}'
122
122
  * create la home per user_opt
123
123
  * @param verbose
124
124
  */
125
- createUserLive(verbose?: boolean): Promise<void>;
125
+ createUserLive(): Promise<void>;
126
126
  /**
127
127
  *
128
128
  */
129
- createXdgAutostart(theme: string | undefined, myAddons: IMyAddons, verbose?: boolean): Promise<void>;
129
+ createXdgAutostart(theme: string | undefined, myAddons: IMyAddons): Promise<void>;
130
130
  /**
131
131
  * Creazione link desktop per lxde
132
132
  * @param name
@@ -142,13 +142,13 @@ export default class Ovary {
142
142
  /**
143
143
  * makeEfi
144
144
  */
145
- makeEfi(theme?: string, verbose?: boolean): Promise<void>;
145
+ makeEfi(theme?: string): Promise<void>;
146
146
  /**
147
147
  * makeDotDisk
148
148
  * create .disk/info, .disk/mksquashfs, .disk/mkiso
149
149
  * return mkiso
150
150
  */
151
- makeDotDisk(backup?: boolean, verbose?: boolean): string;
151
+ makeDotDisk(backup?: boolean): string;
152
152
  /**
153
153
  *
154
154
  * @param backup
@@ -159,7 +159,7 @@ export default class Ovary {
159
159
  * makeIso
160
160
  * cmd: cmd 4 xorirriso
161
161
  */
162
- makeIso(cmd: string, scriptOnly?: boolean, verbose?: boolean): Promise<void>;
162
+ makeIso(cmd: string, scriptOnly?: boolean): Promise<void>;
163
163
  /**
164
164
  * finished = show the results
165
165
  * @param scriptOnly