bug fix: just run the fixer script in the end target

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/8/head
Robert Nelson 13 years ago
parent 69b527f552
commit 604cf8f096

@ -514,6 +514,8 @@ function setup_bootscripts {
#Setup Kernel Boot Address
sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/*.diff
sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/ubuntu-finish.sh
sed -i -e 's:ZRELADD:'$ZRELADD':g' ${DIR}/scripts/debian-finish.sh
if [ "$SMSC95XX_MOREMEM" ];then
sed -i 's/8192/16384/g' ${DIR}/scripts/*.diff
@ -631,23 +633,19 @@ function initrd_cleanup {
function initrd_preseed_settings {
echo "NetInstall: Adding Distro Tweaks and Preseed Configuration"
unset UENV
if [ "${USE_UENV}" ] ; then
UENV="-uenv"
fi
cd ${TEMPDIR}/initrd-tree/
case "$DIST" in
maverick)
patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff
patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff
;;
natty)
patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff
patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff
;;
oneiric)
patch -p1 < ${DIR}/scripts/ubuntu-tweaks${UENV}.diff
patch -p1 < ${DIR}/scripts/ubuntu-tweaks.diff
;;
squeeze)
patch -p1 < ${DIR}/scripts/debian-tweaks${UENV}.diff
patch -p1 < ${DIR}/scripts/debian-tweaks.diff
;;
esac
cd ${DIR}/
@ -658,23 +656,27 @@ case "$DIST" in
cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap
cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg
cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh
;;
natty)
cp -v ${DIR}/scripts/flash-kernel.conf ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf
cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap
cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg
cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh
;;
oneiric)
cp -v ${DIR}/scripts/flash-kernel.conf ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf
cp -v ${DIR}/scripts/serial.conf ${TEMPDIR}/initrd-tree/etc/${SERIAL}.conf
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap
cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg
cp -v ${DIR}/scripts/ubuntu-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh
;;
squeeze)
cp -v ${DIR}/scripts/e2fsck.conf ${TEMPDIR}/initrd-tree/etc/e2fsck.conf
chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap
cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg
cp -v ${DIR}/scripts/debian-finish.sh ${TEMPDIR}/initrd-tree/etc/finish-install.sh
;;
esac
}
@ -858,6 +860,7 @@ if [ "${USE_UENV}" ] ; then
echo "-----------------------------"
cat ${TEMPDIR}/bootscripts/normal.cmd
echo "-----------------------------"
touch ${TEMPDIR}/disk/use_uenv
else
echo "Copying boot.scr based boot scripts to Boot Partition"
echo "-----------------------------"
@ -1023,6 +1026,8 @@ function reset_scripts {
#Setup Kernel Boot Address
sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/*.diff
sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/ubuntu-finish.sh
sed -i -e 's:'$ZRELADD':ZRELADD:g' ${DIR}/scripts/debian-finish.sh
if [ "$SMSC95XX_MOREMEM" ];then
sed -i 's/16384/8192/g' ${DIR}/scripts/*.diff

@ -0,0 +1,34 @@
#!/bin/bash
#Find Target Partition and FileSystem
FINAL_PART=$(mount | grep /dev/ | grep -v devpts | awk '{print $1}')
FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | awk '{print $5}')
#Cleanup: NetInstall Files
rm -f /boot/uboot/uInitrd.net || true
rm -f /boot/uboot/uImage || true
#Next: are we using uEnv.txt or boot.scr boot files?
if [ -f "/boot/uboot/use_uenv" ]; then
rm -f /boot/uboot/boot.scr || true
if [ -f "/boot/uboot/normal.txt" ]; then
sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/normal.txt
sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/normal.txt
rm -f /boot/uboot/uEnv.txt || true
mv /boot/uboot/normal.txt /boot/uboot/uEnv.txt
fi
else
if [ -f "/boot/uboot/boot.scr" ]; then
rm -f /boot/uboot/boot.scr || true
mv /boot/uboot/normal.scr /boot/uboot/boot.scr
fi
fi
#Process Correct Kernel Image:
update-initramfs -c -k `uname -r`
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 ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage

@ -1,63 +0,0 @@
diff --git a/usr/lib/finish-install.d/08rcn-omap b/usr/lib/finish-install.d/08rcn-omap
new file mode 100755
index 0000000..6d06fc7
--- /dev/null
+++ b/usr/lib/finish-install.d/08rcn-omap
@@ -0,0 +1,57 @@
+#!/bin/sh -e
+cp /etc/e2fsck.conf /target/etc/e2fsck.conf
+
+if [ -f /etc/rcn.conf ]; then
+ mkdir -p /tmp/mmc
+ mount /dev/mmcblk0p1 /tmp/mmc
+
+ #Remove NetInstall bits
+ rm -f /tmp/mmc/uInitrd.net || true
+
+ #Install kernel image deb
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/
+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true
+
+ #Setup Final Boot Scripts
+ if [ -f "/tmp/mmc/boot.scr" ]; then
+ rm -f /tmp/mmc/boot.scr || true
+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr
+ fi
+
+ if [ -f "/tmp/mmc/normal.txt" ]; then
+ FINAL_PART=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's/ .*//')
+ FINAL_FSTYPE=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's:'$FINAL_PART' on /target/ type ::' | sed 's/ .*//')
+ sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /tmp/mmc/normal.txt
+ sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /tmp/mmc/normal.txt
+
+ rm -f /tmp/mmc/uEnv.txt || true
+ mv /tmp/mmc/normal.txt /tmp/mmc/uEnv.txt
+ fi
+
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+
+ #smsc95xx kevent workaround/hack
+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf
+
+ if [ ! -f /etc/rcn-serial.conf ]; then
+ cat /target/etc/inittab | grep SERIAL || echo "S:2345:respawn:/sbin/getty 115200 SERIAL" >> /target/etc/inittab
+ fi
+
+ cp -r /lib/firmware/ /target/lib/ || true
+
+ rm -f /etc/rcn.conf
+
+ #Generate new initrd.img-*
+ mount -o bind /sys /target/sys
+ chroot /target update-initramfs -c -k `uname -r`
+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd
+ cp /target/boot/uInitrd /tmp/mmc/uInitrd
+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage
+ cp /target/boot/uImage /tmp/mmc/uImage
+ umount /target/sys
+
+ sync
+ umount /tmp/mmc
+fi
+

@ -3,29 +3,21 @@ new file mode 100755
index 0000000..6d06fc7
--- /dev/null
+++ b/usr/lib/finish-install.d/08rcn-omap
@@ -0,0 +1,47 @@
@@ -0,0 +1,34 @@
+#!/bin/sh -e
+cp /etc/e2fsck.conf /target/etc/e2fsck.conf
+cp /etc/finish-install.sh /target/etc/finish-install.sh
+chmod a+x /target/etc/finish-install.sh
+
+if [ -f /etc/rcn.conf ]; then
+ mkdir -p /tmp/mmc
+ mount /dev/mmcblk0p1 /tmp/mmc
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+
+ #Remove NetInstall bits
+ rm -f /tmp/mmc/uInitrd.net || true
+ mount /dev/mmcblk0p1 /target/boot/uboot
+
+ #Install kernel image deb
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/
+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true
+
+ #Setup Final Boot Scripts
+ if [ -f "/tmp/mmc/boot.scr" ]; then
+ rm -f /tmp/mmc/boot.scr || true
+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr
+ fi
+
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /target/boot/uboot/linux-image-*_1.0*_armel.deb /target/
+ rm -f /target/boot/uboot/linux-image-*_1.0*_armel.deb || true
+
+ #smsc95xx kevent workaround/hack
+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf
@ -38,16 +30,11 @@ index 0000000..6d06fc7
+
+ rm -f /etc/rcn.conf
+
+ #Generate new initrd.img-*
+ mount -o bind /sys /target/sys
+ chroot /target update-initramfs -c -k `uname -r`
+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd
+ cp /target/boot/uInitrd /tmp/mmc/uInitrd
+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage
+ cp /target/boot/uImage /tmp/mmc/uImage
+ chroot /target /bin/bash /etc/finish-install.sh
+ umount /target/sys
+
+ sync
+ umount /tmp/mmc
+ umount /target/boot/uboot
+fi
+

@ -4,7 +4,7 @@
#d-i apt-setup/contrib boolean true
# Individual additional packages to install
d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate
d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade

@ -10,7 +10,7 @@ d-i mirror/http/hostname string ports.ubuntu.com
d-i mirror/http/directory string /ubuntu-ports
# Individual additional packages to install
d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate
d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade

@ -10,7 +10,7 @@ d-i mirror/http/hostname string ports.ubuntu.com
d-i mirror/http/directory string /ubuntu-ports
# Individual additional packages to install
d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate
d-i pkgsel/include string u-boot-tools pastebinit initramfs-tools wget linux-firmware linux-firmware-nonfree ntpdate bash
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade

@ -4,7 +4,7 @@ d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
# Individual additional packages to install
d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget firmware-linux ntpdate
d-i pkgsel/include string uboot-mkimage pastebinit initramfs-tools wget firmware-linux ntpdate bash
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade

@ -0,0 +1,64 @@
#!/bin/bash
#Find Target Partition and FileSystem
FINAL_PART=$(mount | grep /dev/ | grep -v devpts | awk '{print $1}')
FINAL_FSTYPE=$(mount | grep /dev/ | grep -v devpts | awk '{print $5}')
#Cleanup: NetInstall Files
rm -f /boot/uboot/uInitrd.net || true
#Cleanup: Ubuntu's mess of backup files
rm -f /boot/uboot/uInitrd || true
rm -f /boot/uboot/uInitrd.bak || true
rm -f /boot/uboot/uImage || true
rm -f /boot/uboot/uImage.bak || true
#Did: Ubuntu touch and backup scr boot file?
if [ -f "/boot/uboot/boot.scr.bak" ]; then
rm -f /boot/uboot/boot.scr || true
mv /boot/uboot/boot.scr.bak /boot/uboot/boot.scr
fi
#Did: Ubuntu touch and backup MLO Bootloader?
if [ -f "/boot/uboot/MLO.bak" ]; then
rm -f /boot/uboot/MLO || true
mv /boot/uboot/MLO.bak /boot/uboot/MLO
fi
#Did: Ubuntu touch and backup u-boot.bin Bootloader?
if [ -f "/boot/uboot/u-boot.bin.bak" ]; then
rm -f /boot/uboot/u-boot.bin || true
mv /boot/uboot/u-boot.bin.bak /boot/uboot/u-boot.bin
fi
#Next: are we using uEnv.txt or boot.scr boot files?
if [ -f "/boot/uboot/use_uenv" ]; then
rm -f /boot/uboot/boot.scr || true
if [ -f "/boot/uboot/normal.txt" ]; then
sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/normal.txt
sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/normal.txt
rm -f /boot/uboot/uEnv.txt || true
mv /boot/uboot/normal.txt /boot/uboot/uEnv.txt
fi
else
if [ -f "/boot/uboot/boot.scr" ]; then
rm -f /boot/uboot/boot.scr || true
mv /boot/uboot/normal.scr /boot/uboot/boot.scr
fi
fi
#Cleanup: some of Ubuntu's packages:
apt-get remove -y linux-image-omap* || true
apt-get remove -y linux-headers-omap* || true
apt-get remove -y u-boot-linaro* || true
apt-get remove -y x-loader-omap* || true
apt-get remove -y flash-kernel || true
#Process Correct Kernel Image:
update-initramfs -c -k `uname -r`
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 ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage

@ -1,83 +0,0 @@
diff --git a/usr/lib/finish-install.d/08rcn-omap b/usr/lib/finish-install.d/08rcn-omap
new file mode 100755
index 0000000..6d06fc7
--- /dev/null
+++ b/usr/lib/finish-install.d/08rcn-omap
@@ -0,0 +1,76 @@
+#!/bin/sh -e
+cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf
+cp /etc/SERIAL.conf /target/etc/init/SERIAL.conf
+
+if [ -f /etc/rcn.conf ]; then
+ mkdir -p /tmp/mmc
+ mount /dev/mmcblk0p1 /tmp/mmc
+
+ #Remove NetInstall bits
+ rm -f /tmp/mmc/uInitrd.net || true
+
+ #Cleanup Ubuntu's mess
+ rm -f /tmp/mmc/uInitrd || true
+ rm -f /tmp/mmc/uInitrd.bak || true
+ rm -f /tmp/mmc/uImage || true
+ rm -f /tmp/mmc/uImage.bak || true
+
+ if [ -f "/tmp/mmc/boot.scr.bak" ]; then
+ rm -f /tmp/mmc/boot.scr.bak || true
+ fi
+
+ if [ -f "/tmp/mmc/MLO.bak" ]; then
+ rm -f /tmp/mmc/MLO || true
+ mv /tmp/mmc/MLO.bak /tmp/mmc/MLO
+ fi
+
+ if [ -f "/tmp/mmc/u-boot.bin.bak" ]; then
+ rm -f /tmp/mmc/u-boot.bin || true
+ mv /tmp/mmc/u-boot.bin.bak /tmp/mmc/u-boot.bin
+ fi
+
+ #Install kernel image deb
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/
+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true
+
+ #With Oneiric Updates, these now seem to ignore /etc/flash-kernel.conf, so lets just remove them..
+ chroot /target apt-get remove -y linux-image-omap* || true
+ chroot /target apt-get remove -y linux-headers-omap* || true
+ chroot /target apt-get remove -y u-boot-linaro* || true
+ chroot /target apt-get remove -y x-loader-omap* || true
+
+ chroot /target apt-get remove -y flash-kernel || true
+
+ #Setup Final Boot Scripts
+ if [ -f "/tmp/mmc/normal.txt" ]; then
+ FINAL_PART=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's/ .*//')
+ FINAL_FSTYPE=$(mount | grep /target | grep /dev/ | grep -v devpts | sed 's:'$FINAL_PART' on /target/ type ::' | sed 's/ .*//')
+ sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /tmp/mmc/normal.txt
+ sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /tmp/mmc/normal.txt
+
+ rm -f /tmp/mmc/uEnv.txt || true
+ mv /tmp/mmc/normal.txt /tmp/mmc/uEnv.txt
+ fi
+
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+
+ #smsc95xx kevent workaround/hack
+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf
+
+ cp -r /lib/firmware/ /target/lib/ || true
+
+ rm -f /etc/rcn.conf
+
+ #Generate new initrd.img-*
+ mount -o bind /sys /target/sys
+ chroot /target update-initramfs -c -k `uname -r`
+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd
+ cp /target/boot/uInitrd /tmp/mmc/uInitrd
+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage
+ cp /target/boot/uImage /tmp/mmc/uImage
+ umount /target/sys
+
+ sync
+ umount /tmp/mmc
+fi
+

@ -3,58 +3,22 @@ new file mode 100755
index 0000000..6d06fc7
--- /dev/null
+++ b/usr/lib/finish-install.d/08rcn-omap
@@ -0,0 +1,71 @@
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf
+cp /etc/SERIAL.conf /target/etc/init/SERIAL.conf
+cp /etc/finish-install.sh /target/etc/finish-install.sh
+chmod a+x /target/etc/finish-install.sh
+
+if [ -f /etc/rcn.conf ]; then
+ mkdir -p /tmp/mmc
+ mount /dev/mmcblk0p1 /tmp/mmc
+
+ #Remove NetInstall bits
+ rm -f /tmp/mmc/uInitrd.net || true
+
+ #Cleanup Ubuntu's mess
+ rm -f /tmp/mmc/uInitrd || true
+ rm -f /tmp/mmc/uInitrd.bak || true
+ rm -f /tmp/mmc/uImage || true
+ rm -f /tmp/mmc/uImage.bak || true
+
+ if [ -f "/tmp/mmc/boot.scr.bak" ]; then
+ rm -f /tmp/mmc/boot.scr.bak || true
+ fi
+
+ if [ -f "/tmp/mmc/MLO.bak" ]; then
+ rm -f /tmp/mmc/MLO || true
+ mv /tmp/mmc/MLO.bak /tmp/mmc/MLO
+ fi
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+
+ if [ -f "/tmp/mmc/u-boot.bin.bak" ]; then
+ rm -f /tmp/mmc/u-boot.bin || true
+ mv /tmp/mmc/u-boot.bin.bak /tmp/mmc/u-boot.bin
+ fi
+ mount /dev/mmcblk0p1 /target/boot/uboot
+
+ #Install kernel image deb
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /tmp/mmc/linux-image-*_1.0*_armel.deb /target/
+ rm -f /tmp/mmc/linux-image-*_1.0*_armel.deb || true
+
+ #With Oneiric Updates, these now seem to ignore /etc/flash-kernel.conf, so lets just remove them..
+ chroot /target apt-get remove -y linux-image-omap* || true
+ chroot /target apt-get remove -y linux-headers-omap* || true
+ chroot /target apt-get remove -y u-boot-linaro* || true
+ chroot /target apt-get remove -y x-loader-omap* || true
+
+ chroot /target apt-get remove -y flash-kernel || true
+
+ #Setup Final Boot Scripts
+ if [ -f "/tmp/mmc/boot.scr" ]; then
+ rm -f /tmp/mmc/boot.scr || true
+ mv /tmp/mmc/normal.scr /tmp/mmc/boot.scr
+ fi
+
+ mkdir -p /target/boot/uboot
+ echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /target/etc/fstab
+ LD_LIBRARY_PATH=/target/lib /target/usr/bin/dpkg-deb -x /target/boot/uboot/linux-image-*_1.0*_armel.deb /target/
+ rm -f /target/boot/uboot/linux-image-*_1.0*_armel.deb || true
+
+ #smsc95xx kevent workaround/hack
+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf
@ -63,16 +27,11 @@ index 0000000..6d06fc7
+
+ rm -f /etc/rcn.conf
+
+ #Generate new initrd.img-*
+ mount -o bind /sys /target/sys
+ chroot /target update-initramfs -c -k `uname -r`
+ chroot /target mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uInitrd
+ cp /target/boot/uInitrd /tmp/mmc/uInitrd
+ chroot /target mkimage -A arm -O linux -T kernel -C none -a ZRELADD -e ZRELADD -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uImage
+ cp /target/boot/uImage /tmp/mmc/uImage
+ chroot /target /bin/bash /etc/finish-install.sh
+ umount /target/sys
+
+ sync
+ umount /tmp/mmc
+ umount /target/boot/uboot
+fi
+

Loading…
Cancel
Save