SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
PiFlash
Linux Utility to flash SD cards
for Raspberry Pi computers
Presented by Ian Kluft
Silicon Valley Perl (SVPerl)
Sunnyvale, California
February 7, 2019
What is PiFlash?
●
Linux utility to write SD cards for Raspberry Pi
●
I originally wrote piflash in Dec 2016 for myself
●
Presented to SVPerl in Feb 2017
●
Part of OpenSource.com article in Mar 2017
●
Source code on GitHub
– github.com/ikluft/piflash
●
Installable as Perl module from CPAN
– metacpan.org/pod/PiFlash
●
This is an update on PiFlash
The main ideas behind PiFlash
●
For new users
– Safety: it will make
sure it’s only writing to
an SD card
– Prevents accidental
erasure of disks you
wanted to keep
●
For experts
– Automatically detects
input file format to
unpack/decompress
image from zip, tar, gz,
xz files
– More automation coming
with plugin support
What does PiFlash mean?
●
SD (“secure digital” standard) cards
are non-volatile meaning they don’t
lose their content when powered down
●
The chip technology is called “flash
memory”
●
Writing to a flash memory is shortened
to “flashing” it
●
PiFlash writes a bootable OS (usually
Linux) for a Raspberry Pi to an SD card
What is a Raspberry Pi?
●
Credit card sized single board
computer
●
Intended for education
– Inexpensive so kids can learn
programming more easily
●
Popular among do-it-yourself
project builders, or “Makers”
●
ARM processor, 64-bit ARMv8
in current Raspberry Pi 3
History of the Raspberry Pi
●
Started by UK CompSci
professor Eben Upton
●
College freshman didn’t have
experience playing with
computers
●
Needed an inexpensive
computer for kids to learn
●
Raspberry Pi released 2012
●
Low cost: US$25 without
Ethernet, $35 with net
●
Original expected demand was
10,000 units total
●
10 millionth shipped in 2016
●
Developed by non-profit
Raspberry Pi Foundation
●
Licensed to manufacturers
Popularity soars with Maker Community
●
A “Maker” is generally anyone who
builds things
●
Anyone can be a Maker – you too
●
Raspberry Pi instantly became
wildly popular with Makers as a
cheap embedded computer
●
Best when you need the power of
Linux
– It may be overkill when simpler
electronics will work
●
Hardware video acceleration made
it good for displaying video on HDMI
●
GPIO (general purpose I/O) pins
can be optionally used for
electronics interfacing
●
Networking makes RasPi devices
able to remote sense or control
●
For analog/digital electronic
projects, Arduino is popular
competing project board
Based on ARM processor
●
This is different if you’re used to
Intel x86 computers
●
ARM is a “microcontroller” aimed at
low-power devices
●
Most phones & embedded
computers use ARM today
●
Raspberry Pi originally used 32-bit
ARM6
– limited OS support mostly Debian
Linux, OpenElec
●
RasPi 2 & 3 are 64-bit ARM8
– wider OS support: more Linux
distros, FreeBSD, Win10 IoT
●
binaries must be compiled for
ARM – can’t use x86 binaries
– Debian Linux → Raspbian
– Ubuntu & Fedora: ARM spins
– FreeBSD → RaspBSD
– Windows 10 → Win10 IoT
Raspberry Pi Models
Model: RasPi 1 RasPi 1+ RasPi 2 RasPi Zero RasPi 3 RasPi
ZeroW
Raspi 3+
Introduced 2012 2014 2015 2015 2016 2017 2018
Availability discontinued current model
Processor ARM6 32bit ARM6 32bit ARM8* 64bit ARM6 32bit ARM8 64bit ARM6 32bit ARM8 64bit
CPU speed 700MHz 700MHz 900MHz 1GHz 1.2GHz 1GHz 1.4GHz
memory 256MB 512MB 1GB 512MB 1GB 1GB 1GB
USB2 ports 1 on A
2 on B
4 4 1 4 1 4
Flash boot SD MicroSDHC
* RasPi 2 before v1.2 was 64bit ARM7 CPU, upgraded to ARM8 same as RasPi 3
Downloadable System Boot Images
●
NOOBS
– “New Out of the Box System” by
Raspberry Pi Foundation
– For beginners, contains multiple OS
images that it can install for you
– Bigger image because it includes lots of
OS’s
●
Raspbian
– Debian Linux for Raspberry Pi
– Official RasPi reference system
– Works on all RasPi models
●
Ubuntu & Fedora
– Both support RasPi 2 & 3 on ARM versions
●
RaspBSD
– FreeBSD configured for RasPi 2 & 3
●
Kodi, OSMC & LibreElec
– Entertainment system distros based on Linux kernel
– Work on all RasPi models
– Beware untrusted plugins: recent malware problems
●
Microsoft Windows 10 IoT Core
– RasPi 3 only
– Not free - requires software license
Types of Projects
●
Desktop
– Conventional computer
●
RasPi 3 powerful enough for low-end
desktop replacement
– USB keyboard & mouse
●
Or TV remote for entertainment
– HDMI monitor
●
Composite video available, not common
– Network – Ethernet or WiFi
●
WiFi built in on RasPi 3
●
USB WiFi common on others
●
Headless
– No keyboard, mouse or monitor
– Software developed on desktop
– Network common but optional
– “Internet of Things” (IoT) device
– Applications:
●
Sensing/measurement/control
●
Robots
●
Drone autopilot (requires FAA registration)
●
Docker container platform
●
Security camera with facial recognition
●
Etc
How to set up a Raspberry Pi
●
Download OS from raspberrypi.org/downloads/
●
Flash SD card with boot system image
– More on that coming up
●
Connect cables, monitor & network
●
Apply power via microUSB power input
– 1A for RasPi 1, 2A for RasPi 2, 2.4A for RasPi 3
– Maybe more for your specific project needs
– Mysterious malfunctions may result from insufficient
power
●
Boot and configure whatever system it is
Docs from raspberrypi.org
Flashing an SD card for Raspberry Pi
●
Raspberry Pi needs SD card to boot
– RasPi 1 uses bigger SD card
– All others use smaller MicroSD
– RasPi 3 also has USB & network boot procedures
●
not for beginners
●
8GB SD card minimum recommended
– Cheapest SD cards are currently 16-32GB
●
Get the right boot image for your system
– If you have a RasPi 1/1+/Zero/ZeroW, there’s usually a
separate image for ARM6
●
RaspberryPi.org has SD flash tools for Windows &
Mac
– Instructions for Windows
– Instructions for MacOS
●
Linux instructions provide no tools
– Biggest point is to identify the correct
device
– You don’t want to accidentally erase
another disk on your system
– You can use PiFlash for Linux
●
In all cases…
– Flashing gigabytes of data will require at
least some minutes of wait, maybe many
– Be patient once you start
– Let it finish
Installing PiFlash
●
From CPAN
– Follow instructions for local Perl modules if needed
– “cpan PiFlash”
●
Also on GitHub
– Download or git-clone from github.com/ikluft/piflash
– “dzil install”
●
Requires Dist::Zilla to build from Git source
PiFlash usage
●
PiFlash is a command-line utility
usage: piflash [--verbose] [--resize] input-file output-device
piflash [--verbose] --SDsearch
piflash --version
PiFlash usage: --version
●
Prints the current version
$ piflash --version
0.1.0
PiFlash usage: --SDsearch
●
Search available block devices for SD cards
●
Any devices listed are the only ones PiFlash will
write to
– Avoids destroying a disk you wanted to keep!
●
Example shows USB and PCI based drivers:
$ piflash --sdsearch
SD cards found: /dev/sdb /dev/mmcblk0
PiFlash usage: writing to an SD
●
Simplest form is input file and output device
$ piflash --resize 2018-11-13-raspbian-stretch-lite.zip /dev/sdb
requested to flash 2018-11-13-raspbian-stretch-lite.zip to /dev/sdb
output device /dev/sdb will be erased
[sudo] password for user:
verify sudo access
flashing 2018-11-13-raspbian-stretch-lite.zip / 2018-11-13-raspbian-stretch-lite.img ->
/dev/sdb
…
done - it is safe to remove the SD card
PiFlash usage: --resize
●
Add –resize to command line to resize the root
filesystem to fill the entire SD card
●
Only works with boot images that have a Linux ext2/3/4
root filesystem
– Not always necessary – some OS’s will do this on first boot
– Works for Raspbian, Ubuntu, Fedora
– Doesn’t work on NOOBS, RaspBSD, Kodi, RISCOS, Windows
Internals of PiFlash
●
You don’t need to know this to use
PiFlash
– But we at SVPerl want to hear about Perl
●
Lowest-level “State” class stores all
parameters from
– Command line
– Operating system configuration
– Input file
– Output device
– It’s all the info needed for support requests
– --verbose parameter dumps the State
●
Contains a fork/exec wrapper to capture status
or output of commands it launches
– Eliminating qx() made perlcritic happy at the -4 level
●
Maintains list of command locations rather than
use $PATH – just being careful since it needs
root privs
●
“lsblk” command inspects output device so we
can tell if it’s an SD card
– Differences tested on PCI and USB SD readers
– That’s expected to cover most cases
– If a device isn’t detected, I’d like to see the verbose
output so I can add it
●
Main() is exception-catching wrapper
Modules in PiFlash package
●
PiFlash.pm – main(),
package version
●
Command.pm –
command launching
wrapper and logging
●
Hook.pm – callback
hooks
●
Inspector.pm – collects
data on system, input file
and output device
●
MediaWriter.pm – flashes
the SD card from input
file
●
State.pm – middleware
data storage layer
Features in development
●
These are chances for you to get involved if
anything sounds interesting
●
Plugin modules via Module::Pluggable
– Any module named under PiFlash::Plugin hierarchy
can be enabled from command line with –plugin
– i.e. PiFlash::Plugin::ModuleName
Features in development: Hooks
●
Callback hooks via PiFlash::Hook
●
Code including plugins can register callbacks
– At start
– After installation
– With mounted boot/root filesystem for system
customization
Possible customizations via plugins
●
These can be done before 1st boot by mounting boot and root filesystems and
running callback hooks to modify them
●
System configuration
– Kernel driver command line settings
– CPU overclocking
– Camera
– Audio/Video
– Network: wired and/or wireless
●
Security
– Change user name/password
– Set SSH key and authorized remote keys
Caveats for customization
●
Raspberry Pi runs ARM binaries
– 32 bit ARMv6 for Pi 1, 1B, Zero & Zero W
– 64 bit ARMv8 for Pi 2, 3 & 3+
●
Installation of software packages are probably not
the same as the system running PiFlash
– X86 binaries won’t work on RasPi
– Similar to all embedded systems development
Any questions?

Más contenido relacionado

La actualidad más candente

Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Neil Armstrong
 
ELC-NA 2020: War story - Using mainline linux for an Android TV bsp
ELC-NA 2020: War story - Using mainline linux for an Android TV bspELC-NA 2020: War story - Using mainline linux for an Android TV bsp
ELC-NA 2020: War story - Using mainline linux for an Android TV bspNeil Armstrong
 
ELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureNeil Armstrong
 
Using Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled WorldUsing Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled WorldFrank Hunleth
 
Using Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldUsing Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldBrian Chamberlain
 
BKK16-212: What's broken on ARM64?
BKK16-212: What's broken on ARM64?BKK16-212: What's broken on ARM64?
BKK16-212: What's broken on ARM64?Linaro
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsFrank Hunleth
 
LAS16-109: LAS16-109: The status quo and the future of 96Boards
LAS16-109: LAS16-109: The status quo and the future of 96BoardsLAS16-109: LAS16-109: The status quo and the future of 96Boards
LAS16-109: LAS16-109: The status quo and the future of 96BoardsLinaro
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using ErlangFrank Hunleth
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLeszek Godlewski
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linuxNeil Armstrong
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLinaro
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesLeszek Godlewski
 
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...DefconRussia
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linuxlinuxlab_conf
 
BKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFIBKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFILinaro
 
LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLinaro
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Ron Munitz
 

La actualidad más candente (20)

Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
Elc Europe 2020 : u-boot- porting and maintaining a bootloader for a multimed...
 
ELC-NA 2020: War story - Using mainline linux for an Android TV bsp
ELC-NA 2020: War story - Using mainline linux for an Android TV bspELC-NA 2020: War story - Using mainline linux for an Android TV bsp
ELC-NA 2020: War story - Using mainline linux for an Android TV bsp
 
ELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, future
 
Using Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled WorldUsing Erlang in an Embedded and Cross-Compiled World
Using Erlang in an Embedded and Cross-Compiled World
 
Using Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldUsing Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical world
 
BKK16-212: What's broken on ARM64?
BKK16-212: What's broken on ARM64?BKK16-212: What's broken on ARM64?
BKK16-212: What's broken on ARM64?
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBots
 
LAS16-109: LAS16-109: The status quo and the future of 96Boards
LAS16-109: LAS16-109: The status quo and the future of 96BoardsLAS16-109: LAS16-109: The status quo and the future of 96Boards
LAS16-109: LAS16-109: The status quo and the future of 96Boards
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology aside
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linux
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
LAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community UpdateLAS16-400K2: TianoCore – Open Source UEFI Community Update
LAS16-400K2: TianoCore – Open Source UEFI Community Update
 
One Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launchesOne Year of Porting - Post-mortem of two Linux/SteamOS launches
One Year of Porting - Post-mortem of two Linux/SteamOS launches
 
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
 
Raspberry Pi - Overview
Raspberry Pi - OverviewRaspberry Pi - Overview
Raspberry Pi - Overview
 
BKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFIBKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFI
 
LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoT
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
 

Similar a PiFlash: Linux utility to flash SD cards for Raspberry Pi computers

Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 
Raspberry pi Beginners Session
Raspberry pi Beginners SessionRaspberry pi Beginners Session
Raspberry pi Beginners SessionAnant Shrivastava
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry piHusainBhaldar21
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 201244CON
 
Rete di casa e raspberry pi - Home network and Raspberry Pi
Rete di casa e raspberry pi - Home network and Raspberry Pi Rete di casa e raspberry pi - Home network and Raspberry Pi
Rete di casa e raspberry pi - Home network and Raspberry Pi Daniele Albrizio
 
Introduction to Raspberry Pi
Introduction to Raspberry PiIntroduction to Raspberry Pi
Introduction to Raspberry PiIsuru Jayarathne
 
Raspberry Pi introduction
Raspberry Pi introductionRaspberry Pi introduction
Raspberry Pi introductionLotfi Messaoudi
 
Securing a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesSecuring a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesIan Kluft
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Mandeesh Singh
 
introduction to Raspberry pi
introduction to Raspberry pi introduction to Raspberry pi
introduction to Raspberry pi Mohamed Ali May
 
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-piAdafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-piMardiyah Azzahra
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Mandeesh Singh
 
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...Peter Martin
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012Philip Polstra
 
Introduction to Raspberrypi
Introduction to  RaspberrypiIntroduction to  Raspberrypi
Introduction to RaspberrypiIheb Ben Salem
 

Similar a PiFlash: Linux utility to flash SD cards for Raspberry Pi computers (20)

Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
Raspberry pi Beginners Session
Raspberry pi Beginners SessionRaspberry pi Beginners Session
Raspberry pi Beginners Session
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Polstra 44con2012
Polstra 44con2012Polstra 44con2012
Polstra 44con2012
 
Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012Hacking and Forensics on the Go - 44CON 2012
Hacking and Forensics on the Go - 44CON 2012
 
Rete di casa e raspberry pi - Home network and Raspberry Pi
Rete di casa e raspberry pi - Home network and Raspberry Pi Rete di casa e raspberry pi - Home network and Raspberry Pi
Rete di casa e raspberry pi - Home network and Raspberry Pi
 
Introduction to Raspberry Pi
Introduction to Raspberry PiIntroduction to Raspberry Pi
Introduction to Raspberry Pi
 
Raspberry Pi introduction
Raspberry Pi introductionRaspberry Pi introduction
Raspberry Pi introduction
 
Securing a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesSecuring a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devices
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014
 
introduction to Raspberry pi
introduction to Raspberry pi introduction to Raspberry pi
introduction to Raspberry pi
 
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-piAdafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
Adafruit raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi
 
IoT: LoRa and Java on the PI
IoT: LoRa and Java on the PIIoT: LoRa and Java on the PI
IoT: LoRa and Java on the PI
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
Joomla on Raspberry Pi using Nginx - Nederlandse Linux Gebruikers Group novem...
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
Bringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near YouBringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near You
 
Introduction to Raspberrypi
Introduction to  RaspberrypiIntroduction to  Raspberrypi
Introduction to Raspberrypi
 

Más de Ian Kluft

"#AprilFools Hijinks" at SVPerl April 2021 meeting
"#AprilFools Hijinks" at SVPerl April 2021 meeting"#AprilFools Hijinks" at SVPerl April 2021 meeting
"#AprilFools Hijinks" at SVPerl April 2021 meetingIan Kluft
 
Secure Coding in Perl
Secure Coding in PerlSecure Coding in Perl
Secure Coding in PerlIan Kluft
 
New Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationNew Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationIan Kluft
 
Best Practices for Recovering Rocket & Balloon Payloads
Best Practices for Recovering Rocket & Balloon PayloadsBest Practices for Recovering Rocket & Balloon Payloads
Best Practices for Recovering Rocket & Balloon PayloadsIan Kluft
 
Code Generation in Perl
Code Generation in PerlCode Generation in Perl
Code Generation in PerlIan Kluft
 
Aerospace applications of Perl
Aerospace applications of PerlAerospace applications of Perl
Aerospace applications of PerlIan Kluft
 
Command Line Arguments with Getopt::Long
Command Line Arguments with Getopt::LongCommand Line Arguments with Getopt::Long
Command Line Arguments with Getopt::LongIan Kluft
 
Geographic Computation in Perl
Geographic Computation in PerlGeographic Computation in Perl
Geographic Computation in PerlIan Kluft
 
Black Rock Desert Impact Theory
Black Rock Desert Impact TheoryBlack Rock Desert Impact Theory
Black Rock Desert Impact TheoryIan Kluft
 
Exception Handling in Perl
Exception Handling in PerlException Handling in Perl
Exception Handling in PerlIan Kluft
 
Geographic Computation in Perl
Geographic Computation in PerlGeographic Computation in Perl
Geographic Computation in PerlIan Kluft
 
Stratofox Aerospace Tracking Team presentation at Space Access 2013
Stratofox Aerospace Tracking Team presentation at Space Access 2013Stratofox Aerospace Tracking Team presentation at Space Access 2013
Stratofox Aerospace Tracking Team presentation at Space Access 2013Ian Kluft
 
Pacificon 200905
Pacificon 200905Pacificon 200905
Pacificon 200905Ian Kluft
 

Más de Ian Kluft (13)

"#AprilFools Hijinks" at SVPerl April 2021 meeting
"#AprilFools Hijinks" at SVPerl April 2021 meeting"#AprilFools Hijinks" at SVPerl April 2021 meeting
"#AprilFools Hijinks" at SVPerl April 2021 meeting
 
Secure Coding in Perl
Secure Coding in PerlSecure Coding in Perl
Secure Coding in Perl
 
New Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentationNew Perl module Container::Buildah - SVPerl presentation
New Perl module Container::Buildah - SVPerl presentation
 
Best Practices for Recovering Rocket & Balloon Payloads
Best Practices for Recovering Rocket & Balloon PayloadsBest Practices for Recovering Rocket & Balloon Payloads
Best Practices for Recovering Rocket & Balloon Payloads
 
Code Generation in Perl
Code Generation in PerlCode Generation in Perl
Code Generation in Perl
 
Aerospace applications of Perl
Aerospace applications of PerlAerospace applications of Perl
Aerospace applications of Perl
 
Command Line Arguments with Getopt::Long
Command Line Arguments with Getopt::LongCommand Line Arguments with Getopt::Long
Command Line Arguments with Getopt::Long
 
Geographic Computation in Perl
Geographic Computation in PerlGeographic Computation in Perl
Geographic Computation in Perl
 
Black Rock Desert Impact Theory
Black Rock Desert Impact TheoryBlack Rock Desert Impact Theory
Black Rock Desert Impact Theory
 
Exception Handling in Perl
Exception Handling in PerlException Handling in Perl
Exception Handling in Perl
 
Geographic Computation in Perl
Geographic Computation in PerlGeographic Computation in Perl
Geographic Computation in Perl
 
Stratofox Aerospace Tracking Team presentation at Space Access 2013
Stratofox Aerospace Tracking Team presentation at Space Access 2013Stratofox Aerospace Tracking Team presentation at Space Access 2013
Stratofox Aerospace Tracking Team presentation at Space Access 2013
 
Pacificon 200905
Pacificon 200905Pacificon 200905
Pacificon 200905
 

Último

VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...Call Girls in Nagpur High Profile
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointGetawu
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...Amil baba
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...Pooja Nehwal
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRdollysharma2066
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)kojalkojal131
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 

Último (20)

VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Kalyani Nagar (7001035870) Pune Escorts Nearby with Comp...
 
Develop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power pointDevelop Keyboard Skill.pptx er power point
Develop Keyboard Skill.pptx er power point
 
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(PARI) Alandi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
 
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Arekere ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 

PiFlash: Linux utility to flash SD cards for Raspberry Pi computers

  • 1. PiFlash Linux Utility to flash SD cards for Raspberry Pi computers Presented by Ian Kluft Silicon Valley Perl (SVPerl) Sunnyvale, California February 7, 2019
  • 2. What is PiFlash? ● Linux utility to write SD cards for Raspberry Pi ● I originally wrote piflash in Dec 2016 for myself ● Presented to SVPerl in Feb 2017 ● Part of OpenSource.com article in Mar 2017 ● Source code on GitHub – github.com/ikluft/piflash ● Installable as Perl module from CPAN – metacpan.org/pod/PiFlash ● This is an update on PiFlash
  • 3. The main ideas behind PiFlash ● For new users – Safety: it will make sure it’s only writing to an SD card – Prevents accidental erasure of disks you wanted to keep ● For experts – Automatically detects input file format to unpack/decompress image from zip, tar, gz, xz files – More automation coming with plugin support
  • 4. What does PiFlash mean? ● SD (“secure digital” standard) cards are non-volatile meaning they don’t lose their content when powered down ● The chip technology is called “flash memory” ● Writing to a flash memory is shortened to “flashing” it ● PiFlash writes a bootable OS (usually Linux) for a Raspberry Pi to an SD card
  • 5. What is a Raspberry Pi? ● Credit card sized single board computer ● Intended for education – Inexpensive so kids can learn programming more easily ● Popular among do-it-yourself project builders, or “Makers” ● ARM processor, 64-bit ARMv8 in current Raspberry Pi 3
  • 6. History of the Raspberry Pi ● Started by UK CompSci professor Eben Upton ● College freshman didn’t have experience playing with computers ● Needed an inexpensive computer for kids to learn ● Raspberry Pi released 2012 ● Low cost: US$25 without Ethernet, $35 with net ● Original expected demand was 10,000 units total ● 10 millionth shipped in 2016 ● Developed by non-profit Raspberry Pi Foundation ● Licensed to manufacturers
  • 7. Popularity soars with Maker Community ● A “Maker” is generally anyone who builds things ● Anyone can be a Maker – you too ● Raspberry Pi instantly became wildly popular with Makers as a cheap embedded computer ● Best when you need the power of Linux – It may be overkill when simpler electronics will work ● Hardware video acceleration made it good for displaying video on HDMI ● GPIO (general purpose I/O) pins can be optionally used for electronics interfacing ● Networking makes RasPi devices able to remote sense or control ● For analog/digital electronic projects, Arduino is popular competing project board
  • 8. Based on ARM processor ● This is different if you’re used to Intel x86 computers ● ARM is a “microcontroller” aimed at low-power devices ● Most phones & embedded computers use ARM today ● Raspberry Pi originally used 32-bit ARM6 – limited OS support mostly Debian Linux, OpenElec ● RasPi 2 & 3 are 64-bit ARM8 – wider OS support: more Linux distros, FreeBSD, Win10 IoT ● binaries must be compiled for ARM – can’t use x86 binaries – Debian Linux → Raspbian – Ubuntu & Fedora: ARM spins – FreeBSD → RaspBSD – Windows 10 → Win10 IoT
  • 9. Raspberry Pi Models Model: RasPi 1 RasPi 1+ RasPi 2 RasPi Zero RasPi 3 RasPi ZeroW Raspi 3+ Introduced 2012 2014 2015 2015 2016 2017 2018 Availability discontinued current model Processor ARM6 32bit ARM6 32bit ARM8* 64bit ARM6 32bit ARM8 64bit ARM6 32bit ARM8 64bit CPU speed 700MHz 700MHz 900MHz 1GHz 1.2GHz 1GHz 1.4GHz memory 256MB 512MB 1GB 512MB 1GB 1GB 1GB USB2 ports 1 on A 2 on B 4 4 1 4 1 4 Flash boot SD MicroSDHC * RasPi 2 before v1.2 was 64bit ARM7 CPU, upgraded to ARM8 same as RasPi 3
  • 10. Downloadable System Boot Images ● NOOBS – “New Out of the Box System” by Raspberry Pi Foundation – For beginners, contains multiple OS images that it can install for you – Bigger image because it includes lots of OS’s ● Raspbian – Debian Linux for Raspberry Pi – Official RasPi reference system – Works on all RasPi models ● Ubuntu & Fedora – Both support RasPi 2 & 3 on ARM versions ● RaspBSD – FreeBSD configured for RasPi 2 & 3 ● Kodi, OSMC & LibreElec – Entertainment system distros based on Linux kernel – Work on all RasPi models – Beware untrusted plugins: recent malware problems ● Microsoft Windows 10 IoT Core – RasPi 3 only – Not free - requires software license
  • 11. Types of Projects ● Desktop – Conventional computer ● RasPi 3 powerful enough for low-end desktop replacement – USB keyboard & mouse ● Or TV remote for entertainment – HDMI monitor ● Composite video available, not common – Network – Ethernet or WiFi ● WiFi built in on RasPi 3 ● USB WiFi common on others ● Headless – No keyboard, mouse or monitor – Software developed on desktop – Network common but optional – “Internet of Things” (IoT) device – Applications: ● Sensing/measurement/control ● Robots ● Drone autopilot (requires FAA registration) ● Docker container platform ● Security camera with facial recognition ● Etc
  • 12. How to set up a Raspberry Pi ● Download OS from raspberrypi.org/downloads/ ● Flash SD card with boot system image – More on that coming up ● Connect cables, monitor & network ● Apply power via microUSB power input – 1A for RasPi 1, 2A for RasPi 2, 2.4A for RasPi 3 – Maybe more for your specific project needs – Mysterious malfunctions may result from insufficient power ● Boot and configure whatever system it is Docs from raspberrypi.org
  • 13. Flashing an SD card for Raspberry Pi ● Raspberry Pi needs SD card to boot – RasPi 1 uses bigger SD card – All others use smaller MicroSD – RasPi 3 also has USB & network boot procedures ● not for beginners ● 8GB SD card minimum recommended – Cheapest SD cards are currently 16-32GB ● Get the right boot image for your system – If you have a RasPi 1/1+/Zero/ZeroW, there’s usually a separate image for ARM6 ● RaspberryPi.org has SD flash tools for Windows & Mac – Instructions for Windows – Instructions for MacOS ● Linux instructions provide no tools – Biggest point is to identify the correct device – You don’t want to accidentally erase another disk on your system – You can use PiFlash for Linux ● In all cases… – Flashing gigabytes of data will require at least some minutes of wait, maybe many – Be patient once you start – Let it finish
  • 14. Installing PiFlash ● From CPAN – Follow instructions for local Perl modules if needed – “cpan PiFlash” ● Also on GitHub – Download or git-clone from github.com/ikluft/piflash – “dzil install” ● Requires Dist::Zilla to build from Git source
  • 15. PiFlash usage ● PiFlash is a command-line utility usage: piflash [--verbose] [--resize] input-file output-device piflash [--verbose] --SDsearch piflash --version
  • 16. PiFlash usage: --version ● Prints the current version $ piflash --version 0.1.0
  • 17. PiFlash usage: --SDsearch ● Search available block devices for SD cards ● Any devices listed are the only ones PiFlash will write to – Avoids destroying a disk you wanted to keep! ● Example shows USB and PCI based drivers: $ piflash --sdsearch SD cards found: /dev/sdb /dev/mmcblk0
  • 18. PiFlash usage: writing to an SD ● Simplest form is input file and output device $ piflash --resize 2018-11-13-raspbian-stretch-lite.zip /dev/sdb requested to flash 2018-11-13-raspbian-stretch-lite.zip to /dev/sdb output device /dev/sdb will be erased [sudo] password for user: verify sudo access flashing 2018-11-13-raspbian-stretch-lite.zip / 2018-11-13-raspbian-stretch-lite.img -> /dev/sdb … done - it is safe to remove the SD card
  • 19. PiFlash usage: --resize ● Add –resize to command line to resize the root filesystem to fill the entire SD card ● Only works with boot images that have a Linux ext2/3/4 root filesystem – Not always necessary – some OS’s will do this on first boot – Works for Raspbian, Ubuntu, Fedora – Doesn’t work on NOOBS, RaspBSD, Kodi, RISCOS, Windows
  • 20. Internals of PiFlash ● You don’t need to know this to use PiFlash – But we at SVPerl want to hear about Perl ● Lowest-level “State” class stores all parameters from – Command line – Operating system configuration – Input file – Output device – It’s all the info needed for support requests – --verbose parameter dumps the State ● Contains a fork/exec wrapper to capture status or output of commands it launches – Eliminating qx() made perlcritic happy at the -4 level ● Maintains list of command locations rather than use $PATH – just being careful since it needs root privs ● “lsblk” command inspects output device so we can tell if it’s an SD card – Differences tested on PCI and USB SD readers – That’s expected to cover most cases – If a device isn’t detected, I’d like to see the verbose output so I can add it ● Main() is exception-catching wrapper
  • 21. Modules in PiFlash package ● PiFlash.pm – main(), package version ● Command.pm – command launching wrapper and logging ● Hook.pm – callback hooks ● Inspector.pm – collects data on system, input file and output device ● MediaWriter.pm – flashes the SD card from input file ● State.pm – middleware data storage layer
  • 22. Features in development ● These are chances for you to get involved if anything sounds interesting ● Plugin modules via Module::Pluggable – Any module named under PiFlash::Plugin hierarchy can be enabled from command line with –plugin – i.e. PiFlash::Plugin::ModuleName
  • 23. Features in development: Hooks ● Callback hooks via PiFlash::Hook ● Code including plugins can register callbacks – At start – After installation – With mounted boot/root filesystem for system customization
  • 24. Possible customizations via plugins ● These can be done before 1st boot by mounting boot and root filesystems and running callback hooks to modify them ● System configuration – Kernel driver command line settings – CPU overclocking – Camera – Audio/Video – Network: wired and/or wireless ● Security – Change user name/password – Set SSH key and authorized remote keys
  • 25. Caveats for customization ● Raspberry Pi runs ARM binaries – 32 bit ARMv6 for Pi 1, 1B, Zero & Zero W – 64 bit ARMv8 for Pi 2, 3 & 3+ ● Installation of software packages are probably not the same as the system running PiFlash – X86 binaries won’t work on RasPi – Similar to all embedded systems development