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.
20 lines
587 B
20 lines
587 B
7 years ago
|
#!/bin/bash
|
||
|
|
||
|
output_dir=$1
|
||
|
rootfs_mapping=$2
|
||
6 years ago
|
build_log=$output_dir/build.log
|
||
7 years ago
|
|
||
|
[ ! -f ${output_dir}/rootfs.img ] && \
|
||
6 years ago
|
{ log "Error: extracted rootfs partition not found. Aborting."; exit 1; }
|
||
7 years ago
|
|
||
6 years ago
|
sudo dd if=${output_dir}/rootfs.img of=/dev/mapper/${rootfs_mapping} bs=8M >> "$build_log" 2>&1
|
||
6 years ago
|
sync
|
||
|
# 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
|
||
7 years ago
|
|
||
6 years ago
|
log "\tDone."
|
||
7 years ago
|
|
||
|
exit 0
|