land: Update extract scripts to latest templates
Signed-off-by: Darshan Manjrekar <darshanmanjrekar1205@gmail.com>
This commit is contained in:
parent
7069b2a85e
commit
c67e2f669c
2 changed files with 31 additions and 23 deletions
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 The CyanogenMod Project
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
# Copyright (C) 2017 The LineageOS Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -20,7 +21,7 @@ set -e
|
||||||
DEVICE=land
|
DEVICE=land
|
||||||
VENDOR=xiaomi
|
VENDOR=xiaomi
|
||||||
|
|
||||||
# Load extractutils and do some sanity checks
|
# Load extract_utils and do some sanity checks
|
||||||
MY_DIR="${BASH_SOURCE%/*}"
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||||
|
|
||||||
|
@ -33,25 +34,31 @@ if [ ! -f "$HELPER" ]; then
|
||||||
fi
|
fi
|
||||||
. "$HELPER"
|
. "$HELPER"
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
# default to not sanitizing the vendor folder before extraction
|
||||||
SRC=adb
|
clean_vendor=false
|
||||||
else
|
|
||||||
if [ $# -eq 1 ]; then
|
while [ "$1" != "" ]; do
|
||||||
SRC=$1
|
case $1 in
|
||||||
else
|
-p | --path ) shift
|
||||||
echo "$0: bad number of arguments"
|
SRC=$1
|
||||||
echo ""
|
;;
|
||||||
echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
|
-s | --section ) shift
|
||||||
echo ""
|
SECTION=$1
|
||||||
echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
|
clean_vendor=false
|
||||||
echo "the device using adb pull."
|
;;
|
||||||
exit 1
|
-c | --clean-vendor ) clean_vendor=true
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$SRC" ]; then
|
||||||
|
SRC=adb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Initialize the helper
|
# Initialize the helper
|
||||||
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
|
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false $clean_vendor
|
||||||
|
|
||||||
extract "$MY_DIR"/proprietary-files.txt "$SRC"
|
extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
|
||||||
|
|
||||||
"$MY_DIR"/setup-makefiles.sh
|
"$MY_DIR"/setup-makefiles.sh
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2016 The CyanogenMod Project
|
# Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
# Copyright (C) 2017 The LineageOS Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@ -17,11 +18,12 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Required!
|
|
||||||
DEVICE=land
|
DEVICE=land
|
||||||
VENDOR=xiaomi
|
VENDOR=xiaomi
|
||||||
|
|
||||||
# Load extractutils and do some sanity checks
|
INITIAL_COPYRIGHT_YEAR=2016
|
||||||
|
|
||||||
|
# Load extract_utils and do some sanity checks
|
||||||
MY_DIR="${BASH_SOURCE%/*}"
|
MY_DIR="${BASH_SOURCE%/*}"
|
||||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||||
|
|
||||||
|
@ -40,8 +42,7 @@ setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
|
||||||
# Copyright headers and guards
|
# Copyright headers and guards
|
||||||
write_headers
|
write_headers
|
||||||
|
|
||||||
# The standard blobs
|
|
||||||
write_makefiles "$MY_DIR"/proprietary-files.txt
|
write_makefiles "$MY_DIR"/proprietary-files.txt
|
||||||
|
|
||||||
# We are done!
|
# Finish
|
||||||
write_footers
|
write_footers
|
||||||
|
|
Loading…
Reference in a new issue