70
edits
Changes
→Pidora 2014 Reformating Boot Partition Script
<pre>
#!/usr/bin/env bash
#
# Script to take an SD card image created by Livemedia-Creator (such as for a
# Raspberry Pi) with a an ext4 boot partition and reformat it to vfat.
#
# To use this script, provide the image name as
# kpartx (kpartx)
#
# Version 1.0 20131 2014-0408-0527
#
# Authors:
# Andrew Greene, Seneca College 2013-04-05# Christopher Markieta, Seneca College 2014-08-27
#
set -e
MY_DIR=$(dirname $0)
# mount boot partition
mount -o rw /dev/mapper/$loopdev "$MY_DIR"/temp/
## copy Rename kernel.img workaround for boot data to temp dircp "$MY_DIR"/tmp/boot/kernel-r 3./temp/* ."$MY_DIR"/tmp/boot/kernel.img
#unmount temp format boot dirumount ./temp #reformat boot parttions parttion to vfat
mkfs -t vfat -n boot /dev/mapper/$loopdev
# update partition fs info
3
w
" | fdisk /dev/"${loopdev::5}1"
#cp orginal copy original boot data to new vfat partitioncp -r ."$MY_DIR"/tmp/boot/* ./tempsleep 10# umount tmp boot againumount ."$MY_DIR"/temp
kpartx -dv "$1"