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.
22 lines
735 B
22 lines
735 B
#!/bin/bash
|
|
|
|
output_dir=$1
|
|
rootfs_mapping=$2
|
|
build_log=$output_dir/build.log
|
|
|
|
[ ! -f ${output_dir}/rootfs.img ] && \
|
|
{ log "Error: extracted rootfs partition not found. Aborting."; exit 1; }
|
|
|
|
sudo dd if=${output_dir}/rootfs.img of=/dev/mapper/${rootfs_mapping} bs=8M conv=sparse >> "$build_log" 2>&1
|
|
sync
|
|
|
|
sudo e2fsck -y -f /dev/mapper/${rootfs_mapping} >> "$build_log" 2>&1
|
|
sudo resize2fs /dev/mapper/${rootfs_mapping} >> "$build_log" 2>&1
|
|
# Check Linux ext4 file system just in case.
|
|
sudo fsck.ext4 -fp /dev/mapper/${rootfs_mapping} >> "$build_log" 2>&1
|
|
# Make sure the rootfs partition's label follows Mender naming convention.
|
|
sudo tune2fs -L "primary" /dev/mapper/${rootfs_mapping} >> "$build_log" 2>&1
|
|
|
|
log "\tDone."
|
|
|
|
exit 0
|
|
|