2015-11-06 17:40:33 +01:00
|
|
|
Install Qemu and Expect
|
|
|
|
============
|
|
|
|
|
|
|
|
Install the necessary packages:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt-get install qemu qemu-user-static expect
|
|
|
|
```
|
|
|
|
|
2016-04-28 10:04:23 +02:00
|
|
|
|
2015-11-06 17:40:33 +01:00
|
|
|
Create a new image from scratch
|
|
|
|
===============================
|
|
|
|
|
2016-04-28 10:04:23 +02:00
|
|
|
* Download the most recent version of Raspbian Jessie lite:
|
|
|
|
https://downloads.raspberrypi.org/raspbian_lite_latest
|
2015-11-06 17:40:33 +01:00
|
|
|
|
|
|
|
* Unpack it:
|
|
|
|
|
|
|
|
```
|
2016-04-28 10:04:23 +02:00
|
|
|
unzip 2016-03-18-raspbian-jessie-lite.zip
|
2015-11-06 17:40:33 +01:00
|
|
|
```
|
|
|
|
|
2016-04-28 10:04:23 +02:00
|
|
|
|
2015-11-06 17:40:33 +01:00
|
|
|
Prepare the image
|
|
|
|
=================
|
|
|
|
|
|
|
|
It will be used for the build environment and the final image.
|
|
|
|
|
|
|
|
* [Add empty space to the image](resize_img.md)
|
|
|
|
|
|
|
|
* Chroot in the image
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo ./proper_chroot.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
* Change your user to root (your global variables may be broken)
|
|
|
|
|
|
|
|
```
|
|
|
|
su root
|
|
|
|
```
|
|
|
|
|
|
|
|
* The locales may be broken, fix it (remove `en_GB.UTF-8 UTF-8`, set `en_US.UTF-8 UTF-8`):
|
|
|
|
|
|
|
|
```
|
|
|
|
dpkg-reconfigure locales
|
|
|
|
```
|
|
|
|
|
|
|
|
* In the image, make sure everything is up-to-date, and remove the old packages
|
|
|
|
|
|
|
|
```
|
|
|
|
apt-get update
|
|
|
|
apt-get dist-upgrade
|
|
|
|
apt-get autoremove
|
2016-04-26 15:40:20 +02:00
|
|
|
apt-get install timidity git p7zip-full python-dev python-pip python-lxml pmount libjpeg-dev libtiff-dev libwebp-dev liblcms2-dev tcl-dev tk-dev python-tk
|
2015-11-06 17:40:33 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
* Install python requirements
|
|
|
|
|
|
|
|
```
|
2016-04-26 13:45:47 +02:00
|
|
|
pip install oletools olefile officedissector exifread Pillow
|
2015-11-06 17:40:33 +01:00
|
|
|
pip install git+https://github.com/CIRCL/PyCIRCLean.git
|
|
|
|
```
|
|
|
|
|
|
|
|
* Create the user and mtab for a RO filesystem
|
|
|
|
|
|
|
|
```
|
|
|
|
useradd -m kitten
|
|
|
|
chown -R kitten:kitten /home/kitten
|
|
|
|
ln -s /proc/mounts /etc/mtab
|
|
|
|
```
|
|
|
|
|
|
|
|
* Copy the files
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo ./copy_to_final.sh /mnt/arm_rPi/
|
|
|
|
```
|
|
|
|
|
|
|
|
* Enable rc.local
|
|
|
|
|
|
|
|
```
|
|
|
|
systemctl enable rc-local.service
|
|
|
|
```
|
|
|
|
|