File tree 4 files changed +102
-0
lines changed
chromeos-base/edit-pi-config
4 files changed +102
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2020 The Fyde Innovations. All rights reserved.
2
+ # Distributed under the license specified in the root directory of this project.
3
+
4
+ EAPI=" 5"
5
+
6
+ DESCRIPTION=" A simple script to edit config.txt in efi partition"
7
+ HOMEPAGE=" https://fydeos.com"
8
+
9
+ LICENSE=" BSD-Google"
10
+ SLOT=" 0"
11
+ KEYWORDS=" *"
12
+ IUSE=" "
13
+
14
+ RDEPEND=" "
15
+
16
+ DEPEND=" ${RDEPEND} "
17
+ S=${WORKDIR}
18
+
19
+ src_install () {
20
+ exeinto /usr/share/edit-pi-config
21
+ doexe ${FILESDIR} /edit-pi-config
22
+ dosym /usr/share/edit-pi-config/edit-pi-config /usr/sbin/edit-pi-config
23
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -o errexit
4
+
5
+ EDITOR=" /usr/local/bin/nano"
6
+ EDITOR_ALT=" /bin/nano"
7
+ CONFIG_FILE=" config.txt"
8
+ EFI_TYPE=" c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
9
+
10
+ PARTITION=" "
11
+ TARGET_PATH=" "
12
+
13
+ error () {
14
+ echo " error: $* " >&2
15
+ }
16
+
17
+ die () {
18
+ error " $* "
19
+ exit 1
20
+ }
21
+
22
+ check_user () {
23
+ if [[ $EUID -ne 0 ]]; then
24
+ die " Please run this script as root or prepend sudo, abort."
25
+ fi
26
+ }
27
+
28
+ check_editor () {
29
+ if [[ ! -x $EDITOR ]]; then
30
+ EDITOR=" $EDITOR_ALT "
31
+ fi
32
+ if [[ ! -x $EDITOR ]]; then
33
+ die " editor nano not found, abort."
34
+ fi
35
+ }
36
+
37
+ find_root_dev () {
38
+ local dev=" "
39
+ dev=$( rootdev -d)
40
+ if [[ " $dev " = " /dev/" * ]]; then
41
+ dev=" ${dev: 5} "
42
+ fi
43
+ echo " $dev "
44
+ }
45
+
46
+ find_efi_part () {
47
+ local ROOT_DEV=" "
48
+ local PARTITION_NAME=" "
49
+ ROOT_DEV=$( find_root_dev)
50
+ if [[ -z $ROOT_DEV ]]; then
51
+ die " rootdev not found, abort."
52
+ fi
53
+ PARTITION_NAME=$( lsblk -l -o NAME,PARTTYPE | grep " $EFI_TYPE " | awk ' $1 ~ /' " $ROOT_DEV " ' .*/ {print $1}' )
54
+ if [[ -z $PARTITION_NAME ]]; then
55
+ die " no EFI partition found, abort."
56
+ fi
57
+
58
+ PARTITION=" /dev/$PARTITION_NAME "
59
+ TARGET_PATH=" /tmp/$PARTITION_NAME "
60
+ }
61
+
62
+ main () {
63
+ check_editor
64
+ check_user
65
+
66
+ find_efi_part
67
+
68
+ mkdir -p " $TARGET_PATH "
69
+ umount " $PARTITION " || true
70
+ mount " $PARTITION " " $TARGET_PATH " || die " mount failed"
71
+
72
+ $EDITOR " ${TARGET_PATH} /${CONFIG_FILE} "
73
+
74
+ umount " $TARGET_PATH "
75
+ }
76
+
77
+ main
Original file line number Diff line number Diff line change
1
+ fyde-packages-0.0.1.ebuild
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ RDEPEND="
18
18
widevine? ( chromeos-base/libwidevine )
19
19
kiosk_demo? ( chromeos-base/fyde-kiosk-demo )
20
20
fyde_extension? ( chromeos-base/fyde-shell-daemon-bin )
21
+ chromeos-base/edit-pi-config
21
22
"
22
23
23
24
DEPEND=" ${RDEPEND} "
You can’t perform that action at this time.
0 commit comments