penguins-eggs 25.11.21 → 25.12.7
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 +53 -41
- package/README.md +80 -36
- package/README.pdf +21575 -3241
- package/addons/eggs/theme/livecd/full.grub.main.cfg +39 -4
- package/addons/eggs/theme/livecd/full.isolinux.main.cfg +47 -4
- package/bin/run.js +11 -0
- package/conf/derivatives.yaml +4 -2
- package/conf/exclude.list.d/var.list +11 -6
- package/dist/appimage/dependency-manager.d.ts +31 -0
- package/dist/appimage/dependency-manager.js +292 -0
- package/dist/appimage/first-run-check.js +3 -3
- package/dist/bin/run.js +11 -0
- package/dist/classes/cli-autologin.js +78 -53
- package/dist/classes/compressors.d.ts +7 -10
- package/dist/classes/compressors.js +44 -31
- package/dist/classes/daddy.js +11 -11
- package/dist/classes/distro.js +2 -2
- package/dist/classes/diversions.js +2 -3
- package/dist/classes/incubation/fisherman-helper/initcpio.d.ts +4 -0
- package/dist/classes/incubation/fisherman-helper/initcpio.js +14 -4
- package/dist/classes/incubation/fisherman-helper/settings.js +1 -1
- package/dist/classes/incubation/fisherman.js +1 -3
- package/dist/classes/incubation/incubator.js +1 -1
- package/dist/classes/network.d.ts +1 -1
- package/dist/classes/ovary.d/create-xdg-autostart.js +1 -1
- package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -12
- package/dist/classes/ovary.d/edit-live-fs.js +216 -186
- package/dist/classes/ovary.d/fertilization.js +1 -1
- package/dist/classes/ovary.d/make-dot-disk.js +1 -1
- package/dist/classes/ovary.d/produce.js +1 -1
- package/dist/classes/ovary.d/user-create-live.d.ts +4 -10
- package/dist/classes/ovary.d/user-create-live.js +82 -84
- package/dist/classes/ovary.d/users-remove.d.ts +5 -6
- package/dist/classes/ovary.d/users-remove.js +61 -31
- package/dist/classes/ovary.d/xorriso-command.js +1 -5
- package/dist/classes/ovary.d.ts +2 -2
- package/dist/classes/ovary.js +2 -2
- package/dist/classes/pacman.d/alpine.js +2 -2
- package/dist/classes/pacman.d/archlinux.js +2 -2
- package/dist/classes/pacman.d/debian.js +2 -3
- package/dist/classes/pacman.d/fedora.js +2 -3
- package/dist/classes/pacman.d/openmamba.js +2 -3
- package/dist/classes/pacman.d/opensuse.js +2 -3
- package/dist/classes/pacman.d.ts +21 -12
- package/dist/classes/pacman.js +55 -47
- package/dist/classes/pve-live.js +1 -1
- package/dist/classes/settings.js +1 -1
- package/dist/classes/sys-users.d.ts +76 -0
- package/dist/classes/sys-users.js +206 -0
- package/dist/classes/utils.d/kernel.js +3 -3
- package/dist/classes/utils.d.ts +16 -11
- package/dist/classes/utils.js +92 -56
- package/dist/classes/xdg.js +1 -1
- package/dist/classes/yolk.js +2 -4
- package/dist/commands/config.js +3 -14
- package/dist/commands/cuckoo.js +1 -1
- package/dist/commands/export/appimage.js +3 -3
- package/dist/commands/export/pkg.js +3 -3
- package/dist/commands/export/tarballs.js +3 -3
- package/dist/commands/krill.js +1 -1
- package/dist/commands/produce.js +9 -4
- package/dist/commands/{setup.d.ts → setup/install.d.ts} +1 -5
- package/dist/commands/setup/install.js +71 -0
- package/dist/commands/setup/purge.d.ts +17 -0
- package/dist/commands/setup/purge.js +71 -0
- package/dist/commands/tools/yolk.js +1 -1
- package/dist/commands/update.d.ts +15 -0
- package/dist/commands/update.js +74 -7
- package/dist/interfaces/i-exec.d.ts +1 -0
- package/dist/krill/classes/prepare.d/location.js +1 -1
- package/dist/krill/classes/prepare.d/partitions.js +1 -1
- package/dist/krill/classes/prepare.d/users.js +2 -2
- package/dist/krill/classes/prepare.js +5 -5
- package/dist/krill/classes/sequence.d/add_user.d.ts +3 -15
- package/dist/krill/classes/sequence.d/add_user.js +87 -57
- package/dist/krill/classes/sequence.d/change_password.d.ts +5 -7
- package/dist/krill/classes/sequence.d/change_password.js +25 -10
- package/dist/krill/classes/sequence.d/del_live_user.d.ts +5 -7
- package/dist/krill/classes/sequence.d/del_live_user.js +39 -25
- package/dist/krill/classes/sequence.d/fstab.js +1 -1
- package/dist/krill/classes/sequence.d/grubcfg.d.ts +3 -7
- package/dist/krill/classes/sequence.d/grubcfg.js +33 -13
- package/dist/krill/classes/sequence.d/mkfs.js +1 -2
- package/dist/krill/classes/sequence.d/unpackfs.d.ts +2 -4
- package/dist/krill/classes/sequence.d/unpackfs.js +8 -5
- package/dist/krill/classes/sequence.js +2 -3
- package/dist/krill/components/title.js +4 -4
- package/dist/krill/lib/select_installation_device.js +1 -1
- package/dist/krill/lib/select_replaced_partition.js +1 -1
- package/dist/lib/utils.d.ts +51 -19
- package/dist/lib/utils.js +225 -39
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +29 -17
- package/package.json +13 -14
- package/perrisbrewery/template/dependencies.yaml +1 -0
- package/scripts/_eggs +35 -7
- package/scripts/boot-encrypted-root.sh +220 -0
- package/scripts/eggs.bash +2 -1
- package/scripts/mount-encrypted-home.sh +324 -0
- package/dist/appimage/prerequisites.d.ts +0 -34
- package/dist/appimage/prerequisites.js +0 -350
- package/dist/commands/setup.js +0 -90
- package/dracut/create-symlink +0 -71
- package/dracut/dracut-log.txt +0 -3
- package/dracut/export +0 -4
- package/dracut/export-dracut-analysis +0 -51
- package/dracut/export-dracut-log +0 -2
- package/dracut/mkisofs +0 -10
- package/dracut/renew-initramfs +0 -17
- package/dracut/sbin2bin +0 -10
- package/dracut/update-dracut-conf-d +0 -2
- package/dracut/update-dracut-modules +0 -62
- package/scripts/appimage-build.sh +0 -152
- package/scripts/appimage-install.sh +0 -43
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "penguins-eggs",
|
|
3
3
|
"shortName": "eggs",
|
|
4
4
|
"description": "A remaster system tool, compatible with Almalinux, Alpine, Arch, Debian, Devuan, Fedora, Manjaro, Opensuse, Ubuntu and derivatives",
|
|
5
|
-
"version": "25.
|
|
5
|
+
"version": "25.12.7",
|
|
6
6
|
"author": "Piero Proietti",
|
|
7
7
|
"bin": {
|
|
8
8
|
"eggs": "./bin/run.js"
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
"@oclif/plugin-autocomplete": "^3.2.39",
|
|
14
14
|
"@oclif/plugin-help": "^6.2.36",
|
|
15
15
|
"@oclif/plugin-version": "^2.2.36",
|
|
16
|
-
"@types/express": "^5.0.
|
|
16
|
+
"@types/express": "^5.0.6",
|
|
17
17
|
"ansis": "^4.2.0",
|
|
18
18
|
"axios": "^1.13.2",
|
|
19
|
+
"bcryptjs": "^3.0.3",
|
|
19
20
|
"chalk": "^5.6.2",
|
|
20
21
|
"cli-cursor": "^5.0.0",
|
|
21
22
|
"debug": "^4.4.3",
|
|
22
|
-
"express": "^5.1
|
|
23
|
+
"express": "^5.2.1",
|
|
23
24
|
"ink": "^5",
|
|
24
25
|
"ink-progress-bar": "^3.0.0",
|
|
25
26
|
"ink-spinner": "^5.0.0",
|
|
@@ -29,7 +30,6 @@
|
|
|
29
30
|
"netmask": "^2.0.2",
|
|
30
31
|
"react": "^18.3.1",
|
|
31
32
|
"read": "^4.1.0",
|
|
32
|
-
"shelljs": "^0.10.0",
|
|
33
33
|
"systeminformation": "^5.27.11",
|
|
34
34
|
"tftp": "^0.1.2",
|
|
35
35
|
"ws": "^8.18.3"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@oclif/prettier-config": "^0.2.1",
|
|
39
39
|
"@oclif/test": "^4.1.15",
|
|
40
|
+
"@types/bcryptjs": "^3.0.0",
|
|
40
41
|
"@types/chai": "^5.2.3",
|
|
41
42
|
"@types/debug": "^4.1.12",
|
|
42
43
|
"@types/glob": "^9.0.0",
|
|
@@ -44,28 +45,27 @@
|
|
|
44
45
|
"@types/js-yaml": "^4.0.9",
|
|
45
46
|
"@types/mocha": "^10.0.8",
|
|
46
47
|
"@types/mustache": "^4.2.6",
|
|
47
|
-
"@types/netmask": "^2.0.
|
|
48
|
+
"@types/netmask": "^2.0.6",
|
|
48
49
|
"@types/node": "^22.15.30",
|
|
49
50
|
"@types/react": "^18.3.18",
|
|
50
51
|
"@types/read": "^0.0.32",
|
|
51
|
-
"@types/shelljs": "^0.8.17",
|
|
52
52
|
"@types/ws": "^8.18.1",
|
|
53
53
|
"chai": "^6.2.1",
|
|
54
54
|
"eslint": "^9.39.1",
|
|
55
|
-
"eslint-config-oclif": "^6.0.
|
|
55
|
+
"eslint-config-oclif": "^6.0.124",
|
|
56
56
|
"eslint-config-prettier": "^10.1.8",
|
|
57
|
-
"glob": "^
|
|
57
|
+
"glob": "^13.0.0",
|
|
58
58
|
"mocha": "^11.7.5",
|
|
59
|
-
"oclif": "^4.22.
|
|
59
|
+
"oclif": "^4.22.54",
|
|
60
60
|
"perrisbrewery": "^25.9.16",
|
|
61
|
-
"prettier": "^3.
|
|
61
|
+
"prettier": "^3.7.4",
|
|
62
62
|
"shx": "^0.4.0",
|
|
63
63
|
"ts-node": "10.9.2",
|
|
64
64
|
"ts-prune": "^0.10.3",
|
|
65
65
|
"typescript": "^5.9.3"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
|
-
"node": ">=
|
|
68
|
+
"node": ">=22.0.0"
|
|
69
69
|
},
|
|
70
70
|
"files": [
|
|
71
71
|
".oclif.manifest.json",
|
|
@@ -110,10 +110,9 @@
|
|
|
110
110
|
"repository": "pieroproietti/penguins-eggs",
|
|
111
111
|
"types": "dist/index.d.ts",
|
|
112
112
|
"scripts": {
|
|
113
|
-
"appimage": "pnpm build && ./
|
|
114
|
-
"appimage:install": "./scripts/appimage-install.sh",
|
|
113
|
+
"appimage": "pnpm build && ./appimage.sh",
|
|
115
114
|
"build": "pnpm clean && shx rm -rf dist && tsc -p . && oclif manifest",
|
|
116
|
-
"clean": "rm -rf build dist *.AppImage AppDir
|
|
115
|
+
"clean": "rm -rf build dist *.AppImage AppDir",
|
|
117
116
|
"deb": "pnpm build && pb deb --release $(cat ./release)",
|
|
118
117
|
"format": "prettier --write \"+(src|test)/**/*.+(ts|js|json)\"",
|
|
119
118
|
"lint": "eslint . --ext .ts",
|
package/scripts/_eggs
CHANGED
|
@@ -58,6 +58,37 @@ _values "completions" \
|
|
|
58
58
|
esac
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
_eggs_setup() {
|
|
62
|
+
local context state state_descr line
|
|
63
|
+
typeset -A opt_args
|
|
64
|
+
|
|
65
|
+
_arguments -C "1: :->cmds" "*::arg:->args"
|
|
66
|
+
|
|
67
|
+
case "$state" in
|
|
68
|
+
cmds)
|
|
69
|
+
_values "completions" \
|
|
70
|
+
"install[Automatically check and install system prerequisites]" \
|
|
71
|
+
"purge[Automatically check and install system prerequisites]" \
|
|
72
|
+
|
|
73
|
+
;;
|
|
74
|
+
args)
|
|
75
|
+
case $line[1] in
|
|
76
|
+
"install")
|
|
77
|
+
_arguments -S \
|
|
78
|
+
--help"[Show help for command]" \
|
|
79
|
+
"*: :_files"
|
|
80
|
+
;;
|
|
81
|
+
"purge")
|
|
82
|
+
_arguments -S \
|
|
83
|
+
--help"[Show help for command]" \
|
|
84
|
+
"*: :_files"
|
|
85
|
+
;;
|
|
86
|
+
|
|
87
|
+
esac
|
|
88
|
+
;;
|
|
89
|
+
esac
|
|
90
|
+
}
|
|
91
|
+
|
|
61
92
|
_eggs_tools() {
|
|
62
93
|
local context state state_descr line
|
|
63
94
|
typeset -A opt_args
|
|
@@ -191,6 +222,7 @@ _eggs() {
|
|
|
191
222
|
cmds)
|
|
192
223
|
_values "completions" \
|
|
193
224
|
"export[export penguins-eggs AppImage to the destination host]" \
|
|
225
|
+
"setup[Automatically check and install system prerequisites]" \
|
|
194
226
|
"tools[clean system log, apt, etc]" \
|
|
195
227
|
"wardrobe[get warorobe]" \
|
|
196
228
|
"adapt[adapt monitor resolution for VM only]" \
|
|
@@ -203,7 +235,6 @@ _eggs() {
|
|
|
203
235
|
"love[the simplest way to get an egg!]" \
|
|
204
236
|
"mom[ask help from mommy - TUI helper]" \
|
|
205
237
|
"produce[produce a live image from your system]" \
|
|
206
|
-
"setup[Automatically check and install system prerequisites]" \
|
|
207
238
|
"status[informations about eggs status]" \
|
|
208
239
|
"update[update the Penguins' eggs tool]" \
|
|
209
240
|
"autocomplete[Display autocomplete installation instructions.]" \
|
|
@@ -216,6 +247,9 @@ _eggs() {
|
|
|
216
247
|
export)
|
|
217
248
|
_eggs_export
|
|
218
249
|
;;
|
|
250
|
+
setup)
|
|
251
|
+
_eggs_setup
|
|
252
|
+
;;
|
|
219
253
|
tools)
|
|
220
254
|
_eggs_tools
|
|
221
255
|
;;
|
|
@@ -335,12 +369,6 @@ _arguments -S \
|
|
|
335
369
|
"(-y --yolk)"{-y,--yolk}"[force yolk renew]" \
|
|
336
370
|
--help"[Show help for command]" \
|
|
337
371
|
"*: :_files" ;;
|
|
338
|
-
setup)
|
|
339
|
-
_arguments -S \
|
|
340
|
-
"(-c --check)"{-c,--check}"[check status only, do not install]" \
|
|
341
|
-
"(-f --force)"{-f,--force}"[force installation even if already installed]" \
|
|
342
|
-
--help"[Show help for command]" \
|
|
343
|
-
"*: :_files" ;;
|
|
344
372
|
status)
|
|
345
373
|
_arguments -S \
|
|
346
374
|
"(-h --help)"{-h,--help}"[Show CLI help.]" \
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# /scripts/live-premount/boot-encrypted-root.sh
|
|
3
|
+
#
|
|
4
|
+
# This script is designed to Boot Encrypted Linux Live (BELL).
|
|
5
|
+
#
|
|
6
|
+
# Its main purpose is to find an encrypted root image file (root.img)
|
|
7
|
+
# on a live USB/DVD, ask the user for a passphrase to unlock it,
|
|
8
|
+
# and then copy the main system filesystem (filesystem.squashfs)
|
|
9
|
+
# from inside the encrypted image into RAM.
|
|
10
|
+
#
|
|
11
|
+
# the process continue with standard live-boot
|
|
12
|
+
|
|
13
|
+
# enable echo
|
|
14
|
+
# set -e
|
|
15
|
+
|
|
16
|
+
echo "BELL: Boot Encrypted Linux Live"
|
|
17
|
+
|
|
18
|
+
#################################################
|
|
19
|
+
# 1. Setup and Find Media
|
|
20
|
+
|
|
21
|
+
# 1.1 load modules
|
|
22
|
+
echo "BELL: loading modules..."
|
|
23
|
+
modprobe loop 2>/dev/null || true
|
|
24
|
+
modprobe dm_mod 2>/dev/null || true
|
|
25
|
+
modprobe dm_crypt 2>/dev/null || true
|
|
26
|
+
modprobe overlay 2>/dev/null || true
|
|
27
|
+
modprobe ext4 2>/dev/null || true
|
|
28
|
+
modprobe squashfs 2>/dev/null || true
|
|
29
|
+
sleep 2
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# 1.2 find BELL media drive
|
|
33
|
+
echo "BELL: find BELL media drive..."
|
|
34
|
+
mkdir -p /mnt/live-media /mnt/ext4
|
|
35
|
+
BELL_MEDIA_MNT="/mnt/live-media"
|
|
36
|
+
LIVE_DEV=""
|
|
37
|
+
|
|
38
|
+
# find to max 20 devices
|
|
39
|
+
MAX_WAIT_DEV=20; COUNT_DEV=0
|
|
40
|
+
while [ -z "$LIVE_DEV" ] && [ $COUNT_DEV -lt $MAX_WAIT_DEV ]; do
|
|
41
|
+
ls /dev > /dev/null
|
|
42
|
+
for dev in /dev/sr* /dev/sd* /dev/vd* /dev/nvme*n*; do
|
|
43
|
+
if [ ! -b "$dev" ]; then continue; fi
|
|
44
|
+
if mount -o ro "$dev" "$BELL_MEDIA_MNT" 2>/dev/null; then
|
|
45
|
+
if [ -f "${BELL_MEDIA_MNT}/live/root.img" ]; then
|
|
46
|
+
echo "BELL: Found BELL media on $dev"
|
|
47
|
+
LIVE_DEV=$dev
|
|
48
|
+
break 2
|
|
49
|
+
else
|
|
50
|
+
umount "$BELL_MEDIA_MNT" 2>/dev/null || true
|
|
51
|
+
fi
|
|
52
|
+
fi
|
|
53
|
+
done
|
|
54
|
+
sleep 1
|
|
55
|
+
COUNT_DEV=$((COUNT_DEV+1))
|
|
56
|
+
done
|
|
57
|
+
|
|
58
|
+
if [ -z "$LIVE_DEV" ]; then
|
|
59
|
+
echo "BELL: Error: no live BELL drive found!"
|
|
60
|
+
ls /dev
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
ROOT_IMG_RO="${BELL_MEDIA_MNT}/live/root.img"
|
|
65
|
+
RAM_MEDIA_MNT="/run/live/medium" # final destination in RAM
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#################################################
|
|
69
|
+
# 2. Prepare Encrypted Image
|
|
70
|
+
|
|
71
|
+
# 2.1 loop device
|
|
72
|
+
echo "BELL: loop device association for $ROOT_IMG_RO..."
|
|
73
|
+
LOOP_DEV_OUTPUT=$(/sbin/losetup -f --show "$ROOT_IMG_RO" 2>/dev/null); LOSETUP_EXIT_STATUS=$?
|
|
74
|
+
if [ $LOSETUP_EXIT_STATUS -ne 0 ] || [ -z "$LOOP_DEV_OUTPUT" ] || ! [ -b "$LOOP_DEV_OUTPUT" ]; then
|
|
75
|
+
echo "BELL: Error: loop association failed!"
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
LOOP_DEV="$LOOP_DEV_OUTPUT"
|
|
79
|
+
echo "BELL: loop device $ROOT_IMG_RO associated to: $LOOP_DEV"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
#################################################
|
|
84
|
+
# 3. Unlock LUKS (User Interaction)
|
|
85
|
+
|
|
86
|
+
# disable 'set -e' to let 3 tempts
|
|
87
|
+
#set +e
|
|
88
|
+
MAX_ATTEMPTS=3
|
|
89
|
+
ATTEMPT=1
|
|
90
|
+
UNLOCKED=0
|
|
91
|
+
|
|
92
|
+
while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
|
|
93
|
+
|
|
94
|
+
# check if plymouth is active
|
|
95
|
+
if plymouth --ping 2>/dev/null; then
|
|
96
|
+
|
|
97
|
+
# request the password in plymouth and pass it to cryptsetup via stdin (--key-file -)
|
|
98
|
+
if plymouth ask-for-password --prompt="Enter passphrase ($ATTEMPT/$MAX_ATTEMPTS)" | cryptsetup open --readonly --key-file - "$LOOP_DEV" live-root; then
|
|
99
|
+
UNLOCKED=1
|
|
100
|
+
break
|
|
101
|
+
else
|
|
102
|
+
if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
|
|
103
|
+
plymouth display-message --text="Incorrect passphrase. Try again..."
|
|
104
|
+
sleep 2 # wait 2 seconds to read message
|
|
105
|
+
fi
|
|
106
|
+
fi
|
|
107
|
+
else
|
|
108
|
+
# Fallback: Plymouth not active
|
|
109
|
+
echo "Please enter passphrase for $LOOP_DEV ($ATTEMPT/$MAX_ATTEMPTS):"
|
|
110
|
+
|
|
111
|
+
if cryptsetup open --readonly "$LOOP_DEV" live-root; then
|
|
112
|
+
UNLOCKED=1
|
|
113
|
+
break
|
|
114
|
+
else
|
|
115
|
+
if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
|
|
116
|
+
echo "Incorrect passphrase. Please try again."
|
|
117
|
+
fi
|
|
118
|
+
fi
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
ATTEMPT=$((ATTEMPT + 1))
|
|
122
|
+
sleep 1
|
|
123
|
+
done
|
|
124
|
+
|
|
125
|
+
# Enable echo
|
|
126
|
+
# set -e
|
|
127
|
+
|
|
128
|
+
# check if all attempts have failed
|
|
129
|
+
if [ $UNLOCKED -eq 0 ]; then
|
|
130
|
+
if plymouth --ping 2>/dev/null; then
|
|
131
|
+
plymouth display-message --text="LUKS Unlock Failed: Max attempts reached"
|
|
132
|
+
sleep 5
|
|
133
|
+
fi
|
|
134
|
+
/sbin/losetup -d "$LOOP_DEV" || true
|
|
135
|
+
exit 1
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
echo "BELL: LUKS unlocked ($LOOP_DEV -> live-root) [readonly]. Waiting for mapper..."
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
#################################################
|
|
142
|
+
# 4. copy System to RAM
|
|
143
|
+
|
|
144
|
+
# 4.1 waiting mapper
|
|
145
|
+
MAX_WAIT_MAP=10; COUNT_MAP=0
|
|
146
|
+
while [ ! -b /dev/mapper/live-root ] && [ $COUNT_MAP -lt $MAX_WAIT_MAP ]; do
|
|
147
|
+
sleep 1
|
|
148
|
+
COUNT_MAP=$((COUNT_MAP+1))
|
|
149
|
+
done
|
|
150
|
+
|
|
151
|
+
if [ ! -b /dev/mapper/live-root ]; then
|
|
152
|
+
echo "BELL: Error: mapper did not appear."
|
|
153
|
+
cryptsetup close live-root || true
|
|
154
|
+
/sbin/losetup -d "$LOOP_DEV" || true
|
|
155
|
+
exit 1
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# 4.2 mount ext4 filesystem
|
|
159
|
+
echo "BELL: mounting ext4 filesystem..."
|
|
160
|
+
mount -t ext4 -o ro /dev/mapper/live-root /mnt/ext4
|
|
161
|
+
|
|
162
|
+
SQFS_SRC="/mnt/ext4/filesystem.squashfs"
|
|
163
|
+
if [ ! -f "$SQFS_SRC" ]; then
|
|
164
|
+
echo "BELL: error: $SQFS_SRC not found!"
|
|
165
|
+
exit 1
|
|
166
|
+
fi
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# 4.3. Prepare RAM destination /run
|
|
170
|
+
echo "BELL: preparing RAM disk ${RAM_MEDIA_MNT}..."
|
|
171
|
+
SQFS_SIZE_BYTES=$(stat -c%s "$SQFS_SRC")
|
|
172
|
+
NEEDED_SIZE_MB=$(( $SQFS_SIZE_BYTES / 1024 / 1024 + 500 )) # add 500MB buffer
|
|
173
|
+
echo "BELL: Estimated space required in /run: ${NEEDED_SIZE_MB} MB"
|
|
174
|
+
echo "BELL: increase size /run (tmpfs)..."
|
|
175
|
+
if ! mount -o remount,size=${NEEDED_SIZE_MB}M /run; then
|
|
176
|
+
echo "BELL: WARN: Remount /run failed, space may be insufficient."
|
|
177
|
+
df -h /run
|
|
178
|
+
fi
|
|
179
|
+
mkdir -p "${RAM_MEDIA_MNT}/live"
|
|
180
|
+
|
|
181
|
+
# 4.4 copy ONLY filesystem.squashfs to RAM
|
|
182
|
+
SQFS_DEST="${RAM_MEDIA_MNT}/live/filesystem.squashfs"
|
|
183
|
+
echo "BELL: copying $SQFS_SRC -> $SQFS_DEST..."
|
|
184
|
+
if command -v rsync >/dev/null; then
|
|
185
|
+
rsync -a --info=progress2 "$SQFS_SRC" "$SQFS_DEST"
|
|
186
|
+
else
|
|
187
|
+
cp "$SQFS_SRC" "$SQFS_DEST"
|
|
188
|
+
fi
|
|
189
|
+
SQFS_SIZE=$(du -h "$SQFS_DEST" | cut -f1)
|
|
190
|
+
echo "BELL: filesystem.squashfs ($SQFS_SIZE) copied to RAM."
|
|
191
|
+
|
|
192
|
+
# 4.5 copy .disk
|
|
193
|
+
if [ -d "${BELL_MEDIA_MNT}/.disk" ]; then
|
|
194
|
+
cp -a "${BELL_MEDIA_MNT}/.disk" "${RAM_MEDIA_MNT}/"
|
|
195
|
+
echo "BELL: .disk copied."
|
|
196
|
+
else
|
|
197
|
+
echo "BELL: Warning: .disk not found."
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
# 4.6 Copy vmlinuz and initrd (we need to install the system)
|
|
201
|
+
cp -a "${BELL_MEDIA_MNT}/live/vmlinuz"* "${RAM_MEDIA_MNT}/live/" 2>/dev/null || true
|
|
202
|
+
cp -a "${BELL_MEDIA_MNT}/live/initrd"* "${RAM_MEDIA_MNT}/live/" 2>/dev/null || true
|
|
203
|
+
echo "BELL: Attempted kernel/initrd copy (any errors ignored)."
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
#################################################
|
|
207
|
+
# 6. Cleanup and Hand-off
|
|
208
|
+
echo "BELL: cleaning used mounts and devices..."
|
|
209
|
+
umount /mnt/ext4 || echo "BELL: WARN: umount /mnt/ext4 failed ($?)"
|
|
210
|
+
cryptsetup close live-root || echo "BELL: WARN: cryptsetup close live-root failed ($?)"
|
|
211
|
+
/sbin/losetup -d "$LOOP_DEV" || echo "BELL: WARN: losetup -d $LOOP_DEV failed ($?)"
|
|
212
|
+
umount "$BELL_MEDIA_MNT" || echo "BELL: WARN: umount ${BELL_MEDIA_MNT} failed ($?)"
|
|
213
|
+
echo "BELL: cleaning complete."
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# 6.1 switching to live boot
|
|
217
|
+
echo "BELL: live ISO image built in RAM on ${RAM_MEDIA_MNT}"
|
|
218
|
+
# ls -l "$RAM_MEDIA_MNT"
|
|
219
|
+
# ls -l "${RAM_MEDIA_MNT}/live"
|
|
220
|
+
exit 0
|
package/scripts/eggs.bash
CHANGED
|
@@ -25,7 +25,8 @@ krill --btrfs --chroot --crypted --domain --halt --help --ip --nointeractive --n
|
|
|
25
25
|
love --help --verbose --hidden --nointeractive --clone --homecrypt --fullcrypt
|
|
26
26
|
mom --help
|
|
27
27
|
produce --addons --basename --clone --homecrypt --fullcrypt --excludes --help --hidden --kernel --links --max --noicon --nointeractive --pendrive --prefix --release --script --standard --theme --includeRootHome --verbose --yolk
|
|
28
|
-
setup
|
|
28
|
+
setup:install
|
|
29
|
+
setup:purge
|
|
29
30
|
status --help --verbose
|
|
30
31
|
tools:clean --help --nointeractive --verbose
|
|
31
32
|
tools:repo --add --help --nointeractive --remove --verbose
|