diff --git a/mk_mmc.sh b/mk_mmc.sh index da829bb..ac650bf 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -808,11 +808,6 @@ function setup_bootscripts { mkdir -p ${TEMPDIR}/bootscripts/ boot_uenv_txt_template tweak_boot_scripts - - if [ "$SMSC95XX_MOREMEM" ] ; then - sed -i 's/8192/16384/g' "${DIR}/scripts/ubuntu-tweaks.diff" - sed -i 's/8192/16384/g' "${DIR}/scripts/debian-tweaks.diff" - fi } function extract_base_initrd { @@ -974,10 +969,8 @@ function initrd_fixes { #work around for the kevent smsc95xx issue touch ${TEMPDIR}/initrd-tree/etc/sysctl.conf - if [ "$SMSC95XX_MOREMEM" ];then - echo "vm.min_free_kbytes = 16384" >> ${TEMPDIR}/initrd-tree/etc/sysctl.conf - else - echo "vm.min_free_kbytes = 8192" >> ${TEMPDIR}/initrd-tree/etc/sysctl.conf + if [ "${smsc95xx_mem}" ];then + echo "vm.min_free_kbytes = ${smsc95xx_mem}" >> ${TEMPDIR}/initrd-tree/etc/sysctl.conf fi } @@ -1245,6 +1238,7 @@ function populate_boot { load_addr=${load_addr} dtb_addr=${dtb_addr} dtb_file=${dtb_file} + smsc95xx_mem=${smsc95xx_mem} __EOF__ @@ -1282,13 +1276,6 @@ function populate_boot { echo "-----------------------------" } -function reset_scripts { - if [ "${SMSC95XX_MOREMEM}" ] ; then - sed -i 's/16384/8192/g' "${DIR}/scripts/ubuntu-tweaks.diff" - sed -i 's/16384/8192/g' "${DIR}/scripts/debian-tweaks.diff" - fi -} - function check_mmc { FDISK=$(LC_ALL=C fdisk -l 2>/dev/null | grep "Disk ${MMC}" | awk '{print $2}') @@ -1353,6 +1340,7 @@ function is_omap { KMS_VIDEO_RESOLUTION="1280x720" KMS_VIDEOA="video=DVI-D-1" unset KMS_VIDEOB + smsc95xx_mem="8192" } function is_imx { @@ -1379,7 +1367,6 @@ function is_imx { function check_uboot_type { unset IN_VALID_UBOOT - unset SMSC95XX_MOREMEM unset USE_UIMAGE unset USE_KMS unset dtb_file @@ -1391,6 +1378,7 @@ function check_uboot_type { KERNEL_SEL="STABLE" boot="bootz" unset boot_scr_wrapper + unset smsc95xx_mem case "${UBOOT_TYPE}" in beagle_bx) @@ -1474,31 +1462,31 @@ function check_uboot_type { panda) SYSTEM="panda" BOOTLOADER="PANDABOARD" - SMSC95XX_MOREMEM=1 is_omap #dtb_file="omap4-panda.dtb" VIDEO_OMAP_RAM="16MB" KMS_VIDEOB="video=HDMI-A-1" + smsc95xx_mem="16384" ;; panda_es) SYSTEM="panda_es" BOOTLOADER="PANDABOARD_ES" - SMSC95XX_MOREMEM=1 is_omap #dtb_file="omap4-panda.dtb" VIDEO_OMAP_RAM="16MB" KMS_VIDEOB="video=HDMI-A-1" + smsc95xx_mem="16384" ;; panda_kms) SYSTEM="panda_es" BOOTLOADER="PANDABOARD_ES" - SMSC95XX_MOREMEM=1 is_omap #dtb_file="omap4-panda.dtb" USE_KMS=1 unset HAS_OMAPFB_DSS2 KMS_VIDEOB="video=HDMI-A-1" + smsc95xx_mem="16384" KERNEL_SEL="TESTING" ;; @@ -1863,12 +1851,12 @@ if [ -n "${ADDON}" ] ; then fi fi - echo "" - echo "Script Version git: ${GIT_VERSION}" - echo "-----------------------------" +echo "" +echo "Script Version git: ${GIT_VERSION}" +echo "-----------------------------" - check_root - detect_software +check_root +detect_software if [ "${spl_name}" ] || [ "${boot_name}" ]; then if [ "${USE_LOCAL_BOOT}" ] ; then @@ -1878,16 +1866,15 @@ if [ "${spl_name}" ] || [ "${boot_name}" ]; then fi fi - dl_kernel_image - dl_netinstall_image +dl_kernel_image +dl_netinstall_image dl_device_firmware - setup_bootscripts - create_custom_netinstall_image +setup_bootscripts +create_custom_netinstall_image - unmount_all_drive_partitions - create_partitions - populate_boot - reset_scripts +unmount_all_drive_partitions +create_partitions +populate_boot diff --git a/scripts/debian-finish.sh b/scripts/debian-finish.sh index fc4fa53..c47b06c 100644 --- a/scripts/debian-finish.sh +++ b/scripts/debian-finish.sh @@ -55,3 +55,8 @@ if [ "x${boot_fstype}" == "xext2" ] ; then else echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /etc/fstab fi + +if [ "x${smsc95xx_mem}" != "x" ] ; then + echo "vm.min_free_kbytes = ${smsc95xx_mem}" >> /etc/sysctl.conf +fi + diff --git a/scripts/debian-tweaks.diff b/scripts/debian-tweaks.diff index b636941..48c869d 100644 --- a/scripts/debian-tweaks.diff +++ b/scripts/debian-tweaks.diff @@ -3,7 +3,7 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -@@ -0,0 +1,30 @@ +@@ -0,0 +1,27 @@ +#!/bin/sh -e +cp /etc/e2fsck.conf /target/etc/e2fsck.conf +cp /etc/finish-install.sh /target/etc/finish-install.sh @@ -13,9 +13,6 @@ index 0000000..6d06fc7 + mkdir -p /target/boot/uboot + mount /dev/mmcblk0p1 /target/boot/uboot + -+ #smsc95xx kevent workaround/hack -+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf -+ + if [ -d /lib/firmware/ ] ; then + cp -rf /lib/firmware/ /target/lib/ || true + fi diff --git a/scripts/ubuntu-finish.sh b/scripts/ubuntu-finish.sh index 09f6ba9..d7c02d6 100644 --- a/scripts/ubuntu-finish.sh +++ b/scripts/ubuntu-finish.sh @@ -106,3 +106,8 @@ if [ "x${boot_fstype}" == "xext2" ] ; then else echo "/dev/mmcblk0p1 /boot/uboot auto defaults 0 0" >> /etc/fstab fi + +if [ "x${smsc95xx_mem}" != "x" ] ; then + echo "vm.min_free_kbytes = ${smsc95xx_mem}" >> /etc/sysctl.conf +fi + diff --git a/scripts/ubuntu-tweaks.diff b/scripts/ubuntu-tweaks.diff index 4e57dc2..4ab4ffc 100644 --- a/scripts/ubuntu-tweaks.diff +++ b/scripts/ubuntu-tweaks.diff @@ -3,7 +3,7 @@ new file mode 100755 index 0000000..6d06fc7 --- /dev/null +++ b/usr/lib/finish-install.d/08rcn-ee-finish-installing-device -@@ -0,0 +1,30 @@ +@@ -0,0 +1,27 @@ +#!/bin/sh -e +cp /etc/flash-kernel.conf /target/etc/flash-kernel.conf +cp /etc/finish-install.sh /target/etc/finish-install.sh @@ -13,9 +13,6 @@ index 0000000..6d06fc7 + mkdir -p /target/boot/uboot + mount /dev/mmcblk0p1 /target/boot/uboot + -+ #smsc95xx kevent workaround/hack -+ echo "vm.min_free_kbytes = 8192" >> /target/etc/sysctl.conf -+ + if [ -d /lib/firmware/ ] ; then + cp -rf /lib/firmware/ /target/lib/ || true + fi