USB Flash Drive Writer Student: David Labský Supervisor: Ing
Total Page:16
File Type:pdf, Size:1020Kb
CZECH TECHNICAL UNIVERSITY IN PRAGUE FACULTY OF INFORMATION TECHNOLOGY ASSIGNMENT OF BACHELOR’S THESIS Title: USB Flash Drive Writer Student: David Labský Supervisor: Ing. Miroslav Hrončok Study Programme: Informatics Study Branch: Computer engineering Department: Department of Digital Design Validity: Until the end of summer semester 2017/18 Instructions Design and implement an open source hardware box for writing a provided bootable disk image of a Linux distribution such as Fedora to USB flash drives. The box should have a button to start the write operation and an indicator of the progress. • Study existing implementations. • Consider and compare different types of hardware for use in the project. • Write full instructions for construction of the box from scratch. • Construct a functional physical prototype. When making decisions, consider the following criteria for use in the Fedora Project: • Ease of build: Even users without significant previous knowledge about used hardware should be able to build the device. • Price and availability of the components on various continents. • Extensibility. References Will be provided by the supervisor. L.S. doc. Ing. Hana Kubátová, CSc. prof. Ing. Pavel Tvrdík, CSc. Head of Department Dean Prague February 13, 2017 Czech Technical University in Prague Faculty of Information Technology Department of Digital Design Bachelor’s thesis USB Flash Drive Writer David Labský Supervisor: Ing. Miroslav Hrončok 16th of May, 2017 Acknowledgements A sincere thank you to my supervisor Miroslav Hrončok for his ideas, advice, and continued mentoring. Thank you to Petr Viktorin for his ethusiasm and pieces of hardware. Sorry I didn’t reach out more! Many thanks to Marek Žehra for incredibly professional photos on short notice. Thank you, Sentri, for proofreeding as well as keeping me virtual company during the final stretch. Thanks to Jiří Šebele for lending a hand, somehowwe form a good team. A thank you goes to my parents, even if they are unable to read the work proper. Thank you to the communities surrounding open hardware for their worth- while endeavor and always being willing to help. Lastly, I would like to extend my thanks to birds. Declaration I hereby declare that the presented thesis is my own work and that I have cited all sources of information in accordance with the Guideline for adhering to ethical principles when elaborating an academic final thesis. I acknowledge that my thesis is subject to the rights and obligations stipulated by the Act No. 121/2000 Coll., the Copyright Act, as amended. In accordance with Article 46(6) of the Act, I hereby grant a nonexclusive authorization (license) to utilize this thesis, including any and all computer programs incorporated therein or attached thereto and all corresponding documentation (hereinafter collectively referred to as the “Work”), to any and all persons that wish to utilize the Work. Such persons are entitled to use the Work in any way (including for-profit purposes) that does not detract from its value. This authorization is not limited in terms of time, location and quantity. In Prague on 16th of May, 2017 ………………… Czech Technical University in Prague Faculty of Information Technology © 2017 David Labský. All rights reserved. This thesis is a school work as defined by Copyright Act of the Czech Republic. It has been submitted at Czech Technical University in Prague, Faculty of Information Technology. The thesis is protected by the Copyright Act and its usage without author’s permission is prohibited (with exceptions defined by the Copyright Act). Citation of this thesis LABSKÝ, David. USB Flash Drive Writer. Bachelor’s thesis. Czech Technical University in Prague, Faculty of Information Technology, 2017. Available also from WWW: hhttps://github:com/Sanqui/fedorator-thesisi. Abstrakt V této práci je od myšlenky k prototypu dovedeno zařízení zvané Fedorator, které slouží k zápisu operačního systému Fedora na USB flash disky. Je zde proveden detailní rozbor hardwaru včetně přehledu USB protokolu. Klíčová slova USB flash disk, USB duplikační zařízení, Fedora, Raspberry Pi, open hardware Abstract In this thesis, a device called Fedorator, capable of writing the Fedora operating system to USB flash drives, is brought from thought to a prototype. Detailed analysis over the hardware is performed, including an overview of the USB protocol. Keywords USB flash drive, USB duplicator, Fedora, Raspberry Pi, open hardware Contents Introduction 21 1 Research and Analysis 23 1.1 How Fedora Spreads Publicity ................... 23 1.2 Existing solutions .......................... 24 1.2.1 Preloaded USB flash drives . 24 1.2.2 USB Duplicators ....................... 25 1.2.3 Existing software ...................... 27 1.2.4 Dedicated Open Source Hardware . 28 1.3 Rationale for a New Solution .................... 28 2 Specification and Goals 31 2.1 Function ............................... 31 2.1.1 User ............................. 32 2.1.2 Operator ........................... 32 2.2 Looks ................................. 32 2.3 Interface ............................... 33 2.4 Conclusion .............................. 35 3 Analysis of Possible Solutions 37 3.1 Hardware Options .......................... 38 3.1.1 Raspberry Pi ......................... 38 3.1.2 Arduino ........................... 40 13 3.1.3 ESP8266 ........................... 41 3.1.4 Teensy ............................ 42 3.1.5 FPGA ............................. 43 3.2 Display Options ........................... 44 3.2.1 Character-based LCDs ................... 44 3.2.2 OLED ............................. 44 3.2.3 TFT .............................. 45 3.3 Other Component Options ..................... 45 3.4 Casing Options ............................ 45 3.4.1 Wood ............................. 45 3.4.2 Plastic with Mold ...................... 46 3.4.3 3D Printed .......................... 46 3.5 Roundup ............................... 47 3.6 Concepts ............................... 48 3.6.1 Concept A .......................... 49 3.6.2 Concept B .......................... 50 3.6.3 Concept C .......................... 51 3.7 Decision ............................... 52 4 Raspberry Pi-based Solution 53 4.1 Specification ............................. 53 4.2 Software ............................... 53 4.2.1 Behavior ........................... 54 4.3 Technical Implementation ...................... 57 4.4 Case .................................. 57 4.5 Construction of a Prototype .................... 59 4.6 Instructions .............................. 61 4.7 Speed Measurements ........................ 61 4.8 Conclusion .............................. 65 5 Interlude: USB Mass Storage 67 5.1 Introduction to USB ......................... 67 5.2 USB Specification .......................... 68 5.2.1 USB Host ........................... 68 5.2.2 USB Device ......................... 69 5.2.3 USB Hardware ........................ 69 14 5.2.4 USB Protocol ........................ 69 5.3 USB Mass Storage Device Class ................... 70 6 Microcontroller-based solution 71 Conclusion 73 Future Work ................................ 74 Bibliography 75 A List of Acronyms 85 B Supplemental Material 87 15 List of Tables 1.1 Examples of USB duplicators available on the market . 25 4.1 Fedorator speed measurements ..................... 64 17 List of Figures 1.1 Fedora logo and wordmark [33] .................... 23 1.2 VINPOWER Black 1 to 11 USBShark [60] . 26 1.3 Altarec USB Copy Cruiser Mini Duplicator [7] . 26 1.4 Fedora Media Writer running on Linux [21] . 27 2.1 Solid Machined Metal Knob offered by Adafruit [2] . 34 3.1 Raspberry Pi 3 Model B [65] ...................... 38 3.2 Arduino Uno R3 [79] .......................... 41 3.3 Arduino Nano [56] ........................... 42 3.4 Teensy 3.6 [80] ............................. 43 3.5 Common OLED display available on Adafruit [1] . 44 3.6 LulzBot Mini 3D printer [4] ...................... 46 3.7 Concept A ................................ 49 3.8 Concept B ................................ 50 3.9 Concept C ................................ 51 4.1 Fedorator: the standby screen ..................... 54 4.2 Fedorator: picking a release from the list . 55 4.3 Fedorator: taking a look at the Fedora Workstation release . 56 4.4 Fedorator: Fedora LXDE Destkop was sucessfully written to the flash drive ................................ 56 4.5 A screenshot of the OpenSCAD software with the case open. Both the source code and the rendered model can be seen . 58 19 List of Figures 4.6 A render of the constructed case, courtesy of OpenSCAD . 59 4.7 A test print with a Raspberry Pi seated inside . 60 4.8 The case print complete with supports . 61 4.9 The Fedorator prototype with two USB flash drives plugged in . 62 4.10 The Fedorator prototype done flashing the Fedora Workstation system .................................. 63 4.11 The various flash drives tested ..................... 64 6.1 Teensy detecting a USB mass storage device . 72 20 Introduction In today’s world, there are many free and open source operating systems based on the Linux kernel, called Linux distributions [90]. Despite Linux’s relatively small market share (between 2.4% and 4.6%, to date [91]), it is being used by millions of people daily and has significant traction among developers [81] and technically minded people in general. The companies and communities behind Linux distributions are, of course, trying to raise the usage of their respetive operating systems. One way to achieve that is through