forked from samtap/fang-hacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,46 @@ | ||
# fang-hacks | ||
# Fang Hacks | ||
|
||
Collection of modifications for the XiaoFang WiFi Camera | ||
|
||
## General usage | ||
|
||
### 1. Prepare an sd-card with two partitions. | ||
The first partition on the device must be a vfat partition. It will only contain some small scripts so 100MiB should be more than enough. | ||
The second partition must be an ext2 partition and will contain all other files. | ||
|
||
### 2. Copy bootstrap folder and snx_autorun.sh | ||
The bootstrap folder contains CGI scripts for the embedded Boa webserver. The ```snx_autorun.sh``` script is the entry-point for enabling the hacks. | ||
|
||
Both must be copied to the vfat partition. | ||
|
||
### 3. Copy hacks folder | ||
The hacks folder must be copied to the ext2 partition. | ||
|
||
### 4. Place sd-card in device | ||
The device will automatically run ```snx_autorun.sh``` when the sd-card is inserted. | ||
|
||
### 5. Enable hacks | ||
When you visit ```http://device-ip/cgi-bin/status``` you should now be presented with a status page. If you get a '404 Not Found' page, the ```snx_autorun.sh``` script didn't run. | ||
|
||
Please make sure to insert the sd-card after the device has finished booting. Sometimes the script isn't executed when the sd-card is already present during boot. | ||
|
||
Click 'Apply' to enable the hacks. | ||
|
||
## Background | ||
The modifications aim to be as least intrusive as possible. Currently there's no recovery method when the device doesn't boot, so only a minimum of system files are modified. This means you can always revert to original behavior by simply removing the sd-card. | ||
|
||
Two system modifications are made when you click Apply on the status page: | ||
|
||
- A modified sdcard hotplug script is placed on the device to automatically mount ext2 volumes. | ||
- A modified rc.local script is placed on the device to enable hacks when the device is rebooted. It also disables copying original files from /root/etc_default to prevent overwriting changes to the hotplug script. | ||
|
||
Both are based on the original files and don't affect the original behaviour in any way. | ||
|
||
## Hacks | ||
When the status page shows the hacks have been applied successfully, the following features are available: | ||
- You can place any binaries, scripts etc. you need on the ext2 partition. The device only has limited space available on internal flash so you don't risk running out of space. | ||
- A busybox build is provided with many applets available such as telnetd, ftpd, netcat. | ||
- Scripts placed in hacks/etc/scripts will be automatically executed after the device boots. | ||
|
||
Scripts can be enabled and disabled by visiting ```http://device-ip/cgi-bin/scripts``` | ||
|