mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Compare commits
7 Commits
v24.11.1
...
bsp-bugfix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d0bdc1fd0 | ||
|
|
960cc5db43 | ||
|
|
770439e6ff | ||
|
|
57350451f2 | ||
|
|
e8ec9e4a75 | ||
|
|
6328fdf5c7 | ||
|
|
06dda19cb0 |
@@ -9,6 +9,6 @@ CHROMIUM_FLAGS="--disable-smooth-scrolling \
|
||||
--profiler-timing=0 \
|
||||
--disable-composited-antialiasing \
|
||||
--disk-cache-dir=/tmp/${USER}-cache \
|
||||
--disk-cache-size=$(findmnt --target /tmp -n -o AVAIL -b | awk '{printf ("%0.0f",$1*0.3); }') \
|
||||
--disk-cache-size=$(findmnt --noheadings --output AVAIL --bytes --target "/tmp" --uniq | awk '{printf ("%0.0f",$1*0.3); }') \
|
||||
--no-sandbox \
|
||||
--test-type"
|
||||
|
||||
0
packages/bsp/common/etc/kernel/postinst.d/xx-initramfs-cleanup
Executable file → Normal file
0
packages/bsp/common/etc/kernel/postinst.d/xx-initramfs-cleanup
Executable file → Normal file
0
packages/bsp/common/etc/kernel/postrm.d/xx-initramfs-cleanup
Executable file → Normal file
0
packages/bsp/common/etc/kernel/postrm.d/xx-initramfs-cleanup
Executable file → Normal file
@@ -73,15 +73,16 @@ function get_ip_addresses() {
|
||||
|
||||
function storage_info() {
|
||||
# storage info
|
||||
RootInfo=$(df -h /)
|
||||
root_usage=$(awk '/\// {print $(NF-1)}' <<<${RootInfo} | sed 's/%//g')
|
||||
root_total=$(awk '/\// {print $(NF-4)}' <<<${RootInfo})
|
||||
StorageInfo=$(df -h $STORAGE 2>/dev/null | grep $STORAGE)
|
||||
if [[ -n "${StorageInfo}" && ${RootInfo} != *$STORAGE* ]]; then
|
||||
storage_usage=$(awk '/\// {print $(NF-1)}' <<<${StorageInfo} | sed 's/%//g')
|
||||
storage_total=$(awk '/\// {print $(NF-4)}' <<<${StorageInfo})
|
||||
local RootInfo=$(df --output=source,size,pcent --human-readable "/" | tail -n1)
|
||||
local root_device="$(awk '{print $1}' <<<${RootInfo})"
|
||||
root_total=$(awk '{print $2}' <<<${RootInfo})
|
||||
root_usage=$(awk '{print $3}' <<<${RootInfo} | sed 's/%//g')
|
||||
if [[ "${root_device}" != "${STORAGE}" && -b "${STORAGE}" ]]; then
|
||||
local StorageInfo=$(df --output=size,pcent --human-readable "${STORAGE}" | tail -n1)
|
||||
storage_total=$(awk '{print $1}' <<<${StorageInfo})
|
||||
storage_usage=$(awk '{print $2}' <<<${StorageInfo} | sed 's/%//g')
|
||||
if [[ -n "$(command -v smartctl)" ]]; then
|
||||
DISK="${STORAGE::-1}"
|
||||
DISK="/dev/$(lsblk --noheadings --nodeps --output PKNAME "${STORAGE}")"
|
||||
storage_temp+=$(smartctl -l scttempsts $DISK 2> /dev/null | grep -i 'Current Temperature:' | awk '{print $(NF-1)}')
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -46,7 +46,7 @@ set_io_scheduler() {
|
||||
|
||||
prepare_board() {
|
||||
|
||||
CheckDevice=$(for i in /var/log /var /; do findmnt -n -o SOURCE $i && break; done)
|
||||
CheckDevice=$(for i in /var/log /var /; do findmnt --noheadings --output SOURCE --target "$i" --uniq && break; done)
|
||||
# adjust logrotate configs
|
||||
if [[ "${CheckDevice}" == *"/dev/zram"* || "${CheckDevice}" == "armbian-ramlog" ]]; then
|
||||
for ConfigFile in /etc/logrotate.d/*; do sed -i -e "s/\/var\/log\//\/var\/log.hdd\//g" "${ConfigFile}"; done
|
||||
|
||||
@@ -208,7 +208,7 @@ do_expand_filesystem()
|
||||
local partdev=$1
|
||||
local mountpoint=$2
|
||||
|
||||
local fstype=$(findmnt -n -o FSTYPE $mountpoint) # i.e. ext4 or btrfs
|
||||
local fstype=$(findmnt --noheadings --output FSTYPE --target "$mountpoint" --uniq) # i.e. ext4 or btrfs
|
||||
|
||||
echo -e "\n### [resize2fs] Trying to resize $fstype filesystem on $partdev:\n"
|
||||
|
||||
@@ -235,7 +235,7 @@ do_expand_filesystem()
|
||||
|
||||
# check whether reboot is necessary for resize2fs to take effect
|
||||
local devsize=$(lsblk -n -b -o SIZE $partdev | head -1)
|
||||
local fssize=$(findmnt -n -b -o SIZE --target $mountpoint)
|
||||
local fssize=$(findmnt --noheadings --output SIZE --bytes --target "$mountpoint" --uniq)
|
||||
if [[ $(( 100 * $fssize / $devsize )) -lt 90 ]]; then
|
||||
echo -e "\n### [resize2fs] Automated reboot needed to finish the resize procedure"
|
||||
touch /var/run/resize2fs-reboot
|
||||
@@ -258,8 +258,8 @@ main()
|
||||
KERNELID=$(uname -r)
|
||||
echo "$(date) | ${BOARD_NAME} | ${VERSION} | ${DISTRO_ARCH} | ${CPU_ARCH} | ${KERNELID}"
|
||||
|
||||
# trim any btrfs subvolume identifier given in square brackets (e.g. /dev/mapper/armbian-root[/@])
|
||||
local rootdev=$(findmnt -n -o SOURCE / | sed 's~\[.*\]~~') # i.e. /dev/mmcblk0p1, /dev/sda1 or /dev/mapper/armbian-root
|
||||
# Use `--nofsroot` to trim any btrfs subvolume identifier given in square brackets (e.g. /dev/mapper/armbian-root[/@])
|
||||
local rootdev=$(findmnt --noheadings --output SOURCE --nofsroot --target "/" --uniq) # i.e. /dev/mmcblk0p1, /dev/sda1 or /dev/mapper/armbian-root
|
||||
|
||||
# check for crypt
|
||||
local cryptname=""
|
||||
|
||||
@@ -20,7 +20,7 @@ if [ -z "`grep ^Storage=volatile /etc/systemd/journald.conf`" -a -z "$(ls -A /ru
|
||||
journalctl --relinquish-var # make sure to do volatile logging until the next flush
|
||||
fi
|
||||
|
||||
logusage=$(df /var/log/ --output=pcent | tail -1 |cut -d "%" -f 1)
|
||||
logusage=$(df --output=pcent "/var/log/" | awk 'END{print $1}' | sed 's/%//')
|
||||
if [ $logusage -ge $treshold ]; then
|
||||
# remove journal backup files created by armbian-ramdisk in case of duplicate journals directories
|
||||
rm -rf /var/log.hdd/journal-*
|
||||
|
||||
@@ -131,8 +131,8 @@ create_armbian()
|
||||
echo "Root: \$2 $2 $FilesystemChoosen" >> $logfile
|
||||
|
||||
# calculate usage and see if it fits on destination
|
||||
USAGE=$(df -BM | grep ^/dev | head -1 | awk '{print $3}' | tr -cd '[0-9]. \n')
|
||||
DEST=$(df -BM | grep ^/dev | grep "${TempDir}"/rootfs | awk '{print $4}' | tr -cd '[0-9]. \n')
|
||||
USAGE=$(df --output="used" --block-size=1M "/" | awk 'END{print $1}')
|
||||
DEST=$(df --output="avail" --block-size=1M "${TempDir}/rootfs" | awk 'END{print $1}')
|
||||
if [[ $USAGE -gt $DEST ]]; then
|
||||
dialog --title "$title" --backtitle "$backtitle" --colors --infobox\
|
||||
"\n\Z1Partition too small.\Zn Needed: $USAGE MB Avaliable: $DEST MB" 5 60
|
||||
@@ -395,7 +395,7 @@ create_armbian()
|
||||
|
||||
mkswap "${TempDir}"/rootfs/swapfile >> $logfile
|
||||
chmod 0600 "${TempDir}"/rootfs/swapfile
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ resume=UUID=$(findmnt -no UUID -T "${TempDir}"/rootfs/swapfile) resume_offset=$(filefrag -v "${TempDir}"/rootfs/swapfile |grep " 0:"| awk '{print $4}' | cut -d"." -f1)\"/" "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ resume=UUID=$(findmnt --noheadings --output UUID --target "${TempDir}/rootfs/swapfile" --uniq) resume_offset=$(filefrag -v "${TempDir}"/rootfs/swapfile |grep " 0:"| awk '{print $4}' | cut -d"." -f1)\"/" "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg
|
||||
|
||||
echo "GRUB_DISABLE_OS_PROBER=false" >> "${TempDir}"/rootfs/etc/default/grub.d/98-armbian.cfg
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ image=BACKUP-arm-64-emmc.img
|
||||
|
||||
if [ "$wantsbackup" = true ]
|
||||
then
|
||||
rootfree=$(df | grep /$ | awk '{print $4}')
|
||||
rootfree=$(df --output="avail" "/" | awk 'END{print $1}')
|
||||
[ $rootfree -le $intsize ] && echo -e "$_r NOT ENOUGH FREE SPACE! \n FORCING COMPRESSION MODE $_x" && compress=true
|
||||
else
|
||||
echo "$_b AVAILABLE DEVICES: "$_g"$(echo $avail)""$_x"
|
||||
|
||||
@@ -405,7 +405,7 @@ PatchScriptBin() {
|
||||
# try to find location of script.bin
|
||||
Path2ScriptBin=/boot
|
||||
if [ ! -f "${Path2ScriptBin}/script.bin" ]; then
|
||||
Path2ScriptBin="$(df | awk -F" " '/^\/dev\/mmcblk0p1/ {print $6}')"
|
||||
Path2ScriptBin="$(findmnt --noheadings --output TARGET --source "/dev/mmcblk0p1" --uniq)"
|
||||
if [ ! -f "${Path2ScriptBin}/script.bin" ]; then
|
||||
echo -e "Aborted\nCan not find script.bin. Ensure boot partition is mounted" >&2
|
||||
logger "Can not find script.bin. Ensure boot partition is mounted"
|
||||
|
||||
Reference in New Issue
Block a user