Skip to content

Commit

Permalink
[internal] refactor iso_report -> img_report
Browse files Browse the repository at this point in the history
* Also set rufus-next to 2.4
  • Loading branch information
pbatard committed Sep 2, 2015
1 parent 102e176 commit 5024e7f
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 240 deletions.
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for rufus 2.3.
# Generated by GNU Autoconf 2.69 for rufus 2.4.
#
# Report bugs to <https://github.com/pbatard/rufus/issues>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='2.3'
PACKAGE_STRING='rufus 2.3'
PACKAGE_VERSION='2.4'
PACKAGE_STRING='rufus 2.4'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='http://rufus.akeo.ie'

Expand Down Expand Up @@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rufus 2.3 to adapt to many kinds of systems.
\`configure' configures rufus 2.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1294,7 +1294,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rufus 2.3:";;
short | recursive ) echo "Configuration of rufus 2.4:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1385,7 +1385,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rufus configure 2.3
rufus configure 2.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1440,7 +1440,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 2.3, which was
It was created by rufus $as_me 2.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2303,7 +2303,7 @@ fi
# Define the identity of the package.
PACKAGE='rufus'
VERSION='2.3'
VERSION='2.4'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -4480,7 +4480,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rufus $as_me 2.3, which was
This file was extended by rufus $as_me 2.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4534,7 +4534,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
rufus config.status 2.3
rufus config.status 2.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([rufus], [2.3], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AC_INIT([rufus], [2.4], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4])
Expand Down
4 changes: 2 additions & 2 deletions src/checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ DWORD WINAPI SumThread(void* param)
for (rb = 0; ; rb += rSize) {
if (GetTickCount() > LastRefresh + 25) {
LastRefresh = GetTickCount();
format_percent = (100.0f*rb) / (1.0f*iso_report.projected_size);
format_percent = (100.0f*rb) / (1.0f*img_report.projected_size);
PrintInfo(0, MSG_271, format_percent);
SendMessage(hProgress, PBM_SETPOS, (WPARAM)((format_percent/100.0f)*MAX_PROGRESS), 0);
SetTaskbarProgressValue(rb, iso_report.projected_size);
SetTaskbarProgressValue(rb, img_report.projected_size);
}
CHECK_FOR_USER_CANCEL;
if (!ReadFile(h, buffer, sizeof(buffer), &rSize, NULL)) {
Expand Down
68 changes: 34 additions & 34 deletions src/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static void ToValidLabel(WCHAR* name, BOOL bFAT)
}

// Needed for disk by label isolinux.cfg workaround
wchar_to_utf8_no_alloc(name, iso_report.usb_label, sizeof(iso_report.usb_label));
wchar_to_utf8_no_alloc(name, img_report.usb_label, sizeof(img_report.usb_label));
}

/*
Expand Down Expand Up @@ -929,21 +929,21 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive)

// Syslinux
if ( (bt == BT_SYSLINUX_V4) || (bt == BT_SYSLINUX_V6) ||
((bt == BT_ISO) && (HAS_SYSLINUX(iso_report)) && (IS_FAT(fs))) ) {
((bt == BT_ISO) && (HAS_SYSLINUX(img_report)) && (IS_FAT(fs))) ) {
uprintf(using_msg, "Syslinux");
r = write_syslinux_mbr(fp);
goto notify;
}

// Grub 2.0
if ( ((bt == BT_ISO) && (iso_report.has_grub2)) || (bt == BT_GRUB2) ) {
if ( ((bt == BT_ISO) && (img_report.has_grub2)) || (bt == BT_GRUB2) ) {
uprintf(using_msg, "Grub 2.0");
r = write_grub2_mbr(fp);
goto notify;
}

// Grub4DOS
if ( ((bt == BT_ISO) && (iso_report.has_grub4dos)) || (bt == BT_GRUB4DOS) ) {
if ( ((bt == BT_ISO) && (img_report.has_grub4dos)) || (bt == BT_GRUB4DOS) ) {
uprintf(using_msg, "Grub4DOS");
r = write_grub_mbr(fp);
goto notify;
Expand All @@ -957,15 +957,15 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive)
}

// KolibriOS
if ( (bt == BT_ISO) && (iso_report.has_kolibrios) && (IS_FAT(fs))) {
if ( (bt == BT_ISO) && (img_report.has_kolibrios) && (IS_FAT(fs))) {
uprintf(using_msg, "KolibriOS");
r = write_kolibri_mbr(fp);
goto notify;
}

// If everything else failed, fall back to a conventional Windows/Rufus MBR
windows_mbr:
if ((IS_WINPE(iso_report.winpe) && !iso_report.uses_minint) || (IsChecked(IDC_RUFUS_MBR))) {
if ((IS_WINPE(img_report.winpe) && !img_report.uses_minint) || (IsChecked(IDC_RUFUS_MBR))) {
uprintf(using_msg, APPLICATION_NAME);
r = write_rufus_mbr(fp);
} else {
Expand Down Expand Up @@ -1002,10 +1002,10 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive)
(DWORD)(SelectedDrive.Geometry.BytesPerSector * SelectedDrive.Geometry.SectorsPerTrack) : 1024 * 1024;
max_size -= mbr_size;
// Syslinux has precedence over Grub
if ((bt == BT_ISO) && (!HAS_SYSLINUX(iso_report))) {
if (iso_report.has_grub4dos)
if ((bt == BT_ISO) && (!HAS_SYSLINUX(img_report))) {
if (img_report.has_grub4dos)
bt = BT_GRUB4DOS;
if (iso_report.has_grub2)
if (img_report.has_grub2)
bt = BT_GRUB2;
}

Expand Down Expand Up @@ -1056,7 +1056,7 @@ static __inline const char* bt_to_name(int bt) {
case BT_FREEDOS: return "FreeDOS";
case BT_REACTOS: return "ReactOS";
default:
return ((bt==BT_ISO)&&(iso_report.has_kolibrios))?"KolibriOS":"Standard";
return ((bt==BT_ISO)&&(img_report.has_kolibrios))?"KolibriOS":"Standard";
}
}
static BOOL WritePBR(HANDLE hLogicalVolume)
Expand All @@ -1082,7 +1082,7 @@ static BOOL WritePBR(HANDLE hLogicalVolume)
if (!write_fat_16_fd_br(fp, 0)) break;
} else if (bt == BT_REACTOS) {
if (!write_fat_16_ros_br(fp, 0)) break;
} else if ((bt == BT_ISO) && (iso_report.has_kolibrios)) {
} else if ((bt == BT_ISO) && (img_report.has_kolibrios)) {
uprintf("FAT16 is not supported for KolibriOS\n"); break;
} else {
if (!write_fat_16_br(fp, 0)) break;
Expand All @@ -1104,7 +1104,7 @@ static BOOL WritePBR(HANDLE hLogicalVolume)
if (!write_fat_32_fd_br(fp, 0)) break;
} else if (bt == BT_REACTOS) {
if (!write_fat_32_ros_br(fp, 0)) break;
} else if ((bt == BT_ISO) && (iso_report.has_kolibrios)) {
} else if ((bt == BT_ISO) && (img_report.has_kolibrios)) {
if (!write_fat_32_kos_br(fp, 0)) break;
} else {
if (!write_fat_32_br(fp, 0)) break;
Expand Down Expand Up @@ -1152,15 +1152,15 @@ static BOOL SetupWinPE(char drive_letter)
BOOL r = FALSE;
char* buf = NULL;

index = ((iso_report.winpe&WINPE_I386) == WINPE_I386)?0:1;
index = ((img_report.winpe&WINPE_I386) == WINPE_I386)?0:1;
// Allow other values than harddisk 1, as per user choice for disk ID
safe_sprintf(setupsrcdev, sizeof(setupsrcdev),
"SetupSourceDevice = \"\\device\\harddisk%d\\partition1\"", ComboBox_GetCurSel(hDiskID));
// Copy of ntdetect.com in root
safe_sprintf(src, sizeof(src), "%c:\\%s\\ntdetect.com", drive_letter, basedir[index]);
safe_sprintf(dst, sizeof(dst), "%c:\\ntdetect.com", drive_letter);
CopyFileA(src, dst, TRUE);
if (!iso_report.uses_minint) {
if (!img_report.uses_minint) {
// Create a copy of txtsetup.sif, as we want to keep the i386 files unmodified
safe_sprintf(src, sizeof(src), "%c:\\%s\\txtsetup.sif", drive_letter, basedir[index]);
safe_sprintf(dst, sizeof(dst), "%c:\\txtsetup.sif", drive_letter);
Expand All @@ -1182,11 +1182,11 @@ static BOOL SetupWinPE(char drive_letter)

// \minint with /minint option doesn't require further processing => return true
// \minint and no \i386 without /minint is unclear => return error
if (iso_report.winpe&WINPE_MININT) {
if (iso_report.uses_minint) {
if (img_report.winpe&WINPE_MININT) {
if (img_report.uses_minint) {
uprintf("Detected \\minint directory with /minint option: nothing to patch\n");
r = TRUE;
} else if (!(iso_report.winpe&WINPE_I386)) {
} else if (!(img_report.winpe&WINPE_I386)) {
uprintf("Detected \\minint directory only but no /minint option: not sure what to do\n");
}
goto out;
Expand Down Expand Up @@ -1231,7 +1231,7 @@ static BOOL SetupWinPE(char drive_letter)
}
}

if (!iso_report.uses_minint) {
if (!img_report.uses_minint) {
// Additional setupldr.bin/bootmgr patching
for (i=0; i<size-32; i++) {
// rdisk(0) -> rdisk(#) disk masquerading
Expand Down Expand Up @@ -1310,7 +1310,7 @@ BOOL SetupWinToGo(const char* drive_name, BOOL use_ms_efi)
uprintf("Mounted ISO as '%s'", mounted_iso);

// Now we use the WIM API to apply that image
static_sprintf(image, "%s%s", mounted_iso, &iso_report.install_wim_path[2]);
static_sprintf(image, "%s%s", mounted_iso, &img_report.install_wim_path[2]);
if (!WimApplyImage(image, 1, drive_name)) {
uprintf("Failed to apply Windows To Go image");
if (!IS_ERROR(FormatStatus))
Expand Down Expand Up @@ -1460,7 +1460,7 @@ void update_progress(const uint64_t processed_bytes)
{
if (GetTickCount() > LastRefresh + 25) {
LastRefresh = GetTickCount();
format_percent = (100.0f*processed_bytes)/(1.0f*iso_report.projected_size);
format_percent = (100.0f*processed_bytes)/(1.0f*img_report.projected_size);
PrintInfo(0, MSG_261, format_percent);
UpdateProgress(OP_FORMAT, format_percent);
}
Expand Down Expand Up @@ -1509,14 +1509,14 @@ DWORD WINAPI FormatThread(void* param)
pt = GETPARTTYPE((int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)));
tt = GETTARGETTYPE((int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)));
use_large_fat32 = (fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32));
windows_to_go = (togo_mode) && HAS_TOGO(iso_report) && (Button_GetCheck(GetDlgItem(hMainDialog, IDC_WINDOWS_TO_GO)) == BST_CHECKED);
windows_to_go = (togo_mode) && HAS_TOGO(img_report) && (Button_GetCheck(GetDlgItem(hMainDialog, IDC_WINDOWS_TO_GO)) == BST_CHECKED);
// Find out if we need to add any extra partitions
if ((windows_to_go) && (tt == TT_UEFI) && (pt == PARTITION_STYLE_GPT))
// According to Microsoft, every GPT disk (we RUN Windows from) must have an MSR due to not having hidden sectors
// http://msdn.microsoft.com/en-us/library/windows/hardware/dn640535.aspx#gpt_faq_what_disk_require_msr
extra_partitions = XP_MSR | XP_EFI;
else if ( (fs == FS_NTFS) && ((bt == BT_UEFI_NTFS) ||
((bt == BT_ISO) && (iso_report.has_efi) && ((tt == TT_UEFI) || (windows_to_go) || (allow_dual_uefi_bios)))) )
((bt == BT_ISO) && (img_report.has_efi) && ((tt == TT_UEFI) || (windows_to_go) || (allow_dual_uefi_bios)))) )
extra_partitions = XP_UEFI_NTFS;
else if (IsChecked(IDC_EXTRA_PARTITION))
extra_partitions = XP_COMPAT;
Expand Down Expand Up @@ -1674,10 +1674,10 @@ DWORD WINAPI FormatThread(void* param)
}
LastRefresh = 0;

if (iso_report.compression_type != BLED_COMPRESSION_NONE) {
if (img_report.compression_type != BLED_COMPRESSION_NONE) {
uprintf("Writing Compressed Image...");
bled_init(_uprintf, update_progress, &FormatStatus);
bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, iso_report.compression_type);
bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, img_report.compression_type);
bled_exit();
} else {
uprintf("Writing Image...");
Expand Down Expand Up @@ -1706,13 +1706,13 @@ DWORD WINAPI FormatThread(void* param)
break;
if (GetTickCount() > LastRefresh + 25) {
LastRefresh = GetTickCount();
format_percent = (100.0f*wb)/(1.0f*iso_report.projected_size);
format_percent = (100.0f*wb)/(1.0f*img_report.projected_size);
PrintInfo(0, MSG_261, format_percent);
UpdateProgress(OP_FORMAT, format_percent);
}
// Don't overflow our projected size (mostly for VHDs)
if (wb + rSize > iso_report.projected_size) {
rSize = (DWORD)(iso_report.projected_size - wb);
if (wb + rSize > img_report.projected_size) {
rSize = (DWORD)(img_report.projected_size - wb);
}
// WriteFile fails unless the size is a multiple of sector size
if (rSize % SectorSize != 0)
Expand Down Expand Up @@ -1826,13 +1826,13 @@ DWORD WINAPI FormatThread(void* param)
// All good
} else if (tt == TT_UEFI) {
// For once, no need to do anything - just check our sanity
if ( (bt != BT_ISO) || (!iso_report.has_efi) || (fs > FS_NTFS) ) {
if ( (bt != BT_ISO) || (!img_report.has_efi) || (fs > FS_NTFS) ) {
uprintf("Spock gone crazy error!\n");
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_INSTALL_FAILURE;
goto out;
}
} else if ( (bt == BT_SYSLINUX_V4) || (bt == BT_SYSLINUX_V6) ||
((bt == BT_ISO) && (HAS_SYSLINUX(iso_report) || IS_REACTOS(iso_report)) &&
((bt == BT_ISO) && (HAS_SYSLINUX(img_report) || IS_REACTOS(img_report)) &&
(!allow_dual_uefi_bios) && (IS_FAT(fs))) ) {
if (!InstallSyslinux(DriveIndex, drive_name[0], fs)) {
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_INSTALL_FAILURE;
Expand Down Expand Up @@ -1902,7 +1902,7 @@ DWORD WINAPI FormatThread(void* param)
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_ISO_EXTRACT);
goto out;
}
if (iso_report.has_kolibrios) {
if (img_report.has_kolibrios) {
kolibri_dst[0] = drive_name[0];
uprintf("Installing: %s (KolibriOS loader)\n", kolibri_dst);
if (ExtractISOFile(image_path, "HD_Load/USB_Boot/MTLD_F32", kolibri_dst,
Expand All @@ -1911,23 +1911,23 @@ DWORD WINAPI FormatThread(void* param)
}
}
// EFI mode selected, with no 'boot###.efi' but Windows 7 x64's 'bootmgr.efi' (bit #0)
if ((tt == TT_UEFI) && IS_WIN7_EFI(iso_report)) {
if ((tt == TT_UEFI) && IS_WIN7_EFI(img_report)) {
PrintInfoDebug(0, MSG_232);
iso_report.install_wim_path[0] = drive_name[0];
img_report.install_wim_path[0] = drive_name[0];
efi_dst[0] = drive_name[0];
efi_dst[sizeof(efi_dst) - sizeof("\\bootx64.efi")] = 0;
if (!CreateDirectoryA(efi_dst, 0)) {
uprintf("Could not create directory '%s': %s\n", WindowsErrorString());
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_PATCH);
} else {
efi_dst[sizeof(efi_dst) - sizeof("\\bootx64.efi")] = '\\';
if (!WimExtractFile(iso_report.install_wim_path, 1, "Windows\\Boot\\EFI\\bootmgfw.efi", efi_dst)) {
if (!WimExtractFile(img_report.install_wim_path, 1, "Windows\\Boot\\EFI\\bootmgfw.efi", efi_dst)) {
uprintf("Failed to setup Win7 EFI boot\n");
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_PATCH);
}
}
}
if ( (tt == TT_BIOS) && (IS_WINPE(iso_report.winpe)) ) {
if ( (tt == TT_BIOS) && (IS_WINPE(img_report.winpe)) ) {
// Apply WinPe fixup
if (!SetupWinPE(drive_name[0]))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_PATCH);
Expand Down
Loading

0 comments on commit 5024e7f

Please sign in to comment.