Skip to content
Snippets Groups Projects
Verified Commit bd14f1be authored by Newbyte's avatar Newbyte :stars: Committed by clayton craft
Browse files

boot-deploy-functions.sh: Integrate postmarketos-update-depthcharge-kernel (MR 55)

Taken from https://gitlab.com/postmarketOS/pmaports/-/blob/7aa0c329eded5f198b05daf8bbc32a100d677b82/main/postmarketos-update-depthcharge-kernel/update-depthcharge-kernel.sh

This is to more easily let other distributions re-use boot-deploy. Right
now, boot-deploy has a hard dependency on these external scripts for
certain functionality, which is a problem as they're packaged in
pmaports which isn't a great repository to use as source in packages for
other distributions.

As such, just integrate these scripts directly into boot-deploy. Given
their small size and close semantic function to the rest of boot-deploy
there is no greater benefit in keeping them in separate files.
parent 5c17849f
No related branches found
No related tags found
1 merge request!55Integrate postmarketos-update-kernel and postmarketos-update-depthcharge-kernel
Pipeline #1257759706 passed
......@@ -869,8 +869,6 @@ create_depthcharge_kernel_image() {
flash_updated_depthcharge_kernel() {
[ "${deviceinfo_generate_depthcharge_image}" = "true" ] || return 0
[ -f /sbin/pmos-update-depthcharge-kernel ] || return 0
# Don't run when in a pmOS chroot
if [ -f "/in-pmbootstrap" ]; then
log_arrow "Not flashing vmlinuz.kpart in chroot"
......@@ -878,7 +876,27 @@ flash_updated_depthcharge_kernel() {
fi
log_arrow "Flashing depthcharge kernel image"
pmos-update-depthcharge-kernel
local guid
local partition
# shellcheck disable=SC2013
for x in $(cat /proc/cmdline); do
[ "$x" = "${x#kern_guid=}" ] && continue
guid="${x#kern_guid=}"
partition=$(findfs PARTUUID="$guid")
if [ -z "$partition" ]; then
log -n "Failed to find partition to flash depthcharge kernel image"
log " to! Is kern_guid set correctly in /proc/cmdline?"
return 1
fi
log "Flashing $deviceinfo_cgpt_kpart to $partition"
dd if="$work_dir"/"$(basename "$deviceinfo_cgpt_kpart")" of="$partition"
done
log "Done."
}
create_extlinux_config() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment