* [PR PATCH] pinebookpro-uboot: fixed kernel.d script
@ 2022-10-23 15:16 strec007
2022-10-27 23:54 ` classabbyamp
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: strec007 @ 2022-10-23 15:16 UTC (permalink / raw)
To: ml
[-- 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"
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
@ 2022-10-27 23:54 ` classabbyamp
2022-10-28 10:00 ` [PR REVIEW] " sgn
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: classabbyamp @ 2022-10-27 23:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 174 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#issuecomment-1294243602
Comment:
cc maintainer @CameronNemo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
2022-10-27 23:54 ` classabbyamp
@ 2022-10-28 10:00 ` sgn
2022-10-28 10:00 ` sgn
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: sgn @ 2022-10-28 10:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]
New review comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1007883370
Comment:
And this is another single `awk`, too
```sh
awk '$1 ~ /^PARTUUID=/ && $2 == "/" { print $1 }' /etc/fstab
```
Anyway, I think partuuid should be searched first, and uuid as a fallback because it won't invoke blkid or anything
---
Hm, no.
You still keep `UUID=` in `/etc/fstab` but assuming it's `PARTUUID=`, that's wrong.
You should use uuid with `UUID=` and partuuid with `PARTUUID=`, don't mix them.
And this doesn't work for `/dev/sd??` or something like that.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
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
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: sgn @ 2022-10-28 10:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
New review comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1007879223
Comment:
> -E, -r, --regexp-extended
>
> use extended regular expressions in the script (for portability
> use POSIX -E).
But the whole line can be rewrite to a single awk
```sh
awk '$1 ~ /^UUID=/ && $2 == "/" { sub(/^UUID=/, "", $1); print $1 }' /etc/fstab
# or
awk '$1 ~ /^UUID=/ && $2 == "/" { $1=substr($1, 6); print $1 }' /etc/fstab
```
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (2 preceding siblings ...)
2022-10-28 10:00 ` sgn
@ 2022-10-28 10:47 ` strec007
2022-10-28 10:52 ` strec007
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: strec007 @ 2022-10-28 10:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 213 bytes --]
New review comment by strec007 on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1007928431
Comment:
Single awk is fine with me provided that it works. I'll test it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (3 preceding siblings ...)
2022-10-28 10:47 ` strec007
@ 2022-10-28 10:52 ` strec007
2022-10-28 14:28 ` CameronNemo
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: strec007 @ 2022-10-28 10:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
New review comment by strec007 on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1007931866
Comment:
I personally don't care about `UUID=` or `PARTUUID=` and I'm using neither of them in my `/etc/fstab`. My intention is to make this script work the same as the original which apparently only supports `UUID=` in the fstab plus also support fstab with no `*UUID=`. Personally, I'm using encrypted root as `/dev/mapper/croot`.
Therefore, if you think, we only should support `PARTUUID=` because `UUID=` is wrong, I don't object.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (4 preceding siblings ...)
2022-10-28 10:52 ` strec007
@ 2022-10-28 14:28 ` CameronNemo
2022-10-28 14:30 ` CameronNemo
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: CameronNemo @ 2022-10-28 14:28 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
New review comment by CameronNemo on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1008129876
Comment:
What "original" are you referring to?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (5 preceding siblings ...)
2022-10-28 14:28 ` CameronNemo
@ 2022-10-28 14:30 ` CameronNemo
2023-01-10 14:05 ` [PR REVIEW] " strec007
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: CameronNemo @ 2022-10-28 14:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
New comment by CameronNemo on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#issuecomment-1295073386
Comment:
Ok so I am the maintainer, but:
1. I did not write this script
2. I do not like or use this script (I use u-boot-menu)
3. I would encourage anyone to also use u-boot-menu if it fills their needs (and I do not see why it would not in this case)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR REVIEW] pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (6 preceding siblings ...)
2022-10-28 14:30 ` CameronNemo
@ 2023-01-10 14:05 ` strec007
2023-04-11 1:51 ` github-actions
2023-04-25 1:53 ` [PR PATCH] [Closed]: " github-actions
9 siblings, 0 replies; 11+ messages in thread
From: strec007 @ 2023-01-10 14:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
New review comment by strec007 on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#discussion_r1065824634
Comment:
I'm referring to the current version of this package (version 2022.04, revision 2). Sorry if I didn't express myself clearly enough.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (7 preceding siblings ...)
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
9 siblings, 0 replies; 11+ messages in thread
From: github-actions @ 2023-04-11 1:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
New comment by github-actions[bot] on void-packages repository
https://github.com/void-linux/void-packages/pull/40128#issuecomment-1502574630
Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PR PATCH] [Closed]: pinebookpro-uboot: fixed kernel.d script
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
` (8 preceding siblings ...)
2023-04-11 1:51 ` github-actions
@ 2023-04-25 1:53 ` github-actions
9 siblings, 0 replies; 11+ messages in thread
From: github-actions @ 2023-04-25 1:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
There's a closed pull request on the void-packages repository
pinebookpro-uboot: fixed kernel.d script
https://github.com/void-linux/void-packages/pull/40128
Description:
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-04-25 1:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23 15:16 [PR PATCH] pinebookpro-uboot: fixed kernel.d script strec007
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
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).