You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
945 B
25 lines
945 B
#!/bin/bash
|
|
|
|
output_dir=$1
|
|
boot_mapping=$2
|
|
build_log=$output_dir/build.log
|
|
|
|
[ ! -f $output_dir/boot.vfat ] && \
|
|
{ log "Error: extracted boot partition not found. Aborting."; exit 1; }
|
|
|
|
# Make a copy of Linux kernel arguments and modify.
|
|
mcopy -on -i ${output_dir}/boot.vfat -s ::cmdline.txt ${output_dir}/cmdline.txt
|
|
sed -i 's/\b[ ]root=[^ ]*/ root=\/dev\/mmcblk0p2/' ${output_dir}/cmdline.txt
|
|
sed -i 's/\b[ ]console=tty1//' ${output_dir}/cmdline.txt
|
|
# Update Linux kernel command arguments with our custom configuration
|
|
mcopy -o -i ${output_dir}/boot.vfat -s ${output_dir}/cmdline.txt ::cmdline.txt
|
|
|
|
mcopy -on -i ${output_dir}/boot.vfat -s ::config.txt ${output_dir}/config.txt
|
|
echo -e '\nenable_uart=1\n' >> ${output_dir}/config.txt
|
|
mcopy -o -i ${output_dir}/boot.vfat -s ${output_dir}/config.txt ::config.txt
|
|
|
|
sudo dd if=${output_dir}/boot.vfat of=/dev/mapper/${boot_mapping} bs=1M conv=sparse >> "$build_log" 2>&1
|
|
|
|
log "\tDone."
|
|
|
|
exit 0
|
|
|