|
|
|
@ -2,14 +2,15 @@
|
|
|
|
|
|
|
|
|
|
#Find Target Partition and FileSystem
|
|
|
|
|
if [ -f /etc/mtab ] ; then
|
|
|
|
|
FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}')
|
|
|
|
|
FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}')
|
|
|
|
|
FINAL_PART=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $1}')
|
|
|
|
|
FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | grep " / " | awk '{print $5}')
|
|
|
|
|
else
|
|
|
|
|
#Currently only Maverick, but log if something else does it..
|
|
|
|
|
touch /boot/uboot/backup/no_mtab
|
|
|
|
|
FINAL_PART=$(cat /mounts | grep /dev/ | grep "/target " | awk '{print $1}')
|
|
|
|
|
FINAL_FSTYPE=$(cat /mounts | grep /dev/ | grep "/target " | awk '{print $3}')
|
|
|
|
|
#Currently only Maverick, but log if something else does it..
|
|
|
|
|
touch /boot/uboot/backup/no_mtab
|
|
|
|
|
FINAL_PART=$(cat /mounts | grep /dev/ | grep "/target " | awk '{print $1}')
|
|
|
|
|
FINAL_FSTYPE=$(cat /mounts | grep /dev/ | grep "/target " | awk '{print $3}')
|
|
|
|
|
fi
|
|
|
|
|
mount > /boot/uboot/backup/mount.log
|
|
|
|
|
|
|
|
|
|
#Cleanup: NetInstall Files
|
|
|
|
|
rm -f /boot/uboot/uInitrd.net || true
|
|
|
|
@ -76,38 +77,32 @@ apt-get -y autoremove || true
|
|
|
|
|
#Install Correct Kernel Image:
|
|
|
|
|
dpkg -x /boot/uboot/linux-image-*_1.0*_arm*.deb /
|
|
|
|
|
update-initramfs -c -k `uname -r`
|
|
|
|
|
cp /boot/vmlinuz-`uname -r` /boot/uboot/zImage
|
|
|
|
|
cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img
|
|
|
|
|
rm -f /boot/uboot/linux-image-*_1.0*_arm*.deb || true
|
|
|
|
|
|
|
|
|
|
boot_image=$(cat /boot/uboot/SOC.sh | grep boot_image | awk -F"=" '{print $2}')
|
|
|
|
|
#Device Tweaks:
|
|
|
|
|
source /boot/uboot/SOC.sh
|
|
|
|
|
if [ "x${boot_image}" == "xbootm" ] ; then
|
|
|
|
|
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uboot/uInitrd
|
|
|
|
|
load_addr=$(cat /boot/uboot/SOC.sh | grep load_addr | awk -F"=" '{print $2}')
|
|
|
|
|
mkimage -A arm -O linux -T kernel -C none -a ${load_addr} -e ${load_addr} -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cp /boot/vmlinuz-`uname -r` /boot/uboot/zImage
|
|
|
|
|
cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img
|
|
|
|
|
|
|
|
|
|
rm -f /boot/uboot/linux-image-*_1.0*_arm*.deb || true
|
|
|
|
|
|
|
|
|
|
serial_tty=$(cat /boot/uboot/SOC.sh | grep serial_tty | awk -F"=" '{print $2}')
|
|
|
|
|
if [ "x${serial_tty}" != "x" ] ; then
|
|
|
|
|
cat > /etc/init/${serial_tty}.conf <<-__EOF__
|
|
|
|
|
start on stopped rc RUNLEVEL=[2345]
|
|
|
|
|
stop on runlevel [!2345]
|
|
|
|
|
if [ "x${serial_tty}" != "x" ] ; then
|
|
|
|
|
cat > /etc/init/${serial_tty}.conf <<-__EOF__
|
|
|
|
|
start on stopped rc RUNLEVEL=[2345]
|
|
|
|
|
stop on runlevel [!2345]
|
|
|
|
|
|
|
|
|
|
respawn
|
|
|
|
|
exec /sbin/getty 115200 ${serial_tty}
|
|
|
|
|
respawn
|
|
|
|
|
exec /sbin/getty 115200 ${serial_tty}
|
|
|
|
|
|
|
|
|
|
__EOF__
|
|
|
|
|
__EOF__
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
boot_fstype=$(cat /boot/uboot/SOC.sh | grep boot_fstype | awk -F"=" '{print $2}')
|
|
|
|
|
if [ "x${boot_fstype}" == "xext2" ] ; then
|
|
|
|
|
echo "/dev/mmcblk0p1 /boot/uboot ext2 defaults 0 2" >> /etc/fstab
|
|
|
|
|
else
|
|
|
|
|
echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /etc/fstab
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#Debug:
|
|
|
|
|
mount > /boot/uboot/backup/mount.log
|
|
|
|
|
|
|
|
|
|