1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2025-06-05 22:19:21 +02:00

First work on updating the update mechanism using dracut for a kernel embedded initramfs

This commit is contained in:
j1nx 2024-12-14 09:57:50 +00:00
parent 8901830028
commit 3fa282766d
373 changed files with 850 additions and 126 deletions

@ -1 +1 @@
Subproject commit 889d135ea26318212092ad55bd88d1d0ba9cfb1e
Subproject commit fb2de1fc070863113f1e50d6588ed561b9faeb2e

View File

@ -1,31 +1,83 @@
set default="0"
set fallback="1"
set timeout="1"
if [ "$MACHINE_ID" == "" ]; then
boot_condition="systemd.condition-first-boot=true"
fi
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
set timeout=3
set timeout_style=menu
set menu_color_normal=white/black
set menu_color_highlight=white/red
load_env
set rootfs="A"
set ustate=0
default_cmdline="systemd.machine_id=$MACHINE_ID fsck.repair=yes zram.enabled=1 zram.num_devices=3 console=console consoleblank=0 loglevel=0 vt.global_cursor_default=0 logo.nologo systemd.show_status=0 systemd.unified_cgroup_hierarchy=1 cgroup_enable=cpuset cgroup_memory=1 $boot_condition rootwait quiet"
# Load GRUB environment variables
load_env -f /EFI/BOOT/grub.env
# Reset or decrement boot counter based on 'ustate'
if [ "${ustate}" != "1" ]; then
set boot_counter=3
else
if [ -z "${boot_counter}" ]; then
set boot_counter=2
else
if [ "${boot_counter}" == "1" ]; then
set boot_counter=0
elif [ "${boot_counter}" == "2" ]; then
set boot_counter=1
elif [ "${boot_counter}" == "3" ]; then
set boot_counter=2
fi
fi
fi
# Check if boot counter is '0' which means fallback is needed
if [ "${boot_counter}" == "0" ]; then
set ustate=3
# Swap the 'rootfs' variable to the other partition, simulating a fallback
if [ "${rootfs}" == "A" ]; then
set rootfs="B"
set rootfs_status_A="Fail"
set rootfs_status_B="Fallback"
else
set rootfs="A"
set rootfs_status_A="Fallback"
set rootfs_status_B="Fail"
fi
set boot_counter=3 # reset boot counter after fallback
else
# Determine the default boot entry and set status messages based on 'rootfs'
if [ "${rootfs}" == "A" ]; then
set default=0
set rootfs_status_A="Default"
set rootfs_status_B="Inactive"
elif [ "${rootfs}" == "B" ]; then
set default=1
set rootfs_status_A="Inactive"
set rootfs_status_B="Default"
fi
# Adjust status based on boot attempt
if [ "${ustate}" == "1" ]; then
if [ "${rootfs}" == "A" ]; then
set rootfs_status_A="Attempt ${boot_counter}"
else
set rootfs_status_B="Attempt ${boot_counter}"
fi
fi
fi
default_cmdline="fsck.repair=yes zram.enabled=1 zram.num_devices=3 logo.nologo systemd.unified_cgroup_hierarchy=1 cgroup_enable=cpuset cgroup_memory=1 $boot_condition rootwait"
file_env -f ($root)/cmdline.txt cmdline
regexp --set 1:boothd (.+),.+ ${root}
menuentry "OpenVoiceOS - Slot A" {
set default="0"
set fallback="1"
linux (${boothd},gpt2)/boot/kernel root=PARTUUID=c0932a41-44cf-463b-8152-d43188553ed4 ro $default_cmdline $cmdline
# Save all changes to necessary environment variables at once
save_env -f /EFI/BOOT/grub.env ustate boot_counter rootfs
menuentry "OpenVoiceOS - Slot A ${rootfs_status_A}" {
linux (${boothd},gpt2)/boot/kernel root=PARTUUID=c0932a41-44cf-463b-8152-d43188553ed4 rootrw=PARTUUID=f1326040-5236-40eb-b683-aaa100a9afcf init=/init $default_cmdline $cmdline
}
menuentry "OpenVoiceOS - Slot B" {
set default="1"
set fallback="0"
linux (${boothd},gpt3)/boot/kernel root=PARTUUID=3adea996-45ad-4928-920e-ffb5aedd00cb ro $default_cmdline $cmdline
menuentry "OpenVoiceOS - Slot B ${rootfs_status_B}" {
linux (${boothd},gpt3)/boot/kernel root=PARTUUID=3adea996-45ad-4928-920e-ffb5aedd00cb rootrw=PARTUUID=f1326040-5236-40eb-b683-aaa100a9afcf init=/init $default_cmdline $cmdline
}
menuentry "OpenVoiceOS - Slot A (Rescue shell)" {

View File

@ -0,0 +1 @@
Image

View File

@ -1,15 +1,17 @@
image esp.vfat {
vfat {
files = {
"bcm2711-rpi-400.dtb",
"bcm2711-rpi-4-b.dtb",
"bcm2711-rpi-cm4.dtb",
"rpi-firmware/cmdline.txt",
"rpi-firmware/config.txt",
"cmdline.txt",
"config.txt",
"uefi/RPI_EFI.fd",
"uefi/bcm2711-rpi-400.dtb",
"uefi/bcm2711-rpi-4-b.dtb",
"uefi/bcm2711-rpi-cm4.dtb",
"uefi/bcm2711-rpi-cm4-io.dtb",
"uefi/bcm2711-rpi-cm4s.dtb",
"uefi/overlays",
"rpi-firmware/fixup4x.dat",
"rpi-firmware/start4x.elf",
"rpi-firmware/overlays",
"rpi-firmware/RPI_EFI.fd",
"rpi-eeprom/pieeprom.sig",
"rpi-eeprom/pieeprom.upd"
}

View File

@ -0,0 +1,139 @@
### CYPRESS WIRELESS CONNECTIVITY DEVICES
### DRIVER END USER LICENSE AGREEMENT (SOURCE AND BINARY DISTRIBUTION)
PLEASE READ THIS END USER LICENSE AGREEMENT ("Agreement") CAREFULLY BEFORE
DOWNLOADING, INSTALLING, OR USING THIS SOFTWARE, ANY ACCOMPANYING
DOCUMENTATION, OR ANY UPDATES PROVIDED BY CYPRESS ("Software"). BY
DOWNLOADING, INSTALLING, OR USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND
BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
AGREEMENT, PROMPTLY RETURN AND DO NOT USE THE SOFTWARE. IF YOU HAVE
PURCHASED THE SOFTWARE, YOUR RIGHT TO RETURN THE SOFTWARE EXPIRES 30 DAYS
AFTER YOUR PURCHASE AND APPLIES ONLY TO THE ORIGINAL PURCHASER.
Software Provided in Binary Code Form. This paragraph applies to any Software
provided in binary code form. Subject to the terms and conditions of this
Agreement, Cypress Semiconductor Corporation ("Cypress") grants you a
non-exclusive, non-transferable license under its copyright rights in the
Software to reproduce and distribute the Software in object code form only,
solely for use in connection with Cypress integrated circuit products
("Purpose").
Software Provided in Source Code Form. This paragraph applies to any Software
provided in source code form ("Cypress Source Code"). Subject to the terms and
conditions of this Agreement, Cypress grants you a non-exclusive,
non-transferable license under its copyright rights in the Cypress Source Code
to reproduce, modify, compile, and distribute the Cypress Source Code (whether
in source code form or as compiled into binary code form) solely for the
Purpose. Cypress retains ownership of the Cypress Source Code and any compiled
version thereof. Subject to Cypress' ownership of the underlying Cypress
Source Code, you retain ownership of any modifications you make to the
Cypress Source Code. You agree not to remove any Cypress copyright or other
notices from the Cypress Source Code and any modifications thereof. Any
reproduction, modification, translation, compilation, or representation of
the Cypress Source Code except as permitted in this paragraph is prohibited
without the express written permission of Cypress.
Free and Open Source Software. Portions of the Software may be licensed under
free and/or open source licenses such as the GNU General Public License
("FOSS"). FOSS is subject to the applicable license agreement and not this
Agreement. If you are entitled to receive the source code from Cypress for any
FOSS included with the Software, either the source code will be included with
the Software or you may obtain the source code at no charge from
<http://www.cypress.com/go/opensource>. The applicable license terms will
accompany each source code package. To review the license terms applicable to
any FOSS for which Cypress is not required to provide you with source code,
please see the Software's installation directory on your computer.
Proprietary Rights. The Software, including all intellectual property rights
therein, is and will remain the sole and exclusive property of Cypress or its
suppliers. Except as otherwise expressly provided in this Agreement, you may
not: (i) modify, adapt, or create derivative works based upon the Software;
(ii) copy the Software; (iii) except and only to the extent explicitly
permitted by applicable law despite this limitation, decompile, translate,
reverse engineer, disassemble or otherwise reduce the Software to
human-readable form; or (iv) use the Software other than for the Purpose.
No Support. Cypress may, but is not required to, provide technical support for
the Software.
Term and Termination. This Agreement is effective until terminated, and either
party may terminate this Agreement at any time with or without cause. Your
license rights under this Agreement will terminate immediately without notice
from Cypress if you fail to comply with any provision of this Agreement. Upon
termination, you must destroy all copies of Software in your possession or
control. Termination of this Agreement will not affect any licenses validly
granted as of the termination date to any end users of the Software. The
following paragraphs shall survive any termination of this Agreement: "Free and
Open Source Software," "Proprietary Rights," "Compliance With Law,"
"Disclaimer," "Limitation of Liability," and "General."
Compliance With Law. Each party agrees to comply with all applicable laws,
rules and regulations in connection with its activities under this Agreement.
Without limiting the foregoing, the Software may be subject to export control
laws and regulations of the United States and other countries. You agree to
comply strictly with all such laws and regulations and acknowledge that you
have the responsibility to obtain licenses to export, re-export, or import
the Software.
Disclaimer. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES
NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THE SOFTWARE,
INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the
right to make changes to the Software without notice. Cypress does not assume
any liability arising out of the application or use of Software or any
product or circuit described in the Software. Cypress does not authorize its
products for use as critical components in life-support systems where a
malfunction or failure may reasonably be expected to result in significant
injury to the user. The inclusion of Cypress' product in a life-support
system or application implies that the manufacturer of such system or
application assumes all risk of such use and in doing so indemnifies Cypress
against all charges.
Limitation of Liability. IN NO EVENT WILL CYPRESS OR ITS SUPPLIERS,
RESELLERS, OR DISTRIBUTORS BE LIABLE FOR ANY LOST REVENUE, PROFIT, OR DATA,
OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES
HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE
USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF CYPRESS OR ITS SUPPLIERS,
RESELLERS, OR DISTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. IN NO EVENT SHALL CYPRESS' OR ITS SUPPLIERS' RESELLERS', OR
DISTRIBUTORS' TOTAL LIABILITY TO YOU, WHETHER IN CONTRACT, TORT (INCLUDING
NEGLIGENCE), OR OTHERWISE, EXCEED THE PRICE PAID BY YOU FOR THE SOFTWARE.
THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF THE ABOVE-STATED WARRANTY FAILS
OF ITS ESSENTIAL PURPOSE. BECAUSE SOME STATES OR JURISDICTIONS DO NOT ALLOW
LIMITATION OR EXCLUSION OF CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE
LIMITATION MAY NOT APPLY TO YOU.
Restricted Rights. The Software under this Agreement is commercial computer
software as that term is described in 48 C.F.R. 252.227-7014(a)(1). If
acquired by or on behalf of a civilian agency, the U.S. Government acquires
this commercial computer software and/or commercial computer software
documentation subject to the terms of this Agreement as specified in 48
C.F.R. 12.212 (Computer Software) and 12.211 (Technical Data) of the Federal
Acquisition Regulations ("FAR") and its successors. If acquired by or on
behalf of any agency within the Department of Defense ("DOD"), the U.S.
Government acquires this commercial computer software and/or commercial
computer software documentation subject to the terms of this Agreement as
specified in 48 C.F.R. 227.7202-3 of the DOD FAR Supplement ("DFAR") and its
successors.
General. This Agreement will bind and inure to the benefit of each party's
successors and assigns, provided that you may not assign or transfer this
Agreement, in whole or in part, without Cypress' written consent. This
Agreement shall be governed by and construed in accordance with the laws of
the State of California, United States of America, as if performed wholly
within the state and without giving effect to the principles of conflict of
law. The parties consent to personal and exclusive jurisdiction of and venue
in, the state and federal courts within Santa Clara County, California;
provided however, that nothing in this Agreement will limit Cypress' right to
bring legal action in any venue in order to protect or enforce its
intellectual property rights. No failure of either party to exercise or
enforce any of its rights under this Agreement will act as a waiver of such
rights. If any portion hereof is found to be void or unenforceable, the
remaining provisions of this Agreement shall remain in full force and
effect. This Agreement is the complete and exclusive agreement between the
parties with respect to the subject matter hereof, superseding and replacing
any and all prior agreements, communications, and understandings (both
written and oral) regarding such subject matter. Any notice to Cypress will
be deemed effective when actually received and must be sent to Cypress
Semiconductor Corporation, ATTN: Chief Legal Officer, 198 Champion Court, San
Jose, CA 95134 USA.

View File

@ -0,0 +1,9 @@
This directory contains *non-free* WLAN firmware that GNU/Linux might require you to
provide when seting up Wireless access on the Raspberry Pi 4. For instance, Debian 11
may ask you to provide these files during installation.
These files were extracted from:
https://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_20190114-1+rpt11_all.deb
The Bluetooth module may also require firmware from:
https://github.com/RPi-Distro/bluez-firmware/tree/master/broadcom

View File

@ -0,0 +1,98 @@
# Cloned from bcm94345wlpagb_p2xx.txt
NVRAMRev=$Rev: 498373 $
sromrev=11
vendid=0x14e4
devid=0x43ab
manfid=0x2d0
prodid=0x06e4
#macaddr=00:90:4c:c5:12:38
macaddr=b8:27:eb:74:f2:6c
nocrc=1
boardtype=0x6e4
boardrev=0x1304
#XTAL 37.4MHz
xtalfreq=37400
btc_mode=1
#------------------------------------------------------
#boardflags: 5GHz eTR switch by default
# 2.4GHz eTR switch by default
# bit1 for btcoex
boardflags=0x00480201
boardflags2=0x40800000
boardflags3=0x44200100
phycal_tempdelta=15
rxchain=1
txchain=1
aa2g=1
aa5g=1
tssipos5g=1
tssipos2g=1
femctrl=0
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
pa2ga0=-129,6525,-718
pa2ga1=-149,4408,-601
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
itrsw=1
pdoffsetcckma0=2
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
pdoffset2g40ma0=16
pdoffset40ma0=0x8888
pdoffset80ma0=0x8888
extpagain5g=2
extpagain2g=2
tworangetssi2g=1
tworangetssi5g=1
# LTECX flags
# WCI2
ltecxmux=0
ltecxpadnum=0x0504
ltecxfnsel=0x22
ltecxgcigpio=0x32
maxp2ga0=80
ofdmlrbw202gpo=0x0022
dot11agofdmhrbw202gpo=0x4442
mcsbw202gpo=0x98444422
mcsbw402gpo=0x98444422
maxp5ga0=82,82,82,82
mcsbw205glpo=0xb9555000
mcsbw205gmpo=0xb9555000
mcsbw205ghpo=0xb9555000
mcsbw405glpo=0xb9555000
mcsbw405gmpo=0xb9555000
mcsbw405ghpo=0xb9555000
mcsbw805glpo=0xb9555000
mcsbw805gmpo=0xb9555000
mcsbw805ghpo=0xb9555000
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
vcodivmode=1
deadman_to=481500000
ed_thresh2g=-54
ed_thresh5g=-54
eu_edthresh2g=-54
eu_edthresh5g=-54
ldo1=4
rawtempsense=0x1ff
cckPwrIdxCorr=3
cckTssiDelay=150
ofdmTssiDelay=150
txpwr2gAdcScale=1
txpwr5gAdcScale=1
dot11b_opts=0x3aa85
cbfilttype=1
fdsslevel_ch11=6
# Improved Bluetooth coexistence parameters from Cypress
btc_mode=1
btc_params8=0x4e20
btc_params1=0x7530
btc_params50=0x972c

View File

@ -0,0 +1,98 @@
# Cloned from bcm94345wlpagb_p2xx.txt
NVRAMRev=$Rev: 498373 $
sromrev=11
vendid=0x14e4
devid=0x43ab
manfid=0x2d0
prodid=0x06e4
#macaddr=00:90:4c:c5:12:38
macaddr=b8:27:eb:74:f2:6c
nocrc=1
boardtype=0x6e4
boardrev=0x1304
#XTAL 37.4MHz
xtalfreq=37400
btc_mode=1
#------------------------------------------------------
#boardflags: 5GHz eTR switch by default
# 2.4GHz eTR switch by default
# bit1 for btcoex
boardflags=0x00480201
boardflags2=0x40800000
boardflags3=0x44200100
phycal_tempdelta=15
rxchain=1
txchain=1
aa2g=1
aa5g=1
tssipos5g=1
tssipos2g=1
femctrl=0
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
pa2ga0=-129,6525,-718
pa2ga1=-149,4408,-601
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
itrsw=1
pdoffsetcckma0=2
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
pdoffset2g40ma0=16
pdoffset40ma0=0x8888
pdoffset80ma0=0x8888
extpagain5g=2
extpagain2g=2
tworangetssi2g=1
tworangetssi5g=1
# LTECX flags
# WCI2
ltecxmux=0
ltecxpadnum=0x0504
ltecxfnsel=0x22
ltecxgcigpio=0x32
maxp2ga0=80
ofdmlrbw202gpo=0x0022
dot11agofdmhrbw202gpo=0x4442
mcsbw202gpo=0x98444422
mcsbw402gpo=0x98444422
maxp5ga0=82,82,82,82
mcsbw205glpo=0xb9555000
mcsbw205gmpo=0xb9555000
mcsbw205ghpo=0xb9555000
mcsbw405glpo=0xb9555000
mcsbw405gmpo=0xb9555000
mcsbw405ghpo=0xb9555000
mcsbw805glpo=0xb9555000
mcsbw805gmpo=0xb9555000
mcsbw805ghpo=0xb9555000
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
vcodivmode=1
deadman_to=481500000
ed_thresh2g=-54
ed_thresh5g=-54
eu_edthresh2g=-54
eu_edthresh5g=-54
ldo1=4
rawtempsense=0x1ff
cckPwrIdxCorr=3
cckTssiDelay=150
ofdmTssiDelay=150
txpwr2gAdcScale=1
txpwr5gAdcScale=1
dot11b_opts=0x3aa85
cbfilttype=1
fdsslevel_ch11=6
# Improved Bluetooth coexistence parameters from Cypress
btc_mode=1
btc_params8=0x4e20
btc_params1=0x7530
btc_params50=0x972c

Some files were not shown because too many files have changed in this diff Show More