-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot-deploy
More file actions
executable file
·67 lines (54 loc) · 1.52 KB
/
boot-deploy
File metadata and controls
executable file
·67 lines (54 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Copyright 2021 Clayton Craft <clayton@craftyguy.net>
# SPDX-License-Identifier: GPL-3.0-or-later
set -eu
# Disable yash POSIXly-correct mode
# Dash can't handle 'set +o posixly-correct' so we check first
_set_code="$(set -o | grep posixly-correct2>/dev/null || echo $?)"
if [ "$_set_code" = 0 ]; then
# shellcheck disable=SC3040
set +o posixly-correct 2>/dev/null
fi
initfs_filename=""
work_dir=""
output_dir=""
additional_files=""
functions_file=${BOOT_DEPLOY_FUNCTIONS:-/usr/share/boot-deploy/boot-deploy-functions.sh}
if [ ! -f "$functions_file" ]; then
echo "ERROR: functions file not found: $functions_file"
exit 1
fi
# shellcheck disable=SC1090
. "$functions_file"
get_options "$@"
get_kernel
source_deviceinfo
source_boot_deploy_config
# Hooks can be used to run scripts and binaries after source_*
# functions are called. This allows users to run extra
# pre-processing steps before boot-deploy continues with
# creating files for boot.
execute_hooks
append_or_copy_dtb
add_mtk_header
create_uboot_files
create_bootimg
create_depthcharge_kernel_image
create_extlinux_config
create_grub_config
create_cmdline_txt
add_systemd_boot
mkdir -p "$output_dir"
files_to_copy="$work_dir/$initfs_filename"
for f in $additional_files; do
files_to_copy="$files_to_copy $work_dir/$f"
done
# shellcheck disable=SC2086
check_destination_free_space $files_to_copy
# shellcheck disable=SC2086
copy_files $files_to_copy
sync
# flashing requires things in /boot to exist
flash_updated_boot_parts
flash_updated_depthcharge_kernel
exit 0