├── .gitattributes ├── README.md ├── builder ├── .config ├── .gitignore ├── Makefile ├── build-snappy.sh ├── common.mk ├── config │ └── s500 │ │ └── bubble_gum_sd │ │ ├── bootloader.ini │ │ └── config ├── gadget.mk ├── gadget │ ├── boot-assets │ │ └── cmdline.txt │ ├── meta │ │ ├── gadget.yaml │ │ ├── readme.md │ │ ├── roseapple-pi.png │ │ └── snap.yaml │ └── uboot.env.in ├── kernelsnap.mk ├── preloader │ ├── bootloader.bin │ └── bootloader.ini ├── roseapple-model.json ├── roseapple.model ├── scripts │ ├── bootsect.bin │ ├── build.sh │ ├── config.sh │ ├── fw_develop_kits.spec │ ├── fwimage_linux.cfg │ ├── gen_init_cpio │ ├── gen_initramfs_list.sh │ ├── linux_build_fw │ ├── padbootloader │ ├── partition_create.py │ ├── populate_dir │ ├── release_scripts │ │ ├── AD500A_android_exclude_files.txt │ │ ├── AD500A_android_release_boards_cfg.txt │ │ ├── AD500A_debian_exclude_files.txt │ │ ├── AD500A_debian_release_boards_cfg.txt │ │ ├── AD500A_ubuntu_exclude_files.txt │ │ ├── AD500A_ubuntu_release_boards_cfg.txt │ │ ├── release_packages_ad500a_android.sh │ │ ├── release_packages_ad500a_debian.sh │ │ └── release_packages_ad500a_ubuntu.sh │ └── root.mk ├── snappy.mk ├── tools │ ├── fw_maker │ │ ├── AllRelease │ │ │ ├── 26 │ │ │ │ ├── PyMaker.pyo │ │ │ │ └── UnComment.pyo │ │ │ ├── 27 │ │ │ │ ├── PyMaker.pyo │ │ │ │ └── UnComment.pyo │ │ │ ├── 10_32 │ │ │ │ └── CompoundFW │ │ │ └── 10_64 │ │ │ │ └── CompoundFW │ │ ├── maker_install.sh │ │ ├── readme.doc │ │ └── release_note.txt │ └── utils │ │ ├── bootloader_pack │ │ ├── bootloader_pack.arm │ │ ├── dtc │ │ ├── makebootfat │ │ └── mkimage └── u-boot.mk └── prebuild_download.md /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/.gitattributes -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SnappyUbuntuCore 2 | Develop Roseapple Pi to Snappy 16 [Snappy Ubuntu Core](http://developer.ubuntu.com/snappy/) 3 | 4 | ## Structure 5 | builder: build Snappy via makefiles, and that includes Gadget snap and Kernel snap. 6 | 7 | ## Requirements 8 | Make sure your build environment is based on `Ubuntu 16.04` or later. Then, you need to install snappy tools, for creating image. 9 | 10 | To build all parts, a couple of dependencies are required. On Ubuntu you can install all build dependencies with the following commands. 11 | 12 | ```bash 13 | sudo apt-get update 14 | sudo apt-get install -y build-essential u-boot-tools lzop debootstrap gcc-4.8-arm-linux-gnueabihf device-tree-compiler 15 | sudo apt-get install -y ubuntu-snappy snapcraft pxz 16 | sudo apt-get install -y snap 17 | sudo snap install --beta --classic ubuntu-image 18 | ``` 19 | 20 | ### Limitation 21 | xapp-le kernel can't be cross compiled by gcc 5+ arm-linux-gnueabihf, so you have to make soft link to gcc 4.8 related toolchain. 22 | 23 | Generate ssh key-pair if you did not have one 24 | 25 | ```bash 26 | ssh-keygen -t rsa 27 | ``` 28 | 29 | ## Quick Build 30 | 31 | Build an image by fetching essential snaps from Ubuntu store 32 | ```bash 33 | ./build-snappy.sh 34 | ``` 35 | 36 | ## Build from scratch 37 | A `Makefile` is provided to build Snappy, Gadget snap, U-Boot, Kernel snap from source. The sources will be cloned into local folders if not there already. 38 | 39 | To build it all, just run `make snappy`. This will produce a Snappy image, a gadget snap `roseapple-pi_x.y_all.snap` and a kernel snap `roseapple-pi-kernel_x.y.z.snap` for device part, which can be used to build your own Snappy image. 40 | 41 | ### Custom Image 42 | If you want to build the speical version with including the snap you'd like to install from ubuntu store, you can modify the snappy.mk to reach it. For example: 43 | 44 | ```bash 45 | sudo /snap/bin/ubuntu-image \ 46 | --channel $CHANNEL \ 47 | --image-size 4G \ 48 | --extra-snaps snapweb \ 49 | --extra-snaps bluez \ 50 | --extra-snaps modem-manager \ 51 | --extra-snaps network-manager \ 52 | --extra-snaps roseapple-pi_x.y_all.snap \ 53 | --extra-snaps roseapple-pi-kernel_x.y.z.snap \ 54 | -o uc16-roseapple-pi.img \ 55 | roseapple.model 56 | ``` 57 | 58 | ### Build U-boot 59 | 60 | ```bash 61 | make u-boot 62 | ``` 63 | 64 | ### Build Gadget snap 65 | 66 | ```bash 67 | make gadget 68 | ``` 69 | 70 | ### Build Kernel snap 71 | 72 | ```bash 73 | make kernelsnap 74 | ``` 75 | 76 | ### Rebuild a snappy 77 | To rebuild the snappy or other parts, just type `make clean` or `make clean-{prefix}`. The prefix will be u-boot, gadget, kernelsnap, etc. 78 | 79 | ## Flash to SD card 80 | Before dd, we suggest the SD card storage should be umounted to safely clean up. 81 | 82 | ```bash 83 | xzcat ${image} | pv | sudo dd of=/dev/${device} bs=32M ; sync 84 | ``` 85 | ## TroubleShooting 86 | Before snapcraft begins to compile the snap, it may pop up an error as below: 87 | ``` 88 | No valid credentials found. Have you run "snapcraft login"? 89 | ``` 90 | 91 | First, make sure you have Ubuntu One SSO and ability to get 2nd factor from Authenticator, then execute the following command: 92 | ```bash 93 | snapcraft login 94 | ``` 95 | -------------------------------------------------------------------------------- /builder/.config: -------------------------------------------------------------------------------- 1 | IC_NAME=s500 2 | BOARD_NAME=bubble_gum_sd 3 | -------------------------------------------------------------------------------- /builder/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | -------------------------------------------------------------------------------- /builder/Makefile: -------------------------------------------------------------------------------- 1 | BUILD_STEPS := u-boot gadget kernelsnap snappy 2 | 3 | all: build 4 | 5 | pre-u-boot: 6 | pre-linux: 7 | pre-gadget: build-u-boot 8 | pre-kernelsnap: 9 | pre-snappy: build-gadget build-kernelsnap 10 | 11 | define BUILD_STEPS_TEMPLATE 12 | build-$(1): pre-$(1) 13 | $$(MAKE) -f $(1).mk build 14 | clean-$(1): 15 | $$(MAKE) -f $(1).mk clean 16 | distclean-$(1): 17 | $$(MAKE) -f $(1).mk distclean 18 | .PHONY: pre-$(1) build-$(1) clean-$(1) distclean-$(1) 19 | endef 20 | 21 | $(foreach step,$(BUILD_STEPS),$(eval $(call BUILD_STEPS_TEMPLATE,$(step)))) 22 | 23 | build: $(addprefix build-,$(BUILD_STEPS)) 24 | 25 | clean: $(addprefix clean-,$(BUILD_STEPS)) 26 | 27 | distclean: $(addprefix distclean-,$(BUILD_STEPS)) 28 | 29 | u-boot: build-u-boot 30 | 31 | gadget: build-gadget 32 | 33 | kernelsnap: build-kernelsnap 34 | 35 | snappy: build-snappy 36 | 37 | .PHONY: all build clean distclean u-boot gadget kernelsnap snappy 38 | -------------------------------------------------------------------------------- /builder/build-snappy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | SNAPPY_IMAGE=uc16-roseapple-pi-`date +%Y%m%d`-0.img 3 | 4 | sudo /snap/bin/ubuntu-image -d -c stable \ 5 | --extra-snaps alsa-utils \ 6 | --image-size 3800M roseapple.model 7 | #sudo dd conv=notrunc if=./gadget/bootloader.bin of=${SNAPPY_IMAGE} seek=2097664 oflag=seek_bytes 8 | #sudo dd conv=notrunc if=./gadget/u-boot.bin of=${SNAPPY_IMAGE} seek=3145728 oflag=seek_bytes 9 | 10 | if [ -f roseapple-pi.img ]; then 11 | sudo mv roseapple-pi.img ${SNAPPY_IMAGE} 12 | sudo pxz -0 uc16-roseapple-pi-`date +%Y%m%d`-0.img 13 | fi 14 | -------------------------------------------------------------------------------- /builder/common.mk: -------------------------------------------------------------------------------- 1 | CPUS := $(shell getconf _NPROCESSORS_ONLN) 2 | 3 | include .config 4 | 5 | OUTPUT_DIR := $(PWD) 6 | SCRIPT_DIR := $(OUTPUT_DIR)/scripts 7 | TOOLS_DIR := $(OUTPUT_DIR)/tools 8 | PRELOAD_DIR := $(OUTPUT_DIR)/preloader 9 | CONFIG_DIR := $(OUTPUT_DIR)/config/$(IC_NAME)/$(BOARD_NAME) 10 | OEM_BOOT_DIR := $(OUTPUT_DIR)/gadget 11 | 12 | # VENDOR: toolchain from BSP ; DEB: toolchain from deb 13 | TOOLCHAIN := DEB 14 | 15 | ARCH := arm 16 | KERNEL_DTS := actduino_bubble_gum_sdboot_linux 17 | KERNEL_DEFCONFIG := actduino_bubble_gum_linux_defconfig 18 | UBOOT_DEFCONFIG := actduino_bubble_gum_v10_defconfig 19 | 20 | KERNEL_REPO := https://github.com/xapp-le/kernel.git 21 | KERNEL_BRANCH := Ubuntu-Snappy-Core 22 | KERNEL_SRC := $(PWD)/kernel 23 | KERNEL_MODULES := $(PWD)/kernel-build 24 | KERNEL_OUT := $(PWD)/kernel-build 25 | KERNEL_UIMAGE := $(KERNEL_OUT)/arch/arm/boot/zImage 26 | KERNEL_DTB := $(KERNEL_OUT)/arch/arm/boot/dts/$(KERNEL_DTS).dtb 27 | 28 | UBOOT_REPO := https://github.com/xapp-le/u-boot.git 29 | UBOOT_BRANCH := Ubuntu-Snappy-Core 30 | UBOOT_SRC := $(PWD)/u-boot 31 | UBOOT_OUT := $(PWD)/u-boot-build 32 | UBOOT_BIN := $(UBOOT_OUT)/u-boot-dtb.img 33 | UBOOT_CONF := $(OEM_BOOT_DIR)/uboot.conf 34 | 35 | UDF := $(TOOLS_DIR)/ubuntu-device-flash 36 | 37 | ifeq ($(TOOLCHAIN),VENDOR) 38 | CC := 39 | else 40 | CC := arm-linux-gnueabihf- 41 | endif 42 | -------------------------------------------------------------------------------- /builder/config/s500/bubble_gum_sd/bootloader.ini: -------------------------------------------------------------------------------- 1 | [version config] 2 | version = 1.1 3 | [bootdev] 4 | bootdev = 0x20 5 | [jtag config] 6 | jtag_pad = 0 7 | [serial config] 8 | uart_id = 2 9 | uart_pad = 9 10 | uart_baudrate = 0x1c200 11 | [pmu config] 12 | bus_id = 0x0 13 | bus_mfp = 0 14 | pmu_id = 0x3 15 | vddr_pmu_dcdc_cfg = 0x5 16 | [ddr config] 17 | ddr_clk = 0x24c 18 | ddr_cap = 0x0 19 | ddr_bits_width = 0x0 20 | rank = 0x0 21 | ddr_type = 0x0 22 | row_col = 0x0 23 | rdodt = 0x1 24 | wrodt = 0x1 25 | zpzq = 0xc 26 | scan=1 27 | 28 | -------------------------------------------------------------------------------- /builder/config/s500/bubble_gum_sd/config: -------------------------------------------------------------------------------- 1 | ARCH=arm 2 | KERNEL_DTS=actduino_bubble_gum_sdboot_linux 3 | KERNEL_DEFCONFIG=actduino_bubble_gum_linux_defconfig 4 | UBOOT_DEFCONFIG=actduino_bubble_gum_v10_defconfig 5 | 6 | MISC_IMAGE_SIZE=48 7 | 8 | -------------------------------------------------------------------------------- /builder/gadget.mk: -------------------------------------------------------------------------------- 1 | include common.mk 2 | 3 | OEM_UBOOT_BIN := gadget/u-boot.bin 4 | OEM_SNAP := $(OUTPUT_DIR)/roseapple-pi_16.04-*.snap 5 | 6 | # for preloader packaging 7 | ifneq "$(findstring ARM, $(shell grep -m 1 'model name.*: ARM' /proc/cpuinfo))" "" 8 | BOOTLOADER_PACK=bootloader_pack.arm 9 | else 10 | BOOTLOADER_PACK=bootloader_pack 11 | endif 12 | 13 | all: build 14 | 15 | clean: 16 | rm -f $(OEM_UBOOT_BIN) 17 | rm -f $(OEM_BOOT_DIR)/uboot.conf 18 | rm -f $(OEM_BOOT_DIR)/bootloader.bin 19 | rm -f $(OEM_BOOT_DIR)/uboot.env 20 | rm -f $(OEM_SNAP) 21 | distclean: clean 22 | 23 | u-boot: 24 | @if [ ! -f $(UBOOT_BIN) ] ; then echo "Build u-boot first."; exit 1; fi 25 | cp -f $(UBOOT_BIN) $(OEM_UBOOT_BIN) 26 | 27 | preload: 28 | cd $(TOOLS_DIR)/utils && ./$(BOOTLOADER_PACK) $(PRELOAD_DIR)/bootloader.bin $(PRELOAD_DIR)/bootloader.ini $(OEM_BOOT_DIR)/bootloader.bin 29 | mkenvimage -r -s 131072 -o $(OEM_BOOT_DIR)/uboot.env $(OEM_BOOT_DIR)/uboot.env.in 30 | @if [ ! -f $(UBOOT_CONF) ]; then cd $(OEM_BOOT_DIR) && ln -s uboot.env uboot.conf ; fi 31 | 32 | snappy: 33 | snapcraft snap gadget 34 | 35 | gadget: preload u-boot snappy 36 | 37 | build: gadget 38 | 39 | .PHONY: u-boot snappy gadget build 40 | -------------------------------------------------------------------------------- /builder/gadget/boot-assets/cmdline.txt: -------------------------------------------------------------------------------- 1 | # default kernel cmdline 2 | -------------------------------------------------------------------------------- /builder/gadget/meta/gadget.yaml: -------------------------------------------------------------------------------- 1 | device-tree: actduino_bubble_gum_sdboot_linux.dtb 2 | volumes: 3 | roseapple-pi: 4 | schema: mbr 5 | bootloader: u-boot 6 | structure: 7 | - name: bootloader 8 | size: 6M 9 | offset: 2M 10 | content: 11 | - image: bootloader.bin 12 | offset: 512 #4097*512=(4097-4096)*512 13 | - image: u-boot.bin 14 | offset: 1048576 #6144*512=(6144-4096)*512 15 | type: bare 16 | - name: system-boot 17 | type: 0C 18 | filesystem: vfat 19 | filesystem-label: system-boot 20 | offset: 8388608 21 | size: 128M 22 | content: 23 | - source: boot-assets/ 24 | target: / 25 | -------------------------------------------------------------------------------- /builder/gadget/meta/readme.md: -------------------------------------------------------------------------------- 1 | Roseapple-pi support package 2 | -------------------------------------------------------------------------------- /builder/gadget/meta/roseapple-pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/gadget/meta/roseapple-pi.png -------------------------------------------------------------------------------- /builder/gadget/meta/snap.yaml: -------------------------------------------------------------------------------- 1 | name: roseapple-pi 2 | version: 16.04-1.5 3 | summary: Roseapple Pi support package 4 | description: | 5 | Support files for booting Roseapple Pi 6 | type: gadget 7 | architectures: 8 | - armhf 9 | -------------------------------------------------------------------------------- /builder/gadget/uboot.env.in: -------------------------------------------------------------------------------- 1 | arch=arm 2 | board=roseapplepi 3 | cpu=armv7 4 | soc=s500 5 | vendor=actions 6 | os_type=linux 7 | initrd_high=0xffffffff 8 | fdt_high=0xffffffff 9 | mmcdev=0 10 | mmcpart=1 11 | bootpart=0:1 12 | kernel_addr=0x00008000 13 | initrd_addr=0x01ffffc0 14 | fdt_addr=0x04000000 15 | 16 | kernel_file=kernel.img 17 | initrd_file=initrd.img 18 | fdtfile=actduino_bubble_gum_sdboot_linux.dtb 19 | 20 | # functions to load kernel, initrd and fdt from various env values 21 | loadfiles=run loadkernel; run loadinitrd; run loadfdt 22 | loadkernel=fatload mmc ${mmcdev}:${mmcpart} ${kernel_addr} ${snap_kernel}/${kernel_file} 23 | loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${snap_kernel}/dtbs/${fdtfile} 24 | loadinitrd=fatload mmc ${mmcdev}:${mmcpart} ${initrd_addr} ${snap_kernel}/${initrd_file}; setenv initrd_size ${filesize} 25 | 26 | # if we're trying a new version, check if stamp file is already there to revert 27 | # to other version 28 | snappy_boot=if test "${snap_mode}" = "try"; then setenv snap_mode "trying"; saveenv; setenv snap_core "${snap_try_core}"; setenv snap_kernel "${snap_try_kernel}"; elif test "${snap_mode}" = "trying"; then setenv snap_mode ""; saveenv; fi; run loadfiles; setenv mmcroot "/dev/disk/by-label/writable ${snappy_cmdline} snap_core=${snap_core} snap_kernel=${snap_kernel}"; run mmcargs; bootz ${kernel_addr} ${initrd_addr}:${initrd_size} ${fdt_addr} 29 | 30 | snappy_cmdline=net.ifnames=0 init=/lib/systemd/systemd ro panic=-1 fixrtc 31 | snap_mode= 32 | 33 | mmcrootfstype=ext4 rootwait 34 | mmcargs=setenv bootargs root=${mmcroot} rootfstype=${mmcrootfstype} 35 | uenvcmd=run snappy_boot 36 | mmcboot=echo "boot from mmc card ..."; run uenvcmd; 37 | -------------------------------------------------------------------------------- /builder/kernelsnap.mk: -------------------------------------------------------------------------------- 1 | include common.mk 2 | 3 | KERNEL_SNAP_VERSION := `cat $(KERNEL_SRC)/prime/meta/snap.yaml | grep version: | awk '{print $$2}'` 4 | KERNEL_SNAP := roseapple-pi-kernel_$(KERNEL_SNAP_VERSION)_armhf.snap 5 | 6 | all: build 7 | 8 | clean: 9 | rm -f roseapple-pi-kernel*.snap 10 | if [ -d $(KERNEL_SRC) ] ; then cd $(KERNEL_SRC); snapcraft clean; fi 11 | 12 | distclean: clean 13 | rm -rf $(wildcard $(KERNEL_SRC)) 14 | 15 | build: 16 | if [ ! -d $(KERNEL_SRC) ] ; then git clone $(KERNEL_REPO) -b $(KERNEL_BRANCH) kernel; fi 17 | cd $(KERNEL_SRC); snapcraft clean; snapcraft login; snapcraft --target-arch armhf snap; snapcraft logout 18 | cp $(KERNEL_SRC)/$(KERNEL_SNAP) $(OUTPUT_DIR) 19 | 20 | .PHONY: build 21 | -------------------------------------------------------------------------------- /builder/preloader/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/preloader/bootloader.bin -------------------------------------------------------------------------------- /builder/preloader/bootloader.ini: -------------------------------------------------------------------------------- 1 | [version config] 2 | version = 1.1 3 | [bootdev] 4 | bootdev = 0x20 5 | [jtag config] 6 | jtag_pad = 0 7 | [serial config] 8 | uart_id = 2 9 | uart_pad = 9 10 | uart_baudrate = 0x1c200 11 | [pmu config] 12 | bus_id = 0x0 13 | bus_mfp = 0 14 | pmu_id = 0x3 15 | vddr_pmu_dcdc_cfg = 0x5 16 | [ddr config] 17 | ddr_clk = 0x24c 18 | ddr_cap = 0x0 19 | ddr_bits_width = 0x0 20 | rank = 0x0 21 | ddr_type = 0x0 22 | row_col = 0x0 23 | rdodt = 0x1 24 | wrodt = 0x1 25 | zpzq = 0xc 26 | scan=1 27 | 28 | -------------------------------------------------------------------------------- /builder/roseapple-model.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "model", 3 | "authority-id": "HydsnL7f5YHlWroLIeNQrn9060uDSC53", 4 | "brand-id": "HydsnL7f5YHlWroLIeNQrn9060uDSC53", 5 | "series": "16", 6 | "model": "roseapple-pi", 7 | "architecture": "armhf", 8 | "gadget": "roseapple-pi", 9 | "kernel": "roseapple-pi-kernel", 10 | "timestamp": "2016-11-01T11:43:10+00:00" 11 | } 12 | -------------------------------------------------------------------------------- /builder/roseapple.model: -------------------------------------------------------------------------------- 1 | type: model 2 | authority-id: HydsnL7f5YHlWroLIeNQrn9060uDSC53 3 | series: 16 4 | brand-id: HydsnL7f5YHlWroLIeNQrn9060uDSC53 5 | model: roseapple-pi 6 | architecture: armhf 7 | gadget: roseapple-pi 8 | kernel: roseapple-pi-kernel 9 | timestamp: 2016-11-01T11:43:10+00:00 10 | sign-key-sha3-384: 7xhIc11pojDkVTZaY_T-njpODao_FhRyK4zX6vCvxms0bJao-TDRQ7ycqWMkJCpt 11 | 12 | AcLBXAQAAQoABgUCWBiA/AAKCRBXPDWAVZyG8F2jD/9W9rO37BKtpdAJx5ClVzXSmlhdbNG+itKn 13 | oW6ctHF80/EnNe75YJSvv4/qw6/Q8PX9+IwqAMUIWi+IGi5N8aUTWaytXbiJZ3FCGnZ29AByuwA1 14 | MmvoX2vRy+rVD9WEHrJRtajlndJmVCF43ihQYNAcPa9H8vFcuRB/dWuZTgL+H1MJjlQmSFhApyC7 15 | Ft9MfBqT9Rj3QWFa/CM//RTEEHTmJuwIK3VFBZThzY6UFfV8ncNabBmEzAAzW0v5YRyCXx7br/3q 16 | 3tTHBTv1MNvmJO/QnQyr6PieFEfr9SSf08pLtgCSYZQZlSSopZy2h7sAQs5urX/6kqkAHvC45L/x 17 | JrnL0VhC+h3ikYZsLyFPK+BIEwYyeCVFRcoWWTo9m7y4y0sB6C3+nD62TNH2H/3E/OSUna1t+G1q 18 | UHLPVwjN9M7glMpfJymt2T8F9X6PwneofMYYETigjluY+MkIdk2cVruKJz6VpafjUSIuBE4qZc0s 19 | fAaSWJ1P51g/etTUNmu6EyqvkLtHjEVkhoBo1YMthg541g9XQtQCI1q/d9GsABDdbwaj2ltVdNnk 20 | Ydihr50PoMNjAtKeRIOfJtizKr6w9e3yaHaIMDrc1CJo1q2gEtY53wckBwz6NmB1XTB1raMifdDp 21 | XJ7H9VJImoByyldVlNrGJKhtNXO1fzrGd+NZi4YLkA== 22 | -------------------------------------------------------------------------------- /builder/scripts/bootsect.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/scripts/bootsect.bin -------------------------------------------------------------------------------- /builder/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | 4 | 5 | BUILD_MODULE=$1 6 | TOP_DIR=$(cd "$(dirname "$0")"; pwd) 7 | 8 | 9 | if [ "$BUILD_MODULE" = "config" ]; then 10 | cd $TOP_DIR/owl 11 | ./config.sh 12 | exit 13 | elif [ ! -f "$TOP_DIR/owl/.config" ]; then 14 | cd $TOP_DIR/owl 15 | ./config.sh 16 | fi 17 | 18 | if [ "$BUILD_MODULE" = "kernel" ]; then 19 | cd $TOP_DIR/owl 20 | make kernel 21 | 22 | elif [ "$BUILD_MODULE" = "modules" ]; then 23 | cd $TOP_DIR/owl 24 | make modules 25 | 26 | elif [ "$BUILD_MODULE" = "u-boot" ]; then 27 | cd $TOP_DIR/owl 28 | make u-boot 29 | 30 | elif [ "$BUILD_MODULE" = "rootfs" ]; then 31 | cd $TOP_DIR/owl 32 | make rootfs 33 | 34 | elif [ "$BUILD_MODULE" = "distclean" ]; then 35 | cd $TOP_DIR/owl 36 | make distclean 37 | 38 | else 39 | cd $TOP_DIR/owl 40 | make 41 | fi 42 | -------------------------------------------------------------------------------- /builder/scripts/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # (C) Copyright 2015, actions Limited 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. 9 | 10 | 11 | unset MENU_CHOICES_ARRAY 12 | add_item(){ 13 | local new_item=$1 14 | local c 15 | for c in ${MENU_CHOICES_ARRAY[@]} ; do 16 | if [ "$new_item" = "$c" ] ; then 17 | return 18 | fi 19 | done 20 | MENU_CHOICES_ARRAY=(${MENU_CHOICES_ARRAY[@]} $new_item) 21 | } 22 | 23 | build_ic_list() { 24 | unset MENU_CHOICES_ARRAY 25 | if [ -d "s500" ] 26 | then 27 | add_item "s500" 28 | fi 29 | 30 | if [ -d "s700" ] 31 | then 32 | add_item "s700" 33 | fi 34 | 35 | if [ -d "s900" ] 36 | then 37 | add_item "s900" 38 | fi 39 | } 40 | 41 | build_os_list() { 42 | unset MENU_CHOICES_ARRAY 43 | local file 44 | for file in ` ls -1 $1` 45 | do 46 | if [ -d $1"/"$file ] 47 | then 48 | if [ -d .."/"$file ] 49 | then 50 | add_item $file 51 | fi 52 | fi 53 | 54 | done 55 | } 56 | 57 | build_list() { 58 | unset MENU_CHOICES_ARRAY 59 | local file 60 | for file in ` ls -1 $1` 61 | do 62 | if [ -d $1"/"$file ] 63 | then 64 | add_item $file 65 | fi 66 | 67 | done 68 | } 69 | 70 | print_menu(){ 71 | local i=1 72 | local choice 73 | for choice in ${MENU_CHOICES_ARRAY[@]} 74 | do 75 | echo " $i. $choice" 76 | i=$(($i+1)) 77 | done 78 | 79 | echo 80 | } 81 | 82 | 83 | read_choice(){ 84 | ####################################### select ic type 85 | local answer 86 | build_ic_list 87 | 88 | if [ ${#MENU_CHOICES_ARRAY[@]} -eq 0 ] 89 | then 90 | echo "error: no ic." 91 | return 92 | elif [ ${#MENU_CHOICES_ARRAY[@]} -eq 1 ] 93 | then 94 | selected_ic=${MENU_CHOICES_ARRAY[0]} 95 | else 96 | echo "Select IC name:" 97 | print_menu 98 | echo -n "Which would you like? [${MENU_CHOICES_ARRAY[0]}] " 99 | read answer 100 | 101 | local selected_ic= 102 | 103 | if [ -z "$answer" ] 104 | then 105 | selected_ic=${MENU_CHOICES_ARRAY[0]} 106 | elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$") 107 | then 108 | if [ $answer -le ${#MENU_CHOICES_ARRAY[@]} ] 109 | then 110 | selected_ic=${MENU_CHOICES_ARRAY[$(($answer-1))]} 111 | fi 112 | elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$") 113 | then 114 | selected_ic=$answer 115 | fi 116 | 117 | if [ -z "$selected_ic" ] 118 | then 119 | echo 120 | echo "Invalid lunch combo: $answer" 121 | return 1 122 | fi 123 | 124 | echo 125 | fi 126 | 127 | 128 | ###################################### select os type 129 | build_os_list $selected_ic/boards 130 | 131 | if [ ${#MENU_CHOICES_ARRAY[@]} -eq 0 ] 132 | then 133 | echo "error: no os." 134 | return 135 | elif [ ${#MENU_CHOICES_ARRAY[@]} -eq 1 ] 136 | then 137 | selected_os=${MENU_CHOICES_ARRAY[0]} 138 | else 139 | echo "Select build os:" 140 | print_menu 141 | echo -n "Which would you like? [${MENU_CHOICES_ARRAY[0]}] " 142 | read answer 143 | 144 | local selected_os= 145 | 146 | if [ -z "$answer" ] 147 | then 148 | selected_os=${MENU_CHOICES_ARRAY[0]} 149 | elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$") 150 | then 151 | if [ $answer -le ${#MENU_CHOICES_ARRAY[@]} ] 152 | then 153 | selected_os=${MENU_CHOICES_ARRAY[$(($answer-1))]} 154 | fi 155 | elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$") 156 | then 157 | selected_os=$answer 158 | fi 159 | 160 | if [ -z "$selected_os" ] 161 | then 162 | echo 163 | echo "Invalid lunch combo: $answer" 164 | return 1 165 | fi 166 | 167 | echo 168 | fi 169 | 170 | ############################select board type 171 | build_list $selected_ic/boards/$selected_os/ 172 | echo "Select board type:" 173 | print_menu 174 | echo -n "Which would you like? [${MENU_CHOICES_ARRAY[0]}] " 175 | read answer 176 | 177 | local selected_board= 178 | 179 | if [ -z "$answer" ] 180 | then 181 | selected_board=${MENU_CHOICES_ARRAY[0]} 182 | elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$") 183 | then 184 | if [ $answer -le ${#MENU_CHOICES_ARRAY[@]} ] 185 | then 186 | selected_board=${MENU_CHOICES_ARRAY[$(($answer-1))]} 187 | fi 188 | elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$") 189 | then 190 | selected_board=$answer 191 | fi 192 | 193 | if [ -z "$selected_board" ] 194 | then 195 | echo 196 | echo "Invalid lunch combo: $answer" 197 | return 1 198 | fi 199 | 200 | ############################################################## 201 | cat $selected_ic/boards/$selected_os/$selected_board/config > .config 202 | echo IC_NAME=$selected_ic >> .config 203 | echo OS_NAME=$selected_os >> .config 204 | echo BOARD_NAME=$selected_board >> .config 205 | rm -f out/$selected_ic"_"$selected_os"_"$selected_board/kernel/.config 206 | echo "$selected_ic $selected_os $selected_board configured." 207 | } 208 | 209 | 210 | if [ $# -eq 3 ] && [ -d "$1" ] && [ -d "$1/boards/$2" ] && [ -d "$1/boards/$2/$3" ];then 211 | cat $1/boards/$2/$3/config > .config 212 | echo IC_NAME=$1 >> .config 213 | echo OS_NAME=$2 >> .config 214 | echo BOARD_NAME=$3 >> .config 215 | rm -f out/$1_$2_$3/kernel/.config 216 | 217 | echo "$1 $2 $3 configured." 218 | else 219 | read_choice 220 | fi 221 | 222 | 223 | -------------------------------------------------------------------------------- /builder/scripts/fw_develop_kits.spec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/scripts/fw_develop_kits.spec -------------------------------------------------------------------------------- /builder/scripts/fwimage_linux.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/scripts/fwimage_linux.cfg -------------------------------------------------------------------------------- /builder/scripts/gen_init_cpio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/scripts/gen_init_cpio -------------------------------------------------------------------------------- /builder/scripts/gen_initramfs_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (C) Martin Schlemmer 3 | # Copyright (C) 2006 Sam Ravnborg 4 | # 5 | # Released under the terms of the GNU GPL 6 | # 7 | # Generate a cpio packed initramfs. It uses gen_init_cpio to generate 8 | # the cpio archive, and then compresses it. 9 | # The script may also be used to generate the inputfile used for gen_init_cpio 10 | # This script assumes that gen_init_cpio is located in usr/ directory 11 | 12 | # error out on errors 13 | set -e 14 | 15 | usage() { 16 | cat << EOF 17 | Usage: 18 | $0 [-o ] [-u ] [-g ] {-d | } ... 19 | -o Create compressed initramfs file named using 20 | gen_init_cpio and compressor depending on the extension 21 | -u User ID to map to user ID 0 (root). 22 | is only meaningful if is a 23 | directory. "squash" forces all files to uid 0. 24 | -g Group ID to map to group ID 0 (root). 25 | is only meaningful if is a 26 | directory. "squash" forces all files to gid 0. 27 | File list or directory for cpio archive. 28 | If is a .cpio file it will be used 29 | as direct input to initramfs. 30 | -d Output the default cpio list. 31 | 32 | All options except -o and -l may be repeated and are interpreted 33 | sequentially and immediately. -u and -g states are preserved across 34 | options so an explicit "-u 0 -g 0" is required 35 | to reset the root/group mapping. 36 | EOF 37 | } 38 | 39 | # awk style field access 40 | # $1 - field number; rest is argument string 41 | field() { 42 | shift $1 ; echo $1 43 | } 44 | 45 | list_default_initramfs() { 46 | # echo usr/kinit/kinit 47 | : 48 | } 49 | 50 | default_initramfs() { 51 | cat <<-EOF >> ${output} 52 | # This is a very simple, default initramfs 53 | 54 | dir /dev 0755 0 0 55 | nod /dev/console 0600 0 0 c 5 1 56 | dir /root 0700 0 0 57 | # file /kinit usr/kinit/kinit 0755 0 0 58 | # slink /init kinit 0755 0 0 59 | EOF 60 | } 61 | 62 | filetype() { 63 | local argv1="$1" 64 | 65 | # symlink test must come before file test 66 | if [ -L "${argv1}" ]; then 67 | echo "slink" 68 | elif [ -f "${argv1}" ]; then 69 | echo "file" 70 | elif [ -d "${argv1}" ]; then 71 | echo "dir" 72 | elif [ -b "${argv1}" -o -c "${argv1}" ]; then 73 | echo "nod" 74 | elif [ -p "${argv1}" ]; then 75 | echo "pipe" 76 | elif [ -S "${argv1}" ]; then 77 | echo "sock" 78 | else 79 | echo "invalid" 80 | fi 81 | return 0 82 | } 83 | 84 | list_print_mtime() { 85 | : 86 | } 87 | 88 | print_mtime() { 89 | local my_mtime="0" 90 | 91 | if [ -e "$1" ]; then 92 | my_mtime=$(find "$1" -printf "%T@\n" | sort -r | head -n 1) 93 | fi 94 | 95 | echo "# Last modified: ${my_mtime}" >> ${output} 96 | echo "" >> ${output} 97 | } 98 | 99 | list_parse() { 100 | [ ! -L "$1" ] && echo "$1 \\" || : 101 | } 102 | 103 | # for each file print a line in following format 104 | # 105 | # for links, devices etc the format differs. See gen_init_cpio for details 106 | parse() { 107 | local location="$1" 108 | local name="/${location#${srcdir}}" 109 | # change '//' into '/' 110 | name=$(echo "$name" | sed -e 's://*:/:g') 111 | local mode="$2" 112 | local uid="$3" 113 | local gid="$4" 114 | local ftype=$(filetype "${location}") 115 | # remap uid/gid to 0 if necessary 116 | [ "$root_uid" = "squash" ] && uid=0 || [ "$uid" -eq "$root_uid" ] && uid=0 117 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 118 | local str="${mode} ${uid} ${gid}" 119 | 120 | [ "${ftype}" = "invalid" ] && return 0 121 | [ "${location}" = "${srcdir}" ] && return 0 122 | 123 | case "${ftype}" in 124 | "file") 125 | str="${ftype} ${name} ${location} ${str}" 126 | ;; 127 | "nod") 128 | local dev=`LC_ALL=C ls -l "${location}"` 129 | local maj=`field 5 ${dev}` 130 | local min=`field 6 ${dev}` 131 | maj=${maj%,} 132 | 133 | [ -b "${location}" ] && dev="b" || dev="c" 134 | 135 | str="${ftype} ${name} ${str} ${dev} ${maj} ${min}" 136 | ;; 137 | "slink") 138 | local target=`readlink "${location}"` 139 | str="${ftype} ${name} ${target} ${str}" 140 | ;; 141 | *) 142 | str="${ftype} ${name} ${str}" 143 | ;; 144 | esac 145 | 146 | echo "${str}" >> ${output} 147 | 148 | return 0 149 | } 150 | 151 | unknown_option() { 152 | printf "ERROR: unknown option \"$arg\"\n" >&2 153 | printf "If the filename validly begins with '-', " >&2 154 | printf "then it must be prefixed\n" >&2 155 | printf "by './' so that it won't be interpreted as an option." >&2 156 | printf "\n" >&2 157 | usage >&2 158 | exit 1 159 | } 160 | 161 | list_header() { 162 | : 163 | } 164 | 165 | header() { 166 | printf "\n#####################\n# $1\n" >> ${output} 167 | } 168 | 169 | # process one directory (incl sub-directories) 170 | dir_filelist() { 171 | ${dep_list}header "$1" 172 | 173 | srcdir=$(echo "$1" | sed -e 's://*:/:g') 174 | dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n") 175 | 176 | # If $dirlist is only one line, then the directory is empty 177 | if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then 178 | ${dep_list}print_mtime "$1" 179 | 180 | echo "${dirlist}" | \ 181 | while read x; do 182 | ${dep_list}parse ${x} 183 | done 184 | fi 185 | } 186 | 187 | # if only one file is specified and it is .cpio file then use it direct as fs 188 | # if a directory is specified then add all files in given direcotry to fs 189 | # if a regular file is specified assume it is in gen_initramfs format 190 | input_file() { 191 | source="$1" 192 | if [ -f "$1" ]; then 193 | ${dep_list}header "$1" 194 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" 195 | if [ $2 -eq 0 -a ${is_cpio} = "cpio" ]; then 196 | cpio_file=$1 197 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" 198 | [ ! -z ${dep_list} ] && echo "$1" 199 | return 0 200 | fi 201 | if [ -z ${dep_list} ]; then 202 | print_mtime "$1" >> ${output} 203 | cat "$1" >> ${output} 204 | else 205 | echo "$1 \\" 206 | cat "$1" | while read type dir file perm ; do 207 | if [ "$type" = "file" ]; then 208 | echo "$file \\"; 209 | fi 210 | done 211 | fi 212 | elif [ -d "$1" ]; then 213 | dir_filelist "$1" 214 | else 215 | echo " ${prog}: Cannot open '$1'" >&2 216 | exit 1 217 | fi 218 | } 219 | 220 | prog=$0 221 | root_uid=0 222 | root_gid=0 223 | dep_list= 224 | cpio_file= 225 | cpio_list= 226 | output="/dev/stdout" 227 | output_file="" 228 | is_cpio_compressed= 229 | compr="gzip -n -9 -f" 230 | 231 | arg="$1" 232 | case "$arg" in 233 | "-l") # files included in initramfs - used by kbuild 234 | dep_list="list_" 235 | echo "deps_initramfs := $0 \\" 236 | shift 237 | ;; 238 | "-o") # generate compressed cpio image named $1 239 | shift 240 | output_file="$1" 241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" 242 | output=${cpio_list} 243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f" 244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" 245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" 246 | echo "$output_file" | grep -q "\.xz$" && \ 247 | compr="xz --check=crc32 --lzma2=dict=1MiB" 248 | echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f" 249 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" 250 | shift 251 | ;; 252 | esac 253 | while [ $# -gt 0 ]; do 254 | arg="$1" 255 | shift 256 | case "$arg" in 257 | "-u") # map $1 to uid=0 (root) 258 | root_uid="$1" 259 | shift 260 | ;; 261 | "-g") # map $1 to gid=0 (root) 262 | root_gid="$1" 263 | shift 264 | ;; 265 | "-d") # display default initramfs list 266 | default_list="$arg" 267 | ${dep_list}default_initramfs 268 | ;; 269 | "-h") 270 | usage 271 | exit 0 272 | ;; 273 | *) 274 | case "$arg" in 275 | "-"*) 276 | unknown_option 277 | ;; 278 | *) # input file/dir - process it 279 | input_file "$arg" "$#" 280 | ;; 281 | esac 282 | ;; 283 | esac 284 | done 285 | 286 | # If output_file is set we will generate cpio archive and compress it 287 | # we are careful to delete tmp files 288 | if [ ! -z ${output_file} ]; then 289 | if [ -z ${cpio_file} ]; then 290 | timestamp= 291 | if test -n "$KBUILD_BUILD_TIMESTAMP"; then 292 | timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)" 293 | if test -n "$timestamp"; then 294 | timestamp="-t $timestamp" 295 | fi 296 | fi 297 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" 298 | usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile} 299 | else 300 | cpio_tfile=${cpio_file} 301 | fi 302 | rm ${cpio_list} 303 | if [ "${is_cpio_compressed}" = "compressed" ]; then 304 | cat ${cpio_tfile} > ${output_file} 305 | else 306 | (cat ${cpio_tfile} | ${compr} - > ${output_file}) \ 307 | || (rm -f ${output_file} ; false) 308 | fi 309 | [ -z ${cpio_file} ] && rm ${cpio_tfile} 310 | fi 311 | exit 0 312 | -------------------------------------------------------------------------------- /builder/scripts/linux_build_fw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | P=`pwd` 4 | cd ${P}/.. 5 | PM=`pwd` 6 | 7 | FW_NAME=$3 8 | 9 | echo $FW_NAME 10 | cd ${P} 11 | 12 | IMAGE_CFG_FILE=$1 13 | IMAGE_OUTPUT_DIR=$2 14 | 15 | CUR_TIME=`date "+%y%m%d"` 16 | sed -i "s/VER = .*$/VER = \"3.10.37.$CUR_TIME\";/g" $IMAGE_CFG_FILE 17 | 18 | if [ -f ../tools/fw_maker/maker_install.sh ];then 19 | mkdir -p ../tools/fw_maker/Output 20 | cd ../tools/fw_maker && ./maker_install.sh && cd ${P} 21 | MAKER_BIN=../tools/fw_maker/Output/PyMaker.pyo 22 | echo "python -O ${MAKER_BIN} -c ./$IMAGE_CFG_FILE -o ${IMAGE_OUTPUT_DIR}/tmp.fw --mf 1" 23 | python -O ${MAKER_BIN} -c ./$IMAGE_CFG_FILE -o ${IMAGE_OUTPUT_DIR}/tmp.fw --mf 1 24 | fi 25 | 26 | if [ -f ../tools/fw_maker/Maker.exe ];then 27 | MAKER_BIN=../tools/fw_maker/Maker.exe 28 | wine ${MAKER_BIN} -c $IMAGE_CFG_FILE -o ${IMAGE_OUTPUT_DIR}/tmp.fw 29 | fi 30 | 31 | MAKER_BIN=../tools/fw_maker/Output/CompoundFW 32 | 33 | ${MAKER_BIN} -fi:$IMAGE_OUTPUT_DIR/tmp.fw -fo:$IMAGE_OUTPUT_DIR/${FW_NAME}.fw 34 | rm $IMAGE_OUTPUT_DIR/tmp.fw 35 | 36 | exit 0 37 | -------------------------------------------------------------------------------- /builder/scripts/padbootloader: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | dd if=/dev/zero of=./uboot_fill.bin bs=1 count=$( expr $( expr $( expr $(stat -c%s $1) + 511 ) / 512 ) \* 512 ) 4 | dd if=./uboot_fill.bin of=$1 bs=1 skip=$(stat -c%s $1) seek=$(stat -c%s $1) 5 | rm ./uboot_fill.bin 6 | -------------------------------------------------------------------------------- /builder/scripts/partition_create.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | import os 4 | from os.path import join, getsize 5 | from ctypes import * 6 | from string import * 7 | import types 8 | import os; 9 | import io; 10 | import tempfile; 11 | import struct; 12 | 13 | class Partion: 14 | def __init__(self, label, fstype, size, flag, downloadfile): 15 | self.label = label 16 | self.fstype = fstype 17 | self.size = size 18 | self.flag = flag 19 | self.downloadfile = downloadfile 20 | 21 | 22 | def CheckKey(line, keyword): 23 | line_list = []; 24 | if line.count(keyword)==True : 25 | line_list = line.split('='); 26 | if line_list[0].strip() == keyword : 27 | return line_list[1].strip(); 28 | return None; 29 | 30 | def OutFile(fileName, partion_list): 31 | # updpate the property file 32 | print("out file=" + fileName); 33 | fp=open(fileName,'w'); 34 | line = '\nSETPATH="..\\out\\boardname\\burn" \n'; 35 | line +='PARTITION_I=0, "MBRC", "./bootloader.bin", "RAW", "IMG", 0x11;\n' ; 36 | line +='PARTITION_I=1, "BOOT", "./u-boot-dtb.img", "RAW", "IMG", 0x11;\n' ; 37 | line += '\nSETPATH="."\n'; 38 | fp.write(line); 39 | num=2; 40 | for part in partion_list: 41 | if part.label == None: 42 | continue; 43 | if part.fstype == None: 44 | continue; 45 | if part.downloadfile == 'FMT': 46 | line ='PARTITION_F=%d, "%s", "", "%s", "FMT", 0x1;\n' %(num, part.label, part.fstype); 47 | elif ( (part.downloadfile == None) or (len(part.downloadfile)==0 ) ) : 48 | line ='PARTITION_O=%d, "%s", "", "%s", "IMG", 0x20;\n' %(num, part.label, part.fstype); 49 | else : 50 | line ='PARTITION_O=%d, "%s", "", "%s", "IMG", 0x1;\n' %(num, part.label, part.fstype); 51 | fp.write(line); 52 | num = num + 1; 53 | 54 | fp.write("PARTITION_UDISK_INDEX=12;\n"); 55 | fp.write("PARTITION=1;\n"); 56 | 57 | fp.close() 58 | 59 | if __name__ == '__main__': 60 | if len(sys.argv) < 3 : 61 | print 'usage: partions.py input.cfg output.cfg' 62 | exit(-1) 63 | 64 | in_file = sys.argv[1]; 65 | out_file = sys.argv[2]; 66 | print(" careate cfg " + in_file + " to " + out_file); 67 | fp = open(in_file); 68 | partion_list=[] ; 69 | 70 | bpart = False; 71 | label = None; 72 | fstype = None; 73 | size = None; 74 | flag = None; 75 | downloadfile = None; 76 | 77 | while True: 78 | line = fp.readline(); 79 | if not line: 80 | break 81 | if line.strip() == '' or line[0] in '#;//': 82 | continue 83 | 84 | if line.count('[MBR_INFO]')==True : 85 | print "mbr info:"; 86 | bpart = True; 87 | continue; 88 | if line.count('[partition]')==True : 89 | if bpart == True : 90 | partion_list.append( Partion(label, fstype, size, flag, downloadfile) ); 91 | bpart = True; 92 | label = None; 93 | fstype = None; 94 | size = None; 95 | flag = None; 96 | downloadfile = None; 97 | print "partition:"; 98 | continue; 99 | 100 | if bpart != True : 101 | continue; 102 | 103 | tmp = CheckKey(line,'label'); 104 | if tmp != None: 105 | print("label:" + tmp); 106 | label = tmp; 107 | continue; 108 | tmp = CheckKey(line,'fstype'); 109 | if tmp != None: 110 | print("fstype:" + tmp); 111 | fstype = tmp; 112 | continue; 113 | tmp = CheckKey(line,'size'); 114 | if tmp != None: 115 | print("size:" + tmp); 116 | size = tmp; 117 | continue; 118 | tmp = CheckKey(line,'flag'); 119 | if tmp != None: 120 | print 'flag:%d'% int(tmp,16); 121 | flag = tmp; 122 | continue; 123 | tmp = CheckKey(line,'downloadfile'); 124 | if tmp != None: 125 | print("downloadfile:" + tmp); 126 | downloadfile = tmp; 127 | continue; 128 | 129 | if label != None : 130 | partion_list.append( Partion(label, fstype, size, flag, downloadfile) ); 131 | fp.close(); 132 | OutFile(out_file, partion_list); 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /builder/scripts/populate_dir: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd $1 4 | [ -e bin ] || mkdir bin 5 | [ -e boot ] || mkdir boot 6 | [ -e dev ] || mkdir dev 7 | #[ -e etc ] || mkdir etc 8 | #[ -e etc/init.d ] || mkdir etc/init.d 9 | [ -e home ] || mkdir home 10 | [ -e lib ] || mkdir lib 11 | [ -e lib/modules ] || mkdir lib/modules 12 | [ -e mnt ] || mkdir mnt 13 | [ -e proc ] || mkdir proc 14 | [ -e root ] || mkdir root 15 | [ -e sbin ] || mkdir sbin 16 | [ -e sys ] || mkdir sys 17 | [ -e tmp ] || mkdir tmp 18 | [ -e usr ] || mkdir usr 19 | [ -e usr/bin ] || mkdir usr/bin 20 | [ -e usr/lib ] || mkdir usr/lib 21 | [ -e usr/sbin ] || mkdir usr/sbin 22 | [ -e var ] || mkdir var 23 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_android_exclude_files.txt: -------------------------------------------------------------------------------- 1 | #*.o 2 | #*.cmd 3 | #*.order 4 | .git 5 | .repo 6 | .gitignore 7 | 8 | android/device/actions/common/prebuilt/codec/atm7059/libdrm_algorithm.a 9 | android/frameworks/av/include/alsp/inc/libdrm_alogrithm.h 10 | android/device/actions/common/prebuilt/widevine 11 | android/device/actions/common/prebuilt/utils/benchmark 12 | android/device/actions/common/prebuilt/codec/atm7059/version.log 13 | android/device/actions/common/performancemanager 14 | android/out 15 | 16 | owl/out 17 | owl/private 18 | owl/scripts/release_scripts 19 | 20 | owl/s500/boards/android 21 | owl/s500/boards/debian 22 | owl/s500/boards/linux 23 | owl/s500/boards/ubuntu 24 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_android_release_boards_cfg.txt: -------------------------------------------------------------------------------- 1 | gb5_wxga 2 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_debian_exclude_files.txt: -------------------------------------------------------------------------------- 1 | #*.o 2 | #*.cmd 3 | #*.order 4 | .git 5 | .repo 6 | .gitignore 7 | 8 | owl/out 9 | owl/private 10 | owl/scripts/release_scripts 11 | owl/boards/android 12 | owl/boards/linux 13 | owl/boards/ubuntu 14 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_debian_release_boards_cfg.txt: -------------------------------------------------------------------------------- 1 | gb5_wxga 2 | gb5_xga 3 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_ubuntu_exclude_files.txt: -------------------------------------------------------------------------------- 1 | .git 2 | .repo 3 | .gitignore 4 | 5 | owl/out 6 | owl/private 7 | owl/scripts/release_scripts 8 | owl/s500/boards/android 9 | owl/s500/boards/linux 10 | owl/s500/boards/debian 11 | ubuntu/omx/vd*.so 12 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/AD500A_ubuntu_release_boards_cfg.txt: -------------------------------------------------------------------------------- 1 | gb5_wxga 2 | gb5_wxga_sd 3 | gb5_xga 4 | lemaker_guitar 5 | -------------------------------------------------------------------------------- /builder/scripts/release_scripts/release_packages_ad500a_android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo $PWD 4 | RELEASE_DIR=$PWD 5 | echo $RELEASE_DIR 6 | CURRENT_DIR=$PWD/../../../../ 7 | cd $CURRENT_DIR 8 | echo $PWD 9 | 10 | SYSTEM_OS=android 11 | SDK_NAME=AD500A_android_sdk 12 | PREBUILT_UTILS=android/android/device/actions/common/prebuilt/utils 13 | SCRIPTS_DIR=android/owl/scripts/release_scripts 14 | DEVICE_ACTIONS=android/android/device/actions 15 | OWL_BOARDS=android/owl/s500/boards/android 16 | TAR_NAME=ad500a_android.tar.bz2 17 | RELEASE_BOARDS_TXT=AD500A_android_release_boards_cfg.txt 18 | EXCLUDE_FILES_TXT=AD500A_android_exclude_files.txt 19 | ANDROID_PREBUILTS=android/android/prebuilts 20 | ANDROID_OWL=android/owl 21 | BOARD_OUT_NAME=`grep "BOARD_NAME=" android/owl/.config | awk -F "BOARD_NAME=" '{print $2}'` 22 | OUT_PRODUCT_LIB=android/android/out/target/product/$BOARD_OUT_NAME/system/lib 23 | 24 | if [ -d $SDK_NAME ]; then 25 | echo "rm -rf $SDK_NAME" 26 | rm -rf $SDK_NAME 27 | fi 28 | 29 | if [ -f $TAR_NAME ]; then 30 | echo "rm $TAR_NAME" 31 | rm $TAR_NAME 32 | fi 33 | 34 | mkdir $SDK_NAME 35 | echo "---rsync sdk---" 36 | echo "please wait..." 37 | rsync -r $SYSTEM_OS $SDK_NAME -l \ 38 | --exclude-from=$SCRIPTS_DIR/$EXCLUDE_FILES_TXT \ 39 | --exclude=.git \ 40 | --exclude=.gitignore \ 41 | --exclude=*.o \ 42 | --exclude=*.cmd \ 43 | --exclude=*.order 44 | rsync -r $ANDROID_PREBUILTS/ $SDK_NAME/$ANDROID_PREBUILTS/ -l \ 45 | --exclude=.git \ 46 | --exclude=.gitignore 47 | 48 | echo "---copy release board---" 49 | 50 | cd $CURRENT_DIR/$SDK_NAME/$DEVICE_ACTIONS 51 | ls | grep -v "common" | grep -v "populat_new_device.sh" | xargs rm -rf 52 | cd $CURRENT_DIR 53 | 54 | mkdir -p $SDK_NAME/$OWL_BOARDS 55 | while read -r line || [[ -n $line ]] 56 | do 57 | if [ x$line != x ];then 58 | echo "+++ $line +++" 59 | cp -r $DEVICE_ACTIONS/$line $SDK_NAME/$DEVICE_ACTIONS 60 | cp -r $OWL_BOARDS/$line $SDK_NAME/$OWL_BOARDS 61 | fi 62 | done < $SCRIPTS_DIR/$RELEASE_BOARDS_TXT 63 | 64 | #dispose device/actions/performancemanager 65 | echo "---dispose device/actions/performancemanager---" 66 | cp ${OUT_PRODUCT_LIB}/libperformance.so $SDK_NAME/$PREBUILT_UTILS 67 | 68 | echo "---tar sdk---" 69 | tar -jc -f $TAR_NAME $SDK_NAME 70 | #rm -rf $SDK_NAME 71 | tar -jx -f $TAR_NAME -C . 72 | echo "Finish." -------------------------------------------------------------------------------- /builder/scripts/release_scripts/release_packages_ad500a_debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo $PWD 4 | RELEASE_DIR=$PWD 5 | echo $RELEASE_DIR 6 | cd $PWD/../../../../ 7 | echo $PWD 8 | 9 | SDK_NAME=AD500A_debian_sdk 10 | SCRIPTS_DIR=debian/owl/scripts/release_scripts 11 | OWL_BOARDS=debian/owl/boards/debian 12 | 13 | if [ -d $SDK_NAME ]; then 14 | echo "rm -rf $SDK_NAME" 15 | rm -rf $SDK_NAME 16 | fi 17 | 18 | if [ -f ad500a_debian.tar.bz2 ]; then 19 | echo "rm ad500a_debian.tar.bz2" 20 | rm ad500a_debian.tar.bz2 21 | fi 22 | 23 | mkdir $SDK_NAME 24 | echo "---rsync sdk---" 25 | echo "please wait..." 26 | rsync -r debian $SDK_NAME -l \ 27 | --exclude-from=debian/owl/scripts/release_scripts/AD500A_debian_exclude_files.txt \ 28 | --exclude=.git \ 29 | --exclude=.gitignore \ 30 | --exclude=*.o \ 31 | --exclude=*.cmd \ 32 | --exclude=*.order \ 33 | --exclude=debian/owl/boards/debian/* 34 | 35 | echo "---copy release board---" 36 | while read -r line || [[ -n $line ]] 37 | do 38 | if [ x$line != x ];then 39 | echo "+++ $line +++" 40 | cp -r $OWL_BOARDS/$line $SDK_NAME/$OWL_BOARDS 41 | fi 42 | done < $SCRIPTS_DIR/AD500A_debian_release_boards_cfg.txt 43 | 44 | echo "---tar sdk---" 45 | tar -jc -f ad500a_debian.tar.bz2 $SDK_NAME 46 | rm -rf $SDK_NAME 47 | tar -jx -f ad500a_debian.tar.bz2 -C . 48 | echo "Finish." -------------------------------------------------------------------------------- /builder/scripts/release_scripts/release_packages_ad500a_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo $PWD 4 | RELEASE_DIR=$PWD 5 | echo $RELEASE_DIR 6 | cd $PWD/../../../../ 7 | echo $PWD 8 | 9 | SDK_NAME=AD500A_ubuntu_sdk 10 | SCRIPTS_DIR=ubuntu/owl/scripts/release_scripts 11 | OWL_BOARDS=ubuntu/owl/s500/boards/ubuntu 12 | 13 | if [ -d $SDK_NAME ]; then 14 | echo "rm -rf $SDK_NAME" 15 | rm -rf $SDK_NAME 16 | fi 17 | 18 | if [ -d omx_vd_so ]; then 19 | echo "rm -rf omx_vd_so" 20 | rm -rf omx_vd_so 21 | fi 22 | 23 | if [ -f ad500a_ubuntu.tar.bz2 ]; then 24 | echo "rm ad500a_ubuntu.tar.bz2" 25 | rm ad500a_ubuntu.tar.bz2 26 | fi 27 | 28 | mkdir $SDK_NAME 29 | echo "---rsync sdk---" 30 | echo "please wait..." 31 | rsync -r ubuntu $SDK_NAME -l \ 32 | --exclude-from=ubuntu/owl/scripts/release_scripts/AD500A_ubuntu_exclude_files.txt \ 33 | --exclude=ubuntu/owl/s500/boards/ubuntu/* 34 | 35 | echo "---copy release board---" 36 | while read -r line || [[ -n $line ]] 37 | do 38 | if [ x$line != x ];then 39 | echo "+++ $line +++" 40 | cp -r $OWL_BOARDS/$line $SDK_NAME/$OWL_BOARDS 41 | fi 42 | done < $SCRIPTS_DIR/AD500A_ubuntu_release_boards_cfg.txt 43 | 44 | mkdir omx_vd_so 45 | cp ubuntu/ubuntu/omx/vd* omx_vd_so 46 | rm omx_vd_so/vd_xvid.so 47 | rm omx_vd_so/vd_vp8.so 48 | tar -jc -f omx_vd_so.tar.bz2 omx_vd_so 49 | rm -rf omx_vd_so 50 | 51 | echo "copy vd_xvid.so && vd_vp8.so to sdk" 52 | copy ubuntu/ubuntu/omx/vd_xvid.so $SDK_NAME/ubuntu/ubuntu/omx 53 | copy ubuntu/ubuntu/omx/vd_vp8.so $SDK_NAME/ubuntu/ubuntu/omx 54 | 55 | echo "---tar sdk---" 56 | tar -jc -f ad500a_ubuntu.tar.bz2 $SDK_NAME 57 | rm -rf $SDK_NAME 58 | tar -jx -f ad500a_ubuntu.tar.bz2 -C . 59 | cho "Finish." -------------------------------------------------------------------------------- /builder/scripts/root.mk: -------------------------------------------------------------------------------- 1 | 2 | 3 | .PHONY: all clean kernel_clean u-boot_clean bootloader_clean rootfs_clean distclean mrproper spec 4 | .PHONY: kernel kernel-config modules u-boot bootloader rootfs initramfs upramfs misc firmware md5sum recovery 5 | 6 | include .config 7 | 8 | TOP_DIR=$(shell pwd) 9 | CPUS=$$(($(shell cat /sys/devices/system/cpu/present | awk -F- '{ print $$2 }')+1)) 10 | #CPUS=1 11 | Q= 12 | 13 | KERNEL_SRC=$(TOP_DIR)/../kernel 14 | UBOOT_SRC=$(TOP_DIR)/../u-boot 15 | 16 | BOOTLOADER_SRC=$(TOP_DIR)/private/boot 17 | SCRIPT_DIR=$(TOP_DIR)/scripts 18 | BOARD_CONFIG_DIR=$(TOP_DIR)/$(IC_NAME)/boards/$(OS_NAME)/$(BOARD_NAME) 19 | TOOLS_DIR=$(TOP_DIR)/tools 20 | 21 | OUT_DIR=$(TOP_DIR)/out/$(IC_NAME)_$(OS_NAME)_$(BOARD_NAME) 22 | IMAGE_DIR=$(OUT_DIR)/images 23 | BURN_DIR=$(OUT_DIR)/burn 24 | BOOTLOAD_DIR=$(OUT_DIR)/bootloader 25 | MISC_DIR=$(OUT_DIR)/misc 26 | UPRAMFS_ROOTFS=$(BURN_DIR)/upramfs 27 | KERNEL_OUT_DIR=$(OUT_DIR)/kernel 28 | UBOOT_OUT_DIR=$(OUT_DIR)/u-boot 29 | K_BLD_CONFIG=$(KERNEL_OUT_DIR)/.config 30 | 31 | ifneq "$(findstring ARM, $(shell grep -m 1 'model name.*: ARM' /proc/cpuinfo))" "" 32 | BOOTLOADER_PACK=bootloader_pack.arm 33 | CROSS_COMPILE= 34 | else 35 | BOOTLOADER_PACK=bootloader_pack 36 | CROSS_COMPILE=arm-linux-gnueabihf- 37 | endif 38 | 39 | export PATH:=$(TOOLS_DIR)/utils:$(PATH) 40 | 41 | DATE_STR=$(shell date +%y%m%d) 42 | FW_NAME=$(IC_NAME)_$(OS_NAME)_$(BOARD_NAME)_$(DATE_STR) 43 | 44 | all: kernel modules u-boot bootloader rootfs initramfs upramfs misc firmware md5sum 45 | 46 | $(K_BLD_CONFIG): 47 | $(Q)mkdir -p $(KERNEL_OUT_DIR) 48 | $(Q)$(MAKE) -C $(KERNEL_SRC) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) $(KERNEL_DEFCONFIG) 49 | 50 | kernel: $(K_BLD_CONFIG) 51 | $(Q)mkdir -p $(KERNEL_OUT_DIR) 52 | $(Q)$(MAKE) -C $(KERNEL_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) dtbs 53 | $(Q)$(MAKE) -C $(KERNEL_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) -j$(CPUS) uImage 54 | 55 | modules: $(K_BLD_CONFIG) 56 | $(Q)mkdir -p $(KERNEL_OUT_DIR) 57 | $(Q)$(MAKE) -C $(KERNEL_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) -j$(CPUS) modules 58 | 59 | kernel-config: $(K_BLD_CONFIG) 60 | $(Q)$(MAKE) -C $(KERNEL_SRC) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) menuconfig 61 | 62 | u-boot: 63 | $(Q)mkdir -p $(UBOOT_OUT_DIR) 64 | $(Q)$(MAKE) -C $(UBOOT_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) KBUILD_OUTPUT=$(UBOOT_OUT_DIR) $(UBOOT_DEFCONFIG) 65 | $(Q)$(MAKE) -C $(UBOOT_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) KBUILD_OUTPUT=$(UBOOT_OUT_DIR) -j$(CPUS) all u-boot-dtb.img 66 | $(Q)cd $(SCRIPT_DIR) && ./padbootloader $(UBOOT_OUT_DIR)/u-boot-dtb.img 67 | 68 | bootloader: 69 | $(Q)mkdir -p $(BOOTLOAD_DIR) 70 | $(Q)cd $(TOOLS_DIR)/utils && ./$(BOOTLOADER_PACK) $(TOP_DIR)/$(IC_NAME)/bootloader/bootloader.bin $(BOARD_CONFIG_DIR)/bootloader.ini $(BOOTLOAD_DIR)/bootloader.bin 71 | 72 | misc: initramfs 73 | $(Q)echo "-- Build Fat Misc image --" 74 | $(Q)mkdir -p $(MISC_DIR) 75 | $(Q)mkdir -p $(IMAGE_DIR) 76 | $(Q)cp -r $(BOARD_CONFIG_DIR)/misc/* $(MISC_DIR)/ 77 | $(Q)cp $(KERNEL_OUT_DIR)/arch/$(ARCH)/boot/uImage $(MISC_DIR) 78 | $(Q)cp $(KERNEL_OUT_DIR)/arch/$(ARCH)/boot/dts/$(KERNEL_DTS).dtb $(MISC_DIR)/kernel.dtb 79 | $(Q)cp $(BOARD_CONFIG_DIR)/uenv.txt $(MISC_DIR) 80 | $(Q)dd if=/dev/zero of=$(IMAGE_DIR)/misc.img bs=1M count=$(MISC_IMAGE_SIZE) 81 | $(Q)$(TOOLS_DIR)/utils/makebootfat -o $(IMAGE_DIR)/misc.img -L misc -b $(SCRIPT_DIR)/bootsect.bin $(MISC_DIR) 82 | 83 | upramfs: 84 | $(Q)rm -rf $(UPRAMFS_ROOTFS) 85 | $(Q)mkdir -p $(UPRAMFS_ROOTFS) 86 | $(Q)$(SCRIPT_DIR)/populate_dir $(UPRAMFS_ROOTFS) 87 | $(Q)cp -rf $(TOP_DIR)/$(IC_NAME)/burn/initramfs/* $(UPRAMFS_ROOTFS) 88 | $(Q)$(CROSS_COMPILE)strip --strip-unneeded $(UPRAMFS_ROOTFS)/lib/modules/*.ko 89 | 90 | $(Q)$(SCRIPT_DIR)/gen_initramfs_list.sh -u 0 -g 0 $(UPRAMFS_ROOTFS) > $(BURN_DIR)/upramfs.list 91 | $(Q)${SCRIPT_DIR}/gen_init_cpio $(BURN_DIR)/upramfs.list > ${BURN_DIR}/upramfs.img.tmp 92 | $(Q)$(TOOLS_DIR)/utils/mkimage -n "RAMFS" -A arm -O linux -T ramdisk -C none -a 02000000 -e 02000000 -d ${BURN_DIR}/upramfs.img.tmp ${BURN_DIR}/upramfs.img 93 | $(Q)rm ${BURN_DIR}/upramfs.img.tmp 94 | $(Q)rm ${BURN_DIR}/upramfs.list 95 | 96 | firmware: bootloader upramfs misc recovery 97 | $(Q)mkdir -p $(BURN_DIR) 98 | $(Q)cp $(KERNEL_OUT_DIR)/arch/$(ARCH)/boot/uImage $(BURN_DIR) 99 | $(Q)cp $(KERNEL_OUT_DIR)/arch/$(ARCH)/boot/dts/$(KERNEL_DTS).dtb $(BURN_DIR)/kernel.dtb 100 | $(Q)cp $(UBOOT_OUT_DIR)/u-boot-dtb.img $(BURN_DIR)/ 101 | $(Q)cp $(UBOOT_OUT_DIR)/u-boot-dtb.img $(IMAGE_DIR)/ 102 | 103 | $(Q)cp $(BOOTLOAD_DIR)/bootloader.bin $(BURN_DIR)/ 104 | $(Q)cp $(BOOTLOAD_DIR)/bootloader.bin $(IMAGE_DIR)/ 105 | $(Q)cp $(TOP_DIR)/$(IC_NAME)/burn/adfudec/adfudec.bin $(BURN_DIR)/ 106 | 107 | $(Q)cp $(BOARD_CONFIG_DIR)/partition.cfg $(SCRIPT_DIR)/partition.cfg 108 | $(Q)python $(SCRIPT_DIR)/partition_create.py $(SCRIPT_DIR)/partition.cfg $(SCRIPT_DIR)/partition_tmp.cfg 109 | $(Q)sed -i 's/\\boardname\\/\\$(IC_NAME)_$(OS_NAME)_$(BOARD_NAME)\\/' $(SCRIPT_DIR)/partition_tmp.cfg 110 | 111 | $(Q)cp $(SCRIPT_DIR)/fwimage_linux.cfg $(SCRIPT_DIR)/fwimage_linux_tmp.cfg 112 | $(Q)sed -i 's/boardname/$(IC_NAME)_$(OS_NAME)_$(BOARD_NAME)/' $(SCRIPT_DIR)/fwimage_linux_tmp.cfg 113 | 114 | $(Q)echo "--Build Firmwares.." 115 | $(Q)cd $(SCRIPT_DIR) && ./linux_build_fw fwimage_linux_tmp.cfg $(IMAGE_DIR) $(FW_NAME) 116 | $(Q)rm $(SCRIPT_DIR)/partition_tmp.cfg $(SCRIPT_DIR)/partition.cfg $(SCRIPT_DIR)/fwimage_linux_tmp.cfg 117 | 118 | md5sum: 119 | @cd $(IMAGE_DIR) && md5sum *.* > image.md5 120 | 121 | 122 | clean: kernel_clean u-boot_clean bootloader_clean 123 | #$(Q)rm -rf $(TOP_DIR)/out 124 | 125 | kernel_clean: 126 | $(Q)$(MAKE) -C $(KERNEL_SRC) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) O=$(KERNEL_OUT_DIR) clean 127 | 128 | u-boot_clean: 129 | $(Q)$(MAKE) -C $(UBOOT_SRC) CROSS_COMPILE=$(CROSS_COMPILE) KBUILD_OUTPUT=$(UBOOT_OUT_DIR) clean 130 | 131 | bootloader_clean: 132 | @echo "" 133 | 134 | distclean: 135 | $(Q)$(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT_DIR) distclean 136 | $(Q)$(MAKE) -C $(UBOOT_SRC) KBUILD_OUTPUT=$(UBOOT_OUT_DIR) distclean 137 | rm -f $(TOP_DIR)/.config 138 | rm -rf $(TOP_DIR)/out 139 | 140 | mrproper: 141 | $(Q)$(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT_DIR) mrproper 142 | $(Q)$(MAKE) -C $(UBOOT_SRC) KBUILD_OUTPUT=$(UBOOT_OUT_DIR) mrproper 143 | 144 | include $(BOARD_CONFIG_DIR)/os.mk 145 | include $(TOP_DIR)/$(IC_NAME)/pcba_linux/pcba_linux.mk 146 | -------------------------------------------------------------------------------- /builder/snappy.mk: -------------------------------------------------------------------------------- 1 | include common.mk 2 | 3 | SNAPPY_VERSION := `date +%Y%m%d`-0 4 | SNAPPY_IMAGE := uc16-roseapple-pi-${SNAPPY_VERSION}.img 5 | # yes for latest version; no for the specific revision of edge/stable channel 6 | SNAPPY_CORE_NEW := yes 7 | SNAPPY_CORE_VER ?= 8 | SNAPPY_CORE_CH := stable 9 | GADGET_VERSION := `cat gadget/meta/snap.yaml | grep version: | awk '{print $$2}'` 10 | GADGET_SNAP := roseapple-pi_$(GADGET_VERSION)_armhf.snap 11 | KERNEL_SNAP_VERSION := `cat $(KERNEL_SRC)/prime/meta/snap.yaml | grep version: | awk '{print $$2}'` 12 | KERNEL_SNAP := roseapple-pi-kernel_$(KERNEL_SNAP_VERSION)_armhf.snap 13 | REVISION ?= 14 | SNAPPY_WORKAROUND := no 15 | SNAP_UBUNTU_IMAGE=/snap/bin/ubuntu-image 16 | 17 | all: build 18 | 19 | clean: 20 | rm -f $(OUTPUT_DIR)/*.img.xz 21 | distclean: clean 22 | 23 | build-snappy: 24 | ifeq ($(SNAPPY_CORE_NEW),no) 25 | $(eval REVISION = --revision $(SNAPPY_CORE_VER)) 26 | endif 27 | @echo "build snappy..." 28 | sudo $(SNAP_UBUNTU_IMAGE) \ 29 | --channel $(SNAPPY_CORE_CH) \ 30 | --image-size 4G \ 31 | --extra-snaps snapweb \ 32 | --extra-snaps bluez \ 33 | --extra-snaps modem-manager \ 34 | --extra-snaps network-manager \ 35 | --extra-snaps $(GADGET_SNAP) \ 36 | --extra-snaps $(KERNEL_SNAP) \ 37 | -o $(SNAPPY_IMAGE) \ 38 | roseapple.model 39 | 40 | fix-bootflag: 41 | sudo dd conv=notrunc if=boot_fix.bin of=$(SNAPPY_IMAGE) seek=440 oflag=seek_bytes 42 | 43 | workaround: 44 | ifeq ($(SNAPPY_WORKAROUND),yes) 45 | @echo "workaround something..." 46 | endif 47 | 48 | pack: 49 | sudo xz -0 $(SNAPPY_IMAGE) 50 | 51 | build: build-snappy fix-bootflag workaround pack 52 | 53 | .PHONY: build-snappy fix-bootflag workaround pack build 54 | -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/10_32/CompoundFW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/10_32/CompoundFW -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/10_64/CompoundFW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/10_64/CompoundFW -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/26/PyMaker.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/26/PyMaker.pyo -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/26/UnComment.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/26/UnComment.pyo -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/27/PyMaker.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/27/PyMaker.pyo -------------------------------------------------------------------------------- /builder/tools/fw_maker/AllRelease/27/UnComment.pyo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/AllRelease/27/UnComment.pyo -------------------------------------------------------------------------------- /builder/tools/fw_maker/maker_install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | #get cpu arc 3 | OS_ARC=0 4 | if [ "`uname -a | grep 64`" ];then 5 | OS_ARC=64 6 | else 7 | OS_ARC=32 8 | fi 9 | 10 | 11 | #get linux version 12 | CURRENT_VER=`cat /etc/issue` 13 | INSTALL_VER=10 14 | LINUX_VER=10 15 | 16 | VER10="buntu *10" 17 | echo "$CURRENT_VER" | grep -q "$VER10" 18 | if [ $? -eq 0 ]; then 19 | LINUX_VER=10 20 | fi 21 | 22 | VER11="buntu *11" 23 | echo "$CURRENT_VER" | grep -q "$VER11" 24 | if [ $? -eq 0 ]; then 25 | LINUX_VER=11 26 | fi 27 | 28 | VER12="buntu *12" 29 | echo "$CURRENT_VER" | grep -q "$VER12" 30 | if [ $? -eq 0 ]; then 31 | LINUX_VER=12 32 | fi 33 | 34 | #get python ver 35 | U_V1=`python -V 2>&1|awk '{print $2}'|awk -F '.' '{print $1}'` 36 | U_V2=`python -V 2>&1|awk '{print $2}'|awk -F '.' '{print $2}'` 37 | U_V3=`python -V 2>&1|awk '{print $2}'|awk -F '.' '{print $3}'` 38 | PY_VER=0 39 | 40 | if [ $U_V1 -lt 2 ];then 41 | echo 'Your python version is not OK!(1)' 42 | exit 1 43 | else 44 | if [ $U_V2 -eq 6 ];then 45 | PY_VER=26 46 | elif [ $U_V2 -eq 7 ];then 47 | PY_VER=27 48 | else 49 | echo 'Your python version is not OK!(3)' 50 | exit 1 51 | fi 52 | fi 53 | echo "$OS_ARC" bit,Ubuntu "$LINUX_VER",Python "$PY_VER" 54 | 55 | cp ./AllRelease/"$INSTALL_VER"_"$OS_ARC"/* ./Output 56 | cp ./AllRelease/"$PY_VER"/* ./Output 57 | 58 | -------------------------------------------------------------------------------- /builder/tools/fw_maker/readme.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/readme.doc -------------------------------------------------------------------------------- /builder/tools/fw_maker/release_note.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/fw_maker/release_note.txt -------------------------------------------------------------------------------- /builder/tools/utils/bootloader_pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/utils/bootloader_pack -------------------------------------------------------------------------------- /builder/tools/utils/bootloader_pack.arm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/utils/bootloader_pack.arm -------------------------------------------------------------------------------- /builder/tools/utils/dtc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/utils/dtc -------------------------------------------------------------------------------- /builder/tools/utils/makebootfat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/utils/makebootfat -------------------------------------------------------------------------------- /builder/tools/utils/mkimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xapp-le/SnappyUbuntuCore/58da1c95c49fe6f1a41a8b4cb69f294fe70b4401/builder/tools/utils/mkimage -------------------------------------------------------------------------------- /builder/u-boot.mk: -------------------------------------------------------------------------------- 1 | include common.mk 2 | 3 | all: build 4 | 5 | clean: 6 | if test -d "$(UBOOT_SRC)" ; then $(MAKE) ARCH=arm CROSS_COMPILE=${CC} -C $(UBOOT_SRC) clean ; fi 7 | rm -f $(UBOOT_BIN) 8 | rm -rf $(wildcard $(UBOOT_OUT)) 9 | 10 | distclean: clean 11 | rm -rf $(wildcard $(UBOOT_SRC)) 12 | 13 | $(UBOOT_BIN): $(UBOOT_SRC) 14 | mkdir -p $(UBOOT_OUT) 15 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=${CC} -C $(UBOOT_SRC) KBUILD_OUTPUT=$(UBOOT_OUT) $(UBOOT_DEFCONFIG) 16 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=${CC} -C $(UBOOT_SRC) KBUILD_OUTPUT=$(UBOOT_OUT) -j$(CPUS) all u-boot-dtb.img 17 | cd $(SCRIPT_DIR) && ./padbootloader $(UBOOT_OUT)/u-boot-dtb.img 18 | 19 | $(UBOOT_SRC): 20 | git clone $(UBOOT_REPO) -b $(UBOOT_BRANCH) u-boot 21 | 22 | u-boot: $(UBOOT_BIN) 23 | 24 | build: u-boot 25 | 26 | .PHONY: u-boot build 27 | -------------------------------------------------------------------------------- /prebuild_download.md: -------------------------------------------------------------------------------- 1 | # Roseapple-Pi image download 2 | 3 | ## edge 4 | - [uc16-roseapple-pi-20170505-0.img.xz](https://mega.nz/#!pzxBjL6D), key:[`!UXRcEj0D-L8H1rWb8oaZddE_53GrDR7yDUZWinbhKZw`] 5 | 6 | ## stable 7 | - [uc16-roseapple-pi-20170508-0.img.xz](https://mega.nz/#!Nm5gFYaQ), key:[`!CupoYn079tXeJwoAmeUC0UTpNVukuG0O3Ss8-CSu9Do`] 8 | 9 | --------------------------------------------------------------------------------