Skip to content

Commit f3a8ddf

Browse files
committed
Merge remote-tracking branch 'longsleep/master'
2 parents 09f2124 + 343e019 commit f3a8ddf

File tree

15 files changed

+174
-6
lines changed

15 files changed

+174
-6
lines changed

package/root/usr/local/sbin/pine64_health.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if [ "$(id -u)" -ne "0" ]; then
1414
exit 1
1515
fi
1616

17+
GPU_ADDR="1c40000.gpu"
18+
1719
print() {
1820
printf "%-15s: %s %s\n" "$1" "$2 $3" "$4"
1921
}
@@ -70,12 +72,41 @@ cooling_limit() {
7072
print "Cooling limit" $limit
7173
}
7274

75+
gpu_frequency() {
76+
if [ ! -e /sys/devices/$GPU_ADDR/dvfs/manual ]; then
77+
return
78+
fi
79+
local cur=$(cat /sys/devices/$GPU_ADDR/dvfs/manual|awk '{print $1}')
80+
local mhz=$(awk "BEGIN {printf \"%.2f\",$cur}")
81+
print "GPU freq" $mhz MHz
82+
}
83+
84+
gpu_temp() {
85+
if [ ! -e /sys/devices/$GPU_ADDR/dvfs/tempctrl ]; then
86+
return
87+
fi
88+
local temp=$(cat /sys/devices/$GPU_ADDR/dvfs/tempctrl|awk '{print $6}')
89+
print "GPU Temp" $temp "C"
90+
}
91+
92+
gpu_voltage() {
93+
if [ ! -e /sys/devices/$GPU_ADDR/dvfs/voltage ]; then
94+
return
95+
fi
96+
local mv=$(cat /sys/devices/$GPU_ADDR/dvfs/voltage|awk '{print $1}')
97+
local v=$(awk "BEGIN {printf \"%.2f\",$mv/1000}")
98+
print "GPU voltage" $v "V"
99+
}
100+
73101
all() {
74102
cpu_frequency
103+
gpu_frequency
75104
cpu_count
76105
scaling_govenor
77106
vcore_voltage
107+
gpu_voltage
78108
soc_temp
109+
gpu_temp
79110
pmic_temp
80111
cooling_state
81112
cooling_limit
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# <file system> <dir> <type> <options> <dump> <pass>
2+
/dev/mmcblk0p1 /boot vfat defaults 0 2
3+
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
blacklist vfe_v4l2
2+
blacklist vfe_io
3+
blacklist 8723bs_vq0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Disable secondary interface and power management.
2+
options 8723bs if2name=p2p0 rtw_power_mgnt=0
3+
options 8723cs if2name=p2p0 rtw_power_mgnt=0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto load hall driver (LID close).
2+
#hall
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Auto load the sndcodec driver (Audio jack, speakers) when not commented.
2+
#sunxi_codec
3+
#sunxi_i2s
4+
#sunxi_sndcodec
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
8723bs
2+
#8723cs
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ "$(cat /proc/device-tree/compatible)" != "pine64,pine64-plus,pinebook64" ]; then
6+
exit 0
7+
fi
8+
9+
# Enable sndcodec_module.
10+
if [ -e /etc/modules-load.d/pine64-speakers-jack.conf ]; then
11+
sed -i "\
12+
s/^#sunxi_codec$/sunxi_codec/g; \
13+
s/^#sunxi_i2s$/sunxi_i2s/g; \
14+
s/^#sunxi_sndcodec/sunxi_sndcodec/g; \
15+
" /etc/modules-load.d/pine64-speakers-jack.conf
16+
fi
17+
18+
# Enable hall module.
19+
if [ -e /etc/modules-load.d/pine64-pinebook-hall.conf ]; then
20+
sed -i "s/^#hall$/hall/g" /etc/modules-load.d/pine64-pinebook-hall.conf
21+
fi
22+
23+
# Disable 8723bs.
24+
if [ -e /etc/modules-load.d/pine64-wifi.conf ]; then
25+
# NOTE(longsleep): Disable loading of bs driver. Unfortunately the module
26+
# cannot be removed from the running Kernel without crashing. So this will
27+
# become active on next boot.
28+
sed -i "\
29+
s/^8723bs$/#8723bs/g; \
30+
s/^#8723cs$/8723cs/g; \
31+
" /etc/modules-load.d/pine64-wifi.conf
32+
fi
33+
34+
# There is no eth0 on Pinebook, grill it.
35+
if [ -e /etc/network/interfaces.d/eth0 ]; then
36+
rm -f /etc/network/interfaces.d/eth0
37+
fi
38+
39+
40+
# Keep at the end, reload configs - will load configured modules if any.
41+
/bin/systemctl restart systemd-modules-load
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
KERNEL=="disp", MODE="0770", GROUP="video"
2+
KERNEL=="cedar_dev", MODE="0770", GROUP="video"
3+
KERNEL=="ion", MODE="0770", GROUP="video"
4+
KERNEL=="mali", MODE="0770", GROUP="video"

simpleimage/make_rootfs.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
#
33
# Simple script to create a rootfs for aarch64 platforms including support
44
# for Kernel modules created by the rest of the scripting found in this
@@ -23,6 +23,8 @@ if [ -z "$MODEL" ]; then
2323
MODEL="pine64"
2424
fi
2525

26+
export LC_ALL=C
27+
2628
if [ -z "$DEST" ]; then
2729
echo "Usage: $0 <destination-folder> [<linux-tarball>] <package.deb> [distro] [<boot-folder>] [model] [variant: mate, i3 or empty]"
2830
exit 1
@@ -353,12 +355,10 @@ mkdir -p "$DEST/lib"
353355
mkdir -p "$DEST/usr"
354356

355357
# Create fstab
356-
cat <<EOF > "$DEST/etc/fstab"
357-
# <file system> <dir> <type> <options> <dump> <pass>
358-
/dev/mmcblk0p1 /boot vfat defaults 0 2
359-
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
360-
EOF
358+
cp -a ./configuration-files/fstab "$DEST/etc/fstab"
359+
chown root.root "$DEST/etc/fstab"
361360

361+
# Direct Kernel install
362362
if [ -n "$LINUX" -a "$LINUX" != "-" -a -d "$LINUX" ]; then
363363
# NOTE(longsleep): Passing Kernel as folder is deprecated. Pass a tarball!
364364

@@ -414,5 +414,6 @@ fi
414414
# Clean up
415415
rm -f "$DEST/usr/bin/qemu-aarch64-static"
416416
rm -f "$DEST/usr/sbin/policy-rc.d"
417+
rm -f "$DEST/var/lib/dbus/machine-id"
417418

418419
echo "Done - installed rootfs to $DEST"

0 commit comments

Comments
 (0)