diff --git a/TODO b/TODO index 457a8e3..b9c5d4f 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ Easy: * cleanup firmware mess, just copy needed firmware from the mainline git tree -* debug.log, to help troubleshoot failures (do we need anything else /boot/uboot/debug/* after install) +* debug.log, to help troubleshoot failures (do we need anything else /boot/uboot/backup/* after install) * random http link to *.deb package (--deb-file just needs to be extended to http case, as it works for local files) More Effort: * ext2 boot instead of vfat **ti: omap3/4 will always need vfat for MLO bootloader -**freescale: mx51/53 has bootloader dd'd to boot device, could use ext2 over vfat.. \ No newline at end of file +**freescale: mx51/53 has bootloader dd'd to boot device, could use ext2 over vfat.. diff --git a/mk_mmc.sh b/mk_mmc.sh index f318d9a..96834ae 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -1140,33 +1140,32 @@ fi } function populate_boot { - echo "Populating Boot Partition" - echo "-----------------------------" + echo "Populating Boot Partition" + echo "-----------------------------" - mkdir -p ${TEMPDIR}/disk + mkdir -p ${TEMPDIR}/disk - if mount -t vfat ${MMC}${PARTITION_PREFIX}1 ${TEMPDIR}/disk; then + if mount -t vfat ${MMC}${PARTITION_PREFIX}1 ${TEMPDIR}/disk; then - mkdir -p ${TEMPDIR}/disk/cus - mkdir -p ${TEMPDIR}/disk/debug - if [ "${SPL_BOOT}" ] ; then - if [ -f ${TEMPDIR}/dl/${MLO} ]; then - cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/MLO - cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/cus/MLO - fi - fi + mkdir -p ${TEMPDIR}/disk/backup + if [ "${SPL_BOOT}" ] ; then + if [ -f ${TEMPDIR}/dl/${MLO} ]; then + cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/MLO + cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/backup/MLO + fi + fi - if [ ! "${DD_UBOOT}" ] ; then - if [ -f ${TEMPDIR}/dl/${UBOOT} ]; then - if echo ${UBOOT} | grep img > /dev/null 2>&1;then - cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.img - cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/cus/u-boot.img - else - cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.bin - cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/cus/u-boot.bin - fi - fi - fi + if [ ! "${DD_UBOOT}" ] ; then + if [ -f ${TEMPDIR}/dl/${UBOOT} ]; then + if echo ${UBOOT} | grep img > /dev/null 2>&1;then + cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.img + cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/u-boot.img + else + cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.bin + cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/u-boot.bin + fi + fi + fi VMLINUZ="vmlinuz-*" UIMAGE="uImage.net" @@ -1197,7 +1196,7 @@ function populate_boot { cat ${TEMPDIR}/bootscripts/netinstall.cmd echo "-----------------------------" echo "Normal Boot Script:" - cp -v ${TEMPDIR}/bootscripts/normal.cmd ${TEMPDIR}/disk/cus/normal.txt + cp -v ${TEMPDIR}/bootscripts/normal.cmd ${TEMPDIR}/disk/backup/normal.txt echo "-----------------------------" cat ${TEMPDIR}/bootscripts/normal.cmd echo "-----------------------------" diff --git a/scripts/debian-finish.sh b/scripts/debian-finish.sh index 53bb458..a732dd2 100644 --- a/scripts/debian-finish.sh +++ b/scripts/debian-finish.sh @@ -6,7 +6,7 @@ if [ -f /etc/mtab ] ; then 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/debug/no_mtab + 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 @@ -21,10 +21,10 @@ rm -f /boot/uboot/initrd.net || true rm -f /boot/uboot/boot.scr || true rm -f /boot/uboot/uEnv.txt || true -if [ -f "/boot/uboot/cus/normal.txt" ] ; then - sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/cus/normal.txt - sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/cus/normal.txt - mv /boot/uboot/cus/normal.txt /boot/uboot/uEnv.txt +if [ -f "/boot/uboot/backup/normal.txt" ] ; then + sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/backup/normal.txt + sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/backup/normal.txt + mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt fi #Install Correct Kernel Image: @@ -39,5 +39,5 @@ cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img rm -f /boot/uboot/linux-image-*_1.0*_arm*.deb || true #Debug: -mount > /boot/uboot/debug/mount.log +mount > /boot/uboot/backup/mount.log diff --git a/scripts/debian-tweaks.diff b/scripts/debian-tweaks.diff index 56505c5..57563ab 100644 --- a/scripts/debian-tweaks.diff +++ b/scripts/debian-tweaks.diff @@ -22,19 +22,19 @@ index 0000000..6d06fc7 + cat /target/etc/inittab | grep SERIAL || echo "S:2345:respawn:/sbin/getty 115200 SERIAL" >> /target/etc/inittab + fi + -+ if [ -d /lib/firmware/ ] ; then -+ cp -r /lib/firmware/ /target/lib/ || true -+ fi ++ if [ -d /lib/firmware/ ] ; then ++ cp -r /lib/firmware/ /target/lib/ || true ++ fi + + rm -f /etc/rcn.conf + -+ mount -o bind /sys /target/sys -+ cat /proc/mounts > /target/mounts -+ cat /proc/mounts > /target/boot/uboot/debug/proc_mounts -+ chroot /target /bin/bash /etc/finish-install.sh -+ rm -f /target/mounts || true -+ cat /var/log/syslog > /target/boot/uboot/debug/syslog.log -+ umount /target/sys ++ mount -o bind /sys /target/sys ++ cat /proc/mounts > /target/mounts ++ cat /proc/mounts > /target/boot/uboot/backup/proc_mounts ++ chroot /target /bin/bash /etc/finish-install.sh ++ rm -f /target/mounts || true ++ cat /var/log/syslog > /target/boot/uboot/backup/syslog.log ++ umount /target/sys + + sync + umount /target/boot/uboot diff --git a/scripts/ubuntu-finish.sh b/scripts/ubuntu-finish.sh index ec0264c..a844186 100644 --- a/scripts/ubuntu-finish.sh +++ b/scripts/ubuntu-finish.sh @@ -6,7 +6,7 @@ if [ -f /etc/mtab ] ; then 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/debug/no_mtab + 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 @@ -33,8 +33,8 @@ rm -f /boot/uboot/uEnv.txt.bak || true rm -f /boot/uboot/MLO || true rm -f /boot/uboot/MLO.bak || true -if [ -f /boot/uboot/cus/MLO ] ; then - mv /boot/uboot/cus/MLO /boot/uboot/MLO +if [ -f /boot/uboot/backup/MLO ] ; then + mv /boot/uboot/backup/MLO /boot/uboot/MLO fi #Restore, backup u-boot Bootloader? @@ -43,18 +43,18 @@ rm -f /boot/uboot/u-boot.bin.bak || true rm -f /boot/uboot/u-boot.img || true rm -f /boot/uboot/u-boot.img.bak || true -if [ -f /boot/uboot/cus/u-boot.img ] ; then - mv /boot/uboot/cus/u-boot.img /boot/uboot/u-boot.img +if [ -f /boot/uboot/backup/u-boot.img ] ; then + mv /boot/uboot/backup/u-boot.img /boot/uboot/u-boot.img fi -if [ -f /boot/uboot/cus/u-boot.bin ] ; then - mv /boot/uboot/cus/u-boot.bin /boot/uboot/u-boot.bin +if [ -f /boot/uboot/backup/u-boot.bin ] ; then + mv /boot/uboot/backup/u-boot.bin /boot/uboot/u-boot.bin fi -if [ -f "/boot/uboot/cus/normal.txt" ] ; then - sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/cus/normal.txt - sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/cus/normal.txt - mv /boot/uboot/cus/normal.txt /boot/uboot/uEnv.txt +if [ -f "/boot/uboot/backup/normal.txt" ] ; then + sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/backup/normal.txt + sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/backup/normal.txt + mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt fi #Cleanup: some of Ubuntu's packages: @@ -77,5 +77,5 @@ cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img rm -f /boot/uboot/linux-image-*_1.0*_arm*.deb || true #Debug: -mount > /boot/uboot/debug/mount.log +mount > /boot/uboot/backup/mount.log diff --git a/scripts/ubuntu-tweaks.diff b/scripts/ubuntu-tweaks.diff index 8cd480b..1e9a242 100644 --- a/scripts/ubuntu-tweaks.diff +++ b/scripts/ubuntu-tweaks.diff @@ -19,19 +19,19 @@ index 0000000..6d06fc7 + #smsc95xx kevent workaround/hack + echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf + -+ if [ -d /lib/firmware/ ] ; then -+ cp -r /lib/firmware/ /target/lib/ || true -+ fi ++ if [ -d /lib/firmware/ ] ; then ++ cp -r /lib/firmware/ /target/lib/ || true ++ fi + + rm -f /etc/rcn.conf + -+ mount -o bind /sys /target/sys -+ cat /proc/mounts > /target/mounts -+ cat /proc/mounts > /target/boot/uboot/debug/proc_mounts -+ chroot /target /bin/bash /etc/finish-install.sh -+ rm -f /target/mounts || true -+ cat /var/log/syslog > /target/boot/uboot/debug/syslog.log -+ umount /target/sys ++ mount -o bind /sys /target/sys ++ cat /proc/mounts > /target/mounts ++ cat /proc/mounts > /target/boot/uboot/backup/proc_mounts ++ chroot /target /bin/bash /etc/finish-install.sh ++ rm -f /target/mounts || true ++ cat /var/log/syslog > /target/boot/uboot/backup/syslog.log ++ umount /target/sys + + sync + umount /target/boot/uboot