ROSA Image Writer README

# ROSA Image Writer

## Description

This tool is designed for creating bootable USB flash disks with ROSA Linux installator by dumping the distribution ISO image file contents to the flash disk. It might also work the same way for other Linux (or non-Linux) distributions, but there is no guarantee since the image must be prepared for such use.

The tool is distributed under the GPL v3 license which terms and conditions you can find in the file LICENSE.html.

Copyright © 2016 ROSA

Developed by: Konstantin Vlasov <konstantin.vlasov@rosalab.ru>, NTC IT ROSA LLC

## Using

Warning! This tool deletes all the data on the selected USB device, including the partition table (if any), so please be careful and check your actions twice!

The application requires direct access to the physical device, so when you start it, automatical request for Administrator/root privileges will appear. The application's main window looks like follows:

You need to select the source image file and the target USB flash disk where this image will be written. Press the Open button, and the Open file dialog will be shown where you can choose the appropriate image file. (Alternatively, you can specify the path to the ISO file as command-line argument.) The target device can be selected from the corresponding drop-down list. The list should update automatically when you insert or remove some device, but if it doesn't just press the Refresh button.

Now you can press the Write button and after additional confirmation the writing will start, displaying the progress bar and the Cancel button for stopping the operation if you decided to abort it. Please, remember that even if you cancel writing, the files on the target device will be lost anyway, because the partition table and file system structures are located at the very beginning of the disk, and therefore become overwritten first.

Due to special structure of ROSA installation images, you may find it impossible to use the USB flash drive for storing data afterwards: the disk will be displayed as a very small device (like 5 MB or so). To clear you USB device and make it full-size again, press the Clear button. It will remove the partitioning data from the disk, and you will be able to format it to full capacity using any formatting tool you prefer. Actually, what's happening is this: for booting from UEFI firmware, there is a small EFI partition in the ROSA installation image. No other partitions are present, so operating system will display just this only partition as if it was the whole device. You can simply remove it using diskdrake, gparted, or any other partitioning tool, and then OS will see the disk's full capacity. However, many users find this confusing, and we decided to implement the clearing function right in the ImageWriter.

## Building from Sources

The project source code is publshed on the ROSA ABF server: https://abf.rosalinux.ru/captainflint/rosa-image-writer. You may either clone the repository or download the latest snapshot as tarball or ZIP archive.

For building ROSA Image Writer from sources, you will need Qt5 development environment for your operating system (download the binary package from Qt Project Downloads). Additional requirements (other configurations might also work, but were not tested):

- Windows, Qt for VS 2013:
  - Microsoft Visual Studio 2013 SDK or later.
- Linux:
  - libudev development package (possible names: libudev-devel, libudev-dev);
  - libGL development package with dependencies (possible names: libgl-devel, Mesa-libGL-devel, libgl1-mesa-dev).
- Mac OS X:
  - Xcode.

If you plan to deploy the application, it is recommended to build static version of Qt from sources (see Qt documentation), otherwise you'll need to distribute the application with its dependent shared libraries and Qt plugins, which would increase the total size of the package.

Building the application is simple and straight-forward:

### Using Qt Creator

Just open the project file `RosaImageWriter.pro` in the IDE, configure to use the correct Qt kit and build the program.

### From command line

#### In Windows, Qt for VS:

Open the Windows SDK command prompt. If your Qt installation is not in the `PATH` environmebt variable add it there:

`set PATH=%PATH%;C:\Programs\Qt\qtbase\bin`

Go to the source directory of the project and run:

`qmake`
`nmake Release`

#### In Windows, Qt for MinGW:

Open the MinGW command prompt, go to the source directory of the project and run:

`qmake`
`mingw32-make Release`

#### In Linux/Mac OS X:

Go to the source directory of the project and run:

`qmake`
`make`

#### Localizations:

To build localizations, you will need to run `lrelease` for each of the `ts` file and put the resulting `qm` files into the `lang` subdirectory near the application executable. You may use the script build-translations to generate all the translation binaries at once. Usage (supposing the current directory is the project directory):

1. For building translations directly in the `lang` subdirectory, simply use the `lrelease` tool:
   in Linux/Mac OS X:
   `$ lrelease RosaImageWriter.pro`
   in Windows:
   `> lrelease RosaImageWriter.pro`
2. For building translations into a separate build directory, you can use the `build-translations` script, specifying the target directory as the first argument (the `lang` subdirectory will be created there); example:
   in Linux/Mac OS X:
   `$ ./lang/build-translations ../RosaImageWriter-Desktop-Release`
   in Windows:
   `> lang\build-translations ..\RosaImageWriter-Desktop-Release`

## Changelog

### Version 2.6.2.0

1. When the list of USB devices is refreshed, the previously selected device remains selected (if present).
2. Rebuilt with Qt 5.6.1.

### Version 2.6.1.1

1. Linux: Forced displaying the [X] Close button in the titlebar (in GNOME it disappeared for unknown reason).

### Version 2.6.1.0

Minor bug fixes and improvements:

1. Added German translation (thanks to Matthias Schuster Scharmer).
2. Linux: Startup elevation of privileges improved:
   - Added support for `xdg-su` and `beesu`.
   - Fixed: `kdesu` could not always be found in KDE environments.
   - If several su-applications are present, the "native" one is preferred (for example, `kdesu` in KDE).
3. Fixed: Some start-up messages could be untranslated.
4. Linux: Portable executable binaries are now linked statically with `libstdc++` (to avoid version mismatches).
5. Rebuilt with Qt 5.4.2.

### Version 2.6.0.0

Minor bug fixes and improvements:

1. Added Clear function for removing partitioning data from the selected USB device (to make its full capacity visible to operating system).
2. Path to ISO image can now be passed as a command-line argument.
3. Rebuilt with Qt 5.4.1 and, in Windows, MSVC 2013.
4. Windows: Executable binary file is now signed with NTC IT ROSA LLC certificate.
5. Default Open path is set to the current user's Downloads folder.
6. Linux: Elevation is now built-in, no need to use external script or consolehelper.
7. Linux, Mac OS X: Executable binaries are now statically linked to decrease total size (like Windows executable).
8. Various minor fixes and improvements.

### Version 2.5.0.0

Minor bug fixes and improvements:

1. Windows: USB device remained locked after writing was finished.
2. Windows: Added icon size 48x48 into resources.
3. Linux, Mac OS X: Added write flushing after every block: fixes "inconsistent progressbar" problem (when progress quickly went to 100%, and then waited for long time while real writing took place).
4. Linux: Loading libudev dynamically, which allows to use either version 0 and 1 (whichever present in the distribution) or even work without it (USB devices list will have to be refreshed manually).
5. Rebuilt with Qt 5.4.0.

### Version 2.4.0.0

Starting with this version, Mac OS X is also supported (version 10.7 and higher). More detailed list of changes:

1. Implemented all of the functions for Mac OS X:
   - writing image file to the selected USB device;
   - enumerating USB devices;
   - selecting image file by either opening it or drag&dropping the file on the main window;
   - automatic refresh of the USB devices list on inserting/removing a device;
   - displaying progress bar over the Dock application icon.
2. Added French translation.

### Version 2.3.0.0

1. Fixed: internal Qt localization was not used (the "Open" dialog title, "Yes/No" buttons, etc.)

### Version 2.2.0.0

1. Switched to SVG main icon to improve scaling in Linux.

### Version 2.1.0.0

The major improvement of this version is complete Linux support. More detailed list of changes:

1. Implemented almost all of the functions for Linux:
   - writing image file to the selected USB device;
   - enumerating USB devices;
   - selecting image file by either opening it or drag&dropping the file on the main window.
2. Added automatic refresh of the USB devices list on inserting/removing devices.
3. Minor UI changes (the dialog is narrowed, and its lower part is separated from the upper part).
4. Most platform-dependent code was isolated and/or moved to separate classes.
5. Minor fixes and improvements.

### Version 2.0.0.0

This version was rewritten from scratch using C++/Qt5 framework. Main differences from the previous version are:

1. Progress bar is now shown directly in the main dialog instead of popup dialog.
2. The progress bar state is shown on the Windows taskbar button (in Windows 7 or later).
3. Added button for refreshing the list of USB devices.
4. The list of USB devices now displays drive letters assigned to each device.
5. Added possibility to drag&drop image file on the dialog (unfortunately, blocked by UAC if file is dragged from non-elevated application).
6. Added localization support and Russian translation.
7. Some minor visual improvements, like icons on the buttons, more compact controls placement, etc.

### Version 1.1.0.0

Introduced minor UI improvements:

1. The application renamed to ROSA Image Writer.
2. Added copyright notice on the dialog ("© based on SUSE Studio Image Writer").
3. Replaced SUSE logo with ROSA.
4. Replaced the application icon with ROSA icon both in the main window title and as EXE file icon.

### Version 1.0.0.0

1. This is just a Windows-only proof-of-concept: rebuilt SUSE Studio Image Writer from sources without any modifications (using Visual C# Express).

Copyright © 2016 NTC IT ROSA LLC