diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-01-02 13:57:49 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-01-02 13:59:22 -0800 |
commit | a0a63e6712122c758bd51fcec0bb3697f92df203 (patch) | |
tree | 583a104818564ee14b51c9ce570ad15d0aeee21d /populate-new-device.sh | |
parent | 3a182ec19f708859b672cbea69d9a749297244d8 (diff) | |
download | device_common-a0a63e6712122c758bd51fcec0bb3697f92df203.tar.gz device_common-a0a63e6712122c758bd51fcec0bb3697f92df203.tar.bz2 device_common-a0a63e6712122c758bd51fcec0bb3697f92df203.zip |
Script to generate a skeleton for new devices
Change-Id: I4dddb5c7d089c680911e62e6987158df29db581c
Diffstat (limited to 'populate-new-device.sh')
-rwxr-xr-x | populate-new-device.sh | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/populate-new-device.sh b/populate-new-device.sh new file mode 100755 index 0000000..90ab783 --- /dev/null +++ b/populate-new-device.sh @@ -0,0 +1,186 @@ +#!/usr/bin/env bash + +# Copyright 2013 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if test "$1" = "" -o "$2" = "" +then + echo "Need a manufacturer name and a device name" + exit 1 +fi + +mkdir -p device/$1/$2 +mkdir -p device/$1/$2-kernel +mkdir -p vendor/$1/$2 + +cat > device/$1/$2/vendorsetup.sh << EOF +# +# Copyright 2013 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +add_lunch_combo full_$2-userdebug +EOF + +cat > device/$1/$2/AndroidProducts.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +PRODUCT_MAKEFILES := \$(LOCAL_DIR)/full_$2.mk +EOF + +cat > device/$1/$2/full_$2.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +\$(call inherit-product, \$(SRC_TARGET_DIR)/product/full_base.mk) +\$(call inherit-product, device/$1/$2/device.mk) + +PRODUCT_NAME := full_$2 +PRODUCT_DEVICE := $2 +PRODUCT_BRAND := Android +PRODUCT_MODEL := $2 +PRODUCT_MANUFACTURER := $1 +EOF + +cat > device/$1/$2/device.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ifeq (\$(TARGET_PREBUILT_KERNEL),) +LOCAL_KERNEL := device/$1/$2-kernel/kernel +else +LOCAL_KERNEL := \$(TARGET_PREBUILT_KERNEL) +endif + +PRODUCT_COPY_FILES := \\ + \$(LOCAL_KERNEL):kernel + +\$(call inherit-product-if-exists, vendor/$1/$2/device-vendor.mk) +EOF + +cat > device/$1/$2/BoardConfig.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Use the non-open-source parts, if they're present +-include vendor/$1/$2/BoardConfigVendor.mk + +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +EOF + +touch device/$1/$2-kernel/kernel +touch device/$1/$2-kernel/MODULE_LICENSE_GPL + +cat > vendor/$1/$2/device-vendor.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +EOF + +cat > vendor/$1/$2/BoardConfigVendor.mk << EOF +# +# Copyright 2013 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +EOF + |