* [git.ipfire.org] IPFire 2.x development tree branch, seventeen, updated. 3e1145e1a0b1a08bf61d6c4962eeae48e3d0c355
@ 2014-11-05 0:35 git
0 siblings, 0 replies; only message in thread
From: git @ 2014-11-05 0:35 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 5644 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, seventeen has been updated
via 3e1145e1a0b1a08bf61d6c4962eeae48e3d0c355 (commit)
via 69749af1005aa4a35a63d5daf55f39e4c47554aa (commit)
via 6a91a5a72474b213bdba834175c665b963e12f5a (commit)
from 07686bd7e27e790af69f6c3ad7c5f24298ab4c21 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3e1145e1a0b1a08bf61d6c4962eeae48e3d0c355
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Wed Nov 5 01:34:27 2014 +0100
installer: Fix download of the ISO image
commit 69749af1005aa4a35a63d5daf55f39e4c47554aa
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Wed Nov 5 01:33:59 2014 +0100
installer: Don't try to install /etc/hosts which does not exist
commit 6a91a5a72474b213bdba834175c665b963e12f5a
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Wed Nov 5 01:33:29 2014 +0100
installer: Show better helpline in unattended mode
-----------------------------------------------------------------------
Summary of changes:
src/installer/downloadsource.sh | 9 ++++++
src/installer/dracut-module/module-setup.sh | 2 +-
src/installer/main.c | 48 +++++++++++++++++++++--------
3 files changed, 46 insertions(+), 13 deletions(-)
Difference in files:
diff --git a/src/installer/downloadsource.sh b/src/installer/downloadsource.sh
index 4a48686..c74f9e2 100644
--- a/src/installer/downloadsource.sh
+++ b/src/installer/downloadsource.sh
@@ -31,6 +31,15 @@ fi
OUTPUT="${1}"
URL="${2}"
+# Mount a tmpfs which is big enough to hold the ISO image
+OUTPUT_DIR="${OUTPUT%/*}"
+
+mkdir -p "${OUTPUT_DIR}"
+if ! mount -t tmpfs none "${OUTPUT_DIR}" -o size=512M; then
+ echo "Could not mount tmpfs to ${OUTPUT_DIR}" >&2
+ exit 1
+fi
+
echo "Downloading ${URL}..."
if ! download -O "${OUTPUT}" "${URL}"; then
echo "Download failed" >&2
diff --git a/src/installer/dracut-module/module-setup.sh b/src/installer/dracut-module/module-setup.sh
index 0173e95..08dcdd5 100755
--- a/src/installer/dracut-module/module-setup.sh
+++ b/src/installer/dracut-module/module-setup.sh
@@ -42,7 +42,7 @@ install() {
inst /var/ipfire/dhcpc/dhcpcd-run-hooks
inst "$moddir/70-dhcpcd.exe" "/var/ipfire/dhcpc/dhcpcd-hooks/70-dhcpcd.exe"
- inst /etc/host.conf /etc/hosts /etc/protocols
+ inst /etc/host.conf /etc/protocols
inst /etc/nsswitch.conf /etc/resolv.conf
inst_libdir_file "libnss_dns.so.*"
diff --git a/src/installer/main.c b/src/installer/main.c
index 9262a40..01a9cc6 100644
--- a/src/installer/main.c
+++ b/src/installer/main.c
@@ -25,7 +25,7 @@
#define INST_FILECOUNT 21000
#define LICENSE_FILE "/cdrom/COPYING"
-#define SOURCE_TEMPFILE "/tmp/downloaded-image.iso"
+#define SOURCE_TEMPFILE "/tmp/downloads/image.iso"
extern char url[STRING_SIZE];
@@ -412,7 +412,13 @@ int main(int argc, char *argv[]) {
setlocale(LC_ALL, language);
}
- char* helpline = center_string(_("<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"), screen_cols);
+ // Set helpline
+ char* helpline = NULL;
+ if (config.unattended)
+ helpline = center_string(_("Unattended mode"), screen_cols);
+ else
+ helpline = center_string(_("<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"), screen_cols);
+
newtPushHelpLine(helpline);
if (!config.unattended) {
@@ -496,7 +502,7 @@ int main(int argc, char *argv[]) {
FILE* f = fopen(SOURCE_TEMPFILE, "r");
if (f) {
- sourcedrive = SOURCE_TEMPFILE;
+ sourcedrive = strdup(SOURCE_TEMPFILE);
fclose(f);
} else {
char reason[STRING_SIZE] = "-";
@@ -843,6 +849,18 @@ int main(int argc, char *argv[]) {
// Umount source drive and eject
hw_umount(SOURCE_MOUNT_PATH);
+ // Free downloaded ISO image
+ if (strcmp(sourcedrive, SOURCE_TEMPFILE) == 0) {
+ rc = unlink(sourcedrive);
+ if (rc)
+ fprintf(flog, "Could not free downloaded ISO image: %s\n", sourcedrive);
+
+ // or eject real images
+ } else {
+ snprintf(commandstring, STRING_SIZE, "/usr/bin/eject %s", sourcedrive);
+ mysystem(logfile, commandstring);
+ }
+
// Download and execute the postinstall script
if (*config.postinstall) {
snprintf(commandstring, sizeof(commandstring),
@@ -854,9 +872,6 @@ int main(int argc, char *argv[]) {
}
}
- snprintf(commandstring, STRING_SIZE, "/usr/bin/eject %s", sourcedrive);
- mysystem(logfile, commandstring);
-
if (!config.unattended) {
snprintf(message, sizeof(message), _(
"%s was successfully installed!\n\n"
@@ -880,19 +895,28 @@ EXIT:
newtFinished();
// Free resources
- free(system_release);
- free(roottext);
- free(helpline);
+ if (system_release)
+ free(system_release);
+
+ if (roottext)
+ free(roottext);
+
+ if (helpline)
+ free(helpline);
+
+ if (sourcedrive)
+ free(sourcedrive);
- free(sourcedrive);
- free(destination);
+ if (destination)
+ free(destination);
hw_stop_all_raid_arrays(logfile);
if (selected_disks)
hw_free_disks(selected_disks);
- hw_free(hw);
+ if (hw)
+ hw_free(hw);
fcloseall();
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-11-05 0:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-05 0:35 [git.ipfire.org] IPFire 2.x development tree branch, seventeen, updated. 3e1145e1a0b1a08bf61d6c4962eeae48e3d0c355 git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox