penguins-eggs 10.0.24 → 10.0.26

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 (56) hide show
  1. package/.oclif.manifest.json +8 -8
  2. package/README.md +27 -27
  3. package/conf/distros/noble/calamares/modules/users.yml +1 -0
  4. package/conf/distros/rolling/calamares/modules/finished.yml +1 -1
  5. package/dist/classes/bleach.js +22 -15
  6. package/dist/{lib → classes}/cli-autologin.d.ts +15 -6
  7. package/dist/{lib → classes}/cli-autologin.js +82 -36
  8. package/dist/classes/compressors.d.ts +1 -1
  9. package/dist/classes/compressors.js +10 -10
  10. package/dist/classes/daddy.d.ts +6 -6
  11. package/dist/classes/daddy.js +67 -67
  12. package/dist/classes/distro.js +206 -202
  13. package/dist/classes/families/alpine.js +2 -2
  14. package/dist/classes/incubation/incubator.js +1 -1
  15. package/dist/classes/keyboards.d.ts +1 -1
  16. package/dist/classes/keyboards.js +16 -1
  17. package/dist/classes/locales.js +20 -9
  18. package/dist/classes/ovary.d.ts +11 -11
  19. package/dist/classes/ovary.js +109 -93
  20. package/dist/classes/pacman.js +3 -5
  21. package/dist/classes/pxe.d.ts +6 -6
  22. package/dist/classes/pxe.js +42 -42
  23. package/dist/classes/utils.d.ts +5 -1
  24. package/dist/classes/utils.js +20 -17
  25. package/dist/classes/xdg.js +15 -14
  26. package/dist/classes/yolk.js +1 -1
  27. package/dist/commands/cuckoo.js +1 -1
  28. package/dist/commands/dad.d.ts +1 -1
  29. package/dist/commands/dad.js +5 -7
  30. package/dist/commands/produce.js +1 -1
  31. package/dist/commands/syncfrom.d.ts +1 -1
  32. package/dist/commands/syncfrom.js +1 -1
  33. package/dist/components/information.js +5 -10
  34. package/dist/components/summary.js +2 -1
  35. package/dist/interfaces/i-excludes.d.ts +2 -2
  36. package/dist/interfaces/i-pxe.d.ts +15 -15
  37. package/dist/krill/modules/machine-id.js +1 -1
  38. package/dist/krill/modules/network-cfg.js +1 -1
  39. package/dist/krill/modules/packages.js +22 -0
  40. package/dist/krill/sequence.d.ts +1 -1
  41. package/dist/krill/sequence.js +3 -3
  42. package/dracut/README.md +84 -0
  43. package/dracut/dracut.conf +3 -0
  44. package/dracut/dracut.conf.d/90overlayfs.conf +5 -0
  45. package/dracut/dracut.conf.d/99custom.conf +4 -0
  46. package/dracut/install-dracut-99custom +1 -0
  47. package/dracut/usr/lib/dracut/modules.d/99custom/init-live.sh +4 -0
  48. package/dracut/usr/lib/dracut/modules.d/99custom/module-setup.sh +15 -0
  49. package/dracut/usr/lib/dracut/modules.d/99custom/mount-live.sh +25 -0
  50. package/manpages/doc/man/eggs.1.gz +0 -0
  51. package/manpages/doc/man/eggs.html +22 -28
  52. package/mkinitfs/README.md +46 -0
  53. package/mkinitfs/live.conf +2 -0
  54. package/mkinitfs/machine-id-gen.sh +3 -0
  55. package/mkinitfs/sidecar.sh +40 -0
  56. package/package.json +7 -5
@@ -265,13 +265,6 @@
265
265
  "allowNo": false,
266
266
  "type": "boolean"
267
267
  },
268
- "help": {
269
- "char": "h",
270
- "description": "Show CLI help.",
271
- "name": "help",
272
- "allowNo": false,
273
- "type": "boolean"
274
- },
275
268
  "file": {
276
269
  "char": "f",
277
270
  "description": "use a file configuration custom",
@@ -280,6 +273,13 @@
280
273
  "multiple": false,
281
274
  "type": "option"
282
275
  },
276
+ "help": {
277
+ "char": "h",
278
+ "description": "Show CLI help.",
279
+ "name": "help",
280
+ "allowNo": false,
281
+ "type": "boolean"
282
+ },
283
283
  "verbose": {
284
284
  "char": "v",
285
285
  "name": "verbose",
@@ -1461,5 +1461,5 @@
1461
1461
  ]
1462
1462
  }
1463
1463
  },
1464
- "version": "10.0.24"
1464
+ "version": "10.0.26"
1465
1465
  }
package/README.md CHANGED
@@ -490,7 +490,7 @@ EXAMPLES
490
490
  $ eggs adapt
491
491
  ```
492
492
 
493
- _See code: [src/commands/adapt.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/adapt.ts)_
493
+ _See code: [src/commands/adapt.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/adapt.ts)_
494
494
 
495
495
  ## `eggs analyze`
496
496
 
@@ -511,7 +511,7 @@ EXAMPLES
511
511
  sudo eggs analyze
512
512
  ```
513
513
 
514
- _See code: [src/commands/analyze.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/analyze.ts)_
514
+ _See code: [src/commands/analyze.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/analyze.ts)_
515
515
 
516
516
  ## `eggs autocomplete [SHELL]`
517
517
 
@@ -575,7 +575,7 @@ EXAMPLES
575
575
  sudo eggs calamares --remove
576
576
  ```
577
577
 
578
- _See code: [src/commands/calamares.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/calamares.ts)_
578
+ _See code: [src/commands/calamares.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/calamares.ts)_
579
579
 
580
580
  ## `eggs config`
581
581
 
@@ -602,7 +602,7 @@ EXAMPLES
602
602
  sudo eggs config --clean --nointeractive
603
603
  ```
604
604
 
605
- _See code: [src/commands/config.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/config.ts)_
605
+ _See code: [src/commands/config.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/config.ts)_
606
606
 
607
607
  ## `eggs cuckoo`
608
608
 
@@ -622,7 +622,7 @@ EXAMPLES
622
622
  sudo eggs cuckoo
623
623
  ```
624
624
 
625
- _See code: [src/commands/cuckoo.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/cuckoo.ts)_
625
+ _See code: [src/commands/cuckoo.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/cuckoo.ts)_
626
626
 
627
627
  ## `eggs dad`
628
628
 
@@ -630,7 +630,7 @@ ask help from daddy - TUI configuration helper
630
630
 
631
631
  ```
632
632
  USAGE
633
- $ eggs dad [-c] [-d] [-h] [-f <value>] [-v]
633
+ $ eggs dad [-c] [-d] [-f <value>] [-h] [-v]
634
634
 
635
635
  FLAGS
636
636
  -c, --clean remove old configuration before to create
@@ -650,7 +650,7 @@ EXAMPLES
650
650
  sudo dad --default
651
651
  ```
652
652
 
653
- _See code: [src/commands/dad.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/dad.ts)_
653
+ _See code: [src/commands/dad.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/dad.ts)_
654
654
 
655
655
  ## `eggs export deb`
656
656
 
@@ -677,7 +677,7 @@ EXAMPLES
677
677
  $ eggs export deb --all
678
678
  ```
679
679
 
680
- _See code: [src/commands/export/deb.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/export/deb.ts)_
680
+ _See code: [src/commands/export/deb.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/export/deb.ts)_
681
681
 
682
682
  ## `eggs export iso`
683
683
 
@@ -702,7 +702,7 @@ EXAMPLES
702
702
  $ eggs export iso --clean
703
703
  ```
704
704
 
705
- _See code: [src/commands/export/iso.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/export/iso.ts)_
705
+ _See code: [src/commands/export/iso.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/export/iso.ts)_
706
706
 
707
707
  ## `eggs help [COMMAND]`
708
708
 
@@ -722,7 +722,7 @@ DESCRIPTION
722
722
  Display help for eggs.
723
723
  ```
724
724
 
725
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.7/src/commands/help.ts)_
725
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.8/src/commands/help.ts)_
726
726
 
727
727
  ## `eggs install`
728
728
 
@@ -763,7 +763,7 @@ EXAMPLES
763
763
  sudo eggs install --chroot
764
764
  ```
765
765
 
766
- _See code: [src/commands/install.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/install.ts)_
766
+ _See code: [src/commands/install.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/install.ts)_
767
767
 
768
768
  ## `eggs kill`
769
769
 
@@ -786,7 +786,7 @@ EXAMPLES
786
786
  sudo eggs kill
787
787
  ```
788
788
 
789
- _See code: [src/commands/kill.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/kill.ts)_
789
+ _See code: [src/commands/kill.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/kill.ts)_
790
790
 
791
791
  ## `eggs krill`
792
792
 
@@ -845,7 +845,7 @@ EXAMPLES
845
845
  $ eggs mom
846
846
  ```
847
847
 
848
- _See code: [src/commands/mom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/mom.ts)_
848
+ _See code: [src/commands/mom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/mom.ts)_
849
849
 
850
850
  ## `eggs produce`
851
851
 
@@ -902,7 +902,7 @@ EXAMPLES
902
902
  sudo eggs produce --excludes home # exclude ~/*
903
903
  ```
904
904
 
905
- _See code: [src/commands/produce.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/produce.ts)_
905
+ _See code: [src/commands/produce.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/produce.ts)_
906
906
 
907
907
  ## `eggs status`
908
908
 
@@ -923,7 +923,7 @@ EXAMPLES
923
923
  $ eggs status
924
924
  ```
925
925
 
926
- _See code: [src/commands/status.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/status.ts)_
926
+ _See code: [src/commands/status.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/status.ts)_
927
927
 
928
928
  ## `eggs syncfrom`
929
929
 
@@ -949,7 +949,7 @@ EXAMPLES
949
949
  sudo eggs syncfrom --file /path/to/luks-volume
950
950
  ```
951
951
 
952
- _See code: [src/commands/syncfrom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/syncfrom.ts)_
952
+ _See code: [src/commands/syncfrom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/syncfrom.ts)_
953
953
 
954
954
  ## `eggs syncto`
955
955
 
@@ -976,7 +976,7 @@ EXAMPLES
976
976
  sudo eggs syncto --excludes
977
977
  ```
978
978
 
979
- _See code: [src/commands/syncto.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/syncto.ts)_
979
+ _See code: [src/commands/syncto.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/syncto.ts)_
980
980
 
981
981
  ## `eggs tools clean`
982
982
 
@@ -998,7 +998,7 @@ EXAMPLES
998
998
  sudo eggs tools clean
999
999
  ```
1000
1000
 
1001
- _See code: [src/commands/tools/clean.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/tools/clean.ts)_
1001
+ _See code: [src/commands/tools/clean.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/tools/clean.ts)_
1002
1002
 
1003
1003
  ## `eggs tools ppa`
1004
1004
 
@@ -1024,7 +1024,7 @@ EXAMPLES
1024
1024
  sudo eggs tools ppa --remove
1025
1025
  ```
1026
1026
 
1027
- _See code: [src/commands/tools/ppa.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/tools/ppa.ts)_
1027
+ _See code: [src/commands/tools/ppa.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/tools/ppa.ts)_
1028
1028
 
1029
1029
  ## `eggs tools skel`
1030
1030
 
@@ -1048,7 +1048,7 @@ EXAMPLES
1048
1048
  sudo eggs tools skel --user user-to-be-copied
1049
1049
  ```
1050
1050
 
1051
- _See code: [src/commands/tools/skel.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/tools/skel.ts)_
1051
+ _See code: [src/commands/tools/skel.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/tools/skel.ts)_
1052
1052
 
1053
1053
  ## `eggs tools stat`
1054
1054
 
@@ -1074,7 +1074,7 @@ EXAMPLES
1074
1074
  $ eggs tools stat --year
1075
1075
  ```
1076
1076
 
1077
- _See code: [src/commands/tools/stat.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/tools/stat.ts)_
1077
+ _See code: [src/commands/tools/stat.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/tools/stat.ts)_
1078
1078
 
1079
1079
  ## `eggs tools yolk`
1080
1080
 
@@ -1095,7 +1095,7 @@ EXAMPLES
1095
1095
  sudo eggs tools yolk
1096
1096
  ```
1097
1097
 
1098
- _See code: [src/commands/tools/yolk.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/tools/yolk.ts)_
1098
+ _See code: [src/commands/tools/yolk.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/tools/yolk.ts)_
1099
1099
 
1100
1100
  ## `eggs update`
1101
1101
 
@@ -1116,7 +1116,7 @@ EXAMPLES
1116
1116
  $ eggs update
1117
1117
  ```
1118
1118
 
1119
- _See code: [src/commands/update.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/update.ts)_
1119
+ _See code: [src/commands/update.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/update.ts)_
1120
1120
 
1121
1121
  ## `eggs version`
1122
1122
 
@@ -1162,7 +1162,7 @@ EXAMPLES
1162
1162
  $ eggs wardrobe get your-wardrobe
1163
1163
  ```
1164
1164
 
1165
- _See code: [src/commands/wardrobe/get.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/wardrobe/get.ts)_
1165
+ _See code: [src/commands/wardrobe/get.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/wardrobe/get.ts)_
1166
1166
 
1167
1167
  ## `eggs wardrobe list [REPO]`
1168
1168
 
@@ -1191,7 +1191,7 @@ EXAMPLES
1191
1191
  $ eggs wardrobe list --distro arch
1192
1192
  ```
1193
1193
 
1194
- _See code: [src/commands/wardrobe/list.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/wardrobe/list.ts)_
1194
+ _See code: [src/commands/wardrobe/list.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/wardrobe/list.ts)_
1195
1195
 
1196
1196
  ## `eggs wardrobe show [REPO]`
1197
1197
 
@@ -1221,7 +1221,7 @@ EXAMPLES
1221
1221
  $ eggs wardrobe show accessories/
1222
1222
  ```
1223
1223
 
1224
- _See code: [src/commands/wardrobe/show.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/wardrobe/show.ts)_
1224
+ _See code: [src/commands/wardrobe/show.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/wardrobe/show.ts)_
1225
1225
 
1226
1226
  ## `eggs wardrobe wear [REPO]`
1227
1227
 
@@ -1252,7 +1252,7 @@ EXAMPLES
1252
1252
  sudo eggs wardrobe wear wagtail/waydroid
1253
1253
  ```
1254
1254
 
1255
- _See code: [src/commands/wardrobe/wear.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.24/src/commands/wardrobe/wear.ts)_
1255
+ _See code: [src/commands/wardrobe/wear.ts](https://github.com/pieroproietti/penguins-eggs/blob/v10.0.26/src/commands/wardrobe/wear.ts)_
1256
1256
  <!-- commandsstop -->
1257
1257
 
1258
1258
  # penGUI
@@ -2,6 +2,7 @@
2
2
  doAutologin: false
3
3
  setRootPassword: false
4
4
  sudoersGroup: sudo
5
+ userGroup: users # glenn
5
6
  defaultGroups:
6
7
  - adm
7
8
  - cdrom
@@ -32,7 +32,7 @@
32
32
  #
33
33
  # The three combinations of legacy values are still supported.
34
34
  restartNowMode: user-unchecked
35
-
35
+ restartNowChecked: true
36
36
  # If the checkbox is shown, and the checkbox is checked, then when
37
37
  # Calamares exits from the finished-page it will run this command.
38
38
  # If not set, falls back to "shutdown -r now".
@@ -25,21 +25,28 @@ export default class Bleach {
25
25
  Utils.warning('cleaning the system');
26
26
  }
27
27
  const distro = new Distro();
28
- if (distro.familyId === 'debian') {
29
- await exec('apt-get clean', echo);
30
- await exec('apt-get autoclean', echo);
31
- const lockFile = '/var/lib/apt/lists/lock';
32
- await exec(`rm ${lockFile} -rf`, echo);
33
- }
34
- else if (distro.familyId === 'archlinux') {
35
- await exec('pacman -Scc', Utils.setEcho(true));
36
- }
37
- else if (distro.familyId === 'alpine') {
38
- await exec('apk cache clean', echo);
39
- await exec('apk cache purge', echo);
40
- }
41
- else if (distro.familyId === 'suse') {
42
- await exec(`zypper clean`, echo);
28
+ switch (distro.familyId) {
29
+ case 'debian': {
30
+ await exec('apt-get clean', echo);
31
+ await exec('apt-get autoclean', echo);
32
+ const lockFile = '/var/lib/apt/lists/lock';
33
+ await exec(`rm ${lockFile} -rf`, echo);
34
+ break;
35
+ }
36
+ case 'archlinux': {
37
+ await exec('pacman -Scc', Utils.setEcho(true));
38
+ break;
39
+ }
40
+ case 'alpine': {
41
+ await exec('apk cache clean', echo);
42
+ await exec('apk cache purge', echo);
43
+ break;
44
+ }
45
+ case 'suse': {
46
+ await exec(`zypper clean`, echo);
47
+ break;
48
+ }
49
+ // No default
43
50
  }
44
51
  await this.cleanHistory(verbose);
45
52
  await this.cleanJournal(verbose);
@@ -9,7 +9,16 @@
9
9
  * CliAutologin
10
10
  */
11
11
  export default class CliAutologin {
12
- addAutologin(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
12
+ /**
13
+ * add
14
+ * @param distro
15
+ * @param version
16
+ * @param user
17
+ * @param userPasswd
18
+ * @param rootPasswd
19
+ * @param chroot
20
+ */
21
+ add(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
13
22
  /**
14
23
  *
15
24
  * @param distro
@@ -31,13 +40,13 @@ export default class CliAutologin {
31
40
  */
32
41
  addMotd(distro: string, version: string, user: string, userPasswd: string, rootPasswd: string, chroot?: string): Promise<void>;
33
42
  /**
34
- *
35
- * @param path
43
+ * remove
44
+ * @param chroot
36
45
  */
37
- msgRemove(path: string): Promise<void>;
46
+ remove(chroot?: string): Promise<void>;
38
47
  /**
39
48
  *
40
- * @param chroot
49
+ * @param path
41
50
  */
42
- remove(chroot?: string): Promise<void>;
51
+ private msgRemove;
43
52
  }
@@ -6,13 +6,14 @@
6
6
  * license: MIT
7
7
  */
8
8
  import chalk from 'chalk';
9
+ import { execSync } from 'node:child_process';
9
10
  import fs from 'node:fs';
10
11
  import path from 'node:path';
11
12
  import shx from 'shelljs';
12
- import Pacman from '../classes/pacman.js';
13
- import Utils from '../classes/utils.js';
14
13
  // libraries
15
14
  import { exec } from '../lib/utils.js';
15
+ import Pacman from './pacman.js';
16
+ import Utils from './utils.js';
16
17
  const startMessage = 'eggs-start-message';
17
18
  const stopMessage = 'eggs-stop-message';
18
19
  /*
@@ -23,11 +24,17 @@ const stopMessage = 'eggs-stop-message';
23
24
  * CliAutologin
24
25
  */
25
26
  export default class CliAutologin {
26
- async addAutologin(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
27
+ /**
28
+ * add
29
+ * @param distro
30
+ * @param version
31
+ * @param user
32
+ * @param userPasswd
33
+ * @param rootPasswd
34
+ * @param chroot
35
+ */
36
+ async add(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
27
37
  if (Utils.isSystemd()) {
28
- /**
29
- * Systemd
30
- */
31
38
  const fileOverride = `${chroot}/etc/systemd/system/getty@.service.d/override.conf`;
32
39
  const dirOverride = path.dirname(fileOverride);
33
40
  if (fs.existsSync(dirOverride)) {
@@ -43,13 +50,31 @@ export default class CliAutologin {
43
50
  await this.addIssue(distro, version, user, userPasswd, rootPasswd, chroot);
44
51
  await this.addMotd(distro, version, user, userPasswd, rootPasswd, chroot);
45
52
  }
53
+ else if (Utils.isOpenRc()) {
54
+ const inittab = chroot + '/etc/inittab';
55
+ let content = '';
56
+ const search = `tty1::respawn:/sbin/getty 38400 tty1`;
57
+ const replace = `tty1::respawn:/sbin/getty -L 38400 tty1 -n -l /bin/autologin`;
58
+ const lines = fs.readFileSync(inittab, 'utf8').split('\n');
59
+ for (let i = 0; i < lines.length; i++) {
60
+ if (lines[i].includes(search)) {
61
+ lines[i] = replace;
62
+ }
63
+ content += lines[i] + '\n';
64
+ }
65
+ fs.writeFileSync(inittab, content, 'utf-8');
66
+ // create /bin/autologin
67
+ const autologin = chroot + '/bin/autologin';
68
+ content = '#!/bin/sh' + '\n';
69
+ content += `/bin/login -f ${user}` + '\n';
70
+ fs.writeFileSync(autologin, content, 'utf-8');
71
+ execSync(`chmod +x ${autologin}`);
72
+ await this.addIssue(distro, version, user, userPasswd, rootPasswd, chroot);
73
+ await this.addMotd(distro, version, user, userPasswd, rootPasswd, chroot);
74
+ }
46
75
  else if (Utils.isSysvinit()) {
47
- /**
48
- * sysvinit
49
- */
50
76
  const inittab = chroot + '/etc/inittab';
51
77
  const search = '1:2345:respawn:/sbin/getty';
52
- // const replace = `1:2345:respawn:/sbin/getty --noclear --autologin ${user} 38400 tty1`
53
78
  const replace = `1:2345:respawn:/sbin/getty --autologin ${user} 38400 tty1`;
54
79
  let content = '';
55
80
  const lines = fs.readFileSync(inittab, 'utf8').split('\n');
@@ -121,30 +146,7 @@ export default class CliAutologin {
121
146
  fs.writeFileSync(fileMotd, eggsMotd);
122
147
  }
123
148
  /**
124
- *
125
- * @param path
126
- */
127
- async msgRemove(path) {
128
- if (fs.existsSync(path)) {
129
- const rows = fs.readFileSync(path, 'utf8').split('\n');
130
- let cleaned = '';
131
- let remove = false;
132
- for (const row of rows) {
133
- if (row.includes(startMessage)) {
134
- remove = true;
135
- }
136
- if (!remove && row !== '') {
137
- cleaned += row + '\n';
138
- }
139
- if (row.includes(stopMessage)) {
140
- remove = false;
141
- }
142
- }
143
- fs.writeFileSync(path, cleaned, 'utf-8');
144
- }
145
- }
146
- /**
147
- *
149
+ * remove
148
150
  * @param chroot
149
151
  */
150
152
  async remove(chroot = '/') {
@@ -157,16 +159,37 @@ export default class CliAutologin {
157
159
  if (fs.existsSync(dirOverride)) {
158
160
  shx.exec(`rm ${dirOverride} -rf`);
159
161
  }
162
+ // shx.exec(`systemctl revert getty@.service`)
160
163
  this.msgRemove(`${chroot}/etc/motd`);
161
164
  this.msgRemove(`${chroot}/etc/issue`);
162
165
  }
166
+ else if (Utils.isOpenRc()) {
167
+ /**
168
+ * openrc
169
+ */
170
+ const inittab = chroot + '/etc/inittab';
171
+ const search = 'autologin';
172
+ const replace = `tty1::respawn:/sbin/getty 38400 tty1`;
173
+ let content = '';
174
+ const lines = fs.readFileSync(inittab, 'utf8').split('\n');
175
+ for (let i = 0; i < lines.length; i++) {
176
+ if (lines[i].includes(search)) {
177
+ lines[i] = replace;
178
+ }
179
+ content += lines[i] + '\n';
180
+ }
181
+ fs.writeFileSync(inittab, content, 'utf-8');
182
+ this.msgRemove(`${chroot}/etc/motd`);
183
+ this.msgRemove(`${chroot}/etc/issue`);
184
+ const autologin = `${chroot}/bin/autologin`;
185
+ execSync(`rm -f ${autologin}`);
186
+ }
163
187
  else if (Utils.isSysvinit()) {
164
188
  /**
165
189
  * sysvinit
166
190
  */
167
191
  const inittab = chroot + '/etc/inittab';
168
- const search = '1:2345:respawn:/sbin/getty';
169
- // const replace = `1:2345:respawn:/sbin/getty --noclear 38400 tty1 `
192
+ const search = '--autologin';
170
193
  const replace = '1:2345:respawn:/sbin/getty 38400 tty1 ';
171
194
  let content = '';
172
195
  const lines = fs.readFileSync(inittab, 'utf8').split('\n');
@@ -181,4 +204,27 @@ export default class CliAutologin {
181
204
  this.msgRemove(`${chroot}/etc/issue`);
182
205
  } // to add: openrc and runit for Devuan
183
206
  }
207
+ /**
208
+ *
209
+ * @param path
210
+ */
211
+ async msgRemove(path) {
212
+ if (fs.existsSync(path)) {
213
+ const rows = fs.readFileSync(path, 'utf8').split('\n');
214
+ let cleaned = '';
215
+ let remove = false;
216
+ for (const row of rows) {
217
+ if (row.includes(startMessage)) {
218
+ remove = true;
219
+ }
220
+ if (!remove && row !== '') {
221
+ cleaned += row + '\n';
222
+ }
223
+ if (row.includes(stopMessage)) {
224
+ remove = false;
225
+ }
226
+ }
227
+ fs.writeFileSync(path, cleaned, 'utf-8');
228
+ }
229
+ }
184
230
  }
@@ -22,12 +22,12 @@ export default class Compressors {
22
22
  * @returns
23
23
  */
24
24
  fast(): string;
25
- pendrive(level?: string): string;
26
25
  /**
27
26
  * max
28
27
  * @returns
29
28
  */
30
29
  max(): string;
30
+ pendrive(level?: string): string;
31
31
  /**
32
32
  * populate
33
33
  */
@@ -32,16 +32,6 @@ export default class Compressors {
32
32
  }
33
33
  return comp;
34
34
  }
35
- pendrive(level = '15') {
36
- let comp = 'gzip';
37
- if (this.isEnabled.zstd) {
38
- comp = `zstd -b 1M -Xcompression-level ${level}`;
39
- }
40
- else if (this.isEnabled.lz4) {
41
- comp = 'lz4';
42
- }
43
- return comp;
44
- }
45
35
  /**
46
36
  * max
47
37
  * @returns
@@ -58,6 +48,16 @@ export default class Compressors {
58
48
  const comp = `xz -Xbcj ${filter} ${options}`;
59
49
  return comp;
60
50
  }
51
+ pendrive(level = '15') {
52
+ let comp = 'gzip';
53
+ if (this.isEnabled.zstd) {
54
+ comp = `zstd -b 1M -Xcompression-level ${level}`;
55
+ }
56
+ else if (this.isEnabled.lz4) {
57
+ comp = 'lz4';
58
+ }
59
+ return comp;
60
+ }
61
61
  /**
62
62
  * populate
63
63
  */
@@ -9,6 +9,12 @@ import Settings from '../classes/settings.js';
9
9
  import { IEggsConfig } from '../interfaces/i-eggs-config.js';
10
10
  export default class Daddy {
11
11
  settings: Settings;
12
+ /**
13
+ * editConfif
14
+ * @param c
15
+ * @returns
16
+ */
17
+ editConfig(c: IEggsConfig): Promise<string>;
12
18
  /**
13
19
  *
14
20
  * @param reset
@@ -17,10 +23,4 @@ export default class Daddy {
17
23
  * @param verbose
18
24
  */
19
25
  helpMe(reset?: boolean, isCustom?: boolean, fileCustom?: string, verbose?: boolean): Promise<void>;
20
- /**
21
- * editConfif
22
- * @param c
23
- * @returns
24
- */
25
- editConfig(c: IEggsConfig): Promise<string>;
26
26
  }