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.
Files changed (127) hide show
  1. package/README.md +61 -20
  2. package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
  3. package/addons/eggs/adapt/bin/adapt +0 -0
  4. package/addons/eggs/ichoice/bin/eggs-ichoice.sh +0 -0
  5. package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
  6. package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
  7. package/addons/eggs/theme/applications/install-debian.desktop +2 -2
  8. package/addons/neon/theme/applications/install-debian.desktop +0 -0
  9. package/addons/telos/theme/applications/install-debian.desktop +0 -0
  10. package/addons/ufficiozero/theme/applications/install-debian.desktop +0 -0
  11. package/addons/waydroid/theme/applications/install-debian.desktop +0 -0
  12. package/assets/calamares/install-debian +0 -0
  13. package/assets/penguins-eggs.desktop +0 -0
  14. package/assets/penguins-krill.desktop +0 -0
  15. package/assets/penguins-links-add.desktop +0 -0
  16. package/assets/penguins-live-installer.desktop +0 -0
  17. package/bin/dev +0 -0
  18. package/conf/distros/bionic/calamares/calamares-modules/after-bootloader/after-bootloader.sh +0 -0
  19. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader/before-bootloader.sh +0 -0
  20. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader-mkdirs/before-bootloader-mkdirs.sh +0 -0
  21. package/conf/distros/bionic/calamares/calamares-modules/bug/bug.sh +0 -0
  22. package/conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py +0 -0
  23. package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  24. package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  25. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  26. package/conf/distros/buster/calamares/modules/locale.yml +3 -3
  27. package/conf/distros/focal/calamares/calamares-modules/automirror/main.py +0 -0
  28. package/conf/eggs.yaml +2 -2
  29. package/conf/exclude.list +81 -96
  30. package/conf/tools.yaml +1 -1
  31. package/lib/classes/compressors.d.ts +7 -0
  32. package/lib/classes/compressors.js +38 -1
  33. package/lib/classes/daddy.js +6 -29
  34. package/lib/classes/distro.js +25 -12
  35. package/lib/classes/incubation/fisherman-helper/packages.js +6 -3
  36. package/lib/classes/keyboards.d.ts +10 -12
  37. package/lib/classes/keyboards.js +19 -23
  38. package/lib/classes/locales.js +15 -10
  39. package/lib/classes/ovary.js +53 -17
  40. package/lib/classes/utils.js +20 -6
  41. package/lib/commands/{install.d.ts → krill.d.ts} +1 -0
  42. package/lib/commands/{install.js → krill.js} +2 -2
  43. package/lib/commands/produce.js +8 -30
  44. package/lib/components/elements/information.js +0 -2
  45. package/lib/{classes/krill_prepare.d.ts → krill/krill-prepare.d.ts} +9 -2
  46. package/lib/{classes/krill_prepare.js → krill/krill-prepare.js} +62 -12
  47. package/lib/krill/krill-sequence.d.ts +148 -0
  48. package/lib/krill/krill-sequence.js +533 -0
  49. package/lib/krill/modules/add-user.d.ts +15 -0
  50. package/lib/krill/modules/add-user.js +41 -0
  51. package/lib/krill/modules/bootloader-config-arch.d.ts +9 -0
  52. package/lib/krill/modules/bootloader-config-arch.js +13 -0
  53. package/lib/krill/modules/bootloader-config-ubuntu.d.ts +9 -0
  54. package/lib/krill/modules/bootloader-config-ubuntu.js +93 -0
  55. package/lib/krill/modules/bootloader-config.d.ts +9 -0
  56. package/lib/krill/modules/bootloader-config.js +23 -0
  57. package/lib/krill/modules/bootloader.d.ts +10 -0
  58. package/lib/krill/modules/bootloader.js +43 -0
  59. package/lib/krill/modules/change-password.d.ts +10 -0
  60. package/lib/krill/modules/change-password.js +16 -0
  61. package/lib/krill/modules/del-live-user.d.ts +9 -0
  62. package/lib/krill/modules/del-live-user.js +37 -0
  63. package/lib/krill/modules/fstab.d.ts +9 -0
  64. package/lib/krill/modules/fstab.js +93 -0
  65. package/lib/krill/modules/grubcfg.d.ts +12 -0
  66. package/lib/krill/modules/grubcfg.js +33 -0
  67. package/lib/krill/modules/hostname.d.ts +8 -0
  68. package/lib/krill/modules/hostname.js +13 -0
  69. package/lib/krill/modules/hosts.d.ts +9 -0
  70. package/lib/krill/modules/hosts.js +30 -0
  71. package/lib/krill/modules/initramfs-cfg.d.ts +9 -0
  72. package/lib/krill/modules/initramfs-cfg.js +29 -0
  73. package/lib/krill/modules/initramfs.d.ts +8 -0
  74. package/lib/krill/modules/initramfs.js +42 -0
  75. package/lib/krill/modules/locale-cfg.d.ts +5 -0
  76. package/lib/krill/modules/locale-cfg.js +58 -0
  77. package/lib/krill/modules/locale.d.ts +8 -0
  78. package/lib/krill/modules/locale.js +47 -0
  79. package/lib/krill/modules/machine-id.d.ts +10 -0
  80. package/lib/krill/modules/machine-id.js +21 -0
  81. package/lib/krill/modules/mkfs.d.ts +8 -0
  82. package/lib/krill/modules/mkfs.js +33 -0
  83. package/lib/krill/modules/mount-fs.d.ts +12 -0
  84. package/lib/krill/modules/mount-fs.js +63 -0
  85. package/lib/krill/modules/mount-vfs.d.ts +12 -0
  86. package/lib/krill/modules/mount-vfs.js +40 -0
  87. package/lib/krill/modules/network-cfg.d.ts +14 -0
  88. package/lib/krill/modules/network-cfg.js +49 -0
  89. package/lib/krill/modules/partitions.d.ts +15 -0
  90. package/lib/krill/modules/partitions.js +307 -0
  91. package/lib/krill/modules/remove-installer-link.d.ts +8 -0
  92. package/lib/krill/modules/remove-installer-link.js +34 -0
  93. package/lib/krill/modules/set-keyboard.d.ts +5 -0
  94. package/lib/krill/modules/set-keyboard.js +50 -0
  95. package/lib/krill/modules/set-timezone.d.ts +9 -0
  96. package/lib/krill/modules/set-timezone.js +21 -0
  97. package/lib/krill/modules/umount.d.ts +9 -0
  98. package/lib/krill/modules/umount.js +26 -0
  99. package/lib/krill/modules/unpackfs.d.ts +8 -0
  100. package/lib/krill/modules/unpackfs.js +17 -0
  101. package/lib/lib/cli-autologin.js +3 -3
  102. package/lib/lib/select_keyboard_variant.js +1 -0
  103. package/lib/lib/utils.d.ts +27 -0
  104. package/lib/lib/utils.js +54 -19
  105. package/manpages/doc/man/eggs.html +122 -90
  106. package/mkinitcpio/README.md +8 -1
  107. package/mkinitcpio/archlinux/README.md +116 -0
  108. package/mkinitcpio/archlinux/mkinitcpio-install.conf +5 -0
  109. package/mkinitcpio/archlinux/mkinitcpio-produce.conf +13 -0
  110. package/mkinitcpio/manjaro/README.md +31 -11
  111. package/mkinitcpio/manjaro/mkinitcpio-install.conf +7 -0
  112. package/mkinitcpio/manjaro/{mkinitcpio.conf → mkinitcpio-produce.conf} +1 -1
  113. package/package.json +117 -112
  114. package/scripts/_eggs +8 -8
  115. package/scripts/bros/waydroid-helper.sh +0 -0
  116. package/scripts/eggs-adapt.sh +0 -0
  117. package/scripts/eggs.bash +1 -1
  118. package/scripts/install-eggs-ppa.sh +0 -0
  119. package/scripts/mom-cli.sh +8 -8
  120. package/scripts/pve-live.service +0 -0
  121. package/scripts/pve-live.sh +0 -0
  122. package/scripts/resy.sh +0 -0
  123. package/scripts/userexist.sh +0 -0
  124. package/lib/classes/i18n.d.ts +0 -34
  125. package/lib/classes/i18n.js +0 -126
  126. package/lib/classes/krill_install.d.ts +0 -227
  127. package/lib/classes/krill_install.js +0 -1370
@@ -0,0 +1,34 @@
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 fs_1 = tslib_1.__importDefault(require("fs"));
8
+ /**
9
+ * removeInstallerLink
10
+ */
11
+ async function removeInstallerLink() {
12
+ let file = `${this.installTarget}/usr/bin/penguins-links-add.sh`;
13
+ let lines = [];
14
+ let content = '';
15
+ if (fs_1.default.existsSync(file)) {
16
+ lines = fs_1.default.readFileSync(file, { encoding: 'utf8', flag: 'r' }).split('\n');
17
+ for (let i = 0; i < lines.length; i++) {
18
+ if (lines[i]) {
19
+ if (lines[i].search('penguins-krill.desktop') !== -1) {
20
+ lines[i] += '#';
21
+ }
22
+ if (lines[i].search('penguins-clinstaller.desktop') !== -1) {
23
+ lines[i] += '#';
24
+ }
25
+ if (lines[i].search('install-debian.desktop') !== -1) {
26
+ lines[i] += '#';
27
+ }
28
+ content += lines[i] + '\n';
29
+ }
30
+ }
31
+ }
32
+ fs_1.default.writeFileSync(file, content);
33
+ }
34
+ exports.default = removeInstallerLink;
@@ -0,0 +1,5 @@
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
+ export default function setKeyboard(this: Sequence): Promise<void>;
@@ -0,0 +1,50 @@
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
+ async function setKeyboard() {
10
+ /**
11
+ * influence: - /etc/default/keyboard (x11)
12
+ * - /etc/vconsole.conf (console)
13
+ * - /etc/X11/xorg.conf.d/00-keyboard.conf
14
+ *
15
+ * Problem: Actually don't update /etc/default/keyboard (x11)s
16
+ * /etc/vconsole.conf is update in installed syste,
17
+ */
18
+ // systemd as default
19
+ let cmd = `chroot ${this.installTarget} localectl set-keymap ${this.keyboardLayout}`;
20
+ if (!utils_1.default.isSystemd()) {
21
+ cmd = `chroot ${this.installTarget} setupcon ${this.toNull}`;
22
+ }
23
+ try {
24
+ await (0, utils_2.exec)(cmd, this.echo);
25
+ }
26
+ catch (error) {
27
+ console.log(error);
28
+ utils_1.default.pressKeyToExit(cmd, true);
29
+ }
30
+ /**
31
+ * this must to be not necessary but...
32
+ *
33
+ * force change /etc/default/keyboard (x11)
34
+ * force change /etc/vconsole.conf
35
+ */
36
+ let content = '# KEYBOARD CONFIGURATION FILE\n\n';
37
+ content += '# Consult the keyboard(5) manual page.\n\n';
38
+ content += 'XKBMODEL="' + this.keyboardModel + '"\n';
39
+ content += 'XKBLAYOUT="' + this.keyboardLayout + '"\n';
40
+ content += 'XKBVARIANT="' + this.keyboardVariant + '"\n';
41
+ content += 'XKBOPTIONS=""\n';
42
+ content += '\n';
43
+ content += 'BACKSPACE="guess"\n';
44
+ // Utils.write(this.installTarget + '/etc/default/keyboard', content)
45
+ content = 'KEYMAP=' + +this.keyboardModel + '"\n';
46
+ content += 'FONT=\n';
47
+ content += 'FONT_MAP=\n';
48
+ // Utils.write(this.installTarget + '/etc/vconsole.conf', content)
49
+ }
50
+ exports.default = setKeyboard;
@@ -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 setTimezone(this: Sequence): Promise<void>;
@@ -0,0 +1,21 @@
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 = require("../../lib/utils");
8
+ const fs_1 = tslib_1.__importDefault(require("fs"));
9
+ /**
10
+ *
11
+ * @param this
12
+ */
13
+ async function setTimezone() {
14
+ if (fs_1.default.existsSync('/etc/localtime')) {
15
+ const cmd = `chroot ${this.installTarget} unlink /etc/localtime`;
16
+ await (0, utils_1.exec)(cmd, this.echo);
17
+ }
18
+ const cmd = `chroot ${this.installTarget} ln -sf /usr/share/zoneinfo/${this.region}/${this.zone} /etc/localtime`;
19
+ await (0, utils_1.exec)(cmd, this.echo);
20
+ }
21
+ exports.default = setTimezone;
@@ -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 mountpoint
8
+ */
9
+ export default function umount(this: Sequence, mountPoint?: string): Promise<void>;
@@ -0,0 +1,26 @@
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 mountpoint
12
+ */
13
+ async function umount(mountPoint = '') {
14
+ let message = 'umount: ' + mountPoint;
15
+ if (utils_1.default.isMountpoint(mountPoint)) {
16
+ try {
17
+ await (0, utils_2.exec)(`umount ${mountPoint} ${this.toNull}`, this.echo);
18
+ await (0, utils_2.exec)('sleep 1', this.echo);
19
+ }
20
+ catch (error) {
21
+ message += +mountPoint + JSON.stringify(error);
22
+ await utils_1.default.pressKeyToExit(message);
23
+ }
24
+ }
25
+ }
26
+ exports.default = umount;
@@ -0,0 +1,8 @@
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
+ * unpackfs
7
+ */
8
+ export default function unpackfs(this: Sequence): Promise<void>;
@@ -0,0 +1,17 @@
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
+ * unpackfs
11
+ */
12
+ async function unpackfs() {
13
+ const cmd = `unsquashfs -d ${this.installTarget} -f ${this.distro.mountpointSquashFs}`;
14
+ const echoYes = utils_1.default.setEcho(true);
15
+ await (0, utils_2.exec)(cmd, echoYes);
16
+ }
17
+ exports.default = unpackfs;
@@ -110,13 +110,13 @@ exports.remove = remove;
110
110
  */
111
111
  async function addMotd(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
112
112
  const fileMotd = `${chroot}/etc/motd`;
113
- let installer = 'sudo eggs install';
113
+ let installer = 'sudo eggs krill';
114
114
  if (pacman_1.default.packageIsInstalled('calamares')) {
115
115
  if (pacman_1.default.packageIsInstalled('plasma-desktop')) {
116
- installer = 'startplasma-wayland to run GUI and launch calamares, or from terminal sudo eggs install -c';
116
+ installer = 'startplasma-wayland to run GUI and launch calamares, or from terminal sudo eggs krill -c';
117
117
  }
118
118
  else if (pacman_1.default.packageIsInstalled('xfce4')) {
119
- installer = 'startxfce4 to run GUI and launch calamares, or from terminal sudo eggs install -c';
119
+ installer = 'startxfce4 to run GUI and launch calamares, or from terminal sudo eggs krill -c';
120
120
  }
121
121
  }
122
122
  if (!fs_1.default.existsSync(fileMotd)) {
@@ -15,6 +15,7 @@ async function selectKeyboardVariant(keyboardLayout = '') {
15
15
  const keyboards = new keyboards_1.default();
16
16
  const variants = keyboards.getVariants(keyboardLayout);
17
17
  const supported = [];
18
+ supported.push(''); // inserisce una varian nulla
18
19
  for (const v of variants) {
19
20
  supported.push(v.code);
20
21
  }
@@ -7,10 +7,37 @@
7
7
  * Set `capture` to TRUE, to capture and return stdout.
8
8
  *
9
9
  * @returns {Promise<{code: number, data: string | undefined, error: Object}>}
10
+ *
11
+ * https://github.com/oclif/core/issues/453#issuecomment-1200778612
12
+ * codespool:
13
+ * You could wrap spawn in a promise, listen to exit event, and resolve when it happens. That should play nicely with oclif/core.
14
+ * We are using it here:
15
+ * https://github.com/AstarNetwork/swanky-cli/blob/master/src/commands/compile/index.ts
10
16
  */
11
17
  import { IExec } from '../interfaces';
18
+ /**
19
+ *
20
+ * @param command
21
+ * @param param1
22
+ * @returns
23
+ */
12
24
  export declare function exec(command: string, { echo, ignore, capture }?: {
13
25
  echo?: boolean | undefined;
14
26
  ignore?: boolean | undefined;
15
27
  capture?: boolean | undefined;
16
28
  }): Promise<IExec>;
29
+ /**
30
+ * Il problema è in questa funzione: core/cli-ux/indesx.ts
31
+ * qui riportata solo come esempio
32
+ *
33
+ function timeout(p: Promise<any>, ms: number) {
34
+ function wait(ms: number, unref = false) {
35
+ return new Promise(resolve => {
36
+ const t: any = setTimeout(() => resolve(null), ms)
37
+ if (unref) t.unref()
38
+ })
39
+ }
40
+
41
+ return Promise.race([p, wait(ms, true).then(() => ux.error('timed out'))])
42
+ }
43
+ */
package/lib/lib/utils.js CHANGED
@@ -8,37 +8,72 @@
8
8
  * Set `capture` to TRUE, to capture and return stdout.
9
9
  *
10
10
  * @returns {Promise<{code: number, data: string | undefined, error: Object}>}
11
+ *
12
+ * https://github.com/oclif/core/issues/453#issuecomment-1200778612
13
+ * codespool:
14
+ * You could wrap spawn in a promise, listen to exit event, and resolve when it happens. That should play nicely with oclif/core.
15
+ * We are using it here:
16
+ * https://github.com/AstarNetwork/swanky-cli/blob/master/src/commands/compile/index.ts
11
17
  */
12
18
  Object.defineProperty(exports, "__esModule", { value: true });
13
19
  exports.exec = void 0;
14
- function exec(command, { echo = false, ignore = false, capture = false } = {}) {
15
- if (echo) {
16
- console.log(command);
17
- }
18
- const spawn = require('child_process').spawn;
19
- // const childProcess = spawn('bash', ['-c', command], { stdio: capture ? 'pipe' : 'inherit' });
20
- // const childProcess = spawn('bash', ['-c', command], { stdio: capture ? 'pipe' : ignore ? 'ignore' : 'inherit' });
21
- const childProcess = spawn('bash', ['-c', command], {
22
- stdio: ignore ? 'ignore' : capture ? 'pipe' : 'inherit'
23
- });
20
+ const child_process_1 = require("child_process");
21
+ /**
22
+ *
23
+ * @param command
24
+ * @param param1
25
+ * @returns
26
+ */
27
+ async function exec(command, { echo = false, ignore = false, capture = false } = {}) {
28
+ /**
29
+ * You could wrap spawn in a promise,
30
+ * listen to exit event,
31
+ * and resolve when it happens.
32
+ *
33
+ * That should play nicely with oclif/core.
34
+ */
24
35
  return new Promise((resolve, reject) => {
36
+ var _a;
37
+ if (echo) {
38
+ console.log(command);
39
+ }
40
+ const child = (0, child_process_1.spawn)('bash', ['-c', command], {
41
+ stdio: ignore ? 'ignore' : capture ? 'pipe' : 'inherit'
42
+ });
43
+ // const spawn = require('child_process').spawn
44
+ // child.stdout.on('data', (data: string) => {
25
45
  let stdout = '';
26
46
  if (capture) {
27
- childProcess.stdout.on('data', (data) => {
47
+ (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
28
48
  stdout += data;
29
49
  });
30
50
  }
31
- childProcess.on('error', function (error) {
51
+ // 'error' event
52
+ child.on('error', function (error) {
32
53
  reject({ code: 1, error: error });
33
54
  });
34
- childProcess.on('close', function (code) {
35
- if (code > 0) {
36
- reject({ code: code, error: 'Command failed with code ' + code });
37
- }
38
- else {
39
- resolve({ code: code, data: stdout });
40
- }
55
+ // The 'exit' event is emitted after the child process ends. If the process exited, code is the final exit code of the process,
56
+ // otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null.
57
+ // One of the two will always be non-null.
58
+ child.on('exit', (code) => {
59
+ resolve({ code: code, data: stdout });
41
60
  });
61
+ // end promise
42
62
  });
43
63
  }
44
64
  exports.exec = exec;
65
+ /**
66
+ * Il problema è in questa funzione: core/cli-ux/indesx.ts
67
+ * qui riportata solo come esempio
68
+ *
69
+ function timeout(p: Promise<any>, ms: number) {
70
+ function wait(ms: number, unref = false) {
71
+ return new Promise(resolve => {
72
+ const t: any = setTimeout(() => resolve(null), ms)
73
+ if (unref) t.unref()
74
+ })
75
+ }
76
+
77
+ return Promise.race([p, wait(ms, true).then(() => ux.error('timed out'))])
78
+ }
79
+ */