mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-21 14:21:27 +00:00
Chromium works with those parameters on armhf and arm64. Cache = /tmp (memory), size = /tmp size.
This commit is contained in:
parent
496a9d6212
commit
312c2db06f
3 changed files with 6 additions and 34 deletions
|
@ -6,7 +6,11 @@ CHROMIUM_FLAGS="\
|
|||
--disable-smooth-scrolling \
|
||||
--disable-low-res-tiling \
|
||||
--enable-low-end-device-mode \
|
||||
--num-raster-threads=4 \
|
||||
--num-raster-threads=$(grep -c processor /proc/cpuinfo) \
|
||||
--profiler-timing=0 \
|
||||
--disable-composited-antialiasing \
|
||||
--disk-cache-size=300000000
|
||||
--disk-cache-dir=/tmp/cache \
|
||||
--disk-cache-size=$(df -B1 /tmp --output=source,avail | tail -1 | awk '{print $2}') \
|
||||
--no-sandbox \
|
||||
--test-type \
|
||||
"
|
|
@ -22,10 +22,8 @@ install_desktop ()
|
|||
if [[ $RELEASE == xenial ]]; then
|
||||
# install optimized firefox configuration
|
||||
# cp $SRC/lib/config/firefox.conf $CACHEDIR/$SDCARD/etc/firefox/syspref.js
|
||||
|
||||
# install optimized chromium configuration
|
||||
cp $SRC/lib/config/chromium.conf $CACHEDIR/$SDCARD/etc/chromium-browser/default
|
||||
echo "export XDG_CACHE_HOME=\"/var/log/.cache\"" > $CACHEDIR/$SDCARD/etc/chromium-browser/customizations/10-cachedir
|
||||
fi
|
||||
# install dedicated startup icons
|
||||
cp $SRC/lib/bin/icons/${RELEASE}.png $CACHEDIR/$SDCARD/usr/share/pixmaps
|
||||
|
|
|
@ -312,41 +312,11 @@ check_sd_card_speed() {
|
|||
fi
|
||||
} # check_sd_card_speed
|
||||
|
||||
adjust_chromium_settings() {
|
||||
if [ -f /etc/chromium-browser/default ]; then
|
||||
|
||||
# create chromium cache directory
|
||||
[[ ! -d /var/log/.cache ]] && mkdir /var/log/.cache && chgrp netdev /var/log/.cache && chmod g+w /var/log/.cache
|
||||
|
||||
# Desktop image. Let's adjust chromium cache size depending on available DRAM (15%)
|
||||
# and count of render threads based on number of CPU cores
|
||||
mem_info=$(LANG=en_US.UTF-8 free -w 2>/dev/null | grep "^Mem" || LANG=en_US.UTF-8 free | grep "^Mem")
|
||||
memory_total=$(awk '{printf("%d",$2/1024)}' <<<${mem_info})
|
||||
cpu_cores=$(grep -c processor /proc/cpuinfo)
|
||||
chromium_disk_cache=$(( ${memory_total} * 158000 ))
|
||||
log2ram_size=$(( 50 + $(( ${memory_total} / 1000 * 150 )) ))
|
||||
|
||||
# adjust log2ram config if necessary (switching between devices with different amount
|
||||
# of DRAM but same OS image)
|
||||
grep -q "^SIZE=${log2ram_size}M" /etc/default/log2ram || \
|
||||
sed -i "s/^SIZE=.*/SIZE=${log2ram_size}M/" /etc/default/log2ram && \
|
||||
systemctl restart log2ram
|
||||
|
||||
# adjust chromium settings
|
||||
sed -i -e "s/disk-cache-size=.*/disk-cache-size=${chromium_disk_cache}/" \
|
||||
-e "s/num-raster-threads=.*/num-raster-threads=${cpu_cores}/" \
|
||||
/etc/chromium-browser/default
|
||||
fi
|
||||
} # adjust_chromium_settings
|
||||
|
||||
case $1 in
|
||||
*start*)
|
||||
# set optimal disk scheduler settings
|
||||
set_io_scheduler &
|
||||
|
||||
# check/set chromium optimizations
|
||||
adjust_chromium_settings &
|
||||
|
||||
# check sd card speed once on 3rd boot too warn for too slow media
|
||||
check_sd_card_speed &
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue