bcm2835-bootloader: fixes and cleanup

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-05-17 20:43:53 +02:00
parent 0e9a76c34a
commit d25dcddbbd

View File

@ -213,37 +213,46 @@ echo "#########################################################"
mkfs.vfat "$PART1" -n System mkfs.vfat "$PART1" -n System
echo "creating filesystem on $PART2..." echo "creating filesystem on $PART2..."
mkfs.ext4 "$PART2" -n Storage mkfs.ext4 "$PART2" -L Storage
# mount partition # mount partition
echo "mounting partition $PART1 on /tmp/usb_install..." echo "mounting partition $PART1 ..."
mkdir -p /tmp/usb_install if [ -d /dev/shm ]; then
mount "$PART1" /tmp/usb_install rm -rf /dev/shm/openelec_install
mkdir -p /dev/shm/openelec_install
mount "$PART1" /dev/shm/openelec_install
MOUNTPOINT=/dev/shm/openelec_install
else
rm -rf /tmp/openelec_install
mkdir -p /tmp/openelec_install
mount "$PART1" /tmp/openelec_install
MOUNTPOINT=/tmp/openelec_install
fi
# create bootloader configuration # create bootloader configuration
echo "creating bootloader configuration..." echo "creating bootloader configuration..."
echo "boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 ssh quiet" > /tmp/usb_install/cmdline.txt echo "boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 ssh quiet" > $MOUNTPOINT/cmdline.txt
# copy files # copy files
echo "copying files to $PART1..." echo "copying files to $MOUNTPOINT..."
cp target/KERNEL /tmp/usb_install/kernel.img cp target/KERNEL $MOUNTPOINT/kernel.img
cp target/SYSTEM /tmp/usb_install cp target/SYSTEM $MOUNTPOINT
cp 3rdparty/bootloader/* /tmp/usb_install cp 3rdparty/bootloader/* $MOUNTPOINT
cp openelec.ico /tmp/usb_install cp openelec.ico $MOUNTPOINT
cp README.md /tmp/usb_install cp README.md $MOUNTPOINT
# sync disk # sync disk
echo "syncing disk..." echo "syncing disk..."
sync sync
# unmount partition # unmount partition
echo "unmounting partition $PART1..." echo "unmounting partition $MOUNTPOINT ..."
umount "$PART1" umount $MOUNTPOINT
# cleaning # cleaning
echo "cleaning tempdir..." echo "cleaning tempdir..."
rmdir /tmp/usb_install rmdir $MOUNTPOINT
echo "...installation finished" echo "...installation finished"