Commit f4bfcb6d authored by Claude's avatar Claude 🌴

Update for 2021-03-04-raspios-buster

parent 95206437
Pipeline #8776 passed with stage
in 10 seconds
......@@ -6,19 +6,26 @@ declare -gri RASPBIAN_PI_USER_ID_DEFAULT=1000
declare -gri RASPBIAN_PI_GROUP_ID_DEFAULT=1000
declare -gr BCM_WORKSPACE_DEFAULT=true
declare -gr FILES_TO_VERIFY_ON_BOOT_PARTITION='
config.txt
kernel.img
kernel7.img
start.elf
start_x.elf
'
declare -gr FILES_TO_VERIFY_ON_ROOTFS_PARTITION='
home/pi/.bashrc
home/pi/.profile
usr/bin/raspi-config
'
declare -gra FILES_TO_VERIFY_ON_BOOT_PARTITION_ARMHF=(
'config.txt'
'kernel.img'
'kernel7.img'
'start.elf'
'start_x.elf'
)
declare -gra FILES_TO_VERIFY_ON_BOOT_PARTITION_ARM64=(
'config.txt'
'kernel8.img'
'start.elf'
'start_x.elf'
)
declare -gra FILES_TO_VERIFY_ON_ROOTFS_PARTITION=(
'home/pi/.bashrc'
'home/pi/.profile'
'usr/bin/raspi-config'
)
function customize_sd {
# Ensure boot partition is has expected
......@@ -227,6 +234,21 @@ function get_partition_home_by_label {
fi
}
function check_if_all_files_exists {
local -r root_dir="$1"
shift
local file=
while [ "$#" -gt 0 ] ; do
file="${root_dir}/$1"
shift
if [ ! -f "${file}" ] ; then
echowarn "File '${file}' is required."
return 1
fi
done
}
function verify_sd_content {
local -r boot_partition_home="$1"
local -r rootfs_partition_home="$2"
......@@ -236,16 +258,20 @@ function verify_sd_content {
exit 1
fi
for file in ${FILES_TO_VERIFY_ON_BOOT_PARTITION} ; do
exit_if_file_not_exists "${boot_partition_home}/${file}"
done
if ! check_if_all_files_exists "${boot_partition_home}" "${FILES_TO_VERIFY_ON_BOOT_PARTITION_ARMHF[@]}" ; then
if ! check_if_all_files_exists "${boot_partition_home}" "${FILES_TO_VERIFY_ON_BOOT_PARTITION_ARM64[@]}" ; then
echofatal 'Missing required file'
return 100
fi
fi
if [ ! -d "${rootfs_partition_home}" ] ; then
echoerror "Cannot find directory: rootfs_partition_home='${rootfs_partition_home}'"
exit 1
fi
for file in ${FILES_TO_VERIFY_ON_ROOTFS_PARTITION} ; do
exit_if_file_not_exists "${rootfs_partition_home}/${file}"
done
if ! check_if_all_files_exists "${rootfs_partition_home}" "${FILES_TO_VERIFY_ON_ROOTFS_PARTITION[@]}" ; then
echofatal 'Missing required file'
return 100
fi
}
......@@ -178,18 +178,10 @@ function main {
case "${param_arch}" in
'arm64')
check_rootfs_for './lib/modules/5.4.51+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v7+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v7l+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v8+/kernel/drivers/net/dummy.ko'
check_rootfs_for './usr/share/doc/libalgorithm-diff-xs-perl/changelog.Debian.arm64.gz'
;;
'armhf')
check_rootfs_for './lib/modules/5.4.51+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v7+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v7l+/kernel/drivers/net/dummy.ko'
check_rootfs_for './lib/modules/5.4.51-v8+/kernel/drivers/net/dummy.ko'
check_rootfs_for './usr/share/doc/libalgorithm-diff-xs-perl/changelog.Debian.armhf.gz'
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment