|
|
@ -124,7 +124,7 @@ function is_valid_addon {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_root {
|
|
|
|
function check_root {
|
|
|
|
if [[ $UID -ne 0 ]]; then
|
|
|
|
if [[ ${UID} -ne 0 ]] ; then
|
|
|
|
echo "$0 must be run as sudo user or root"
|
|
|
|
echo "$0 must be run as sudo user or root"
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -331,20 +331,20 @@ function remove_uboot_wrapper {
|
|
|
|
function actually_dl_netinstall {
|
|
|
|
function 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
|
|
|
|
remove_uboot_wrapper
|
|
|
|
remove_uboot_wrapper
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_dl_netinstall {
|
|
|
|
function check_dl_netinstall {
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
MD5SUM=$(md5sum "${DIR}/dl/${DISTARCH}/${NETINSTALL}" | awk '{print $1}')
|
|
|
|
if [ "=$TEST_MD5SUM=" != "=$MD5SUM=" ]; then
|
|
|
|
if [ "x${TEST_MD5SUM}" != "x${MD5SUM}" ] ; then
|
|
|
|
echo "Note: NetInstall md5sum has changed: $MD5SUM"
|
|
|
|
echo "Note: NetInstall md5sum has changed: ${MD5SUM}"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
rm -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" || true
|
|
|
|
rm -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" || true
|
|
|
|
actually_dl_netinstall
|
|
|
|
actually_dl_netinstall
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if [ "${UBOOTWRAPPER}" ]; then
|
|
|
|
if [ "${UBOOTWRAPPER}" ] ; then
|
|
|
|
remove_uboot_wrapper
|
|
|
|
remove_uboot_wrapper
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -356,7 +356,6 @@ function dl_netinstall_image {
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
|
|
|
|
|
|
|
|
unset UBOOTWRAPPER
|
|
|
|
unset UBOOTWRAPPER
|
|
|
|
|
|
|
|
|
|
|
|
case "${DISTARCH}" in
|
|
|
|
case "${DISTARCH}" in
|
|
|
|
maverick-armel)
|
|
|
|
maverick-armel)
|
|
|
|
TEST_MD5SUM=$MAVERICK_MD5SUM
|
|
|
|
TEST_MD5SUM=$MAVERICK_MD5SUM
|
|
|
@ -424,15 +423,13 @@ function dl_netinstall_image {
|
|
|
|
UBOOTWRAPPER=1
|
|
|
|
UBOOTWRAPPER=1
|
|
|
|
NETINSTALL="uInitrd"
|
|
|
|
NETINSTALL="uInitrd"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
if [ -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" ] ; then
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f "${DIR}/dl/${DISTARCH}/${NETINSTALL}" ]; then
|
|
|
|
|
|
|
|
check_dl_netinstall
|
|
|
|
check_dl_netinstall
|
|
|
|
else
|
|
|
|
else
|
|
|
|
actually_dl_netinstall
|
|
|
|
actually_dl_netinstall
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "md5sum of NetInstall: ${MD5SUM}"
|
|
|
|
echo "md5sum of NetInstall: ${MD5SUM}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -444,6 +441,7 @@ function boot_uenv_txt_template {
|
|
|
|
cat > ${TEMPDIR}/bootscripts/netinstall.cmd <<-__EOF__
|
|
|
|
cat > ${TEMPDIR}/bootscripts/netinstall.cmd <<-__EOF__
|
|
|
|
#These video values are now set by default in the bootloader
|
|
|
|
#These video values are now set by default in the bootloader
|
|
|
|
#uncomment/change if you need something else
|
|
|
|
#uncomment/change if you need something else
|
|
|
|
|
|
|
|
|
|
|
|
UENV_VRAM
|
|
|
|
UENV_VRAM
|
|
|
|
UENV_FB
|
|
|
|
UENV_FB
|
|
|
|
UENV_TIMING
|
|
|
|
UENV_TIMING
|
|
|
@ -681,7 +679,11 @@ 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
|
|
|
|
|
|
|
|
sed -i -e 's:UENV_TIMING:dvimode=VIDEO_TIMING:g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
fi
|
|
|
|
sed -i -e 's:VIDEO_TIMING:'$VIDEO_TIMING':g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
sed -i -e 's:VIDEO_TIMING:'$VIDEO_TIMING':g' ${TEMPDIR}/bootscripts/${ALL}
|
|
|
|
|
|
|
|
|
|
|
|
#optargs=VIDEO_CONSOLE -> optargs=console=tty0
|
|
|
|
#optargs=VIDEO_CONSOLE -> optargs=console=tty0
|
|
|
@ -953,7 +955,7 @@ function initrd_preseed_settings {
|
|
|
|
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device
|
|
|
|
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device
|
|
|
|
cp -v "${DIR}/scripts/${DIST}-preseed.cfg" ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
|
cp -v "${DIR}/scripts/${DIST}-preseed.cfg" ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${SERIAL_MODE}" ];then
|
|
|
|
if [ "${SERIAL_MODE}" ] ; then
|
|
|
|
#Squeeze/Wheezy: keymaps aren't an issue with serial mode so disable preseed workaround:
|
|
|
|
#Squeeze/Wheezy: keymaps aren't an issue with serial mode so disable preseed workaround:
|
|
|
|
sed -i -e 's:d-i console-tools:#d-i console-tools:g' ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
|
sed -i -e 's:d-i console-tools:#d-i console-tools:g' ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
|
sed -i -e 's:d-i debian-installer:#d-i debian-installer:g' ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
|
sed -i -e 's:d-i debian-installer:#d-i debian-installer:g' ${TEMPDIR}/initrd-tree/preseed.cfg
|
|
|
@ -969,7 +971,7 @@ function initrd_fixes {
|
|
|
|
|
|
|
|
|
|
|
|
#work around for the kevent smsc95xx issue
|
|
|
|
#work around for the kevent smsc95xx issue
|
|
|
|
touch ${TEMPDIR}/initrd-tree/etc/sysctl.conf
|
|
|
|
touch ${TEMPDIR}/initrd-tree/etc/sysctl.conf
|
|
|
|
if [ "${smsc95xx_mem}" ];then
|
|
|
|
if [ "${smsc95xx_mem}" ] ; then
|
|
|
|
echo "vm.min_free_kbytes = ${smsc95xx_mem}" >> ${TEMPDIR}/initrd-tree/etc/sysctl.conf
|
|
|
|
echo "vm.min_free_kbytes = ${smsc95xx_mem}" >> ${TEMPDIR}/initrd-tree/etc/sysctl.conf
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1059,7 +1061,7 @@ function omap_fatfs_boot_part {
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
parted --script ${MMC} set 1 boot on
|
|
|
|
parted --script ${MMC} set 1 boot on
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$FDISK_DEBUG" ];then
|
|
|
|
if [ "${FDISK_DEBUG}" ] ; then
|
|
|
|
echo "Debug: Partition 1 layout:"
|
|
|
|
echo "Debug: Partition 1 layout:"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
fdisk -l ${MMC}
|
|
|
|
fdisk -l ${MMC}
|
|
|
@ -1135,7 +1137,7 @@ function populate_boot {
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! "${bootloader_installed}" ] ; then
|
|
|
|
if [ ! "${bootloader_installed}" ] ; then
|
|
|
|
if [ "${spl_name}" ] ; then
|
|
|
|
if [ "${spl_name}" ] ; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${MLO} ]; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${MLO} ] ; then
|
|
|
|
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/${spl_name}
|
|
|
|
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/${spl_name}
|
|
|
|
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/backup/${spl_name}
|
|
|
|
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/backup/${spl_name}
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
@ -1143,13 +1145,13 @@ function populate_boot {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${boot_name}" ] && [ ! "${IS_IMX}" ] ; then
|
|
|
|
if [ "${boot_name}" ] && [ ! "${IS_IMX}" ] ; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${UBOOT} ]; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${UBOOT} ] ; then
|
|
|
|
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/${boot_name}
|
|
|
|
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/${boot_name}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${boot_name}" ] ; then
|
|
|
|
if [ "${boot_name}" ] ; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${UBOOT} ]; then
|
|
|
|
if [ -f ${TEMPDIR}/dl/${UBOOT} ] ; then
|
|
|
|
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/${boot_name}
|
|
|
|
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/${boot_name}
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "-----------------------------"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -1612,35 +1614,34 @@ function check_uboot_type {
|
|
|
|
|
|
|
|
|
|
|
|
function check_distro {
|
|
|
|
function check_distro {
|
|
|
|
unset IN_VALID_DISTRO
|
|
|
|
unset IN_VALID_DISTRO
|
|
|
|
|
|
|
|
|
|
|
|
case "${DISTRO_TYPE}" in
|
|
|
|
case "${DISTRO_TYPE}" in
|
|
|
|
natty)
|
|
|
|
|
|
|
|
DIST=natty
|
|
|
|
|
|
|
|
ARCH=armel
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
maverick)
|
|
|
|
maverick)
|
|
|
|
DIST=maverick
|
|
|
|
DIST="maverick"
|
|
|
|
ARCH=armel
|
|
|
|
ARCH="armel"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
natty)
|
|
|
|
|
|
|
|
DIST="natty"
|
|
|
|
|
|
|
|
ARCH="armel"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
oneiric)
|
|
|
|
oneiric)
|
|
|
|
DIST=oneiric
|
|
|
|
DIST="oneiric"
|
|
|
|
ARCH=armel
|
|
|
|
ARCH="armel"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
precise-armel)
|
|
|
|
precise-armel)
|
|
|
|
DIST=precise
|
|
|
|
DIST="precise"
|
|
|
|
ARCH=armel
|
|
|
|
ARCH="armel"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
precise-armhf)
|
|
|
|
precise-armhf)
|
|
|
|
DIST=precise
|
|
|
|
DIST="precise"
|
|
|
|
ARCH=armhf
|
|
|
|
ARCH="armhf"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
quantal-armhf)
|
|
|
|
quantal-armhf)
|
|
|
|
DIST="quantal"
|
|
|
|
DIST="quantal"
|
|
|
|
ARCH="armhf"
|
|
|
|
ARCH="armhf"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
squeeze)
|
|
|
|
squeeze)
|
|
|
|
DIST=squeeze
|
|
|
|
DIST="squeeze"
|
|
|
|
ARCH=armel
|
|
|
|
ARCH="armel"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
wheezy-armel)
|
|
|
|
wheezy-armel)
|
|
|
|
DIST="wheezy"
|
|
|
|
DIST="wheezy"
|
|
|
@ -1674,7 +1675,6 @@ function check_distro {
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
DISTARCH="${DIST}-${ARCH}"
|
|
|
|
DISTARCH="${DIST}-${ARCH}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1745,7 +1745,7 @@ function usage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function checkparm {
|
|
|
|
function checkparm {
|
|
|
|
if [ "$(echo $1|grep ^'\-')" ];then
|
|
|
|
if [ "$(echo $1|grep ^'\-')" ] ; then
|
|
|
|
echo "E: Need an argument"
|
|
|
|
echo "E: Need an argument"
|
|
|
|
usage
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -1754,7 +1754,7 @@ function checkparm {
|
|
|
|
IN_VALID_UBOOT=1
|
|
|
|
IN_VALID_UBOOT=1
|
|
|
|
|
|
|
|
|
|
|
|
# parse commandline options
|
|
|
|
# parse commandline options
|
|
|
|
while [ ! -z "$1" ]; do
|
|
|
|
while [ ! -z "$1" ] ; do
|
|
|
|
case $1 in
|
|
|
|
case $1 in
|
|
|
|
-h|--help)
|
|
|
|
-h|--help)
|
|
|
|
usage
|
|
|
|
usage
|
|
|
@ -1768,8 +1768,7 @@ while [ ! -z "$1" ]; do
|
|
|
|
--mmc)
|
|
|
|
--mmc)
|
|
|
|
checkparm $2
|
|
|
|
checkparm $2
|
|
|
|
MMC="$2"
|
|
|
|
MMC="$2"
|
|
|
|
if [[ "${MMC}" =~ "mmcblk" ]]
|
|
|
|
if [[ "${MMC}" =~ "mmcblk" ]] ; then
|
|
|
|
then
|
|
|
|
|
|
|
|
PARTITION_PREFIX="p"
|
|
|
|
PARTITION_PREFIX="p"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
check_root
|
|
|
|
check_root
|
|
|
@ -1856,7 +1855,7 @@ echo "-----------------------------"
|
|
|
|
check_root
|
|
|
|
check_root
|
|
|
|
detect_software
|
|
|
|
detect_software
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${spl_name}" ] || [ "${boot_name}" ]; then
|
|
|
|
if [ "${spl_name}" ] || [ "${boot_name}" ] ; then
|
|
|
|
if [ "${USE_LOCAL_BOOT}" ] ; then
|
|
|
|
if [ "${USE_LOCAL_BOOT}" ] ; then
|
|
|
|
local_bootloader
|
|
|
|
local_bootloader
|
|
|
|
else
|
|
|
|
else
|
|
|
|