Merge pull request #234 from calamares/umount_log

Creating the option to copy an install log to target
This commit is contained in:
Teo Mrnjavac 2016-01-14 19:26:19 +01:00
commit 8c05254a75
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,18 @@
### Umount Module
---------
This module represents the last part of the installation, the unmounting of partitions used for the install. It is also the last place where it is possible to copy files to the target system, thus the best place to copy an installation log.
You can either use the default ```/root/.cache/Calamares/Calamares/Calamares.log```
to copy or if you want to use the full output of ```sudo calamares -d``` to create a log you will need to include a log creation to your launcher script or add it to the used calamares.desktop, example of a launcher script:
```
#!/bin/sh
sudo /usr/bin/calamares -d > installation.log
```
Example desktop line:
```
Exec=sudo /usr/bin/calamares -d > installation.log
```
Set the source and destination path of your install log in umount.conf.
If you do not wish to use the copy of an install log feature, no action needed, the default settings do not execute the copy of an install log in this module.

View File

@ -4,6 +4,7 @@
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
# Copyright 2016, Anke Boersma <demm@kaosx.us>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -20,6 +21,7 @@
import os
import subprocess
import shutil
import libcalamares
@ -47,6 +49,13 @@ def run():
:return:
"""
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
log_source = libcalamares.job.configuration["srcLog"]
log_destination = libcalamares.job.configuration["destLog"]
# copy installation log before umount
if(os.path.exists('{!s}'.format(log_source))):
shutil.copy2('{!s}'.format(log_source), '{!s}/{!s}'.format(
root_mount_point, log_destination))
if not root_mount_point:
return ("No mount point for root partition in globalstorage",

View File

@ -0,0 +1,9 @@
---
scrLog: "/path/to/installation.log"
destLog: "/var/log/installation.log"
# example when using the Calamares created log:
#srcLog: "/root/.cache/Calamares/Calamares/Calamares.log"
#destLog: "/var/log/Calamares.log"
# example when creating with a sudo calamares -d log:
#srcLog: "/home/live/installation.log"
#destLog: "/var/log/installation.log"