Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Mount FAT32 partition first. Added apt-get detection

  • Loading branch information...
commit 50bcd6be3671384d4822071c080fbe37662302af 1 parent 1e9a031
@cnxsoft authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 a1x-initramfs.sh
View
21 a1x-initramfs.sh
@@ -13,7 +13,7 @@ failure ()
#
# Indicate that an error occurred.
#
- echo Build step failed!
+ echo Script failed!
#
# Exit with a failure return code.
@@ -21,19 +21,28 @@ failure ()
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.
Something went wrong with that request. Please try again.