Skip to content

Commit 4878b84

Browse files
committed
Merge remote-tracking branch 'osresearch/master' into loftlifter31_galp5
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2 parents 9638cdb + c0762aa commit 4878b84

File tree

5 files changed

+78
-8
lines changed

5 files changed

+78
-8
lines changed

bin/seed_package_mirror.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#! /usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
usage() {
6+
cat >&2 <<USAGE_END
7+
$0 <mirror-directory>
8+
9+
Downloads all current package artifacts needed to build Heads and copies them
10+
to a mirror directory, for seeding a package mirror.
11+
12+
Parameters:
13+
<mirror-directory>: Path to a directory where the packages are placed.
14+
Created if it does not already exist.
15+
USAGE_END
16+
}
17+
18+
ARGS_DONE=
19+
while [[ $# -ge 1 ]] && [ -z "$ARGS_DONE" ]; do
20+
case "$1" in
21+
--)
22+
ARGS_DONE=y
23+
shift
24+
;;
25+
--help)
26+
usage
27+
exit 0
28+
;;
29+
--*)
30+
echo "unknown parameter: $1" >&2
31+
usage
32+
exit 1
33+
;;
34+
*)
35+
ARGS_DONE=y
36+
;;
37+
esac
38+
done
39+
40+
if [[ $# -ne 1 ]]; then
41+
usage
42+
exit 1
43+
fi
44+
45+
ARG_MIRROR_DIR="$(realpath "$1")"
46+
47+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
48+
49+
echo
50+
echo "Cleaning build to download all packages..."
51+
# fetch packages for representative boards
52+
rm -rf build/x86 build/ppc64
53+
rm -rf packages/x86 packages/ppc64
54+
echo
55+
echo "Downloading packages..."
56+
make packages BOARD=qemu-coreboot-fbwhiptail-tpm1-hotp
57+
make packages BOARD=talos-2 # newt, PPC
58+
make packages BOARD=librem_l1um_v2 # TPM2
59+
make packages BOARD=librem_l1um # coreboot 4.11
60+
make packages BOARD=x230-maximized # io386
61+
echo
62+
echo "Copying to mirror directory..."
63+
mkdir -p "$ARG_MIRROR_DIR"
64+
cp packages/x86/* packages/ppc64/* "$ARG_MIRROR_DIR/"

initrd/bin/gui-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ check_gpg_key()
363363
option=$(cat /tmp/whiptail)
364364
case "$option" in
365365
g )
366-
gpg-gui.sh && BG_COLOR_MAIN_MENU="normnal"
366+
gpg-gui.sh && BG_COLOR_MAIN_MENU="normal"
367367
;;
368368
i )
369369
skip_to_menu="true"

initrd/bin/oem-factory-reset

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ die() {
6262
exit 1
6363
}
6464

65-
whiptail_error() {
65+
local_whiptail_error() {
6666
local msg=$1
6767
if [ "$msg" = "" ]; then
6868
die "whiptail error: An error msg is required"
@@ -71,7 +71,7 @@ whiptail_error() {
7171
}
7272

7373
whiptail_error_die() {
74-
whiptail_error "$@"
74+
local_whiptail_error "$@"
7575
die
7676
}
7777

@@ -1111,7 +1111,7 @@ if [ "$GPG_GEN_KEY_IN_MEMORY" = "n" -o "$GPG_GEN_KEY_IN_MEMORY_COPY_TO_SMARTCARD
11111111
echo -e "\nChecking for USB Security Dongle...\n"
11121112
enable_usb
11131113
if ! gpg --card-status >/dev/null 2>&1; then
1114-
whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
1114+
local_whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
11151115
if ! gpg --card-status >/dev/null 2>/tmp/error; then
11161116
ERROR=$(tail -n 1 /tmp/error | fold -s)
11171117
whiptail_error_die "Unable to detect USB Security Dongle:\n\n${ERROR}"

initrd/etc/gui_functions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# continue with automatic boot, nonzero if user interrupted.
77
pause_automatic_boot()
88
{
9-
if IFS= read -t "$CONFIG_AUTO_BOOT_TIMEOUT" -s -n 1 -p \
10-
"Automatic boot in $CONFIG_AUTO_BOOT_TIMEOUT seconds unless interrupted by keypress... "; then
9+
if IFS= read -t "$CONFIG_AUTO_BOOT_TIMEOUT" -s -n 1 -r -p \
10+
$'Automatic boot in '"$CONFIG_AUTO_BOOT_TIMEOUT"$' seconds unless interrupted by keypress...\n'; then
1111
return 1 # Interrupt automatic boot
1212
fi
1313
return 0 # Continue with automatic boot

initrd/init

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,14 @@ fi
140140
#
141141
# Values in user config have higher priority during combining thus effectively
142142
# changing the value for the rest of the scripts which source /tmp/config.
143-
echo "export CONFIG_TPM=\"$CONFIG_TPM\"" >> /etc/config.user
144-
echo "export CONFIG_TPM2_TOOLS=\"$CONFIG_TPM2_TOOLS\"" >> /etc/config.user
143+
144+
#Only set CONFIG_TPM and CONFIG_TPM2_TOOLS if they are not already set in /etc/config.user
145+
if ! grep -q 'CONFIG_TPM=' /etc/config.user; then
146+
echo "export CONFIG_TPM=\"$CONFIG_TPM\"" >> /etc/config.user
147+
fi
148+
if ! grep -q 'CONFIG_TPM2_TOOLS=' /etc/config.user; then
149+
echo "export CONFIG_TPM2_TOOLS=\"$CONFIG_TPM2_TOOLS\"" >> /etc/config.user
150+
fi
145151

146152
# CONFIG_BASIC was previously CONFIG_PUREBOOT_BASIC in the PureBoot distribution.
147153
# Substitute it in config.user if present for backward compatibility.

0 commit comments

Comments
 (0)