boot.img too large when I compile AOSP11 source code for OTA - android-source

I trying to enable AB OTA in AOSP11 source code.
Followed below steps:
Step 1:
BOARD_USES_AB_IMAGE := true
Step 2 : CONFIG_ANDROID_AB=y in u boot source code.
Getting below compilation error :
libcameradevice curr board is yy356x
[ 91% 48807/53497] Target boot image from recovery: out/target/product/xx/boot.img
FAILED: out/target/product/xx/boot.img
/bin/bash -c "(out/host/linux-x86/bin/mkbootimg --kernel out/target/product/xx/kernel --ramdis
k out/target/product/xx/ramdisk-recovery.img --cmdline "console=ttyFIQ0 androidboot.baseband=N/
A androidboot.wificountrycode=CN androidboot.veritymode=enforcing androidboot.hardware=yy30board andro
idboot.console=ttyFIQ0 androidboot.verifiedbootstate=orange firmware_class.path=/vendor/etc/firmware i
nit=/init rootwait ro init=/init androidboot.selinux=permissive buildvariant=userdebug" --recovery_dt
bo out/target/product/xx/rebuild-dtbo.img --dtb out/target/product/xx/dtb.img --os_version
11 --os_patch_level 2021-08-05 --second kernel/resource.img --header_version 2 --output out/target/
product/xx/boot.img ) && (size=$(for i in out/target/product/xx/boot.img; do stat -c "%s" "$i" | tr -d '\n'; echo +; done; echo 0); total=$(( $( echo "$size" ) )); printname=$(ec
ho -n " out/target/product/xx/boot.img" | tr " " +); maxsize=$(( 100663296-0)); if [ "
$total" -gt "$maxsize" ]; then echo "error: $printname too large ($total > $maxsize)"; false;
elif [ "$total" -gt $((maxsize - 32768)) ]; then echo "WARNING: $printname approaching size li
mit ($total now; limit $maxsize)"; fi )"
error: +out/target/product/xx/boot.img too large (103485440 > 100663296)
[ 91% 48808/53497] //libcore/mmodules/intracoreapi:art-module-intra-core-api-stubs-source metalava mer
metalava detected access to files that are not explicitly specified. See /home/test/aosp/aa_android/
out/soong/.intermediates/libcore/mmodules/intracoreapi/art-module-intra-core-api-stubs-source/android_
common/art-module-intra-core-api-stubs-source-violations.txt for details.
01:25:09 ninja failed with: exit status 1
failed to build some targets (02:42:20 (hh:mm:ss))

Related

How does vimscript execute functions through multiple threads?

I have a function for generating tags via ctags:
:function! UpdateCtags()
if !has('linux')
echohl ErrorMsg | echo 'This function only supports running under the linux operating system.' | echohl None
return
endif
echo 'Generating labels...'
let output = system('ctags -f ' . g:tags_file . ' -R /usr/include')
if v:shell_error == 0
echo 'Generated labels successfully.'
else
echohl ErrorMsg | echo output | echohl None
endif
:endfunction
I want to simply execute the UpdateCtags function through multiple threads, how can I do this?
My neovim version:
$ nvim -v
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info

Github workflow gets invalid when adding a grep command

I am trying to run a conditional check before running the run command.
And the docker runs on ubuntu.
runs-on: ubuntu-latest
- name: 'Running checks with test'
if: ${{grep -c 'ApexClass' package/package.xml > 0}}
run: |
echo "Found ApexClass"
- name: 'Running checks without test'
if: ${{grep -c 'ApexClass' package/package.xml < 0}}
run: |
echo "No Apex Found"
And throws an error :
The workflow is not valid. .github/workflows/preDeployCheckQA.yml (Line: 32, Col: 13): Unrecognized named-value: 'grep'. Located at position 1 within expression: grep -c 'ApexClass' package/package.xml > 0 .github/workflows/preDeployCheckQA.yml (Line: 36, Col: 13): Unrecognized named-value: 'grep'. Located at position 1 within expression: grep -c 'ApexClass' package/package.xml < 0
How do I add a check like grep
If this is not supported, I would try and:
define a variable apexcl=$(grep -c 'ApexClass' package/package.xml)
use if in the if conditional
That is:
if: ${{ apexcl != '' }}
run...
if: ${{ apexcl == '' }}
run...

Eclipse Makefile Error

I need some help with solving an error. I was trying to create a simple bluetooth server using the library bluez-5.31 . I am using eclipse on Raspbian Jessie which is similar to Debian but I have little to no experience with either one. I tried fixing it for a couple days now and nothing seems to be working so i really need some help...
This is the error description:
error 1: make:*** [Bluetooth Server 2]Error 1 Resource: Bluetooth Server 2
error 2: recipe for target 'Bluetooth Server 2' failed Resource: makefile Path: /Bluetooth Server 2/Debug Location: line 45
where "Bluetooth Server 2" is the name of the project[/code]
This is main:
#include "/usr/include/stdint.h"
#include "/usr/include/bluez-5.31/lib/bluetooth.h"
#include "/usr/include/bluez-5.31/lib/hci.h"
#include "/usr/include/bluez-5.31/lib/hci_lib.h"
#include "/usr/include/bluez-5.31/lib/rfcomm.h"
int main(int argc, char **argv)
{
struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };
char buf[1024] = { 0 };
int s, client, bytes_read;
unsigned int opt = sizeof(rem_addr);
//allocate socket
s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
//bind socket to port 1 of the first available adapter
bdaddr_t tmp = {0,0,0,0,0,0};
loc_addr.rc_family = AF_BLUETOOTH;
loc_addr.rc_bdaddr = tmp;
loc_addr.rc_channel = 1;
bind(s, (struct sockaddr* )&loc_addr, sizeof(loc_addr));
//put socket into listening mode
listen(s, 1);
//accept one connection
client = accept(s, (struct sockaddr *)&rem_addr, &opt);
ba2str( &rem_addr.rc_bdaddr, buf );
fprintf( stderr, "accepter connection from %s\n", buf);
memset( buf, 0, sizeof(buf));
//read data from the client
bytes_read = recv(client, buf, sizeof(buf), 0);
if( bytes_read > 0 )
{
printf("received [%s]\n", buf);
}
//close connection
//close(client);
//close(s);
return 0;
}
This is the make file:
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: Bluetooth\ Server\ 2
# Tool invocations
Bluetooth\ Server\ 2: $(OBJS) $(USER_OBJS)
#echo 'Building target: $#'
#echo 'Invoking: GCC C++ Linker'
g++ -L/usr/include/ -bluez-5.31 -o "Bluetooth Server 2" $(OBJS) $(USER_OBJS) $(LIBS)
#echo 'Finished building target: $#'
#echo ' '
# Other Targets
clean:
-$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_U PPER_DEPS) "Bluetooth Server 2"
-#echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
And this is what changes i made to project properties:
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Miscellaneous: In the linker flags box i wrote: "-bluez-5.31"
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Libraries: Added " "bluez-5.31" " in -l
- C/C++ Build >> Settings >> Tool Settings >> GCC C++ Linker >> Libraries: Added " /usr/include " in -L

Compile a static version of pngquant

I'm trying to create a statically linked version of pngquant in Oracle Linux Server release 7.1. I've compiled the static version of zlib and the static version of libpng.
Then, when I configure pngquant, I always get the information that it will be linked with a shared version of zlib.
$ ./configure --with-libpng=../libpng-1.6.21 --extra-cflags="-I../zlib-1.2.8" --extra-ldflags="../zlib-1.2.8/libz.a"
Compiler: gcc
Debug: no
SSE: yes
OpenMP: no
libpng: static (1.6.21)
zlib: shared (1.2.7)
lcms2: no
If I execute make, in the output it seems that the options are correctly passed to the compiler. However, the resulting binary requires libz.so to be executed. It seems that my directives are ignored or that the installed version always takes precedence.
Is there any way of forcing pngquant to be compiled with the static version of zlib?
I'm not sure, if I got it right, but here's a patch to pngquant's configure that worked for me. configure now accepts --with-zlib=<dir> as parameter. Store it to pngquant.patch and apply it with patch -uN -p1 -i pngquant.patch.
diff -ur pngquant-2.9.0/configure pngquant-2.9.0.fixed/configure
--- pngquant-2.9.0/configure 2017-03-06 09:37:30.000000000 +0100
+++ pngquant-2.9.0.fixed/configure 2017-03-07 09:57:20.246012152 +0100
## -48,6 +48,7 ##
help "--with-cocoa/--without-cocoa use Cocoa framework to read images"
fi
help "--with-libpng=<dir> search for libpng in directory"
+ help "--with-zlib=<dir> search for zlib in directory"
echo
help "CC=<compiler> use given compiler command"
help "CFLAGS=<flags> pass options to the compiler"
## -97,6 +98,9 ##
--with-libpng=*)
LIBPNG_DIR=${i#*=}
;;
+ --with-zlib=*)
+ ZLIB_DIR=${i#*=}
+ ;;
--prefix=*)
PREFIX=${i#*=}
;;
## -238,6 +242,19 ##
echo "${MAJ}${MIN}"
}
+# returns full zlib.h version string
+zlibh_string() {
+ echo "$(grep -m1 "define ZLIB_VERSION" "$1" | \
+ grep -Eo '"[^"]+"' | grep -Eo '[^"]+')"
+}
+
+# returns major minor version numbers from png.h
+zlibh_majmin() {
+ local MAJ=$(grep -m1 "define ZLIB_VER_MAJOR" "$1" | grep -Eo "[0-9]+")
+ local MIN=$(grep -m1 "define ZLIB_VER_MINOR" "$1" | grep -Eo "[0-9]+")
+ echo "${MAJ}${MIN}"
+}
+
error() {
status "$1" "error ... $2"
echo
## -420,11 +437,42 ##
error "libpng" "not found (try: $LIBPNG_CMD)"
fi
-# zlib
-if ! find_library "zlib" "z" "zlib.h" "libz.a" "libz.$SOLIBSUFFIX*"; then
- error "zlib" "not found (please install zlib-devel package)"
+# try if given flags are enough for zlib
+HAS_ZLIB=0
+if echo "#include \"zlib.h\"
+ int main(){
+ uLong test = zlibCompileFlags();
+ return 0;
+}" | "$CC" -xc -std=c99 -o /dev/null $CFLAGS $LDFLAGS - &> /dev/null; then
+ status "zlib" "custom flags"
+ HAS_ZLIB=1
fi
+if [ "$HAS_ZLIB" -eq 0 ]; then
+ # try static in the given directory
+ ZLIBH=$(find_h "$ZLIB_DIR" "zlib.h")
+ if [ -n "$ZLIBH" ]; then
+ ZLIBH_STRING=$(zlibh_string "$ZLIBH")
+ ZLIBH_MAJMIN=$(zlibh_majmin "$ZLIBH")
+ if [[ -n "$ZLIBH_STRING" && -n "$ZLIBH_MAJMIN" ]]; then
+ ZLIBA=$(find_f "$ZLIB_DIR" "libz${ZLIBH_MAJMIN}.a")
+ if [ -z "$ZLIBA" ]; then
+ ZLIBA=$(find_f "$ZLIB_DIR" "libz.a")
+ fi
+ if [ -n "$ZLIBA" ]; then
+ cflags "-I${ZLIBH%/*}"
+ lflags "${ZLIBA}"
+ status "zlib" "static (${ZLIBH_STRING})"
+ HAS_ZLIB=1
+ fi
+ fi
+ fi
+fi
+# zlib
+if ! find_library "zlib" "z" "zlib.h" "libz.a" "zlib.$SOLIBSUFFIX*"; then
+ error "zlib" "not found (please install zlib-devel package)"
+fi
+
# lcms2
if [ "$LCMS2" != 0 ]; then
if find_library "lcms2" "lcms2" "lcms2.h" "liblcms2.a" "liblcms2.$SOLIBSUFFIX*"; then
Sorry, the configure script does not support it. It shouldn't be too hard to modify configure to pass appropriate flags to pkg-config or do the same workaround it does for libpng.

Logstash v2.2.0 fails to start as a service

+ PATH=/sbin:/usr/sbin:/bin:/usr/bin
+ export PATH
+ id -u
+ [ 0 -ne 0 ]
+ name=logstash
+ pidfile=/var/run/logstash.pid
+ LS_USER=logstash
+ LS_GROUP=logstash
+ LS_HOME=/var/lib/logstash
+ LS_HEAP_SIZE=1g
+ LS_LOG_DIR=/var/log/logstash
+ LS_LOG_FILE=/var/log/logstash/logstash.log
+ LS_CONF_DIR=/etc/logstash/conf.d
+ LS_OPEN_FILES=16384
+ LS_NICE=19
+ LS_OPTS=
+ [ -r /etc/default/logstash ]
+ . /etc/default/logstash
+ KILL_ON_STOP_TIMEOUT=0
+ [ -r /etc/sysconfig/logstash ]
+ program=/opt/logstash/bin/logstash
+ args=agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
+ status
+ [ -f /var/run/logstash.pid ]
+ cat /var/run/logstash.pid
+ pid=12716
+ kill -0 12716
+ return 2
+ code=2
+ [ 2 -eq 0 ]
+ start
+ LS_JAVA_OPTS= -Djava.io.tmpdir=/var/lib/logstash
+ HOME=/var/lib/logstash
+ export PATH HOME LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING
+ id -Gn logstash
+ + sed s/,$//
tr ,
+ echo
+ SGROUPS=logstash
+ [ ! -z logstash ]
+ EXTRA_GROUPS=--groups logstash
+ ulimit -n 16384
+ echo 22073
+ echo logstash started.
logstash started.
+ return 0
+ code=0
+ exit 0
+ nice -n 19 chroot --userspec logstash:logstash --groups logstash / sh -c
cd /var/lib/logstash
ulimit -n 16384
exec "/opt/logstash/bin/logstash" agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
The above is the command output when the logstash service is started.
(Got this by adding -x switch to the start of the init.d script - #!/bin/sh -x)
Logstash v2.2.0 is installed using the DEB package on Ubuntu 14.04
When I run the exec command that is used by the init script (as seen in the above output) logstash startups pretty fine and works flawlessly
"/opt/logstash/bin/logstash" agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
There is something in the init.d service script that causes logstash to fail as a service. I suspect the nice command that the init script uses.
Do you guys see any issues with the 'nice' command that is being used in the init script ?
+ nice -n 19 chroot --userspec logstash:logstash --groups logstash / sh -c
cd /var/lib/logstash
ulimit -n 16384
exec "/opt/logstash/bin/logstash" agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
When you have uninstalled older version, the logstash user and group was also removed. Now with new installation a new logstash user and group was created with different uid and gid. Yet the ownership of common logstash directories belongs to the old logstash uid and gid.
Now when you start new logstash it tries to read/write to this dir and fails hence logstash not running.
Try changing ownership of these dir and start logstash
chown -R logstash:logstash /var/log/logstash
chown -R logstash:logstash /var/lib/logstash
chown -R logstash:logstash /etc/logstash
rm -rf /var/run/logstash.pid
/etc/init.d/logstash start