slitaz-arm view rpi/cgi-adm/plugins/rpi_config/rpi_config.cgi @ rev 114

Fix rpi-blacklist.conf in CGI plugin
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 19 23:19:55 2014 +0200 (2014-04-19)
parents fd283c8054a5
children c10b9b20b9a5
line source
1 #!/bin/sh
2 #
3 # TazBerry CGI Plugin - Raspberry Pi configuration
4 #
6 case " $(GET) " in
8 *\ leds\ *)
9 trigger="/sys/class/leds/led0/trigger"
10 brightness="/sys/class/leds/led0/brightness"
11 html_header "Leds"
12 case " $(GET leds) " in
13 *\ act_test\ *)
14 (echo "1" > ${brightness}
15 sleep 3; echo "0" > ${brightness}) & ;;
16 *\ act_on\ *)
17 echo "1" > ${brightness} ;;
18 *\ act_off\ *)
19 echo "0" > ${brightness} ;;
20 esac
21 cat << EOT
22 <h1>Leds</h1>
23 <pre>
24 Trigger : $(cat $trigger)
25 Brightness : $(cat $brightness)
26 </pre>
27 <div class="button">
28 <a href="$script?leds=act_on">ACT Test</a>
29 <a href="$script?leds=act_on">ACT On</a>
30 <a href="$script?leds=act_off">ACT Off</a>
31 </div>
32 EOT
33 html_footer && exit 0 ;;
35 *\ rdate\ *)
36 html_header "System time"
37 echo "<h1>System time</h1>"
38 echo "<pre>"
39 echo -n "Old date: "; date
40 rdate -s tick.greyware.com
41 echo -n "New date: "; date
42 echo "</pre>"
43 html_footer && exit 0 ;;
45 *\ oclock\ *)
46 html_header "Overclocking"
47 cat << EOT
48 <h1>RPi Overclocking</h1>
50 <pre>
51 $(/home/pankso/Projects/slitaz-arm/rpi/tazberry rpi_oclock)
52 </pre>
54 <h2>Current settings:</h2>
55 <pre>
56 $(fgrep _freq /boot/config.txt)
57 $(fgrep over_voltage /boot/config.txt)
58 </pre>
59 <div class="button">
60 <a href='$script?editor&amp;file=/boot/config.txt'>Edit boot configuration</a>
61 <div>
62 EOT
63 html_footer && exit 0 ;;
65 *\ rpi_config\ *)
66 blacklist="/etc/modprobe.d/rpi-blacklist.conf"
67 html_header "Raspberry Pi"
68 cat << EOT
69 <h1>SliTaz Raspberry Pi</h1>
71 <p>
72 Remotely configure your SliTaz Raspberry Pi device.
73 </p>
75 <div id="actions">
76 <form method="get" action="$script">
77 <input type="submit" name="rdate" value="Set system time" />
78 <input type="submit" name="oclock" value="Overclocking" />
79 <input type="submit" name="leds" value="Leds" />
80 </form>
81 </div>
83 <h2>Kernel boot parameters</h2>
84 <p>
85 This file provides the Linux Kernel boot time parameters and SliTaz
86 boot time options.
87 </p>
88 <pre>
89 $(cat /boot/cmdline.txt 2>/dev/null)
90 </pre>
91 <div class="button">
92 <a href="$script?editor&amp;file=/boot/cmdline.txt">Edit cmdline.txt</a>
93 </div>
95 <h2>Boot configuration file</h2>
96 <p>
97 The Raspberry Pi boot time configuration file
98 </p>
99 <pre>
100 $(cat /boot/config.txt 2>/dev/null)
101 </pre>
102 <div class="button">
103 <a href="$script?editor&amp;file=/boot/config.txt">Edit config.txt</a>
104 </div>
106 <h2>Blacklisted Kernel modules</h2>
107 <p>
108 List of the Linux Kernel modules that should not be loaded on boot
109 time to save resources and speed up your Raspberry Pi.
110 </p>
111 <pre>
112 $(cat $blacklist 2>/dev/null)
113 </pre>
114 <div class="button">
115 <a href="$script?editor&amp;file=$blacklist">Edit $(basename $blacklist)</a>
116 </div>
117 EOT
119 html_footer && exit 0 ;;
120 esac