penguins-eggs 10.0.3 → 10.0.8

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 (159) hide show
  1. package/.oclif.manifest.json +25 -28
  2. package/README.md +101 -1159
  3. package/assets/calamares/install-system.sh +9 -5
  4. package/conf/derivatives.yaml +2 -1
  5. package/dist/classes/bleach.d.ts +6 -6
  6. package/dist/classes/bleach.js +6 -6
  7. package/dist/classes/cfs.d.ts +6 -6
  8. package/dist/classes/cfs.js +6 -6
  9. package/dist/classes/compressors.d.ts +8 -7
  10. package/dist/classes/compressors.js +19 -9
  11. package/dist/classes/daddy.d.ts +6 -6
  12. package/dist/classes/daddy.js +13 -13
  13. package/dist/classes/distro.d.ts +12 -2
  14. package/dist/classes/distro.js +41 -46
  15. package/dist/classes/families/archlinux.d.ts +6 -6
  16. package/dist/classes/families/archlinux.js +7 -11
  17. package/dist/classes/families/debian.d.ts +6 -6
  18. package/dist/classes/families/debian.js +6 -6
  19. package/dist/classes/families/mockup.js +2 -4
  20. package/dist/classes/families/suse.d.ts +2 -2
  21. package/dist/classes/families/suse.js +2 -2
  22. package/dist/classes/incubation/branding.js +24 -25
  23. package/dist/classes/incubation/distros/focal.js +1 -1
  24. package/dist/classes/incubation/distros/rolling.d.ts +4 -4
  25. package/dist/classes/incubation/distros/rolling.js +4 -4
  26. package/dist/classes/incubation/fisherman-helper/packages.js +2 -6
  27. package/dist/classes/incubation/incubator.js +6 -7
  28. package/dist/classes/incubation/installer.js +1 -2
  29. package/dist/classes/initrd.d.ts +6 -6
  30. package/dist/classes/initrd.js +6 -6
  31. package/dist/classes/keyboards.d.ts +6 -6
  32. package/dist/classes/keyboards.js +6 -6
  33. package/dist/classes/locales.d.ts +12 -12
  34. package/dist/classes/locales.js +14 -14
  35. package/dist/classes/n8.d.ts +9 -7
  36. package/dist/classes/n8.js +8 -12
  37. package/dist/classes/network.d.ts +6 -6
  38. package/dist/classes/network.js +9 -11
  39. package/dist/classes/ovary.d.ts +44 -49
  40. package/dist/classes/ovary.js +231 -259
  41. package/dist/classes/pacman.d.ts +6 -6
  42. package/dist/classes/pacman.js +8 -10
  43. package/dist/classes/pve-live.d.ts +6 -6
  44. package/dist/classes/pve-live.js +6 -6
  45. package/dist/classes/pxe.d.ts +34 -25
  46. package/dist/classes/pxe.js +205 -190
  47. package/dist/classes/settings.d.ts +7 -7
  48. package/dist/classes/settings.js +10 -10
  49. package/dist/classes/sources_list.d.ts +16 -16
  50. package/dist/classes/sources_list.js +20 -20
  51. package/dist/classes/systemctl.js +2 -2
  52. package/dist/classes/tailor.d.ts +22 -22
  53. package/dist/classes/tailor.js +88 -88
  54. package/dist/classes/tools.d.ts +6 -6
  55. package/dist/classes/tools.js +6 -6
  56. package/dist/classes/users.d.ts +9 -9
  57. package/dist/classes/users.js +33 -35
  58. package/dist/classes/xdg.d.ts +6 -6
  59. package/dist/classes/xdg.js +10 -9
  60. package/dist/classes/yolk.d.ts +8 -8
  61. package/dist/classes/yolk.js +9 -15
  62. package/dist/commands/adapt.js +2 -4
  63. package/dist/commands/analyze.js +1 -1
  64. package/dist/commands/calamares.js +9 -14
  65. package/dist/commands/config.d.ts +2 -3
  66. package/dist/commands/config.js +11 -23
  67. package/dist/commands/cuckoo.d.ts +1 -1
  68. package/dist/commands/cuckoo.js +11 -10
  69. package/dist/commands/dad.js +2 -6
  70. package/dist/commands/export/deb.js +2 -6
  71. package/dist/commands/export/iso.js +2 -5
  72. package/dist/commands/install.d.ts +1 -1
  73. package/dist/commands/install.js +5 -9
  74. package/dist/commands/kill.js +3 -5
  75. package/dist/commands/mom.js +2 -4
  76. package/dist/commands/produce.d.ts +2 -1
  77. package/dist/commands/produce.js +16 -18
  78. package/dist/commands/status.js +2 -4
  79. package/dist/commands/syncfrom.d.ts +2 -2
  80. package/dist/commands/syncfrom.js +6 -9
  81. package/dist/commands/syncto.js +8 -12
  82. package/dist/commands/tools/clean.js +3 -5
  83. package/dist/commands/tools/ppa.js +14 -17
  84. package/dist/commands/tools/skel.js +2 -5
  85. package/dist/commands/tools/stat.js +3 -7
  86. package/dist/commands/tools/yolk.js +2 -4
  87. package/dist/commands/update.js +4 -6
  88. package/dist/commands/wardrobe/get.js +4 -7
  89. package/dist/commands/wardrobe/list.js +11 -15
  90. package/dist/commands/wardrobe/show.js +11 -15
  91. package/dist/commands/wardrobe/wear.js +3 -7
  92. package/dist/interfaces/i-packages.d.ts +1 -1
  93. package/dist/interfaces/i-pxe.d.ts +35 -11
  94. package/dist/interfaces/i-pxe.js +0 -7
  95. package/dist/interfaces/i-settings.d.ts +15 -21
  96. package/dist/krill/modules/change-password.d.ts +4 -4
  97. package/dist/krill/modules/change-password.js +4 -4
  98. package/dist/krill/modules/del-live-user.d.ts +3 -3
  99. package/dist/krill/modules/del-live-user.js +3 -3
  100. package/dist/krill/modules/fstab.d.ts +3 -3
  101. package/dist/krill/modules/fstab.js +5 -5
  102. package/dist/krill/modules/grubcfg.d.ts +6 -6
  103. package/dist/krill/modules/grubcfg.js +6 -6
  104. package/dist/krill/modules/hostname.js +4 -4
  105. package/dist/krill/modules/initramfs.d.ts +2 -2
  106. package/dist/krill/modules/initramfs.js +2 -2
  107. package/dist/krill/modules/locale-cfg.js +8 -7
  108. package/dist/krill/modules/locale.d.ts +2 -2
  109. package/dist/krill/modules/locale.js +6 -6
  110. package/dist/krill/modules/m-keyboard.js +14 -14
  111. package/dist/krill/modules/mkfs.d.ts +2 -2
  112. package/dist/krill/modules/mkfs.js +2 -2
  113. package/dist/krill/modules/mount-fs.d.ts +2 -2
  114. package/dist/krill/modules/mount-fs.js +2 -2
  115. package/dist/krill/modules/mount-vfs.d.ts +4 -4
  116. package/dist/krill/modules/mount-vfs.js +4 -4
  117. package/dist/krill/modules/packages.js +25 -33
  118. package/dist/krill/modules/partition.js +38 -38
  119. package/dist/krill/modules/remove-installer-link.d.ts +2 -2
  120. package/dist/krill/modules/remove-installer-link.js +2 -2
  121. package/dist/krill/modules/umount.d.ts +3 -3
  122. package/dist/krill/modules/umount.js +4 -4
  123. package/dist/krill/modules/unpackfs.d.ts +2 -2
  124. package/dist/krill/modules/unpackfs.js +2 -2
  125. package/dist/krill/sequence.js +2 -1
  126. package/dist/lib/cli-autologin.js +3 -3
  127. package/dist/lib/get_address.js +2 -3
  128. package/dist/lib/get_dns.js +2 -3
  129. package/dist/lib/get_domain.js +2 -3
  130. package/dist/lib/get_gateway.js +2 -3
  131. package/dist/lib/get_hostname.js +2 -3
  132. package/dist/lib/get_netmask.js +2 -3
  133. package/dist/lib/get_password.js +3 -4
  134. package/dist/lib/get_userfullname.js +2 -3
  135. package/dist/lib/get_username.js +2 -2
  136. package/dist/lib/kill_me_softly.js +3 -18
  137. package/dist/lib/select_address_type.js +2 -2
  138. package/dist/lib/select_filesystem_type.js +9 -3
  139. package/dist/lib/select_installation_device.js +2 -2
  140. package/dist/lib/select_installation_mode.js +2 -3
  141. package/dist/lib/select_interface.js +2 -2
  142. package/dist/lib/select_keyboard_layout.d.ts +2 -2
  143. package/dist/lib/select_keyboard_layout.js +4 -4
  144. package/dist/lib/select_keyboard_model.d.ts +2 -2
  145. package/dist/lib/select_keyboard_model.js +4 -4
  146. package/dist/lib/select_keyboard_option.d.ts +2 -2
  147. package/dist/lib/select_keyboard_option.js +4 -4
  148. package/dist/lib/select_keyboard_variant.d.ts +2 -2
  149. package/dist/lib/select_keyboard_variant.js +4 -4
  150. package/dist/lib/select_languages.js +2 -2
  151. package/dist/lib/select_regions.js +2 -3
  152. package/dist/lib/select_user_swap_choice.js +2 -3
  153. package/dist/lib/select_zones.js +8 -10
  154. package/dist/lib/utils.js +1 -1
  155. package/manpages/doc/man/eggs.1.gz +0 -0
  156. package/manpages/doc/man/eggs.html +17 -23
  157. package/package.json +24 -22
  158. package/scripts/_eggs +354 -314
  159. package/scripts/eggs.bash +8 -8
@@ -1,21 +1,45 @@
1
- /**
2
- * ./src/interfaces/i-pxe.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
1
  export interface ITftpOptions {
9
- denyPUT: boolean;
10
2
  host: string;
11
3
  port: number;
12
4
  root: string;
5
+ denyPUT: boolean;
13
6
  }
14
7
  export interface IDhcpOptions {
8
+ subnet: string;
9
+ host: string;
10
+ tftpserver: string;
15
11
  bios_filename: string;
16
12
  efi32_filename: string;
17
13
  efi64_filename: string;
18
- host: string;
19
- subnet: string;
20
- tftpserver: string;
14
+ }
15
+ export interface IDhcpd {
16
+ constructor(opts: IDhcpOptions): void;
17
+ pre_init: (pkt: IPacket) => void;
18
+ discover: (pkt: IPacket) => void;
19
+ request: (pkt: IPacket) => void;
20
+ inform: (pkt: IPacket) => void;
21
+ proxy_request: (pkt: IPacket) => IPacket;
22
+ }
23
+ export interface IProxy {
24
+ bind: (port: number, addr: string, cb: any) => IPacket;
25
+ }
26
+ export interface IServer {
27
+ bind: (port: number, addr: string, cb: any) => IPacket;
28
+ }
29
+ export interface IPacket {
30
+ getRequestedIPAddress: () => string;
31
+ op: (op: any) => IPacket;
32
+ htype: (htype: any) => IPacket;
33
+ hlen: (hlen: any) => IPacket;
34
+ hops: (hops: any) => IPacket;
35
+ xid: (xid: any) => IPacket;
36
+ secs: (secs: any) => IPacket;
37
+ flags: (flags: any) => IPacket;
38
+ ciaddr: (ciaddr: string) => IPacket;
39
+ siaddr: (siaddr: string) => IPacket;
40
+ giaddr: (giaddr: string) => IPacket;
41
+ chaddr: (chaddr: any) => IPacket;
42
+ sname: (sname: any) => IPacket;
43
+ fname: (fname: any) => IPacket;
44
+ options: (options: any) => IPacket;
21
45
  }
@@ -1,8 +1 @@
1
- /**
2
- * ./src/interfaces/i-pxe.ts
3
- * penguins-eggs v.10.0.0 / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
7
- */
8
1
  export {};
@@ -14,26 +14,20 @@ interface Iinstance {
14
14
  *
15
15
  */
16
16
  export interface ISettings {
17
- "branding": string;
18
- "disable-cancel": boolean;
19
- "disable-cancel-during-exec": boolean;
20
- "dont-chroot": boolean;
21
- "instances": [
22
- instance: Iinstance
23
- ];
24
- "modules-search": string[];
25
- "oem-setup": boolean;
26
- "prompt-install": boolean;
27
- "sequence": [
28
- {
29
- show: string[];
30
- },
31
- {
32
- exec: string[];
33
- },
34
- {
35
- show: string[];
36
- }
37
- ];
17
+ branding: string;
18
+ 'disable-cancel': boolean;
19
+ 'disable-cancel-during-exec': boolean;
20
+ 'dont-chroot': boolean;
21
+ instances: [instance: Iinstance];
22
+ 'modules-search': string[];
23
+ 'oem-setup': boolean;
24
+ 'prompt-install': boolean;
25
+ sequence: [{
26
+ show: string[];
27
+ }, {
28
+ exec: string[];
29
+ }, {
30
+ show: string[];
31
+ }];
38
32
  }
39
33
  export {};
@@ -8,8 +8,8 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * changePassword
12
- * @param name
13
- * @param newPassword
14
- */
11
+ * changePassword
12
+ * @param name
13
+ * @param newPassword
14
+ */
15
15
  export default function changePassword(this: Sequence, name?: string, newPassword?: string): Promise<void>;
@@ -8,10 +8,10 @@
8
8
  */
9
9
  import { exec } from '../../lib/utils.js';
10
10
  /**
11
- * changePassword
12
- * @param name
13
- * @param newPassword
14
- */
11
+ * changePassword
12
+ * @param name
13
+ * @param newPassword
14
+ */
15
15
  export default async function changePassword(name = 'live', newPassword = 'evolution') {
16
16
  const cmd = `echo ${name}:${newPassword} | chroot ${this.installTarget} chpasswd ${this.toNull}`;
17
17
  await exec(cmd, this.echo);
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * delUser
12
- * va corretto con users.conf di calamares
13
- */
11
+ * delUser
12
+ * va corretto con users.conf di calamares
13
+ */
14
14
  export default function delLiveUser(this: Sequence): Promise<void>;
@@ -9,9 +9,9 @@
9
9
  import Utils from '../../classes/utils.js';
10
10
  import { exec } from '../../lib/utils.js';
11
11
  /**
12
- * delUser
13
- * va corretto con users.conf di calamares
14
- */
12
+ * delUser
13
+ * va corretto con users.conf di calamares
14
+ */
15
15
  export default async function delLiveUser() {
16
16
  if (Utils.isLive()) {
17
17
  const user = this.settings.config.user_opt;
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * fstab()
12
- * @param devices
13
- */
11
+ * fstab()
12
+ * @param devices
13
+ */
14
14
  export default function fstab(this: Sequence, installDevice: string, crypted?: boolean): Promise<void>;
@@ -10,14 +10,14 @@ import shx from 'shelljs';
10
10
  import Pacman from '../../classes/pacman.js';
11
11
  import Utils from '../../classes/utils.js';
12
12
  /**
13
- * fstab()
14
- * @param devices
15
- */
13
+ * fstab()
14
+ * @param devices
15
+ */
16
16
  export default async function fstab(installDevice, crypted = false) {
17
17
  let text = '';
18
18
  /**
19
- * crypttab
20
- */
19
+ * crypttab
20
+ */
21
21
  if (this.partitions.installationMode === 'full-encrypted') {
22
22
  const crypttab = this.installTarget + '/etc/crypttab';
23
23
  text += '# /etc/crypttab: mappings for encrypted partitions.\n';
@@ -8,10 +8,10 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * grubcfg
12
- * - open /etc/default/grub
13
- * - find GRUB_CMDLINE_LINUX_DEFAULT=
14
- * - replace with GRUB_CMDLINE_LINUX_DEFAULT=
15
- * 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
16
- */
11
+ * grubcfg
12
+ * - open /etc/default/grub
13
+ * - find GRUB_CMDLINE_LINUX_DEFAULT=
14
+ * - replace with GRUB_CMDLINE_LINUX_DEFAULT=
15
+ * 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
16
+ */
17
17
  export default function grubcfg(this: Sequence): Promise<void>;
@@ -9,12 +9,12 @@
9
9
  import fs from 'node:fs';
10
10
  import Utils from '../../classes/utils.js';
11
11
  /**
12
- * grubcfg
13
- * - open /etc/default/grub
14
- * - find GRUB_CMDLINE_LINUX_DEFAULT=
15
- * - replace with GRUB_CMDLINE_LINUX_DEFAULT=
16
- * 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
17
- */
12
+ * grubcfg
13
+ * - open /etc/default/grub
14
+ * - find GRUB_CMDLINE_LINUX_DEFAULT=
15
+ * - replace with GRUB_CMDLINE_LINUX_DEFAULT=
16
+ * 's/GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT=/g'
17
+ */
18
18
  export default async function grubcfg() {
19
19
  const file = `${this.installTarget}/etc/default/grub`;
20
20
  let content = '';
@@ -13,16 +13,16 @@ import fs from 'node:fs';
13
13
  export default async function hostname(domain = '') {
14
14
  const { hostname } = this.users;
15
15
  /**
16
- * hostname
17
- */
16
+ * hostname
17
+ */
18
18
  {
19
19
  const file = this.installTarget + '/etc/hostname';
20
20
  const text = hostname;
21
21
  fs.writeFileSync(file, text);
22
22
  }
23
23
  /**
24
- * hosts
25
- */
24
+ * hosts
25
+ */
26
26
  {
27
27
  const file = this.installTarget + '/etc/hosts';
28
28
  if (domain === '(none)') {
@@ -8,6 +8,6 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * initramfs()
12
- */
11
+ * initramfs()
12
+ */
13
13
  export default function initramfs(this: Sequence): Promise<void>;
@@ -12,8 +12,8 @@ import { exec } from '../../lib/utils.js';
12
12
  // _dirname
13
13
  const __dirname = path.dirname(new URL(import.meta.url).pathname);
14
14
  /**
15
- * initramfs()
16
- */
15
+ * initramfs()
16
+ */
17
17
  export default async function initramfs() {
18
18
  if (this.distro.familyId === 'debian') {
19
19
  let cmd = `chroot ${this.installTarget} mkinitramfs -o ~/initrd.img-$(uname -r) ${this.toNull}`;
@@ -8,14 +8,14 @@
8
8
  */
9
9
  import fs from 'node:fs';
10
10
  /* localeCfg
11
- * Enable the configured locales (those set by the user on the
12
- * user page) in /etc/locale.gen, if they are available in the
13
- * target system.
14
- */
11
+ * Enable the configured locales (those set by the user on the
12
+ * user page) in /etc/locale.gen, if they are available in the
13
+ * target system.
14
+ */
15
15
  export default async function localeCfg() {
16
16
  /**
17
- * influence: - locale-gen
18
- */
17
+ * influence: - locale-gen
18
+ */
19
19
  let supporteds = [];
20
20
  if (this.distro.familyId === 'debian') {
21
21
  // Format: en_US.UTF-8 UTF-8
@@ -26,7 +26,8 @@ export default async function localeCfg() {
26
26
  const supportedsSource = fs.readFileSync('/etc/locale.gen', 'utf8').split('\n');
27
27
  // Original Format: #en_US.UTF-8 UTF-8
28
28
  for (let line of supportedsSource) {
29
- if (line.slice(0, 2) !== '# ') { // se non è un commento
29
+ if (line.slice(0, 2) !== '# ') {
30
+ // se non è un commento
30
31
  line = line.slice(1); // Rimuove #
31
32
  }
32
33
  supporteds.push(line);
@@ -8,6 +8,6 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * locale
12
- */
11
+ * locale
12
+ */
13
13
  export default function locale(this: Sequence): Promise<void>;
@@ -8,14 +8,14 @@
8
8
  */
9
9
  import Utils from '../../classes/utils.js';
10
10
  /**
11
- * locale
12
- */
11
+ * locale
12
+ */
13
13
  export default async function locale() {
14
14
  /**
15
- * influcence: - /etc/default/locale
16
- * - /etc/locale.conf
17
- * - /etc/timezone
18
- */
15
+ * influcence: - /etc/default/locale
16
+ * - /etc/locale.conf
17
+ * - /etc/timezone
18
+ */
19
19
  const defaultLocale = this.language;
20
20
  // /etc/default/locale
21
21
  let file = this.installTarget + '/etc/default/locale';
@@ -15,13 +15,13 @@ import { exec } from '../../lib/utils.js';
15
15
  */
16
16
  export default async function mKeyboard() {
17
17
  /**
18
- * influence: - /etc/default/keyboard (x11)
19
- * - /etc/vconsole.conf (console)
20
- * - /etc/X11/xorg.conf.d/00-keyboard.conf
21
- *
22
- * Problem: Actually don't update /etc/default/keyboard (x11)
23
- * /etc/vconsole.conf is update in installed systems
24
- */
18
+ * influence: - /etc/default/keyboard (x11)
19
+ * - /etc/vconsole.conf (console)
20
+ * - /etc/X11/xorg.conf.d/00-keyboard.conf
21
+ *
22
+ * Problem: Actually don't update /etc/default/keyboard (x11)
23
+ * /etc/vconsole.conf is update in installed systems
24
+ */
25
25
  // systemd as default
26
26
  let cmd = `chroot ${this.installTarget} localectl set-keymap ${this.keyboardLayout}`;
27
27
  if (!Utils.isSystemd()) {
@@ -35,12 +35,12 @@ export default async function mKeyboard() {
35
35
  Utils.pressKeyToExit(cmd, true);
36
36
  }
37
37
  /**
38
- * this must to be not necessary but...
39
- *
40
- * force change /etc/default/keyboard (x11)
41
- * force change /etc/vconsole.conf
42
- * force change /etc/X11/xorg.conf.d/00-keyboard.conf
43
- */
38
+ * this must to be not necessary but...
39
+ *
40
+ * force change /etc/default/keyboard (x11)
41
+ * force change /etc/vconsole.conf
42
+ * force change /etc/X11/xorg.conf.d/00-keyboard.conf
43
+ */
44
44
  let content = '# KEYBOARD CONFIGURATION FILE\n\n';
45
45
  content += '# Consult the keyboard(5) manual page.\n\n';
46
46
  content += '# See penguins-eggs/src/krill/modules/m-keyboard.ts\n\n';
@@ -65,7 +65,7 @@ export default async function mKeyboard() {
65
65
  * 00-keyboard.conf: dovrebbe dipendere da X
66
66
  */
67
67
  content = '# See penguins-eggs/src/krill/modules/set-keyboard.ts\n\n';
68
- content += '# Read and parsed by systemd-localed. It\'s probably wise not to edit this file\n';
68
+ content += "# Read and parsed by systemd-localed. It's probably wise not to edit this file\n";
69
69
  content += '# manually too freely.\n';
70
70
  content += 'Section "InputClass"\n';
71
71
  content += ' Identifier "system-keyboard"\n';
@@ -8,6 +8,6 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * mkfs
12
- */
11
+ * mkfs
12
+ */
13
13
  export default function mkfs(this: Sequence): Promise<boolean>;
@@ -8,8 +8,8 @@
8
8
  */
9
9
  import { exec } from '../../lib/utils.js';
10
10
  /**
11
- * mkfs
12
- */
11
+ * mkfs
12
+ */
13
13
  export default async function mkfs() {
14
14
  const result = true;
15
15
  if (this.partitions.filesystemType === 'ext4') {
@@ -8,8 +8,8 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * mountFs
12
- */
11
+ * mountFs
12
+ */
13
13
  export declare function mountFs(this: Sequence): Promise<boolean>;
14
14
  /**
15
15
  * umountFs
@@ -9,8 +9,8 @@
9
9
  import fs from 'node:fs';
10
10
  import { exec } from '../../lib/utils.js';
11
11
  /**
12
- * mountFs
13
- */
12
+ * mountFs
13
+ */
14
14
  export async function mountFs() {
15
15
  if (!fs.existsSync(this.installTarget)) {
16
16
  await exec(`mkdir ${this.installTarget} ${this.toNull}`, this.echo);
@@ -8,10 +8,10 @@
8
8
  */
9
9
  import Sequence from '../sequence.js';
10
10
  /**
11
- * mountvfs()
12
- */
11
+ * mountvfs()
12
+ */
13
13
  export declare function mountVfs(this: Sequence): Promise<void>;
14
14
  /**
15
- *
16
- */
15
+ *
16
+ */
17
17
  export declare function umountVfs(this: Sequence): Promise<void>;
@@ -8,8 +8,8 @@
8
8
  */
9
9
  import { exec } from '../../lib/utils.js';
10
10
  /**
11
- * mountvfs()
12
- */
11
+ * mountvfs()
12
+ */
13
13
  export async function mountVfs() {
14
14
  await exec(`mkdir ${this.installTarget}/dev ${this.toNull}`, this.echo);
15
15
  await exec(`mkdir ${this.installTarget}/dev/pts ${this.toNull}`, this.echo);
@@ -26,8 +26,8 @@ export async function mountVfs() {
26
26
  await exec(`mount -o rbind /run ${this.installTarget}/run ${this.toNull}`, this.echo);
27
27
  }
28
28
  /**
29
- *
30
- */
29
+ *
30
+ */
31
31
  export async function umountVfs() {
32
32
  await this.umount(`${this.installTarget}/dev/pts`);
33
33
  await this.umount(`${this.installTarget}/dev`);
@@ -23,10 +23,10 @@ export default async function packages() {
23
23
  }
24
24
  const config_file = `${modulePath}modules/packages.conf`;
25
25
  if (fs.existsSync(config_file)) {
26
- let packages = yaml.load(fs.readFileSync(config_file, 'utf8'));
26
+ const packages = yaml.load(fs.readFileSync(config_file, 'utf8'));
27
27
  let packagesToInstall = [];
28
28
  let packagesToRemove = [];
29
- for (let operation of packages.operations) {
29
+ for (const operation of packages.operations) {
30
30
  if ('try_remove' in operation) {
31
31
  packagesToRemove = operation.try_remove;
32
32
  }
@@ -36,47 +36,39 @@ export default async function packages() {
36
36
  }
37
37
  if (packages.backend === 'apt') {
38
38
  // Debian/Devuan/Ubuntu
39
- if (packagesToRemove != undefined) {
40
- if (packagesToRemove.length > 0) {
41
- let cmd = `chroot ${this.installTarget} apt-get purge -y `;
42
- for (const elem of packagesToRemove) {
43
- if (Pacman.packageIsInstalled(elem)) {
44
- cmd += elem + ' ';
45
- }
39
+ if (packagesToRemove != undefined && packagesToRemove.length > 0) {
40
+ let cmd = `chroot ${this.installTarget} apt-get purge -y `;
41
+ for (const elem of packagesToRemove) {
42
+ if (Pacman.packageIsInstalled(elem)) {
43
+ cmd += elem + ' ';
46
44
  }
47
- await exec(`${cmd} ${this.toNull}`, this.echo);
48
- let autoremove = `chroot ${this.installTarget} apt-get autoremove -y ${this.toNull}`;
49
- await exec(autoremove, this.echo);
50
45
  }
46
+ await exec(`${cmd} ${this.toNull}`, this.echo);
47
+ const autoremove = `chroot ${this.installTarget} apt-get autoremove -y ${this.toNull}`;
48
+ await exec(autoremove, this.echo);
51
49
  }
52
- if (packagesToInstall != undefined) {
53
- if (packagesToInstall.length > 0) {
54
- let cmd = `chroot ${this.installTarget} apt-get install -y `;
55
- for (const elem of packagesToInstall) {
56
- cmd += elem + ' ';
57
- }
58
- let update = `chroot ${this.installTarget} apt-get update ${this.toNull}`;
59
- await exec(update, this.echo);
60
- await exec(`${cmd} ${this.toNull}`, this.echo);
50
+ if (packagesToInstall != undefined && packagesToInstall.length > 0) {
51
+ let cmd = `chroot ${this.installTarget} apt-get install -y `;
52
+ for (const elem of packagesToInstall) {
53
+ cmd += elem + ' ';
61
54
  }
55
+ const update = `chroot ${this.installTarget} apt-get update ${this.toNull}`;
56
+ await exec(update, this.echo);
57
+ await exec(`${cmd} ${this.toNull}`, this.echo);
62
58
  }
63
59
  }
64
60
  else if (packages.backend === 'pacman') {
65
61
  // arch/manjaro
66
- if (packagesToRemove != undefined) {
67
- if (packagesToRemove.length > 0) {
68
- let cmd = `chroot ${this.installTarget} pacman -R\n`;
69
- for (const elem of packagesToRemove) {
70
- cmd += elem + ' ';
71
- }
72
- await exec(`${cmd} ${echoYes}`, this.echo);
62
+ if (packagesToRemove != undefined && packagesToRemove.length > 0) {
63
+ let cmd = `chroot ${this.installTarget} pacman -R\n`;
64
+ for (const elem of packagesToRemove) {
65
+ cmd += elem + ' ';
73
66
  }
67
+ await exec(`${cmd} ${echoYes}`, this.echo);
74
68
  }
75
- if (packagesToInstall != undefined) {
76
- if (packagesToInstall.length > 0) {
77
- for (const elem of packagesToInstall) {
78
- await exec(`chroot ${this.installTarget} pacman -S ${elem}`, echoYes);
79
- }
69
+ if (packagesToInstall != undefined && packagesToInstall.length > 0) {
70
+ for (const elem of packagesToInstall) {
71
+ await exec(`chroot ${this.installTarget} pacman -S ${elem}`, echoYes);
80
72
  }
81
73
  }
82
74
  }