Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 8b6d15d

Browse files
committed
Initial Commit
0 parents  commit 8b6d15d

File tree

3,426 files changed

+277618
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,426 files changed

+277618
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recovery/buildroot/output/
2+
recovery/buildroot/dl/

BUILDME.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
# Bash script to rebuild recovery
4+
5+
set -e
6+
7+
cd buildroot
8+
9+
# Delete buildroot build directory to force rebuild
10+
if [ -e output/build ]; then
11+
rm -rf output/build/recovery* || true
12+
fi
13+
14+
# Let buildroot build everything
15+
make
16+
17+
# Copy recovery kernel and rootfs to output dir
18+
cp output/images/zImage ../output/recovery.img
19+
cp output/images/rootfs.cpio.lzo ../output/recovery.rfs
20+
21+
# Ensure that output dir contains files necessary to boot
22+
if [ ! -e ../output/bootcode.bin ]; then
23+
cp output/images/rpi-firmware/start_cd.elf ../output/recovery.elf
24+
cp output/images/rpi-firmware/bootcode.bin ../output
25+
fi
26+
27+
# Add build-date timestamp to files$
28+
29+
rm ../output/BUILT* || true
30+
touch ../output/"BUILT-"$(date +"%m-%d-%Y")
31+
32+
cd ..
33+
34+
clear
35+
echo Build complete. Copy files in \'output\' directory onto a clean FAT formatted SD card to use.

README.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Raspberry Pi Recovery System
2+
#### (New Out Of Box Software)
3+
4+
The Raspberry Pi Recovery System is designed to make it easy to select and install operating systems for the Raspberry Pi on an SD card without requiring either network access or a more complicated SD card imaging operation.
5+
6+
### About
7+
The Recovery system works by creating a FAT partition on your SD card containing heavily compressed versions of OS images. At boot you can press SHIFT to enter the recovery app and easily reinstall the existing OS or choose to install a different one.
8+
9+
The Recovery System currently has the following functionality;
10+
- <b>Restore Image</b>: Writes the selected OS image onto the remainder of the SD card. Only one OS can be imaged at a time.
11+
- <b>Edit Config</b>: Opens a text editor allowing the cmdline and config for the installed OS to be edited.
12+
- <b>Online Help</b>: [Networking Required] Open a browser that displays the raspberrypi.org/forum, allowing people to quickly access help and troubleshooting.
13+
- <b>Exit</b>: Quits the recovery app and reboots the Pi into the installed OS.
14+
15+
### Setup
16+
17+
To setup a blank SD card with the Recovery System;
18+
- Format an SD card that is 4GB or greater in size as FAT32
19+
- Copy the files in the `/output` directory onto the SD card
20+
- Place any OS images you want to be able to install into the `/images` directory on the SD card
21+
22+
On first boot the "Recovery" FAT partition will be automatically resized to a minimum and a list of OS images that are available to install will be displayed. If there is only one OS image contained within `/images` then this will be automatically installed on first boot.
23+
24+
### How to Format an SD card as FAT
25+
26+
For <b>Windows</b> users, we recommend formatting your SD card using the SD Association's Formatting Tool, which can be downloaded from https://www.sdcard.org/downloads/formatter_4/ You will need to set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu to ensure that the entire SD card volume is formatted - not just a single partition. Please see screenshots at www.raspberrypi.org/downloads for help with this.
27+
28+
The SD Association's Formatting Tool is also available for <b>Mac</b> users although the default OSX Disk Utility is also capable of formatting the entire disk (select the SD card volume and choose "Erase" with "MS-DOS" format).
29+
30+
For <b>Linux</b> users we recommend `gparted` (or the command line version `parted`).
31+
32+
===
33+
34+
## How to Rebuild the Recovery System
35+
36+
#### Get Build Dependencies
37+
38+
On Ubuntu:
39+
40+
`sudo apt-get install build-essential rsync texinfo libncurses-dev whois`
41+
42+
#### Run Build Script
43+
44+
`./BUILDME.sh`
45+
46+
Buildroot will then build the software and all dependencies, putting the result in the "output" directory.
47+
48+
Buildroot by default compiles multiple files in parallel, depending on the number of CPU cores you have.
49+
50+
If your build machine does have a quad core CPU, but relatively little RAM, you may want
51+
to lower the number to prevent swapping.
52+
53+
`cd buildroot ; make menuconfig`
54+
55+
"Build options" -> "Number of jobs to run simultaneously"
56+
57+
## About the Buildroot infrastructure
58+
59+
To add extra packages: `cd buildroot ; make menuconfig`
60+
61+
Recovery software packaging is in: `buildroot/package/recovery`
62+
63+
Kernel configuration used: `buildroot/kernelconfig-recovery`
64+
65+
Main differences with bcmrpi_defconfig:
66+
67+
- `CONFIG_BLK_DEV_INITRD=y` - initramfs support
68+
- `CONFIG_INPUT_EVDEV=y` - evdev support built-in
69+
- `CONFIG_USB_HID=m` - usb HID driver and alternative driver build as module
70+
- `CONFIG_USB_KBD=m`
71+
- All other modules disabled.
72+
73+
## Modifying Qt source
74+
75+
Source is in the "recovery" folder.
76+
Be aware that user interface screens will appear larger in Qt Creator then when deployed on the Pi, can
77+
raise font sizes 2 points to compensate.
78+
79+
Several constants can be changed in "config.h"
80+
81+
Wrap code that calls Qt Embedded specific classes (such as QWSServer) between "#ifdef Q_WS_QWS" and "#endif"
82+
So that the project also compiles and can be tested under standard Qt.
83+
84+
## Adding/Updating Translations
85+
86+
References:
87+
88+
http://qt-project.org/doc/qt-4.8/i18n-source-translation.html
89+
90+
http://qt-project.org/doc/qt-4.8/linguist-manual.html
91+
92+
To add a new translation:
93+
94+
- Add to recovery/recovery.pro `TRANSLATIONS += translation_<languagecode>.ts`
95+
- Run `lupdate recovery.pro` which extracts strings from the source code and generates/updates the .ts files.
96+
- The .ts can then be send to the translator, opened in Qt Linguist and filled in.
97+
- Turn the .ts XML file into a binary .qm file by running `lrelease translation_code.ts`
98+
- The .qm file needs to be added to "icons.qrc". This file contains a list with resource files that will be embedded into the
99+
application's executable during build.
100+
101+
Can add a flag icon to the "icons" folder and add that flag to "icons.qrc" as well.
102+
103+
104+
### Legal compliance
105+
106+
Copyright (c) 2013, Raspberry Pi
107+
All rights reserved.
108+
109+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
110+
111+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
112+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
113+
Neither the name of the Raspberry Pi Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
114+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
115+
116+
#### Third party licenses:
117+
118+
Recovery software directly links to:
119+
120+
- Qt libraries, available under LGPL and commercial license.
121+
122+
Currently used icon sets:
123+
124+
- http://www.fatcow.com/free-icons - Creative commons Attribution license
125+
- http://www.famfamfam.com/lab/icons/flags - "These flag icons are available for free use for any purpose with no requirement for attribution."
126+
127+
Licenses of utility software build by buildroot:
128+
129+
Type `cd buildroot ; make legal-info` to generate a list, which will be available under `output/legal-info`.

0 commit comments

Comments
 (0)