SHARE
TWEET

Untitled

a guest Jun 12th, 2017 291 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2. #OrangePiH5_PC2
  3. your_path=/tmp/tmp
  4.  
  5. #rm -Rf ${your_path}/orangepi-3.10.y ${your_path}/kernel;
  6. cp -dpR orangepi_h5sdk-2000/kernel/ ${your_path}/;
  7. mv ${your_path}/kernel ${your_path}/orangepi-3.10.y;
  8. cd ${your_path}/orangepi-3.10.y;
  9. if [ \! -d ${your_path}/orangepi-3.10.y ]; then echo "${your_path}/orangepi-3.10.y..."; exit -1; fi;
  10.  
  11. sed -r -i "s/^#define (SUPPORTED_ARCH) 1/#undef \1/" samples/seccomp/bpf-direct.c
  12. (make ARCH=arm64 CROSS_COMPILE=aarch64-pc-linux-gnueabihf- -j 8 OrangePiH5_PC2_linux_defconfig)
  13. for f in CONFIG_SQUASHFS CONFIG_COMPAT CONFIG_CPU_IDLE; do sed -r -i "s/^[#] ($f) is not set/\1=y/" .config;done;
  14. for f in CONFIG_RTL8188EU CONFIG_RTL8189ES CONFIG_RTL8723BS CONFIG_RTL8192EU CONFIG_RTL8723BU; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  15. for f in CONFIG_SECCOMP; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  16.  
  17. #CONFIG_EFI
  18.  
  19.  
  20. s_vers0="3.10";s_vers3=3.10.0;s_versp="3.10.0";verso="";
  21.  
  22. if true; then
  23.   for f in CONFIG_USB_USBNET CONFIG_USB_NET_AX8817X CONFIG_USB_RTL8150 CONFIG_KERNEL_XZ CONFIG_DVB_CORE; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=y/" .config;done;
  24.   for f in CONFIG_DEVTMPFS_MOUNT CONFIG_EXT4_FS_POSIX_ACL CONFIG_FS_POSIX_ACL CONFIG_TMPFS_POSIX_ACL CONFIG_TMPFS_XATTR; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  25.   for f in CONFIG_NFS_V3_ACL CONFIG_NFS_ACL_SUPPORT CONFIG_GENERIC_ACL CONFIG_ISCSI_BOOT_SYSFS; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  26.   for f in CONFIG_CGROUPS CONFIG_USB_NET_QF9700 CONFIG_USB_NET_DM9601 CONFIG_USB_NET_SMSC75XX CONFIG_USB_NET_SMSC95XX CONFIG_USB_NET_MCS7830 CONFIG_NFS_V4; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  27.   for f in CONFIG_USB_STORAGE_REALTEK CONFIG_USB_STORAGE_DATAFAB CONFIG_USB_STORAGE_FREECOM CONFIG_USB_STORAGE_ISD200 CONFIG_USB_STORAGE_USBAT; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  28.   for f in CONFIG_USB_STORAGE_SDDR09 CONFIG_USB_STORAGE_SDDR55 CONFIG_USB_STORAGE_JUMPSHOT CONFIG_USB_STORAGE_ALAUDA CONFIG_USB_STORAGE_ONETOUCH CONFIG_USB_STORAGE_KARMA; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  29.   for f in CONFIG_BLK_DEV_RAM CONFIG_BLK_DEV_LOOP CONFIG_DEVPTS_MULTIPLE_INSTANCES CONFIG_NFSD CONFIG_NFS_USE_LEGACY_DNS CONFIG_LEGACY_PTYS; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=y/" .config;done;
  30.   for f in CONFIG_BLK_DEV_NBD CONFIG_XFS_FS CONFIG_BONDING CONFIG_BRIDGE_NETFILTER CONFIG_SUNRPC_GSS CONFIG_CRYPTO_CTS CONFIG_BRIDGE_NF_EBTABLES CONFIG_BT_RFCOMM; do sed -r -i "s/^[#] ($f) is not set/\1=m/" .config;done;
  31.   for f in CONFIG_TUN CONFIG_BINFMT_MISC CONFIG_BT CONFIG_BLK_DEV_CRYPTOLOOP CONFIG_IR_NEC_DECODER CONFIG_IR_RC5_DECODER CONFIG_IR_RC6_DECODER; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=m/" .config;done;
  32.   for f in CONFIG_IR_JVC_DECODER CONFIG_IR_SONY_DECODER CONFIG_IR_RC5_SZ_DECODER CONFIG_IR_SANYO_DECODER CONFIG_IR_MCE_KBD_DECODER CONFIG_IR_LIRC_CODEC; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=m/" .config;done;
  33.   for f in CONFIG_EXT4_USE_FOR_EXT23 EXT4_FS_SECURITY CONFIG_EXT4_ENCRYPTION CONFIG_EXT4_DEBUG CONFIG_EXT4_FS_XATTR CONFIG_EXT4_FS_SECURITY CONFIG_GFS2_FS CONFIG_LDM_PARTITION; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  34.   for f in CONFIG_MAC_PARTITION CONFIG_REISERFS_FS CONFIG_AUTOFS4_FS CONFIG_BLK_DEV_BSGLIB BLK_DEV_CRYPTOLOOP CONFIG_NFS_USE_KERNEL_DNS; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  35.   for f in CONFIG_HID_APPLE CONFIG_HID_BELKIN CONFIG_HID_CHERRY CONFIG_HID_CHICONY  CONFIG_HID_CYPRESS CONFIG_HID_DRAGONRISE CONFIG_HID_EZKEY CONFIG_HID_KENSINGTON CONFIG_HID_KYE; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  36.   for f in CONFIG_KERNEL_GZIP CONFIG_SCSI_ISCSI_ATTRS CONFIG_ISCSI_TCP CONFIG_USB_ETH_RNDIS CONFIG_USB_G_MULTI_RNDIS CONFIG_DEFAULT_CFQ CONFIG_DRAGONRISE_FF; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  37.   for f in CONFIG_SND_DYNAMIC_MINORS CONFIG_CUSE CONFIG_SENSORS_AFA750 CONFIG_SENSORS_KIONIX CONFIG_SENSORS_LIS3DE_ACC CONFIG_SENSORS_LIS3DH_ACC; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  38.   for f in CONFIG_SENSORS_MMA7660 CONFIG_SENSORS_MMA8452 CONFIG_SENSORS_MMA865x CONFIG_SENSORS_PMBUS CONFIG_USB_STORAGE_CYPRESS_ATACB CONFIG_CRAMFS; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  39.   for f in CONFIG_USB_STORAGE_ENE_UB6250 CONFIG_IOSCHED_NOOP CONFIG_RC_MAP CONFIG_RTL8187 CONFIG_DNS_RESOLVER CONFIG_EXT2_FS_XATTR; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  40.   for f in CONFIG_EXT2_FS CONFIG_EXT3_FS; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=y/" .config;done;sed -r -i "/^CONFIG_INITRAMFS/ D;" .config;sed -r -i "/^CONFIG_SENSORS_/ D;" .config;
  41.   for f in CONFIG_IP_NF_FILTER CONFIG_IP_NF_IPTABLES CONFIG_NF_CONNTRACK CONFIG_NF_NAT CONFIG_NETFILTER_NETLINK CONFIG_NETFILTER_NETLINK_LOG CONFIG_NF_CONNTRACK_IPV4; do sed -r -i "s/^($f)=[ym]/\1=y/" .config;done;
  42.   for f in CONFIG_JBD CONFIG_UHID CONFIG_IP6_NF_FILTER CONFIG_FUSE_FS CONFIG_INPUT_UINPUT CONFIG_BRIDGE CONFIG_VLAN_8021Q; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=m/" .config;done;
  43.   for f in CONFIG_ANDROID_BINDER_IPC CONFIG_ANDROID_LOGGER; do sed -r -i "s/^($f)=[ym]/# \1 is not set/" .config;done;
  44.   echo -e >>.config "# CONFIG_EXT3_FS_XATTR is not set\n# CONFIG_EXT4_FS_XATTR is not set\nCONFIG_USB_ETH=m\n# CONFIG_USB_ETH_EEM is not set\nCONFIG_USB_CDC_COMPOSITE=m\nCONFIG_USB_G_MULTI=m\n# CONFIG_USB_ETH_RNDIS is not set";
  45.   echo -e >>.config "# CONFIG_USB_G_MULTI_RNDIS is not set\nCONFIG_IR_SUNXI=m\nCONFIG_IOSCHED_BFQ=y\nCONFIG_SENSORS_MAX1668=y\n# CONFIG_FW_LOADER_USER_HELPER is not set\nCONFIG_NF_CONNTRACK_RTSP=y\nCONFIG_NF_NAT_RTSP=y";
  46.   echo -e >>.config "CONFIG_IOSCHED_DEADLINE=y\nCONFIG_IOSCHED_CFQ=y\nCONFIG_DEFAULT_BFQ=y\nCONFIG_CC_OPTIMIZE_FOR_SIZE=y\nCONFIG_NFSD_V3=y";sed -r -i "s/^(CONFIG_DEFAULT_IOSCHED=\")([a-z0-9-]+)(\")$/\1bfq\3/" .config;
  47.   echo -e >>.config "CONFIG_DVB_NET=y\nCONFIG_DVB_USB=m"
  48.   echo -ne >>.config "# CONFIG_MEDIA_TUNER_SIMPLE is not set\n# CONFIG_MEDIA_TUNER_TDA8290 is not set\n# CONFIG_MEDIA_TUNER_TDA827X is not set\n# CONFIG_MEDIA_TUNER_TDA18271 is not set\n# CONFIG_MEDIA_TUNER_TDA9887 is not set\n"
  49.   echo -ne >>.config "# CONFIG_MEDIA_TUNER_TEA5761 is not set\n# CONFIG_MEDIA_TUNER_TEA5767 is not set\n# CONFIG_MEDIA_TUNER_MT20XX is not set\n# CONFIG_MEDIA_TUNER_MT2060 is not set\n# CONFIG_MEDIA_TUNER_MT2063 is not set\n"
  50.   echo -ne >>.config "# CONFIG_MEDIA_TUNER_MT2266 is not set\n# CONFIG_MEDIA_TUNER_MT2131 is not set\n# CONFIG_MEDIA_TUNER_QT1010 is not set\n# CONFIG_MEDIA_TUNER_XC2028 is not set\n# CONFIG_MEDIA_TUNER_XC5000 is not set\n"
  51.   echo -ne >>.config "# CONFIG_MEDIA_TUNER_XC4000 is not set\n# CONFIG_MEDIA_TUNER_MXL5005S is not set\n# CONFIG_MEDIA_TUNER_MXL5007T is not set\n# CONFIG_MEDIA_TUNER_MC44S803 is not set\n# CONFIG_MEDIA_TUNER_MAX2165 is not set\n"
  52.   echo -ne >>.config "# CONFIG_MEDIA_TUNER_TDA18218 is not set\n# CONFIG_MEDIA_TUNER_TDA18212 is not set\n"
  53.   echo -ne >>.config "# CONFIG_DVB_STB0899 is not set\n# CONFIG_DVB_STB6100 is not set\n# CONFIG_DVB_STV090x is not set\n# CONFIG_DVB_STV6110x is not set\n# CONFIG_DVB_DRXK is not set\n# CONFIG_DVB_TDA18271C2DD is not set\n"
  54.   echo -ne >>.config "# CONFIG_DVB_CX24110 is not set\n# CONFIG_DVB_CX24123 is not set\n# CONFIG_DVB_MT312 is not set\n# CONFIG_DVB_ZL10036 is not set\n# CONFIG_DVB_ZL10039 is not set\n# CONFIG_DVB_S5H1420 is not set\n"
  55.   echo -ne >>.config "# CONFIG_DVB_STV0288 is not set\n# CONFIG_DVB_STB6000 is not set\n# CONFIG_DVB_STV0299 is not set\n# CONFIG_DVB_STV6110 is not set\n# CONFIG_DVB_STV0900 is not set\n# CONFIG_DVB_TDA8083 is not set\n"
  56.   echo -ne >>.config "# CONFIG_DVB_TDA10086 is not set\n# CONFIG_DVB_TDA8261 is not set\n# CONFIG_DVB_VES1X93 is not set\n# CONFIG_DVB_TUNER_ITD1000 is not set\n# CONFIG_DVB_TUNER_CX24113 is not set\n# CONFIG_DVB_TDA826X is not set\n"
  57.   echo -ne >>.config "# CONFIG_DVB_TUA6100 is not set\n# CONFIG_DVB_CX24116 is not set\n# CONFIG_DVB_M88DS3103 is not set\n# CONFIG_DVB_SI21XX is not set\n# CONFIG_DVB_DS3000 is not set\n# CONFIG_DVB_MB86A16 is not set\n"
  58.   echo -ne >>.config "# CONFIG_DVB_TDA10071 is not set\n# CONFIG_DVB_SP8870 is not set\n# CONFIG_DVB_SP887X is not set\n# CONFIG_DVB_CX22700 is not set\n# CONFIG_DVB_CX22702 is not set\n# CONFIG_DVB_S5H1432 is not set\n"
  59.   echo -ne >>.config "# CONFIG_DVB_DRXD is not set\n# CONFIG_DVB_L64781 is not set\n# CONFIG_DVB_TDA1004X is not set\n# CONFIG_DVB_NXT6000 is not set\n# CONFIG_DVB_MT352 is not set\n# CONFIG_DVB_ZL10353 is not set\n"
  60.   echo -ne >>.config "# CONFIG_DVB_DIB3000MB is not set\n# CONFIG_DVB_DIB3000MC is not set\n# CONFIG_DVB_DIB7000M is not set\n# CONFIG_DVB_DIB7000P is not set\n# CONFIG_DVB_DIB9000 is not set\n# CONFIG_DVB_TDA10048 is not set\n"
  61.   echo -ne >>.config "# CONFIG_DVB_AF9013 is not set\n# CONFIG_DVB_EC100 is not set\n# CONFIG_DVB_HD29L2 is not set\n# CONFIG_DVB_STV0367 is not set\n# CONFIG_DVB_CXD2820R is not set\n# CONFIG_DVB_RTL2830 is not set\n"
  62.   echo -ne >>.config "# CONFIG_DVB_VES1820 is not set\n# CONFIG_DVB_TDA10021 is not set\n# CONFIG_DVB_TDA10023 is not set\n# CONFIG_DVB_STV0297 is not set\n# CONFIG_DVB_NXT200X is not set\n# CONFIG_DVB_OR51211 is not set\n"
  63.   echo -ne >>.config "# CONFIG_DVB_OR51132 is not set\n# CONFIG_DVB_BCM3510 is not set\n# CONFIG_DVB_LGDT330X is not set\n# CONFIG_DVB_LGDT3305 is not set\n# CONFIG_DVB_S5H1409 is not set\n# CONFIG_DVB_S5H1411 is not set\n"
  64.   echo -ne >>.config "# CONFIG_DVB_S921 is not set\n# CONFIG_DVB_DIB8000 is not set\n# CONFIG_DVB_MB86A20S is not set\n# CONFIG_DVB_PLL is not set\n# CONFIG_DVB_TUNER_DIB0070 is not set\n# CONFIG_DVB_TUNER_DIB0090 is not set\n"
  65.   echo -ne >>.config "# CONFIG_DVB_LNBP21 is not set\n# CONFIG_DVB_LNBP22 is not set\n# CONFIG_DVB_ISL6405 is not set\n# CONFIG_DVB_ISL6421 is not set\n# CONFIG_DVB_ISL6423 is not set\n# CONFIG_DVB_A8293 is not set\n"
  66.   echo -ne >>.config "# CONFIG_DVB_LGS8GL5 is not set\n# CONFIG_DVB_LGS8GXX is not set\n# CONFIG_DVB_ATBM8830 is not set\n# CONFIG_DVB_TDA665x is not set\n# CONFIG_DVB_IX2505V is not set\n# CONFIG_DVB_IT913X_FE is not set\n"
  67.   echo -ne >>.config "# CONFIG_DVB_M88RS2000 is not set\n"
  68.   echo -ne >>.config "CONFIG_BRIDGE_EBT_BROUTE=m\nCONFIG_BRIDGE_EBT_IP6=m\nCONFIG_BRIDGE_EBT_STP=m\nCONFIG_BRIDGE_EBT_T_FILTER=m\nCONFIG_BRIDGE_EBT_VLAN=m\n"
  69.   sed -r -i "s/^(CONFIG_NLS_DEFAULT=\")([a-z0-9-]+)(\")$/\1iso8859-15\3/" .config;sed -r -i "s/^(CONFIG_UEVENT_HELPER_PATH=).*/\1\"\/sbin\/hotplug\"/" .config; echo -e >>.config "CONFIG_IR_RCMM_DECODER=m\nCONFIG_UNION_FS=m";
  70.   for f in CONFIG_BCMDHD_CONFIG_PATH CONFIG_BCMDHD_FW_PATH CONFIG_BCMDHD_NVRAM_PATH;do sed -r -i "s/^($f=)\"(.+)(\")$/\1y/" .config;done; echo -e >>.config "# CONFIG_BCMDHD_SDIO is not set";
  71. fi;   #gadget# echo -n 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role;insmod /lib/modules/$(uname -r)/kernel/drivers/usb/gadget/g_ether.ko;echo -n 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role;
  72. #for f in /dosq/download/cvs/OpenELEC-OPi2/packages/linux/patches/linux-*.patch; do cat "$f" | patch -p1 -N -s;done;find . -name "*.rej*";
  73. #for f in /dosq/download/cvs/OpenELEC-OPi2/projects/H3/patches/linux/linux-*.patch; do cat "$f"|patch -p1 -N -s;done;find . -name "*.rej*";
  74. sed -r -i "s/^(static u8 is_udc_enable = )0(;)/\11\2/" ./drivers/usb/sunxi_usb/udc/sunxi_udc.c;find . -name "*.rej*"; #http://igor2.repo.hu/tmp/opi_usb_gadget.txt
  75.  
  76. patch -p0 -N -s <<EOF
  77. --- Makefile.orig       2016-11-27 12:55:58.000000000 +0100
  78. +++ Makefile    2016-11-27 12:56:39.000000000 +0100
  79. @@ -194,6 +194,7 @@
  80.  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
  81.  ARCH           ?= \$(SUBARCH)
  82.  CROSS_COMPILE  ?= \$(CONFIG_CROSS_COMPILE:"%"=%)
  83. +INSTALL_MOD_PATH=/usr/local/aarch64-pc-linux-gnu
  84.  
  85.  # Architecture as present in compile.h
  86.  UTS_MACHINE    := \$(ARCH)
  87. EOF
  88.  
  89. #-fix
  90. #for f in CONFIG_BRIDGE CONFIG_VLAN_8021Q CONFIG_LLC CONFIG_STP; do sed -r -i "s/^(($f)=[ym]|[#] ($f) is not set)$/\3\2=y/" .config;done; #required if the modules are missing.
  91. #sed -r -i "s/^(SUBLEVEL = )[0-9]+/\1200/" Makefile
  92. #drivers/usb/gadget/Makefile
  93. patch -p0 -N -s <<EOF
  94. --- drivers/usb/gadget/Makefile 2016-11-24 02:07:15.000000000 +0100
  95. +++ drivers/usb/gadget/Makefile 2016-11-25 22:22:55.000000000 +0100
  96. @@ -51,14 +51,14 @@
  97.  #
  98.  g_zero-y                       := zero.o
  99.  g_audio-y                      := audio.o
  100. -g_ether-y                      := ether.o
  101. +#g_ether-y                     := ether.o
  102.  g_serial-y                     := serial.o
  103.  g_midi-y                       := gmidi.o
  104.  gadgetfs-y                     := inode.o
  105.  g_mass_storage-y               := mass_storage.o
  106.  g_printer-y                    := printer.o
  107. -g_cdc-y                                := cdc2.o
  108. -g_multi-y                      := multi.o
  109. +#g_cdc-y                               := cdc2.o
  110. +#g_multi-y                     := multi.o
  111.  g_hid-y                                := hid.o
  112.  g_dbgp-y                       := dbgp.o
  113.  g_nokia-y                      := nokia.o
  114. @@ -70,17 +70,17 @@
  115.  
  116.  obj-\$(CONFIG_USB_ZERO)                += g_zero.o
  117.  obj-\$(CONFIG_USB_AUDIO)               += g_audio.o
  118. -obj-\$(CONFIG_USB_ETH)         += g_ether.o
  119. +#obj-\$(CONFIG_USB_ETH)                += g_ether.o
  120.  obj-\$(CONFIG_USB_GADGETFS)    += gadgetfs.o
  121.  obj-\$(CONFIG_USB_FUNCTIONFS)  += g_ffs.o
  122.  obj-\$(CONFIG_USB_MASS_STORAGE)        += g_mass_storage.o
  123.  obj-\$(CONFIG_USB_G_SERIAL)    += g_serial.o
  124.  obj-\$(CONFIG_USB_G_PRINTER)   += g_printer.o
  125.  obj-\$(CONFIG_USB_MIDI_GADGET) += g_midi.o
  126. -obj-\$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o
  127. +#obj-\$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o
  128.  obj-\$(CONFIG_USB_G_HID)               += g_hid.o
  129.  obj-\$(CONFIG_USB_G_DBGP)      += g_dbgp.o
  130. -obj-\$(CONFIG_USB_G_MULTI)     += g_multi.o
  131. +#obj-\$(CONFIG_USB_G_MULTI)    += g_multi.o
  132.  obj-\$(CONFIG_USB_G_NOKIA)     += g_nokia.o
  133.  obj-\$(CONFIG_USB_G_WEBCAM)    += g_webcam.o
  134.  obj-\$(CONFIG_USB_G_NCM)               += g_ncm.o
  135. EOF
  136. #
  137. exit
  138. cd ${your_path}/orangepi-3.10.y;
  139. (make ARCH=arm64 CROSS_COMPILE=aarch64-pc-linux-gnueabihf- -j 8 menuconfig)
  140. (make ARCH=arm64 CROSS_COMPILE=aarch64-pc-linux-gnueabihf- -j 8 LOADADDR=0x40080000 Image modules dtbs)
  141. #--
  142. mkdir build;
  143. (make -C ${your_path}/orangepi-3.10.y/modules/gpu ARCH=arm64 CROSS_COMPILE=aarch64-pc-linux-gnueabihf- LICHEE_KDIR=${your_path}/orangepi-3.10.y LICHEE_MOD_DIR=${your_path}/orangepi-3.10.y/build LICHEE_PLATFORM=linux);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top