penguins-eggs 8.1.3 → 9.0.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/README.md +332 -168
- package/addons/README.md +78 -84
- package/addons/{pve → blissos}/theme/applications/install-debian.desktop +0 -0
- package/addons/{deblinux → blissos}/theme/artwork/install-debian.png +0 -0
- package/addons/blissos/theme/calamares/branding/blissos-logo.png +0 -0
- package/addons/{guadalinex → blissos}/theme/calamares/branding/branding.desc +0 -0
- package/addons/blissos/theme/calamares/branding/languages.png +0 -0
- package/addons/blissos/theme/calamares/branding/show.qml +75 -0
- package/addons/blissos/theme/calamares/branding/slide1.png +0 -0
- package/addons/blissos/theme/calamares/branding/slide2.png +0 -0
- package/addons/blissos/theme/calamares/branding/slide3.png +0 -0
- package/addons/blissos/theme/calamares/branding/welcome.png +0 -0
- package/addons/{guadalinex → blissos}/theme/calamares/modules/partition.yml +1 -1
- package/{conf/distros/buster/grub/theme.cfg → addons/blissos/theme/livecd/grub.theme.cfg} +10 -9
- package/{conf/distros/buster/isolinux/stdmenu.template.cfg → addons/blissos/theme/livecd/isolinux.theme.cfg} +4 -0
- package/addons/blissos/theme/livecd/splash.png +0 -0
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +1 -1
- package/addons/eggs/theme/calamares/branding/show.qml +1 -1
- package/addons/eggs/theme/livecd/README.md +19 -6
- package/addons/eggs/theme/livecd/{theme.cfg → grub.theme.cfg} +13 -12
- package/addons/eggs/theme/livecd/isolinux.theme.cfg +46 -0
- package/addons/eggs/theme/livecd/splash.png +0 -0
- package/addons/{ufficiozero/theme/livecd/theme.cfg → neon/theme/livecd/grub.theme.cfg} +13 -12
- package/addons/neon/theme/livecd/isolinux.theme.cfg +46 -0
- package/addons/neon/theme/livecd/splash.png +0 -0
- package/addons/templates/grub.template +28 -0
- package/addons/templates/isolinux.template +29 -0
- package/addons/ufficiozero/theme/applications/install-debian.desktop +17 -2
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +2 -4
- package/conf/distros/bionic/calamares/settings.yml +5 -5
- package/conf/distros/bookworm/README.md +9 -0
- package/conf/distros/bullseye/README.md +6 -8
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +1 -1
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.working.sh +1 -1
- package/conf/distros/buster/calamares/modules/shellprocess_eggs-cleanup.yml +6 -0
- package/conf/distros/buster/calamares/settings.yml +14 -3
- package/conf/distros/chimaera/README.md +3 -0
- package/conf/distros/daedalus/README.md +3 -0
- package/conf/distros/focal/calamares/settings.yml +2 -2
- package/conf/distros/hirsute/README.md +1 -1
- package/conf/distros/impish/README.md +9 -0
- package/conf/distros/jammy/README.md +9 -0
- package/conf/distros/jessie/krill/krill-modules/sources-yolk/sources-yolk.sh +1 -1
- package/conf/distros/rolling/README.md +3 -0
- package/conf/distros/rolling/calamares/calamares-modules/remove-link/module.yml +9 -0
- package/conf/distros/rolling/calamares/calamares-modules/remove-link/remove-link.sh +3 -0
- package/conf/distros/rolling/calamares/modules/displaymanager.yml +22 -0
- package/conf/distros/rolling/calamares/modules/finished.yml +6 -0
- package/conf/distros/rolling/calamares/modules/fstab.yml +13 -0
- package/conf/distros/rolling/calamares/modules/locale.yml +97 -0
- package/conf/distros/rolling/calamares/modules/luksopenswaphookcfg.yml +6 -0
- package/conf/distros/rolling/calamares/modules/mount.yml +38 -0
- package/conf/distros/rolling/calamares/modules/packages.yml +8 -0
- package/conf/distros/rolling/calamares/modules/removeuser.yml +15 -0
- package/conf/distros/rolling/calamares/modules/unpackfs.yml +7 -0
- package/conf/distros/rolling/calamares/modules/users.yml +20 -0
- package/conf/distros/rolling/calamares/modules/welcome.yml +19 -0
- package/conf/distros/{bullseye → rolling}/calamares/settings.yml +17 -12
- package/conf/distros/thirtyfive/README.md +3 -0
- package/conf/distros/tumbleweed/README.md +3 -0
- package/conf/eggs.yaml +3 -3
- package/conf/exclude.list +12 -7
- package/conf/tools.yaml +1 -1
- package/lib/classes/basket.js +24 -20
- package/lib/classes/bleach.js +19 -19
- package/lib/classes/compressors.js +15 -14
- package/lib/classes/daddy.js +44 -31
- package/lib/classes/distro.d.ts +3 -2
- package/lib/classes/distro.js +314 -175
- package/lib/classes/family/archlinux.d.ts +69 -0
- package/lib/classes/family/archlinux.js +182 -0
- package/lib/classes/family/debian.d.ts +64 -0
- package/lib/classes/family/debian.js +227 -0
- package/lib/classes/family/fedora.d.ts +63 -0
- package/lib/classes/family/fedora.js +169 -0
- package/lib/classes/family/suse.d.ts +63 -0
- package/lib/classes/family/suse.js +169 -0
- package/lib/classes/i18n.js +16 -16
- package/lib/classes/incubation/branding.js +5 -4
- package/lib/classes/incubation/distros/bionic.js +1 -2
- package/lib/classes/incubation/distros/buster.js +2 -2
- package/lib/classes/incubation/distros/focal.js +3 -2
- package/lib/classes/incubation/distros/jessie.js +1 -25
- package/lib/classes/incubation/distros/{bullseye.d.ts → rolling.d.ts} +3 -3
- package/lib/classes/incubation/distros/{bullseye.js → rolling.js} +15 -16
- package/lib/classes/incubation/fisherman-helper/displaymanager.js +2 -7
- package/lib/classes/incubation/fisherman-helper/packages.js +31 -32
- package/lib/classes/incubation/fisherman.d.ts +17 -17
- package/lib/classes/incubation/fisherman.js +84 -71
- package/lib/classes/incubation/incubator.js +116 -74
- package/lib/classes/incubation/installer.d.ts +2 -2
- package/lib/classes/incubation/installer.js +6 -20
- package/lib/classes/initrd.d.ts +1 -1
- package/lib/classes/initrd.js +37 -30
- package/lib/classes/krill_install.d.ts +4 -4
- package/lib/classes/krill_install.js +166 -162
- package/lib/classes/krill_prepare.d.ts +6 -2
- package/lib/classes/krill_prepare.js +73 -60
- package/lib/classes/n8.js +6 -11
- package/lib/classes/ovary.d.ts +34 -25
- package/lib/classes/ovary.js +771 -688
- package/lib/classes/pacman.d.ts +55 -56
- package/lib/classes/pacman.js +524 -436
- package/lib/classes/pve-live.js +6 -6
- package/lib/classes/settings.js +47 -56
- package/lib/classes/systemctl.d.ts +6 -6
- package/lib/classes/systemctl.js +7 -7
- package/lib/classes/tools.d.ts +1 -1
- package/lib/classes/tools.js +10 -10
- package/lib/classes/users.d.ts +21 -0
- package/lib/classes/users.js +129 -0
- package/lib/classes/utils.d.ts +10 -13
- package/lib/classes/utils.js +128 -107
- package/lib/classes/xdg.js +112 -91
- package/lib/classes/yolk.js +38 -31
- package/lib/commands/adapt.d.ts +3 -3
- package/lib/commands/adapt.js +12 -12
- package/lib/commands/analyze.d.ts +25 -0
- package/lib/commands/analyze.js +74 -0
- package/lib/commands/bro.d.ts +14 -0
- package/lib/commands/bro.js +31 -0
- package/lib/commands/calamares.d.ts +7 -7
- package/lib/commands/calamares.js +22 -54
- package/lib/commands/config.d.ts +5 -5
- package/lib/commands/config.js +69 -79
- package/lib/commands/dad.d.ts +5 -5
- package/lib/commands/dad.js +11 -11
- package/lib/commands/export/deb.d.ts +8 -8
- package/lib/commands/export/deb.js +16 -16
- package/lib/commands/export/docs.d.ts +2 -2
- package/lib/commands/export/docs.js +9 -9
- package/lib/commands/export/iso.d.ts +4 -4
- package/lib/commands/export/iso.js +12 -17
- package/lib/commands/info.d.ts +9 -3
- package/lib/commands/info.js +14 -164
- package/lib/commands/install.d.ts +5 -5
- package/lib/commands/install.js +28 -42
- package/lib/commands/kill.d.ts +3 -3
- package/lib/commands/kill.js +11 -13
- package/lib/commands/mom.d.ts +2 -2
- package/lib/commands/mom.js +8 -8
- package/lib/commands/produce.d.ts +14 -14
- package/lib/commands/produce.js +48 -46
- package/lib/commands/remove.d.ts +5 -5
- package/lib/commands/remove.js +46 -57
- package/lib/commands/syncfrom.d.ts +37 -0
- package/lib/commands/syncfrom.js +156 -0
- package/lib/commands/syncto.d.ts +48 -0
- package/lib/commands/syncto.js +219 -0
- package/lib/commands/tools/clean.d.ts +3 -3
- package/lib/commands/tools/clean.js +10 -12
- package/lib/commands/tools/locales.d.ts +4 -4
- package/lib/commands/tools/locales.js +8 -8
- package/lib/commands/tools/skel.d.ts +4 -4
- package/lib/commands/tools/skel.js +10 -15
- package/lib/commands/tools/stat.d.ts +7 -4
- package/lib/commands/tools/stat.js +20 -13
- package/lib/commands/tools/yolk.d.ts +3 -3
- package/lib/commands/tools/yolk.js +13 -13
- package/lib/commands/update.d.ts +5 -10
- package/lib/commands/update.js +56 -72
- package/lib/components/elements/information.d.ts +4 -0
- package/lib/components/elements/information.js +166 -0
- package/lib/components/elements/steps.js +1 -1
- package/lib/components/elements/title.js +7 -10
- package/lib/components/finished.js +5 -5
- package/lib/components/install.js +5 -5
- package/lib/components/keyboard.js +5 -5
- package/lib/components/location.js +5 -5
- package/lib/components/network.js +5 -5
- package/lib/components/partitions.d.ts +2 -1
- package/lib/components/partitions.js +9 -7
- package/lib/components/summary.js +5 -5
- package/lib/components/users.js +6 -6
- package/lib/components/welcome.js +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/interfaces/i-analyze.d.ts +13 -0
- package/lib/interfaces/i-analyze.js +18 -0
- package/lib/interfaces/i-distro.d.ts +3 -2
- package/lib/interfaces/i-krill.d.ts +1 -0
- package/lib/interfaces/i-settings.d.ts +2 -2
- package/lib/lib/cli-autologin.d.ts +19 -2
- package/lib/lib/cli-autologin.js +114 -39
- package/lib/lib/dependencies.d.ts +9 -6
- package/lib/lib/dependencies.js +22 -13
- package/lib/lib/get_address.js +2 -2
- package/lib/lib/get_dns.js +2 -2
- package/lib/lib/get_domain.js +2 -2
- package/lib/lib/get_gateway.js +2 -2
- package/lib/lib/get_hostname.js +2 -2
- package/lib/lib/get_netmask.js +2 -2
- package/lib/lib/get_password.js +3 -2
- package/lib/lib/get_root_password.js +2 -2
- package/lib/lib/get_userfullname.js +2 -2
- package/lib/lib/get_username.js +2 -2
- package/lib/lib/select_address_type.js +2 -5
- package/lib/lib/select_filesystem_type.js +5 -14
- package/lib/lib/select_installation_device.js +3 -3
- package/lib/lib/select_interface.js +1 -1
- package/lib/lib/select_keyboard_layout.js +2 -10
- package/lib/lib/select_languages.js +2 -2
- package/lib/lib/select_regions.js +1 -12
- package/lib/lib/select_user_swap_choice.js +4 -4
- package/lib/lib/select_zones.js +483 -62
- package/manpages/doc/man/eggs.html +508 -0
- package/manpages/doc/man/eggs.roll.gz +0 -0
- package/oclif.manifest.json +1 -1
- package/package.json +115 -107
- package/scripts/_eggs +275 -0
- package/scripts/bros/waydroid-helper.sh +92 -0
- package/scripts/eggs.bash +68 -19
- package/scripts/mom-cli.sh +6 -5
- package/scripts/not-used/eggs-cleanup.sh +7 -0
- package/scripts/not-used/install-eggs-ppa.sh +2 -0
- package/scripts/{mkinitramfs → not-used/mkinitramfs} +0 -0
- package/scripts/{pve-live.sh → not-used/pve-live.sh} +0 -0
- package/addons/debian/theme/applications/install-debian.desktop +0 -13
- package/addons/debian/theme/artwork/install-debian.png +0 -0
- package/addons/debian/theme/branding/branding.desc +0 -27
- package/addons/debian/theme/branding/debian-logo.png +0 -0
- package/addons/debian/theme/branding/show.qml +0 -51
- package/addons/debian/theme/branding/slide1.png +0 -0
- package/addons/debian/theme/branding/welcome.png +0 -0
- package/addons/deblinux/theme/README.md +0 -16
- package/addons/deblinux/theme/applications/install-debian.desktop +0 -13
- package/addons/deblinux/theme/calamares/branding/branding.desc +0 -23
- package/addons/deblinux/theme/calamares/branding/deblinux-logo.png +0 -0
- package/addons/deblinux/theme/calamares/branding/show.qml +0 -46
- package/addons/deblinux/theme/calamares/branding/slide1.png +0 -0
- package/addons/deblinux/theme/calamares/branding/welcome.png +0 -0
- package/addons/deblinux/theme/calamares/modules/partition.yml +0 -233
- package/addons/eggs/theme/calamares/branding/4tation.png +0 -0
- package/addons/eggs/theme/livecd/grub.template.cfg +0 -60
- package/addons/eggs/theme/livecd/menu.template.cfg +0 -54
- package/addons/guadalinex/theme/README.md +0 -9
- package/addons/guadalinex/theme/applications/install-debian.desktop +0 -28
- package/addons/guadalinex/theme/artwork/install-debian.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/guadalinex-logo.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/show.qml +0 -85
- package/addons/guadalinex/theme/calamares/branding/slide1.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide2.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide3.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide4.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide5.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide6.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide7.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/welcome.png +0 -0
- package/addons/guadalinex/theme/livecd/menu.template.cfg +0 -54
- package/addons/guadalinex/theme/livecd/splash.png +0 -0
- package/addons/guadalinex/theme/livecd/theme.cfg +0 -42
- package/addons/openos/theme/applications/Install-OpenOS-Neon_RLTS-Desktop.png +0 -0
- package/addons/openos/theme/applications/install-debian.desktop +0 -24
- package/addons/openos/theme/artwork/install-debian.png +0 -0
- package/addons/openos/theme/calamares/branding/branding.desc +0 -28
- package/addons/openos/theme/calamares/branding/openos-logo.png +0 -0
- package/addons/openos/theme/calamares/branding/show.qml +0 -203
- package/addons/openos/theme/calamares/branding/slide1.png +0 -0
- package/addons/openos/theme/calamares/branding/slide10.png +0 -0
- package/addons/openos/theme/calamares/branding/slide11.png +0 -0
- package/addons/openos/theme/calamares/branding/slide12.png +0 -0
- package/addons/openos/theme/calamares/branding/slide13.png +0 -0
- package/addons/openos/theme/calamares/branding/slide14.png +0 -0
- package/addons/openos/theme/calamares/branding/slide15.png +0 -0
- package/addons/openos/theme/calamares/branding/slide16.png +0 -0
- package/addons/openos/theme/calamares/branding/slide2.png +0 -0
- package/addons/openos/theme/calamares/branding/slide3.png +0 -0
- package/addons/openos/theme/calamares/branding/slide4.png +0 -0
- package/addons/openos/theme/calamares/branding/slide5.png +0 -0
- package/addons/openos/theme/calamares/branding/slide6.png +0 -0
- package/addons/openos/theme/calamares/branding/slide7.png +0 -0
- package/addons/openos/theme/calamares/branding/slide8.png +0 -0
- package/addons/openos/theme/calamares/branding/slide9.png +0 -0
- package/addons/openos/theme/calamares/branding/welcome.png +0 -0
- package/addons/openos/theme/calamares/branding.desc +0 -24
- package/addons/openos/theme/calamares/lang/calamares-default_ar.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_en.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_eo.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_fr.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_nl.qm +0 -0
- package/addons/openos/theme/calamares/modules/partition.yml +0 -233
- package/addons/openos/theme/livecd/grub.template.cfg +0 -60
- package/addons/openos/theme/livecd/menu.template.cfg +0 -54
- package/addons/openos/theme/livecd/splash.png +0 -0
- package/addons/openos/theme/livecd/theme.cfg +0 -42
- package/addons/pve/theme/applications/penguins-pve.desktop +0 -24
- package/addons/pve/theme/artwork/install-debian.png +0 -0
- package/addons/pve/theme/calamares/branding/branding.desc +0 -1
- package/addons/pve/theme/calamares/branding/pve-logo.png +0 -0
- package/addons/pve/theme/calamares/branding/show.qml +0 -227
- package/addons/pve/theme/calamares/branding/slide1.png +0 -0
- package/addons/pve/theme/calamares/branding/slide2.png +0 -0
- package/addons/pve/theme/calamares/branding/slide3.png +0 -0
- package/addons/pve/theme/calamares/branding/slide4.png +0 -0
- package/addons/pve/theme/calamares/branding/slide5.png +0 -0
- package/addons/pve/theme/calamares/branding/slide6.png +0 -0
- package/addons/pve/theme/calamares/branding/slide7.png +0 -0
- package/addons/pve/theme/calamares/branding/slide8.png +0 -0
- package/addons/pve/theme/calamares/branding/slide9.png +0 -0
- package/addons/pve/theme/calamares/branding/welcome.png +0 -0
- package/addons/pve/theme/calamares/modules/partition.yml +0 -233
- package/addons/pve/theme/livecd/README.md +0 -8
- package/addons/pve/theme/livecd/grub.template.cfg +0 -60
- package/addons/pve/theme/livecd/menu.template.cfg +0 -54
- package/addons/pve/theme/livecd/splash.png +0 -0
- package/addons/pve/theme/livecd/theme.cfg +0 -42
- package/addons/ufficiozero/theme/artwork/install-debian.png +0 -0
- package/addons/ufficiozero/theme/livecd/README.md +0 -8
- package/addons/ufficiozero/theme/livecd/grub.template.cfg +0 -60
- package/addons/ufficiozero/theme/livecd/menu.template.cfg +0 -54
- package/conf/distros/bullseye/calamares/calamares-modules/bootloader-config/bootloader-config.sh +0 -28
- package/conf/distros/bullseye/calamares/calamares-modules/bootloader-config/module.yml +0 -8
- package/conf/distros/buster/grub/grub.template.cfg +0 -58
- package/conf/distros/buster/grub/loopback.cfg +0 -1
- package/conf/distros/buster/isolinux/isolinux.template.cfg +0 -8
- package/conf/distros/buster/isolinux/menu.template.cfg +0 -56
- package/conf/distros/focal/grub/grub.template.cfg +0 -67
- package/conf/distros/focal/isolinux/menu.template.cfg +0 -54
- package/lib/classes/incubation/distros/beowulf.d.ts +0 -30
- package/lib/classes/incubation/distros/beowulf.js +0 -69
- package/manpages/doc/man/eggs.1.gz +0 -0
package/lib/commands/produce.js
CHANGED
|
@@ -10,19 +10,19 @@ const tslib_1 = require("tslib");
|
|
|
10
10
|
* email: piero.proietti@gmail.com
|
|
11
11
|
* license: MIT
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
|
|
15
|
-
const ovary_1 = tslib_1.__importDefault(require("../classes/ovary"));
|
|
16
|
-
const compressors_1 = tslib_1.__importDefault(require("../classes/compressors"));
|
|
17
|
-
const config_1 = tslib_1.__importDefault(require("./config"));
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const settings_1 = tslib_1.__importDefault(require("../classes/settings"));
|
|
22
|
-
class Produce extends
|
|
13
|
+
const core_1 = require("@oclif/core");
|
|
14
|
+
const utils_1 = (0, tslib_1.__importDefault)(require("../classes/utils"));
|
|
15
|
+
const ovary_1 = (0, tslib_1.__importDefault)(require("../classes/ovary"));
|
|
16
|
+
const compressors_1 = (0, tslib_1.__importDefault)(require("../classes/compressors"));
|
|
17
|
+
const config_1 = (0, tslib_1.__importDefault)(require("./config"));
|
|
18
|
+
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
19
|
+
const node_fs_1 = (0, tslib_1.__importDefault)(require("node:fs"));
|
|
20
|
+
const node_path_1 = (0, tslib_1.__importDefault)(require("node:path"));
|
|
21
|
+
const settings_1 = (0, tslib_1.__importDefault)(require("../classes/settings"));
|
|
22
|
+
class Produce extends core_1.Command {
|
|
23
23
|
async run() {
|
|
24
24
|
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
25
|
-
const { flags } = this.parse(Produce);
|
|
25
|
+
const { flags } = await this.parse(Produce);
|
|
26
26
|
if (utils_1.default.isRoot(this.id)) {
|
|
27
27
|
/**
|
|
28
28
|
* ADDONS dei vendors
|
|
@@ -31,23 +31,23 @@ class Produce extends command_1.Command {
|
|
|
31
31
|
const addons = [];
|
|
32
32
|
if (flags.addons) {
|
|
33
33
|
const addons = flags.addons; // array
|
|
34
|
-
|
|
34
|
+
for (let addon of addons) {
|
|
35
35
|
// se non viene specificato il vendor il default è eggs
|
|
36
|
-
if (addon.
|
|
36
|
+
if (!addon.includes('//')) {
|
|
37
37
|
addon = 'eggs/' + addon;
|
|
38
38
|
}
|
|
39
|
-
const dirAddon =
|
|
40
|
-
if (!
|
|
39
|
+
const dirAddon = node_path_1.default.resolve(__dirname, `../../addons/${addon}`);
|
|
40
|
+
if (!node_fs_1.default.existsSync(dirAddon)) {
|
|
41
41
|
console.log(dirAddon);
|
|
42
|
-
utils_1.default.warning('addon: ' +
|
|
42
|
+
utils_1.default.warning('addon: ' + chalk_1.default.white(addon) + ' not found, terminate!');
|
|
43
43
|
process.exit();
|
|
44
44
|
}
|
|
45
|
-
const vendorAddon = addon.
|
|
45
|
+
const vendorAddon = addon.slice(0, Math.max(0, addon.search('/')));
|
|
46
46
|
const nameAddon = addon.substring(addon.search('/') + 1, addon.length);
|
|
47
47
|
if (nameAddon === 'theme') {
|
|
48
48
|
flags.theme = vendorAddon;
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* composizione dei flag
|
|
@@ -64,7 +64,7 @@ class Produce extends command_1.Command {
|
|
|
64
64
|
* Analisi del tipo di compressione del kernel
|
|
65
65
|
*
|
|
66
66
|
*/
|
|
67
|
-
const compressors = new
|
|
67
|
+
const compressors = new compressors_1.default();
|
|
68
68
|
await compressors.populate();
|
|
69
69
|
let fastest = 'gzip';
|
|
70
70
|
if (compressors.isEnabled.zstd) {
|
|
@@ -73,7 +73,9 @@ class Produce extends command_1.Command {
|
|
|
73
73
|
else if (compressors.isEnabled.lz4) {
|
|
74
74
|
fastest = 'lz4';
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
/**
|
|
77
|
+
* jessie e stretch will use gzip for fastest
|
|
78
|
+
*/
|
|
77
79
|
const settings = new settings_1.default();
|
|
78
80
|
if (settings.distro.versionLike === 'jessie' || settings.distro.versionLike === 'stretch') {
|
|
79
81
|
fastest = 'gzip';
|
|
@@ -96,15 +98,16 @@ class Produce extends command_1.Command {
|
|
|
96
98
|
if (release) {
|
|
97
99
|
compression = 'xz -Xbcj x86';
|
|
98
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* theme: if not defined will use eggs
|
|
103
|
+
*/
|
|
99
104
|
let theme = 'eggs';
|
|
100
105
|
if (flags.theme !== undefined) {
|
|
101
106
|
theme = flags.theme;
|
|
102
107
|
}
|
|
103
108
|
const i = await config_1.default.thatWeNeed(verbose);
|
|
104
|
-
if (i.needApt || i.configurationInstall || i.configurationRefresh || i.distroTemplate) {
|
|
105
|
-
|
|
106
|
-
await config_1.default.install(i, verbose);
|
|
107
|
-
}
|
|
109
|
+
if ((i.needApt || i.configurationInstall || i.configurationRefresh || i.distroTemplate) && (await utils_1.default.customConfirm('Select yes to continue...'))) {
|
|
110
|
+
await config_1.default.install(i, verbose);
|
|
108
111
|
}
|
|
109
112
|
const myAddons = {};
|
|
110
113
|
if (flags.addons != undefined) {
|
|
@@ -133,30 +136,29 @@ class Produce extends command_1.Command {
|
|
|
133
136
|
}
|
|
134
137
|
exports.default = Produce;
|
|
135
138
|
Produce.flags = {
|
|
136
|
-
prefix:
|
|
137
|
-
basename:
|
|
138
|
-
backup:
|
|
139
|
-
fast:
|
|
140
|
-
normal:
|
|
141
|
-
max:
|
|
142
|
-
verbose:
|
|
143
|
-
yolk:
|
|
144
|
-
script:
|
|
145
|
-
help:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
release: command_1.flags.boolean({ description: 'release: configure GUI installer to remove eggs and calamares after installation' }),
|
|
139
|
+
prefix: core_1.Flags.string({ char: 'p', description: 'prefix' }),
|
|
140
|
+
basename: core_1.Flags.string({ description: 'basename' }),
|
|
141
|
+
backup: core_1.Flags.boolean({ char: 'b', description: 'backup mode' }),
|
|
142
|
+
fast: core_1.Flags.boolean({ char: 'f', description: 'fast compression' }),
|
|
143
|
+
normal: core_1.Flags.boolean({ char: 'n', description: 'normal compression' }),
|
|
144
|
+
max: core_1.Flags.boolean({ char: 'm', description: 'max compression' }),
|
|
145
|
+
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' }),
|
|
146
|
+
yolk: core_1.Flags.boolean({ char: 'y', description: '-y force yolk renew' }),
|
|
147
|
+
script: core_1.Flags.boolean({ char: 's', description: 'script mode. Generate scripts to manage iso build' }),
|
|
148
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
149
|
+
theme: core_1.Flags.string({ description: 'theme for livecd, calamares branding and partitions' }),
|
|
150
|
+
addons: core_1.Flags.string({ multiple: true, description: 'addons to be used: adapt, ichoice, pve, rsupport' }),
|
|
151
|
+
release: core_1.Flags.boolean({ description: 'release: configure GUI installer to remove eggs and calamares after installation' })
|
|
150
152
|
};
|
|
151
153
|
Produce.description = 'the system produce an egg: iso image of your system';
|
|
152
154
|
Produce.aliases = ['spawn', 'lay'];
|
|
153
155
|
Produce.examples = [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
'$ sudo eggs produce \nproduce an ISO called [hostname]-[arch]-YYYY-MM-DD_HHMM.iso, compressed xz (standard compression).\nIf hostname=ugo and arch=i386 ugo-x86-2020-08-25_1215.iso\n',
|
|
157
|
+
'$ sudo eggs produce -v\nsame as previuos, but with --verbose output\n',
|
|
158
|
+
'$ sudo eggs produce -vf\nsame as previuos, compression zstd, lz4 or gzip (depend from system capability)\n',
|
|
159
|
+
'$ sudo eggs produce -vm\nsame as previuos, compression xz -Xbcj x86 (max compression, about 10%\nmore compressed)\n',
|
|
160
|
+
'$ sudo eggs produce -vf --basename leo --theme debian --addons adapt \nproduce an ISO called leo-i386-2020-08-25_1215.iso compression fast,\nusing Debian theme and link to adapt\n',
|
|
161
|
+
'$ sudo eggs produce -v --basename leo --theme debian --addons rsupport \nproduce an ISO called leo-i386-2020-08-25_1215.iso compression xz,\nusing Debian theme and link to dwagent\n',
|
|
162
|
+
'$ sudo eggs produce -v --basename leo --rsupport \nproduce an ISO called leo-i386-2020-08-25_1215.iso compression xz, using eggs\ntheme and link to dwagent\n',
|
|
163
|
+
'$ sudo eggs produce -vs --basename leo --rsupport \nproduce scripts to build an ISO as the previus example. Scripts can be found\nin /home/eggs/ovarium and you can customize all you need\n'
|
|
162
164
|
];
|
package/lib/commands/remove.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* email: piero.proietti@gmail.com
|
|
5
5
|
* license: MIT
|
|
6
6
|
*/
|
|
7
|
-
import { Command } from '@oclif/
|
|
7
|
+
import { Command } from '@oclif/core';
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
@@ -12,10 +12,10 @@ export default class Remove extends Command {
|
|
|
12
12
|
static description: string;
|
|
13
13
|
static examples: string[];
|
|
14
14
|
static flags: {
|
|
15
|
-
purge: import("@oclif/
|
|
16
|
-
autoremove: import("@oclif/
|
|
17
|
-
help: import("@oclif/
|
|
18
|
-
verbose: import("@oclif/
|
|
15
|
+
purge: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
autoremove: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
18
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
19
|
};
|
|
20
20
|
run(): Promise<void>;
|
|
21
21
|
}
|
package/lib/commands/remove.js
CHANGED
|
@@ -7,86 +7,75 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
* email: piero.proietti@gmail.com
|
|
8
8
|
* license: MIT
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
11
|
-
const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
|
|
12
|
-
const pacman_1 = tslib_1.__importDefault(require("../classes/pacman"));
|
|
13
|
-
const
|
|
14
|
-
const exec = require('../lib/utils').exec;
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const utils_1 = (0, tslib_1.__importDefault)(require("../classes/utils"));
|
|
12
|
+
const pacman_1 = (0, tslib_1.__importDefault)(require("../classes/pacman"));
|
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
|
15
14
|
/**
|
|
16
15
|
*
|
|
17
16
|
*/
|
|
18
|
-
class Remove extends
|
|
17
|
+
class Remove extends core_1.Command {
|
|
19
18
|
async run() {
|
|
20
19
|
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
21
|
-
const { flags } = this.parse(Remove);
|
|
20
|
+
const { flags } = await this.parse(Remove);
|
|
22
21
|
let verbose = false;
|
|
23
22
|
if (flags.verbose) {
|
|
24
23
|
verbose = true;
|
|
25
24
|
}
|
|
26
25
|
if (utils_1.default.isRoot()) {
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* debian package
|
|
28
|
+
*/
|
|
29
|
+
if (utils_1.default.isDebPackage() && (await utils_1.default.customConfirm())) {
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* in caso di autoremove, tolgo le dipendenze di versione PRIMA di eggs, altrimenti si inchioda
|
|
30
32
|
*/
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
if (flags.autoremove) {
|
|
34
|
+
/**
|
|
35
|
+
* Rimozione dipendenze da versione live-config / open-infrastructure-system-config (ubuntu bionic)
|
|
36
|
+
*/
|
|
37
|
+
if (pacman_1.default.packageIsInstalled('open-infrastructure-system-config')) {
|
|
38
|
+
(0, node_child_process_1.execSync)('apt-get purge open-infrastructure-system-config --yes');
|
|
34
39
|
}
|
|
35
|
-
else {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (flags.autoremove) {
|
|
39
|
-
child_process_1.execSync('apt-get autoremove --yes');
|
|
40
|
+
else if (pacman_1.default.packageIsInstalled('live-config')) {
|
|
41
|
+
(0, node_child_process_1.execSync)('apt-get purge live-config --yes');
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
if (flags.purge) {
|
|
52
|
-
await pacman_1.default.configurationRemove();
|
|
53
|
-
}
|
|
54
|
-
utils_1.default.warning('You are using eggs as sources. I\'ll NOT remove it');
|
|
44
|
+
if (flags.purge) {
|
|
45
|
+
(0, node_child_process_1.execSync)('apt-get purge eggs --yes');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
(0, node_child_process_1.execSync)('apt-get remove eggs --yes');
|
|
49
|
+
}
|
|
50
|
+
if (flags.autoremove) {
|
|
51
|
+
(0, node_child_process_1.execSync)('apt-get autoremove --yes');
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
// purge configurations files
|
|
71
|
-
if (flags.purge) {
|
|
72
|
-
await pacman_1.default.configurationRemove();
|
|
73
|
-
}
|
|
74
|
-
// Rimuove eggs
|
|
75
|
-
child_process_1.execSync('npm remove penguins-eggs -g');
|
|
54
|
+
/**
|
|
55
|
+
* sources
|
|
56
|
+
*/
|
|
57
|
+
if (utils_1.default.isSources() && (await utils_1.default.customConfirm())) {
|
|
58
|
+
if (flags.autoremove) {
|
|
59
|
+
// await Pacman.prerequisitesRemove()
|
|
60
|
+
}
|
|
61
|
+
if (flags.purge) {
|
|
62
|
+
await pacman_1.default.configurationRemove();
|
|
63
|
+
// eggs completion
|
|
64
|
+
(0, node_child_process_1.execSync)('rm -f /etc/bash_completion.d/eggs.bash');
|
|
65
|
+
// manpages
|
|
66
|
+
(0, node_child_process_1.execSync)('rm -f /usr/share/man/man1/eggs.1.gz');
|
|
76
67
|
}
|
|
68
|
+
utils_1.default.warning("You are using eggs as sources. I'll NOT remove it");
|
|
77
69
|
}
|
|
78
70
|
}
|
|
79
71
|
}
|
|
80
72
|
}
|
|
81
73
|
exports.default = Remove;
|
|
82
74
|
Remove.description = 'remove eggs and others stuff';
|
|
83
|
-
Remove.examples = [
|
|
84
|
-
`$ sudo eggs remove \nremove eggs\n`,
|
|
85
|
-
`$ sudo eggs remove --purge \nremove eggs, eggs configurations, packages prerequisites\n`,
|
|
86
|
-
];
|
|
75
|
+
Remove.examples = ['$ sudo eggs remove \nremove eggs\n', "$ sudo eggs remove --purge \nremove eggs, eggs configurations, configuration's files\n", '$ sudo eggs remove --autoremove \nremove eggs, eggs configurations, packages dependencies\n'];
|
|
87
76
|
Remove.flags = {
|
|
88
|
-
purge:
|
|
89
|
-
autoremove:
|
|
90
|
-
help:
|
|
91
|
-
verbose:
|
|
77
|
+
purge: core_1.Flags.boolean({ char: 'p', description: 'remove eggs configurations files' }),
|
|
78
|
+
autoremove: core_1.Flags.boolean({ char: 'a', description: 'remove eggs packages dependencies' }),
|
|
79
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
80
|
+
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
92
81
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* penguins-eggs-v9
|
|
3
|
+
* author: Piero Proietti
|
|
4
|
+
* email: piero.proietti@gmail.com
|
|
5
|
+
* license: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from '@oclif/core';
|
|
8
|
+
export default class Syncfrom extends Command {
|
|
9
|
+
luksName: string;
|
|
10
|
+
luksFile: string;
|
|
11
|
+
luksDevice: string;
|
|
12
|
+
luksMountpoint: string;
|
|
13
|
+
rootDir: string;
|
|
14
|
+
static description: string;
|
|
15
|
+
static flags: {
|
|
16
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
17
|
+
rootdir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
18
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
19
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
static aliases: string[];
|
|
22
|
+
static examples: string[];
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param verbose
|
|
27
|
+
*/
|
|
28
|
+
private restorePrivateData;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
luksOpen(verbose?: boolean): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
luksClose(verbose?: boolean): Promise<void>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/**
|
|
5
|
+
* penguins-eggs-v9
|
|
6
|
+
* author: Piero Proietti
|
|
7
|
+
* email: piero.proietti@gmail.com
|
|
8
|
+
* license: MIT
|
|
9
|
+
*/
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const utils_1 = (0, tslib_1.__importDefault)(require("../classes/utils"));
|
|
14
|
+
const utils_2 = require("../lib/utils");
|
|
15
|
+
class Syncfrom extends core_1.Command {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.luksName = 'luks-eggs-backup';
|
|
19
|
+
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
20
|
+
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
21
|
+
this.luksMountpoint = '/tmp/eggs-backup';
|
|
22
|
+
this.rootDir = '';
|
|
23
|
+
}
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(Syncfrom);
|
|
26
|
+
let verbose = false;
|
|
27
|
+
if (flags.verbose) {
|
|
28
|
+
verbose = true;
|
|
29
|
+
}
|
|
30
|
+
let fileVolume = '';
|
|
31
|
+
if (flags.file) {
|
|
32
|
+
fileVolume = flags.file;
|
|
33
|
+
}
|
|
34
|
+
if (utils_1.default.isLive()) {
|
|
35
|
+
if (flags.rootdir) {
|
|
36
|
+
this.rootDir = flags.rootdir;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
utils_1.default.warning(`Argument --rootdir is mandatory, when running from live! Process will terminate`);
|
|
40
|
+
process.exit();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.rootDir = '/';
|
|
45
|
+
}
|
|
46
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
47
|
+
if (utils_1.default.isRoot(this.id)) {
|
|
48
|
+
if (fileVolume === '') {
|
|
49
|
+
fileVolume = '/run/live/medium/live/luks-eggs-backup';
|
|
50
|
+
}
|
|
51
|
+
if (!utils_1.default.isLive()) {
|
|
52
|
+
/**
|
|
53
|
+
* WORKING FROM INSTALLED
|
|
54
|
+
*/
|
|
55
|
+
if (fs.existsSync(fileVolume)) {
|
|
56
|
+
this.luksName = path.basename(fileVolume);
|
|
57
|
+
this.luksFile = fileVolume;
|
|
58
|
+
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
59
|
+
this.luksMountpoint = '/tmp/eggs-backup';
|
|
60
|
+
await this.restorePrivateData(verbose);
|
|
61
|
+
if (await utils_1.default.customConfirm(`Your system was updated! Press a key to reboot`)) {
|
|
62
|
+
await (0, utils_2.exec)('reboot');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
utils_1.default.warning(`Can't find ${this.luksFile}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
/**
|
|
71
|
+
* WORKING FROM LIVE
|
|
72
|
+
*/
|
|
73
|
+
this.luksName = path.basename(fileVolume);
|
|
74
|
+
this.luksFile = fileVolume;
|
|
75
|
+
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
76
|
+
this.luksMountpoint = '/tmp/eggs-backup';
|
|
77
|
+
await this.restorePrivateData(verbose);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @param verbose
|
|
84
|
+
*/
|
|
85
|
+
async restorePrivateData(verbose = false) {
|
|
86
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
87
|
+
if (!fs.existsSync(this.luksMountpoint)) {
|
|
88
|
+
await (0, utils_2.exec)(`mkdir ${this.luksMountpoint}`);
|
|
89
|
+
}
|
|
90
|
+
await this.luksOpen();
|
|
91
|
+
/**
|
|
92
|
+
* ONLY FROM LIVE
|
|
93
|
+
* rm home, subst /etc/passwd, /etc/shadow, /etc/groups
|
|
94
|
+
*/
|
|
95
|
+
if (utils_1.default.isLive()) {
|
|
96
|
+
if (this.rootDir !== '/') {
|
|
97
|
+
utils_1.default.warning('Removing live user on destination system');
|
|
98
|
+
await (0, utils_2.exec)(`rm -rf ${this.rootDir}/home/*`, echo);
|
|
99
|
+
utils_1.default.warning('Restoring accounts');
|
|
100
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/passwd ${this.rootDir}/etc/`, echo);
|
|
101
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/shadow ${this.rootDir}/etc/`, echo);
|
|
102
|
+
await (0, utils_2.exec)(`cp ${this.luksMountpoint}/etc/group ${this.rootDir}/etc/`, echo);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
utils_1.default.warning('Restoring backup data');
|
|
106
|
+
await (0, utils_2.exec)(`rsync -a ${this.luksMountpoint}/ROOT/ ${this.rootDir}/`, echo);
|
|
107
|
+
await this.luksClose();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
async luksOpen(verbose = false) {
|
|
113
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
114
|
+
const echoYes = utils_1.default.setEcho(true); // echoYes serve solo per cryptsetup luksOpen
|
|
115
|
+
if (!fs.existsSync(this.luksDevice)) {
|
|
116
|
+
utils_1.default.warning(`LUKS open volume: ${this.luksName}`);
|
|
117
|
+
await (0, utils_2.exec)(`cryptsetup luksOpen --type luks2 ${this.luksFile} ${this.luksName}`, echoYes);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
utils_1.default.warning(`LUKS volume: ${this.luksName} already open`);
|
|
121
|
+
}
|
|
122
|
+
if (!fs.existsSync(this.luksMountpoint)) {
|
|
123
|
+
await (0, utils_2.exec)(`mkdir -p ${this.luksMountpoint}`, echo);
|
|
124
|
+
}
|
|
125
|
+
if (!utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
126
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} on ${this.luksMountpoint}`);
|
|
127
|
+
await (0, utils_2.exec)(`mount ${this.luksDevice} ${this.luksMountpoint}`, echo);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
utils_1.default.warning(`mount volume: ${this.luksDevice} already mounted on ${this.luksMountpoint}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
async luksClose(verbose = false) {
|
|
137
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
138
|
+
if (utils_1.default.isMountpoint(this.luksMountpoint)) {
|
|
139
|
+
await (0, utils_2.exec)(`umount ${this.luksMountpoint}`, echo);
|
|
140
|
+
}
|
|
141
|
+
if (fs.existsSync(this.luksDevice)) {
|
|
142
|
+
utils_1.default.warning(`LUKS close volume: ${this.luksName}`);
|
|
143
|
+
await (0, utils_2.exec)(`cryptsetup luksClose ${this.luksName}`, echo);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.default = Syncfrom;
|
|
148
|
+
Syncfrom.description = 'Restore users, server and datas from luks-eggs-backup';
|
|
149
|
+
Syncfrom.flags = {
|
|
150
|
+
file: core_1.Flags.string({ char: 'f', description: "file with LUKS volume encrypted" }),
|
|
151
|
+
rootdir: core_1.Flags.string({ char: 'r', description: 'rootdir of the installed system, when used from live' }),
|
|
152
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
153
|
+
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
154
|
+
};
|
|
155
|
+
Syncfrom.aliases = ['restore'];
|
|
156
|
+
Syncfrom.examples = ['$ sudo eggs restore'];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* penguins-eggs-v9
|
|
3
|
+
* author: Piero Proietti
|
|
4
|
+
* email: piero.proietti@gmail.com
|
|
5
|
+
* license: MIT
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from '@oclif/core';
|
|
8
|
+
import Users from '../classes/users';
|
|
9
|
+
export default class Syncto extends Command {
|
|
10
|
+
luksName: string;
|
|
11
|
+
luksFile: string;
|
|
12
|
+
luksDevice: string;
|
|
13
|
+
luksMountpoint: string;
|
|
14
|
+
static description: string;
|
|
15
|
+
static flags: {
|
|
16
|
+
krill: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
18
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
19
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
static aliases: string[];
|
|
22
|
+
static examples: string[];
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
run(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param verbose
|
|
30
|
+
*/
|
|
31
|
+
backup(verbose?: boolean): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* usersFill
|
|
34
|
+
*/
|
|
35
|
+
usersFill(): Promise<Users[]>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
luksCreate(verbose?: boolean): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
luksOpen(verbose?: boolean): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
luksClose(verbose?: boolean): Promise<void>;
|
|
48
|
+
}
|