树莓派4B交叉编译更新Linux内核

树莓派4B交叉编译更新Linux内核参考:https://www.raspberrypi.com/documentation/computers/linux_kernel.html#kernel 以下基本全文复制官方教程。 原本树莓派4b运行的就是u...

树莓派
utils.js(deps.jquery).then(fn) } else { fn() } }, onLoading: (el) => { if (el) { $(el).append('
'); } }, onLoadSuccess: (el) => { if (el) { $(el).find('.loading-wrap').remove(); } }, onLoadFailure: (el) => { if (el) { $(el).find('.loading-wrap svg').remove(); $(el).find('.loading-wrap').append(''); $(el).find('.loading-wrap').addClass('error'); } }, request: (el, url, callback, onFailure) => { const maxRetry = 3; let retryCount = 0; return new Promise((resolve, reject) => { const load = () => { utils.onLoading?.(el); let timedOut = false; const timeout = setTimeout(() => { timedOut = true; console.warn('[request] 超时:', url); if (++retryCount >= maxRetry) { utils.onLoadFailure?.(el); onFailure?.(); reject('请求超时'); } else { setTimeout(load, 1000); } }, 5000); fetch(url).then(resp => { if (timedOut) return; clearTimeout(timeout); if (!resp.ok) throw new Error('响应失败'); return resp; }).then(data => { if (timedOut) return; utils.onLoadSuccess?.(el); callback(data); resolve(data); }).catch(err => { clearTimeout(timeout); console.warn('[request] 错误:', err); if (++retryCount >= maxRetry) { utils.onLoadFailure?.(el); onFailure?.(); reject(err); } else { setTimeout(load, 1000); } }); }; load(); }); }, requestWithoutLoading: (url, options = {}, maxRetry = 2, timeout = 5000) => { return new Promise((resolve, reject) => { let retryCount = 0; const tryRequest = () => { let timedOut = false; const timer = setTimeout(() => { timedOut = true; if (++retryCount > maxRetry) reject('timeout'); else tryRequest(); }, timeout); fetch(url, options) .then(resp => { clearTimeout(timer); if (!resp.ok) throw new Error('bad response'); resolve(resp); }) .catch(err => { clearTimeout(timer); if (++retryCount > maxRetry) reject(err); else setTimeout(tryRequest, 500); }); }; tryRequest(); }); }, /********************** requestAnimationFrame ********************************/ // 1、requestAnimationFrame 会把每一帧中的所有 DOM 操作集中起来,在一次重绘或回流中就完成,并且重绘或回流的时间间隔紧紧跟随浏览器的刷新频率,一般来说,这个频率为每秒60帧。 // 2、在隐藏或不可见的元素中,requestAnimationFrame 将不会进行重绘或回流,这当然就意味着更少的的 cpu,gpu 和内存使用量。 requestAnimationFrame: (fn) => { if (!window.requestAnimationFrame) { window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame; } window.requestAnimationFrame(fn) }, dark: {}, }; // utils.dark.mode 当前模式 dark or light // utils.dark.toggle() 暗黑模式触发器 // utils.dark.push(callBack[,"callBackName"]) 传入触发器回调函数 utils.dark.method = { toggle: new RunItem(), }; utils.dark = Object.assign(utils.dark, { push: utils.dark.method.toggle.push, });