penguins-eggs 25.10.6 → 25.10.19
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 +51 -145
- package/README.md +3 -829
- package/addons/eggs/theme/livecd/isolinux.main.simple.cfg +3 -3
- package/conf/distros/trixie/calamares/modules/shellprocess@boot_deploy.yml +3 -4
- package/conf/love.yaml +1 -1
- package/dist/classes/distro.js +9 -2
- package/dist/classes/diversions.d.ts +1 -1
- package/dist/classes/diversions.js +27 -8
- package/dist/classes/incubation/incubator.d/archlinux.js +1 -0
- package/dist/classes/incubation/incubator.d/trixie.js +7 -10
- package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -1
- package/dist/classes/ovary.d/edit-live-fs.js +1 -7
- package/dist/classes/ovary.d/fertilization.js +1 -0
- package/dist/classes/ovary.d/finished.js +1 -5
- package/dist/classes/ovary.d/initrd.d.ts +1 -1
- package/dist/classes/ovary.d/initrd.js +17 -19
- package/dist/classes/ovary.d/live-create-structure.js +1 -4
- package/dist/classes/ovary.d/luks-get-password.d.ts +12 -0
- package/dist/classes/ovary.d/luks-get-password.js +57 -0
- package/dist/classes/ovary.d/luks-home-support.d.ts +12 -0
- package/dist/classes/ovary.d/luks-home-support.js +75 -0
- package/dist/classes/ovary.d/luks-home.d.ts +15 -0
- package/dist/classes/ovary.d/luks-home.js +140 -0
- package/dist/classes/ovary.d/luks-root-bootstrap-builder.d.ts +11 -0
- package/dist/classes/ovary.d/luks-root-bootstrap-builder.js +45 -0
- package/dist/classes/ovary.d/luks-root.d.ts +15 -0
- package/dist/classes/ovary.d/luks-root.js +126 -0
- package/dist/classes/ovary.d/make-efi.js +1 -1
- package/dist/classes/ovary.d/make-squashfs.d.ts +1 -1
- package/dist/classes/ovary.d/make-squashfs.js +7 -3
- package/dist/classes/ovary.d/produce.d.ts +3 -3
- package/dist/classes/ovary.d/produce.js +76 -48
- package/dist/classes/ovary.d/syslinux.js +1 -1
- package/dist/classes/ovary.d/xorriso-command.d.ts +2 -2
- package/dist/classes/ovary.d/xorriso-command.js +27 -29
- package/dist/classes/ovary.d.ts +35 -16
- package/dist/classes/ovary.js +42 -16
- package/dist/classes/utils.d.ts +1 -0
- package/dist/classes/utils.js +3 -0
- package/dist/commands/config.d.ts +1 -1
- package/dist/commands/config.js +2 -2
- package/dist/commands/love.d.ts +3 -0
- package/dist/commands/love.js +40 -2
- package/dist/commands/produce.d.ts +3 -2
- package/dist/commands/produce.js +14 -17
- package/dist/commands/tools/{ppa.d.ts → repo.d.ts} +2 -2
- package/dist/commands/tools/{ppa.js → repo.js} +69 -67
- package/dracut/create-symlink +71 -0
- package/dracut/dracut-log.txt +3 -0
- package/dracut/dracut.conf.d/50-live.conf +24 -6
- package/dracut/dracut.conf.d/README.md +10 -0
- package/dracut/export +4 -0
- package/dracut/export-dracut-analysis +51 -0
- package/dracut/export-dracut-log +2 -0
- package/dracut/mkisofs +10 -0
- package/dracut/modules.d/00debug-shell/debug-hook.sh +13 -0
- package/dracut/modules.d/00debug-shell/module-setup.sh +20 -0
- package/dracut/modules.d/90block/README.md +7 -0
- package/dracut/modules.d/90block/block-cmdline.sh +3 -0
- package/dracut/modules.d/90block/module-setup.sh +15 -0
- package/dracut/modules.d/95iso-scan/README.md +3 -0
- package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +12 -0
- package/dracut/modules.d/95iso-scan/iso-scan.sh +92 -0
- package/dracut/modules.d/95iso-scan/module-setup.sh +18 -0
- package/dracut/modules.d/95luks-loop/README.md +9 -0
- package/dracut/modules.d/95luks-loop/luks-loop.sh +90 -0
- package/dracut/modules.d/95luks-loop/module-setup.sh +17 -0
- package/dracut/renew-initramfs +17 -0
- package/dracut/sbin2bin +10 -0
- package/dracut/update-dracut-conf-d +2 -0
- package/dracut/update-dracut-modules +62 -0
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +7 -661
- package/package.json +9 -8
- package/perrisbrewery/template/dependencies.yaml +6 -5
- package/scripts/_eggs +16 -31
- package/scripts/eggs.bash +4 -6
- package/scripts/luks-root-bootstrap-create.sh +235 -0
- package/scripts/luks-root-unlock.sh +172 -0
- package/scripts/mount-encrypted-home.sh +223 -0
- package/dist/commands/syncfrom.d.ts +0 -45
- package/dist/commands/syncfrom.js +0 -152
- package/dist/commands/syncto.d.ts +0 -40
- package/dist/commands/syncto.js +0 -175
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ./src/commands/tools/
|
|
2
|
+
* ./src/commands/tools/repo.ts
|
|
3
3
|
* penguins-eggs v.25.7.x / ecmascript 2020
|
|
4
4
|
* author: Piero Proietti
|
|
5
5
|
* email: piero.proietti@gmail.com
|
|
@@ -17,43 +17,43 @@ import Distro from '../../classes/distro.js';
|
|
|
17
17
|
import Utils from '../../classes/utils.js';
|
|
18
18
|
import { exec } from '../../lib/utils.js';
|
|
19
19
|
import Diversions from '../../classes/diversions.js';
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
let
|
|
20
|
+
const repoKeyUrl = 'https://pieroproietti.github.io/penguins-eggs-repo/KEY.asc';
|
|
21
|
+
const repoKeyPath = '/usr/share/keyrings/penguins-eggs-repo.gpg';
|
|
22
|
+
const repoUrl = `https://pieroproietti.github.io/penguins-eggs-repo`;
|
|
23
|
+
let repoPath = '/etc/apt/sources.list.d/penguins-eggs-repo'; // Base path without extension
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
|
-
export default class
|
|
28
|
-
static description = 'add/remove repo';
|
|
29
|
-
static examples = ['sudo eggs tools
|
|
27
|
+
export default class Repo extends Command {
|
|
28
|
+
static description = 'add/remove penguins-eggs-repo';
|
|
29
|
+
static examples = ['sudo eggs tools repo --add', 'sudo eggs tools repo --remove'];
|
|
30
30
|
static flags = {
|
|
31
|
-
add: Flags.boolean({ char: 'a', description: 'add penguins-eggs
|
|
31
|
+
add: Flags.boolean({ char: 'a', description: 'add penguins-eggs-repo' }),
|
|
32
32
|
help: Flags.help({ char: 'h' }),
|
|
33
33
|
nointeractive: Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
34
|
-
remove: Flags.boolean({ char: 'r', description: 'remove penguins-eggs
|
|
34
|
+
remove: Flags.boolean({ char: 'r', description: 'remove penguins-eggs-repo' }),
|
|
35
35
|
verbose: Flags.boolean({ char: 'v', description: 'verbose' })
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
*
|
|
39
39
|
*/
|
|
40
40
|
async run() {
|
|
41
|
-
const { flags } = await this.parse(
|
|
41
|
+
const { flags } = await this.parse(Repo);
|
|
42
42
|
Utils.titles(this.id + ' ' + this.argv);
|
|
43
43
|
const { nointeractive } = flags;
|
|
44
44
|
if (Utils.isRoot()) {
|
|
45
45
|
const distro = new Distro();
|
|
46
|
-
if (distro.familyId === 'archlinux'
|
|
46
|
+
if (distro.familyId === 'archlinux') {
|
|
47
47
|
if (flags.add) {
|
|
48
|
-
Utils.warning(`Are you sure to add penguins-eggs
|
|
48
|
+
Utils.warning(`Are you sure to add penguins-eggs repo to your repositories?`);
|
|
49
49
|
if (await Utils.customConfirm('Select yes to continue...')) {
|
|
50
|
-
await
|
|
50
|
+
await archlinuxRepoAdd(distro.distroId);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
else if (flags.remove) {
|
|
54
|
-
Utils.warning(`Are you sure to remove penguins-eggs
|
|
54
|
+
Utils.warning(`Are you sure to remove penguins-eggs repo to your repositories?`);
|
|
55
55
|
if (await Utils.customConfirm('Select yes to continue...')) {
|
|
56
|
-
await
|
|
56
|
+
await archlinuxRepoRemove(distro.distroId);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -62,9 +62,8 @@ export default class Ppa extends Command {
|
|
|
62
62
|
* Debian
|
|
63
63
|
*/
|
|
64
64
|
if (flags.add) {
|
|
65
|
-
Utils.warning(`Are you sure to add source ${path.basename(
|
|
65
|
+
Utils.warning(`Are you sure to add source ${path.basename(repoPath)} to your repositories?`);
|
|
66
66
|
if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
|
|
67
|
-
// Rimuove sempre le vecchie configurazioni per uno stato pulito
|
|
68
67
|
await debianRemove();
|
|
69
68
|
if (await is822()) {
|
|
70
69
|
await debianAdd822();
|
|
@@ -75,7 +74,7 @@ export default class Ppa extends Command {
|
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
else if (flags.remove) {
|
|
78
|
-
Utils.warning(`Are you sure to remove source ${path.basename(
|
|
77
|
+
Utils.warning(`Are you sure to remove source ${path.basename(repoPath)} to your repositories?`);
|
|
79
78
|
if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
|
|
80
79
|
await debianRemove();
|
|
81
80
|
}
|
|
@@ -85,7 +84,7 @@ export default class Ppa extends Command {
|
|
|
85
84
|
else if (distro.familyId === 'fedora') {
|
|
86
85
|
if (distro.distroId !== 'Fedora') {
|
|
87
86
|
console.log("You can find the step-by-step instructions at this link:");
|
|
88
|
-
console.log("https://github.com/pieroproietti/penguins-eggs/blob/master/DOCS/INSTALL-
|
|
87
|
+
console.log("https://github.com/pieroproietti/penguins-eggs/blob/master/DOCS/INSTALL-ENTERPRISE-LINUX.md");
|
|
89
88
|
console.log();
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
@@ -109,23 +108,25 @@ export default class Ppa extends Command {
|
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
/**
|
|
112
|
-
*
|
|
111
|
+
* ARCH
|
|
113
112
|
*/
|
|
114
|
-
|
|
113
|
+
// archlinuxRepoAdd
|
|
114
|
+
async function archlinuxRepoAdd(distroId = "Arch") {
|
|
115
|
+
console.log(`Adding penguins-eggs repo for ${distroId}`);
|
|
115
116
|
const repoBlockIdentifier = '# Penguins-eggs repository';
|
|
116
117
|
const repoName = '[penguins-eggs]';
|
|
117
118
|
const keyId = 'F6773EA7D2F309BA3E5DE08A45B10F271525403F';
|
|
118
|
-
|
|
119
|
+
let serverUrl = 'https://pieroproietti.github.io/penguins-eggs-repo/arch';
|
|
120
|
+
if (Diversions.isManjaroBased(distroId)) {
|
|
121
|
+
serverUrl = 'https://pieroproietti.github.io/penguins-eggs-repo/manjaro';
|
|
122
|
+
}
|
|
119
123
|
const pacmanConfPath = '/etc/pacman.conf';
|
|
120
124
|
const echo = Utils.setEcho(true);
|
|
121
|
-
// 1. Controlla se il repository è già configurato
|
|
122
125
|
const pacmanConfContent = fs.readFileSync(pacmanConfPath, 'utf8');
|
|
123
126
|
if (pacmanConfContent.includes(repoName)) {
|
|
124
|
-
console.log(`
|
|
125
|
-
// Qui potresti voler uscire o chiamare una funzione di rimozione, come nel tuo esempio.
|
|
127
|
+
console.log(`The repository ${repoName} already exists in ${pacmanConfPath}!`);
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
|
-
// 2. Importa e firma la chiave GPG del repository
|
|
129
130
|
console.log(`Importazione della chiave GPG: ${keyId}...`);
|
|
130
131
|
await exec(`pacman-key --recv-key ${keyId} --keyserver keyserver.ubuntu.com`, echo);
|
|
131
132
|
await exec(`pacman-key --lsign-key ${keyId}`, echo);
|
|
@@ -135,51 +136,53 @@ async function penguinsRepoAdd() {
|
|
|
135
136
|
repoBlock += `SigLevel = Optional TrustAll\n`;
|
|
136
137
|
repoBlock += `Server = ${serverUrl}\n`;
|
|
137
138
|
fs.appendFileSync(pacmanConfPath, repoBlock);
|
|
139
|
+
let message = 'Run “sudo pacman -Syyu” to update pacman databases.';
|
|
140
|
+
if (Diversions.isManjaroBased(distroId)) {
|
|
141
|
+
message = 'Run “sudo pamac update --force-refresh" to update pacman databases.';
|
|
142
|
+
}
|
|
143
|
+
console.log('Repository successfully removed!');
|
|
144
|
+
console.log(message);
|
|
138
145
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
async function penguinsRepoRemove() {
|
|
143
|
-
// --- Configurazione del repository da rimuovere ---
|
|
146
|
+
// archlinuxRepoRemove
|
|
147
|
+
async function archlinuxRepoRemove(distroId = 'Arch') {
|
|
148
|
+
console.log(`Removing penguins-eggs repo for ${distroId}`);
|
|
144
149
|
const repoBlockIdentifier = '# Penguins-eggs repository';
|
|
145
150
|
const repoName = '[penguins-eggs]';
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
let serverUrl = 'https://pieroproietti.github.io/penguins-eggs-repo/arch';
|
|
152
|
+
if (Diversions.isManjaroBased(distroId)) {
|
|
153
|
+
serverUrl = 'https://pieroproietti.github.io/penguins-eggs-repo/manjaro';
|
|
154
|
+
}
|
|
148
155
|
const pacmanConfPath = '/etc/pacman.conf';
|
|
149
156
|
let pacmanConfContent = fs.readFileSync(pacmanConfPath, 'utf8');
|
|
150
|
-
// Controlla se il repository è effettivamente presente
|
|
151
157
|
if (pacmanConfContent.includes(repoName)) {
|
|
152
|
-
console.log(`
|
|
153
|
-
// Costruisce la stringa esatta del blocco da rimuovere
|
|
158
|
+
console.log(`Removing repository ${repoName} in progress...`);
|
|
154
159
|
let repoBlock = ``;
|
|
155
160
|
repoBlock += repoBlockIdentifier + `\n`;
|
|
156
161
|
repoBlock += `${repoName}\n`;
|
|
157
162
|
repoBlock += `SigLevel = Optional TrustAll\n`;
|
|
158
163
|
repoBlock += `Server = ${serverUrl}\n`;
|
|
159
|
-
// Sostituisce il blocco del repository con una stringa vuota
|
|
160
164
|
pacmanConfContent = pacmanConfContent.replace(repoBlock, '');
|
|
161
|
-
// Riscrive il file con il contenuto aggiornato, usando trim() per
|
|
162
|
-
// rimuovere eventuali spazi o righe vuote all'inizio o alla fine.
|
|
163
165
|
fs.writeFileSync(pacmanConfPath, pacmanConfContent.trim());
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
let message = 'Run “sudo pacman -Syyu” to update pacman databases.';
|
|
167
|
+
if (Diversions.isManjaroBased(distroId)) {
|
|
168
|
+
message = 'Run “sudo pamac update --force-refresh" to update pacman databases.';
|
|
169
|
+
}
|
|
170
|
+
console.log('Repository successfully removed!');
|
|
171
|
+
console.log(message);
|
|
166
172
|
}
|
|
167
173
|
else {
|
|
168
|
-
console.log('
|
|
174
|
+
console.log('The repository was not present in /etc/pacman.conf.');
|
|
169
175
|
}
|
|
170
176
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
*/
|
|
174
|
-
// archAdd
|
|
175
|
-
async function archAdd() {
|
|
177
|
+
// archlinuxAurAdd
|
|
178
|
+
async function archlinuxAurAdd() {
|
|
176
179
|
const path = '/var/cache/pacman/pkg/';
|
|
177
180
|
const keyring = 'chaotic-keyring.pkg.tar.zst';
|
|
178
181
|
const mirrorlist = 'chaotic-mirrorlist.pkg.tar.zst';
|
|
179
182
|
const echo = Utils.setEcho(true);
|
|
180
183
|
if (fs.existsSync(path + keyring) && fs.existsSync(path + mirrorlist)) {
|
|
181
184
|
console.log('repository Chaotic-AUR, already present!');
|
|
182
|
-
await
|
|
185
|
+
await archlinuxAurRemove();
|
|
183
186
|
process.exit();
|
|
184
187
|
}
|
|
185
188
|
await exec('pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com', echo);
|
|
@@ -189,8 +192,8 @@ async function archAdd() {
|
|
|
189
192
|
const chaoticAppend = '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n\n';
|
|
190
193
|
fs.appendFileSync('/etc/pacman.conf', chaoticAppend);
|
|
191
194
|
}
|
|
192
|
-
//
|
|
193
|
-
async function
|
|
195
|
+
// archlinuxAurRemove
|
|
196
|
+
async function archlinuxAurRemove() {
|
|
194
197
|
const path = '/var/cache/pacman/pkg/';
|
|
195
198
|
const keyring = 'chaotic-keyring.pkg.tar.zst';
|
|
196
199
|
const mirrorlist = 'chaotic-mirrorlist.pkg.tar.zst';
|
|
@@ -207,6 +210,17 @@ async function archRemove() {
|
|
|
207
210
|
/**
|
|
208
211
|
* DEBIAN
|
|
209
212
|
*/
|
|
213
|
+
// debianAdd
|
|
214
|
+
async function debianAdd() {
|
|
215
|
+
await exec(`curl -fsSL ${repoKeyUrl} | gpg --dearmor -o ${repoKeyPath}`);
|
|
216
|
+
const content = `deb [signed-by=${repoKeyPath}] ${repoUrl}/deb stable main\n`;
|
|
217
|
+
fs.writeFileSync(`${repoPath}.list`, content);
|
|
218
|
+
}
|
|
219
|
+
// debianRemove
|
|
220
|
+
async function debianRemove() {
|
|
221
|
+
await exec(`rm -f ${repoKeyPath}`);
|
|
222
|
+
await exec(`rm -f ${repoPath}*`);
|
|
223
|
+
}
|
|
210
224
|
// is822
|
|
211
225
|
async function is822() {
|
|
212
226
|
let retval = false;
|
|
@@ -221,24 +235,12 @@ async function is822() {
|
|
|
221
235
|
}
|
|
222
236
|
// debianAdd822
|
|
223
237
|
async function debianAdd822() {
|
|
224
|
-
await exec(`curl -fsSL ${
|
|
238
|
+
await exec(`curl -fsSL ${repoKeyUrl} | gpg --dearmor -o ${repoKeyPath}`);
|
|
225
239
|
let content = '';
|
|
226
240
|
content += `Types: deb\n`;
|
|
227
|
-
content += `URIs: ${
|
|
241
|
+
content += `URIs: ${repoUrl}/deb\n`; // Correct URI for packages
|
|
228
242
|
content += `Suites: stable\n`; // It's better to be specific
|
|
229
243
|
content += `Components: main\n`;
|
|
230
|
-
content += `Signed-By: ${
|
|
231
|
-
fs.writeFileSync(`${
|
|
232
|
-
}
|
|
233
|
-
// debianAdd
|
|
234
|
-
async function debianAdd() {
|
|
235
|
-
await exec(`curl -fsSL ${ppaKeyUrl} | gpg --dearmor -o ${ppaKeyPath}`);
|
|
236
|
-
const content = `deb [signed-by=${ppaKeyPath}] ${ppaUrl}/deb stable main\n`;
|
|
237
|
-
fs.writeFileSync(`${ppaPath}.list`, content);
|
|
238
|
-
}
|
|
239
|
-
// debianRemove
|
|
240
|
-
async function debianRemove() {
|
|
241
|
-
// The script runs as root, so sudo inside exec is not needed here
|
|
242
|
-
await exec(`rm -f ${ppaKeyPath}`);
|
|
243
|
-
await exec(`rm -f ${ppaPath}*`);
|
|
244
|
+
content += `Signed-By: ${repoKeyPath}\n`;
|
|
245
|
+
fs.writeFileSync(`${repoPath}.sources`, content);
|
|
244
246
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Script per creare symlink dei moduli Penguins-Eggs in /usr/lib/dracut/modules.d
|
|
4
|
+
# Questo è necessario perché Dracut 106 su Debian non legge dracutmodules_dirs con --confdir
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
CUSTOM_DIR="/usr/lib/penguins-eggs/dracut/modules.d"
|
|
10
|
+
SYSTEM_DIR="/usr/lib/dracut/modules.d"
|
|
11
|
+
|
|
12
|
+
echo "=== Creazione Symlink Moduli Dracut ==="
|
|
13
|
+
echo ""
|
|
14
|
+
|
|
15
|
+
# Verifica di essere root
|
|
16
|
+
if [ "$EUID" -ne 0 ]; then
|
|
17
|
+
echo "ERRORE: Esegui come root (sudo)"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Verifica directory
|
|
22
|
+
if [ ! -d "$CUSTOM_DIR" ]; then
|
|
23
|
+
echo "ERRORE: $CUSTOM_DIR non esiste"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if [ ! -d "$SYSTEM_DIR" ]; then
|
|
28
|
+
echo "ERRORE: $SYSTEM_DIR non esiste"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Lista moduli
|
|
33
|
+
MODULES=(
|
|
34
|
+
"00debug-shell"
|
|
35
|
+
"90block"
|
|
36
|
+
"95iso-scan"
|
|
37
|
+
"95luks"
|
|
38
|
+
"95luks-loop"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
echo "Creazione symlink..."
|
|
42
|
+
for module in "${MODULES[@]}"; do
|
|
43
|
+
SOURCE="$CUSTOM_DIR/$module"
|
|
44
|
+
TARGET="$SYSTEM_DIR/$module"
|
|
45
|
+
|
|
46
|
+
if [ ! -d "$SOURCE" ]; then
|
|
47
|
+
echo " [SKIP] $module - non trovato"
|
|
48
|
+
continue
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Rimuovi esistente
|
|
52
|
+
if [ -e "$TARGET" ] || [ -L "$TARGET" ]; then
|
|
53
|
+
rm -rf "$TARGET"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Crea symlink
|
|
57
|
+
ln -sf "$SOURCE" "$TARGET"
|
|
58
|
+
echo " [OK] $module"
|
|
59
|
+
done
|
|
60
|
+
|
|
61
|
+
echo ""
|
|
62
|
+
echo "Verifica symlink creati:"
|
|
63
|
+
ls -la "$SYSTEM_DIR" | grep -E "(debug-shell|90block|iso-scan|95luks)"
|
|
64
|
+
|
|
65
|
+
echo ""
|
|
66
|
+
echo "Test dracut --list-modules:"
|
|
67
|
+
dracut --list-modules 2>&1 | grep -E "(debug-shell|90block|iso-scan|95luks)" || echo " ATTENZIONE: moduli non ancora visibili"
|
|
68
|
+
|
|
69
|
+
echo ""
|
|
70
|
+
echo "=== Completato ==="
|
|
71
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
dracut[I]: Executing: /usr/bin/dracut --force --confdir /usr/lib/penguins-eggs/dracut/dracut.conf.d --kmoddir /lib/modules/6.12.48+deb13-amd64 /home/eggs/iso/live/initrd.img-6.12.48+deb13-amd64 6.12.48+deb13-amd64
|
|
2
|
+
dracut[I]: 62bluetooth: Could not find any command of '/usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd'!
|
|
3
|
+
dracut[E]: Module '90block' cannot be found.
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
# ==============================================================
|
|
2
|
+
# 50-live.conf – Opzione A: Usa solo luks-loop
|
|
3
|
+
# Più semplice, compatibile con dmsquash-live standard
|
|
4
|
+
# ==============================================================
|
|
5
|
+
|
|
6
6
|
compress="zstd"
|
|
7
|
-
|
|
7
|
+
squash_compress="zstd"
|
|
8
8
|
hostonly="no"
|
|
9
|
+
lvmconf="no"
|
|
10
|
+
mdadmconf="no"
|
|
9
11
|
early_microcode="no"
|
|
10
12
|
|
|
13
|
+
# Moduli (SENZA 95luks, usa SOLO luks-loop)
|
|
14
|
+
add_dracutmodules+=" dm kernel-modules "
|
|
15
|
+
add_dracutmodules+=" block "
|
|
16
|
+
add_dracutmodules+=" iso-scan pollcdrom "
|
|
17
|
+
add_dracutmodules+=" luks-loop "
|
|
18
|
+
add_dracutmodules+=" dmsquash-live dmsquash-live-autooverlay "
|
|
19
|
+
add_dracutmodules+=" livenet qemu qemu-net "
|
|
20
|
+
add_dracutmodules+=" debug-shell "
|
|
21
|
+
|
|
22
|
+
omit_dracutmodules+=" plymouth luks crypt systemd-cryptsetup fido2 pkcs11 "
|
|
23
|
+
|
|
24
|
+
# Parametri kernel per luks-loop + dmsquash-live
|
|
25
|
+
# IMPORTANTE: rd.live.squashimg punta al LUKS decifrato
|
|
26
|
+
kernel_cmdline="boot=live root=live:LABEL=colibri rd.luks.loop=/live/luks.img eggs.luks.uuid=fedb19f3-e117-4e94-a85c-debe41b18e5b rd.live.dir=/live rd.live.overlay.overlayfs=1 rd.shell rd.debug"
|
|
27
|
+
|
|
28
|
+
install_items+=" /usr/bin/find /usr/bin/lsblk /bin/cat "
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# dracut.conf.d/50-live.conf
|
|
2
|
+
mdadmconf="no"
|
|
3
|
+
lvmconf="no"
|
|
4
|
+
use_fstab="no"
|
|
5
|
+
squash_compress="zstd"
|
|
6
|
+
compress="zstd"
|
|
7
|
+
add_dracutmodules+=" crypt livenet dmsquash-live dmsquash-live-autooverlay convertfs pollcdrom qemu qemu-net "
|
|
8
|
+
hostonly="no"
|
|
9
|
+
early_microcode="no"
|
|
10
|
+
|
package/dracut/export
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
./export-dracut-analysis /usr/lib/penguins-eggs/dracut/modules.d /usr/lib/penguins-eggs/dracut/dracut.conf.d
|
|
2
|
+
scp dracut-analisys.txt artisan@192.168.1.2:/home/artisan
|
|
3
|
+
scp /home/eggs/iso/egg-of_debian-trixie-* artisan@192.168.1.2:/home/artisan/dracut-log.txt
|
|
4
|
+
rm dracut-analisys.txt
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script per consolidare il contenuto di più directory di configurazione Dracut
|
|
4
|
+
# in un unico file di testo.
|
|
5
|
+
|
|
6
|
+
# --- Impostazioni ---
|
|
7
|
+
OUTPUT_FILE="dracut-analysis.txt"
|
|
8
|
+
|
|
9
|
+
# --- Logica dello Script ---
|
|
10
|
+
|
|
11
|
+
# Controlla se è stato fornito almeno un percorso come argomento
|
|
12
|
+
if [ "$#" -eq 0 ]; then
|
|
13
|
+
echo "ERRORE: Devi specificare almeno un percorso di directory."
|
|
14
|
+
echo "Uso: $0 <percorso_dir_1> [<percorso_dir_2> ...]"
|
|
15
|
+
echo "Esempio: $0 ./modules.d ./dracut.conf.d"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Pulisce il file di output se esiste già e scrive l'intestazione
|
|
20
|
+
echo "--- INIZIO ANALISI CONFIGURAZIONE DRACUT ---" > "$OUTPUT_FILE"
|
|
21
|
+
echo "" >> "$OUTPUT_FILE"
|
|
22
|
+
|
|
23
|
+
# Itera su tutte le directory passate come argomenti
|
|
24
|
+
for TARGET_DIR in "$@"; do
|
|
25
|
+
# Controlla se il percorso fornito è una directory valida
|
|
26
|
+
if [ ! -d "$TARGET_DIR" ]; then
|
|
27
|
+
echo "ATTENZIONE: '$TARGET_DIR' non è una directory valida o non esiste. Verrà saltata."
|
|
28
|
+
continue # Salta questo argomento e passa al successivo
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Aggiunge un'intestazione per la directory corrente nel file di output
|
|
32
|
+
echo "##################################################" >> "$OUTPUT_FILE"
|
|
33
|
+
echo "### CONTENUTO DIRECTORY: ${TARGET_DIR}" >> "$OUTPUT_FILE"
|
|
34
|
+
echo "##################################################" >> "$OUTPUT_FILE"
|
|
35
|
+
echo "" >> "$OUTPUT_FILE"
|
|
36
|
+
|
|
37
|
+
# Trova tutti i file nella directory corrente e aggiunge il loro contenuto al file
|
|
38
|
+
find "$TARGET_DIR" -type f | sort | while read -r filepath; do
|
|
39
|
+
echo "==================================================" >> "$OUTPUT_FILE"
|
|
40
|
+
echo "### FILE: ${filepath}" >> "$OUTPUT_FILE"
|
|
41
|
+
echo "==================================================" >> "$OUTPUT_FILE"
|
|
42
|
+
echo '```' >> "$OUTPUT_FILE"
|
|
43
|
+
cat "$filepath" >> "$OUTPUT_FILE"
|
|
44
|
+
echo '```' >> "$OUTPUT_FILE"
|
|
45
|
+
echo "" >> "$OUTPUT_FILE"
|
|
46
|
+
done
|
|
47
|
+
done
|
|
48
|
+
|
|
49
|
+
echo "--- FINE ANALISI CONFIGURAZIONE DRACUT ---" >> "$OUTPUT_FILE"
|
|
50
|
+
|
|
51
|
+
echo "✅ Fatto! L'analisi combinata è stata salvata nel file: $OUTPUT_FILE"
|
package/dracut/mkisofs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ~/penguins-eggs/dracut/modules.d/00debug-shell/debug-hook.sh
|
|
2
|
+
|
|
3
|
+
#!/bin/sh
|
|
4
|
+
|
|
5
|
+
# Controlla se il parametro "startdebug" è stato passato al kernel
|
|
6
|
+
if getargbool 0 startdebug; then
|
|
7
|
+
echo "############################################"
|
|
8
|
+
echo "### FORZANDO LA SHELL DI DEBUG"
|
|
9
|
+
echo "############################################"
|
|
10
|
+
|
|
11
|
+
# Lancia una shell interattiva
|
|
12
|
+
/bin/sh
|
|
13
|
+
fi
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ~/penguins-eggs/dracut/modules.d/00debug-shell/module-setup.sh
|
|
2
|
+
|
|
3
|
+
#!/bin/bash
|
|
4
|
+
|
|
5
|
+
check() {
|
|
6
|
+
return 0
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
depends() {
|
|
10
|
+
# Non dipende da nulla per essere sicuro che si esegua
|
|
11
|
+
return 0
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
install() {
|
|
15
|
+
# Installa una shell e alcuni comandi utili per il debug
|
|
16
|
+
inst_multiple /bin/sh /bin/ls /bin/cat /bin/mount
|
|
17
|
+
|
|
18
|
+
# Installa uno script che si eseguirà molto presto durante il boot
|
|
19
|
+
inst_hook cmdline 10 "$moddir/debug-hook.sh"
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# 90block
|
|
2
|
+
Questo è solo un dummy, su Debian per fargli credere che 90block esiste, ma
|
|
3
|
+
su Debian non è necessario.
|
|
4
|
+
|
|
5
|
+
Debian usa un’architettura leggermente diversa dove parte delle funzionalità di block sono “fuse” dentro `95rootfs-block` e `99base`, ma non fornisce l’interfaccia di compatibilità `90block` che molti altri moduli (come `iso-scan`, `dmsquash-live`, `luks`, ecc.) si aspettano.
|
|
6
|
+
|
|
7
|
+
Quindi `iso-scan` cerca block, ma non lo trova né lo può risolvere, perché non esiste come directory in `/usr/lib/dracut/modules.d/`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# iso-scan-fallback.sh
|
|
3
|
+
# Penguins-Eggs: fallback hook to help dmsquash-live on Debian
|
|
4
|
+
|
|
5
|
+
# CREA la directory se non esiste
|
|
6
|
+
mkdir -p /run/initramfs/cmdline.d
|
|
7
|
+
|
|
8
|
+
if [ -e /run/initramfs/live.squashfs.path ] && [ -z "$live_squash" ]; then
|
|
9
|
+
live_squash=$(cat /run/initramfs/live.squashfs.path)
|
|
10
|
+
info "iso-scan-fallback: live_squash set to $live_squash"
|
|
11
|
+
echo "rd.live.squashimg=$live_squash" >> /run/initramfs/cmdline.d/90-iso-scan.conf
|
|
12
|
+
fi
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# iso-scan.sh
|
|
3
|
+
# Penguins-Eggs: ISO scanner for Debian Dracut
|
|
4
|
+
|
|
5
|
+
type info >/dev/null 2>&1 || info() { echo "[iso-scan] $*" >&2; }
|
|
6
|
+
type warn >/dev/null 2>&1 || warn() { echo "[iso-scan][WARN] $*" >&2; }
|
|
7
|
+
type die >/dev/null 2>&1 || die() { echo "[iso-scan][ERR] $*" >&2; exit 1; }
|
|
8
|
+
|
|
9
|
+
info "iso-scan starting..."
|
|
10
|
+
|
|
11
|
+
# Retrieve kernel args
|
|
12
|
+
# boot=live root=live:LABEL=colibri
|
|
13
|
+
# Estrai solo il LABEL, non "live:LABEL="
|
|
14
|
+
root_arg=$(getarg root=)
|
|
15
|
+
live_label=""
|
|
16
|
+
|
|
17
|
+
if [[ "$root_arg" =~ live:LABEL=(.+) ]]; then
|
|
18
|
+
live_label="${BASH_REMATCH[1]}"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
live_media=$(getarg rd.live.media=)
|
|
22
|
+
live_dir=$(getarg rd.live.dir=)
|
|
23
|
+
[ -z "$live_dir" ] && live_dir="/live"
|
|
24
|
+
|
|
25
|
+
luks_loop=$(getarg rd.luks.loop=)
|
|
26
|
+
squashimg=$(getarg rd.live.squashimg=)
|
|
27
|
+
[ -z "$squashimg" ] && squashimg="filesystem.squashfs"
|
|
28
|
+
|
|
29
|
+
mountpoint="/run/initramfs/isoscan"
|
|
30
|
+
mkdir -p "$mountpoint"
|
|
31
|
+
|
|
32
|
+
info "Looking for device with LABEL=$live_label"
|
|
33
|
+
|
|
34
|
+
# Detect ISO device
|
|
35
|
+
device=""
|
|
36
|
+
if [ -n "$live_label" ]; then
|
|
37
|
+
# Cerca device per LABEL
|
|
38
|
+
info "searching by LABEL: $live_label"
|
|
39
|
+
device=$(blkid -l -t LABEL="$live_label" -o device)
|
|
40
|
+
if [ -z "$device" ]; then
|
|
41
|
+
# Fallback: cerca con findfs
|
|
42
|
+
device=$(findfs LABEL="$live_label" 2>/dev/null)
|
|
43
|
+
fi
|
|
44
|
+
elif [ -n "$live_media" ]; then
|
|
45
|
+
device="$live_media"
|
|
46
|
+
info "using rd.live.media: $device"
|
|
47
|
+
else
|
|
48
|
+
# Fallback: prova /dev/sr0 o loop devices
|
|
49
|
+
info "no LABEL specified, trying default devices"
|
|
50
|
+
for dev in /dev/sr0 /dev/sda /dev/sdb /dev/loop*; do
|
|
51
|
+
if [ -b "$dev" ]; then
|
|
52
|
+
device="$dev"
|
|
53
|
+
info "trying device: $device"
|
|
54
|
+
break
|
|
55
|
+
fi
|
|
56
|
+
done
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [ -z "$device" ]; then
|
|
60
|
+
warn "no live device found"
|
|
61
|
+
exit 0
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
info "found live device: $device"
|
|
65
|
+
|
|
66
|
+
# Monta il device
|
|
67
|
+
if ! mount -o ro "$device" "$mountpoint" 2>/dev/null; then
|
|
68
|
+
warn "cannot mount $device on $mountpoint"
|
|
69
|
+
exit 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
info "mounted $device on $mountpoint"
|
|
73
|
+
|
|
74
|
+
# Verifica contenuto
|
|
75
|
+
ls -la "$mountpoint$live_dir/" 2>/dev/null | head -10 | while read line; do
|
|
76
|
+
info " $line"
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
# Se luks.img esiste, salva il path
|
|
80
|
+
if [ -e "$mountpoint$live_dir/luks.img" ]; then
|
|
81
|
+
echo "$mountpoint$live_dir/luks.img" > /run/initramfs/luks.loop.path
|
|
82
|
+
info "found luks.img at $mountpoint$live_dir/luks.img"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
# Se filesystem.squashfs esiste (senza LUKS), salva il path
|
|
86
|
+
if [ -e "$mountpoint$live_dir/$squashimg" ]; then
|
|
87
|
+
echo "$mountpoint$live_dir/$squashimg" > /run/initramfs/live.squashfs.path
|
|
88
|
+
info "found $squashimg at $mountpoint$live_dir/$squashimg"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
info "iso-scan completed"
|
|
92
|
+
exit 0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
check() {
|
|
4
|
+
return 0
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
depends() {
|
|
8
|
+
return 0
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
install() {
|
|
12
|
+
inst_multiple mount umount blkid findfs losetup
|
|
13
|
+
inst_hook pre-mount 10 "$moddir/iso-scan.sh"
|
|
14
|
+
|
|
15
|
+
# Serve a scrivere /run/initramfs/live.squashfs.path
|
|
16
|
+
# prima che dmsquash-live entri in azione.
|
|
17
|
+
inst_hook pre-mount 20 "$moddir/iso-scan-fallback.sh"
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 95luks-loop
|
|
2
|
+
|
|
3
|
+
Debian (senza 90block, senza iso-scan) userà 95rootfs-block come base.
|
|
4
|
+
|
|
5
|
+
Il tuo nuovo modulo 95luks-loop farà la parte di “monta luks.img da ISO”.
|
|
6
|
+
|
|
7
|
+
Non serve patchare Dracut upstream.
|
|
8
|
+
|
|
9
|
+
È cross-distro, funziona anche su Fedora (dove block esiste ma non confligge).
|