penguins-eggs 10.0.60 → 10.1.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.
- package/.oclif.manifest.json +62 -1
- package/README.md +145 -75
- package/addons/eggs/theme/calamares/modules/{_users.yml → users.yml} +3 -3
- package/addons/eggs/theme/livecd/grub.main.full.cfg +1 -1
- package/addons/eggs/theme/livecd/grub.main.simple.cfg +1 -1
- package/conf/derivatives.yaml +4 -3
- package/conf/derivatives_fedora.yaml +6 -0
- package/conf/distros/alpine/calamares/modules/users.yml +3 -3
- package/conf/distros/bionic/calamares/calamares-modules/grubcfg/grubcfg.yml +1 -1
- package/conf/distros/bionic/calamares/modules/users.yml +3 -3
- package/conf/distros/buster/calamares/modules/users.yml +4 -3
- package/conf/distros/fedora/calamares/modules/users.yml +3 -3
- package/conf/distros/noble/calamares/modules/focal-jammy/users.yml +3 -3
- package/conf/distros/noble/calamares/modules/users.yml +1 -0
- package/conf/distros/opensuse/calamares/modules/users.yml +3 -3
- package/conf/distros/rolling/calamares/modules/users.yml +3 -3
- package/conf/eggs.yaml +1 -1
- package/conf/love.yaml +4 -4
- package/dist/classes/compressors.js +1 -1
- package/dist/classes/distro.d.ts +27 -3
- package/dist/classes/distro.js +361 -289
- package/dist/classes/ovary.d/bind-live-fs.js +22 -30
- package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -0
- package/dist/classes/ovary.d/edit-live-fs.js +9 -13
- package/dist/classes/ovary.d/fertilization.js +6 -1
- package/dist/classes/ovary.d/initrd.js +11 -15
- package/dist/classes/ovary.d/kernel-copy.js +2 -16
- package/dist/classes/ovary.d/make-efi.js +8 -5
- package/dist/classes/ovary.d/make-squashfs.d.ts +1 -1
- package/dist/classes/ovary.d/make-squashfs.js +17 -24
- package/dist/classes/ovary.d/merged.d.ts +9 -13
- package/dist/classes/ovary.d/merged.js +38 -48
- package/dist/classes/ovary.d/produce.d.ts +1 -1
- package/dist/classes/ovary.d/produce.js +38 -32
- package/dist/classes/ovary.d/syslinux.js +4 -4
- package/dist/classes/ovary.d/user-create-live.js +12 -5
- package/dist/classes/ovary.d.ts +8 -3
- package/dist/classes/ovary.js +8 -3
- package/dist/classes/pacman.d/archlinux.js +1 -5
- package/dist/classes/pacman.js +2 -1
- package/dist/classes/systemctl.d.ts +1 -1
- package/dist/classes/systemctl.js +1 -1
- package/dist/classes/tailor.js +2 -1
- package/dist/classes/utils.d/architecture.d.ts +41 -0
- package/dist/classes/utils.d/architecture.js +87 -0
- package/dist/classes/utils.d/console-output.d.ts +26 -0
- package/dist/classes/utils.d/console-output.js +46 -0
- package/dist/classes/utils.d/filesystem.d.ts +53 -0
- package/dist/classes/utils.d/filesystem.js +152 -0
- package/dist/classes/utils.d/formatters.d.ts +32 -0
- package/dist/classes/utils.d/formatters.js +64 -0
- package/dist/classes/utils.d/kernel.d.ts +83 -0
- package/dist/classes/utils.d/kernel.js +288 -0
- package/dist/classes/utils.d/network.d.ts +43 -0
- package/dist/classes/utils.d/network.js +133 -0
- package/dist/classes/utils.d/package-info.d.ts +55 -0
- package/dist/classes/utils.d/package-info.js +137 -0
- package/dist/classes/utils.d/snapshot.d.ts +44 -0
- package/dist/classes/utils.d/snapshot.js +102 -0
- package/dist/classes/utils.d/system.d.ts +63 -0
- package/dist/classes/utils.d/system.js +200 -0
- package/dist/classes/utils.d/user-interaction.d.ts +39 -0
- package/dist/classes/utils.d/user-interaction.js +104 -0
- package/dist/classes/utils.d.ts +90 -322
- package/dist/classes/utils.js +105 -1013
- package/dist/commands/dad.d.ts +1 -0
- package/dist/commands/dad.js +1 -0
- package/dist/commands/export/pkg.js +6 -6
- package/dist/commands/export/tarballs.js +11 -16
- package/dist/commands/kill.js +1 -1
- package/dist/commands/love.d.ts +1 -0
- package/dist/commands/love.js +21 -7
- package/dist/commands/pods.d.ts +22 -0
- package/dist/commands/pods.js +92 -0
- package/dist/commands/produce.d.ts +1 -0
- package/dist/commands/produce.js +21 -1
- package/dist/commands/update.js +2 -2
- package/dist/index.d.ts +6 -52
- package/dist/index.js +6 -145
- package/dist/krill/classes/krill_enums.d.ts +14 -1
- package/dist/krill/classes/krill_enums.js +16 -1
- package/dist/krill/classes/prepare.d/partitions.js +3 -3
- package/dist/krill/classes/prepare.d.ts +46 -21
- package/dist/krill/classes/prepare.js +187 -187
- package/dist/krill/classes/sequence.d/add_user.js +21 -3
- package/dist/krill/classes/sequence.d/partition.js +2 -2
- package/dist/krill/classes/sequence.d.ts +18 -21
- package/dist/krill/classes/sequence.js +156 -423
- package/dist/krill/components/information.js +13 -7
- package/dist/{krill/lib → lib}/kill_me_softly.js +2 -2
- package/dist/penguins-eggs_10.1.1-0_amd64.deb +0 -0
- package/dist/penguins-eggs_10.1.1-0_amd64.deb.sha256 +1 -0
- package/package.json +32 -27
- package/perrisbrewery/scripts/postinst +98 -0
- package/perrisbrewery/scripts/postrm +82 -0
- package/perrisbrewery/scripts/preinst +40 -0
- package/perrisbrewery/scripts/prerm +47 -0
- package/perrisbrewery/template/control.template +17 -0
- package/perrisbrewery/template/dependencies-bionic.yaml +33 -0
- package/perrisbrewery/template/dependencies.yaml +37 -0
- package/perrisbrewery/template/man.template.md +110 -0
- package/pods/README.md +14 -0
- package/pods/almalinux.sh +10 -0
- package/pods/archlinux.sh +10 -0
- package/pods/ci/README.md +5 -0
- package/pods/ci/kernel-overlay-install.sh +114 -0
- package/pods/ci/minimal/almalinux-container2host.sh +165 -0
- package/pods/ci/minimal/archlinux-container2host.sh +125 -0
- package/pods/ci/minimal/debian-container2host.sh +173 -0
- package/pods/ci/minimal/fedora-container2host.sh +170 -0
- package/pods/ci/minimal/manjaro-container2host.sh +123 -0
- package/pods/ci/minimal/opensuse-container2host.sh +143 -0
- package/pods/ci/penguins-eggs-execute.sh +22 -0
- package/pods/ci/penguins-eggs-install.sh +115 -0
- package/pods/ci/run +34 -0
- package/pods/ci/run-on-almalinux.sh +50 -0
- package/pods/ci/run-on-archlinux.sh +64 -0
- package/pods/ci/run-on-debian.sh +51 -0
- package/pods/ci/run-on-devuan.sh +48 -0
- package/pods/ci/run-on-fedora.sh +51 -0
- package/pods/ci/run-on-manjaro.sh +61 -0
- package/pods/ci/run-on-opensuse.sh +58 -0
- package/pods/ci/run-on-rockylinux.sh +51 -0
- package/pods/ci/run-on-ubuntu.sh +52 -0
- package/pods/debian.sh +23 -0
- package/pods/devuan.sh +26 -0
- package/pods/fedora.sh +12 -0
- package/pods/lmde.sh +22 -0
- package/pods/manjaro.sh +10 -0
- package/pods/opensuse.sh +12 -0
- package/pods/podman.command.sh +85 -0
- package/pods/rocky.sh +12 -0
- package/pods/run-build-packages-debs.sh +45 -0
- package/pods/run-create-debs.sh +23 -0
- package/pods/ubuntu.sh +24 -0
- package/scripts/_eggs +14 -5
- package/scripts/eggs.bash +5 -4
- /package/dist/{krill/lib → lib}/kill_me_softly.d.ts +0 -0
package/dist/commands/dad.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export default class Dad extends Command {
|
|
|
13
13
|
clean: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
help: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
17
18
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
};
|
package/dist/commands/dad.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class Dad extends Command {
|
|
|
18
18
|
clean: Flags.boolean({ char: 'c', description: 'remove old configuration before to create' }),
|
|
19
19
|
default: Flags.boolean({ char: 'd', description: 'reset to default values' }),
|
|
20
20
|
file: Flags.string({ char: 'f', description: 'use a file configuration custom' }),
|
|
21
|
+
nointeractive: Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
21
22
|
help: Flags.help({ char: 'h' }),
|
|
22
23
|
verbose: Flags.boolean({ char: 'v' })
|
|
23
24
|
};
|
|
@@ -86,7 +86,7 @@ export default class ExportPkg extends Command {
|
|
|
86
86
|
Utils.warning("manjaro PKGBUILD");
|
|
87
87
|
localPath = `/home/${this.user}/penguins-packs/manjaro/penguins-eggs`;
|
|
88
88
|
remotePath = this.Tu.config.remotePathPackages + "/manjaro";
|
|
89
|
-
filter = `penguins-eggs-10
|
|
89
|
+
filter = `penguins-eggs-10.?.*-*-any.pkg.tar.*`;
|
|
90
90
|
/**
|
|
91
91
|
* Arch
|
|
92
92
|
*/
|
|
@@ -95,7 +95,7 @@ export default class ExportPkg extends Command {
|
|
|
95
95
|
Utils.warning("aur PKGBUILD");
|
|
96
96
|
localPath = `/home/${this.user}/penguins-packs/aur/penguins-eggs`;
|
|
97
97
|
remotePath = this.Tu.config.remotePathPackages + "/aur";
|
|
98
|
-
filter = `penguins-eggs-10
|
|
98
|
+
filter = `penguins-eggs-10.?.*-*-any.pkg.tar.zst`;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Debian
|
|
@@ -103,13 +103,13 @@ export default class ExportPkg extends Command {
|
|
|
103
103
|
}
|
|
104
104
|
else if (familyId === "debian") {
|
|
105
105
|
Utils.warning("debian deb");
|
|
106
|
-
localPath = `/home/${this.user}/penguins-eggs/
|
|
106
|
+
localPath = `/home/${this.user}/penguins-eggs/dist`;
|
|
107
107
|
remotePath = this.Tu.config.remotePathPackages + "/debs";
|
|
108
108
|
let arch = Utils.uefiArch();
|
|
109
109
|
if (this.all) {
|
|
110
110
|
arch = '*';
|
|
111
111
|
}
|
|
112
|
-
filter = `penguins-eggs_10
|
|
112
|
+
filter = `penguins-eggs_10.?.*-*_${arch}.deb`;
|
|
113
113
|
/**
|
|
114
114
|
* fedora
|
|
115
115
|
*/
|
|
@@ -118,7 +118,7 @@ export default class ExportPkg extends Command {
|
|
|
118
118
|
Utils.warning("fedora rpm packages");
|
|
119
119
|
localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
|
|
120
120
|
remotePath = this.Tu.config.remotePathPackages + "/fedora";
|
|
121
|
-
filter = `penguins-eggs-10
|
|
121
|
+
filter = `penguins-eggs-10.?.*-*fedora.*.rpm`;
|
|
122
122
|
/**
|
|
123
123
|
* openmamba
|
|
124
124
|
*/
|
|
@@ -127,7 +127,7 @@ export default class ExportPkg extends Command {
|
|
|
127
127
|
Utils.warning("openmamba rpm packages");
|
|
128
128
|
localPath = `/usr/src/RPM/RPMS/x86_64`;
|
|
129
129
|
remotePath = this.Tu.config.remotePathPackages + "/openmamba";
|
|
130
|
-
filter = `penguins-eggs-10
|
|
130
|
+
filter = `penguins-eggs-10.?.*-*mamba.*.rpm`;
|
|
131
131
|
/**
|
|
132
132
|
* opensuse
|
|
133
133
|
*/
|
|
@@ -10,7 +10,8 @@ import Tools from '../../classes/tools.js';
|
|
|
10
10
|
import Utils from '../../classes/utils.js';
|
|
11
11
|
import { exec } from '../../lib/utils.js';
|
|
12
12
|
import os from 'node:os';
|
|
13
|
-
import
|
|
13
|
+
import { globSync } from 'glob';
|
|
14
|
+
import path from 'path';
|
|
14
15
|
// pjson
|
|
15
16
|
import { createRequire } from 'module';
|
|
16
17
|
const require = createRequire(import.meta.url);
|
|
@@ -51,32 +52,26 @@ export default class ExportTarballs extends Command {
|
|
|
51
52
|
const remoteMountpoint = `/tmp/eggs-${(Math.random() + 1).toString(36).slice(7)}`;
|
|
52
53
|
const localPath = `/home/${this.user}/penguins-eggs/dist/`;
|
|
53
54
|
const remotePath = `${this.Tu.config.remotePathPackages}/tarballs/`;
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// rename new tarball
|
|
60
|
-
cmd = `mv ${localPath}${filter} ${localPath}${tarName}`;
|
|
61
|
-
await exec(cmd, this.echo);
|
|
62
|
-
// check if new tarball exists
|
|
63
|
-
if (!fs.existsSync(`${localPath}${tarName}`)) {
|
|
64
|
-
console.log(`No ${tarName} exists!`);
|
|
55
|
+
const tarNamePattern = `penguins-eggs_${pjson.version}-*-linux-x64.tar.gz`;
|
|
56
|
+
const searchPattern = path.join(localPath, tarNamePattern);
|
|
57
|
+
const matchingFiles = globSync(searchPattern);
|
|
58
|
+
if (matchingFiles.length === 0) {
|
|
59
|
+
console.log(`No ${searchPattern} exists!`);
|
|
65
60
|
console.log(`Create it using: pnpm tarballs`);
|
|
66
61
|
process.exit(1);
|
|
67
62
|
}
|
|
68
|
-
cmd = `mkdir ${remoteMountpoint}\n`;
|
|
63
|
+
let cmd = `mkdir ${remoteMountpoint}\n`;
|
|
69
64
|
cmd += `sshfs ${this.Tu.config.remoteUser}@${this.Tu.config.remoteHost}:${remotePath} ${remoteMountpoint}\n`;
|
|
70
65
|
if (this.clean) {
|
|
71
|
-
cmd += `rm -f ${remoteMountpoint}
|
|
66
|
+
cmd += `rm -f ${remoteMountpoint}/${tarNamePattern}\n`;
|
|
72
67
|
}
|
|
73
|
-
cmd += `cp ${localPath}${
|
|
68
|
+
cmd += `cp ${localPath}${tarNamePattern} ${remoteMountpoint}/\n`;
|
|
74
69
|
cmd += 'sync\n';
|
|
75
70
|
cmd += `umount ${remoteMountpoint}\n`;
|
|
76
71
|
cmd += `rm -rf ${remoteMountpoint}\n`;
|
|
77
72
|
if (!this.verbose) {
|
|
78
73
|
if (this.clean) {
|
|
79
|
-
console.log(`remove: ${this.Tu.config.remoteUser}@${this.Tu.config.remoteHost}:${remotePath}
|
|
74
|
+
console.log(`remove: ${this.Tu.config.remoteUser}@${this.Tu.config.remoteHost}:${remotePath}/${tarNamePattern}`);
|
|
80
75
|
}
|
|
81
76
|
}
|
|
82
77
|
await exec(cmd, this.echo);
|
package/dist/commands/kill.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Command, Flags } from '@oclif/core';
|
|
9
9
|
import Settings from '../classes/settings.js';
|
|
10
10
|
import Utils from '../classes/utils.js';
|
|
11
|
-
import killMeSoftly from '../
|
|
11
|
+
import killMeSoftly from '../lib/kill_me_softly.js';
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
*/
|
package/dist/commands/love.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class Love extends Command {
|
|
|
15
15
|
static flags: {
|
|
16
16
|
help: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
17
17
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
};
|
|
19
20
|
run(): Promise<void>;
|
|
20
21
|
}
|
package/dist/commands/love.js
CHANGED
|
@@ -21,20 +21,34 @@ export default class Love extends Command {
|
|
|
21
21
|
static examples = ['eggs auto'];
|
|
22
22
|
static flags = {
|
|
23
23
|
help: Flags.help({ char: 'h' }),
|
|
24
|
-
verbose: Flags.boolean({ char: 'v' })
|
|
24
|
+
verbose: Flags.boolean({ char: 'v' }),
|
|
25
|
+
nointeractive: Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
25
26
|
};
|
|
26
27
|
async run() {
|
|
27
28
|
const { args, flags } = await this.parse(Love);
|
|
28
29
|
let verbose = false;
|
|
30
|
+
let flagVerbose = '';
|
|
29
31
|
if (flags.verbose) {
|
|
30
32
|
verbose = true;
|
|
33
|
+
flagVerbose = '--verbose';
|
|
34
|
+
}
|
|
35
|
+
let nointeractive = false;
|
|
36
|
+
let flagNointeractive = '';
|
|
37
|
+
if (flags.nointeractive) {
|
|
38
|
+
nointeractive = true;
|
|
39
|
+
flagNointeractive = '--nointeractive';
|
|
31
40
|
}
|
|
32
41
|
const echo = Utils.setEcho(verbose);
|
|
33
42
|
Utils.titles(this.id + ' ' + this.argv);
|
|
34
|
-
|
|
43
|
+
let cmdSudo = '';
|
|
35
44
|
if (process.getuid && process.getuid() === 0) {
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
cmdSudo = '';
|
|
46
|
+
}
|
|
47
|
+
else if (fs.existsSync('/usr/bin/sudo')) {
|
|
48
|
+
cmdSudo = 'sudo';
|
|
49
|
+
}
|
|
50
|
+
else if (fs.existsSync('/usr/bin/doas')) {
|
|
51
|
+
cmdSudo = 'doas';
|
|
38
52
|
}
|
|
39
53
|
let loveConf = '/etc/penguins-eggs.d/love.yaml';
|
|
40
54
|
if (!fs.existsSync(loveConf)) {
|
|
@@ -44,12 +58,12 @@ export default class Love extends Command {
|
|
|
44
58
|
console.log('The following commands will be executed:');
|
|
45
59
|
console.log();
|
|
46
60
|
for (const cmd of cmds) {
|
|
47
|
-
console.log(`- ${cmd}`);
|
|
61
|
+
console.log(`- ${cmdSudo} ${cmd} ${flagVerbose} ${flagNointeractive}`);
|
|
48
62
|
}
|
|
49
63
|
console.log();
|
|
50
|
-
if (await Utils.customConfirm()) {
|
|
64
|
+
if (nointeractive || await Utils.customConfirm()) {
|
|
51
65
|
for (const cmd of cmds) {
|
|
52
|
-
await exec(cmd);
|
|
66
|
+
await exec(`${cmdSudo} ${cmd} ${flagVerbose} ${flagNointeractive}`);
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
69
|
else {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/commands/cuckoo.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
|
+
import { Command } from '@oclif/core';
|
|
9
|
+
export default class Pods extends Command {
|
|
10
|
+
static args: {
|
|
11
|
+
distro: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
static description: string;
|
|
14
|
+
static examples: string[];
|
|
15
|
+
static flags: {
|
|
16
|
+
help: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/commands/cuckoo.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
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
9
|
+
import fs from 'fs';
|
|
10
|
+
import Utils from '../classes/utils.js';
|
|
11
|
+
import { exec } from '../lib/utils.js';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import { execSync } from 'node:child_process';
|
|
14
|
+
// _dirname
|
|
15
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
16
|
+
export default class Pods extends Command {
|
|
17
|
+
static args = {
|
|
18
|
+
distro: Args.string({ description: 'distro to build', name: 'distro', required: false })
|
|
19
|
+
};
|
|
20
|
+
static description = 'eggs pods: build ISOs from containers';
|
|
21
|
+
static examples = [
|
|
22
|
+
'eggs pods archlinux',
|
|
23
|
+
'eggs pods debian',
|
|
24
|
+
'eggs pods ubuntu',
|
|
25
|
+
];
|
|
26
|
+
static flags = {
|
|
27
|
+
help: Flags.help({ char: 'h' })
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
async run() {
|
|
33
|
+
Utils.titles(this.id + ' ' + this.argv);
|
|
34
|
+
const { args, flags } = await this.parse(Pods);
|
|
35
|
+
if (!isPodmanInstalledSync()) {
|
|
36
|
+
console.log('You need to install podmand to use this command');
|
|
37
|
+
process.exit(0);
|
|
38
|
+
}
|
|
39
|
+
if (process.getuid && process.getuid() === 0) {
|
|
40
|
+
Utils.warning('You must use eggs pods without sudo');
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
// mode
|
|
44
|
+
let pathPods = path.resolve(__dirname, `../../pods`);
|
|
45
|
+
const userHome = `/home/${await Utils.getPrimaryUser()}/`;
|
|
46
|
+
if (Utils.isSources()) {
|
|
47
|
+
console.log("Using eggs pods from sources.\nThe pods directory of the source will be used ");
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
console.log("Using eggs pods from package.");
|
|
51
|
+
if (!fs.existsSync(`${userHome}/pods`)) {
|
|
52
|
+
console.log(`The pods directory will be created in the user home ${userHome}, do you want to continue?`);
|
|
53
|
+
if (await Utils.customConfirm()) {
|
|
54
|
+
console.log(`Creating a pods folder under ${userHome}`);
|
|
55
|
+
await exec(`cp -r ${Utils.rootPenguin()}/pods ${userHome}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
pathPods = path.resolve(`${userHome}/pods`);
|
|
59
|
+
}
|
|
60
|
+
console.log(`Using ${pathPods}`);
|
|
61
|
+
let distro = 'debian';
|
|
62
|
+
if (this.argv['0'] !== undefined) {
|
|
63
|
+
distro = this.argv['0'];
|
|
64
|
+
}
|
|
65
|
+
let cmd = `${pathPods}/${distro}.sh`;
|
|
66
|
+
if (fs.existsSync(cmd)) {
|
|
67
|
+
console.log(`We are building a egg from a ${distro} container`);
|
|
68
|
+
if (!await Utils.customConfirm()) {
|
|
69
|
+
process.exit(0);
|
|
70
|
+
}
|
|
71
|
+
await exec(cmd);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
console.log(`No script: ${cmd} fpr ${distro} container`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
function isPodmanInstalledSync() {
|
|
83
|
+
let podmanInstalled = false;
|
|
84
|
+
try {
|
|
85
|
+
execSync('podman --version', { stdio: 'ignore' });
|
|
86
|
+
podmanInstalled = true;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error('Podman does not appear to be installed or is not in the PATH.\n');
|
|
90
|
+
}
|
|
91
|
+
return podmanInstalled;
|
|
92
|
+
}
|
|
@@ -16,6 +16,7 @@ export default class Produce extends Command {
|
|
|
16
16
|
cryptedclone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
excludes: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
help: import("@oclif/core/interfaces").BooleanFlag<void>;
|
|
19
|
+
kernel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
links: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
max: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
22
|
noicon: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
package/dist/commands/produce.js
CHANGED
|
@@ -37,6 +37,7 @@ export default class Produce extends Command {
|
|
|
37
37
|
cryptedclone: Flags.boolean({ char: 'C', description: 'crypted clone' }),
|
|
38
38
|
excludes: Flags.string({ description: 'use: static, homes, home', multiple: true }),
|
|
39
39
|
help: Flags.help({ char: 'h' }),
|
|
40
|
+
kernel: Flags.string({ char: 'k', description: 'kernel version' }),
|
|
40
41
|
links: Flags.string({ description: 'desktop links', multiple: true }),
|
|
41
42
|
max: Flags.boolean({ char: 'm', description: 'max compression: xz -Xbcj ...' }),
|
|
42
43
|
noicon: Flags.boolean({ char: 'N', description: 'no icon eggs on desktop' }),
|
|
@@ -145,6 +146,25 @@ export default class Produce extends Command {
|
|
|
145
146
|
const { noicon } = flags;
|
|
146
147
|
// if clone or cryptedclone unsecure = true
|
|
147
148
|
const unsecure = flags.unsecure || clone || cryptedclone;
|
|
149
|
+
let { kernel } = flags;
|
|
150
|
+
if (kernel === undefined) {
|
|
151
|
+
kernel = '';
|
|
152
|
+
}
|
|
153
|
+
if (kernel !== '') {
|
|
154
|
+
if (!fs.existsSync(`/usr/lib/modules/${kernel}`)) {
|
|
155
|
+
let kernelModules = `/usr/lib/modules/`;
|
|
156
|
+
if (!fs.existsSync(kernelModules)) {
|
|
157
|
+
kernelModules = `/lib/modules/`;
|
|
158
|
+
}
|
|
159
|
+
let kernels = fs.readdirSync(kernelModules);
|
|
160
|
+
console.log("modules available:");
|
|
161
|
+
for (const k of kernels) {
|
|
162
|
+
console.log(`- ${k}`);
|
|
163
|
+
}
|
|
164
|
+
console.log(`\nNo available modules for kernel version "${kernel}" in /usr/lib/modules/`);
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
148
168
|
/**
|
|
149
169
|
* theme: if not defined will use eggs
|
|
150
170
|
*/
|
|
@@ -190,7 +210,7 @@ export default class Produce extends Command {
|
|
|
190
210
|
Utils.warning(message);
|
|
191
211
|
}
|
|
192
212
|
if (await ovary.fertilization(prefix, basename, theme, compression, !nointeractive)) {
|
|
193
|
-
await ovary.produce(clone, cryptedclone, scriptOnly, yolkRenew, release, myAddons, myLinks, excludes, nointeractive, noicon, unsecure, verbose);
|
|
213
|
+
await ovary.produce(kernel, clone, cryptedclone, scriptOnly, yolkRenew, release, myAddons, myLinks, excludes, nointeractive, noicon, unsecure, verbose);
|
|
194
214
|
ovary.finished(scriptOnly);
|
|
195
215
|
}
|
|
196
216
|
}
|
package/dist/commands/update.js
CHANGED
|
@@ -39,7 +39,7 @@ export default class Update extends Command {
|
|
|
39
39
|
if (Utils.isSources()) {
|
|
40
40
|
Utils.warning(`You are on penguins-eggs v. ${Utils.getPackageVersion()} from sources`);
|
|
41
41
|
}
|
|
42
|
-
else if (Utils.
|
|
42
|
+
else if (Utils.isPackage()) {
|
|
43
43
|
Utils.warning(`You are on eggs-${Utils.getPackageVersion()} installed as package`);
|
|
44
44
|
}
|
|
45
45
|
await this.chooseUpdate();
|
|
@@ -117,7 +117,7 @@ export default class Update extends Command {
|
|
|
117
117
|
await Tu.loadSettings();
|
|
118
118
|
Utils.warning('import from lan');
|
|
119
119
|
if (this.distro.familyId === "debian") {
|
|
120
|
-
const filterDeb = `penguins-eggs_10
|
|
120
|
+
const filterDeb = `penguins-eggs_10.?.*-*_${Utils.uefiArch()}.deb`;
|
|
121
121
|
const cmd = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/debs/${filterDeb} /tmp`;
|
|
122
122
|
await exec(cmd, { capture: true, echo: true });
|
|
123
123
|
if (await Utils.customConfirm(`Want to install ${filterDeb}`)) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,54 +1,8 @@
|
|
|
1
|
-
import { Errors, Interfaces } from '@oclif/core';
|
|
2
|
-
type CaptureOptions = {
|
|
3
|
-
print?: boolean;
|
|
4
|
-
stripAnsi?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type CaptureResult<T> = {
|
|
7
|
-
error?: Error & Partial<Errors.CLIError>;
|
|
8
|
-
result?: T;
|
|
9
|
-
stderr: string;
|
|
10
|
-
stdout: string;
|
|
11
|
-
};
|
|
12
1
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
19
|
-
* - error: Error object if the function throws an error
|
|
20
|
-
* - result: Result of the function if it returns a value and succeeds
|
|
21
|
-
* - stderr: Captured stderr output
|
|
22
|
-
* - stdout: Captured stdout output
|
|
2
|
+
* ./src/index.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
23
7
|
*/
|
|
24
|
-
export
|
|
25
|
-
/**
|
|
26
|
-
* Capture the stderr and stdout output of a command in your CLI
|
|
27
|
-
* @param args Command arguments, e.g. `['my:command', '--flag']` or `'my:command --flag'`
|
|
28
|
-
* @param loadOpts options for loading oclif `Config`
|
|
29
|
-
* @param captureOpts options for capturing the output
|
|
30
|
-
* - print: Whether to print the output to the console
|
|
31
|
-
* - stripAnsi: Whether to strip ANSI codes from the output
|
|
32
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
33
|
-
* - error: Error object if the command throws an error
|
|
34
|
-
* - result: Result of the command if it returns a value and succeeds
|
|
35
|
-
* - stderr: Captured stderr output
|
|
36
|
-
* - stdout: Captured stdout output
|
|
37
|
-
*/
|
|
38
|
-
export declare function runCommand<T>(args: string | string[], loadOpts?: Interfaces.LoadOptions, captureOpts?: CaptureOptions): Promise<CaptureResult<T>>;
|
|
39
|
-
/**
|
|
40
|
-
* Capture the stderr and stdout output of a hook in your CLI
|
|
41
|
-
* @param hook Hook name
|
|
42
|
-
* @param options options to pass to the hook
|
|
43
|
-
* @param loadOpts options for loading oclif `Config`
|
|
44
|
-
* @param captureOpts options for capturing the output
|
|
45
|
-
* - print: Whether to print the output to the console
|
|
46
|
-
* - stripAnsi: Whether to strip ANSI codes from the output
|
|
47
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
48
|
-
* - error: Error object if the hook throws an error
|
|
49
|
-
* - result: Result of the hook if it returns a value and succeeds
|
|
50
|
-
* - stderr: Captured stderr output
|
|
51
|
-
* - stdout: Captured stdout output
|
|
52
|
-
*/
|
|
53
|
-
export declare function runHook<T>(hook: string, options: Record<string, unknown>, loadOpts?: Interfaces.LoadOptions, captureOpts?: CaptureOptions): Promise<CaptureResult<T>>;
|
|
54
|
-
export {};
|
|
8
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
CHANGED
|
@@ -1,147 +1,8 @@
|
|
|
1
|
-
import { Config, Errors, run } from '@oclif/core';
|
|
2
|
-
import makeDebug from 'debug';
|
|
3
|
-
import { dirname } from 'node:path';
|
|
4
|
-
const debug = makeDebug('oclif-test');
|
|
5
|
-
function traverseFilePathUntil(filename, predicate) {
|
|
6
|
-
let current = filename;
|
|
7
|
-
while (!predicate(current)) {
|
|
8
|
-
current = dirname(current);
|
|
9
|
-
}
|
|
10
|
-
return current;
|
|
11
|
-
}
|
|
12
|
-
function findRoot() {
|
|
13
|
-
return (process.env.OCLIF_TEST_ROOT ??
|
|
14
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
15
|
-
Object.values(require.cache).find((m) => m?.children.includes(module))?.filename ??
|
|
16
|
-
traverseFilePathUntil(
|
|
17
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
18
|
-
require.main?.path ?? module.path, (p) => !(p.includes('node_modules') || p.includes('.pnpm') || p.includes('.yarn'))));
|
|
19
|
-
}
|
|
20
|
-
function makeLoadOptions(loadOpts) {
|
|
21
|
-
return loadOpts ?? { root: findRoot() };
|
|
22
|
-
}
|
|
23
1
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* splitString('foo bar --name="foo bar"') // ['foo bar', '--name=foo bar']
|
|
30
|
-
* splitString('foo bar --name=foo bar') // ['foo bar', '--name=foo', 'bar']
|
|
31
|
-
*
|
|
32
|
-
* @param str input string
|
|
33
|
-
* @returns array of strings with quotes removed
|
|
2
|
+
* ./src/index.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
34
7
|
*/
|
|
35
|
-
|
|
36
|
-
return (str.match(/(?:[^\s"]+|"[^"]*")+/g) ?? []).map((s) => s.replaceAll(/^"|"$|(?<==)"/g, ''));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Capture the stderr and stdout output of a function
|
|
40
|
-
* @param fn async function to run
|
|
41
|
-
* @param opts options
|
|
42
|
-
* - print: Whether to print the output to the console
|
|
43
|
-
* - stripAnsi: Whether to strip ANSI codes from the output
|
|
44
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
45
|
-
* - error: Error object if the function throws an error
|
|
46
|
-
* - result: Result of the function if it returns a value and succeeds
|
|
47
|
-
* - stderr: Captured stderr output
|
|
48
|
-
* - stdout: Captured stdout output
|
|
49
|
-
*/
|
|
50
|
-
export async function captureOutput(fn, opts) {
|
|
51
|
-
const print = opts?.print ?? false;
|
|
52
|
-
const stripAnsi = opts?.stripAnsi ?? true;
|
|
53
|
-
const originals = {
|
|
54
|
-
NODE_ENV: process.env.NODE_ENV,
|
|
55
|
-
stderr: process.stderr.write,
|
|
56
|
-
stdout: process.stdout.write,
|
|
57
|
-
};
|
|
58
|
-
const output = {
|
|
59
|
-
stderr: [],
|
|
60
|
-
stdout: [],
|
|
61
|
-
};
|
|
62
|
-
//const toString = (str: Uint8Array | string): string => (stripAnsi ? ansis.strip(str.toString()) : str.toString())
|
|
63
|
-
const toString = (str) => (stripAnsi ? str.toString() : str.toString());
|
|
64
|
-
const getStderr = () => output.stderr.map((b) => toString(b)).join('');
|
|
65
|
-
const getStdout = () => output.stdout.map((b) => toString(b)).join('');
|
|
66
|
-
const mock = (std) => (str, encoding, cb) => {
|
|
67
|
-
output[std].push(str);
|
|
68
|
-
if (print) {
|
|
69
|
-
if (encoding !== null && typeof encoding === 'function') {
|
|
70
|
-
cb = encoding;
|
|
71
|
-
encoding = undefined;
|
|
72
|
-
}
|
|
73
|
-
originals[std].apply(process[std], [str, encoding, cb]);
|
|
74
|
-
}
|
|
75
|
-
else if (typeof cb === 'function')
|
|
76
|
-
cb();
|
|
77
|
-
return true;
|
|
78
|
-
};
|
|
79
|
-
process.stdout.write = mock('stdout');
|
|
80
|
-
process.stderr.write = mock('stderr');
|
|
81
|
-
process.env.NODE_ENV = 'test';
|
|
82
|
-
try {
|
|
83
|
-
const result = await fn();
|
|
84
|
-
return {
|
|
85
|
-
result: result,
|
|
86
|
-
stderr: getStderr(),
|
|
87
|
-
stdout: getStdout(),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
return {
|
|
92
|
-
...(error instanceof Errors.CLIError && { error: { ...error, message: toString(error.message) } }),
|
|
93
|
-
...(error instanceof Error && { error: { ...error, message: toString(error.message) } }),
|
|
94
|
-
stderr: getStderr(),
|
|
95
|
-
stdout: getStdout(),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
finally {
|
|
99
|
-
process.stderr.write = originals.stderr;
|
|
100
|
-
process.stdout.write = originals.stdout;
|
|
101
|
-
process.env.NODE_ENV = originals.NODE_ENV;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Capture the stderr and stdout output of a command in your CLI
|
|
106
|
-
* @param args Command arguments, e.g. `['my:command', '--flag']` or `'my:command --flag'`
|
|
107
|
-
* @param loadOpts options for loading oclif `Config`
|
|
108
|
-
* @param captureOpts options for capturing the output
|
|
109
|
-
* - print: Whether to print the output to the console
|
|
110
|
-
* - stripAnsi: Whether to strip ANSI codes from the output
|
|
111
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
112
|
-
* - error: Error object if the command throws an error
|
|
113
|
-
* - result: Result of the command if it returns a value and succeeds
|
|
114
|
-
* - stderr: Captured stderr output
|
|
115
|
-
* - stdout: Captured stdout output
|
|
116
|
-
*/
|
|
117
|
-
export async function runCommand(args, loadOpts, captureOpts) {
|
|
118
|
-
const loadOptions = makeLoadOptions(loadOpts);
|
|
119
|
-
const argsArray = splitString((Array.isArray(args) ? args : [args]).join(' '));
|
|
120
|
-
const [id, ...rest] = argsArray;
|
|
121
|
-
const finalArgs = id === '.' ? rest : argsArray;
|
|
122
|
-
debug('loadOpts: %O', loadOptions);
|
|
123
|
-
debug('args: %O', finalArgs);
|
|
124
|
-
return captureOutput(async () => run(finalArgs, loadOptions), captureOpts);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Capture the stderr and stdout output of a hook in your CLI
|
|
128
|
-
* @param hook Hook name
|
|
129
|
-
* @param options options to pass to the hook
|
|
130
|
-
* @param loadOpts options for loading oclif `Config`
|
|
131
|
-
* @param captureOpts options for capturing the output
|
|
132
|
-
* - print: Whether to print the output to the console
|
|
133
|
-
* - stripAnsi: Whether to strip ANSI codes from the output
|
|
134
|
-
* @returns {Promise<CaptureResult<T>>} Captured output
|
|
135
|
-
* - error: Error object if the hook throws an error
|
|
136
|
-
* - result: Result of the hook if it returns a value and succeeds
|
|
137
|
-
* - stderr: Captured stderr output
|
|
138
|
-
* - stdout: Captured stdout output
|
|
139
|
-
*/
|
|
140
|
-
export async function runHook(hook, options, loadOpts, captureOpts) {
|
|
141
|
-
const loadOptions = makeLoadOptions(loadOpts);
|
|
142
|
-
debug('loadOpts: %O', loadOptions);
|
|
143
|
-
return captureOutput(async () => {
|
|
144
|
-
const config = await Config.load(loadOptions);
|
|
145
|
-
return config.runHook(hook, options);
|
|
146
|
-
}, captureOpts);
|
|
147
|
-
}
|
|
8
|
+
export { run } from '@oclif/core';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
11
|
export declare enum InstallationMode {
|
|
12
|
-
|
|
12
|
+
EraseDisk = "Erase disk",
|
|
13
13
|
Luks = "Erase disk/Encrypted",
|
|
14
14
|
Replace = "Replace partition"
|
|
15
15
|
}
|
|
@@ -22,3 +22,16 @@ export declare enum SwapChoice {
|
|
|
22
22
|
Suspend = "suspend",
|
|
23
23
|
File = "file"
|
|
24
24
|
}
|
|
25
|
+
export declare enum Bios {
|
|
26
|
+
Legacy = "legacy",
|
|
27
|
+
EFI = "efi"
|
|
28
|
+
}
|
|
29
|
+
export declare enum FsType {
|
|
30
|
+
ext2 = "ext2",
|
|
31
|
+
ext3 = "ext3",
|
|
32
|
+
ext4 = "ext4",
|
|
33
|
+
btrfs = "btrfs",
|
|
34
|
+
xfs = "xfs",
|
|
35
|
+
zfs = "zfs",
|
|
36
|
+
ntfs = "ntfs"
|
|
37
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export var InstallationMode;
|
|
12
12
|
(function (InstallationMode) {
|
|
13
|
-
InstallationMode["
|
|
13
|
+
InstallationMode["EraseDisk"] = "Erase disk";
|
|
14
14
|
InstallationMode["Luks"] = "Erase disk/Encrypted";
|
|
15
15
|
InstallationMode["Replace"] = "Replace partition";
|
|
16
16
|
})(InstallationMode || (InstallationMode = {}));
|
|
@@ -24,3 +24,18 @@ export var SwapChoice;
|
|
|
24
24
|
SwapChoice["Suspend"] = "suspend";
|
|
25
25
|
SwapChoice["File"] = "file";
|
|
26
26
|
})(SwapChoice || (SwapChoice = {}));
|
|
27
|
+
export var Bios;
|
|
28
|
+
(function (Bios) {
|
|
29
|
+
Bios["Legacy"] = "legacy";
|
|
30
|
+
Bios["EFI"] = "efi";
|
|
31
|
+
})(Bios || (Bios = {}));
|
|
32
|
+
export var FsType;
|
|
33
|
+
(function (FsType) {
|
|
34
|
+
FsType["ext2"] = "ext2";
|
|
35
|
+
FsType["ext3"] = "ext3";
|
|
36
|
+
FsType["ext4"] = "ext4";
|
|
37
|
+
FsType["btrfs"] = "btrfs";
|
|
38
|
+
FsType["xfs"] = "xfs";
|
|
39
|
+
FsType["zfs"] = "zfs";
|
|
40
|
+
FsType["ntfs"] = "ntfs";
|
|
41
|
+
})(FsType || (FsType = {}));
|