| 1 |
#!/bin/bash |
| 2 |
# called from /etc/udev/rules.d/99-live-kiwi.rules |
| 3 |
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh |
| 4 |
type mountIso >/dev/null 2>&1 || . /lib/kiwi-live-lib.sh |
| 5 |
|
| 6 |
PATH=/usr/sbin:/usr/bin:/sbin:/bin |
| 7 |
|
| 8 |
# init debug log file if wanted |
| 9 |
setupDebugMode |
| 10 |
|
| 11 |
# initialize profile environment |
| 12 |
initialize |
| 13 |
|
| 14 |
# load required kernel modules |
| 15 |
loadKernelModules |
| 16 |
|
| 17 |
# provide ISO when remote |
| 18 |
root=$(ProvideIso "$1") |
| 19 |
|
| 20 |
# device nodes and types |
| 21 |
initGlobalDevices "$root" |
| 22 |
|
| 23 |
# live options and their default values |
| 24 |
initGlobalOptions |
| 25 |
|
| 26 |
# prepare overlay for generated systemd LiveOS_rootfs service |
| 27 |
declare isodiskdev=${isodiskdev} |
| 28 |
if getargbool 0 rd.live.overlay.persistent && [ -n "${isodiskdev}" ]; then |
| 29 |
if ! preparePersistentOverlay; then |
| 30 |
warn "Failed to setup persistent write space !" |
| 31 |
warn "Falling back to temporary overlay" |
| 32 |
prepareTemporaryOverlay |
| 33 |
fi |
| 34 |
else |
| 35 |
prepareTemporaryOverlay |
| 36 |
fi |
| 37 |
|
| 38 |
# mount ISO device |
| 39 |
iso_mount_point=$(mountIso) |
| 40 |
|
| 41 |
# mount squashfs compressed container |
| 42 |
container_mount_point=$( |
| 43 |
mountCompressedContainerFromIso "${iso_mount_point}" |
| 44 |
) |
| 45 |
|
| 46 |
# mount readonly root filesystem from container |
| 47 |
mountReadOnlyRootImageFromContainer "${container_mount_point}" |
| 48 |
|
| 49 |
need_shutdown |
| 50 |
|
| 51 |
exit 0 |