reorganize: final boot scripts

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/22/head
Robert Nelson 12 years ago
parent 4e2977257d
commit 0449d73c5e

@ -1,5 +1,14 @@
#!/bin/bash #!/bin/bash
#Device Configuration:
if [ ! -f /boot/uboot/SOC.sh ] ; then
cp /etc/hwpack/SOC.sh /boot/uboot/SOC.sh
fi
source /boot/uboot/SOC.sh
if [ ! -d /boot/uboot/backup/ ] ; then
mkdir -p /boot/uboot/backup/
fi
ls -lh /boot/uboot/* >/boot/uboot/backup/file_list.log ls -lh /boot/uboot/* >/boot/uboot/backup/file_list.log
#Find Target Partition and FileSystem #Find Target Partition and FileSystem
@ -34,24 +43,6 @@ if [ -f "/boot/uboot/backup/normal.txt" ] ; then
mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt
fi fi
#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
#Device Configuration:
if [ ! -f /boot/uboot/SOC.sh ] ; then
cp /etc/hwpack/SOC.sh /boot/uboot/SOC.sh
fi
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
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
if [ "x${serial_tty}" != "x" ] ; then if [ "x${serial_tty}" != "x" ] ; then
cp /etc/inittab /boot/uboot/backup/inittab cp /etc/inittab /boot/uboot/backup/inittab
serial_num=$(echo -n "${serial_tty}"| tail -c -1) serial_num=$(echo -n "${serial_tty}"| tail -c -1)
@ -123,3 +114,14 @@ __EOF__
chmod u+x /etc/init.d/board_tweaks.sh chmod u+x /etc/init.d/board_tweaks.sh
insserv board_tweaks.sh || true insserv board_tweaks.sh || true
#Install Correct Kernel Image: (this will fail if the boot partition was re-formated)
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
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
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

@ -1,5 +1,14 @@
#!/bin/bash #!/bin/bash
#Device Configuration:
if [ ! -f /boot/uboot/SOC.sh ] ; then
cp /etc/hwpack/SOC.sh /boot/uboot/SOC.sh
fi
source /boot/uboot/SOC.sh
if [ ! -d /boot/uboot/backup/ ] ; then
mkdir -p /boot/uboot/backup/
fi
ls -lh /boot/uboot/* >/boot/uboot/backup/file_list.log ls -lh /boot/uboot/* >/boot/uboot/backup/file_list.log
#Find Target Partition and FileSystem #Find Target Partition and FileSystem
@ -63,8 +72,10 @@ if [ -f /boot/uboot/backup/u-boot.bin ] ; then
mv /boot/uboot/backup/u-boot.bin /boot/uboot/u-boot.bin mv /boot/uboot/backup/u-boot.bin /boot/uboot/u-boot.bin
fi fi
if [ -f /boot/uboot/backup/u-boot.imx ] ; then if [ "${dd_uboot_seek}" ] && [ "${dd_uboot_bs}" ] ; then
dd if=/boot/uboot/backup/u-boot.imx of=/dev/mmcblk0 seek=1 bs=1024 if [ -f /boot/uboot/backup/u-boot.imx ] ; then
dd if=/boot/uboot/backup/u-boot.imx of=/dev/mmcblk0 seek=${dd_uboot_seek} bs=${dd_uboot_bs}
fi
fi fi
if [ -f "/boot/uboot/backup/boot.scr" ] ; then if [ -f "/boot/uboot/backup/boot.scr" ] ; then
@ -85,24 +96,6 @@ apt-get remove -y x-loader-omap* || true
apt-get remove -y flash-kernel || true apt-get remove -y flash-kernel || true
apt-get -y autoremove || true 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
#Device Configuration:
if [ ! -f /boot/uboot/SOC.sh ] ; then
cp /etc/hwpack/SOC.sh /boot/uboot/SOC.sh
fi
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
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
if [ "x${serial_tty}" != "x" ] ; then if [ "x${serial_tty}" != "x" ] ; then
cat > /etc/init/${serial_tty}.conf <<-__EOF__ cat > /etc/init/${serial_tty}.conf <<-__EOF__
start on stopped rc RUNLEVEL=[2345] start on stopped rc RUNLEVEL=[2345]
@ -141,3 +134,14 @@ cat > /etc/init/board_tweaks.conf <<-__EOF__
__EOF__ __EOF__
#Install Correct Kernel Image: (this will fail if the boot partition was re-formated)
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
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
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
Loading…
Cancel
Save