diff --git a/mk_mmc.sh b/mk_mmc.sh index 002c026..3a3cba0 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -999,21 +999,52 @@ function initrd_cleanup { rm -rf ${TEMPDIR}/initrd-tree/lib/firmware/*-versatile/ || true } +function finish_installing_device { + cat > ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device <<-__EOF__ + #!/bin/sh -e + 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 /target/boot/uboot || true + mount /dev/mmcblk0p1 /target/boot/uboot + + if [ -d /lib/firmware/ ] ; then + cp -rf /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/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 + fi + + __EOF__ + + chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device +} + function initrd_preseed_settings { echo "NetInstall: Adding Distro Tweaks and Preseed Configuration" cd ${TEMPDIR}/initrd-tree/ case "${DIST}" in maverick|natty|oneiric|precise|quantal) - patch -p1 < "${DIR}/scripts/ubuntu-tweaks.diff" cp -v "${DIR}/scripts/ubuntu-finish.sh" ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; squeeze|wheezy) - patch -p1 < "${DIR}/scripts/debian-tweaks.diff" cp -v "${DIR}/scripts/debian-finish.sh" ${TEMPDIR}/initrd-tree/etc/finish-install.sh ;; esac - chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-ee-finish-installing-device + finish_installing_device cp -v "${DIR}/scripts/${DIST}-preseed.cfg" ${TEMPDIR}/initrd-tree/preseed.cfg if [ "${SERIAL_MODE}" ] ; then diff --git a/scripts/debian-tweaks.diff b/scripts/debian-tweaks.diff deleted file mode 100644 index 9273e82..0000000 --- a/scripts/debian-tweaks.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/usr/lib/finish-install.d/08rcn-ee-finish-installing-device b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -new file mode 100755 -index 0000000..6d06fc7 ---- /dev/null -+++ b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -@@ -0,0 +1,26 @@ -+#!/bin/sh -e -+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 /target/boot/uboot -+ mount /dev/mmcblk0p1 /target/boot/uboot -+ -+ if [ -d /lib/firmware/ ] ; then -+ cp -rf /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/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 -+fi -+ diff --git a/scripts/ubuntu-tweaks.diff b/scripts/ubuntu-tweaks.diff deleted file mode 100644 index 9273e82..0000000 --- a/scripts/ubuntu-tweaks.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/usr/lib/finish-install.d/08rcn-ee-finish-installing-device b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -new file mode 100755 -index 0000000..6d06fc7 ---- /dev/null -+++ b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -@@ -0,0 +1,26 @@ -+#!/bin/sh -e -+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 /target/boot/uboot -+ mount /dev/mmcblk0p1 /target/boot/uboot -+ -+ if [ -d /lib/firmware/ ] ; then -+ cp -rf /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/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 -+fi -+