|
|
@ -53,7 +53,7 @@ DISTARCH="${DIST}-${ARCH}"
|
|
|
|
DIR="$PWD"
|
|
|
|
DIR="$PWD"
|
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
|
|
|
|
|
|
|
|
function is_element_of {
|
|
|
|
is_element_of () {
|
|
|
|
testelt=$1
|
|
|
|
testelt=$1
|
|
|
|
for validelt in $2 ; do
|
|
|
|
for validelt in $2 ; do
|
|
|
|
[ $testelt = $validelt ] && return 0
|
|
|
|
[ $testelt = $validelt ] && return 0
|
|
|
@ -69,7 +69,7 @@ function is_element_of {
|
|
|
|
|
|
|
|
|
|
|
|
VALID_ADDONS="pico"
|
|
|
|
VALID_ADDONS="pico"
|
|
|
|
|
|
|
|
|
|
|
|
function is_valid_addon {
|
|
|
|
is_valid_addon () {
|
|
|
|
if is_element_of $1 "${VALID_ADDONS}" ] ; then
|
|
|
|
if is_element_of $1 "${VALID_ADDONS}" ] ; then
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -77,14 +77,14 @@ function is_valid_addon {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_root {
|
|
|
|
check_root () {
|
|
|
|
if [[ ${UID} -ne 0 ]] ; then
|
|
|
|
if ! [ $(id -u) = 0 ] ; then
|
|
|
|
echo "$0 must be run as sudo user or root"
|
|
|
|
echo "$0 must be run as sudo user or root"
|
|
|
|
exit
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_for_command {
|
|
|
|
check_for_command () {
|
|
|
|
if ! which "$1" > /dev/null ; then
|
|
|
|
if ! which "$1" > /dev/null ; then
|
|
|
|
echo -n "You're missing command $1"
|
|
|
|
echo -n "You're missing command $1"
|
|
|
|
NEEDS_COMMAND=1
|
|
|
|
NEEDS_COMMAND=1
|
|
|
@ -95,7 +95,7 @@ function check_for_command {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function detect_software {
|
|
|
|
detect_software () {
|
|
|
|
unset NEEDS_COMMAND
|
|
|
|
unset NEEDS_COMMAND
|
|
|
|
|
|
|
|
|
|
|
|
check_for_command mkfs.vfat dosfstools
|
|
|
|
check_for_command mkfs.vfat dosfstools
|
|
|
@ -123,7 +123,7 @@ function detect_software {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function local_bootloader {
|
|
|
|
local_bootloader () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Using Locally Stored Device Bootloader"
|
|
|
|
echo "Using Locally Stored Device Bootloader"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -142,7 +142,7 @@ function local_bootloader {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_bootloader {
|
|
|
|
dl_bootloader (){
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Downloading Device's Bootloader"
|
|
|
|
echo "Downloading Device's Bootloader"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -190,7 +190,7 @@ function dl_bootloader {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_kernel_image {
|
|
|
|
dl_kernel_image () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Downloading Device's Kernel Image"
|
|
|
|
echo "Downloading Device's Kernel Image"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -276,7 +276,7 @@ function dl_kernel_image {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function remove_uboot_wrapper {
|
|
|
|
remove_uboot_wrapper () {
|
|
|
|
echo "Note: NetInstall has u-boot header, removing..."
|
|
|
|
echo "Note: NetInstall has u-boot header, removing..."
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
dd if="${DIR}/dl/${DISTARCH}/${NETINSTALL}" bs=64 skip=1 of="${DIR}/dl/${DISTARCH}/initrd.gz"
|
|
|
|
dd if="${DIR}/dl/${DISTARCH}/${NETINSTALL}" bs=64 skip=1 of="${DIR}/dl/${DISTARCH}/initrd.gz"
|
|
|
@ -285,7 +285,7 @@ function remove_uboot_wrapper {
|
|
|
|
unset UBOOTWRAPPER
|
|
|
|
unset UBOOTWRAPPER
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function actually_dl_netinstall {
|
|
|
|
actually_dl_netinstall () {
|
|
|
|
wget --directory-prefix="${DIR}/dl/${DISTARCH}" ${HTTP_IMAGE}/${DIST}/main/installer-${ARCH}/${NETIMAGE}/images/${BASE_IMAGE}/${NETINSTALL}
|
|
|
|
wget --directory-prefix="${DIR}/dl/${DISTARCH}" ${HTTP_IMAGE}/${DIST}/main/installer-${ARCH}/${NETIMAGE}/images/${BASE_IMAGE}/${NETINSTALL}
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
if [ "${UBOOTWRAPPER}" ] ; then
|
|
|
|
if [ "${UBOOTWRAPPER}" ] ; then
|
|
|
@ -293,7 +293,7 @@ function actually_dl_netinstall {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_dl_netinstall {
|
|
|
|
check_dl_netinstall () {
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
if [ "x${TEST_MD5SUM}" != "x${MD5SUM}" ] ; then
|
|
|
|
if [ "x${TEST_MD5SUM}" != "x${MD5SUM}" ] ; then
|
|
|
|
echo "Note: NetInstall md5sum has changed: ${MD5SUM}"
|
|
|
|
echo "Note: NetInstall md5sum has changed: ${MD5SUM}"
|
|
|
@ -307,14 +307,14 @@ function check_dl_netinstall {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_netinstall_image {
|
|
|
|
dl_netinstall_image () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Downloading NetInstall Image"
|
|
|
|
echo "Downloading NetInstall Image"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
|
|
|
|
|
|
|
##FIXME: "network-console" support...
|
|
|
|
##FIXME: "network-console" support...
|
|
|
|
debian_boot="netboot"
|
|
|
|
debian_boot="netboot"
|
|
|
|
source "${DIR}"/lib/distro.conf
|
|
|
|
. "${DIR}"/lib/distro.conf
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" ] ; then
|
|
|
|
if [ -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" ] ; then
|
|
|
|
check_dl_netinstall
|
|
|
|
check_dl_netinstall
|
|
|
@ -324,7 +324,7 @@ function dl_netinstall_image {
|
|
|
|
echo "md5sum of NetInstall: ${MD5SUM}"
|
|
|
|
echo "md5sum of NetInstall: ${MD5SUM}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function boot_uenv_txt_template {
|
|
|
|
boot_uenv_txt_template () {
|
|
|
|
#Start with a blank state:
|
|
|
|
#Start with a blank state:
|
|
|
|
echo "#Normal Boot" > ${TEMPDIR}/bootscripts/normal.cmd
|
|
|
|
echo "#Normal Boot" > ${TEMPDIR}/bootscripts/normal.cmd
|
|
|
|
echo "#Debian Installer only Boot" > ${TEMPDIR}/bootscripts/netinstall.cmd
|
|
|
|
echo "#Debian Installer only Boot" > ${TEMPDIR}/bootscripts/netinstall.cmd
|
|
|
@ -567,10 +567,10 @@ function boot_uenv_txt_template {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function tweak_boot_scripts {
|
|
|
|
tweak_boot_scripts () {
|
|
|
|
unset KMS_OVERRIDE
|
|
|
|
unset KMS_OVERRIDE
|
|
|
|
|
|
|
|
|
|
|
|
if [ "x${ADDON}" == "xpico" ] ; then
|
|
|
|
if [ "x${ADDON}" = "xpico" ] ; then
|
|
|
|
VIDEO_TIMING="640x480MR-16@60"
|
|
|
|
VIDEO_TIMING="640x480MR-16@60"
|
|
|
|
KMS_OVERRIDE=1
|
|
|
|
KMS_OVERRIDE=1
|
|
|
|
KMS_VIDEOA="video=DVI-D-1"
|
|
|
|
KMS_VIDEOA="video=DVI-D-1"
|
|
|
@ -605,7 +605,7 @@ function tweak_boot_scripts {
|
|
|
|
sed -i -e 's:VIDEO_OMAPFB_MODE:'$VIDEO_OMAPFB_MODE':g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
sed -i -e 's:VIDEO_OMAPFB_MODE:'$VIDEO_OMAPFB_MODE':g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
|
|
|
|
|
|
|
|
#UENV_TIMING -> dvimode=1280x720MR-16@60
|
|
|
|
#UENV_TIMING -> dvimode=1280x720MR-16@60
|
|
|
|
if [ "x${ADDON}" == "xpico" ] ; then
|
|
|
|
if [ "x${ADDON}" = "xpico" ] ; then
|
|
|
|
sed -i -e 's:UENV_TIMING:dvimode=VIDEO_TIMING:g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
sed -i -e 's:UENV_TIMING:dvimode=VIDEO_TIMING:g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
sed -i -e 's:UENV_TIMING:#dvimode=VIDEO_TIMING:g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
sed -i -e 's:UENV_TIMING:#dvimode=VIDEO_TIMING:g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
@ -720,13 +720,13 @@ function tweak_boot_scripts {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setup_bootscripts {
|
|
|
|
setup_bootscripts () {
|
|
|
|
mkdir -p ${TEMPDIR}/bootscripts/
|
|
|
|
mkdir -p ${TEMPDIR}/bootscripts/
|
|
|
|
boot_uenv_txt_template
|
|
|
|
boot_uenv_txt_template
|
|
|
|
tweak_boot_scripts
|
|
|
|
tweak_boot_scripts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function extract_base_initrd {
|
|
|
|
extract_base_initrd () {
|
|
|
|
echo "NetInstall: Extracting Base ${NETINSTALL}"
|
|
|
|
echo "NetInstall: Extracting Base ${NETINSTALL}"
|
|
|
|
cd ${TEMPDIR}/initrd-tree
|
|
|
|
cd ${TEMPDIR}/initrd-tree
|
|
|
|
zcat "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | cpio -i -d
|
|
|
|
zcat "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | cpio -i -d
|
|
|
@ -734,12 +734,12 @@ function extract_base_initrd {
|
|
|
|
cd "${DIR}/"
|
|
|
|
cd "${DIR}/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function git_failure {
|
|
|
|
git_failure () {
|
|
|
|
echo "Unable to pull/clone git tree"
|
|
|
|
echo "Unable to pull/clone git tree"
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_linux_firmware {
|
|
|
|
dl_linux_firmware () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Clone/Pulling linux-firmware.git"
|
|
|
|
echo "Clone/Pulling linux-firmware.git"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -756,7 +756,7 @@ function dl_linux_firmware {
|
|
|
|
cd "${DIR}/"
|
|
|
|
cd "${DIR}/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_am335_firmware {
|
|
|
|
dl_am335_firmware () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Clone/Pulling am33x-cm3.git"
|
|
|
|
echo "Clone/Pulling am33x-cm3.git"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -773,7 +773,7 @@ function dl_am335_firmware {
|
|
|
|
cd "${DIR}/"
|
|
|
|
cd "${DIR}/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dl_device_firmware {
|
|
|
|
dl_device_firmware () {
|
|
|
|
mkdir -p ${TEMPDIR}/firmware/
|
|
|
|
mkdir -p ${TEMPDIR}/firmware/
|
|
|
|
DL_WGET="wget --directory-prefix=${TEMPDIR}/firmware/"
|
|
|
|
DL_WGET="wget --directory-prefix=${TEMPDIR}/firmware/"
|
|
|
|
|
|
|
|
|
|
|
@ -802,7 +802,7 @@ function dl_device_firmware {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initrd_add_firmware {
|
|
|
|
initrd_add_firmware () {
|
|
|
|
DL_WGET="wget --directory-prefix=${TEMPDIR}/firmware/"
|
|
|
|
DL_WGET="wget --directory-prefix=${TEMPDIR}/firmware/"
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "NetInstall: Adding Firmware"
|
|
|
|
echo "NetInstall: Adding Firmware"
|
|
|
@ -839,7 +839,7 @@ function initrd_add_firmware {
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initrd_cleanup {
|
|
|
|
initrd_cleanup () {
|
|
|
|
echo "NetInstall: Removing Optional Stuff to Save RAM Space"
|
|
|
|
echo "NetInstall: Removing Optional Stuff to Save RAM Space"
|
|
|
|
#Cleanup some of the extra space..
|
|
|
|
#Cleanup some of the extra space..
|
|
|
|
rm -f ${TEMPDIR}/initrd-tree/boot/*-${KERNEL} || true
|
|
|
|
rm -f ${TEMPDIR}/initrd-tree/boot/*-${KERNEL} || true
|
|
|
@ -862,7 +862,7 @@ function initrd_cleanup {
|
|
|
|
rm -rf ${TEMPDIR}/initrd-tree/lib/firmware/*-versatile/ || true
|
|
|
|
rm -rf ${TEMPDIR}/initrd-tree/lib/firmware/*-versatile/ || true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function flash_kernel_base_installer {
|
|
|
|
flash_kernel_base_installer () {
|
|
|
|
#All this crap, is just to make "flash-kernel-installer" happy...
|
|
|
|
#All this crap, is just to make "flash-kernel-installer" happy...
|
|
|
|
cat > ${TEMPDIR}/initrd-tree/usr/lib/post-base-installer.d/00flash-kernel <<-__EOF__
|
|
|
|
cat > ${TEMPDIR}/initrd-tree/usr/lib/post-base-installer.d/00flash-kernel <<-__EOF__
|
|
|
|
#!/bin/sh -e
|
|
|
|
#!/bin/sh -e
|
|
|
@ -913,7 +913,7 @@ flash_kernel_broken () {
|
|
|
|
chmod a+x ${TEMPDIR}/initrd-tree/fix_flash-kernel.sh
|
|
|
|
chmod a+x ${TEMPDIR}/initrd-tree/fix_flash-kernel.sh
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function finish_installing_device {
|
|
|
|
finish_installing_device () {
|
|
|
|
cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__
|
|
|
|
cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__
|
|
|
|
#!/bin/sh -e
|
|
|
|
#!/bin/sh -e
|
|
|
|
cp /usr/bin/finish-install.sh /target/usr/bin/finish-install.sh
|
|
|
|
cp /usr/bin/finish-install.sh /target/usr/bin/finish-install.sh
|
|
|
@ -973,7 +973,7 @@ setup_parition_recipe () {
|
|
|
|
__EOF__
|
|
|
|
__EOF__
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initrd_preseed_settings {
|
|
|
|
initrd_preseed_settings () {
|
|
|
|
echo "NetInstall: Adding Distro Tweaks and Preseed Configuration"
|
|
|
|
echo "NetInstall: Adding Distro Tweaks and Preseed Configuration"
|
|
|
|
cd ${TEMPDIR}/initrd-tree/
|
|
|
|
cd ${TEMPDIR}/initrd-tree/
|
|
|
|
case "${DIST}" in
|
|
|
|
case "${DIST}" in
|
|
|
@ -1008,7 +1008,7 @@ function initrd_preseed_settings {
|
|
|
|
cd "${DIR}"/
|
|
|
|
cd "${DIR}"/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function extract_zimage {
|
|
|
|
extract_zimage () {
|
|
|
|
echo "NetInstall: Extracting Kernel Boot Image"
|
|
|
|
echo "NetInstall: Extracting Kernel Boot Image"
|
|
|
|
dpkg -x "${DIR}/dl/${DISTARCH}/${ACTUAL_DEB_FILE}" ${TEMPDIR}/kernel
|
|
|
|
dpkg -x "${DIR}/dl/${DISTARCH}/${ACTUAL_DEB_FILE}" ${TEMPDIR}/kernel
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1021,7 +1021,7 @@ package_modules () {
|
|
|
|
cd "${DIR}"/
|
|
|
|
cd "${DIR}"/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initrd_device_settings {
|
|
|
|
initrd_device_settings () {
|
|
|
|
echo "NetInstall: Adding Device Tweaks"
|
|
|
|
echo "NetInstall: Adding Device Tweaks"
|
|
|
|
touch ${TEMPDIR}/initrd-tree/etc/rcn.conf
|
|
|
|
touch ${TEMPDIR}/initrd-tree/etc/rcn.conf
|
|
|
|
|
|
|
|
|
|
|
@ -1062,14 +1062,14 @@ function initrd_device_settings {
|
|
|
|
__EOF__
|
|
|
|
__EOF__
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function recompress_initrd {
|
|
|
|
recompress_initrd () {
|
|
|
|
echo "NetInstall: Compressing initrd image"
|
|
|
|
echo "NetInstall: Compressing initrd image"
|
|
|
|
cd ${TEMPDIR}/initrd-tree/
|
|
|
|
cd ${TEMPDIR}/initrd-tree/
|
|
|
|
find . | cpio -o -H newc | gzip -9 > ${TEMPDIR}/initrd.mod.gz
|
|
|
|
find . | cpio -o -H newc | gzip -9 > ${TEMPDIR}/initrd.mod.gz
|
|
|
|
cd "${DIR}/"
|
|
|
|
cd "${DIR}/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function create_custom_netinstall_image {
|
|
|
|
create_custom_netinstall_image () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "NetInstall: Creating Custom Image"
|
|
|
|
echo "NetInstall: Creating Custom Image"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -1093,7 +1093,7 @@ function create_custom_netinstall_image {
|
|
|
|
recompress_initrd
|
|
|
|
recompress_initrd
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drive_error_ro {
|
|
|
|
drive_error_ro () {
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "Error: [LC_ALL=C parted --script ${MMC} mklabel msdos] failed..."
|
|
|
|
echo "Error: [LC_ALL=C parted --script ${MMC} mklabel msdos] failed..."
|
|
|
|
echo "Error: for some reason your SD card is not writable..."
|
|
|
|
echo "Error: for some reason your SD card is not writable..."
|
|
|
@ -1105,17 +1105,17 @@ function drive_error_ro {
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function unmount_all_drive_partitions {
|
|
|
|
unmount_all_drive_partitions () {
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Unmounting Partitions"
|
|
|
|
echo "Unmounting Partitions"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
|
|
|
|
|
|
|
NUM_MOUNTS=$(mount | grep -v none | grep "$MMC" | wc -l)
|
|
|
|
NUM_MOUNTS=$(mount | grep -v none | grep "$MMC" | wc -l)
|
|
|
|
|
|
|
|
|
|
|
|
for (( c=1; c<=$NUM_MOUNTS; c++ ))
|
|
|
|
for (i=1;i<=${NUM_MOUNTS};i++)
|
|
|
|
do
|
|
|
|
do
|
|
|
|
DRIVE=$(mount | grep -v none | grep "$MMC" | tail -1 | awk '{print $1}')
|
|
|
|
DRIVE=$(mount | grep -v none | grep "$MMC" | tail -1 | awk '{print $1}')
|
|
|
|
umount ${DRIVE} &> /dev/null || true
|
|
|
|
umount ${DRIVE} >/dev/null 2>&1 || true
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
echo "Zeroing out Partition Table"
|
|
|
|
echo "Zeroing out Partition Table"
|
|
|
@ -1124,12 +1124,12 @@ function unmount_all_drive_partitions {
|
|
|
|
sync
|
|
|
|
sync
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function fatfs_boot_error {
|
|
|
|
fatfs_boot_error () {
|
|
|
|
echo "Failure: [parted --script ${MMC} set 1 boot on]"
|
|
|
|
echo "Failure: [parted --script ${MMC} set 1 boot on]"
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function fatfs_boot {
|
|
|
|
fatfs_boot () {
|
|
|
|
#For: TI: Omap/Sitara Devices
|
|
|
|
#For: TI: Omap/Sitara Devices
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Using fdisk to create an omap compatible fatfs BOOT partition"
|
|
|
|
echo "Using fdisk to create an omap compatible fatfs BOOT partition"
|
|
|
@ -1154,7 +1154,7 @@ function fatfs_boot {
|
|
|
|
LC_ALL=C parted --script ${MMC} set 1 boot on || fatfs_boot_error
|
|
|
|
LC_ALL=C parted --script ${MMC} set 1 boot on || fatfs_boot_error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dd_uboot_boot {
|
|
|
|
dd_uboot_boot () {
|
|
|
|
#For: Freescale: i.mx5/6 Devices
|
|
|
|
#For: Freescale: i.mx5/6 Devices
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Using dd to place bootloader on drive"
|
|
|
|
echo "Using dd to place bootloader on drive"
|
|
|
@ -1163,7 +1163,7 @@ function dd_uboot_boot {
|
|
|
|
bootloader_installed=1
|
|
|
|
bootloader_installed=1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dd_spl_uboot_boot {
|
|
|
|
dd_spl_uboot_boot () {
|
|
|
|
#For: Samsung: Exynos 4 Devices
|
|
|
|
#For: Samsung: Exynos 4 Devices
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Using dd to place bootloader on drive"
|
|
|
|
echo "Using dd to place bootloader on drive"
|
|
|
@ -1173,22 +1173,22 @@ function dd_spl_uboot_boot {
|
|
|
|
bootloader_installed=1
|
|
|
|
bootloader_installed=1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function format_partition_error {
|
|
|
|
format_partition_error () {
|
|
|
|
echo "Failure: formating partition"
|
|
|
|
echo "Failure: formating partition"
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function format_boot_partition {
|
|
|
|
format_boot_partition () {
|
|
|
|
echo "Formating Boot Partition"
|
|
|
|
echo "Formating Boot Partition"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
partprobe ${MMC}
|
|
|
|
partprobe ${MMC}
|
|
|
|
LC_ALL=C ${mkfs} ${MMC}${PARTITION_PREFIX}1 ${mkfs_label} || format_partition_error
|
|
|
|
LC_ALL=C ${mkfs} ${MMC}${PARTITION_PREFIX}1 ${mkfs_label} || format_partition_error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function create_partitions {
|
|
|
|
create_partitions () {
|
|
|
|
unset bootloader_installed
|
|
|
|
unset bootloader_installed
|
|
|
|
|
|
|
|
|
|
|
|
if [ "x${boot_fstype}" == "xfat" ] ; then
|
|
|
|
if [ "x${boot_fstype}" = "xfat" ] ; then
|
|
|
|
parted_format="fat16"
|
|
|
|
parted_format="fat16"
|
|
|
|
mount_partition_format="vfat"
|
|
|
|
mount_partition_format="vfat"
|
|
|
|
mkfs="mkfs.vfat -F 16"
|
|
|
|
mkfs="mkfs.vfat -F 16"
|
|
|
@ -1223,7 +1223,7 @@ function create_partitions {
|
|
|
|
format_boot_partition
|
|
|
|
format_boot_partition
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function populate_boot {
|
|
|
|
populate_boot () {
|
|
|
|
echo "Populating Boot Partition"
|
|
|
|
echo "Populating Boot Partition"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
|
|
|
|
|
|
@ -1287,7 +1287,7 @@ function populate_boot {
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${ACTUAL_DTB_FILE}" ] ; then
|
|
|
|
if [ "${ACTUAL_DTB_FILE}" ] ; then
|
|
|
|
echo "Copying Device Tree Files:"
|
|
|
|
echo "Copying Device Tree Files:"
|
|
|
|
if [ "x${boot_fstype}" == "xfat" ] ; then
|
|
|
|
if [ "x${boot_fstype}" = "xfat" ] ; then
|
|
|
|
tar xfvo "${DIR}/dl/${DISTARCH}/${ACTUAL_DTB_FILE}" -C ${TEMPDIR}/disk/dtbs
|
|
|
|
tar xfvo "${DIR}/dl/${DISTARCH}/${ACTUAL_DTB_FILE}" -C ${TEMPDIR}/disk/dtbs
|
|
|
|
else
|
|
|
|
else
|
|
|
|
tar xfv "${DIR}/dl/${DISTARCH}/${ACTUAL_DTB_FILE}" -C ${TEMPDIR}/disk/dtbs
|
|
|
|
tar xfv "${DIR}/dl/${DISTARCH}/${ACTUAL_DTB_FILE}" -C ${TEMPDIR}/disk/dtbs
|
|
|
@ -1395,7 +1395,7 @@ function populate_boot {
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_mmc {
|
|
|
|
check_mmc () {
|
|
|
|
FDISK=$(LC_ALL=C fdisk -l 2>/dev/null | grep "Disk ${MMC}" | awk '{print $2}')
|
|
|
|
FDISK=$(LC_ALL=C fdisk -l 2>/dev/null | grep "Disk ${MMC}" | awk '{print $2}')
|
|
|
|
|
|
|
|
|
|
|
|
if [ "x${FDISK}" = "x${MMC}:" ] ; then
|
|
|
|
if [ "x${FDISK}" = "x${MMC}:" ] ; then
|
|
|
@ -1412,8 +1412,12 @@ function check_mmc {
|
|
|
|
mount | grep -v none | grep "/dev/" --color=never
|
|
|
|
mount | grep -v none | grep "/dev/" --color=never
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
read -p "Are you 100% sure, on selecting [${MMC}] (y/n)? "
|
|
|
|
unset response
|
|
|
|
[ "${REPLY}" == "y" ] || exit
|
|
|
|
echo -n "Are you 100% sure, on selecting [${MMC}] (y/n)? "
|
|
|
|
|
|
|
|
read response
|
|
|
|
|
|
|
|
if [ "x${response}" != "xy" ] ; then
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
}
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
@ -1471,7 +1475,7 @@ check_dtb_board () {
|
|
|
|
#${dtb_board}.conf
|
|
|
|
#${dtb_board}.conf
|
|
|
|
dtb_board=$(echo ${dtb_board} | awk -F ".conf" '{print $1}')
|
|
|
|
dtb_board=$(echo ${dtb_board} | awk -F ".conf" '{print $1}')
|
|
|
|
if [ -f "${DIR}"/hwpack/${dtb_board}.conf ] ; then
|
|
|
|
if [ -f "${DIR}"/hwpack/${dtb_board}.conf ] ; then
|
|
|
|
source "${DIR}"/hwpack/${dtb_board}.conf
|
|
|
|
. "${DIR}"/hwpack/${dtb_board}.conf
|
|
|
|
populate_dtbs=1
|
|
|
|
populate_dtbs=1
|
|
|
|
unset error_invalid_uboot_dtb
|
|
|
|
unset error_invalid_uboot_dtb
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1480,7 +1484,7 @@ check_dtb_board () {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function is_omap {
|
|
|
|
is_omap () {
|
|
|
|
IS_OMAP=1
|
|
|
|
IS_OMAP=1
|
|
|
|
|
|
|
|
|
|
|
|
bootloader_location="fatfs_boot"
|
|
|
|
bootloader_location="fatfs_boot"
|
|
|
@ -1517,11 +1521,11 @@ function is_omap {
|
|
|
|
unset KMS_VIDEOB
|
|
|
|
unset KMS_VIDEOB
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function convert_uboot_to_dtb_board {
|
|
|
|
convert_uboot_to_dtb_board () {
|
|
|
|
populate_dtbs=1
|
|
|
|
populate_dtbs=1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_uboot_type {
|
|
|
|
check_uboot_type () {
|
|
|
|
#New defines for hwpack:
|
|
|
|
#New defines for hwpack:
|
|
|
|
conf_bl_http="http://rcn-ee.net/deb/tools/latest"
|
|
|
|
conf_bl_http="http://rcn-ee.net/deb/tools/latest"
|
|
|
|
conf_bl_listfile="bootloader-ng"
|
|
|
|
conf_bl_listfile="bootloader-ng"
|
|
|
@ -1576,7 +1580,7 @@ function check_uboot_type {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
beagle_xm)
|
|
|
|
beagle_xm)
|
|
|
|
echo "Note: [--dtb omap3-beagle-xm] now replaces [--uboot beagle_xm]"
|
|
|
|
echo "Note: [--dtb omap3-beagle-xm] now replaces [--uboot beagle_xm]"
|
|
|
|
source "${DIR}"/hwpack/omap3-beagle-xm.conf
|
|
|
|
. "${DIR}"/hwpack/omap3-beagle-xm.conf
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
bone-serial|bone)
|
|
|
|
bone-serial|bone)
|
|
|
@ -1619,7 +1623,7 @@ function check_uboot_type {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
bone_dt|bone_dtb)
|
|
|
|
bone_dt|bone_dtb)
|
|
|
|
echo "Note: [--dtb am335x-bone-serial] now replaces [--uboot bone_dtb]"
|
|
|
|
echo "Note: [--dtb am335x-bone-serial] now replaces [--uboot bone_dtb]"
|
|
|
|
source "${DIR}"/hwpack/am335x-bone-serial.conf
|
|
|
|
. "${DIR}"/hwpack/am335x-bone-serial.conf
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
igepv2)
|
|
|
|
igepv2)
|
|
|
@ -1632,17 +1636,17 @@ function check_uboot_type {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
panda)
|
|
|
|
panda)
|
|
|
|
echo "Note: [--dtb omap4-panda] now replaces [--uboot panda]"
|
|
|
|
echo "Note: [--dtb omap4-panda] now replaces [--uboot panda]"
|
|
|
|
source "${DIR}"/hwpack/omap4-panda.conf
|
|
|
|
. "${DIR}"/hwpack/omap4-panda.conf
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
panda_dtb)
|
|
|
|
panda_dtb)
|
|
|
|
echo "Note: [--dtb omap4-panda-v3.9-dt] now replaces [--uboot panda_dtb]"
|
|
|
|
echo "Note: [--dtb omap4-panda-v3.9-dt] now replaces [--uboot panda_dtb]"
|
|
|
|
source "${DIR}"/hwpack/omap4-panda-v3.9-dt.conf
|
|
|
|
. "${DIR}"/hwpack/omap4-panda-v3.9-dt.conf
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
panda_es)
|
|
|
|
panda_es)
|
|
|
|
echo "Note: [--dtb omap4-panda-es] now replaces [--uboot panda_es]"
|
|
|
|
echo "Note: [--dtb omap4-panda-es] now replaces [--uboot panda_es]"
|
|
|
|
source "${DIR}"/hwpack/omap4-panda-es.conf
|
|
|
|
. "${DIR}"/hwpack/omap4-panda-es.conf
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
convert_uboot_to_dtb_board
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
crane)
|
|
|
|
crane)
|
|
|
@ -1678,7 +1682,7 @@ function check_uboot_type {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_distro {
|
|
|
|
check_distro () {
|
|
|
|
unset IN_VALID_DISTRO
|
|
|
|
unset IN_VALID_DISTRO
|
|
|
|
ARCH="armhf"
|
|
|
|
ARCH="armhf"
|
|
|
|
fki_vmlinuz="vmlinuz-"
|
|
|
|
fki_vmlinuz="vmlinuz-"
|
|
|
@ -1710,8 +1714,12 @@ function check_distro {
|
|
|
|
switch back to menu/(ctrl-alt-f1) and rerun failed option.
|
|
|
|
switch back to menu/(ctrl-alt-f1) and rerun failed option.
|
|
|
|
-----------------------------
|
|
|
|
-----------------------------
|
|
|
|
__EOF__
|
|
|
|
__EOF__
|
|
|
|
read -p "Are you 100% sure on still trying to install [${DIST}] (y/n)? "
|
|
|
|
unset response
|
|
|
|
[ "${REPLY}" == "y" ] || exit
|
|
|
|
echo -n "Are you 100% sure on still trying to install [${DIST}] (y/n)? "
|
|
|
|
|
|
|
|
read response
|
|
|
|
|
|
|
|
if [ "x${response}" != "xy" ] ; then
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
squeeze)
|
|
|
|
squeeze)
|
|
|
|
DIST="squeeze"
|
|
|
|
DIST="squeeze"
|
|
|
@ -1748,7 +1756,7 @@ function check_distro {
|
|
|
|
DISTARCH="${DIST}-${ARCH}"
|
|
|
|
DISTARCH="${DIST}-${ARCH}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function usage {
|
|
|
|
usage () {
|
|
|
|
echo "usage: sudo $(basename $0) --mmc /dev/sdX --uboot <dev board>"
|
|
|
|
echo "usage: sudo $(basename $0) --mmc /dev/sdX --uboot <dev board>"
|
|
|
|
#tabed to match
|
|
|
|
#tabed to match
|
|
|
|
cat <<-__EOF__
|
|
|
|
cat <<-__EOF__
|
|
|
@ -1804,7 +1812,7 @@ function usage {
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function checkparm {
|
|
|
|
checkparm () {
|
|
|
|
if [ "$(echo $1|grep ^'\-')" ] ; then
|
|
|
|
if [ "$(echo $1|grep ^'\-')" ] ; then
|
|
|
|
echo "E: Need an argument"
|
|
|
|
echo "E: Need an argument"
|
|
|
|
usage
|
|
|
|
usage
|
|
|
@ -1828,7 +1836,7 @@ while [ ! -z "$1" ] ; do
|
|
|
|
--mmc)
|
|
|
|
--mmc)
|
|
|
|
checkparm $2
|
|
|
|
checkparm $2
|
|
|
|
MMC="$2"
|
|
|
|
MMC="$2"
|
|
|
|
if [[ "${MMC}" =~ "mmcblk" ]] ; then
|
|
|
|
if [ "${MMC}" =~ "mmcblk" ] ; then
|
|
|
|
PARTITION_PREFIX="p"
|
|
|
|
PARTITION_PREFIX="p"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
check_root
|
|
|
|
check_root
|
|
|
@ -1953,4 +1961,3 @@ create_custom_netinstall_image
|
|
|
|
unmount_all_drive_partitions
|
|
|
|
unmount_all_drive_partitions
|
|
|
|
create_partitions
|
|
|
|
create_partitions
|
|
|
|
populate_boot
|
|
|
|
populate_boot
|
|
|
|
|
|
|
|
|
|
|
|