penguins-eggs 25.12.15 → 25.12.16
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 +1 -1
- package/README.md +0 -742
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
- package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
- package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
- package/addons/eggs/theme/applications/install-system.desktop +0 -0
- package/assets/calamares/install-system.sh +0 -0
- package/assets/penguins-eggs.desktop +0 -0
- package/assets/penguins-krill.desktop +0 -0
- package/assets/penguins-links-add.desktop +0 -0
- package/assets/penguins-live-installer.desktop +0 -0
- package/bin/dev.js +0 -0
- package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/focal/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/focal/calamares/libexec/calamares-aptsources.sh +0 -0
- package/conf/distros/focal/calamares/libexec/calamares-l10n-helper.sh +0 -0
- package/conf/distros/focal/calamares/libexec/calamares-logs-helper.sh +0 -0
- package/conf/distros/focal/calamares/libexec/calamares-nomodeset.sh +0 -0
- package/conf/distros/noble/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/noble/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-aptsources.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-l10n-helper.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-logs-helper.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-nomodeset.sh +0 -0
- package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/opensuse/calamares/settings.yml +0 -0
- package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/init/unattended.sh +0 -0
- package/dist/bin/dev.js +0 -0
- package/dist/bin/run.js +0 -0
- package/dist/classes/ovary.d/luks-home-support-systemd.d.ts +12 -0
- package/dist/classes/ovary.d/luks-home-support-systemd.js +70 -0
- package/dist/classes/ovary.d/luks-home-support.d.ts +1 -0
- package/dist/classes/ovary.d/luks-home-support.js +101 -24
- package/dist/krill/classes/prepare.js +6 -2
- package/dist/krill/classes/sequence.d/remove-homecrypt-hack.d.ts +13 -0
- package/dist/krill/classes/sequence.d/remove-homecrypt-hack.js +65 -0
- package/dist/krill/classes/sequence.d.ts +2 -0
- package/dist/krill/classes/sequence.js +6 -1
- package/dracut/modules.d/00debug-shell/debug-hook.sh +0 -0
- package/dracut/modules.d/00debug-shell/module-setup.sh +0 -0
- package/dracut/modules.d/90block/block-cmdline.sh +0 -0
- package/dracut/modules.d/90block/module-setup.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan.sh +0 -0
- package/dracut/modules.d/95iso-scan/module-setup.sh +0 -0
- package/dracut/modules.d/95luks-loop/luks-loop.sh +0 -0
- package/dracut/modules.d/95luks-loop/module-setup.sh +0 -0
- package/eui/eui-autostart-cinnamon.desktop +0 -0
- package/eui/eui-autostart-xfce.desktop +0 -0
- package/eui/eui-create-image.sh +0 -0
- package/eui/eui-start.sh +0 -0
- package/package.json +130 -124
- package/perrisbrewery/scripts/postinst +0 -0
- package/perrisbrewery/scripts/postrm +0 -0
- package/perrisbrewery/scripts/preinst +0 -0
- package/perrisbrewery/scripts/prerm +0 -0
- package/scripts/99clean +0 -0
- package/scripts/adapt.sh +0 -0
- package/scripts/boot-encrypted-root.sh +0 -0
- package/scripts/bros/waydroid-helper.sh +0 -0
- package/scripts/lsb_release +0 -0
- package/scripts/mom.sh +0 -0
- package/scripts/mount-encrypted-home.sh +0 -0
- package/scripts/pve-live.service +0 -0
- package/scripts/pve-live.sh +0 -0
- package/scripts/restore_homecrypt_krill.sh +0 -0
- package/scripts/resy +0 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/bin/dev.js
CHANGED
|
File without changes
|
package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/conf/init/unattended.sh
CHANGED
|
File without changes
|
package/dist/bin/dev.js
CHANGED
|
File without changes
|
package/dist/bin/run.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/ovary.d/luks-home-support.ts
|
|
3
|
+
* penguins-eggs v.25.10.x / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import Ovary from '../ovary.js';
|
|
9
|
+
/**
|
|
10
|
+
* Installa i file necessari per sbloccare home.img LUKS durante il boot
|
|
11
|
+
*/
|
|
12
|
+
export declare function installHomecryptSupport(this: Ovary, squashfsRoot: string, homeImgPath: string): void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/ovary.d/luks-home-support.ts
|
|
3
|
+
* penguins-eggs v.25.10.x / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
// packages
|
|
9
|
+
import fs from 'fs';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
import { dirname } from 'path';
|
|
13
|
+
import Utils from '../utils.js';
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
/**
|
|
17
|
+
* Installa i file necessari per sbloccare home.img LUKS durante il boot
|
|
18
|
+
*/
|
|
19
|
+
export function installHomecryptSupport(squashfsRoot, homeImgPath) {
|
|
20
|
+
Utils.warning('installing encrypted home support...');
|
|
21
|
+
// console.log("squashfsRoot:", squashfsRoot)
|
|
22
|
+
// console.log("homeImgPath:", homeImgPath)
|
|
23
|
+
// Leggi il template bash
|
|
24
|
+
const templatePath = path.join(__dirname, '../../../scripts/mount-encrypted-home.sh');
|
|
25
|
+
let bashScript = fs.readFileSync(templatePath, 'utf8');
|
|
26
|
+
// Sostituisci il placeholder con il path reale
|
|
27
|
+
bashScript = bashScript.replace('__HOME_IMG_PATH__', homeImgPath);
|
|
28
|
+
// Systemd service
|
|
29
|
+
const systemdService = `[Unit]
|
|
30
|
+
Description=Unlock and mount encrypted home.img
|
|
31
|
+
DefaultDependencies=no
|
|
32
|
+
After=systemd-udev-settle.service local-fs-pre.target
|
|
33
|
+
Before=local-fs.target display-manager.service
|
|
34
|
+
ConditionPathExists=${homeImgPath}
|
|
35
|
+
|
|
36
|
+
[Service]
|
|
37
|
+
Type=oneshot
|
|
38
|
+
RemainAfterExit=yes
|
|
39
|
+
StandardInput=tty
|
|
40
|
+
StandardOutput=journal+console
|
|
41
|
+
StandardError=journal+console
|
|
42
|
+
TTYPath=/dev/console
|
|
43
|
+
TTYReset=yes
|
|
44
|
+
TTYVHangup=yes
|
|
45
|
+
ExecStart=/usr/local/bin/mount-encrypted-home.sh
|
|
46
|
+
ExecStop=/bin/bash -c 'umount /home && cryptsetup close live-home'
|
|
47
|
+
|
|
48
|
+
[Install]
|
|
49
|
+
WantedBy=local-fs.target
|
|
50
|
+
`;
|
|
51
|
+
// Percorsi di destinazione
|
|
52
|
+
const scriptPath = path.join(squashfsRoot, 'usr/local/bin/mount-encrypted-home.sh');
|
|
53
|
+
const servicePath = path.join(squashfsRoot, 'etc/systemd/system/mount-encrypted-home.service');
|
|
54
|
+
const symlinkDir = path.join(squashfsRoot, 'etc/systemd/system/local-fs.target.wants');
|
|
55
|
+
const symlinkPath = path.join(symlinkDir, 'mount-encrypted-home.service');
|
|
56
|
+
// Create dirs
|
|
57
|
+
fs.mkdirSync(path.dirname(scriptPath), { recursive: true });
|
|
58
|
+
fs.mkdirSync(path.dirname(servicePath), { recursive: true });
|
|
59
|
+
fs.mkdirSync(symlinkDir, { recursive: true });
|
|
60
|
+
// Scrivi lo script
|
|
61
|
+
fs.writeFileSync(scriptPath, bashScript);
|
|
62
|
+
fs.chmodSync(scriptPath, 0o755);
|
|
63
|
+
// Scrivi il service
|
|
64
|
+
fs.writeFileSync(servicePath, systemdService);
|
|
65
|
+
// Crea il symlink per abilitare il service
|
|
66
|
+
if (fs.existsSync(symlinkPath)) {
|
|
67
|
+
fs.unlinkSync(symlinkPath);
|
|
68
|
+
}
|
|
69
|
+
fs.symlinkSync('../mount-encrypted-home.service', symlinkPath);
|
|
70
|
+
}
|
|
@@ -8,5 +8,6 @@
|
|
|
8
8
|
import Ovary from '../ovary.js';
|
|
9
9
|
/**
|
|
10
10
|
* Installa i file necessari per sbloccare home.img LUKS durante il boot
|
|
11
|
+
* Supporta sia Systemd (Debian/Ubuntu) che SysVinit (Devuan)
|
|
11
12
|
*/
|
|
12
13
|
export declare function installHomecryptSupport(this: Ovary, squashfsRoot: string, homeImgPath: string): void;
|
|
@@ -15,18 +15,23 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
15
15
|
const __dirname = dirname(__filename);
|
|
16
16
|
/**
|
|
17
17
|
* Installa i file necessari per sbloccare home.img LUKS durante il boot
|
|
18
|
+
* Supporta sia Systemd (Debian/Ubuntu) che SysVinit (Devuan)
|
|
18
19
|
*/
|
|
19
20
|
export function installHomecryptSupport(squashfsRoot, homeImgPath) {
|
|
20
21
|
Utils.warning('installing encrypted home support...');
|
|
21
|
-
//
|
|
22
|
-
// console.log("homeImgPath:", homeImgPath)
|
|
23
|
-
// Leggi il template bash
|
|
22
|
+
// 1. PREPARAZIONE SCRIPT DI MONTAGGIO (Il "Motore")
|
|
24
23
|
const templatePath = path.join(__dirname, '../../../scripts/mount-encrypted-home.sh');
|
|
25
24
|
let bashScript = fs.readFileSync(templatePath, 'utf8');
|
|
26
|
-
// Sostituisci il placeholder con il path reale
|
|
27
25
|
bashScript = bashScript.replace('__HOME_IMG_PATH__', homeImgPath);
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const mountScriptPath = path.join(squashfsRoot, 'usr/local/bin/mount-encrypted-home.sh');
|
|
27
|
+
fs.mkdirSync(path.dirname(mountScriptPath), { recursive: true });
|
|
28
|
+
fs.writeFileSync(mountScriptPath, bashScript);
|
|
29
|
+
fs.chmodSync(mountScriptPath, 0o755);
|
|
30
|
+
// ---------------------------------------------------------
|
|
31
|
+
// RAMO SYSTEMD (Invariato - funziona bene con i .service)
|
|
32
|
+
// ---------------------------------------------------------
|
|
33
|
+
if (Utils.isSystemd()) {
|
|
34
|
+
const systemdService = `[Unit]
|
|
30
35
|
Description=Unlock and mount encrypted home.img
|
|
31
36
|
DefaultDependencies=no
|
|
32
37
|
After=systemd-udev-settle.service local-fs-pre.target
|
|
@@ -48,23 +53,95 @@ ExecStop=/bin/bash -c 'umount /home && cryptsetup close live-home'
|
|
|
48
53
|
[Install]
|
|
49
54
|
WantedBy=local-fs.target
|
|
50
55
|
`;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
const servicePath = path.join(squashfsRoot, 'etc/systemd/system/mount-encrypted-home.service');
|
|
57
|
+
const symlinkDir = path.join(squashfsRoot, 'etc/systemd/system/local-fs.target.wants');
|
|
58
|
+
const symlinkPath = path.join(symlinkDir, 'mount-encrypted-home.service');
|
|
59
|
+
fs.mkdirSync(path.dirname(servicePath), { recursive: true });
|
|
60
|
+
fs.mkdirSync(symlinkDir, { recursive: true });
|
|
61
|
+
fs.writeFileSync(servicePath, systemdService);
|
|
62
|
+
if (fs.existsSync(symlinkPath))
|
|
63
|
+
fs.unlinkSync(symlinkPath);
|
|
64
|
+
fs.symlinkSync('../mount-encrypted-home.service', symlinkPath);
|
|
65
|
+
}
|
|
66
|
+
// ---------------------------------------------------------
|
|
67
|
+
// RAMO SYSVINIT (DEVUAN) - METODO INITTAB HIJACK
|
|
68
|
+
// ---------------------------------------------------------
|
|
69
|
+
else if (Utils.isSysvinit()) {
|
|
70
|
+
Utils.warning('Configuring SysVinit via /etc/inittab hijacking (Persistent Method)...');
|
|
71
|
+
// A. Creiamo un Wrapper Script che fa: Sblocco -> Poi lancia Login
|
|
72
|
+
// Questo script prenderà il posto di 'agetty' su tty1
|
|
73
|
+
const wrapperScript = `#!/bin/sh
|
|
74
|
+
# Wrapper per sbloccare la home prima del login su TTY1
|
|
75
|
+
|
|
76
|
+
# 1. Setup ambiente minimale
|
|
77
|
+
export TERM=linux
|
|
78
|
+
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|
79
|
+
|
|
80
|
+
# 2. Pulizia schermo e stop Plymouth
|
|
81
|
+
clear
|
|
82
|
+
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
|
|
83
|
+
/bin/plymouth quit
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# 3. Attesa dispositivi (importante per USB)
|
|
87
|
+
echo "Waiting for devices..."
|
|
88
|
+
/sbin/udevadm settle
|
|
89
|
+
|
|
90
|
+
# 4. Esecuzione script di sblocco
|
|
91
|
+
echo "------------------------------------------------"
|
|
92
|
+
echo " CHECKING ENCRYPTED HOME STORAGE"
|
|
93
|
+
echo "------------------------------------------------"
|
|
94
|
+
/usr/local/bin/mount-encrypted-home.sh
|
|
95
|
+
|
|
96
|
+
# 5. Controllo esito (visivo)
|
|
97
|
+
if mountpoint -q /home; then
|
|
98
|
+
echo ">> Home mounted successfully."
|
|
99
|
+
sleep 1
|
|
100
|
+
else
|
|
101
|
+
echo ">> Home NOT mounted. Continuing unencrypted..."
|
|
102
|
+
sleep 2
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
# 6. LANCIO DEL VERO LOGIN (Sostituisce questo processo)
|
|
106
|
+
# Nota: --noclear evita di cancellare i messaggi di errore precedenti
|
|
107
|
+
exec /sbin/agetty --noclear tty1 linux
|
|
108
|
+
`;
|
|
109
|
+
const wrapperPath = path.join(squashfsRoot, 'usr/local/bin/tty1-unlock-wrapper.sh');
|
|
110
|
+
fs.writeFileSync(wrapperPath, wrapperScript);
|
|
111
|
+
fs.chmodSync(wrapperPath, 0o755);
|
|
112
|
+
// B. Modifichiamo /etc/inittab per usare il nostro wrapper
|
|
113
|
+
const inittabPath = path.join(squashfsRoot, 'etc/inittab');
|
|
114
|
+
if (fs.existsSync(inittabPath)) {
|
|
115
|
+
let content = fs.readFileSync(inittabPath, 'utf8');
|
|
116
|
+
// La riga standard è solitamente: 1:2345:respawn:/sbin/getty 38400 tty1
|
|
117
|
+
// Oppure su Devuan: 1:2345:respawn:/sbin/agetty --noclear tty1 linux
|
|
118
|
+
// Cerchiamo qualsiasi riga che inizia con "1:" (tty1)
|
|
119
|
+
const regexTTY1 = /^1:.*$/m;
|
|
120
|
+
// La nuova riga che lancia il nostro wrapper invece di agetty diretto
|
|
121
|
+
const newLine = `1:2345:respawn:/usr/local/bin/tty1-unlock-wrapper.sh`;
|
|
122
|
+
if (regexTTY1.test(content)) {
|
|
123
|
+
content = content.replace(regexTTY1, newLine);
|
|
124
|
+
Utils.warning('Patched /etc/inittab to run home unlock on TTY1');
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// Se non la trova, la aggiungiamo in fondo (caso raro ma possibile)
|
|
128
|
+
content += `\n${newLine}\n`;
|
|
129
|
+
}
|
|
130
|
+
fs.writeFileSync(inittabPath, content);
|
|
131
|
+
}
|
|
132
|
+
// C. Pulizia vecchi tentativi (Rimuoviamo script init.d se presenti per evitare conflitti)
|
|
133
|
+
const badSymlinks = [
|
|
134
|
+
path.join(squashfsRoot, 'etc/rcS.d/S05mount-encrypted-home'),
|
|
135
|
+
path.join(squashfsRoot, 'etc/rcS.d/S20mount-encrypted-home'),
|
|
136
|
+
path.join(squashfsRoot, 'etc/rc2.d/S02mount-encrypted-home')
|
|
137
|
+
];
|
|
138
|
+
badSymlinks.forEach(link => {
|
|
139
|
+
if (fs.existsSync(link))
|
|
140
|
+
fs.unlinkSync(link);
|
|
141
|
+
});
|
|
142
|
+
// Rimuoviamo anche lo script init.d stesso se esiste, non serve più
|
|
143
|
+
const initdFile = path.join(squashfsRoot, 'etc/init.d/mount-encrypted-home');
|
|
144
|
+
if (fs.existsSync(initdFile))
|
|
145
|
+
fs.unlinkSync(initdFile);
|
|
68
146
|
}
|
|
69
|
-
fs.symlinkSync('../mount-encrypted-home.service', symlinkPath);
|
|
70
147
|
}
|
|
@@ -231,11 +231,15 @@ export default class Krill {
|
|
|
231
231
|
oPartitions.installationMode = InstallationMode.Luks;
|
|
232
232
|
// Set default installation device if empty
|
|
233
233
|
if (oPartitions.installationDevice === '') {
|
|
234
|
-
const
|
|
234
|
+
const cmd = `lsblk -d -n -p -o NAME,RM,RO,TYPE | awk '$2 == 0 && $3 == 0 && $4 == "disk" {print $1}'`;
|
|
235
|
+
const result = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
236
|
+
const drives = result ? result.split('\n') : [];
|
|
235
237
|
if (drives.length > 0) {
|
|
236
|
-
oPartitions.installationDevice =
|
|
238
|
+
oPartitions.installationDevice = drives[0];
|
|
237
239
|
}
|
|
238
240
|
else {
|
|
241
|
+
console.error("[Krll] No suitable disc found for installation. Debug info:");
|
|
242
|
+
shx.exec('lsblk -o NAME,RM,RO,TYPE,SIZE,MODEL', { silent: false });
|
|
239
243
|
throw new Error("Unable to find installation drive");
|
|
240
244
|
}
|
|
241
245
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/krill/modules/remove-installer-link.ts
|
|
3
|
+
* penguins-eggs v.25.7.x / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
8
|
+
*/
|
|
9
|
+
import Sequence from '../sequence.js';
|
|
10
|
+
/**
|
|
11
|
+
* removeHomecryptHack
|
|
12
|
+
*/
|
|
13
|
+
export default function removeHomecryptHack(this: Sequence): Promise<void>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/krill/modules/remove-installer-link.ts
|
|
3
|
+
* penguins-eggs v.25.7.x / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
8
|
+
*/
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
/**
|
|
12
|
+
* removeHomecryptHack
|
|
13
|
+
*/
|
|
14
|
+
export default async function removeHomecryptHack() {
|
|
15
|
+
const targetRoot = this.installTarget;
|
|
16
|
+
// -------------------------------------------------------
|
|
17
|
+
// 1. PULIZIA SYSVINIT (Critica per il boot)
|
|
18
|
+
// -------------------------------------------------------
|
|
19
|
+
const inittabPath = path.join(targetRoot, 'etc/inittab');
|
|
20
|
+
if (fs.existsSync(inittabPath)) {
|
|
21
|
+
let content = fs.readFileSync(inittabPath, 'utf8');
|
|
22
|
+
// Cerca la riga modificata dal nostro hack
|
|
23
|
+
const hackRegex = /^1:.*tty1-unlock-wrapper\.sh.*$/m;
|
|
24
|
+
// Ripristina la riga standard (adatta questa stringa se usi parametri diversi per agetty)
|
|
25
|
+
const standardLine = '1:2345:respawn:/sbin/agetty --noclear tty1 linux';
|
|
26
|
+
if (hackRegex.test(content)) {
|
|
27
|
+
content = content.replace(hackRegex, standardLine);
|
|
28
|
+
fs.writeFileSync(inittabPath, content);
|
|
29
|
+
// console.log('- Restored standard inittab entry')
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// -------------------------------------------------------
|
|
33
|
+
// 2. PULIZIA SYSTEMD (Cosmetica / Best Practice)
|
|
34
|
+
// -------------------------------------------------------
|
|
35
|
+
// Anche se non rompe il boot, rimuoviamo i file inutili
|
|
36
|
+
const systemdFiles = [
|
|
37
|
+
'etc/systemd/system/mount-encrypted-home.service',
|
|
38
|
+
'etc/systemd/system/local-fs.target.wants/mount-encrypted-home.service'
|
|
39
|
+
];
|
|
40
|
+
systemdFiles.forEach(fileRelPath => {
|
|
41
|
+
const fullPath = path.join(targetRoot, fileRelPath);
|
|
42
|
+
if (fs.existsSync(fullPath)) {
|
|
43
|
+
try {
|
|
44
|
+
fs.unlinkSync(fullPath);
|
|
45
|
+
}
|
|
46
|
+
catch (e) { /* ignore */ }
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// -------------------------------------------------------
|
|
50
|
+
// 3. RIMOZIONE SCRIPT COMUNI
|
|
51
|
+
// -------------------------------------------------------
|
|
52
|
+
const scriptFiles = [
|
|
53
|
+
'usr/local/bin/tty1-unlock-wrapper.sh',
|
|
54
|
+
'usr/local/bin/mount-encrypted-home.sh'
|
|
55
|
+
];
|
|
56
|
+
scriptFiles.forEach(fileRelPath => {
|
|
57
|
+
const fullPath = path.join(targetRoot, fileRelPath);
|
|
58
|
+
if (fs.existsSync(fullPath)) {
|
|
59
|
+
try {
|
|
60
|
+
fs.unlinkSync(fullPath);
|
|
61
|
+
}
|
|
62
|
+
catch (e) { /* ignore */ }
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -32,6 +32,7 @@ import grubcfg from './sequence.d/grubcfg.js';
|
|
|
32
32
|
import bootloader from './sequence.d/bootloader.js';
|
|
33
33
|
import packages from './sequence.d/packages.js';
|
|
34
34
|
import removeInstallerLink from './sequence.d/remove_installer_link.js';
|
|
35
|
+
import removeHomecryptHack from './sequence.d/remove-homecrypt-hack.js';
|
|
35
36
|
import initramfsCfg from './sequence.d/initramfs_cfg.js';
|
|
36
37
|
import initramfs from './sequence.d/initramfs.js';
|
|
37
38
|
import delLiveUser from './sequence.d/del_live_user.js';
|
|
@@ -63,6 +64,7 @@ export default class Sequence {
|
|
|
63
64
|
bootloader: typeof bootloader;
|
|
64
65
|
packages: typeof packages;
|
|
65
66
|
removeInstallerLink: typeof removeInstallerLink;
|
|
67
|
+
removeHomecryptHack: typeof removeHomecryptHack;
|
|
66
68
|
initramfsCfg: typeof initramfsCfg;
|
|
67
69
|
initramfs: typeof initramfs;
|
|
68
70
|
delLiveUser: typeof delLiveUser;
|
|
@@ -44,6 +44,7 @@ import grubcfg from './sequence.d/grubcfg.js';
|
|
|
44
44
|
import bootloader from './sequence.d/bootloader.js';
|
|
45
45
|
import packages from './sequence.d/packages.js';
|
|
46
46
|
import removeInstallerLink from './sequence.d/remove_installer_link.js';
|
|
47
|
+
import removeHomecryptHack from './sequence.d/remove-homecrypt-hack.js';
|
|
47
48
|
import initramfsCfg from './sequence.d/initramfs_cfg.js';
|
|
48
49
|
import initramfs from './sequence.d/initramfs.js';
|
|
49
50
|
import delLiveUser from './sequence.d/del_live_user.js';
|
|
@@ -79,6 +80,7 @@ export default class Sequence {
|
|
|
79
80
|
bootloader = bootloader;
|
|
80
81
|
packages = packages;
|
|
81
82
|
removeInstallerLink = removeInstallerLink;
|
|
83
|
+
removeHomecryptHack = removeHomecryptHack;
|
|
82
84
|
initramfsCfg = initramfsCfg;
|
|
83
85
|
initramfs = initramfs;
|
|
84
86
|
delLiveUser = delLiveUser;
|
|
@@ -300,13 +302,16 @@ export default class Sequence {
|
|
|
300
302
|
let restoreHomeCrypt = path.resolve(__dirname, '../../../scripts/restore_homecrypt_krill.sh');
|
|
301
303
|
await exec(`${restoreHomeCrypt} ${this.cryptedHomeDevice} ${this.installTarget}`);
|
|
302
304
|
});
|
|
305
|
+
await this.executeStep("Remove Homecrypt hack", 91, async () => {
|
|
306
|
+
await this.removeHomecryptHack();
|
|
307
|
+
});
|
|
303
308
|
}
|
|
304
309
|
// 13. Custom final steps
|
|
305
310
|
const cfs = new CFS();
|
|
306
311
|
const steps = await cfs.steps();
|
|
307
312
|
if (steps.length > 0) {
|
|
308
313
|
for (const step of steps) {
|
|
309
|
-
await this.executeStep(`running ${step}`,
|
|
314
|
+
await this.executeStep(`running ${step}`, 92, () => this.execCalamaresModule(step));
|
|
310
315
|
}
|
|
311
316
|
}
|
|
312
317
|
// 14- Handle chroot if requested
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/eui/eui-create-image.sh
CHANGED
|
File without changes
|
package/eui/eui-start.sh
CHANGED
|
File without changes
|