Skip to content

Commit

Permalink
Mount FAT32 partition first. Added apt-get detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cnxsoft committed Aug 2, 2012
1 parent 1e9a031 commit 50bcd6b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions a1x-initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,36 @@ failure ()
#
# Indicate that an error occurred.
#
echo Build step failed!
echo Script failed!

#
# Exit with a failure return code.
#
exit 1
}

detect_aptget=`which apt-get`
if [ -z $detect_aptget ]; then
echo "apt-get not found!"
echo "Currently this script only supports distributions using apt-get"
echo "If your system uses another package managers e.g. yum, pacman..."
echo "Feel free to edit this script @ https://github.com/cnxsoft/a10-tools :)"
exit 1
fi

echo "Make sure required tools are installed"
try sudo apt-get install -y u-boot-tools initramfs-tools
echo "Mount the FAT partition"
try sudo mount /dev/mmcblk0p1 /boot
echo "Extract and copy kernel config to /boot directory"
try cp /proc/config.gz /tmp
try gzip -df /tmp/config.gz
try sudo cp /tmp/config /boot/config-`uname -r`
echo "Make sure required tools are installed"
try sudo apt-get install -y u-boot-tools initramfs-tools
echo "Generate the initramfs"
try sudo update-initramfs -c -k `uname -r`
echo "Mount the FAT partition"
try sudo mount /dev/mmcblk0p1 /boot
echo "Make initramfs image for u-boot"
try sudo mkimage -A arm -T ramdisk -C none -n "uInitrd" -d /boot/initrd.img-`uname -r` /boot/uInitrd
try sudo umount /boot
try sudo rm -f /boot/initrd* /boot/config-*
try sudo umount /boot
echo "Done. Reboot if you want to use the initramfs"

0 comments on commit 50bcd6b

Please sign in to comment.