From: strec007 <strec007@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] pinebookpro-uboot: fixed kernel.d script
Date: Sun, 23 Oct 2022 17:16:27 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40128@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]
There is a new pull request by strec007 against master on the void-packages repository
https://github.com/strec007/void-packages _pc_pinebook-uboot_fix
https://github.com/void-linux/void-packages/pull/40128
pinebookpro-uboot: fixed kernel.d script
The original (rev. 2) does not work e. g. with encrypted root and also fails if there are certain commented out lines in /etc/fstab. This proposed version fixes both issues. If the / line in fstab does not include UUID, the device is taken directly from fstab.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, (arm64-glibc)
- This package is specifically designed for Pinebook Pro which only employs arm64.
A patch file from https://github.com/void-linux/void-packages/pull/40128.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-_pc_pinebook-uboot_fix-40128.patch --]
[-- Type: text/x-diff, Size: 2474 bytes --]
From fcc84190cc00ac71841741f0e074b1f3fba73c9e Mon Sep 17 00:00:00 2001
From: Petr Cizmar <petr@cizmar.net>
Date: Sun, 23 Oct 2022 17:07:08 +0200
Subject: [PATCH] pinebookpro-uboot: fixed kernel.d script
The original (rev. 2) does not work e. g. with encrypted root and also
fails if there are certain commented out lines in /etc/fstab. This
proposed version fixes both issues. If the / line in fstab does not
include UUID, the device is taken directly from fstab.
---
srcpkgs/pinebookpro-uboot/files/kernel.d/uboot | 11 +++++++++--
srcpkgs/pinebookpro-uboot/template | 2 +-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
index f184ced22d53..73adec540b27 100755
--- a/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
+++ b/srcpkgs/pinebookpro-uboot/files/kernel.d/uboot
@@ -1,20 +1,27 @@
#!/bin/sh
kver=${2}
-uuid=$(cat /etc/fstab | awk '$2 == "/" { print $1 }' | sed 's/^UUID=//')
+uuid=$(cat /etc/fstab | sed -r '/^\s*#/d' | awk '$2 == "/" { print $1 }' | sed 's/^UUID=//')
dev=$(blkid -U "${uuid}")
partuuid=$(blkid -o value -s PARTUUID "${dev}")
bootpart=$(df -P /boot | tail -1 | awk '{ print $6 }')
bootstrip() {
echo ${1} | sed "s,^${bootpart}/,/,"
}
+root="PARTUUID=$partuuid"
+
+[ -z "$partuuid" ] && {
+ # UUID search failed, trying fstab directly
+ root=$(cat /etc/fstab | sed -r '/^\s*#/d;s/UUID=/PARTUUID=/' | awk '$2 == "/" {print $1}')
+}
+
cat > /boot/boot.txt <<EOF
# MAC address (use spaces instead of colons)
setenv macaddr da 19 c8 7a 6d f4
part uuid \${devtype} \${devnum}:\${bootpart} uuid
-setenv bootargs console=ttyS2,1500000 console=tty1 root=PARTUUID=${partuuid} rootwait video=eDP-1:1920x1080@60 loglevel=4
+setenv bootargs console=ttyS2,1500000 console=tty1 root=${root} rootwait video=eDP-1:1920x1080@60 loglevel=4
setenv fdtfile rockchip/rk3399-pinebook-pro.dtb
if load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} $(bootstrip /boot/vmlinux-${kver}); then
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index cf716f1eb443..a754089a48c7 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -2,7 +2,7 @@
pkgname=pinebookpro-uboot
reverts="20200212_1 20200212_2"
version=2022.04
-revision=2
+revision=3
archs="aarch64*"
wrksrc="u-boot-${version}"
hostmakedepends="flex bc dtc python3 openssl-devel"
next reply other threads:[~2022-10-23 15:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 15:16 strec007 [this message]
2022-10-27 23:54 ` classabbyamp
2022-10-28 10:00 ` [PR REVIEW] " sgn
2022-10-28 10:00 ` sgn
2022-10-28 10:47 ` strec007
2022-10-28 10:52 ` strec007
2022-10-28 14:28 ` CameronNemo
2022-10-28 14:30 ` CameronNemo
2023-01-10 14:05 ` [PR REVIEW] " strec007
2023-04-11 1:51 ` github-actions
2023-04-25 1:53 ` [PR PATCH] [Closed]: " github-actions
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40128@inbox.vuxu.org \
--to=strec007@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).