penguins-eggs 10.0.19 → 10.0.21

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/scripts/eggs.bash CHANGED
@@ -23,7 +23,7 @@ install --btrfs --chroot --crypted --domain --halt --help --ip --nointeractive -
23
23
  krill --btrfs --chroot --crypted --domain --halt --help --ip --nointeractive --none --pve --random --small --suspend --unattended --verbose
24
24
  kill --help --isos --nointeractive --verbose
25
25
  mom --help
26
- produce --addons --basename --clone --cryptedclone --excludes --help --links --max --noicon --nointeractive --pendrive --prefix --release --script --standard --theme --unsecure --verbose --udf --yolk
26
+ produce --addons --basename --clone --cryptedclone --excludes --help --links --max --noicon --nointeractive --pendrive --prefix --release --script --standard --theme --unsecure --verbose --yolk
27
27
  status --help --verbose
28
28
  syncfrom --delete --file --help --rootdir --verbose
29
29
  syncto --excludes --file --help --verbose
@@ -1,41 +0,0 @@
1
- /**
2
- * ./src/classes/initrd.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 { IInitrd } from '../interfaces/index.js';
9
- /**
10
- * initrd
11
- * Controlla e rimuove, se necessario cryptroot, resume
12
- * cryptsetup
13
- */
14
- export default class Initrd {
15
- compression: string;
16
- fsLive: string;
17
- initrdDest: string;
18
- initrdSrc: string;
19
- workDir: string;
20
- constructor(initrdSrc?: string, initrdDest?: string, fsLive?: string);
21
- /**
22
- * Check initrd for cryptroot, resume, cryptsetup.
23
- */
24
- check(): IInitrd;
25
- /**
26
- * clean
27
- */
28
- clean(): void;
29
- /**
30
- * extract
31
- */
32
- extract(initrd?: string, verbose?: boolean): Promise<void>;
33
- /**
34
- * edit
35
- */
36
- private edit;
37
- /**
38
- * rebuild
39
- */
40
- private rebuild;
41
- }
@@ -1,152 +0,0 @@
1
- /**
2
- * ./src/classes/initrd.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
- /**
9
- * Schema from "refractasnapshot-10.2.10 (20191218)"
10
- * Copyright: fsmithred@gmail.com 2011-2019
11
- */
12
- // packages
13
- import fs from 'node:fs';
14
- import shx from 'shelljs';
15
- /**
16
- * initrd
17
- * Controlla e rimuove, se necessario cryptroot, resume
18
- * cryptsetup
19
- */
20
- export default class Initrd {
21
- compression = 'gzip';
22
- fsLive = '/home/eggs/ovarium/filesystem';
23
- initrdDest = '/home/eggs/ovarium/iso/live';
24
- initrdSrc = '/initrd.img';
25
- workDir = '/tmp/initrd-extracted';
26
- constructor(initrdSrc = '/initrd.img', initrdDest = '/home/eggs/mnt/ovarium/iso/live/initrd.img', fsLive = '/home/eggs/ovarium/filesystem') {
27
- this.initrdSrc = initrdSrc;
28
- this.initrdDest = initrdDest;
29
- this.fsLive = fsLive;
30
- console.log('sorgente: ' + this.initrdSrc);
31
- console.log('destinazione: ' + this.initrdDest);
32
- console.log('fsLive: ' + this.fsLive);
33
- }
34
- /**
35
- * Check initrd for cryptroot, resume, cryptsetup.
36
- */
37
- check() {
38
- const initrd = {};
39
- const cmdCheck = `lsinitramfs ${this.initrdSrc} | egrep 'conf/conf.d/cryptroot|cryptroot/crypttab|conf/conf.d/resume|conf/conf.d/zz-resume-auto'`;
40
- const check = shx.exec(cmdCheck, { silent: true });
41
- if (check.includes('conf/conf.d/cryptroot')) {
42
- initrd.cryptoroot = true;
43
- }
44
- if (check.includes('cryptroot/crypttab')) {
45
- initrd.crypttab = true;
46
- }
47
- if (check.includes('conf/conf.d/resume')) {
48
- initrd.resume = true;
49
- }
50
- if (check.includes('conf/conf.d/zz-resume-auto')) {
51
- initrd.zz_resume_auto = true;
52
- }
53
- return initrd;
54
- }
55
- /**
56
- * clean
57
- */
58
- clean() {
59
- this.extract();
60
- this.edit();
61
- this.rebuild();
62
- }
63
- /**
64
- * extract
65
- */
66
- async extract(initrd = '/initrd.img', verbose = false) {
67
- let echo = { echo: false, ignore: false };
68
- if (verbose) {
69
- echo = { echo: true, ignore: false };
70
- }
71
- const savedState = process.cwd();
72
- // cancello e ricreo la cartella di lavore
73
- if (fs.existsSync(this.workDir)) {
74
- shx.exec(`rm ${this.workDir} -rf`);
75
- }
76
- shx.mkdir(this.workDir);
77
- process.chdir(this.workDir);
78
- // Verifico il tipo di compressione
79
- const cmd = `file -L ${this.initrdSrc} | egrep -o 'gzip compressed|XZ compressed|cpio archive'`;
80
- const compressionShell = shx.exec(cmd).trimStart().trimEnd();
81
- switch (compressionShell) {
82
- case 'gzip compressed': {
83
- break;
84
- }
85
- case 'xz compressed': {
86
- this.compression = 'xz';
87
- break;
88
- }
89
- case 'cpio compressed': {
90
- this.compression = 'cpio';
91
- break;
92
- }
93
- // No default
94
- }
95
- // Estratto initrd nella cartella di lavoro
96
- console.log('compression: [' + this.compression + ']');
97
- if ((this.compression = 'gzip')) {
98
- shx.exec(`zcat ${initrd} | cpio -i`);
99
- }
100
- else if (this.compression === 'xz') {
101
- shx.exec(`xzcat ${initrd} | cpio -d -i -m`);
102
- }
103
- else if (this.compression === 'cpio') {
104
- shx.exec(`(cpio -i ; zcat | cpio -i) < ${initrd}`);
105
- }
106
- process.chdir(savedState);
107
- }
108
- /**
109
- * edit
110
- */
111
- edit(verbose = true) {
112
- // Analizzo per cryptroot
113
- if (fs.existsSync(`${this.workDir}/conf/conf.d/cryptroot`)) {
114
- console.log('Removing cryptroot');
115
- shx.exec(`rm -f ${this.workDir}/conf/conf.d/cryptroot`);
116
- }
117
- else if (fs.existsSync(`${this.workDir}/cryptroot/crypttab`)) {
118
- console.log('Removing crypttab');
119
- shx.exec(`rm -f ${this.workDir}/cryptroot/crypttab`);
120
- }
121
- // Analizzo per resume
122
- if (fs.existsSync(`${this.workDir}/conf/conf.d/resume`)) {
123
- console.log('Removing resume');
124
- shx.exec(`rm -f ${this.workDir}/conf/conf.d/resume`);
125
- shx.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
126
- }
127
- else if (`${this.workDir}/conf/conf.d/zz-resume-auto`) {
128
- shx.exec(`rm -f ${this.workDir}/rm -f conf/conf.d/zz-resume-auto`);
129
- shx.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
130
- }
131
- }
132
- /**
133
- * rebuild
134
- */
135
- rebuild(initrd = '/initrd.img', verbose = true) {
136
- let echo = { echo: false, ignore: false };
137
- if (verbose) {
138
- echo = { echo: true, ignore: false };
139
- }
140
- const savedState = process.cwd();
141
- console.log('Compression: ' + this.compression);
142
- process.chdir(this.workDir);
143
- console.log('work_dir: ' + this.workDir);
144
- if (this.compression === 'gzip') {
145
- shx.exec(`find . -print0 | cpio -0 -H newc -o | gzip -c > ${this.initrdDest}`);
146
- }
147
- else if (this.compression === 'xz') {
148
- shx.exec(`find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ${this.initrdDest}`);
149
- }
150
- process.chdir(savedState);
151
- }
152
- }
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- xrandr --output Virtual-0 --auto
3
- xrandr --output Virtual-1 --auto
4
- xrandr --output Virtual-2 --auto
5
- xrandr --output Virtual-3 --auto