Skip to content

Commit e828ab6

Browse files
committed
pkg: pine64: device-pine64-pinetab: include boot script
Move the u-boot configuration to the device meta-package, and change mmc_bootdev to devnum for compatibility with tow-boot. When booting from tow-boot mmc_bootdev points at the emmc, even if arch is installed to the sd card, devnum gets set to be the correct device though.
1 parent 9f46902 commit e828ab6

File tree

4 files changed

+81
-4
lines changed

4 files changed

+81
-4
lines changed

PKGBUILDS/pine64/device-pine64-pinetab/PKGBUILD

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
# Maintainer: Danct12 <[email protected]>
22
pkgname=device-pine64-pinetab
33
pkgver=0.2
4-
pkgrel=3
4+
pkgrel=4
55
pkgdesc="PineTab device package"
66
arch=(aarch64)
77
url="https://github.com/dreemurrs-embedded/Pine64-Arch"
88
license=('MIT')
9+
install="$pkgname.install"
10+
backup=("boot/boot.txt")
911
depends=(linux-megi
10-
uboot-pinephone
1112
rtl8723bt-firmware
1213
ov5640-firmware
14+
uboot-tools # we need this for mkscr
1315
alsa-ucm-pinetab)
16+
optdepends=('uboot-pinephone: required if not using tow-boot')
1417
source=(pinetab-suspend-hook.sh
1518
phoc.ini
1619
machine-info
1720
pulseaudio-pinetweaks.conf
18-
gsk-renderer-gl.sh)
21+
gsk-renderer-gl.sh
22+
boot.txt
23+
mkscr)
1924

2025
package() {
2126
# Current workaround for suspend
@@ -29,10 +34,15 @@ package() {
2934
install -Dm644 "$srcdir"/pulseaudio-pinetweaks.conf "$pkgdir"/etc/pulse/daemon.conf.d/pinetweaks.conf
3035

3136
install -Dm755 "$srcdir"/gsk-renderer-gl.sh -t "$pkgdir"/etc/profile.d/
37+
38+
# u-boot startup script
39+
install -Dm644 -t "${pkgdir}"/boot boot.txt mkscr
3240
}
3341

3442
md5sums=('b0912b95d7d810a0f161d9bd79fc162b'
3543
'ecd8742a921d805e6756abc522da1dba'
3644
'340993065eb26f928700733369be2d9b'
3745
'1504e684e5a2aec439e0674cdfc9d3c1'
38-
'df623da01912f5ce89c178639fc22656')
46+
'df623da01912f5ce89c178639fc22656'
47+
'69400a6dfe94221172b2a00f18b1a8bd'
48+
'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
@@ -0,0 +1,8 @@
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+
}
5+
6+
post_install() {
7+
post_upgrade
8+
}
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)