Skip to content

Commit dbd0c3e

Browse files
committed
pkg: pine64: device-pine64-pinephone: make u-boot optional
This moves the u-boot configuration to the device meta-package so that uboot-pinephone can be uninstalled for use with tow-boot.
1 parent 35b2a52 commit dbd0c3e

File tree

4 files changed

+79
-8
lines changed

4 files changed

+79
-8
lines changed

PKGBUILDS/pine64/device-pine64-pinephone/PKGBUILD

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# Maintainer: Danct12 <[email protected]>
22
pkgname=device-pine64-pinephone
33
pkgver=0.2
4-
pkgrel=4
4+
pkgrel=5
55
pkgdesc="PinePhone device package"
66
arch=(aarch64)
77
url="https://github.com/dreemurrs-embedded/Pine64-Arch"
88
license=('MIT')
9-
depends=(danctnix-tweaks alsa-ucm-pinephone linux-megi uboot-pinephone rtl8723bt-firmware anx7688-firmware
10-
ov5640-firmware eg25-manager)
9+
depends=(danctnix-tweaks alsa-ucm-pinephone linux-megi rtl8723bt-firmware anx7688-firmware
10+
ov5640-firmware eg25-manager uboot-tools)
11+
optdepends=('uboot-pinephone: requierd if not using tow-boot')
1112
install="$pkgname.install"
13+
backup=("boot/boot.txt")
1214
source=(10-proximity.rules
1315
10-pinephone-brightness.rules
1416
pinephone-suspend-hook.sh
1517
machine-info
16-
pulseaudio-pinetweaks.conf)
18+
pulseaudio-pinetweaks.conf
19+
boot.txt
20+
mkscr)
1721

1822
package() {
1923
# Kanged from Mobian, this is to make iio-sensor-proxy works with proximity sensor.
@@ -28,10 +32,15 @@ package() {
2832
install -Dm644 "$srcdir"/machine-info "$pkgdir"/etc/machine-info
2933

3034
install -Dm644 "$srcdir"/pulseaudio-pinetweaks.conf "$pkgdir"/etc/pulse/daemon.conf.d/pinetweaks.conf
35+
36+
# u-boot startup script
37+
install -Dm644 -t "${pkgdir}"/boot boot.txt mkscr
3138
}
3239

3340
md5sums=('b72ff096c022588f72c226283ac328bd'
3441
'3a478fece4381cf41fb795009bfe8cc3'
3542
'b0912b95d7d810a0f161d9bd79fc162b'
3643
'b53781dde1d7a9a44e5076f3be463570'
37-
'1504e684e5a2aec439e0674cdfc9d3c1')
44+
'1504e684e5a2aec439e0674cdfc9d3c1'
45+
'69400a6dfe94221172b2a00f18b1a8bd'
46+
'021623a04afd29ac3f368977140cfbfd')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
gpio set 98 # Enable vibrator
2+
3+
if test ${devnum} -eq 0; then
4+
echo "Booting from SD"
5+
setenv linux_mmcdev 0
6+
else
7+
echo "Booting from eMMC"
8+
setenv linux_mmcdev 2
9+
fi
10+
11+
# If we have at least 2 partitions, then the 1st one is /boot, and / is #2
12+
if part size mmc ${devnum} 2 none; then
13+
setenv rootpart 2
14+
else
15+
setenv rootpart 1
16+
setenv bootdir "/boot"
17+
fi
18+
19+
setenv bootargs loglevel=4 console=${console} console=tty0 root=/dev/mmcblk${linux_mmcdev}p${rootpart} rw rootwait quiet bootsplash.bootfile=bootsplash-themes/danctnix/bootsplash
20+
21+
echo "Loading kernel..."
22+
load mmc ${devnum}:1 ${ramdisk_addr_r} ${bootdir}/Image.gz
23+
24+
echo "Uncompressing kernel..."
25+
unzip ${ramdisk_addr_r} ${kernel_addr_r}
26+
27+
echo "Loading initramfs..."
28+
load mmc ${devnum}:1 ${ramdisk_addr_r} ${bootdir}/initramfs-linux.img
29+
setenv ramdisk_size ${filesize}
30+
31+
echo "Loading dtb..."
32+
load mmc ${devnum}:1 ${fdt_addr_r} ${bootdir}/dtbs/${fdtfile}
33+
34+
echo Resizing FDT
35+
fdt addr ${fdt_addr_r}
36+
fdt resize
37+
38+
echo Adding FTD RAM clock
39+
fdt mknode / memory
40+
fdt set /memory ram_freq ${ram_freq}
41+
fdt list /memory
42+
43+
echo Loading user script
44+
setenv user_scriptaddr 0x61dbc200
45+
load mmc ${devnum}:1 ${user_scriptaddr} ${bootdir}/user.scr
46+
if test $? -eq 0; then source ${user_scriptaddr}; else echo No user script found; fi
47+
48+
echo "Booting..."
49+
gpio clear 98 # Disable vibrator
50+
booti ${kernel_addr_r} ${ramdisk_addr_r}:0x${ramdisk_size} ${fdt_addr_r}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
post_install() {
1+
post_upgrade() {
2+
echo "Generating U-Boot script"
3+
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d /boot/boot.txt /boot/boot.scr
4+
25
systemctl enable eg25-manager
36
}
47

5-
post_upgrade() {
6-
systemctl enable eg25-manager
8+
post_install() {
9+
post_upgrade
710
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if [[ ! -x /usr/bin/mkimage ]]; then
4+
echo "mkimage not found. Please install uboot-tools:"
5+
echo " pacman -S uboot-tools"
6+
exit 1
7+
fi
8+
9+
mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

0 commit comments

Comments
 (0)