]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
installer: Fix detection if we have the correct ISO image mounted
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Oct 2017 14:50:31 +0000 (15:50 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Oct 2017 14:50:31 +0000 (15:50 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/installer
src/installer/configure.ac
src/installer/hw.c
src/installer/hw.h
src/installer/main.c

index 347d90e70bab6158e7571c7ea6a2c1c38243ca8f..790ac06df2040e11ab5e743c401bd4741dab5174 100644 (file)
@@ -59,6 +59,7 @@ $(TARGET) :
                --with-distro-name="$(NAME)" \
                --with-distro-sname="$(SNAME)" \
                --with-distro-slogan="$(SLOGAN)" \
+               --with-distro-version="$(VERSION)-core$(CORE)" \
                --with-config-root="$(CONFIG_ROOT)" \
                --with-download-url="$(DOWNLOAD_URL)"
 
index 85c5c5cb8c95a2c6f56680e5c541e9b889bb9234..fb4858cba8bba6c2b1a62b7f9c42d7a6b619c54a 100644 (file)
@@ -76,17 +76,22 @@ PKG_CHECK_MODULES(UDEV, [libudev])
 
 AC_ARG_WITH([distro-name],
        AS_HELP_STRING([--with-distro-name] [The name of the distribution]),
-       AC_DEFINE_UNQUOTED([NAME], "$withval", [The name of the distribution]),
+       AC_DEFINE_UNQUOTED([DISTRO_NAME], "$withval", [The name of the distribution]),
        AC_MSG_ERROR([*** you need to set the name with --with-distro-name=]))
 
 AC_ARG_WITH([distro-sname],
        AS_HELP_STRING([--with-distro-sname] [The short name of the distribution]),
-       AC_DEFINE_UNQUOTED([SNAME], "$withval", [The sname of the distribution]),
+       AC_DEFINE_UNQUOTED([DISTRO_SNAME], "$withval", [The sname of the distribution]),
        AC_MSG_ERROR([*** you need to set the sname with --with-distro-sname=]))
 
+AC_ARG_WITH([distro-version],
+       AS_HELP_STRING([--with-distro-sname] [The version of the distribution]),
+       AC_DEFINE_UNQUOTED([DISTRO_VERSION], "$withval", [The version of the distribution]),
+       AC_MSG_ERROR([*** you need to set the version with --with-distro-version=]))
+
 AC_ARG_WITH([distro-slogan],
        AS_HELP_STRING([--with-distro-slogan] [The slogan of the distribution]),
-       AC_DEFINE_UNQUOTED([SLOGAN], "$withval", [The slogan of the distribution]),
+       AC_DEFINE_UNQUOTED([DISTRO_SLOGAN], "$withval", [The slogan of the distribution]),
        AC_MSG_ERROR([*** you need to set the slogan with --with-distro-slogan=]))
 
 AC_ARG_WITH([config-root],
@@ -111,4 +116,9 @@ AC_MSG_RESULT([
        CFLAGS:                 ${OUR_CFLAGS} ${CFLAGS}
        CPPFLAGS:               ${OUR_CPPFLAGS} ${CPPFLAGS}
        LDFLAGS:                ${OUR_LDFLAGS} ${LDFLAGS}
+
+       Distribution:           ${DISTRO_NAME} (${DISTRO_SNAME})
+       Version:                ${DISTRO_VERSION}
+       Slogan:                 ${DISTRO_SLOGAN}
+       Config Root:            ${CONFIG_ROOT}
 ])
index 362be4779f14119e2582fe04eb6c4ecb367ce011..06bf42b6784fafa4c39d43a50938b50f5c6aed63 100644 (file)
@@ -165,7 +165,7 @@ static int hw_test_source_medium(const char* path) {
        // Umount the test device.
        hw_umount(SOURCE_MOUNT_PATH);
 
-       return (ret == 0);
+       return ret;
 }
 
 char* hw_find_source_medium(struct hw* hw) {
index f16b39cb6a04a0b86e50ec73573166092f62a3ea..e2d621be5404c4a6a3e5b76b64df06cb48009425 100644 (file)
@@ -24,8 +24,8 @@
 #include <libudev.h>
 
 #define DESTINATION_MOUNT_PATH        "/harddisk"
-#define SOURCE_MOUNT_PATH "/cdrom"
-#define SOURCE_TEST_FILE  SOURCE_MOUNT_PATH "/" VERSION ".media"
+#define SOURCE_MOUNT_PATH             "/cdrom"
+#define SOURCE_TEST_FILE              SOURCE_MOUNT_PATH "/" DISTRO_SNAME "-" DISTRO_VERSION ".media"
 
 #define HW_MAX_DISKS                 32
 #define STRING_SIZE                1024
index c420de3a18572760fa1a1eff837213f8be276153..e9517e2209033d820851898cf8b0ccf44e30fa06 100644 (file)
@@ -195,7 +195,7 @@ int write_lang_configs(char* lang) {
 
        /* default stuff for main/settings. */
        replacekeyvalue(kv, "LANGUAGE", lang);
-       replacekeyvalue(kv, "HOSTNAME", SNAME);
+       replacekeyvalue(kv, "HOSTNAME", DISTRO_SNAME);
        replacekeyvalue(kv, "THEME", "ipfire");
        writekeyvalues(kv, "/harddisk" CONFIG_ROOT "/main/settings");
        freekeyvalues(kv);
@@ -369,7 +369,7 @@ int main(int argc, char *argv[]) {
        FILE *copying;
 
        setlocale(LC_ALL, "");
-       sethostname(SNAME, 10);
+       sethostname(DISTRO_SNAME, 10);
 
        /* Log file/terminal stuff. */
        FILE* flog = NULL;
@@ -398,7 +398,7 @@ int main(int argc, char *argv[]) {
        if (roottext)
                newtDrawRootText(0, 0, roottext);
 
-       snprintf(title, sizeof(title), "%s - %s", NAME, SLOGAN);
+       snprintf(title, sizeof(title), "%s - %s", DISTRO_NAME, DISTRO_SLOGAN);
 
        // Parse parameters from the kernel command line
        parse_command_line(&config);
@@ -448,7 +448,7 @@ int main(int argc, char *argv[]) {
        if (!config.unattended) {
                snprintf(message, sizeof(message),
                        _("Welcome to the %s installation program.\n\n"
-                       "Selecting Cancel on any of the following screens will reboot the computer."), NAME);
+                       "Selecting Cancel on any of the following screens will reboot the computer."), DISTRO_NAME);
                newtWinMessage(title, _("Start installation"), message);
        }
 
@@ -933,7 +933,7 @@ int main(int argc, char *argv[]) {
                        "Please remove any installation mediums from this system and hit the reboot button. "
                        "Once the system has restarted you will be asked to setup networking and system passwords. "
                        "After that, you should point your web browser at https://%s:444 (or what ever you name "
-                       "your %s) for the web configuration console."), NAME, SNAME, NAME);
+                       "your %s) for the web configuration console."), DISTRO_NAME, DISTRO_SNAME, DISTRO_NAME);
                newtWinMessage(_("Congratulations!"), _("Reboot"), message);
        }