penguins-eggs 9.6.23 → 9.8.1

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 (128) hide show
  1. package/.oclif.manifest.json +1458 -1
  2. package/README.md +1527 -201
  3. package/addons/eggs/theme/livecd/grub.main.cfg +4 -4
  4. package/addons/eggs/theme/livecd/isolinux.main.cfg +5 -5
  5. package/bin/dev.js +6 -0
  6. package/bin/run +0 -0
  7. package/bin/run.js +7 -0
  8. package/conf/derivatives.yaml +23 -3
  9. package/conf/distros/README.md +25 -0
  10. package/conf/distros/bionic/calamares/calamares-modules/sources-yolk/module.yml +8 -0
  11. package/conf/distros/bionic/calamares/calamares-modules/sources-yolk/sources-yolk.sh +82 -0
  12. package/conf/distros/bionic/calamares/modules/packages.yml +6 -0
  13. package/conf/distros/{rolling/calamares-32 → bionic/calamares}/modules/removeuser.yml +2 -3
  14. package/conf/distros/bionic/calamares/modules/unpackfs.yml +6 -0
  15. package/conf/distros/buster/calamares/calamares-modules/bootloader-config/bootloader-config.sh +3 -3
  16. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +1 -1
  17. package/conf/distros/buster/calamares/modules/bootloader.yml +2 -1
  18. package/conf/distros/buster/calamares/modules/fstab.yml +1 -1
  19. package/conf/distros/buster/calamares/modules/mount.yml +2 -2
  20. package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +10 -1
  21. package/conf/distros/focal/calamares/modules/before_bootloader_mkdirs_context.yml +4 -4
  22. package/conf/distros/focal/calamares/modules/fstab.yml +1 -1
  23. package/conf/distros/focal/calamares/modules/mount.yml +2 -2
  24. package/conf/distros/focal/calamares/modules/shellprocess_bug-LP#1829805.yml +1 -1
  25. package/conf/distros/focal/calamares/modules/shellprocess_logs.yml +1 -1
  26. package/conf/distros/stretch/krill/krill-modules/bootloader-config/bootloader-config.sh +28 -0
  27. package/conf/distros/stretch/krill/krill-modules/bootloader-config/module.yml +8 -0
  28. package/conf/distros/stretch/krill/krill-modules/remove-link/module.yml +9 -0
  29. package/conf/distros/stretch/krill/krill-modules/remove-link/remove-link.sh +5 -0
  30. package/conf/distros/stretch/krill/krill-modules/sources-yolk/module.yml +8 -0
  31. package/conf/distros/stretch/krill/krill-modules/sources-yolk/sources-yolk.sh +75 -0
  32. package/conf/distros/stretch/krill/krill-modules/sources-yolk-unmount/module.yml +8 -0
  33. package/conf/distros/stretch/krill/modules/partitions.yml +8 -0
  34. package/conf/distros/stretch/krill/modules/removeuser.yml +15 -0
  35. package/conf/distros/{rolling/calamares-32 → stretch/krill}/settings.yml +50 -11
  36. package/conf/eggs.yaml +2 -9
  37. package/conf/{exclude.list.homes → exclude.list.d/home.list} +6 -1
  38. package/conf/{exclude.list.template → exclude.list.d/master.list} +16 -26
  39. package/conf/{exclude.list.usr → exclude.list.d/usr.list} +2 -2
  40. package/conf/exclude.list.d/var.list +21 -0
  41. package/conf/tools.yaml +1 -3
  42. package/dist/classes/compressors.js +11 -13
  43. package/dist/classes/daddy.js +1 -3
  44. package/dist/classes/distro.js +23 -4
  45. package/dist/classes/families/archlinux.js +7 -9
  46. package/dist/classes/families/debian.js +1 -1
  47. package/dist/classes/families/fedora.js +1 -1
  48. package/dist/classes/families/suse.js +1 -1
  49. package/dist/classes/incubation/branding.js +9 -3
  50. package/dist/classes/incubation/distros/bionic.js +8 -3
  51. package/dist/classes/incubation/distros/buster.js +8 -3
  52. package/dist/classes/incubation/distros/focal.js +8 -3
  53. package/dist/classes/incubation/distros/jessie.js +6 -3
  54. package/dist/classes/incubation/distros/rolling.js +8 -4
  55. package/dist/classes/incubation/fisherman-helper/packages.js +5 -2
  56. package/dist/classes/incubation/fisherman.js +18 -3
  57. package/dist/classes/incubation/incubator.js +7 -2
  58. package/dist/classes/incubation/installer.js +3 -1
  59. package/dist/classes/initrd.js +5 -5
  60. package/dist/classes/keyboards.js +4 -4
  61. package/dist/classes/network.js +7 -7
  62. package/dist/classes/ovary.js +136 -176
  63. package/dist/classes/pacman.js +12 -14
  64. package/dist/classes/pve-live.js +1 -1
  65. package/dist/classes/pxe.js +10 -12
  66. package/dist/classes/settings.js +19 -18
  67. package/dist/classes/systemctl.js +1 -1
  68. package/dist/classes/tailor.js +6 -6
  69. package/dist/classes/tools.js +4 -6
  70. package/dist/classes/users.js +10 -0
  71. package/dist/classes/utils.js +30 -0
  72. package/dist/classes/xdg.js +21 -8
  73. package/dist/classes/yolk.js +3 -5
  74. package/dist/commands/adapt.js +8 -8
  75. package/dist/commands/analyze.js +9 -12
  76. package/dist/commands/calamares.js +20 -23
  77. package/dist/commands/config.js +13 -13
  78. package/dist/commands/cuckoo.js +7 -7
  79. package/dist/commands/dad.js +12 -12
  80. package/dist/commands/export/deb.js +20 -25
  81. package/dist/commands/export/iso.js +11 -11
  82. package/dist/commands/install.js +41 -37
  83. package/dist/commands/kill.js +12 -15
  84. package/dist/commands/mom.js +7 -7
  85. package/dist/commands/produce.js +71 -47
  86. package/dist/commands/status.js +8 -8
  87. package/dist/commands/syncfrom.js +34 -40
  88. package/dist/commands/syncto.js +142 -202
  89. package/dist/commands/tools/clean.js +9 -9
  90. package/dist/commands/tools/ppa.js +12 -12
  91. package/dist/commands/tools/skel.js +10 -10
  92. package/dist/commands/tools/stat.js +11 -11
  93. package/dist/commands/tools/yolk.js +9 -9
  94. package/dist/commands/update.js +8 -8
  95. package/dist/commands/wardrobe/get.js +13 -10
  96. package/dist/commands/wardrobe/list.js +15 -13
  97. package/dist/commands/wardrobe/show.js +16 -13
  98. package/dist/commands/wardrobe/wear.js +16 -14
  99. package/dist/components/summary.js +5 -2
  100. package/dist/interfaces/i-analyze.js +8 -10
  101. package/dist/interfaces/{i-filters.js → i-excludes.js} +0 -1
  102. package/dist/krill/krill-prepare.js +23 -11
  103. package/dist/krill/krill-sequence.js +72 -73
  104. package/dist/krill/modules/fstab.js +59 -32
  105. package/dist/krill/modules/mkfs.js +29 -16
  106. package/dist/krill/modules/network-cfg.js +22 -21
  107. package/dist/krill/modules/partition.js +3 -3
  108. package/dist/lib/dependencies.js +1 -0
  109. package/dist/lib/select_filesystem_type.js +6 -1
  110. package/manpages/doc/man/eggs.1.gz +0 -0
  111. package/manpages/doc/man/eggs.html +128 -74
  112. package/mkinitcpio/biglinux/live.conf +74 -0
  113. package/mkinitcpio/biglinux/mkinitcpio.conf +73 -0
  114. package/package.json +43 -41
  115. package/scripts/_eggs +17 -14
  116. package/scripts/eggs.bash +6 -6
  117. package/conf/distros/rolling/calamares-32/modules/displaymanager.yml +0 -23
  118. package/conf/distros/rolling/calamares-32/modules/finished.yml +0 -6
  119. package/conf/distros/rolling/calamares-32/modules/fstab.yml +0 -14
  120. package/conf/distros/rolling/calamares-32/modules/locale.yml +0 -11
  121. package/conf/distros/rolling/calamares-32/modules/mount.yml +0 -39
  122. package/conf/distros/rolling/calamares-32/modules/packages.yml +0 -11
  123. package/conf/distros/rolling/calamares-32/modules/partition.yml +0 -283
  124. package/conf/distros/rolling/calamares-32/modules/shellprocess_removelink.yml +0 -8
  125. package/conf/distros/rolling/calamares-32/modules/unpackfs.yml +0 -7
  126. package/conf/distros/rolling/calamares-32/modules/users.yml +0 -20
  127. package/conf/exclude.list.custom +0 -3
  128. package/manpages/doc/man/README.md +0 -0
@@ -11,10 +11,8 @@ const tslib_1 = require("tslib");
11
11
  const core_1 = require("@oclif/core");
12
12
  const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
13
13
  const krill_prepare_1 = tslib_1.__importDefault(require("../krill/krill-prepare"));
14
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
15
14
  const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
16
15
  const fs_1 = tslib_1.__importDefault(require("fs"));
17
- const axios_1 = tslib_1.__importDefault(require("axios"));
18
16
  const node_https_1 = tslib_1.__importDefault(require("node:https"));
19
17
  const agent = new node_https_1.default.Agent({
20
18
  rejectUnauthorized: false,
@@ -23,6 +21,30 @@ const agent = new node_https_1.default.Agent({
23
21
  * Class Krill
24
22
  */
25
23
  class Install extends core_1.Command {
24
+ static flags = {
25
+ btrfs: core_1.Flags.boolean({ char: 'b', description: 'Format btrfs' }),
26
+ crypted: core_1.Flags.boolean({ char: 'k', description: 'Crypted CLI installation' }),
27
+ custom: core_1.Flags.string({ char: 'c', description: 'custom unattended configuration' }),
28
+ domain: core_1.Flags.string({ char: 'd', description: 'Domain name, defult: .local' }),
29
+ halt: core_1.Flags.boolean({ char: 'H', description: 'Halt the system after installation' }),
30
+ help: core_1.Flags.help({ char: 'h' }),
31
+ ip: core_1.Flags.boolean({ char: 'i', description: 'hostname as ip, eg: ip-192-168-1-33' }),
32
+ nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
33
+ none: core_1.Flags.boolean({ char: 'N', description: 'Swap none: 256M' }),
34
+ pve: core_1.Flags.boolean({ char: 'p', description: 'Proxmox VE install' }),
35
+ random: core_1.Flags.boolean({ char: 'r', description: 'Add random to hostname, eg: colibri-ay412dt' }),
36
+ small: core_1.Flags.boolean({ char: 's', description: 'Swap small: RAM' }),
37
+ suspend: core_1.Flags.boolean({ char: 'S', description: 'Swap suspend: RAM x 2' }),
38
+ unattended: core_1.Flags.boolean({ char: 'u', description: 'Unattended installation' }),
39
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'Verbose' }),
40
+ };
41
+ static aliases = ['krill'];
42
+ static description = 'krill: the CLI system installer - the egg became a penguin!';
43
+ static examples = [
44
+ 'sudo eggs install',
45
+ 'sudo eggs install --unattended --halt',
46
+ 'sudo eggs install --custom it',
47
+ ];
26
48
  /**
27
49
  * Execute
28
50
  */
@@ -36,19 +58,24 @@ class Install extends core_1.Command {
36
58
  }
37
59
  // krillConfig
38
60
  let krillConfig = {};
61
+ const content = fs_1.default.readFileSync('/etc/penguins-eggs.d/krill.yaml', 'utf8');
62
+ krillConfig = js_yaml_1.default.load(content);
63
+ /* removed
39
64
  if (custom !== undefined) {
40
- const fname = node_path_1.default.basename(custom);
41
- const url = `https://raw.githubusercontent.com/pieroproietti/penguins-wardrobe/main/config/${fname}.yaml`;
42
- let res;
43
- await axios_1.default.get(url, { httpsAgent: agent })
44
- .then(function (response) {
45
- krillConfig = js_yaml_1.default.load(response.data);
46
- })
47
- .catch(function (error) {
48
- const content = fs_1.default.readFileSync('/etc/penguins-eggs.d/krill.yaml', 'utf8');
49
- krillConfig = js_yaml_1.default.load(content);
50
- });
65
+ const fname = path.basename(custom)
66
+ const url = `https://raw.githubusercontent.com/pieroproietti/penguins-wardrobe/main/config/${fname}.yaml`
67
+ let res: AxiosResponse
68
+ await axios.get(url, {httpsAgent: agent})
69
+ .then(function (response) {
70
+ krillConfig = yaml.load(response.data) as IKrillConfig
71
+ })
72
+ .catch(function (error) {
73
+ const content = fs.readFileSync('/etc/penguins-eggs.d/krill.yaml', 'utf8')
74
+ krillConfig = yaml.load(content) as IKrillConfig
75
+ })
51
76
  }
77
+ }
78
+ end removed */
52
79
  // nointeractive
53
80
  const nointeractive = flags.nointeractive;
54
81
  // halt
@@ -73,7 +100,7 @@ class Install extends core_1.Command {
73
100
  if (utils_1.default.isRoot()) {
74
101
  if (utils_1.default.isLive()) {
75
102
  const krill = new krill_prepare_1.default(unattended, nointeractive, halt);
76
- await krill.prepare(krillConfig, ip, random, domain, suspend, small, none, crypted, pve, verbose);
103
+ await krill.prepare(krillConfig, ip, random, domain, suspend, small, none, crypted, pve, flags.btrfs, verbose);
77
104
  }
78
105
  else {
79
106
  utils_1.default.warning('You are in an installed system!');
@@ -84,27 +111,4 @@ class Install extends core_1.Command {
84
111
  }
85
112
  }
86
113
  }
87
- Install.flags = {
88
- crypted: core_1.Flags.boolean({ char: 'k', description: 'Crypted CLI installation' }),
89
- custom: core_1.Flags.string({ char: 'c', description: 'custom unattended configuration' }),
90
- domain: core_1.Flags.string({ char: 'd', description: 'Domain name, defult: .local' }),
91
- halt: core_1.Flags.boolean({ char: 'H', description: 'Halt the system after installation' }),
92
- help: core_1.Flags.help({ char: 'h' }),
93
- ip: core_1.Flags.boolean({ char: 'i', description: 'hostname as ip, eg: ip-192-168-1-33' }),
94
- nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
95
- none: core_1.Flags.boolean({ char: 'N', description: 'Swap none: 256M' }),
96
- pve: core_1.Flags.boolean({ char: 'p', description: 'Proxmox VE install' }),
97
- random: core_1.Flags.boolean({ char: 'r', description: 'Add random to hostname, eg: colibri-ay412dt' }),
98
- small: core_1.Flags.boolean({ char: 's', description: 'Swap small: RAM' }),
99
- suspend: core_1.Flags.boolean({ char: 'S', description: 'Swap suspend: RAM x 2' }),
100
- unattended: core_1.Flags.boolean({ char: 'u', description: 'Unattended installation' }),
101
- verbose: core_1.Flags.boolean({ char: 'v', description: 'Verbose' }),
102
- };
103
- Install.aliases = ['krill'];
104
- Install.description = 'krill: the CLI system installer - the egg became a penguin!';
105
- Install.examples = [
106
- 'sudo eggs install',
107
- 'sudo eggs install --unattended --halt',
108
- 'sudo eggs install --custom it',
109
- ];
110
114
  exports.default = Install;
@@ -16,11 +16,18 @@ const kill_me_softly_1 = tslib_1.__importDefault(require("../lib/kill_me_softly"
16
16
  *
17
17
  */
18
18
  class Kill extends core_1.Command {
19
- constructor() {
20
- super(...arguments);
21
- this.config_file = '/etc/penguins-eggs.d/eggs.yaml';
22
- this.snapshot_dir = '';
23
- }
19
+ static flags = {
20
+ help: core_1.Flags.help({ char: 'h' }),
21
+ nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
22
+ isos: core_1.Flags.boolean({ char: 'i', description: 'erase all ISOs on remote mount' }),
23
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
24
+ };
25
+ static description = 'kill the eggs/free the nest';
26
+ static examples = [
27
+ 'sudo eggs kill',
28
+ ];
29
+ config_file = '/etc/penguins-eggs.d/eggs.yaml';
30
+ snapshot_dir = '';
24
31
  async run() {
25
32
  utils_1.default.titles(this.id + ' ' + this.argv);
26
33
  const { flags } = await this.parse(Kill);
@@ -46,14 +53,4 @@ class Kill extends core_1.Command {
46
53
  }
47
54
  }
48
55
  }
49
- Kill.flags = {
50
- help: core_1.Flags.help({ char: 'h' }),
51
- nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
52
- isos: core_1.Flags.boolean({ char: 'i', description: 'erase all ISOs on remote mount' }),
53
- verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
54
- };
55
- Kill.description = 'kill the eggs/free the nest';
56
- Kill.examples = [
57
- 'sudo eggs kill',
58
- ];
59
56
  exports.default = Kill;
@@ -13,6 +13,13 @@ const node_path_1 = tslib_1.__importDefault(require("node:path"));
13
13
  const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
14
14
  const utils_2 = require("../lib/utils");
15
15
  class Mom extends core_1.Command {
16
+ static flags = {
17
+ help: core_1.Flags.help({ char: 'h' }),
18
+ };
19
+ static description = 'ask help from mommy - TUI helper';
20
+ static examples = [
21
+ 'eggs mom',
22
+ ];
16
23
  async run() {
17
24
  utils_1.default.titles(this.id + ' ' + this.argv);
18
25
  // No sudo!
@@ -24,11 +31,4 @@ class Mom extends core_1.Command {
24
31
  await (0, utils_2.exec)(cmd);
25
32
  }
26
33
  }
27
- Mom.flags = {
28
- help: core_1.Flags.help({ char: 'h' }),
29
- };
30
- Mom.description = 'ask help from mommy - TUI helper';
31
- Mom.examples = [
32
- 'eggs mom',
33
- ];
34
34
  exports.default = Mom;
@@ -17,6 +17,39 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
17
17
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
18
18
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
19
19
  class Produce extends core_1.Command {
20
+ static flags = {
21
+ addons: core_1.Flags.string({ multiple: true, description: 'addons to be used: adapt, ichoice, pve, rsupport' }),
22
+ basename: core_1.Flags.string({ description: 'basename' }),
23
+ clone: core_1.Flags.boolean({ char: 'c', description: 'clone' }),
24
+ cryptedclone: core_1.Flags.boolean({ char: 'C', description: 'crypted clone' }),
25
+ excludes: core_1.Flags.string({ multiple: true, description: 'use: custom, home, mine, usr, var' }),
26
+ help: core_1.Flags.help({ char: 'h' }),
27
+ links: core_1.Flags.string({ multiple: true, description: 'desktop links' }),
28
+ max: core_1.Flags.boolean({ char: 'm', description: 'max compression' }),
29
+ noicons: core_1.Flags.boolean({ char: 'N', description: 'no icons on desktop' }),
30
+ nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
31
+ prefix: core_1.Flags.string({ char: 'p', description: 'prefix' }),
32
+ release: core_1.Flags.boolean({ description: 'release: max compression, remove penguins-eggs and calamares after installation' }),
33
+ script: core_1.Flags.boolean({ char: 's', description: 'script mode. Generate scripts to manage iso build' }),
34
+ standard: core_1.Flags.boolean({ char: 'f', description: 'standard compression' }),
35
+ theme: core_1.Flags.string({ description: 'theme for livecd, calamares branding and partitions' }),
36
+ unsecure: core_1.Flags.boolean({ char: 'u', description: '/root contents are included on live' }),
37
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
38
+ yolk: core_1.Flags.boolean({ char: 'y', description: 'force yolk renew' }),
39
+ };
40
+ static description = 'produce a live image from your system whithout your data';
41
+ static examples = [
42
+ 'sudo eggs produce',
43
+ 'sudo eggs produce --standard',
44
+ 'sudo eggs produce --max',
45
+ 'sudo eggs produce --max --basename=colibri',
46
+ 'sudo eggs produce --cryptedclone 4G',
47
+ 'sudo eggs produce --clone',
48
+ 'sudo eggs produce --basename=colibri',
49
+ 'sudo eggs produce --basename=colibri --theme theme --addons adapt',
50
+ 'sudo eggs produce --excludes=usr var',
51
+ 'sudo eggs produce --excludes=static'
52
+ ];
20
53
  async run() {
21
54
  utils_1.default.titles(this.id + ' ' + this.argv);
22
55
  const { flags } = await this.parse(Produce);
@@ -46,27 +79,44 @@ class Produce extends core_1.Command {
46
79
  }
47
80
  }
48
81
  }
82
+ // links check
83
+ let myLinks = [];
84
+ if (flags.links) {
85
+ const links = flags.links;
86
+ for (let i = 0; i < links.length; i++) {
87
+ if (node_fs_1.default.existsSync(`/usr/share/applications/${links[i]}.desktop`)) {
88
+ myLinks.push(links[i]);
89
+ }
90
+ else {
91
+ utils_1.default.warning('desktop link: ' + chalk_1.default.white('/usr/share/applications/' + links[i] + '.desktop') + ' not found!');
92
+ }
93
+ }
94
+ }
49
95
  /**
50
96
  * composizione dei flag
51
97
  */
52
- // filters
53
- const filters = {};
54
- filters.custom = false;
55
- filters.dev = false;
56
- filters.homes = false;
57
- filters.usr = false;
58
- if (flags.filters) {
59
- if (flags.filters.includes('custom')) {
60
- filters.custom = true;
98
+ // excludes
99
+ const excludes = {};
100
+ excludes.static = false;
101
+ excludes.home = false;
102
+ excludes.mine = false;
103
+ excludes.usr = false;
104
+ excludes.var = false;
105
+ if (flags.excludes) {
106
+ if (flags.excludes.includes('static')) {
107
+ excludes.static = true;
108
+ }
109
+ if (flags.excludes.includes('home')) {
110
+ excludes.home = true;
61
111
  }
62
- if (flags.filters.includes('dev')) {
63
- filters.dev = true;
112
+ if (flags.excludes.includes('mine')) {
113
+ excludes.mine = true;
64
114
  }
65
- if (flags.filters.includes('homes')) {
66
- filters.homes = true;
115
+ if (flags.excludes.includes('usr')) {
116
+ excludes.usr = true;
67
117
  }
68
- if (flags.filters.includes('usr')) {
69
- filters.usr = true;
118
+ if (flags.excludes.includes('var')) {
119
+ excludes.var = true;
70
120
  }
71
121
  }
72
122
  let prefix = '';
@@ -87,7 +137,7 @@ class Produce extends core_1.Command {
87
137
  compression = compressors.standard();
88
138
  }
89
139
  const release = flags.release;
90
- const cryptedclone = flags.cryptedclone;
140
+ let cryptedclone = flags.cryptedclone;
91
141
  const clone = flags.clone;
92
142
  const verbose = flags.verbose;
93
143
  const scriptOnly = flags.script;
@@ -140,7 +190,7 @@ class Produce extends core_1.Command {
140
190
  const ovary = new ovary_1.default();
141
191
  utils_1.default.warning('Produce an egg...');
142
192
  if (await ovary.fertilization(prefix, basename, theme, compression, !nointeractive)) {
143
- await ovary.produce(clone, cryptedclone, scriptOnly, yolkRenew, release, myAddons, filters, nointeractive, noicons, unsecure, verbose);
193
+ await ovary.produce(clone, cryptedclone, scriptOnly, yolkRenew, release, myAddons, myLinks, excludes, nointeractive, noicons, unsecure, verbose);
144
194
  ovary.finished(scriptOnly);
145
195
  }
146
196
  }
@@ -149,34 +199,8 @@ class Produce extends core_1.Command {
149
199
  }
150
200
  }
151
201
  }
152
- Produce.flags = {
153
- addons: core_1.Flags.string({ multiple: true, description: 'addons to be used: adapt, ichoice, pve, rsupport' }),
154
- basename: core_1.Flags.string({ description: 'basename' }),
155
- clone: core_1.Flags.boolean({ char: 'c', description: 'clone' }),
156
- cryptedclone: core_1.Flags.boolean({ char: 'C', description: 'crypted clone' }),
157
- filters: core_1.Flags.string({ multiple: true, description: 'filters can be used: custom. dev, homes, usr' }),
158
- help: core_1.Flags.help({ char: 'h' }),
159
- max: core_1.Flags.boolean({ char: 'm', description: 'max compression' }),
160
- noicons: core_1.Flags.boolean({ char: 'N', description: 'no icons on desktop' }),
161
- nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
162
- prefix: core_1.Flags.string({ char: 'p', description: 'prefix' }),
163
- release: core_1.Flags.boolean({ description: 'release: max compression, remove penguins-eggs and calamares after installation' }),
164
- script: core_1.Flags.boolean({ char: 's', description: 'script mode. Generate scripts to manage iso build' }),
165
- standard: core_1.Flags.boolean({ char: 'f', description: 'standard compression' }),
166
- theme: core_1.Flags.string({ description: 'theme for livecd, calamares branding and partitions' }),
167
- unsecure: core_1.Flags.boolean({ char: 'u', description: '/root contents are included on live' }),
168
- verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
169
- yolk: core_1.Flags.boolean({ char: 'y', description: 'force yolk renew' }),
170
- };
171
- Produce.description = 'produce a live image from your system whithout your data';
172
- Produce.examples = [
173
- 'sudo eggs produce',
174
- 'sudo eggs produce --standard',
175
- 'sudo eggs produce --max',
176
- 'sudo eggs produce --max --basename=colibri',
177
- 'sudo eggs produce --cryptedclone',
178
- 'sudo eggs produce --clone',
179
- 'sudo eggs produce --basename=colibri',
180
- 'sudo eggs produce --basename=colibri --theme theme --addons adapt',
181
- ];
182
202
  exports.default = Produce;
203
+ const validSizePattern = /^(\d+)([MG]?)$/;
204
+ function isValidSize(input) {
205
+ return validSizePattern.test(input);
206
+ }
@@ -14,6 +14,14 @@ const information_1 = tslib_1.__importDefault(require("../components/elements/in
14
14
  *
15
15
  */
16
16
  class Status extends core_1.Command {
17
+ static flags = {
18
+ help: core_1.Flags.help({ char: 'h' }),
19
+ verbose: core_1.Flags.boolean({ char: 'v' }),
20
+ };
21
+ static description = 'informations about eggs status';
22
+ static examples = [
23
+ 'eggs status',
24
+ ];
17
25
  /**
18
26
  *
19
27
  */
@@ -26,12 +34,4 @@ class Status extends core_1.Command {
26
34
  await (0, information_1.default)(verbose);
27
35
  }
28
36
  }
29
- Status.flags = {
30
- help: core_1.Flags.help({ char: 'h' }),
31
- verbose: core_1.Flags.boolean({ char: 'v' }),
32
- };
33
- Status.description = 'informations about eggs status';
34
- Status.examples = [
35
- 'eggs status',
36
- ];
37
37
  exports.default = Status;
@@ -13,20 +13,31 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
13
13
  const path_1 = tslib_1.__importDefault(require("path"));
14
14
  const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
15
15
  const utils_2 = require("../lib/utils");
16
+ const distro_1 = tslib_1.__importDefault(require("../classes/distro"));
16
17
  /**
17
18
  *
18
19
  */
19
20
  class Syncfrom extends core_1.Command {
20
- constructor() {
21
- super(...arguments);
22
- this.verbose = false;
23
- this.echo = {};
24
- this.rootDir = '/';
25
- this.luksName = 'luks-eggs-data';
26
- this.luksFile = `/run/live/medium/live/${this.luksName}`;
27
- this.luksDevice = `/dev/mapper/${this.luksName}`;
28
- this.luksMountpoint = '/tmp/eggs-data';
29
- }
21
+ static flags = {
22
+ delete: core_1.Flags.string({ description: 'rsync --delete delete extraneous files from dest dirs' }),
23
+ file: core_1.Flags.string({ char: 'f', description: 'file containing luks-volume encrypted' }),
24
+ help: core_1.Flags.help({ char: 'h' }),
25
+ rootdir: core_1.Flags.string({ char: 'r', description: 'rootdir of the installed system, when used from live' }),
26
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
27
+ };
28
+ static description = 'restore users and user data from a LUKS volumes';
29
+ static examples = [
30
+ 'sudo eggs syncfrom',
31
+ 'sudo eggs syncfrom --file /path/to/luks-volume',
32
+ ];
33
+ verbose = false;
34
+ echo = {};
35
+ rootDir = '/';
36
+ luksName = 'luks-volume';
37
+ luksFile = "";
38
+ luksDevice = `/dev/mapper/${this.luksName}`;
39
+ luksMountpoint = `/tmp/mnt/${this.luksName}`;
40
+ remix = {};
30
41
  async run() {
31
42
  const { flags } = await this.parse(Syncfrom);
32
43
  if (flags.verbose) {
@@ -51,7 +62,8 @@ class Syncfrom extends core_1.Command {
51
62
  }
52
63
  if (utils_1.default.isRoot()) {
53
64
  if (fileVolume === '') {
54
- fileVolume = '/run/live/medium/live/luks-eggs-dada';
65
+ let distro = new distro_1.default(this.remix);
66
+ fileVolume = `${distro.liveMediumPath}live/${this.luksName}`;
55
67
  }
56
68
  if (!utils_1.default.isLive()) {
57
69
  /**
@@ -61,7 +73,7 @@ class Syncfrom extends core_1.Command {
61
73
  this.luksName = path_1.default.basename(fileVolume);
62
74
  this.luksFile = fileVolume;
63
75
  this.luksDevice = `/dev/mapper/${this.luksName}`;
64
- this.luksMountpoint = '/tmp/eggs-data';
76
+ this.luksMountpoint = `/tmp/${this.luksName}`;
65
77
  await this.restorePrivateData();
66
78
  if (await utils_1.default.customConfirm('Your system was updated! Press a key to reboot')) {
67
79
  await (0, utils_2.exec)('reboot');
@@ -78,7 +90,7 @@ class Syncfrom extends core_1.Command {
78
90
  this.luksName = path_1.default.basename(fileVolume);
79
91
  this.luksFile = fileVolume;
80
92
  this.luksDevice = `/dev/mapper/${this.luksName}`;
81
- this.luksMountpoint = '/tmp/eggs-data';
93
+ this.luksMountpoint = `/tmp/${this.luksName}`;
82
94
  await this.restorePrivateData();
83
95
  }
84
96
  }
@@ -95,24 +107,18 @@ class Syncfrom extends core_1.Command {
95
107
  await (0, utils_2.exec)(`mkdir ${this.luksMountpoint}`, this.echo);
96
108
  }
97
109
  await this.luksOpen();
98
- /**
99
- * ONLY FROM LIVE
100
- * rm home, subst /etc/passwd, /etc/shadow, /etc/groups
101
- */
102
110
  if (utils_1.default.isLive() && this.rootDir !== '/') {
103
- utils_1.default.warning('Removing live user on destination system');
111
+ utils_1.default.warning('Restoring crypted data');
112
+ // Rimozione dei file esistenti
113
+ await (0, utils_2.exec)(`rm -rf ${this.rootDir}/etc/lightdm/lightdm.conf`, this.echo);
114
+ await (0, utils_2.exec)(`rm -rf ${this.rootDir}/etc/passwd`, this.echo);
115
+ await (0, utils_2.exec)(`rm -rf ${this.rootDir}/etc/group`, this.echo);
116
+ await (0, utils_2.exec)(`rm -rf ${this.rootDir}/etc/shadow`, this.echo);
104
117
  await (0, utils_2.exec)(`rm -rf ${this.rootDir}/home/*`, this.echo);
105
- utils_1.default.warning('Restoring accounts');
106
- await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/passwd ${this.rootDir}/etc/`, this.echo);
107
- await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/shadow ${this.rootDir}/etc/`, this.echo);
108
- await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/group ${this.rootDir}/etc/`, this.echo);
109
- }
110
- utils_1.default.warning('Restoring crypted data');
111
- let cmd = `rsync -a ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
112
- if (destDelete) {
113
- cmd = `rsync --archive --delete ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`;
118
+ // unsquashfs
119
+ const cmd = `unsquashfs -d ${this.rootDir} -f ${this.luksMountpoint}/private.squashfs`;
120
+ await (0, utils_2.exec)(cmd, utils_1.default.setEcho(true));
114
121
  }
115
- await (0, utils_2.exec)(cmd, this.echo);
116
122
  await this.luksClose();
117
123
  }
118
124
  /**
@@ -150,16 +156,4 @@ class Syncfrom extends core_1.Command {
150
156
  }
151
157
  }
152
158
  }
153
- Syncfrom.flags = {
154
- delete: core_1.Flags.string({ description: 'rsync --delete delete extraneous files from dest dirs' }),
155
- file: core_1.Flags.string({ char: 'f', description: 'file LUKS volume encrypted' }),
156
- help: core_1.Flags.help({ char: 'h' }),
157
- rootdir: core_1.Flags.string({ char: 'r', description: 'rootdir of the installed system, when used from live' }),
158
- verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
159
- };
160
- Syncfrom.description = 'restore users and user data from a LUKS volumes';
161
- Syncfrom.examples = [
162
- 'sudo eggs syncfrom',
163
- 'sudo eggs syncfrom --file /path/to/fileLUKS',
164
- ];
165
159
  exports.default = Syncfrom;