penguins-eggs 10.0.53 → 10.0.54
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 +1548 -2
- package/README.md +788 -0
- package/addons/eggs/theme/livecd/grub.main.simple.cfg +49 -0
- package/addons/eggs/theme/livecd/isolinux.theme.cfg +6 -5
- package/conf/distros/fedora/calamares/settings.yml +0 -6
- package/dist/classes/bleach.d.ts +32 -0
- package/dist/classes/bleach.js +135 -0
- package/dist/classes/cfs.d.ts +17 -0
- package/dist/classes/cfs.js +39 -0
- package/dist/classes/cli-autologin.d.ts +52 -0
- package/dist/classes/cli-autologin.js +247 -0
- package/dist/classes/compressors.d.ts +54 -0
- package/dist/classes/compressors.js +109 -0
- package/dist/classes/daddy.d.ts +26 -0
- package/dist/classes/daddy.js +167 -0
- package/dist/classes/distro.d.ts +32 -0
- package/dist/classes/distro.js +341 -0
- package/dist/classes/diversions.d.ts +48 -0
- package/dist/classes/diversions.js +116 -0
- package/dist/classes/incubation/branding.d.ts +17 -0
- package/dist/classes/incubation/branding.js +85 -0
- package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +11 -0
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +40 -0
- package/dist/classes/incubation/fisherman-helper/packages.d.ts +20 -0
- package/dist/classes/incubation/fisherman-helper/packages.js +72 -0
- package/dist/classes/incubation/fisherman-helper/settings.d.ts +15 -0
- package/dist/classes/incubation/fisherman-helper/settings.js +83 -0
- package/dist/classes/incubation/fisherman.d.ts +70 -0
- package/dist/classes/incubation/fisherman.js +263 -0
- package/dist/classes/incubation/incubator.d/alpine.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/alpine.js +78 -0
- package/dist/classes/incubation/incubator.d/bionic.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/bionic.js +83 -0
- package/dist/classes/incubation/incubator.d/buster.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/buster.js +85 -0
- package/dist/classes/incubation/incubator.d/jessie.d.ts +31 -0
- package/dist/classes/incubation/incubator.d/jessie.js +44 -0
- package/dist/classes/incubation/incubator.d/noble.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/noble.js +85 -0
- package/dist/classes/incubation/incubator.d/openmamba.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/openmamba.js +81 -0
- package/dist/classes/incubation/incubator.d/opensuse.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/opensuse.js +81 -0
- package/dist/classes/incubation/incubator.d/rolling.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/rolling.js +80 -0
- package/dist/classes/incubation/incubator.d.ts +44 -0
- package/dist/classes/incubation/incubator.js +382 -0
- package/dist/classes/incubation/installer.d.ts +13 -0
- package/dist/classes/incubation/installer.js +52 -0
- package/dist/classes/keyboards.d.ts +50 -0
- package/dist/classes/keyboards.js +287 -0
- package/dist/classes/locales.d.ts +21 -0
- package/dist/classes/locales.js +77 -0
- package/dist/classes/network.d.ts +37 -0
- package/dist/classes/network.js +98 -0
- package/dist/classes/ovary.d.ts +198 -0
- package/dist/classes/ovary.js +1849 -0
- package/dist/classes/pacman.d/aldos.d.ts +52 -0
- package/dist/classes/pacman.d/aldos.js +100 -0
- package/dist/classes/pacman.d/alpine.d.ts +56 -0
- package/dist/classes/pacman.d/alpine.js +162 -0
- package/dist/classes/pacman.d/archlinux.d.ts +62 -0
- package/dist/classes/pacman.d/archlinux.js +137 -0
- package/dist/classes/pacman.d/debian.d.ts +65 -0
- package/dist/classes/pacman.d/debian.js +143 -0
- package/dist/classes/pacman.d/fedora.d.ts +53 -0
- package/dist/classes/pacman.d/fedora.js +101 -0
- package/dist/classes/pacman.d/openmamba.d.ts +52 -0
- package/dist/classes/pacman.d/openmamba.js +100 -0
- package/dist/classes/pacman.d/opensuse.d.ts +53 -0
- package/dist/classes/pacman.d/opensuse.js +102 -0
- package/dist/classes/pacman.d/voidlinux.d.ts +52 -0
- package/dist/classes/pacman.d/voidlinux.js +90 -0
- package/dist/classes/pacman.d.ts +139 -0
- package/dist/classes/pacman.js +775 -0
- package/dist/classes/pve-live.d.ts +17 -0
- package/dist/classes/pve-live.js +52 -0
- package/dist/classes/pxe.d.ts +74 -0
- package/dist/classes/pxe.js +410 -0
- package/dist/classes/settings.d.ts +53 -0
- package/dist/classes/settings.js +185 -0
- package/dist/classes/sources_list.d.ts +28 -0
- package/dist/classes/sources_list.js +89 -0
- package/dist/classes/systemctl.d.ts +47 -0
- package/dist/classes/systemctl.js +86 -0
- package/dist/classes/tailor.d.ts +50 -0
- package/dist/classes/tailor.js +526 -0
- package/dist/classes/tools.d.ts +26 -0
- package/dist/classes/tools.js +50 -0
- package/dist/classes/users.d.ts +28 -0
- package/dist/classes/users.js +143 -0
- package/dist/classes/utils.d.ts +324 -0
- package/dist/classes/utils.js +984 -0
- package/dist/classes/xdg.d.ts +45 -0
- package/dist/classes/xdg.js +337 -0
- package/dist/classes/yolk.d.ts +33 -0
- package/dist/classes/yolk.js +114 -0
- package/dist/commands/adapt.d.ts +17 -0
- package/dist/commands/adapt.js +33 -0
- package/dist/commands/analyze.d.ts +26 -0
- package/dist/commands/analyze.js +95 -0
- package/dist/commands/calamares.d.ts +29 -0
- package/dist/commands/calamares.js +112 -0
- package/dist/commands/config.d.ts +35 -0
- package/dist/commands/config.js +120 -0
- package/dist/commands/cuckoo.d.ts +16 -0
- package/dist/commands/cuckoo.js +62 -0
- package/dist/commands/dad.d.ts +20 -0
- package/dist/commands/dad.js +46 -0
- package/dist/commands/export/iso.d.ts +19 -0
- package/dist/commands/export/iso.js +55 -0
- package/dist/commands/export/pkg.d.ts +29 -0
- package/dist/commands/export/pkg.js +163 -0
- package/dist/commands/export/tarballs.d.ts +27 -0
- package/dist/commands/export/tarballs.js +84 -0
- package/dist/commands/install.d.ts +37 -0
- package/dist/commands/install.js +88 -0
- package/dist/commands/kill.d.ts +24 -0
- package/dist/commands/kill.js +50 -0
- package/dist/commands/love.d.ts +20 -0
- package/dist/commands/love.js +59 -0
- package/dist/commands/mom.d.ts +16 -0
- package/dist/commands/mom.js +30 -0
- package/dist/commands/produce.d.ts +34 -0
- package/dist/commands/produce.js +201 -0
- package/dist/commands/status.d.ts +23 -0
- package/dist/commands/status.js +31 -0
- package/dist/commands/syncfrom.d.ts +45 -0
- package/dist/commands/syncfrom.js +152 -0
- package/dist/commands/syncto.d.ts +40 -0
- package/dist/commands/syncto.js +175 -0
- package/dist/commands/tools/clean.d.ts +18 -0
- package/dist/commands/tools/clean.js +37 -0
- package/dist/commands/tools/ppa.d.ts +26 -0
- package/dist/commands/tools/ppa.js +138 -0
- package/dist/commands/tools/skel.d.ts +18 -0
- package/dist/commands/tools/skel.js +44 -0
- package/dist/commands/tools/stat.d.ts +31 -0
- package/dist/commands/tools/stat.js +70 -0
- package/dist/commands/tools/yolk.d.ts +24 -0
- package/dist/commands/tools/yolk.js +45 -0
- package/dist/commands/update.d.ts +51 -0
- package/dist/commands/update.js +219 -0
- package/dist/commands/wardrobe/get.d.ts +23 -0
- package/dist/commands/wardrobe/get.js +52 -0
- package/dist/commands/wardrobe/list.d.ts +24 -0
- package/dist/commands/wardrobe/list.js +125 -0
- package/dist/commands/wardrobe/show.d.ts +25 -0
- package/dist/commands/wardrobe/show.js +97 -0
- package/dist/commands/wardrobe/wear.d.ts +26 -0
- package/dist/commands/wardrobe/wear.js +84 -0
- package/dist/components/finished.d.ts +16 -0
- package/dist/components/finished.js +56 -0
- package/dist/components/information.d.ts +8 -0
- package/dist/components/information.js +154 -0
- package/dist/components/install.d.ts +15 -0
- package/dist/components/install.js +60 -0
- package/dist/components/keyboard.d.ts +16 -0
- package/dist/components/keyboard.js +54 -0
- package/dist/components/location.d.ts +16 -0
- package/dist/components/location.js +59 -0
- package/dist/components/network.d.ts +19 -0
- package/dist/components/network.js +65 -0
- package/dist/components/partitions.d.ts +16 -0
- package/dist/components/partitions.js +73 -0
- package/dist/components/steps.d.ts +13 -0
- package/dist/components/steps.js +148 -0
- package/dist/components/summary.d.ts +24 -0
- package/dist/components/summary.js +81 -0
- package/dist/components/title.d.ts +11 -0
- package/dist/components/title.js +35 -0
- package/dist/components/users.d.ts +24 -0
- package/dist/components/users.js +80 -0
- package/dist/components/welcome.d.ts +13 -0
- package/dist/components/welcome.js +63 -0
- package/dist/index-old.d.ts +8 -0
- package/dist/index-old.js +8 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +147 -0
- package/dist/interfaces/i-addons.d.ts +12 -0
- package/dist/interfaces/i-addons.js +8 -0
- package/dist/interfaces/i-analyze.d.ts +17 -0
- package/dist/interfaces/i-analyze.js +17 -0
- package/dist/interfaces/i-app.d.ts +14 -0
- package/dist/interfaces/i-app.js +8 -0
- package/dist/interfaces/i-branding.d.ts +36 -0
- package/dist/interfaces/i-branding.js +8 -0
- package/dist/interfaces/i-calamares-displaymanager.d.ts +17 -0
- package/dist/interfaces/i-calamares-displaymanager.js +1 -0
- package/dist/interfaces/i-calamares-finished.d.ts +12 -0
- package/dist/interfaces/i-calamares-finished.js +1 -0
- package/dist/interfaces/i-calamares-packages.d.ts +28 -0
- package/dist/interfaces/i-calamares-packages.js +1 -0
- package/dist/interfaces/i-calamares-partition.d.ts +40 -0
- package/dist/interfaces/i-calamares-partition.js +1 -0
- package/dist/interfaces/i-config-tools.d.ts +15 -0
- package/dist/interfaces/i-config-tools.js +8 -0
- package/dist/interfaces/i-devices.d.ts +20 -0
- package/dist/interfaces/i-devices.js +8 -0
- package/dist/interfaces/i-distro.d.ts +23 -0
- package/dist/interfaces/i-distro.js +8 -0
- package/dist/interfaces/i-drive-list.d.ts +33 -0
- package/dist/interfaces/i-drive-list.js +8 -0
- package/dist/interfaces/i-eggs-config.d.ts +32 -0
- package/dist/interfaces/i-eggs-config.js +8 -0
- package/dist/interfaces/i-excludes.d.ts +14 -0
- package/dist/interfaces/i-excludes.js +8 -0
- package/dist/interfaces/i-exec.d.ts +11 -0
- package/dist/interfaces/i-exec.js +8 -0
- package/dist/interfaces/i-initrd.d.ts +13 -0
- package/dist/interfaces/i-initrd.js +8 -0
- package/dist/interfaces/i-install.d.ts +16 -0
- package/dist/interfaces/i-install.js +8 -0
- package/dist/interfaces/i-installer.d.ts +17 -0
- package/dist/interfaces/i-installer.js +8 -0
- package/dist/interfaces/i-krill-config.d.ts +33 -0
- package/dist/interfaces/i-krill-config.js +8 -0
- package/dist/interfaces/i-krill.d.ts +42 -0
- package/dist/interfaces/i-krill.js +8 -0
- package/dist/interfaces/i-materia.d.ts +36 -0
- package/dist/interfaces/i-materia.js +8 -0
- package/dist/interfaces/i-net.d.ts +16 -0
- package/dist/interfaces/i-net.js +8 -0
- package/dist/interfaces/i-packages.d.ts +16 -0
- package/dist/interfaces/i-packages.js +8 -0
- package/dist/interfaces/i-partitions.d.ts +16 -0
- package/dist/interfaces/i-partitions.js +8 -0
- package/dist/interfaces/i-pxe.d.ts +45 -0
- package/dist/interfaces/i-pxe.js +1 -0
- package/dist/interfaces/i-remix.d.ts +21 -0
- package/dist/interfaces/i-remix.js +8 -0
- package/dist/interfaces/i-settings.d.ts +33 -0
- package/dist/interfaces/i-settings.js +8 -0
- package/dist/interfaces/i-user.d.ts +14 -0
- package/dist/interfaces/i-user.js +8 -0
- package/dist/interfaces/i-workdir.d.ts +14 -0
- package/dist/interfaces/i-workdir.js +8 -0
- package/dist/interfaces/i-xkb-model.d.ts +24 -0
- package/dist/interfaces/i-xkb-model.js +8 -0
- package/dist/interfaces/index.d.ts +25 -0
- package/dist/interfaces/index.js +8 -0
- package/dist/krill/modules/add-user.d.ts +20 -0
- package/dist/krill/modules/add-user.js +48 -0
- package/dist/krill/modules/bootloader-config.d.ts +14 -0
- package/dist/krill/modules/bootloader-config.js +165 -0
- package/dist/krill/modules/bootloader.d.ts +14 -0
- package/dist/krill/modules/bootloader.js +157 -0
- package/dist/krill/modules/change-password.d.ts +15 -0
- package/dist/krill/modules/change-password.js +18 -0
- package/dist/krill/modules/del-live-user.d.ts +14 -0
- package/dist/krill/modules/del-live-user.js +39 -0
- package/dist/krill/modules/fstab.d.ts +14 -0
- package/dist/krill/modules/fstab.js +123 -0
- package/dist/krill/modules/grubcfg.d.ts +17 -0
- package/dist/krill/modules/grubcfg.js +29 -0
- package/dist/krill/modules/hostname.d.ts +13 -0
- package/dist/krill/modules/hostname.js +50 -0
- package/dist/krill/modules/initramfs-cfg.d.ts +14 -0
- package/dist/krill/modules/initramfs-cfg.js +22 -0
- package/dist/krill/modules/initramfs.d.ts +13 -0
- package/dist/krill/modules/initramfs.js +54 -0
- package/dist/krill/modules/locale-cfg.d.ts +10 -0
- package/dist/krill/modules/locale-cfg.js +58 -0
- package/dist/krill/modules/locale.d.ts +13 -0
- package/dist/krill/modules/locale.js +91 -0
- package/dist/krill/modules/m-keyboard.d.ts +14 -0
- package/dist/krill/modules/m-keyboard.js +58 -0
- package/dist/krill/modules/machine-id.d.ts +15 -0
- package/dist/krill/modules/machine-id.js +33 -0
- package/dist/krill/modules/mkfs.d.ts +15 -0
- package/dist/krill/modules/mkfs.js +50 -0
- package/dist/krill/modules/mount-fs.d.ts +17 -0
- package/dist/krill/modules/mount-fs.js +62 -0
- package/dist/krill/modules/mount-vfs.d.ts +17 -0
- package/dist/krill/modules/mount-vfs.js +40 -0
- package/dist/krill/modules/network-cfg.d.ts +19 -0
- package/dist/krill/modules/network-cfg.js +64 -0
- package/dist/krill/modules/packages.d.ts +14 -0
- package/dist/krill/modules/packages.js +111 -0
- package/dist/krill/modules/partition.d.ts +20 -0
- package/dist/krill/modules/partition.js +324 -0
- package/dist/krill/modules/remove-installer-link.d.ts +13 -0
- package/dist/krill/modules/remove-installer-link.js +35 -0
- package/dist/krill/modules/umount.d.ts +14 -0
- package/dist/krill/modules/umount.js +28 -0
- package/dist/krill/modules/unpackfs.d.ts +13 -0
- package/dist/krill/modules/unpackfs.js +20 -0
- package/dist/krill/prepare.d.ts +78 -0
- package/dist/krill/prepare.js +624 -0
- package/dist/krill/sequence.d.ts +154 -0
- package/dist/krill/sequence.js +652 -0
- package/dist/lib/get_address.d.ts +8 -0
- package/dist/lib/get_address.js +23 -0
- package/dist/lib/get_dns.d.ts +8 -0
- package/dist/lib/get_dns.js +23 -0
- package/dist/lib/get_domain.d.ts +8 -0
- package/dist/lib/get_domain.js +23 -0
- package/dist/lib/get_gateway.d.ts +8 -0
- package/dist/lib/get_gateway.js +23 -0
- package/dist/lib/get_hostname.d.ts +8 -0
- package/dist/lib/get_hostname.js +23 -0
- package/dist/lib/get_netmask.d.ts +8 -0
- package/dist/lib/get_netmask.js +23 -0
- package/dist/lib/get_password.d.ts +8 -0
- package/dist/lib/get_password.js +36 -0
- package/dist/lib/get_userfullname.d.ts +8 -0
- package/dist/lib/get_userfullname.js +23 -0
- package/dist/lib/get_username.d.ts +8 -0
- package/dist/lib/get_username.js +23 -0
- package/dist/lib/kill_me_softly.d.ts +11 -0
- package/dist/lib/kill_me_softly.js +61 -0
- package/dist/lib/select_address_type.d.ts +8 -0
- package/dist/lib/select_address_type.js +24 -0
- package/dist/lib/select_filesystem_type.d.ts +8 -0
- package/dist/lib/select_filesystem_type.js +46 -0
- package/dist/lib/select_installation_device.d.ts +8 -0
- package/dist/lib/select_installation_device.js +30 -0
- package/dist/lib/select_installation_mode.d.ts +8 -0
- package/dist/lib/select_installation_mode.js +24 -0
- package/dist/lib/select_interface.d.ts +8 -0
- package/dist/lib/select_interface.js +24 -0
- package/dist/lib/select_keyboard_layout.d.ts +11 -0
- package/dist/lib/select_keyboard_layout.js +36 -0
- package/dist/lib/select_keyboard_model.d.ts +11 -0
- package/dist/lib/select_keyboard_model.js +34 -0
- package/dist/lib/select_keyboard_option.d.ts +11 -0
- package/dist/lib/select_keyboard_option.js +34 -0
- package/dist/lib/select_keyboard_variant.d.ts +11 -0
- package/dist/lib/select_keyboard_variant.js +35 -0
- package/dist/lib/select_languages.d.ts +8 -0
- package/dist/lib/select_languages.js +28 -0
- package/dist/lib/select_regions.d.ts +8 -0
- package/dist/lib/select_regions.js +24 -0
- package/dist/lib/select_user_swap_choice.d.ts +8 -0
- package/dist/lib/select_user_swap_choice.js +34 -0
- package/dist/lib/select_zones.d.ts +8 -0
- package/dist/lib/select_zones.js +518 -0
- package/dist/lib/utils.d.ts +34 -0
- package/dist/lib/utils.js +79 -0
- package/dist/penguins-eggs-tarball-10.0.54-1-linux-x64.tar.gz +0 -0
- package/package.json +11 -7
- package/scripts/_eggs +10 -1
- package/scripts/eggs.bash +1 -0
- /package/addons/eggs/theme/livecd/{grub.main.cfg → grub.main.full.cfg} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/compressors.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 shx from 'shelljs';
|
|
9
|
+
export default class Compressors {
|
|
10
|
+
dest = '/tmp/eggs-mksquash-dest';
|
|
11
|
+
isEnabled = {
|
|
12
|
+
error: false,
|
|
13
|
+
gzip: true,
|
|
14
|
+
lz4: false,
|
|
15
|
+
lzma: false,
|
|
16
|
+
lzo: false,
|
|
17
|
+
xz: false,
|
|
18
|
+
zstd: false
|
|
19
|
+
};
|
|
20
|
+
source = '/tmp/eggs-mksquash-test';
|
|
21
|
+
/**
|
|
22
|
+
* fast compression
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
fast() {
|
|
26
|
+
let comp = 'gzip';
|
|
27
|
+
if (this.isEnabled.zstd) {
|
|
28
|
+
comp = 'zstd -b 1M -Xcompression-level 3';
|
|
29
|
+
}
|
|
30
|
+
else if (this.isEnabled.lz4) {
|
|
31
|
+
comp = 'lz4';
|
|
32
|
+
}
|
|
33
|
+
return comp;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* max
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
max() {
|
|
40
|
+
let filter = 'x86';
|
|
41
|
+
if (process.arch === 'arm64') {
|
|
42
|
+
filter = 'arm';
|
|
43
|
+
}
|
|
44
|
+
const options = '-b 1M -no-duplicates -no-recovery -always-use-fragments';
|
|
45
|
+
if (process.arch === 'ia32') {
|
|
46
|
+
// options = '-b 1M'
|
|
47
|
+
}
|
|
48
|
+
const comp = `xz -Xbcj ${filter} ${options}`;
|
|
49
|
+
return comp;
|
|
50
|
+
}
|
|
51
|
+
pendrive(level = '15') {
|
|
52
|
+
let comp = 'gzip';
|
|
53
|
+
if (this.isEnabled.zstd) {
|
|
54
|
+
comp = `zstd -b 1M -Xcompression-level ${level}`;
|
|
55
|
+
}
|
|
56
|
+
else if (this.isEnabled.lz4) {
|
|
57
|
+
comp = 'lz4';
|
|
58
|
+
}
|
|
59
|
+
return comp;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* populate
|
|
63
|
+
*/
|
|
64
|
+
async populate() {
|
|
65
|
+
await this.prepareCheck();
|
|
66
|
+
this.isEnabled.error = await this.check('error');
|
|
67
|
+
this.isEnabled.lzma = await this.check('lzma');
|
|
68
|
+
this.isEnabled.lzo = await this.check('lzo');
|
|
69
|
+
this.isEnabled.lz4 = await this.check('lz4');
|
|
70
|
+
this.isEnabled.xz = await this.check('xz');
|
|
71
|
+
this.isEnabled.zstd = await this.check('zstd');
|
|
72
|
+
await this.removeCheck();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* standard
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
standard() {
|
|
79
|
+
const comp = 'xz -b 1M';
|
|
80
|
+
return comp;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* check mksquashfs exists
|
|
84
|
+
* @param compressor
|
|
85
|
+
* @returns
|
|
86
|
+
*/
|
|
87
|
+
async check(compressor) {
|
|
88
|
+
let result = false;
|
|
89
|
+
const { stderr } = shx.exec('mksquashfs ' + this.source + ' ' + this.dest + ' -comp ' + compressor + ' -ef ' + this.dest, { silent: true });
|
|
90
|
+
if (stderr === '') {
|
|
91
|
+
result = true;
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* prepareCheck
|
|
97
|
+
*/
|
|
98
|
+
async prepareCheck() {
|
|
99
|
+
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
100
|
+
shx.exec('mkdir ' + this.source, { silent: true });
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* removeCheck
|
|
104
|
+
*/
|
|
105
|
+
async removeCheck() {
|
|
106
|
+
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
107
|
+
shx.exec('rm -f ' + this.dest, { silent: true });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/daddy.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 Settings from '../classes/settings.js';
|
|
9
|
+
import { IEggsConfig } from '../interfaces/i-eggs-config.js';
|
|
10
|
+
export default class Daddy {
|
|
11
|
+
settings: Settings;
|
|
12
|
+
/**
|
|
13
|
+
* editConfif
|
|
14
|
+
* @param c
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
editConfig(c: IEggsConfig): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param reset
|
|
21
|
+
* @param isCustom
|
|
22
|
+
* @param fileCustom
|
|
23
|
+
* @param verbose
|
|
24
|
+
*/
|
|
25
|
+
helpMe(reset?: boolean, isCustom?: boolean, fileCustom?: string, verbose?: boolean): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/daddy.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 chalk from 'chalk';
|
|
9
|
+
import inquirer from 'inquirer';
|
|
10
|
+
import yaml from 'js-yaml';
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
// _dirname
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
// We need to remove .js extension from import
|
|
15
|
+
import Pacman from '../classes/pacman.js';
|
|
16
|
+
import Settings from '../classes/settings.js';
|
|
17
|
+
import Utils from '../classes/utils.js';
|
|
18
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
19
|
+
export default class Daddy {
|
|
20
|
+
settings = {};
|
|
21
|
+
/**
|
|
22
|
+
* editConfif
|
|
23
|
+
* @param c
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
async editConfig(c) {
|
|
27
|
+
// Utils.titles('dad')
|
|
28
|
+
console.log(chalk.cyan('Edit and save Live system parameters'));
|
|
29
|
+
console.log();
|
|
30
|
+
let compressionOpt = 0;
|
|
31
|
+
if (c.compression === 'xz') {
|
|
32
|
+
compressionOpt = 1;
|
|
33
|
+
}
|
|
34
|
+
else if (c.compression === 'xz -Xbcj x86') {
|
|
35
|
+
compressionOpt = 2;
|
|
36
|
+
}
|
|
37
|
+
if (c.snapshot_prefix === '') {
|
|
38
|
+
c.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
39
|
+
}
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
const questions = [
|
|
42
|
+
{
|
|
43
|
+
default: c.snapshot_prefix,
|
|
44
|
+
message: 'LiveCD iso prefix: ',
|
|
45
|
+
name: 'snapshot_prefix',
|
|
46
|
+
type: 'input'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
default: c.snapshot_basename,
|
|
50
|
+
message: 'LiveCD iso basename: ',
|
|
51
|
+
name: 'snapshot_basename',
|
|
52
|
+
type: 'input'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
default: c.user_opt,
|
|
56
|
+
message: 'LiveCD user:',
|
|
57
|
+
name: 'user_opt',
|
|
58
|
+
type: 'input'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
default: c.user_opt_passwd,
|
|
62
|
+
message: 'LiveCD user password: ',
|
|
63
|
+
name: 'user_opt_passwd',
|
|
64
|
+
type: 'input'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
default: c.root_passwd,
|
|
68
|
+
message: 'LiveCD root password: ',
|
|
69
|
+
name: 'root_passwd',
|
|
70
|
+
type: 'input'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
choices: ['fast', 'max'],
|
|
74
|
+
default: compressionOpt,
|
|
75
|
+
message: 'LiveCD compression: ',
|
|
76
|
+
name: 'compression',
|
|
77
|
+
type: 'list'
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
inquirer.prompt(questions).then((options) => {
|
|
81
|
+
resolve(JSON.stringify(options));
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param reset
|
|
88
|
+
* @param isCustom
|
|
89
|
+
* @param fileCustom
|
|
90
|
+
* @param verbose
|
|
91
|
+
*/
|
|
92
|
+
async helpMe(reset = false, isCustom = false, fileCustom = '', verbose = false) {
|
|
93
|
+
if (isCustom) {
|
|
94
|
+
console.log('using custom file:', fileCustom);
|
|
95
|
+
}
|
|
96
|
+
// Controllo configurazione
|
|
97
|
+
if (!Pacman.configurationCheck()) {
|
|
98
|
+
console.log('- creating configuration dir...');
|
|
99
|
+
await Pacman.configurationInstall(verbose);
|
|
100
|
+
}
|
|
101
|
+
// Templates
|
|
102
|
+
if (!Pacman.distroTemplateCheck()) {
|
|
103
|
+
console.log('- distro template install...');
|
|
104
|
+
await Pacman.distroTemplateInstall(verbose);
|
|
105
|
+
}
|
|
106
|
+
//Calamares
|
|
107
|
+
if (!Pacman.calamaresExists() &&
|
|
108
|
+
Pacman.isInstalledGui() &&
|
|
109
|
+
Pacman.isCalamaresAvailable()) {
|
|
110
|
+
console.log('- this is a GUI system, calamares is available, but NOT installed');
|
|
111
|
+
}
|
|
112
|
+
// show and edit configuration
|
|
113
|
+
this.settings = new Settings();
|
|
114
|
+
let config = {};
|
|
115
|
+
let jsonConf = '';
|
|
116
|
+
if (await this.settings.load()) {
|
|
117
|
+
config = this.settings.config;
|
|
118
|
+
config.compression = 'fast';
|
|
119
|
+
if (reset || isCustom) {
|
|
120
|
+
if (config.snapshot_prefix === '') {
|
|
121
|
+
config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
122
|
+
}
|
|
123
|
+
jsonConf = JSON.stringify(config);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
jsonConf = await this.editConfig(config);
|
|
127
|
+
}
|
|
128
|
+
// Custom configuration
|
|
129
|
+
if (isCustom) {
|
|
130
|
+
const conf = fs.readFileSync(fileCustom, 'utf8');
|
|
131
|
+
const confCustom = yaml.load(conf);
|
|
132
|
+
config.snapshot_basename = confCustom.snapshot_basename;
|
|
133
|
+
config.snapshot_prefix = confCustom.snapshot_prefix;
|
|
134
|
+
config.user_opt = confCustom.user_opt;
|
|
135
|
+
config.user_opt_passwd = confCustom.user_opt_passwd;
|
|
136
|
+
config.root_passwd = confCustom.root_passwd;
|
|
137
|
+
config.theme = confCustom.theme;
|
|
138
|
+
jsonConf = JSON.stringify(config);
|
|
139
|
+
}
|
|
140
|
+
// Save new configuration
|
|
141
|
+
const confNew = JSON.parse(jsonConf);
|
|
142
|
+
config.snapshot_basename = confNew.snapshot_basename;
|
|
143
|
+
config.snapshot_prefix = confNew.snapshot_prefix;
|
|
144
|
+
config.user_opt = confNew.user_opt;
|
|
145
|
+
config.user_opt_passwd = confNew.user_opt_passwd;
|
|
146
|
+
config.root_passwd = confNew.root_passwd;
|
|
147
|
+
config.theme = confNew.theme;
|
|
148
|
+
await this.settings.save(config);
|
|
149
|
+
}
|
|
150
|
+
console.log();
|
|
151
|
+
console.log(chalk.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
|
|
152
|
+
console.log();
|
|
153
|
+
console.log(chalk.cyan(`You can create a clean ISO with: `) + chalk.white(`sudo eggs produce`));
|
|
154
|
+
console.log(chalk.cyan(`or a full personal clone: `) + chalk.white(`sudo eggs produce --clone`));
|
|
155
|
+
console.log();
|
|
156
|
+
console.log(chalk.cyan(`If you don't have enough space to remaster, you can mount`));
|
|
157
|
+
console.log(chalk.cyan(`some remote or local space. Follow the samples:`));
|
|
158
|
+
console.log(chalk.cyan(`- first, create an hidden mountpoint under the nest:`));
|
|
159
|
+
console.log(chalk.white(`sudo mkdir /home/eggs/.mnt -p`));
|
|
160
|
+
console.log(chalk.cyan(`- then, mount remote space:`));
|
|
161
|
+
console.log(chalk.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
|
|
162
|
+
console.log(chalk.cyan('- or, mount a local partition:'));
|
|
163
|
+
console.log(chalk.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
|
|
164
|
+
console.log();
|
|
165
|
+
console.log(chalk.cyan('More help? ') + chalk.white('eggs mom'));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* penguins-eggs
|
|
3
|
+
* class: distro.ts
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import { IDistro } from '../interfaces/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Classe
|
|
11
|
+
*/
|
|
12
|
+
declare class Distro implements IDistro {
|
|
13
|
+
bugReportUrl: string;
|
|
14
|
+
codenameId: string;
|
|
15
|
+
codenameLikeId: string;
|
|
16
|
+
distroId: string;
|
|
17
|
+
distroLike: string;
|
|
18
|
+
familyId: string;
|
|
19
|
+
homeUrl: string;
|
|
20
|
+
isCalamaresAvailable: boolean;
|
|
21
|
+
liveMediumPath: string;
|
|
22
|
+
releaseId: string;
|
|
23
|
+
squashfs: string;
|
|
24
|
+
supportUrl: string;
|
|
25
|
+
syslinuxPath: string;
|
|
26
|
+
usrLibPath: string;
|
|
27
|
+
/**
|
|
28
|
+
* Costruttore
|
|
29
|
+
*/
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
32
|
+
export default Distro;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* penguins-eggs
|
|
3
|
+
* class: distro.ts
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import yaml from 'js-yaml';
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import shell from 'shelljs';
|
|
12
|
+
import Utils from './utils.js';
|
|
13
|
+
import Diversions from './diversions.js';
|
|
14
|
+
// _dirname
|
|
15
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
16
|
+
/**
|
|
17
|
+
* Classe
|
|
18
|
+
*/
|
|
19
|
+
class Distro {
|
|
20
|
+
bugReportUrl;
|
|
21
|
+
codenameId;
|
|
22
|
+
codenameLikeId;
|
|
23
|
+
distroId;
|
|
24
|
+
distroLike;
|
|
25
|
+
familyId;
|
|
26
|
+
homeUrl;
|
|
27
|
+
isCalamaresAvailable;
|
|
28
|
+
liveMediumPath;
|
|
29
|
+
releaseId;
|
|
30
|
+
squashfs;
|
|
31
|
+
supportUrl;
|
|
32
|
+
syslinuxPath;
|
|
33
|
+
usrLibPath;
|
|
34
|
+
/**
|
|
35
|
+
* Costruttore
|
|
36
|
+
*/
|
|
37
|
+
constructor() {
|
|
38
|
+
let found = false;
|
|
39
|
+
// Tutti i default sono per Debian
|
|
40
|
+
this.bugReportUrl = 'https://github.com-pieroproietti/penguins-eggs/issue';
|
|
41
|
+
this.codenameId = '';
|
|
42
|
+
this.codenameLikeId = '';
|
|
43
|
+
this.distroId = '';
|
|
44
|
+
this.distroLike = '';
|
|
45
|
+
this.familyId = 'debian';
|
|
46
|
+
this.homeUrl = 'https://penguins-eggs.net';
|
|
47
|
+
this.isCalamaresAvailable = true;
|
|
48
|
+
this.liveMediumPath = '/run/live/medium/';
|
|
49
|
+
this.releaseId = '';
|
|
50
|
+
this.squashfs = 'live/filesystem.squashfs';
|
|
51
|
+
this.supportUrl = 'https://penguins-eggs.net';
|
|
52
|
+
this.syslinuxPath = path.resolve(__dirname, `../../syslinux`);
|
|
53
|
+
this.usrLibPath = '/usr/lib';
|
|
54
|
+
/**
|
|
55
|
+
* lsb_release -cs per codename (version)
|
|
56
|
+
* lsb_release -is per distribuzione
|
|
57
|
+
* lsb_release -rs per release
|
|
58
|
+
*/
|
|
59
|
+
this.codenameId = shell.exec(`lsb_release -cs`, { silent: true }).stdout.toString().trim();
|
|
60
|
+
this.releaseId = shell.exec(`lsb_release -rs`, { silent: true }).stdout.toString().trim();
|
|
61
|
+
this.distroId = shell.exec(`lsb_release -is`, { silent: true }).stdout.toString().trim();
|
|
62
|
+
if (this.distroId === 'Debian' && this.codenameId === 'sid') {
|
|
63
|
+
this.codenameId = 'trixie';
|
|
64
|
+
}
|
|
65
|
+
if (this.distroId.includes('BigLinux')) {
|
|
66
|
+
this.distroId = "BigLinux";
|
|
67
|
+
}
|
|
68
|
+
if (this.distroId.includes('BigCommunity')) {
|
|
69
|
+
this.distroId = "BigCommunity";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Alpine, Fedora, openmamba, opensuse, VoidLinux solo distroId.
|
|
73
|
+
*
|
|
74
|
+
* Debian, Devuan, Ubuntu e derivate ricadono in
|
|
75
|
+
* default e si analizza il codebaseId
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
if (this.distroId === 'ALDOS') {
|
|
79
|
+
this.familyId = 'aldos';
|
|
80
|
+
this.distroLike = 'ALDOS';
|
|
81
|
+
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
82
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
83
|
+
this.liveMediumPath = '/run/initramfs/live/';
|
|
84
|
+
/**
|
|
85
|
+
* Alpine compatible
|
|
86
|
+
*/
|
|
87
|
+
}
|
|
88
|
+
else if (this.distroId === 'Alpine') {
|
|
89
|
+
this.familyId = 'alpine';
|
|
90
|
+
this.distroLike = this.distroId;
|
|
91
|
+
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
92
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
93
|
+
this.liveMediumPath = '/mnt/'; // Qua è deciso da noi
|
|
94
|
+
/**
|
|
95
|
+
* Fedora/RHEL compatible
|
|
96
|
+
*/
|
|
97
|
+
}
|
|
98
|
+
else if (this.distroId === 'AlmaLinux' ||
|
|
99
|
+
this.distroId === 'Fedora' ||
|
|
100
|
+
this.distroId === 'NobaraLinux' ||
|
|
101
|
+
this.distroId === 'RockyLinux') {
|
|
102
|
+
this.familyId = 'fedora';
|
|
103
|
+
this.distroLike = 'Fedora';
|
|
104
|
+
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
105
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
106
|
+
this.liveMediumPath = '/run/initramfs/live/';
|
|
107
|
+
/**
|
|
108
|
+
* openmamba
|
|
109
|
+
*/
|
|
110
|
+
}
|
|
111
|
+
else if (this.distroId === 'openmamba') {
|
|
112
|
+
this.familyId = 'openmamba';
|
|
113
|
+
this.distroLike = 'openmamba';
|
|
114
|
+
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
115
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
116
|
+
this.liveMediumPath = '/run/initramfs/live/';
|
|
117
|
+
/**
|
|
118
|
+
* opensuse compatible
|
|
119
|
+
*/
|
|
120
|
+
}
|
|
121
|
+
else if (this.distroId === 'openSUSE') {
|
|
122
|
+
this.familyId = 'opensuse';
|
|
123
|
+
this.distroLike = this.distroId;
|
|
124
|
+
this.codenameId = 'rolling'; // viene rimosso dal nome
|
|
125
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
126
|
+
this.liveMediumPath = '/run/initramfs/live/'; // check
|
|
127
|
+
/**
|
|
128
|
+
* voidlinux compatible
|
|
129
|
+
*/
|
|
130
|
+
}
|
|
131
|
+
else if (this.distroId === 'VoidLinux') {
|
|
132
|
+
this.familyId = 'voidlinux';
|
|
133
|
+
this.distroLike = this.distroId;
|
|
134
|
+
this.codenameId = 'rolling';
|
|
135
|
+
this.codenameLikeId = this.familyId; // per krill
|
|
136
|
+
this.liveMediumPath = '/run/initramfs/live/'; // we must discover
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
/**
|
|
140
|
+
* We must analize codenameId
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* Arch
|
|
144
|
+
*/
|
|
145
|
+
if (this.codenameId === 'rolling' || this.codenameId === 'n/a') {
|
|
146
|
+
this.familyId = 'archlinux';
|
|
147
|
+
this.distroLike = 'Arch';
|
|
148
|
+
this.codenameId = 'rolling';
|
|
149
|
+
this.codenameLikeId = 'rolling';
|
|
150
|
+
this.liveMediumPath = '/run/archiso/bootmnt/';
|
|
151
|
+
this.squashfs = `arch/x86_64/airootfs.sfs`;
|
|
152
|
+
/**
|
|
153
|
+
* Debian jessie
|
|
154
|
+
*/
|
|
155
|
+
}
|
|
156
|
+
else if (this.codenameId === 'jessie') {
|
|
157
|
+
this.distroLike = 'Debian';
|
|
158
|
+
this.codenameLikeId = 'jessie';
|
|
159
|
+
this.liveMediumPath = '/lib/live/mount/medium/';
|
|
160
|
+
this.isCalamaresAvailable = false;
|
|
161
|
+
/**
|
|
162
|
+
* Debian stretch
|
|
163
|
+
*/
|
|
164
|
+
}
|
|
165
|
+
else if (this.codenameId === 'stretch') {
|
|
166
|
+
this.distroLike = 'Debian';
|
|
167
|
+
this.codenameLikeId = 'stretch';
|
|
168
|
+
this.liveMediumPath = '/lib/live/mount/medium/';
|
|
169
|
+
this.isCalamaresAvailable = false;
|
|
170
|
+
/**
|
|
171
|
+
* Debian buster
|
|
172
|
+
*/
|
|
173
|
+
}
|
|
174
|
+
else if (this.codenameId === 'buster') {
|
|
175
|
+
this.distroLike = 'Debian';
|
|
176
|
+
this.codenameLikeId = 'buster';
|
|
177
|
+
/**
|
|
178
|
+
* Debian bullseye
|
|
179
|
+
*/
|
|
180
|
+
}
|
|
181
|
+
else if (this.codenameId === 'bullseye') {
|
|
182
|
+
this.distroLike = 'Debian';
|
|
183
|
+
this.codenameLikeId = 'bullseye';
|
|
184
|
+
/**
|
|
185
|
+
* Debian bookworm
|
|
186
|
+
*/
|
|
187
|
+
}
|
|
188
|
+
else if (this.codenameId === 'bookworm') {
|
|
189
|
+
this.distroLike = 'Debian';
|
|
190
|
+
this.codenameLikeId = 'bookworm';
|
|
191
|
+
/**
|
|
192
|
+
* Debian trixie
|
|
193
|
+
*/
|
|
194
|
+
}
|
|
195
|
+
else if (this.codenameId === 'trixie') {
|
|
196
|
+
this.distroLike = 'Debian';
|
|
197
|
+
this.codenameLikeId = 'trixie';
|
|
198
|
+
/**
|
|
199
|
+
* Devuan beowulf
|
|
200
|
+
*/
|
|
201
|
+
}
|
|
202
|
+
else if (this.codenameId === 'beowulf') {
|
|
203
|
+
this.distroLike = 'Devuan';
|
|
204
|
+
this.codenameLikeId = 'beowulf';
|
|
205
|
+
/**
|
|
206
|
+
* Devuan chimaera
|
|
207
|
+
*/
|
|
208
|
+
}
|
|
209
|
+
else if (this.codenameId === 'chimaera') {
|
|
210
|
+
this.distroLike = 'Devuan';
|
|
211
|
+
this.codenameLikeId = 'chimaera';
|
|
212
|
+
/**
|
|
213
|
+
* Devuan daedalus
|
|
214
|
+
*/
|
|
215
|
+
}
|
|
216
|
+
else if (this.codenameId === 'daedalus') {
|
|
217
|
+
this.distroLike = 'Devuan';
|
|
218
|
+
this.codenameLikeId = 'daedalus';
|
|
219
|
+
/**
|
|
220
|
+
* Devuan excalibur
|
|
221
|
+
*/
|
|
222
|
+
}
|
|
223
|
+
else if (this.codenameId === 'excalibur') {
|
|
224
|
+
this.distroLike = 'Devuan';
|
|
225
|
+
this.codenameLikeId = 'excalibur';
|
|
226
|
+
/**
|
|
227
|
+
* Ubuntu bionic
|
|
228
|
+
*/
|
|
229
|
+
}
|
|
230
|
+
else if (this.codenameId === 'bionic') {
|
|
231
|
+
this.distroLike = 'Ubuntu';
|
|
232
|
+
this.codenameLikeId = 'bionic';
|
|
233
|
+
this.liveMediumPath = '/lib/live/mount/medium/';
|
|
234
|
+
/**
|
|
235
|
+
* Ubuntu focal
|
|
236
|
+
*/
|
|
237
|
+
}
|
|
238
|
+
else if (this.codenameId === 'focal') {
|
|
239
|
+
this.distroLike = 'Ubuntu';
|
|
240
|
+
this.codenameLikeId = 'focal';
|
|
241
|
+
/**
|
|
242
|
+
* Ubuntu jammy
|
|
243
|
+
*/
|
|
244
|
+
}
|
|
245
|
+
else if (this.codenameId === 'jammy') {
|
|
246
|
+
this.distroLike = 'Ubuntu';
|
|
247
|
+
this.codenameLikeId = 'jammy';
|
|
248
|
+
/**
|
|
249
|
+
* Ubuntu noble
|
|
250
|
+
*/
|
|
251
|
+
}
|
|
252
|
+
else if (this.codenameId === 'noble') {
|
|
253
|
+
this.distroLike = 'Ubuntu';
|
|
254
|
+
this.codenameLikeId = 'noble';
|
|
255
|
+
/**
|
|
256
|
+
* Ubuntu devel
|
|
257
|
+
*/
|
|
258
|
+
}
|
|
259
|
+
else if (this.codenameId === 'devel') {
|
|
260
|
+
this.distroLike = 'Ubuntu';
|
|
261
|
+
this.codenameLikeId = 'devel';
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
/**
|
|
265
|
+
* patch per Roy VERIFICARE
|
|
266
|
+
*/
|
|
267
|
+
let file = path.resolve(__dirname, '../../conf/derivatives.yaml');
|
|
268
|
+
if (fs.existsSync('/etc/penguins-eggs.d/derivatives.yaml')) {
|
|
269
|
+
file = '/etc/penguins-eggs.d/derivatives.yaml';
|
|
270
|
+
}
|
|
271
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
272
|
+
const distros = yaml.load(content);
|
|
273
|
+
for (const distro of distros) {
|
|
274
|
+
if (distro.ids !== undefined) {
|
|
275
|
+
for (let n = 0; n < distro.ids.length; n++) {
|
|
276
|
+
if (this.codenameId === distro.ids[n]) {
|
|
277
|
+
found = true;
|
|
278
|
+
this.distroLike = distro.distroLike;
|
|
279
|
+
this.codenameLikeId = distro.id;
|
|
280
|
+
this.familyId = distro.family;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (!found) {
|
|
286
|
+
console.log(`This distro ${this.distroId}/${this.codenameId} is not yet recognized!`);
|
|
287
|
+
console.log('');
|
|
288
|
+
console.log('You can edit /usr/lib/penguins-eggs/conf/derivatives.yaml to add it -');
|
|
289
|
+
console.log('after that - run: sudo eggs dad -d to re-configure eggs.');
|
|
290
|
+
console.log('If you can create your new iso, you can contribute to the project');
|
|
291
|
+
console.log('by suggesting your modification.');
|
|
292
|
+
process.exit(0);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Ultimi ritocchi
|
|
298
|
+
*/
|
|
299
|
+
/**
|
|
300
|
+
* Debian: /usr/lib/x86_64-linux-gnu
|
|
301
|
+
* /usr/lib/aarch64-linux-gnu
|
|
302
|
+
*/
|
|
303
|
+
if (this.familyId === "debian") {
|
|
304
|
+
this.usrLibPath = '/usr/lib/' + Utils.usrLibPath();
|
|
305
|
+
}
|
|
306
|
+
else if (this.familyId === "opensuse") {
|
|
307
|
+
this.usrLibPath = '/usr/lib64/';
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* ManjaroLinux e derivate
|
|
311
|
+
*/
|
|
312
|
+
if (Diversions.isManjaroBased(this.distroId)) {
|
|
313
|
+
this.liveMediumPath = '/run/miso/bootmnt/';
|
|
314
|
+
this.squashfs = 'manjaro/x86_64/livefs.sfs';
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* lettura os_release per i pulsanti
|
|
318
|
+
*/
|
|
319
|
+
const os_release = '/etc/os-release';
|
|
320
|
+
if (fs.existsSync(os_release)) {
|
|
321
|
+
let lines = [];
|
|
322
|
+
if (fs.existsSync(os_release)) {
|
|
323
|
+
const data = fs.readFileSync(os_release, 'utf8');
|
|
324
|
+
lines = data.split('\n');
|
|
325
|
+
}
|
|
326
|
+
// per ogni riga
|
|
327
|
+
for (const line of lines) {
|
|
328
|
+
if (line.startsWith('HOME_URL=')) {
|
|
329
|
+
this.homeUrl = line.slice('HOME_URL='.length).replaceAll('"', '');
|
|
330
|
+
}
|
|
331
|
+
else if (line.startsWith('SUPPORT_URL=')) {
|
|
332
|
+
this.supportUrl = line.slice('SUPPORT_URL='.length).replaceAll('"', '');
|
|
333
|
+
}
|
|
334
|
+
else if (line.startsWith('BUG_REPORT_URL=')) {
|
|
335
|
+
this.bugReportUrl = line.slice('BUG_REPORT_URL='.length).replaceAll('"', '');
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
export default Distro;
|