diff --git a/mk_mmc.sh b/mk_mmc.sh index 3a32e47..3e22575 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -40,6 +40,7 @@ BOOT_LABEL=boot PARTITION_PREFIX="" MAVERICK_MD5SUM="12c0f04da6b8fb118939489f237e4c86" +NATTY_MD5SUM="6fa5569bae9fbd642d78ec417acc53b9" #SQUEEZE_NETIMAGE="current" SQUEEZE_NETIMAGE="20110106+b1" @@ -112,11 +113,9 @@ function set_defaults { fi if [ "$USB_ROOTFS" ];then - sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/dvi-normal-maverick.cmd - sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/dvi-normal-squeeze.cmd + sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/dvi-normal-*.cmd - sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/serial-normal-maverick.cmd - sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/serial-normal-squeeze.cmd + sed -i 's/mmcblk0p5/sda1/g' ${DIR}/scripts/serial-normal-*.cmd fi if [ "$PRINTK" ];then @@ -180,6 +179,10 @@ case "$DIST" in TEST_MD5SUM=$MAVERICK_MD5SUM HTTP_IMAGE="http://ports.ubuntu.com/ubuntu-ports/dists" ;; + natty) + TEST_MD5SUM=$NATTY_MD5SUM + HTTP_IMAGE="http://ports.ubuntu.com/ubuntu-ports/dists" + ;; squeeze) TEST_MD5SUM=$SQUEEZE_MD5SUM HTTP_IMAGE="http://ftp.debian.org/debian/dists" @@ -231,6 +234,23 @@ case "$DIST" in wget -c --directory-prefix=${DIR}/dl/${DIST} http://ports.ubuntu.com/pool/multiverse/l/linux-firmware-nonfree/${MAVERICK_NONF_FW} MAVERICK_NONF_FW=${MAVERICK_NONF_FW##*/} + #ar9170 + wget -c --directory-prefix=${DIR}/dl/${DIST} http://www.kernel.org/pub/linux/kernel/people/chr/carl9170/fw/1.9.2/carl9170-1.fw + AR9170_FW="carl9170-1.fw" + ;; + natty) + rm -f ${TEMPDIR}/dl/index.html || true + wget --directory-prefix=${TEMPDIR}/dl/ http://ports.ubuntu.com/pool/main/l/linux-firmware/ + NATTY_FW=$(cat ${TEMPDIR}/dl/index.html | grep 1.48 | grep linux-firmware | grep _all.deb | head -1 | awk -F"\"" '{print $8}') + wget -c --directory-prefix=${DIR}/dl/${DIST} http://ports.ubuntu.com/pool/main/l/linux-firmware/${NATTY_FW} + NATTY_FW=${NATTY_FW##*/} + + rm -f ${TEMPDIR}/dl/index.html || true + wget --directory-prefix=${TEMPDIR}/dl/ http://ports.ubuntu.com/pool/multiverse/l/linux-firmware-nonfree/ + NATTY_NONF_FW=$(cat ${TEMPDIR}/dl/index.html | grep 1.9 | grep linux-firmware-nonfree | grep _all.deb | head -1 | awk -F"\"" '{print $8}') + wget -c --directory-prefix=${DIR}/dl/${DIST} http://ports.ubuntu.com/pool/multiverse/l/linux-firmware-nonfree/${NATTY_NONF_FW} + NATTY_NONF_FW=${NATTYs_NONF_FW##*/} + #ar9170 wget -c --directory-prefix=${DIR}/dl/${DIST} http://www.kernel.org/pub/linux/kernel/people/chr/carl9170/fw/1.9.2/carl9170-1.fw AR9170_FW="carl9170-1.fw" @@ -301,6 +321,12 @@ case "$DIST" in sudo cp -v ${DIR}/dl/${DIST}/${AR9170_FW} ${TEMPDIR}/initrd-tree/lib/firmware/ sudo cp -vr ${DIR}/dl/linux-firmware/ti-connectivity ${TEMPDIR}/initrd-tree/lib/firmware/ ;; + natty) + sudo dpkg -x ${DIR}/dl/${DIST}/${NATTY_FW} ${TEMPDIR}/initrd-tree + sudo dpkg -x ${DIR}/dl/${DIST}/${NATTY_NONF_FW} ${TEMPDIR}/initrd-tree + sudo cp -v ${DIR}/dl/${DIST}/${AR9170_FW} ${TEMPDIR}/initrd-tree/lib/firmware/ + sudo cp -vr ${DIR}/dl/linux-firmware/ti-connectivity ${TEMPDIR}/initrd-tree/lib/firmware/ + ;; squeeze) #from: http://packages.debian.org/source/squeeze/firmware-nonfree sudo dpkg -x ${DIR}/dl/${DIST}/${ATMEL_FW} ${TEMPDIR}/initrd-tree @@ -392,6 +418,12 @@ case "$DIST" in sudo chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap sudo cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg ;; + natty) + sudo cp -v ${DIR}/scripts/flash-kernel.conf ${TEMPDIR}/initrd-tree/etc/flash-kernel.conf + sudo cp -v ${DIR}/scripts/ttyO2.conf ${TEMPDIR}/initrd-tree/etc/ttyO2.conf + sudo chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap + sudo cp -v ${DIR}/scripts/${DIST}-preseed.cfg ${TEMPDIR}/initrd-tree/preseed.cfg + ;; squeeze) sudo cp -v ${DIR}/scripts/e2fsck.conf ${TEMPDIR}/initrd-tree/etc/e2fsck.conf sudo chmod a+x ${TEMPDIR}/initrd-tree/usr/lib/finish-install.d/08rcn-omap @@ -809,11 +841,9 @@ echo "done" function reset_scripts { if [ "$USB_ROOTFS" ];then - sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/dvi-normal-maverick.cmd - sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/dvi-normal-squeeze.cmd + sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/dvi-normal-*.cmd - sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/serial-normal-maverick.cmd - sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/serial-normal-squeeze.cmd + sed -i 's/sda1/mmcblk0p5/g' ${DIR}/scripts/serial-normal-*.cmd fi if [ "$PRINTK" ];then @@ -917,6 +947,12 @@ function check_distro { unset IN_VALID_DISTRO fi + if test "-$DISTRO_TYPE-" = "-natty-" + then + DIST=natty + unset IN_VALID_DISTRO + fi + # if test "-$DISTRO_TYPE-" = "-sid-" # then # DIST=sid @@ -949,6 +985,7 @@ Required Options: squeeze Ubuntu maverick + natty Optional: --firmware diff --git a/scripts/dvi-normal-natty.cmd b/scripts/dvi-normal-natty.cmd new file mode 100644 index 0000000..53adfdd --- /dev/null +++ b/scripts/dvi-normal-natty.cmd @@ -0,0 +1,15 @@ +echo "Debug: Natty DVI" +if test "${beaglerev}" = "xMA"; then +echo "Kernel is not ready for 1Ghz limiting to 800Mhz" +setenv mpurate 800 +fi +if test "${beaglerev}" = "xMB"; then +echo "Kernel is not ready for 1Ghz limiting to 800Mhz" +setenv mpurate 800 +fi +setenv dvimode 1280x720MR-16@60 +setenv vram 12MB +setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80300000 0x81600000' +setenv bootargs console=ttyO2,115200n8 console=tty0 root=/dev/mmcblk0p5 ro vram=${vram} omapfb.mode=dvi:${dvimode} fixrtc buddy=${buddy} mpurate=${mpurate} +boot + diff --git a/scripts/maverick-tweaks.diff b/scripts/maverick-tweaks.diff index c917ee3..0754feb 100644 --- a/scripts/maverick-tweaks.diff +++ b/scripts/maverick-tweaks.diff @@ -3,7 +3,7 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,33 @@ +@@ -0,0 +1,35 @@ +#!/bin/sh -e +cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf +cp /etc/ttyO2.conf /target/etc/init/ttyO2.conf @@ -34,6 +34,8 @@ index 0000000..6d06fc7 + #smsc95xx kevent workaround/hack + echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf + ++ cp -ru /lib/firmware/ /target/lib/ ++ + rm -f /etc/rcn.conf +fi + diff --git a/scripts/natty-preseed.cfg b/scripts/natty-preseed.cfg new file mode 100644 index 0000000..78e8a45 --- /dev/null +++ b/scripts/natty-preseed.cfg @@ -0,0 +1,36 @@ +### Apt setup +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true + +# If you select ftp, the mirror/country string does not need to be set. +#d-i mirror/protocol string ftp +d-i mirror/country string manual +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 + +# Whether to upgrade packages after debootstrap. +# Allowed values: none, safe-upgrade, full-upgrade +d-i pkgsel/upgrade select safe-upgrade + +# Controls whether to use NTP to set the clock during the install +d-i clock-setup/ntp boolean true + +# During installations from serial console, the regular virtual consoles +# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next +# line to prevent this. +d-i finish-install/keep-consoles boolean true + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This command is run just before the install finishes, but when there is +# still a usable /target directory. You can chroot to /target and use it +# directly, or use the apt-install and in-target commands to easily install +# packages and run commands in the target system. +d-i preseed/late_command \ +string apt-install parted; in-target /sbin/parted /dev/mmcblk0 set 1 boot on ; + diff --git a/scripts/natty-tweaks.diff b/scripts/natty-tweaks.diff new file mode 100644 index 0000000..0754feb --- /dev/null +++ b/scripts/natty-tweaks.diff @@ -0,0 +1,41 @@ +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,35 @@ ++#!/bin/sh -e ++cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf ++cp /etc/ttyO2.conf /target/etc/init/ttyO2.conf ++ ++if [ -e /etc/rcn.conf ]; then ++ mkdir -p /tmp/mmc ++ mount /dev/mmcblk0p1 /tmp/mmc ++ rm -f /tmp/mmc/boot.scr || true ++ mv /tmp/mmc/user.scr /tmp/mmc/boot.scr ++ rm -f /tmp/mmc/uInitrd.net || true ++ ++ #Thank You Ubuntu; arrrggg!!! ++ 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 ++ ++ mv /tmp/mmc/uInitrd.end /tmp/mmc/uInitrd ++ mv /tmp/mmc/uImage.net /tmp/mmc/uImage ++ 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 ++ sync ++ umount /tmp/mmc ++ ++ 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 -ru /lib/firmware/ /target/lib/ ++ ++ rm -f /etc/rcn.conf ++fi ++ diff --git a/scripts/serial-normal-natty.cmd b/scripts/serial-normal-natty.cmd new file mode 100644 index 0000000..5f61dcf --- /dev/null +++ b/scripts/serial-normal-natty.cmd @@ -0,0 +1,13 @@ +echo "Debug: Natty Serial" +if test "${beaglerev}" = "xMA"; then +echo "Kernel is not ready for 1Ghz limiting to 800Mhz" +setenv mpurate 800 +fi +if test "${beaglerev}" = "xMB"; then +echo "Kernel is not ready for 1Ghz limiting to 800Mhz" +setenv mpurate 800 +fi +setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80300000 0x81600000' +setenv bootargs console=ttyO2,115200n8 root=/dev/mmcblk0p5 ro fixrtc buddy=${buddy} mpurate=${mpurate} +boot + diff --git a/scripts/squeeze-tweaks.diff b/scripts/squeeze-tweaks.diff index fdb1b4c..4f8136c 100644 --- a/scripts/squeeze-tweaks.diff +++ b/scripts/squeeze-tweaks.diff @@ -3,7 +3,7 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-omap -@@ -0,0 +1,27 @@ +@@ -0,0 +1,29 @@ +#!/bin/sh -e +cp /etc/e2fsck.conf /target/etc/e2fsck.conf + @@ -28,6 +28,8 @@ index 0000000..6d06fc7 + + cat /target/etc/inittab | grep ttyO2 || echo "S:2345:respawn:/sbin/getty 115200 ttyO2" >> /target/etc/inittab + ++ cp -ru /lib/firmware/ /target/lib/ ++ + rm -f /etc/rcn.conf +fi +