Add variables to allow skipping root overlay copying.

This commit is contained in:
parazyd 2020-06-15 16:37:33 +02:00
parent adde9b80ad
commit 994ac84e16
No known key found for this signature in database
GPG Key ID: 6B636BF0493EE747
1 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# Copyright (c) 2016-2017 Dyne.org Foundation
# Copyright (c) 2016-2020 Dyne.org Foundation
# arm-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
#
# This file is part of arm-sdk
@ -94,21 +94,28 @@ copy-kernel-config() {
$R/tmp/kernels/$device_name/${device_name}-linux/.config
}
vars+=(skip_arm_generic_root skip_arm_device_root)
copy-root-overlay() {
fn copy-root-overlay
req=(strapdir device_name R)
ckreq || return 1
[[ -d $R/extra/generic-root ]] && \
notice "copying generic-root" && \
sudo cp -rfv $R/extra/generic-root/* $strapdir
if [ -z "$skip_arm_generic_root" ]; then
if [ -d "$R/extra/generic-root" ]; then
notice "copying generic-root"
sudo cp -rfv "$R/extra/generic-root"/* "$strapdir"
fi
fi
if [ -z "$skip_arm_device_root" ]; then
if [ -d "$R/extra/$device_name" ]; then
notice "copyring ${device_name}-root"
sudo cp -rfv "$R/extra/$device_name"/* "$strapdir"
fi
fi
sudo sed -e "s/{{{BOOTFS}}}/$bootfs/" -i "$strapdir/etc/fstab"
[[ -d $R/extra/$device_name ]] && \
notice "copying ${device_name}-root" && \
sudo cp -rfv $R/extra/$device_name/* $strapdir
return 0
}