├── patch ├── .gitempty ├── kernel │ └── .gitempty └── filesystem │ ├── .gitempty │ └── fs.patch ├── Buildroot ├── board │ └── FOG │ │ └── FOS │ │ ├── create_group │ │ └── rootfs_overlay │ │ ├── usr │ │ └── share │ │ │ └── fog │ │ │ ├── lib │ │ │ ├── EOFRESTOREPART │ │ │ ├── EOFCHNTPW │ │ │ └── EOFFIXPARTS │ │ │ ├── BCD │ │ │ └── mbr │ │ │ ├── xp.mbr │ │ │ ├── vista.mbr │ │ │ ├── win7.mbr │ │ │ └── win8.mbr │ │ ├── bin │ │ ├── fog.checkimgvar │ │ ├── fog.statusreporter │ │ ├── fog.nonimgcomplete │ │ ├── fog.testdisk │ │ ├── fog.checkmountdrivesize │ │ ├── fog.checkmount │ │ ├── fog.mount │ │ ├── fog.surfacetest │ │ ├── fog.photorec │ │ ├── fog.wipe │ │ ├── fog.imgcomplete │ │ ├── fog.debug │ │ ├── fog.chntpw │ │ ├── fog.chpass │ │ ├── fog.auto.reg │ │ ├── fog │ │ ├── fog.checkin │ │ ├── fog.capone │ │ ├── fog.inventory │ │ ├── fog.av │ │ └── fog.sysinfo │ │ └── etc │ │ ├── init.d │ │ ├── K40network │ │ ├── S99fog │ │ └── S40network │ │ ├── fstab │ │ ├── profile │ │ ├── inittab │ │ └── ssh │ │ └── sshd_config └── package │ ├── testdisk │ ├── Config.in │ └── testdisk.mk │ ├── cabextract │ ├── Config.in │ └── cabextract.mk │ ├── fog │ ├── fog.hash │ ├── Config.in │ ├── src │ │ ├── Makefile │ │ └── fogmbrfix.cpp │ └── fog.mk │ ├── chntpw │ ├── Config.in │ ├── chntpw.mk │ └── chntpw.patch │ ├── newConf.in │ ├── partclone │ ├── Config.in │ ├── partclone.mk │ └── partclone-0.3.33.patch │ └── partimage │ ├── Config.in │ ├── partimage-0.6.9-sysmacros.patch │ ├── partimage.mk │ ├── partimage-0.6.9-nolibintl.patch │ ├── partimage-0.6.9-nmu.patch │ ├── partimage-0.6.9-configure.patch │ ├── partimage-0.6.9-fifo.patch │ └── partimage-0.6.9-fog.patch ├── .gitignore ├── KernelPackages └── drivers │ └── net │ └── ethernet │ └── realtek │ ├── Makefile │ ├── r8125 │ ├── r8125_n.o │ ├── rtltool.o │ ├── r8125_fiber.o │ ├── rtl_eeprom.o │ ├── Kconfig │ ├── .built-in.a.cmd │ ├── built-in.a │ ├── Makefile │ ├── rtl_eeprom.h │ ├── r8125_fiber.h │ ├── r8125_firmware.h │ ├── rtltool.h │ ├── r8125_rss.h │ ├── r8125_realwow.h │ ├── r8125_ptp.h │ └── r8125_dash.h │ ├── r8126 │ ├── r8126_n.o │ ├── rtltool.o │ ├── r8126_fiber.o │ ├── rtl_eeprom.o │ ├── Kconfig │ ├── .built-in.a.cmd │ ├── built-in.a │ ├── Makefile │ ├── rtl_eeprom.h │ ├── r8126_fiber.h │ ├── r8126_firmware.h │ ├── rtltool.h │ ├── r8126_rss.h │ ├── r8126_realwow.h │ ├── r8126_ptp.h │ └── r8126_dash.h │ ├── r8168 │ ├── r8168_n.o │ ├── rtltool.o │ ├── r8168_asf.o │ ├── rtl_eeprom.o │ ├── Kconfig │ ├── .built-in.a.cmd │ ├── built-in.a │ ├── Makefile │ ├── rtl_eeprom.h │ ├── r8168_firmware.h │ ├── rtltool.h │ ├── r8168_fiber.h │ ├── r8168_rss.h │ ├── r8168_realwow.h │ └── r8168_dash.h │ └── Kconfig ├── .github └── workflows │ └── make_usb.yml ├── README.md ├── dependencies.sh ├── release.sh └── create-usb-image.sh /patch/.gitempty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /patch/kernel/.gitempty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /patch/filesystem/.gitempty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/create_group: -------------------------------------------------------------------------------- 1 | - -1 kvm -1 * - - - kvm nodes 2 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/EOFRESTOREPART: -------------------------------------------------------------------------------- 1 | w 2 | 3 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/EOFCHNTPW: -------------------------------------------------------------------------------- 1 | 1 2 | q 3 | y 4 | 5 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/EOFFIXPARTS: -------------------------------------------------------------------------------- 1 | y 2 | w 3 | y 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | fssource*/ 2 | kernelsource*/ 3 | linux-*/ 4 | dist/ 5 | buildroot*.tar.xz 6 | linux-*.tar.xz 7 | -------------------------------------------------------------------------------- /Buildroot/package/testdisk/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_TESTDISK 2 | bool "TestDisk & PhotoRec" 3 | help 4 | Photo & Disk recover utilities 5 | -------------------------------------------------------------------------------- /Buildroot/package/cabextract/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_CABEXTRACT 2 | bool "CAB Extractor" 3 | help 4 | See http://www.cabextract.org.uk/ 5 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/BCD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/BCD -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/Makefile: -------------------------------------------------------------------------------- 1 | 2 | obj-$(CONFIG_R8125) += r8125/ 3 | obj-$(CONFIG_R8126) += r8126/ 4 | obj-$(CONFIG_R8168) += r8168/ 5 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_n.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_n.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/rtltool.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8125/rtltool.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_n.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_n.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/rtltool.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8126/rtltool.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_n.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_n.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/rtltool.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8168/rtltool.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_asf.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_asf.o -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/xp.mbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/xp.mbr -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_fiber.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_fiber.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/rtl_eeprom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8125/rtl_eeprom.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_fiber.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_fiber.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/rtl_eeprom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8126/rtl_eeprom.o -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/rtl_eeprom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/KernelPackages/drivers/net/ethernet/realtek/r8168/rtl_eeprom.o -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/vista.mbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/vista.mbr -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/win7.mbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/win7.mbr -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/win8.mbr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FOGProject/fos/HEAD/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/mbr/win8.mbr -------------------------------------------------------------------------------- /Buildroot/package/fog/fog.hash: -------------------------------------------------------------------------------- 1 | sha512 35ee72a6dba282bd727452f9358a63316cbe5b1c18ff878f0623aed86c4f7fea7290103d8aa86530660665f513f881b007ec5f499b1dd5277ebccd8909a8be88 fog_1.tar.gz 2 | -------------------------------------------------------------------------------- /Buildroot/package/chntpw/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_CHNTPW 2 | bool "CHNTPW - Offline NT Password Editor" 3 | select BR2_PACKAGE_OPENSSL 4 | help 5 | NT Password reset utility. 6 | -------------------------------------------------------------------------------- /Buildroot/package/fog/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_FOG 2 | bool "FOG Binaries & Scripts" 3 | select BR2_PACKAGE_PARTED 4 | help 5 | FOG specific scripts & binaries from the current release. 6 | -------------------------------------------------------------------------------- /Buildroot/package/fog/src/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for the fog initrd binaries 3 | # 4 | # 5 | all: fogmbrfix 6 | fogmbrfix: 7 | $(CXX) $(CXXFLAGS) -o fogmbrfix fogmbrfix.cpp 8 | clean: 9 | rm -f *.o fogmbrfix 10 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/Kconfig: -------------------------------------------------------------------------------- 1 | 2 | source "drivers/net/ethernet/realtek/r8125/Kconfig" 3 | source "drivers/net/ethernet/realtek/r8126/Kconfig" 4 | source "drivers/net/ethernet/realtek/r8168/Kconfig" 5 | 6 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/Kconfig: -------------------------------------------------------------------------------- 1 | config R8126 2 | tristate "Realtek 5G Ethernet driver (r8126)" 3 | depends on PCI && MII 4 | help 5 | This is the official Realtek 5G Ethernet driver. 6 | 7 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/Kconfig: -------------------------------------------------------------------------------- 1 | config R8168 2 | tristate "Realtek GBE Ethernet driver (r8168)" 3 | depends on PCI && MII 4 | help 5 | This is the official Realtek GBE Ethernet driver. 6 | 7 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/Kconfig: -------------------------------------------------------------------------------- 1 | config R8125 2 | tristate "Realtek 2.5G Ethernet driver (r8125)" 3 | depends on PCI && MII 4 | help 5 | This is the official Realtek 2.5G Ethernet driver. 6 | 7 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.checkimgvar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dots "Checking img variable is set" 3 | if [[ -z $img ]]; then 4 | echo "Failed" 5 | debugPause 6 | handleError "Fatal Error: img variable not set. ($0)\n Args Passed: $*" 7 | fi 8 | echo "Done" 9 | debugPause 10 | -------------------------------------------------------------------------------- /Buildroot/package/newConf.in: -------------------------------------------------------------------------------- 1 | menu "Packages for FOG" 2 | source "package/chntpw/Config.in" 3 | source "package/fog/Config.in" 4 | source "package/partclone/Config.in" 5 | source "package/testdisk/Config.in" 6 | source "package/cabextract/Config.in" 7 | source "package/partimage/Config.in" 8 | endmenu 9 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/.built-in.a.cmd: -------------------------------------------------------------------------------- 1 | savedcmd_drivers/net/ethernet/realtek/r8168/built-in.a := rm -f drivers/net/ethernet/realtek/r8168/built-in.a; printf "drivers/net/ethernet/realtek/r8168/%s " r8168_n.o r8168_asf.o rtl_eeprom.o rtltool.o | xargs ar cDPrST drivers/net/ethernet/realtek/r8168/built-in.a 2 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/.built-in.a.cmd: -------------------------------------------------------------------------------- 1 | savedcmd_drivers/net/ethernet/realtek/r8125/built-in.a := rm -f drivers/net/ethernet/realtek/r8125/built-in.a; printf "drivers/net/ethernet/realtek/r8125/%s " r8125_n.o rtl_eeprom.o rtltool.o r8125_fiber.o | xargs ar cDPrST drivers/net/ethernet/realtek/r8125/built-in.a 2 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/.built-in.a.cmd: -------------------------------------------------------------------------------- 1 | savedcmd_drivers/net/ethernet/realtek/r8126/built-in.a := rm -f drivers/net/ethernet/realtek/r8126/built-in.a; printf "drivers/net/ethernet/realtek/r8126/%s " r8126_n.o rtl_eeprom.o rtltool.o r8126_fiber.o | xargs ar cDPrST drivers/net/ethernet/realtek/r8126/built-in.a 2 | -------------------------------------------------------------------------------- /Buildroot/package/partclone/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PARTCLONE 2 | bool "partclone" 3 | help 4 | Partclone 5 | The Free and Open Source Software for Partition Imaging and Cloning 6 | 7 | http://partclone.org 8 | 9 | comment "partclone requires a toolchain with LARGEFILE+WCHAR support" 10 | depends on !(BR2_USE_WCHAR) 11 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/K40network: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ifaces=$(ls -1 /sys/class/net | tr -d '@') 3 | for iface in $ifaces; do 4 | if [[ x$iface == xlo ]]; then 5 | /sbin/ip link set lo down 6 | continue 7 | fi 8 | echo "Stopping $iface interface" 9 | /sbin/udhcpc -i $iface -R 10 | /sbin/ip link set $iface down 11 | done 12 | exit $? 13 | -------------------------------------------------------------------------------- /Buildroot/package/cabextract/cabextract.mk: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | # 3 | # cabextract 4 | # 5 | ########################################################### 6 | 7 | CABEXTRACT_SITE=http://www.cabextract.org.uk 8 | CABEXTRACT_VERSION=1.4 9 | CABEXTRACT_SOURCE=cabextract-$(CABEXTRACT_VERSION).tar.gz 10 | CABEXTRACT_CONF_OPTS=ac_cv_func_fnmatch_gnu=yes ac_cv_func_fnmatch_works=yes 11 | 12 | $(eval $(autotools-package)) 13 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/built-in.a: -------------------------------------------------------------------------------- 1 | ! 2 | // 52 ` 3 | r8125_n.o/ 4 | rtl_eeprom.o/ 5 | rtltool.o/ 6 | r8125_fiber.o/ 7 | 8 | /0 0 0 0 644 455568 ` 9 | /11 0 0 0 644 10016 ` 10 | /25 0 0 0 644 6712 ` 11 | /36 0 0 0 644 10992 ` 12 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/built-in.a: -------------------------------------------------------------------------------- 1 | ! 2 | // 52 ` 3 | r8126_n.o/ 4 | rtl_eeprom.o/ 5 | rtltool.o/ 6 | r8126_fiber.o/ 7 | 8 | /0 0 0 0 644 308368 ` 9 | /11 0 0 0 644 10088 ` 10 | /25 0 0 0 644 5872 ` 11 | /36 0 0 0 644 11032 ` 12 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/built-in.a: -------------------------------------------------------------------------------- 1 | ! 2 | // 50 ` 3 | r8168_n.o/ 4 | r8168_asf.o/ 5 | rtl_eeprom.o/ 6 | rtltool.o/ 7 | 8 | /0 0 0 0 644 1256280 ` 9 | /11 0 0 0 644 15656 ` 10 | /24 0 0 0 644 10088 ` 11 | /38 0 0 0 644 5840 ` 12 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/fstab: -------------------------------------------------------------------------------- 1 | # 2 | /dev/root / ext2 rw,noauto 0 1 3 | proc /proc proc defaults 0 0 4 | devpts /dev/pts devpts defaults,gid=5,mode=620 0 0 5 | tmpfs /dev/shm tmpfs mode=0777 0 0 6 | tmpfs /tmp tmpfs mode=1777 0 0 7 | tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 8 | sysfs /sys sysfs defaults 0 0 9 | efivarfs /sys/firmware/efi/efivars efivars defaults 0 0 10 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_PARTIMAGE 2 | bool "partimage" 3 | select BR2_PACKAGE_NTFS_3G_NTFSPROGS 4 | select BR2_PACKAGE_E2FSPROGS 5 | select BR2_PACKAGE_READLINE 6 | select BR2_PACKAGE_UTIL_LINUX 7 | select BR2_PACKAGE_UTIL_LINUX_LIBUUID 8 | help 9 | partimage, the GNU partition resizing program 10 | 11 | http://www.partimage.org/Main_Page 12 | 13 | comment "partimage requires a toolchain with LARGEFILE+WCHAR support" 14 | depends on !(BR2_USE_WCHAR) 15 | -------------------------------------------------------------------------------- /Buildroot/package/testdisk/testdisk.mk: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 3 | # testdisk 4 | # 5 | ############################################################# 6 | TESTDISK_VERSION:=7.2 7 | TESTDISK_SOURCE:=testdisk-$(TESTDISK_VERSION).tar.bz2 8 | TESTDISK_SITE:=http://www.cgsecurity.org 9 | TESTDISK_INSTALL_STAGING=YES 10 | TESTDISK_LIBTOOL_PATCH=NO 11 | TESTDISK_CONF_OPTS = --program-transform-name= 12 | TESTDISK_DEPENDENCIES = ncurses 13 | 14 | $(eval $(autotools-package)) 15 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage-0.6.9-sysmacros.patch: -------------------------------------------------------------------------------- 1 | diff -rupN partimage-0.6.9_orig/src/client/misc.cpp partimage-0.6.9_new/src/client/misc.cpp 2 | --- partimage-0.6.9_orig/src/client/misc.cpp 2010-07-25 10:30:31.000000000 -0500 3 | +++ partimage-0.6.9_new/src/client/misc.cpp 2019-04-27 03:28:24.711728836 -0500 4 | @@ -46,6 +46,7 @@ 5 | #include 6 | #include 7 | #include 8 | +#include 9 | 10 | #include "misc.h" 11 | #include "partimage.h" 12 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/profile: -------------------------------------------------------------------------------- 1 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin 2 | if [ $(id -u) -eq 0 ]; then 3 | export PS1='\[\e[1;34m\][\d \u@\h \w]\$\[\e[m\] ' 4 | else 5 | export PS1='\[\e[1;32m\][\d \u@\h \w]\$\[\e[m\] ' 6 | fi 7 | export PAGER='/bin/more ' 8 | export EDITOR='/bin/vim' 9 | alias vi='vim' 10 | alias ls='ls --color=auto' 11 | # Source configuration files from /etc/profile.d 12 | for i in /etc/profile.d/*.sh ; do 13 | if [ -r "$i" ]; then 14 | . $i 15 | fi 16 | unset i 17 | done 18 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # partimage 4 | # 5 | ################################################################################ 6 | 7 | PARTIMAGE_VERSION = 0.6.9 8 | PARTIMAGE_SOURCE = partimage-$(PARTIMAGE_VERSION).tar.bz2 9 | PARTIMAGE_SITE = http://downloads.sourceforge.net/project/partimage/stable/0.6.9 10 | PARTIMAGE_DEPENDENCIES = e2fsprogs 11 | PARTIMAGE_INSTALL_STAGING = YES 12 | PARTIMAGE_CONF_OPTS = ac_cv_func_setpgrp_void=yes --disable-ssl 13 | 14 | $(eval $(autotools-package)) 15 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.statusreporter: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sysuuid=$(dmidecode -s system-uuid) 3 | sysuuid=${sysuuid,,} 4 | oIFS=$IFS 5 | IFS=$'\n' 6 | mac="$1" 7 | web="$2" 8 | usleep 3000000 9 | while :; do 10 | tmpfile="/tmp/status.fog" 11 | status=$(tail -n 2 $tmpfile 2>/dev/null | head -n 1 2>/dev/null) 12 | cat /dev/null > $tmpfile 2>/dev/null 13 | [[ -z $mac ]] && continue 14 | status=$(echo $status | base64) 15 | res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&status=$status" ${web}service/progress.php 2>/dev/null) 16 | usleep 3000000 17 | done 18 | IFS=$oIFS 19 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.nonimgcomplete: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo " * Task Complete" 3 | [[ ! -z $1 ]] && mactosend="$1" || mactosend="$mac" 4 | count=0 5 | res="" 6 | sysuuid=$(dmidecode -s system-uuid) 7 | sysuuid=${sysuuid,,} 8 | dots "Updating Database" 9 | while [[ $res != "##" ]]; do 10 | res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mactosend" ${web}service/Post_Wipe.php 2>/dev/null) 11 | if [[ $count -ge 10 ]]; then 12 | echo "Failed" 13 | debugPause 14 | handleError "Could not complete tasking. ($0)\n Args Passed: $*" 15 | fi 16 | let count+=1 17 | usleep 5000000 18 | done 19 | echo "Done" 20 | debugPause 21 | -------------------------------------------------------------------------------- /.github/workflows/make_usb.yml: -------------------------------------------------------------------------------- 1 | name: Add USB Image to Release 2 | 3 | on: 4 | release: 5 | types: 6 | - published 7 | 8 | jobs: 9 | add-usb-image: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v2 15 | 16 | - name: Create USB Image 17 | run: | 18 | sudo apt-get install grub-efi-amd64 parted kpartx 19 | sudo ./create-usb-image.sh "https://github.com/${{github.repository}}/releases/download/${{ github.event.release.tag_name }}" 20 | 21 | - name: Release 22 | uses: softprops/action-gh-release@v1 23 | with: 24 | files: /tmp/fos-usb.img 25 | -------------------------------------------------------------------------------- /Buildroot/package/fog/fog.mk: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 3 | # fog 4 | # 5 | ############################################################# 6 | FOG_VERSION = 1 7 | FOG_SOURCE = fog_$(FOG_VERSION).tar.gz 8 | FOG_SITE = https://www.fogproject.org 9 | FOG_DEPENDENCIES = parted 10 | 11 | define FOG_BUILD_CMDS 12 | cp -rf package/fog/src $(@D) 13 | $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/src \ 14 | CXXFLAGS="$(TARGET_CXXFLAGS)" \ 15 | LDFLAGS="$(TARGET_LDFLAGS)" 16 | endef 17 | 18 | define FOG_INSTALL_TARGET_CMDS 19 | $(INSTALL) -D -m 0755 $(@D)/src/fogmbrfix $(TARGET_DIR)/bin/fogmbrfix 20 | $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/bin/fogmbrfix 21 | endef 22 | 23 | $(eval $(generic-package)) 24 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.testdisk: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | disks="" 6 | disk="" 7 | hd="" 8 | parts="" 9 | part="" 10 | getHardDisk "true" 11 | [[ -z $disks ]] && handleError "No Hard disks not found! ($0)\n Args Passed: $*" 12 | for disk in $disks; do 13 | echo " Starting TestDisk on $disk" 14 | getPartitions "$disk" 15 | for part in $parts; do 16 | dots " * Scanning $part" 17 | testdisk "$part" >/dev/null 2>&1 18 | case $? in 19 | 0) 20 | echo "Done" 21 | ;; 22 | *) 23 | echo "Failed" 24 | debugPause 25 | continue 26 | ;; 27 | esac 28 | debugPause 29 | done 30 | done 31 | . /bin/fog.nonimgcomplete 32 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.checkmountdrivesize: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dots "Checking Server Disk Space" 3 | getServerDiskSpaceUsage=$(df -h | grep "/images" | sed -n '/dev/{s/ */ /gp}') 4 | echo "Done" 5 | 6 | dots "Server Disk Size Total" 7 | serverDiskSizeTotal=$(echo "$getServerDiskSpaceUsage" | cut -d ' ' -f2) 8 | echo "$serverDiskSizeTotal" 9 | 10 | dots "Server Disk Size Used" 11 | serverDiskSizeUsed=$(echo "$getServerDiskSpaceUsage" | cut -d ' ' -f3) 12 | echo "$serverDiskSizeUsed" 13 | 14 | dots "Server Disk Size Used Percentage" 15 | serverDiskSizeUsedPercent=$(echo "$getServerDiskSpaceUsage" | cut -d ' ' -f5) 16 | echo "$serverDiskSizeUsedPercent" 17 | 18 | dots "Server Disk Size Available" 19 | serverDiskSizeAvailable=$(echo "$getServerDiskSpaceUsage" | cut -d ' ' -f4) 20 | [[ $serverDiskSizeAvailable == "0" ]] && serverDiskSizeAvailable="0M" 21 | echo "$serverDiskSizeAvailable" 22 | 23 | debugPause -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.checkmount: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sysuuid=$(dmidecode -s system-uuid) 3 | sysuuid=${sysuuid,,} 4 | dots "Checking Mounted File System" 5 | if [[ ! -f /images/.mntcheck ]]; then 6 | count=0 7 | while [[ $blame != '##' ]]; do 8 | blame=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&type=$type" ${web}service/blame.php 2>/dev/null) 9 | case $count in 10 | [0-8]) 11 | let count+=1 12 | usleep 5000000 13 | ;; 14 | 9) 15 | echo "Failed" 16 | debugPause 17 | handleError "Error during failure notification: $blame ($0)\n Args Passed: $*" 18 | ;; 19 | esac 20 | done 21 | echo "Failed" 22 | debugPause 23 | handleError "Could not verify mount point, check if .mntcheck exists ($0)\n Args Passed: $*" 24 | fi 25 | echo "Done" 26 | debugPause 27 | -------------------------------------------------------------------------------- /Buildroot/package/chntpw/chntpw.mk: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # 3 | # chntpw 4 | # 5 | ############################################################# 6 | CHNTPW_VERSION = 140201 7 | CHNTPW_SOURCE = chntpw-source-$(CHNTPW_VERSION).zip 8 | CHNTPW_SITE = http://pogostick.net/~pnh/ntpasswd 9 | 10 | define CHNTPW_EXTRACT_CMDS 11 | unzip $(DL_DIR)/chntpw/$(CHNTPW_SOURCE) -d $(BUILD_DIR) 12 | endef 13 | 14 | define CHNTPW_BUILD_CMDS 15 | $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \ 16 | CFLAGS="$(TARGET_CFLAGS)" \ 17 | LDFLAGS="$(TARGET_LDFLAGS)" 18 | endef 19 | 20 | define CHNTPW_INSTALL_TARGET_CMDS 21 | $(INSTALL) -D -m 0755 $(@D)/chntpw $(TARGET_DIR)/usr/sbin/chntpw 22 | $(INSTALL) -D -m 0755 $(@D)/reged $(TARGET_DIR)/usr/sbin/reged 23 | $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/chntpw 24 | $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/reged 25 | endef 26 | 27 | $(eval $(generic-package)) 28 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage-0.6.9-nolibintl.patch: -------------------------------------------------------------------------------- 1 | diff -pruN partimage-0.6.9/src/client/partimage.h partimage-0.6.9.new/src/client/partimage.h 2 | --- partimage-0.6.9/src/client/partimage.h 2010-07-25 10:30:31.000000000 -0500 3 | +++ partimage-0.6.9.new/src/client/partimage.h 2010-12-02 10:40:36.938076907 -0600 4 | @@ -19,7 +19,9 @@ 5 | #define PARTIMAGE_H 6 | 7 | #include 8 | +#ifndef __UCLIBC__ 9 | #include // intl translation 10 | +#endif 11 | #include 12 | #include 13 | #include 14 | @@ -76,10 +78,12 @@ extern CInterface *g_interface; 15 | extern bool g_bSigInt; 16 | extern bool g_bSigKill; 17 | 18 | -#ifdef OS_LINUX 19 | +#if defined OS_LINUX && !defined __UCLIBC__ 20 | #define i18n(X) gettext(X) 21 | #else 22 | - #define i18n(X) (X) 23 | + #define i18n(X) (char*)(X) 24 | + #define bindtextdomain(X, Y) 25 | + #define textdomain(X) 26 | #endif 27 | 28 | #define my_min(a,b) ((a) < (b) ? (a) : (b)) 29 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.mount: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | umount /ntfs >/dev/null 2>&1 3 | umount /images >/dev/null 2>&1 4 | umount /bcdstore >/dev/null 2>&1 5 | dots "Mounting File System" 6 | if [[ ! -d /images ]]; then 7 | mkdir -p /images >/dev/null 2>&1 8 | if [[ ! $? -eq 0 ]]; then 9 | echo "Failed" 10 | debugPause 11 | handleError "Failed to create location to mount nfs share ($0)\n Args Passed: $*" 12 | fi 13 | fi 14 | umount /images >/dev/null 2>&1 15 | case $type in 16 | up) 17 | mount -o nolock,proto=tcp,rsize=32768,wsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1 18 | ;; 19 | down) 20 | mount -o nolock,proto=tcp,rsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1 21 | ;; 22 | esac 23 | case $? in 24 | 0) 25 | echo "Done" 26 | debugPause 27 | ;; 28 | *) 29 | echo "Failed" 30 | debugPause 31 | handleError "Could not mount images folder ($0)\n Args Passed: $*\n Reason: $(cat /tmp/mount-output | tr -d \\0)" 32 | ;; 33 | esac 34 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.surfacetest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | dots "Location disks" 6 | disks="" 7 | disk="" 8 | hd="" 9 | getHardDisk "true" 10 | if [[ -z $disks ]]; then 11 | echo "Failed" 12 | debugPause 13 | handleError "No hard disks found! ($0)\n Args Passed: $*" 14 | fi 15 | echo "Done" 16 | debugPause 17 | dots "Attempting to checkin" 18 | res="" 19 | count=0 20 | sysuuid=$(dmidecode -s system-uuid) 21 | sysuuid=${sysuuid,,} 22 | while [[ $res != "##@GO" ]]; do 23 | res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac" ${web}service/Pre_Stage1.php 2>/dev/null) 24 | if [[ $count -ge 10 ]]; then 25 | echo "Failed" 26 | debugPause 27 | handleError "Could not checkin. ($0)\n Args Passed: $*" 28 | fi 29 | let count+=1 30 | usleep 5000000 31 | done 32 | echo "Done" 33 | debugPause 34 | for disk in $disks; do 35 | dots " * Disk Surface test for $disk" 36 | usleep 2000000 37 | badblocks -sv $disk 38 | echo " * Press [Enter] key to continue" 39 | read -p "$*" 40 | done 41 | . /bin/fog.nonimgcomplete 42 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.photorec: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | disks="" 6 | disk="" 7 | hd="" 8 | parts="" 9 | part="" 10 | getHardDisk "true" 11 | dots "Creating File System Mount point" 12 | [[ ! -d /images ]] && mkdir -p /images >/dev/null 2>&1 13 | if [[ ! -d /images ]]; then 14 | echo "Failed" 15 | debugPause 16 | handleError "Count not create image directory ($0)\n Args Passed: $*" 17 | fi 18 | echo "Done" 19 | debugPause 20 | dots "Mounting File System" 21 | mount -o nolock $storage /images >/tmp/mount-output 2>&1 22 | case $? in 23 | 0) 24 | echo "Done" 25 | debugPause 26 | ;; 27 | *) 28 | echo "Failed" 29 | debugPause 30 | handleError " * Could not mount $storage ($0)\n Args Passed: $*\n Reason: $(cat /tmp/mount-output | tr -d \\0)" 31 | ;; 32 | esac 33 | debugPause 34 | for disk in $disks; do 35 | echo " * Starting PhotoRec on $disk" 36 | usleep 2000000 37 | getPartitions "$disk" 38 | for part in $parts; do 39 | echo "Performing photorec on $part" 40 | photorec $part 41 | done 42 | usleep 5000000 43 | done 44 | . /bin/fog.nonimgcomplete 45 | -------------------------------------------------------------------------------- /Buildroot/package/partclone/partclone.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # partclone 4 | # 5 | ################################################################################ 6 | 7 | PARTCLONE_VERSION = 0.3.33 8 | PARTCLONE_SOURCE = partclone-$(PARTCLONE_VERSION).tar.gz 9 | PARTCLONE_SITE = $(call github,Thomas-Tsai,partclone,$(PARTCLONE_VERSION)) 10 | PARTCLONE_INSTALL_STAGING = YES 11 | PARTCLONE_AUTORECONF = YES 12 | PARTCLONE_DEPENDENCIES += attr e2fsprogs libgcrypt lzo xz zlib xfsprogs ncurses host-pkgconf 13 | PARTCLONE_CONF_OPTS = --enable-static --enable-xfs --enable-btrfs --enable-ntfs --enable-extfs --enable-fat --enable-hfsp --enable-apfs --enable-ncursesw --enable-f2fs 14 | PARTCLONE_EXTRA_LIBS = -ldl -latomic 15 | PARTCLONE_CONF_ENV += LIBS="$(PARTCLONE_EXTRA_LIBS)" 16 | 17 | define PARTCLONE_LINK_LIBRARIES_TOOL 18 | ln -f -s $(BUILD_DIR)/xfsprogs-*/include/xfs $(STAGING_DIR)/usr/include/ 19 | ln -f -s $(BUILD_DIR)/xfsprogs-*/libxfs/.libs/libxfs.* $(STAGING_DIR)/usr/lib/ 20 | ln -f -s $(@D)/fail-mbr/fail-mbr.bin $(@D)/fail-mbr/fail-mbr.bin.orig 21 | endef 22 | 23 | PARTCLONE_POST_PATCH_HOOKS += PARTCLONE_LINK_LIBRARIES_TOOL 24 | 25 | $(eval $(autotools-package)) 26 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S99fog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # rc.single This file is executed by init when it goes into runlevel 5 | # 1, which is the administrative state. It kills all 6 | # deamons and then puts the system into single user mode. 7 | # Note that the file systems are kept mounted. 8 | # 9 | # Author: Miquel van Smoorenburg, 10 | # Modified for RHS Linux by Damien Neil 11 | # Modified for FOG by Chuck Syperski 12 | # 13 | [[ ! -h /dev/fd ]] && ln -s /proc/self/fd /dev/fd 14 | [[ ! -h /dev/stdin ]] && ln -s /proc/self/fd/0 /dev/stdin 15 | [[ ! -h /dev/stdout ]] && ln -s /proc/self/fd/1 /dev/stdout 16 | [[ ! -h /dev/stderr ]] && ln -s /proc/self/fd/2 /dev/stderr 17 | if [[ $mdraid == true ]]; then 18 | mdadm --auto-detect 19 | mdadm --assemble --scan 20 | mdadm --incremental --run --scan 21 | fi 22 | [[ -n $keymap ]] && loadkeys $keymap 23 | case $isdebug in 24 | [Yy][Ee][Ss]|[Yy]) 25 | fog.debug 26 | ;; 27 | *) 28 | fog 29 | echo " * Rebooting system as task is complete" 30 | [[ $shutdown -eq 1 ]] && poweroff || reboot -f 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.wipe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | disks="" 6 | disk="" 7 | hd="" 8 | [[ -z $seconds ]] && seconds=60 9 | getHardDisk 10 | echo " WARNING! You are about to destroy the contents of the following hard disk:" 11 | echo -e " $hd\n" 12 | echo -e " You have $seconds seconds to turn off this computer to cancel!\n" 13 | usleep $((seconds * 1000000)) 14 | 15 | [[ $hd == *[Nn][Vv][Mm][Ee]* ]] && wipemode="nvme" 16 | 17 | case $wipemode in 18 | nvme) 19 | echo -e " Starting disk wipe of $hd using nvme format...\n" 20 | usleep 10000000 21 | nvme format $hd --force 22 | ;; 23 | full) 24 | echo -e " Starting full disk wipe of $hd using shred...\n" 25 | usleep 10000000 26 | shred -f -v -z -n 3 "$hd" 27 | ;; 28 | normal) 29 | echo -e " Starting normal disk wipe of $hd using shred...\n" 30 | usleep 10000000 31 | shred -f -v -n 1 "$hd" 32 | ;; 33 | fast|fastwipe) 34 | echo " Writing zeros to start of $hd" 35 | dd if=/dev/zero of="$hd" bs=512 count=100000 36 | ;; 37 | esac 38 | echo -e "\n Wiping complete.\n" 39 | . /bin/fog.nonimgcomplete 40 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/inittab: -------------------------------------------------------------------------------- 1 | # /etc/inittab 2 | # 3 | # Copyright (C) 2001 Erik Andersen 4 | # 5 | # Note: BusyBox init doesn't support runlevels. The runlevels field is 6 | # completely ignored by BusyBox init. If you want runlevels, use 7 | # sysvinit. 8 | # 9 | # Format for each entry: ::: 10 | # 11 | # id == tty to run on, or empty for /dev/console 12 | # runlevels == ignored 13 | # action == one of sysinit, respawn, askfirst, wait, and once 14 | # process == program to run 15 | # Startup the system 16 | null::sysinit:/bin/mount -t proc proc /proc 17 | null::sysinit:/bin/mount -o remount,rw / # REMOUNT_ROOTFS_RW 18 | null::sysinit:/bin/mkdir -p /dev/pts 19 | null::sysinit:/bin/mkdir -p /dev/shm 20 | null::sysinit:/bin/mount -a 21 | null::sysinit:/bin/hostname -F /etc/hostname 22 | # now run any rc scripts 23 | ::sysinit:/etc/init.d/rcS 24 | tty0::respawn:-/bin/bash 25 | # Put a getty on the serial port 26 | #ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL 27 | 28 | # Stuff to do for the 3-finger salute 29 | ::ctrlaltdel:/sbin/reboot 30 | 31 | # Stuff to do before rebooting 32 | null::shutdown:/usr/bin/killall klogd 33 | null::shutdown:/usr/bin/killall syslogd 34 | null::shutdown:/bin/umount -a -r 35 | null::shutdown:/sbin/swapoff -a 36 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.imgcomplete: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo " * Task Complete" 3 | sysuuid=$(dmidecode -s system-uuid) 4 | sysuuid=${sysuuid,,} 5 | case $type in 6 | [Dd][Oo][Ww][Nn]) 7 | php_post="Post_Stage3.php" 8 | poststring="sysuuid=${sysuuid}&mac=$mac&type=$type" 9 | ;; 10 | [Uu][Pp]) 11 | php_post="Post_Stage2.php" 12 | poststring="sysuuid=${sysuuid}&mac=$mac&type=$type&osid=$osid" 13 | ;; 14 | *) 15 | handleError "Wrong type for this completion script ($0)\n Args Passed: $*" 16 | ;; 17 | esac 18 | count=0 19 | res="" 20 | dots "Updating Database" 21 | while [[ $res != "##" ]]; do 22 | res=$(curl -Lks --data "$poststring" ${web}service/$php_post 2>/dev/null) 23 | if [[ $res != "##" && $count -lt 10 ]]; then 24 | echo "Failed" 25 | debugPause 26 | printf " * Error returned: %s" "$res" 27 | echo 28 | debugPause 29 | dots "Reattempting to update database" 30 | fi 31 | if [[ $count -ge 10 ]]; then 32 | echo "Failed" 33 | debugPause 34 | printf " * Error returned: %s" "$res" 35 | echo 36 | debugPause 37 | handleError "Could not complete tasking ($0)\n Args Passed: $*" 38 | fi 39 | let count+=1 40 | done 41 | echo "Done" 42 | debugPause 43 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage-0.6.9-nmu.patch: -------------------------------------------------------------------------------- 1 | diff -rupN partimage-0.6.9/src/client/imagefile.cpp partimage-0.6.9-new/src/client/imagefile.cpp 2 | --- partimage-0.6.9/src/client/imagefile.cpp 2010-07-25 11:30:31.000000000 -0400 3 | +++ partimage-0.6.9-new/src/client/imagefile.cpp 2013-11-30 18:51:49.724381366 -0500 4 | @@ -783,7 +783,7 @@ void CImage::openWriting() 5 | else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression 6 | { 7 | showDebug(1, "open gzip\n"); 8 | - m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h"); 9 | + m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h"); 10 | if (m_gzImageFile == NULL) 11 | { 12 | showDebug(1, "error:%d %s\n", errno, strerror(errno)); 13 | @@ -1098,7 +1098,7 @@ void CImage::openReading(CVolumeHeader * 14 | } 15 | else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression 16 | { 17 | - m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb"); 18 | + m_gzImageFile = gzdopen(m_nFdImage, "rb"); 19 | if (m_gzImageFile == NULL) 20 | THROW(ERR_ERRNO, errno); 21 | else 22 | diff -rupN partimage-0.6.9/src/client/imagefile.h partimage-0.6.9-new/src/client/imagefile.h 23 | --- partimage-0.6.9/src/client/imagefile.h 2010-07-25 11:30:31.000000000 -0400 24 | +++ partimage-0.6.9-new/src/client/imagefile.h 2013-11-30 18:51:20.357380577 -0500 25 | @@ -41,7 +41,7 @@ class CImage 26 | COptions m_options; 27 | 28 | FILE *m_fImageFile; 29 | - gzFile *m_gzImageFile; 30 | + gzFile m_gzImageFile; 31 | BZFILE *m_bzImageFile; 32 | 33 | int m_nFdImage; 34 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.debug: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | echo " You have entered into FOG debug" 6 | echo " mode. Below is a list of common" 7 | echo " commands you may wish to run" 8 | echo -e "\nfog" 9 | echo " * This is the main script that" 10 | echo " is used to image a computer" 11 | echo -e "\nifconfig or ip addr"; 12 | echo " * This command will show you the" 13 | echo " network interface on this machine." 14 | echo -e "\ngdisk -l "; 15 | echo " * GPT fdisk (aka gdisk) is a text-mode" 16 | echo " menu-driven program for creation and" 17 | echo " manipulation of partition tables." 18 | echo -e "\nfdisk " 19 | echo " * Fdisk is a text-mode menu-driven" 20 | echo " program for creation and manipulation" 21 | echo " of partition tables." 22 | echo -e "\nfixparts " 23 | echo " * This is used to correct GPT/MBR" 24 | echo " partition problems on the device" 25 | echo " Specifically to make a disk fully" 26 | echo " MBR but GPT was not wiped properly." 27 | echo -e "\nreboot" 28 | echo " * This will restart the computer" 29 | debugPause 30 | echo -e "\n\nBelow is a variable dump from FOG" 31 | osname="" 32 | mbrfile="" 33 | defaultpart2start="" 34 | disks="" 35 | hd="" 36 | [[ -n $osid ]] && determineOS "$osid" 37 | [[ -n $osid ]] && echo "osid=$osid" 38 | echo "osname=$osname" 39 | echo "mbrfile=$mbrfile" 40 | echo "type=$type" 41 | echo "storage=$storage" 42 | echo "img=$img" 43 | echo "imgType=$imgType" 44 | echo "imgFormat=$imgFormat" 45 | echo "imgPartitionType=$imgPartitionType" 46 | getHardDisk 47 | echo "disks=$disks" 48 | echo "hd=$hd" 49 | debugPause 50 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.chntpw: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | disks="" 6 | disk="" 7 | hd="" 8 | getHardDisk 9 | [[ -z $winuser ]] && handleError "Invalid User Account ($0)\n Args Passed: $*" 10 | blCont=0 11 | blStop=0 12 | [[ ! -d /ntfs ]] && mkdir -p /ntfs >/dev/null 2>&1 13 | sam="" 14 | parts="" 15 | part="" 16 | getPartitions "$hd" 17 | for part in $parts; do 18 | while [[ $blCont -eq 0 && $blStop -eq 0 ]]; do 19 | umount /ntfs 2>/dev/null >/dev/null 20 | mount -o rw "$part" /ntfs >/tmp/mount-output 2>&1 21 | [[ ! $? -eq 0 ]] && handleError " * Could not mount $part ($0)\n Args Passed: $*\n Reason: $(cat /tmp/mount-output | tr -d \\0)" 22 | getSAMLoc 23 | [[ -f $sam ]] && blCont=1 || blStop=1 24 | done 25 | umount /ntfs >/dev/null 2>&1 26 | if [[ ! $blCont -eq 1 ]]; then 27 | echo " * Unable to locate SAM File" 28 | continue 29 | fi 30 | dots "Mounting Windows File System" 31 | mount -o rw "$part" /ntfs >/tmp/mount-output 2>&1 32 | if [[ ! $? -eq 0 ]]; then 33 | echo "Failed" 34 | debugPause 35 | handleError " * Could not mount $part ($0)\n Args Passed: $*\n Reason: $(cat /tmp/mount-output | tr -d \\0)" 36 | fi 37 | echo "Done" 38 | debugPause 39 | dots "Attempting to change password" 40 | chntpw -u "$winuser" "$sam" >/dev/null 2>&1 >co 4 | 5 | fi 6 | 7 | - 8 | -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 9 | -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } 10 | -if test "${ac_cv_func_setpgrp_void+set}" = set; then : 11 | - $as_echo_n "(cached) " >&6 12 | -else 13 | - if test "$cross_compiling" = yes; then : 14 | - as_fn_error "cannot check setpgrp when cross compiling" "$LINENO" 5 15 | -else 16 | - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 17 | -/* end confdefs.h. */ 18 | -$ac_includes_default 19 | -int 20 | -main () 21 | -{ 22 | -/* If this system has a BSD-style setpgrp which takes arguments, 23 | - setpgrp(1, 1) will fail with ESRCH and return -1, in that case 24 | - exit successfully. */ 25 | - return setpgrp (1,1) != -1; 26 | - ; 27 | - return 0; 28 | -} 29 | -_ACEOF 30 | -if ac_fn_c_try_run "$LINENO"; then : 31 | - ac_cv_func_setpgrp_void=no 32 | -else 33 | - ac_cv_func_setpgrp_void=yes 34 | -fi 35 | -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 36 | - conftest.$ac_objext conftest.beam conftest.$ac_ext 37 | -fi 38 | - 39 | -fi 40 | -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 41 | -$as_echo "$ac_cv_func_setpgrp_void" >&6; } 42 | -if test $ac_cv_func_setpgrp_void = yes; then 43 | - 44 | -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h 45 | - 46 | -fi 47 | - 48 | for ac_func in getwd strerror strdup atoll strtoll setpgid 49 | do : 50 | as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 51 | -------------------------------------------------------------------------------- /Buildroot/package/fog/src/fogmbrfix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | main(int argc, char* argv[]) 8 | { 9 | string strLine; 10 | int intLineCnt = 0; 11 | string strWriteBack = ""; 12 | 13 | if ( argc != 3 ) 14 | { 15 | cout << "Usage: " << argv[0] << " input.mbr.txt output.mbr.txt" << endl; 16 | cout << "Input file must be generated using the xxd application" << endl; 17 | return 1; 18 | } 19 | 20 | ifstream inFile(argv[1], ios::in); 21 | ofstream outFile( argv[2], ios::out); 22 | 23 | if( ! inFile ) 24 | { 25 | cout << " Unable to locate mbr text file." << endl; 26 | return 1; 27 | } 28 | 29 | if( ! outFile ) 30 | { 31 | cout << " Unable to open output file." << endl; 32 | return 1; 33 | } 34 | 35 | while( getline(inFile,strLine) ) 36 | { 37 | intLineCnt++; 38 | if( ! strLine.empty() ); 39 | { 40 | if ( intLineCnt == 28 ) 41 | { 42 | for( int i = 29; i < 33; i++ ) 43 | strLine[i] = '0'; 44 | 45 | for( int i = 34; i < 38; i++ ) 46 | strLine[i] = '0'; 47 | strLine[46] = '2'; 48 | strLine[47] = '0'; 49 | strWriteBack += strLine; 50 | } 51 | else if (intLineCnt == 29 ) 52 | { 53 | strLine[9] = '2'; 54 | 55 | for( int i = 24; i < 27; i++) 56 | strLine[i] = '0'; 57 | 58 | strLine[27] = '8'; 59 | strWriteBack += strLine; 60 | } 61 | else 62 | { 63 | strWriteBack += strLine; 64 | } 65 | 66 | strWriteBack += "\n"; 67 | } 68 | } 69 | outFile</dev/null 2>&1 12 | if [[ ! -d /chntpw ]]; then 13 | echo "Failed" 14 | debugPause 15 | handleError "Unable to create chntpw folder ($0)\n Args Passed: $*" 16 | fi 17 | echo "Done" 18 | debugPause 19 | dots "Using disk" 20 | getHardDisk 21 | if [[ -z $hd ]]; then 22 | echo "Failed" 23 | debugPause 24 | handleError "Could not locate disk to work from ($0)\n Args Passed: $*" 25 | fi 26 | echo "$hd" 27 | debugPause 28 | sam="" 29 | getSAMLoc 30 | getPartitions "$hd" 31 | for part in $parts; do 32 | isBitlockedPartition "$part" 33 | fsTypeSetting "$part" 34 | case $fstype in 35 | [Nn][Tt][Ff][Ss]) 36 | echo " * Mounting partition $part" 37 | ntfs-3g -o remove_hiberfile,rw "$part" /chntpw >/tmp/ntfs-mount-output 2>&1 38 | [[ ! $? -eq 0 ]] && handleError " * Could not mount $part ($0)\n Args Passed: $*\n Reason: $(cat /tmp/ntfs-mount-output | tr -d \\0)" 39 | if [[ ! -f $sam ]]; then 40 | echo " * Unable to locate SAM file" 41 | debugPause 42 | umount /chntpw 43 | continue 44 | fi 45 | dots "Removing password" 46 | chntpw "$sam" 47 | if [[ ! $? -eq 0 ]]; then 48 | echo "Failed" 49 | debugPause 50 | umount /chntpw 51 | continue 52 | fi 53 | echo "Done" 54 | debugPause 55 | ;; 56 | *) 57 | dots "Not working with partition" 58 | echo "$part" 59 | debugPause 60 | continue 61 | ;; 62 | esac 63 | done 64 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/Makefile: -------------------------------------------------------------------------------- 1 | obj-$(CONFIG_R8168) += r8168.o 2 | r8168-objs += r8168_n.o r8168_asf.o rtl_eeprom.o rtltool.o 3 | 4 | EXTRA_CFLAGS += -DCONFIG_SOC_LAN 5 | EXTRA_CFLAGS += -DCONFIG_ASPM 6 | EXTRA_CFLAGS += -DENABLE_S5WOL 7 | EXTRA_CFLAGS += -DCONFIG_DYNAMIC_ASPM 8 | # EXTRA_CFLAGS += -DCONFIG_R8168_VLAN # Need to check if needed 9 | 10 | # 11 | # Other options that can be enabled if needed. 12 | # 13 | # 14 | # ENABLE_REALWOW_SUPPORT: 15 | # r8168-objs += r8168_realwow.o 16 | # EXTRA_CFLAGS += -DENABLE_REALWOW_SUPPORT 17 | # 18 | # ENABLE_FIBER_SUPPORT: 19 | # r8168-objs += r8168_fiber.o 20 | # EXTRA_CFLAGS += -DENABLE_FIBER_SUPPORT 21 | # 22 | # ENABLE_DASH_SUPPORT: 23 | # r8168-objs += r8168_dash.o 24 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT 25 | # 26 | # ENABLE_DASH_PRINTER_SUPPORT: 27 | # r8168-objs += r8168_dash.o 28 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT -DENABLE_DASH_PRINTER_SUPPORT 29 | # 30 | # ENABLE_RSS_SUPPORT: 31 | # EXTRA_CFLAGS += -DCONFIG_R8168_NAPI 32 | # 33 | # CONFIG_DOWN_SPEED_100: 34 | # EXTRA_CFLAGS += -DCONFIG_DOWN_SPEED_100 35 | # 36 | # ENABLE_S5_KEEP_CURR_MAC: 37 | # EXTRA_CFLAGS += -DENABLE_S5_KEEP_CURR_MAC 38 | # 39 | # ENABLE_EEE: 40 | # EXTRA_CFLAGS += -DENABLE_EEE 41 | # 42 | # ENABLE_S0_MAGIC_PACKET: 43 | # EXTRA_CFLAGS += -DENABLE_S0_MAGIC_PACKET 44 | # 45 | # CONFIG_DYNAMIC_ASPM: 46 | # EXTRA_CFLAGS += -DCONFIG_DYNAMIC_ASPM 47 | # 48 | # ENABLE_USE_FIRMWARE_FILE: 49 | # r8168-objs += r8168_firmware.o 50 | # EXTRA_CFLAGS += -DENABLE_USE_FIRMWARE_FILE 51 | # 52 | # CONFIG_CTAP_SHORT_OFF: 53 | # EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF 54 | # 55 | # ENABLE_MULTIPLE_TX_QUEUE: 56 | # EXTRA_CFLAGS += -DENABLE_MULTIPLE_TX_QUEUE 57 | # 58 | # ENABLE_RSS_SUPPORT: 59 | # r8168-objs += r8168_rss.o 60 | # EXTRA_CFLAGS += -DENABLE_RSS_SUPPORT 61 | # 62 | # ENABLE_LIB_SUPPORT: 63 | # r8168-objs += r8168_lib.o 64 | # EXTRA_CFLAGS += -DENABLE_LIB_SUPPORT 65 | # 66 | # DISABLE_WOL_SUPPORT: 67 | # EXTRA_CFLAGS += -DDISABLE_WOL_SUPPORT 68 | 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FOG Operating System (FOS) 2 | This is the operating system environment used for imaging with FOG. This is a linux based operating system with all the scripts and programs required for perform imaging tasks. 3 | 4 | # What does this repository do? 5 | Builds FOS inits as well as kernels used by FOG. 6 | 7 | # What do we need? 8 | 1. You'll need a Debian or Red Hat based operating system. 9 | 2. You'll need to install git on your system. 10 | 3. You'll need to clone the fos repository. 11 | 12 | # How do I get the fos repository? 13 | Pull the fos repository with: 14 | 15 | ``` 16 | git clone https://github.com/fogproject/fos 17 | ``` 18 | 19 | # How to build? 20 | To build the FOS inits and/or kernels we use the `build.sh` script. 21 | 22 | 23 | #### Build script options: 24 | The `build.sh` script has usage flags that are used to build the inits/kernels. You can run `build.sh -h` or `build.sh --help` to see all the flags. 25 | 26 | 27 | #### NOTES: 28 | 1. This repository does not contain FOS or the kernels, it contains all the files needed to build the inits and kernels. 29 | 2. `/path/to/fos/repo` is not the real path, this is the path to the cloned repository on the machine you plan to run this on. Typically this would be something like `~/fos`. This path **will** need to be changed to build. 30 | 31 | --- 32 | 33 | #### Build Everything 34 | ``` 35 | /path/to/fos/repo/build.sh -n 36 | ``` 37 | #### Build all inits only 38 | ``` 39 | /path/to/fos/repo/build.sh -nf 40 | ``` 41 | #### Build 64 bit (x64) init 42 | ``` 43 | /path/to/fos/repo/build.sh -nfa x64 44 | ``` 45 | #### Build 32 bit (x86) init 46 | ``` 47 | /path/to/fos/repo/build.sh -nfa x86 48 | ``` 49 | #### Build ARM 64 bit init 50 | ``` 51 | /path/to/fos/repo/build.sh -nfa arm64 52 | ``` 53 | #### Build all kernels only 54 | ``` 55 | /path/to/fos/repo/build.sh -nk 56 | ``` 57 | #### Build 64 bit (x64) kernel 58 | ``` 59 | /path/to/fos/repo/build.sh -nka x64 60 | ``` 61 | #### Build 32 bit (x86) kernel 62 | ``` 63 | /path/to/fos/repo/build.sh -nka x86 64 | ``` 65 | #### Build ARM 64 bit kernel 66 | ``` 67 | /path/to/fos/repo/build.sh -nka arm64 68 | ``` 69 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.auto.reg: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | clearScreen 4 | displayBanner 5 | disks="" 6 | disk="" 7 | hd="" 8 | sysman="" 9 | sysproduct="" 10 | sysversion="" 11 | sysserial="" 12 | sysuuid="" 13 | systype="" 14 | biosversion="" 15 | biosvendor="" 16 | biosdate="" 17 | mbman="" 18 | mbproductname="" 19 | mbversion="" 20 | mbserial="" 21 | mbasset="" 22 | cpuman="" 23 | cpuversion="" 24 | cpucurrent="" 25 | cpumax="" 26 | mem="" 27 | hdinfo="" 28 | caseman="" 29 | casever="" 30 | caseserial="" 31 | caseasset="" 32 | sysman64="" 33 | sysproduct64="" 34 | sysversion64="" 35 | sysserial64="" 36 | sysuuid64="" 37 | systype64="" 38 | biosversion64="" 39 | biosvendor64="" 40 | biosdate64="" 41 | mbman64="" 42 | mbproductname64="" 43 | mbversion64="" 44 | mbserial64="" 45 | mbasset64="" 46 | cpuman64="" 47 | cpuversion64="" 48 | cpucurrent64="" 49 | cpumax64="" 50 | mem64="" 51 | hdinfo64="" 52 | caseman64="" 53 | casever64="" 54 | caseserial64="" 55 | caseasset64="" 56 | dots "Using disk device" 57 | getHardDisk 58 | echo "$hd" 59 | echo "Starting host registration" 60 | debugPause 61 | mac=$(getMACAddresses | base64) 62 | sysuuid=$(dmidecode -s system-uuid) 63 | sysuuid=${sysuuid,,} 64 | sysuuid=$(echo $sysuuid | base64) 65 | sysserial=$(dmidecode -s system-serial-number) 66 | sysserial=${sysserial,,} 67 | sysserial=$(echo $sysserial | base64) 68 | dots "Attempting to register host" 69 | count=0 70 | res="" 71 | productKey="" 72 | if [[ -f /sys/firmware/acpi/tables/MSDM ]]; then 73 | productKey=$(tail -c+57 /sys/firmware/acpi/tables/MSDM | base64) 74 | fi 75 | while [[ -z $res ]]; do 76 | res=$(curl -Lks --data "sysserial=${sysserial}&sysuuid=${sysuuid}&mac=$mac&productKey=${productKey}" ${web}service/auto.register.php 2>/dev/null) 77 | case $count in 78 | [0-8]) 79 | let count+=1 80 | usleep 5000000 81 | ;; 82 | 9) 83 | echo "Failed" 84 | debugPause 85 | handleError "Cannot register host. ($0)\n Args Passed: $*" 86 | ;; 87 | esac 88 | done 89 | echo "$res" 90 | debugPause 91 | . /bin/fog.inventory 92 | count=0 93 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/Makefile: -------------------------------------------------------------------------------- 1 | obj-$(CONFIG_R8126) += r8126.o 2 | r8126-objs += r8126_n.o rtl_eeprom.o rtltool.o r8126_fiber.o 3 | 4 | EXTRA_CFLAGS += -DCONFIG_SOC_LAN 5 | EXTRA_CFLAGS += -DENABLE_FIBER_SUPPORT 6 | EXTRA_CFLAGS += -DCONFIG_ASPM 7 | EXTRA_CFLAGS += -DENABLE_S5WOL 8 | EXTRA_CFLAGS += -DENABLE_TX_NO_CLOSE 9 | EXTRA_CFLAGS += -DENABLE_GIGA_LITE 10 | # EXTRA_CFLAGS += -DCONFIG_R8126_NAPI # Need to check if needed 11 | # EXTRA_CFLAGS += -DCONFIG_R8126_VLAN # Need to check if needed 12 | 13 | # 14 | # Other options that can be enabled if needed. 15 | # 16 | # ENABLE_REALWOW_SUPPORT: 17 | # r8126-objs += r8126_realwow.o 18 | # EXTRA_CFLAGS += -DENABLE_REALWOW_SUPPORT 19 | # 20 | # ENABLE_DASH_SUPPORT: 21 | # r8126-objs += r8126_dash.o 22 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT 23 | # 24 | # ENABLE_DASH_PRINTER_SUPPORT: 25 | # r8126-objs += r8126_dash.o 26 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT -DENABLE_DASH_PRINTER_SUPPORT 27 | # 28 | # CONFIG_DOWN_SPEED_100: 29 | # EXTRA_CFLAGS += -DCONFIG_DOWN_SPEED_100 30 | # 31 | # ENABLE_S5_KEEP_CURR_MAC: 32 | # EXTRA_CFLAGS += -DENABLE_S5_KEEP_CURR_MAC 33 | # 34 | # ENABLE_EEE: 35 | # EXTRA_CFLAGS += -DENABLE_EEE 36 | # 37 | # ENABLE_S0_MAGIC_PACKET: 38 | # EXTRA_CFLAGS += -DENABLE_S0_MAGIC_PACKET 39 | # 40 | # ENABLE_MULTIPLE_TX_QUEUE: 41 | # EXTRA_CFLAGS += -DENABLE_MULTIPLE_TX_QUEUE 42 | # 43 | # ENABLE_PTP_SUPPORT: 44 | # r8126-objs += r8126_ptp.o 45 | # EXTRA_CFLAGS += -DENABLE_PTP_SUPPORT 46 | # 47 | # ENABLE_RSS_SUPPORT: 48 | # r8126-objs += r8126_rss.o 49 | # EXTRA_CFLAGS += -DENABLE_RSS_SUPPORT 50 | # 51 | # ENABLE_LIB_SUPPORT: 52 | # r8126-objs += r8126_lib.o 53 | # EXTRA_CFLAGS += -DENABLE_LIB_SUPPORT 54 | # 55 | # ENABLE_USE_FIRMWARE_FILE: 56 | # r8126-objs += r8126_firmware.o 57 | # EXTRA_CFLAGS += -DENABLE_USE_FIRMWARE_FILE 58 | # 59 | # DISABLE_WOL_SUPPORT: 60 | # EXTRA_CFLAGS += -DDISABLE_WOL_SUPPORT 61 | # 62 | # DISABLE_MULTI_MSIX_VECTOR: 63 | # EXTRA_CFLAGS += -DDISABLE_MULTI_MSIX_VECTOR 64 | # 65 | # ENABLE_DOUBLE_VLAN: 66 | # EXTRA_CFLAGS += -DENABLE_DOUBLE_VLAN 67 | # 68 | # ENABLE_PAGE_REUSE: 69 | # EXTRA_CFLAGS += -DENABLE_PAGE_REUSE 70 | # 71 | # ENABLE_RX_PACKET_FRAGMENT: 72 | # EXTRA_CFLAGS += -DENABLE_RX_PACKET_FRAGMENT 73 | 74 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/Makefile: -------------------------------------------------------------------------------- 1 | obj-$(CONFIG_R8125) += r8125.o 2 | r8125-objs += r8125_n.o rtl_eeprom.o rtltool.o r8125_fiber.o 3 | 4 | EXTRA_CFLAGS += -DCONFIG_SOC_LAN 5 | EXTRA_CFLAGS += -DENABLE_FIBER_SUPPORT 6 | EXTRA_CFLAGS += -DCONFIG_ASPM 7 | EXTRA_CFLAGS += -DENABLE_S5WOL 8 | EXTRA_CFLAGS += -DENABLE_TX_NO_CLOSE 9 | EXTRA_CFLAGS += -DENABLE_GIGA_LITE 10 | # EXTRA_CFLAGS += -DCONFIG_R8125_NAPI # Need to check if needed 11 | # EXTRA_CFLAGS += -DCONFIG_R8125_VLAN # Need to check if needed 12 | 13 | # 14 | # Other options that can be enabled if needed. 15 | # 16 | # ENABLE_REALWOW_SUPPORT: 17 | # r8125-objs += r8125_realwow.o 18 | # EXTRA_CFLAGS += -DENABLE_REALWOW_SUPPORT 19 | # 20 | # ENABLE_DASH_SUPPORT: 21 | # r8125-objs += r8125_dash.o 22 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT 23 | # 24 | # ENABLE_DASH_PRINTER_SUPPORT: 25 | # r8125-objs += r8125_dash.o 26 | # EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT -DENABLE_DASH_PRINTER_SUPPORT 27 | # 28 | # CONFIG_DOWN_SPEED_100: 29 | # EXTRA_CFLAGS += -DCONFIG_DOWN_SPEED_100 30 | # 31 | # ENABLE_S5_KEEP_CURR_MAC: 32 | # EXTRA_CFLAGS += -DENABLE_S5_KEEP_CURR_MAC 33 | # 34 | # ENABLE_EEE: 35 | # EXTRA_CFLAGS += -DENABLE_EEE 36 | # 37 | # ENABLE_S0_MAGIC_PACKET: 38 | # EXTRA_CFLAGS += -DENABLE_S0_MAGIC_PACKET 39 | # 40 | # ENABLE_MULTIPLE_TX_QUEUE: 41 | # EXTRA_CFLAGS += -DENABLE_MULTIPLE_TX_QUEUE 42 | # 43 | # ENABLE_PTP_SUPPORT: 44 | # r8125-objs += r8125_ptp.o 45 | # EXTRA_CFLAGS += -DENABLE_PTP_SUPPORT 46 | # 47 | # ENABLE_PTP_MASTER_MODE: 48 | # EXTRA_CFLAGS += -DENABLE_PTP_MASTER_MODE 49 | # 50 | # ENABLE_RSS_SUPPORT: 51 | # r8125-objs += r8125_rss.o 52 | # EXTRA_CFLAGS += -DENABLE_RSS_SUPPORT 53 | # 54 | # ENABLE_LIB_SUPPORT: 55 | # r8125-objs += r8125_lib.o 56 | # EXTRA_CFLAGS += -DENABLE_LIB_SUPPORT 57 | # 58 | # ENABLE_USE_FIRMWARE_FILE: 59 | # r8125-objs += r8125_firmware.o 60 | # EXTRA_CFLAGS += -DENABLE_USE_FIRMWARE_FILE 61 | # 62 | # DISABLE_WOL_SUPPORT: 63 | # EXTRA_CFLAGS += -DDISABLE_WOL_SUPPORT 64 | # 65 | # DISABLE_MULTI_MSIX_VECTOR: 66 | # EXTRA_CFLAGS += -DDISABLE_MULTI_MSIX_VECTOR 67 | # 68 | # ENABLE_DOUBLE_VLAN: 69 | # EXTRA_CFLAGS += -DENABLE_DOUBLE_VLAN 70 | # 71 | # ENABLE_PAGE_REUSE: 72 | # EXTRA_CFLAGS += -DENABLE_PAGE_REUSE 73 | # 74 | # ENABLE_RX_PACKET_FRAGMENT: 75 | # EXTRA_CFLAGS += -DENABLE_RX_PACKET_FRAGMENT 76 | 77 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage-0.6.9-fifo.patch: -------------------------------------------------------------------------------- 1 | diff -pruN partimage-0.6.9/src/client/misc.cpp partimage-0.6.9.pigz/src/client/misc.cpp 2 | --- partimage-0.6.9/src/client/misc.cpp 2010-07-25 10:30:31.000000000 -0500 3 | +++ partimage-0.6.9.pigz/src/client/misc.cpp 2010-12-02 23:22:10.963274582 -0600 4 | @@ -367,6 +367,7 @@ void savePartition(char *szDevice, char 5 | DWORD i, j; 6 | int nMajor, nMinor; 7 | char szFileSystem[1024]; 8 | + struct stat fStat; 9 | 10 | // structures to stock informations about the current partition 11 | CImage image(options); 12 | @@ -381,6 +382,12 @@ void savePartition(char *szDevice, char 13 | //if (options->dwSplitMode == SPLIT_AUTO) 14 | if ((strncmp(szImageName, "stdout", 6) == 0) || (strncmp(szImageName, "STDOUT", 6) == 0)) 15 | options->qwSplitSize = 0; 16 | + if (stat(szImageName, &fStat) != -1 && S_ISFIFO(fStat.st_mode)) 17 | + { 18 | + options->qwSplitSize = 0; 19 | + options->bOverwrite = true; 20 | + } 21 | + 22 | if (!options->qwSplitSize) 23 | { 24 | SNPRINTF(aux, "%s", szImageName); *(aux+MAXPATHLEN-1)='\0'; 25 | @@ -1975,9 +1982,9 @@ int checkOptions(COptions options, char 26 | // check for an image file 27 | if ((szImageFile) && (*szImageFile) && (stat(szImageFile, &fStat) != -1)) 28 | { 29 | - if (!S_ISREG(fStat.st_mode)) 30 | + if (!(S_ISREG(fStat.st_mode) || S_ISFIFO(fStat.st_mode))) 31 | { 32 | - g_interface->msgBoxError(i18n("The third argument [%s] must be a valid regular file (not a directory, a symlink, ...)"), szImageFile); 33 | + g_interface->msgBoxError(i18n("The third argument [%s] must be a valid regular file or fifo (not a directory, a symlink, ...)"), szImageFile); 34 | RETURN_int(-1); 35 | } 36 | } 37 | diff -pruN partimage-0.6.9/src/shared/image_disk.cpp partimage-0.6.9.pigz/src/shared/image_disk.cpp 38 | --- partimage-0.6.9/src/shared/image_disk.cpp 2010-07-25 10:30:31.000000000 -0500 39 | +++ partimage-0.6.9.pigz/src/shared/image_disk.cpp 2010-12-02 23:18:46.580273115 -0600 40 | @@ -586,7 +586,7 @@ void CImageDisk::openWriting() // [Main- 41 | #endif 42 | THROW(ERR_ERRNO, errno); 43 | 44 | - if (!S_ISREG(fStat.st_mode)) // not a regular file 45 | + if (!(S_ISREG(fStat.st_mode) || S_ISFIFO(fStat.st_mode))) // not a regular file 46 | THROW(ERR_NOTAREGULARFILE, m_szImageFilename); 47 | 48 | // lock the image file 49 | -------------------------------------------------------------------------------- /Buildroot/package/partimage/partimage-0.6.9-fog.patch: -------------------------------------------------------------------------------- 1 | diff -pruN partimage-0.6.7/fogbuild.txt partimage-0.6.7.fog/fogbuild.txt 2 | --- partimage-0.6.7/fogbuild.txt 1969-12-31 18:00:00.000000000 -0600 3 | +++ partimage-0.6.7.fog/fogbuild.txt 2009-06-12 16:27:11.000000000 -0500 4 | @@ -0,0 +1 @@ 5 | +./configure --with-log-dir=/dev/null --disable-cheuid --disable-login --disable-ssl --disable-nls && make && make install 6 | diff -pruN partimage-0.6.7/src/client/gui_text.cpp partimage-0.6.7.fog/src/client/gui_text.cpp 7 | --- partimage-0.6.7/src/client/gui_text.cpp 2008-02-03 15:58:00.000000000 -0600 8 | +++ partimage-0.6.7.fog/src/client/gui_text.cpp 2009-06-12 16:27:05.000000000 -0500 9 | @@ -554,6 +554,15 @@ void CSavingWindow::showStats(const time 10 | SNPRINTF(szTemp, i18n("Data copied:.................%s / %s"), formatSize(qwDone, szTemp2), formatSize(qwTotal, szTemp3)); 11 | newtLabelSetText(m_labelStatsSpace, szTemp); 12 | 13 | + if ( getenv("FOGSTATS") != NULL && strlen(getenv("FOGSTATS")) ) 14 | + { 15 | + fprintf(stderr,"%s@",formatSize(qwBytesPerMin, szTemp2)); 16 | + fprintf(stderr,"%s@",formatTime((DWORD)timeElapsed, szTemp2)); 17 | + fprintf(stderr,"%s@",formatTime((DWORD)timeRemaining, szTemp2)); 18 | + fprintf(stderr,"%s@",formatSize(qwDone, szTemp2)); 19 | + fprintf(stderr,"%s@",formatSize(qwTotal, szTemp3)); 20 | + fprintf(stderr,"%d\n", (int)qwPercent); 21 | + } 22 | //option -B gui=no show stats 23 | if ((szFullyBatchMode) && (strlen(szFullyBatchMode)>0)) 24 | { 25 | @@ -831,6 +840,15 @@ void CRestoringWindow::showStats(const t 26 | 27 | SNPRINTF(szTemp, i18n("Data copied:......................%s / %s"), formatSize(qwDone, szTemp2), formatSize(qwTotal, szTemp3)); 28 | newtLabelSetText(m_labelStatsSpace, szTemp); 29 | + if ( getenv("FOGSTATS") != NULL && strlen(getenv("FOGSTATS")) ) 30 | + { 31 | + fprintf(stderr,"%s@",formatSize(qwBytesPerMin, szTemp2)); 32 | + fprintf(stderr,"%s@",formatTime((DWORD)timeElapsed, szTemp2)); 33 | + fprintf(stderr,"%s@",formatTime((DWORD)timeRemaining, szTemp2)); 34 | + fprintf(stderr,"%s@",formatSize(qwDone, szTemp2)); 35 | + fprintf(stderr,"%s@",formatSize(qwTotal, szTemp3)); 36 | + fprintf(stderr,"%d\n", (int)qwPercent); 37 | + } 38 | //option -B gui=no show stats 39 | if ((szFullyBatchMode) && (strlen(szFullyBatchMode)>0)) 40 | { 41 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/rtl_eeprom.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | //EEPROM opcodes 36 | #define RTL_EEPROM_READ_OPCODE 06 37 | #define RTL_EEPROM_WRITE_OPCODE 05 38 | #define RTL_EEPROM_ERASE_OPCODE 07 39 | #define RTL_EEPROM_EWEN_OPCODE 19 40 | #define RTL_EEPROM_EWDS_OPCODE 16 41 | 42 | #define RTL_CLOCK_RATE 3 43 | 44 | void rtl8125_eeprom_type(struct rtl8125_private *tp); 45 | void rtl8125_eeprom_cleanup(struct rtl8125_private *tp); 46 | u16 rtl8125_eeprom_read_sc(struct rtl8125_private *tp, u16 reg); 47 | void rtl8125_eeprom_write_sc(struct rtl8125_private *tp, u16 reg, u16 data); 48 | void rtl8125_shift_out_bits(struct rtl8125_private *tp, int data, int count); 49 | u16 rtl8125_shift_in_bits(struct rtl8125_private *tp); 50 | void rtl8125_raise_clock(struct rtl8125_private *tp, u8 *x); 51 | void rtl8125_lower_clock(struct rtl8125_private *tp, u8 *x); 52 | void rtl8125_stand_by(struct rtl8125_private *tp); 53 | void rtl8125_set_eeprom_sel_low(struct rtl8125_private *tp); 54 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/rtl_eeprom.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | //EEPROM opcodes 36 | #define RTL_EEPROM_READ_OPCODE 06 37 | #define RTL_EEPROM_WRITE_OPCODE 05 38 | #define RTL_EEPROM_ERASE_OPCODE 07 39 | #define RTL_EEPROM_EWEN_OPCODE 19 40 | #define RTL_EEPROM_EWDS_OPCODE 16 41 | 42 | #define RTL_CLOCK_RATE 3 43 | 44 | void rtl8168_eeprom_type(struct rtl8168_private *tp); 45 | void rtl8168_eeprom_cleanup(struct rtl8168_private *tp); 46 | u16 rtl8168_eeprom_read_sc(struct rtl8168_private *tp, u16 reg); 47 | void rtl8168_eeprom_write_sc(struct rtl8168_private *tp, u16 reg, u16 data); 48 | void rtl8168_shift_out_bits(struct rtl8168_private *tp, int data, int count); 49 | u16 rtl8168_shift_in_bits(struct rtl8168_private *tp); 50 | void rtl8168_raise_clock(struct rtl8168_private *tp, u8 *x); 51 | void rtl8168_lower_clock(struct rtl8168_private *tp, u8 *x); 52 | void rtl8168_stand_by(struct rtl8168_private *tp); 53 | void rtl8168_set_eeprom_sel_low(struct rtl8168_private *tp); 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/rtl_eeprom.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTLEEPROM_H 36 | #define _LINUX_RTLEEPROM_H 37 | 38 | //EEPROM opcodes 39 | #define RTL_EEPROM_READ_OPCODE 06 40 | #define RTL_EEPROM_WRITE_OPCODE 05 41 | #define RTL_EEPROM_ERASE_OPCODE 07 42 | #define RTL_EEPROM_EWEN_OPCODE 19 43 | #define RTL_EEPROM_EWDS_OPCODE 16 44 | 45 | #define RTL_CLOCK_RATE 3 46 | 47 | void rtl8126_eeprom_type(struct rtl8126_private *tp); 48 | void rtl8126_eeprom_cleanup(struct rtl8126_private *tp); 49 | u16 rtl8126_eeprom_read_sc(struct rtl8126_private *tp, u16 reg); 50 | void rtl8126_eeprom_write_sc(struct rtl8126_private *tp, u16 reg, u16 data); 51 | void rtl8126_shift_out_bits(struct rtl8126_private *tp, int data, int count); 52 | u16 rtl8126_shift_in_bits(struct rtl8126_private *tp); 53 | void rtl8126_raise_clock(struct rtl8126_private *tp, u8 *x); 54 | void rtl8126_lower_clock(struct rtl8126_private *tp, u8 *x); 55 | void rtl8126_stand_by(struct rtl8126_private *tp); 56 | void rtl8126_set_eeprom_sel_low(struct rtl8126_private *tp); 57 | 58 | #endif /* _LINUX_RTLEEPROM_H */ 59 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_fiber.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_FIBER_H 36 | #define _LINUX_R8126_FIBER_H 37 | 38 | enum { 39 | FIBER_MODE_NIC_ONLY = 0, 40 | FIBER_MODE_RTL8126_RTL8251B, 41 | FIBER_MODE_MAX 42 | }; 43 | 44 | enum { 45 | FIBER_STAT_NOT_CHECKED = 0, 46 | FIBER_STAT_DISCONNECT, 47 | FIBER_STAT_CONNECT_GPO_C45, 48 | FIBER_STAT_MAX 49 | }; 50 | 51 | #define HW_FIBER_MODE_ENABLED(_M) ((_M)->HwFiberModeVer > 0) 52 | #define HW_FIBER_STATUS_CONNECTED(_M) (((_M)->HwFiberStat == FIBER_STAT_CONNECT_GPO_C45)) 53 | #define HW_FIBER_STATUS_DISCONNECTED(_M) ((_M)->HwFiberStat == FIBER_STAT_DISCONNECT) 54 | 55 | struct rtl8126_private; 56 | 57 | void rtl8126_hw_fiber_phy_config(struct rtl8126_private *tp); 58 | void rtl8126_check_fiber_mode_support(struct rtl8126_private *tp); 59 | void rtl8126_fiber_mdio_write( struct rtl8126_private *tp, u32 reg, u16 val); 60 | u16 rtl8126_fiber_mdio_read(struct rtl8126_private *tp, u32 reg); 61 | unsigned int rtl8126_fiber_link_ok(struct net_device *dev); 62 | 63 | #endif /* _LINUX_R8126_FIBER_H */ 64 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_fiber.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8125_FIBER_H 36 | #define _LINUX_R8125_FIBER_H 37 | 38 | enum { 39 | FIBER_MODE_NIC_ONLY = 0, 40 | FIBER_MODE_RTL8125D_RTL8221D, 41 | FIBER_MODE_MAX 42 | }; 43 | 44 | enum { 45 | FIBER_STAT_NOT_CHECKED = 0, 46 | FIBER_STAT_DISCONNECT, 47 | FIBER_STAT_CONNECT_GPO_C45, 48 | FIBER_STAT_MAX 49 | }; 50 | 51 | #define HW_FIBER_MODE_ENABLED(_M) ((_M)->HwFiberModeVer > 0) 52 | #define HW_FIBER_STATUS_CONNECTED(_M) (((_M)->HwFiberStat == FIBER_STAT_CONNECT_GPO_C45)) 53 | #define HW_FIBER_STATUS_DISCONNECTED(_M) ((_M)->HwFiberStat == FIBER_STAT_DISCONNECT) 54 | 55 | struct rtl8125_private; 56 | 57 | void rtl8125_hw_fiber_phy_config(struct rtl8125_private *tp); 58 | void rtl8125_check_fiber_mode_support(struct rtl8125_private *tp); 59 | void rtl8125_fiber_mdio_write( struct rtl8125_private *tp, u32 reg, u16 val); 60 | u16 rtl8125_fiber_mdio_read(struct rtl8125_private *tp, u32 reg); 61 | unsigned int rtl8125_fiber_link_ok(struct net_device *dev); 62 | 63 | #endif /* _LINUX_R8125_FIBER_H */ 64 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_firmware.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_FIRMWARE_H 36 | #define _LINUX_R8126_FIRMWARE_H 37 | 38 | #include 39 | #include 40 | 41 | struct rtl8126_private; 42 | typedef void (*rtl8126_fw_write_t)(struct rtl8126_private *tp, u16 reg, u16 val); 43 | typedef u32 (*rtl8126_fw_read_t)(struct rtl8126_private *tp, u16 reg); 44 | 45 | #define RTL8126_VER_SIZE 32 46 | 47 | struct rtl8126_fw { 48 | rtl8126_fw_write_t phy_write; 49 | rtl8126_fw_read_t phy_read; 50 | rtl8126_fw_write_t mac_mcu_write; 51 | rtl8126_fw_read_t mac_mcu_read; 52 | const struct firmware *fw; 53 | const char *fw_name; 54 | struct device *dev; 55 | 56 | char version[RTL8126_VER_SIZE]; 57 | 58 | struct rtl8126_fw_phy_action { 59 | __le32 *code; 60 | size_t size; 61 | } phy_action; 62 | }; 63 | 64 | int rtl8126_fw_request_firmware(struct rtl8126_fw *rtl_fw); 65 | void rtl8126_fw_release_firmware(struct rtl8126_fw *rtl_fw); 66 | void rtl8126_fw_write_firmware(struct rtl8126_private *tp, struct rtl8126_fw *rtl_fw); 67 | 68 | #endif /* _LINUX_R8126_FIRMWARE_H */ 69 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_firmware.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek 2.5Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTL8168_FIRMWARE_H 36 | #define _LINUX_RTL8168_FIRMWARE_H 37 | 38 | #include 39 | #include 40 | 41 | struct rtl8168_private; 42 | typedef void (*rtl8168_fw_write_t)(struct rtl8168_private *tp, u16 reg, u16 val); 43 | typedef u32 (*rtl8168_fw_read_t)(struct rtl8168_private *tp, u16 reg); 44 | 45 | #define RTL8168_VER_SIZE 32 46 | 47 | struct rtl8168_fw { 48 | rtl8168_fw_write_t phy_write; 49 | rtl8168_fw_read_t phy_read; 50 | rtl8168_fw_write_t mac_mcu_write; 51 | rtl8168_fw_read_t mac_mcu_read; 52 | const struct firmware *fw; 53 | const char *fw_name; 54 | struct device *dev; 55 | 56 | char version[RTL8168_VER_SIZE]; 57 | 58 | struct rtl8168_fw_phy_action { 59 | __le32 *code; 60 | size_t size; 61 | } phy_action; 62 | }; 63 | 64 | int rtl8168_fw_request_firmware(struct rtl8168_fw *rtl_fw); 65 | void rtl8168_fw_release_firmware(struct rtl8168_fw *rtl_fw); 66 | void rtl8168_fw_write_firmware(struct rtl8168_private *tp, struct rtl8168_fw *rtl_fw); 67 | 68 | #endif /* _LINUX_RTL8168_FIRMWARE_H */ 69 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_firmware.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_rtl8125_FIRMWARE_H 36 | #define _LINUX_rtl8125_FIRMWARE_H 37 | 38 | #include 39 | #include 40 | 41 | struct rtl8125_private; 42 | typedef void (*rtl8125_fw_write_t)(struct rtl8125_private *tp, u16 reg, u16 val); 43 | typedef u32 (*rtl8125_fw_read_t)(struct rtl8125_private *tp, u16 reg); 44 | 45 | #define RTL8125_VER_SIZE 32 46 | 47 | struct rtl8125_fw { 48 | rtl8125_fw_write_t phy_write; 49 | rtl8125_fw_read_t phy_read; 50 | rtl8125_fw_write_t mac_mcu_write; 51 | rtl8125_fw_read_t mac_mcu_read; 52 | const struct firmware *fw; 53 | const char *fw_name; 54 | struct device *dev; 55 | 56 | char version[RTL8125_VER_SIZE]; 57 | 58 | struct rtl8125_fw_phy_action { 59 | __le32 *code; 60 | size_t size; 61 | } phy_action; 62 | }; 63 | 64 | int rtl8125_fw_request_firmware(struct rtl8125_fw *rtl_fw); 65 | void rtl8125_fw_release_firmware(struct rtl8125_fw *rtl_fw); 66 | void rtl8125_fw_write_firmware(struct rtl8125_private *tp, struct rtl8125_fw *rtl_fw); 67 | 68 | #endif /* _LINUX_rtl8125_FIRMWARE_H */ 69 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | ### If USB Boot device we need a way to get the kernel args properly 4 | if [[ $boottype == usb && ! -z $web ]]; then 5 | sysuuid=$(dmidecode -s system-uuid) 6 | sysuuid=${sysuuid,,} 7 | mac=$(getMACAddresses) 8 | base64mac=$(echo $mac | base64) 9 | token=$(curl -Lks --data "mac=$base64mac" "${web}status/hostgetkey.php") 10 | curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac&hosttoken=${token}" "${web}service/hostinfo.php" -A '' 11 | [[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt 12 | fi 13 | dots "Running post init scripts" 14 | [[ ! -d /imagesinit ]] && mkdir /imagesinit >/dev/null 2>&1 15 | umount /imagesinit >/dev/null 2>&1 16 | mount -o nolock,proto=tcp,rsize=32768,wsize=32768,intr,noatime "$storage" /imagesinit >/tmp/mount-output 2>&1 17 | if [[ $? -eq 0 ]]; then 18 | if [[ -f /imagesinit/.mntcheck ]]; then 19 | if [[ -f /imagesinit/postinitscripts/fog.postinit ]]; then 20 | postinitpath="/imagesinit/postinitscripts/" 21 | elif [[ -f /imagesinit/dev/postinitscripts/fog.postinit ]]; then 22 | postinitpath="/imagesinit/dev/postinitscripts/" 23 | fi 24 | . ${postinitpath}fog.postinit 25 | fi 26 | umount /imagesinit >/dev/null 2>&1 27 | echo "Done" 28 | debugPause 29 | else 30 | echo "Skipped" 31 | debugPause 32 | fi 33 | if [[ -n $mode && $mode != +(*debug*) && -z $type ]]; then 34 | case $mode in 35 | wipe) 36 | fog.wipe 37 | ;; 38 | checkdisk) 39 | fog.testdisk 40 | ;; 41 | photorec) 42 | fog.photorec 43 | ;; 44 | badblocks) 45 | fog.surfacetest 46 | ;; 47 | clamav) 48 | fog.av 49 | ;; 50 | autoreg) 51 | fog.auto.reg 52 | ;; 53 | manreg) 54 | fog.man.reg 55 | ;; 56 | inventory) 57 | fog.inventory 58 | ;; 59 | capone) 60 | fog.capone 61 | ;; 62 | winpassreset) 63 | fog.chntpw 64 | ;; 65 | quickimage) 66 | fog.quickimage 67 | ;; 68 | sysinfo) 69 | fog.sysinfo 70 | ;; 71 | *) 72 | handleError "Fatal Error: Unknown mode :: $mode ($0)\n Args Passed: $*" 73 | ;; 74 | esac 75 | else 76 | case $type in 77 | down) 78 | fog.download 79 | ;; 80 | up) 81 | fog.upload 82 | ;; 83 | *) 84 | [[ -z $type ]] && type="Null" 85 | handleError "Fatal Error: Unknown request type :: $type" 86 | ;; 87 | esac 88 | fi 89 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/rtltool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTLTOOL_H 36 | #define _LINUX_RTLTOOL_H 37 | 38 | #define SIOCRTLTOOL SIOCDEVPRIVATE+1 39 | 40 | enum rtl_cmd { 41 | RTLTOOL_READ_MAC=0, 42 | RTLTOOL_WRITE_MAC, 43 | RTLTOOL_READ_PHY, 44 | RTLTOOL_WRITE_PHY, 45 | RTLTOOL_READ_EPHY, 46 | RTLTOOL_WRITE_EPHY, 47 | RTLTOOL_READ_ERI, 48 | RTLTOOL_WRITE_ERI, 49 | RTLTOOL_READ_PCI, 50 | RTLTOOL_WRITE_PCI, 51 | RTLTOOL_READ_EEPROM, 52 | RTLTOOL_WRITE_EEPROM, 53 | 54 | RTL_READ_OOB_MAC, 55 | RTL_WRITE_OOB_MAC, 56 | 57 | RTL_ENABLE_PCI_DIAG, 58 | RTL_DISABLE_PCI_DIAG, 59 | 60 | RTL_READ_MAC_OCP, 61 | RTL_WRITE_MAC_OCP, 62 | 63 | RTL_DIRECT_READ_PHY_OCP, 64 | RTL_DIRECT_WRITE_PHY_OCP, 65 | 66 | RTLTOOL_INVALID 67 | }; 68 | 69 | struct rtltool_cmd { 70 | __u32 cmd; 71 | __u32 offset; 72 | __u32 len; 73 | __u32 data; 74 | }; 75 | 76 | enum mode_access { 77 | MODE_NONE=0, 78 | MODE_READ, 79 | MODE_WRITE 80 | }; 81 | 82 | #ifdef __KERNEL__ 83 | int rtl8168_tool_ioctl(struct rtl8168_private *tp, struct ifreq *ifr); 84 | #endif 85 | 86 | #endif /* _LINUX_RTLTOOL_H */ 87 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/rtltool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTLTOOL_H 36 | #define _LINUX_RTLTOOL_H 37 | 38 | #define SIOCRTLTOOL SIOCDEVPRIVATE+1 39 | 40 | enum rtl_cmd { 41 | RTLTOOL_READ_MAC=0, 42 | RTLTOOL_WRITE_MAC, 43 | RTLTOOL_READ_PHY, 44 | RTLTOOL_WRITE_PHY, 45 | RTLTOOL_READ_EPHY, 46 | RTLTOOL_WRITE_EPHY, 47 | RTLTOOL_READ_ERI, 48 | RTLTOOL_WRITE_ERI, 49 | RTLTOOL_READ_PCI, 50 | RTLTOOL_WRITE_PCI, 51 | RTLTOOL_READ_EEPROM, 52 | RTLTOOL_WRITE_EEPROM, 53 | 54 | RTL_READ_OOB_MAC, 55 | RTL_WRITE_OOB_MAC, 56 | 57 | RTL_ENABLE_PCI_DIAG, 58 | RTL_DISABLE_PCI_DIAG, 59 | 60 | RTL_READ_MAC_OCP, 61 | RTL_WRITE_MAC_OCP, 62 | 63 | RTL_DIRECT_READ_PHY_OCP, 64 | RTL_DIRECT_WRITE_PHY_OCP, 65 | 66 | RTL_READ_FIBER_PHY, 67 | RTL_WRITE_FIBER_PHY, 68 | 69 | RTLTOOL_INVALID 70 | }; 71 | 72 | struct rtltool_cmd { 73 | __u32 cmd; 74 | __u32 offset; 75 | __u32 len; 76 | __u32 data; 77 | }; 78 | 79 | enum mode_access { 80 | MODE_NONE=0, 81 | MODE_READ, 82 | MODE_WRITE 83 | }; 84 | 85 | #ifdef __KERNEL__ 86 | int rtl8125_tool_ioctl(struct rtl8125_private *tp, struct ifreq *ifr); 87 | #endif 88 | 89 | #endif /* _LINUX_RTLTOOL_H */ 90 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/rtltool.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTLTOOL_H 36 | #define _LINUX_RTLTOOL_H 37 | 38 | #define SIOCRTLTOOL SIOCDEVPRIVATE+1 39 | 40 | enum rtl_cmd { 41 | RTLTOOL_READ_MAC=0, 42 | RTLTOOL_WRITE_MAC, 43 | RTLTOOL_READ_PHY, 44 | RTLTOOL_WRITE_PHY, 45 | RTLTOOL_READ_EPHY, 46 | RTLTOOL_WRITE_EPHY, 47 | RTLTOOL_READ_ERI, 48 | RTLTOOL_WRITE_ERI, 49 | RTLTOOL_READ_PCI, 50 | RTLTOOL_WRITE_PCI, 51 | RTLTOOL_READ_EEPROM, 52 | RTLTOOL_WRITE_EEPROM, 53 | 54 | RTL_READ_OOB_MAC, 55 | RTL_WRITE_OOB_MAC, 56 | 57 | RTL_ENABLE_PCI_DIAG, 58 | RTL_DISABLE_PCI_DIAG, 59 | 60 | RTL_READ_MAC_OCP, 61 | RTL_WRITE_MAC_OCP, 62 | 63 | RTL_DIRECT_READ_PHY_OCP, 64 | RTL_DIRECT_WRITE_PHY_OCP, 65 | 66 | RTL_READ_FIBER_PHY, 67 | RTL_WRITE_FIBER_PHY, 68 | 69 | RTLTOOL_INVALID 70 | }; 71 | 72 | struct rtltool_cmd { 73 | __u32 cmd; 74 | __u32 offset; 75 | __u32 len; 76 | __u32 data; 77 | }; 78 | 79 | enum mode_access { 80 | MODE_NONE=0, 81 | MODE_READ, 82 | MODE_WRITE 83 | }; 84 | 85 | #ifdef __KERNEL__ 86 | int rtl8126_tool_ioctl(struct rtl8126_private *tp, struct ifreq *ifr); 87 | #endif 88 | 89 | #endif /* _LINUX_RTLTOOL_H */ 90 | -------------------------------------------------------------------------------- /Buildroot/package/partclone/partclone-0.3.33.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/progress.c b/src/progress.c 2 | index 9858511..8b98adc 100644 3 | --- a/src/progress.c 4 | +++ b/src/progress.c 5 | @@ -228,6 +228,47 @@ static void calculate_speed(struct progress_bar *prog, unsigned long long copied 6 | strncpy(prog_stat->Rformated, Rformated, sizeof(Rformated)+1); 7 | } 8 | 9 | +/// convert the size 10 | +char* filesize_conv(double size, char *buf, size_t len) { 11 | + int i = 0; 12 | + const char* units[] = {"iB","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"}; 13 | + while (size > 1024) { 14 | + size /= 1024; 15 | + i++; 16 | + } 17 | + snprintf(buf, len, "%.*f %s", i, size, units[i]); 18 | + return buf; 19 | +} 20 | + 21 | +/// write data to log file for status/progress info 22 | +void fogLogStatusFile(struct progress_bar *prog,struct prog_stat_t *prog_stat,unsigned long long current) { 23 | + FILE *fog_log; 24 | + fog_log = fopen("/tmp/status.fog","w"); 25 | + if (fog_log == NULL) { 26 | + fprintf(stderr,"Error opening file %s","/tmp/status.fog"); 27 | + exit(0); 28 | + } 29 | + double totalsize=prog->block_size * prog->total; 30 | + double currentsize=prog->block_size * current; 31 | + int max_len=15; 32 | + char total_str[max_len]; 33 | + char current_str[max_len]; 34 | + char buf[max_len]; 35 | + sprintf(total_str,filesize_conv(totalsize,buf,max_len)); 36 | + sprintf(current_str,filesize_conv(currentsize,buf,max_len)); 37 | + fprintf(fog_log,"%6.2f%s@%s@%s@%s@%s@%6.2f@%f\n", 38 | + prog_stat->speed, 39 | + prog_stat->speed_unit, 40 | + prog_stat->Eformated, 41 | + prog_stat->Rformated, 42 | + current_str, 43 | + total_str, 44 | + prog_stat->percent, 45 | + totalsize 46 | + ); 47 | + fclose(fog_log); 48 | +} 49 | + 50 | /// update information at progress bar 51 | extern void progress_update(struct progress_bar *prog, unsigned long long copied, unsigned long long current, int done) 52 | { 53 | @@ -249,6 +290,7 @@ extern void progress_update(struct progress_bar *prog, unsigned long long copied 54 | fprintf(stderr, _(", %6.2f%s/%s,"), prog_stat.speed, prog_stat.speed_unit, prog->time_unit); 55 | if(prog->flag == IO) 56 | fprintf(stderr, _("\n\r%80c\rCurrent block: %10Lu, Total block: %10Lu, Complete: %6.2f%%%s\r"), clear_buf, current, prog->total, prog_stat.total_percent, "\x1b[A"); 57 | + fogLogStatusFile(prog, &prog_stat, current); 58 | } else { 59 | setlocale(LC_ALL, ""); 60 | bindtextdomain(PACKAGE, LOCALEDIR); 61 | @@ -326,6 +368,7 @@ extern void Ncurses_progress_update(struct progress_bar *prog, unsigned long lon 62 | wrefresh(p_win); 63 | wrefresh(bar_win); 64 | wrefresh(tbar_win); 65 | + fogLogStatusFile(prog, &prog_stat, current); 66 | } else { 67 | mvwprintw(p_win, 0, 0, _("Total Time: %s Remaining: %s "), prog_stat.Eformated, prog_stat.Rformated); 68 | if((prog->flag == IO) || (prog->flag == NO_BLOCK_DETAIL)) 69 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.checkin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | RUN_CHKDSK="" 4 | HOSTNAME_EARLY=0 5 | OS_ID_WIN7=5 6 | OS_ID_WIN8=6 7 | for arg in $(cat /proc/cmdline | tr -d \\0); do 8 | case $arg in 9 | initsh) 10 | ash -i 11 | ;; 12 | nombr) 13 | nombr=1 14 | ;; 15 | *) 16 | [[ $imgPartitionType != all && $imgPartitionType != mbr ]] && nombr=1 17 | ;; 18 | esac 19 | done 20 | clearScreen 21 | displayBanner 22 | osname="" 23 | mbrfile="" 24 | macWinSafe=$(echo $mac|sed 's/://g') 25 | sockets=$(grep "physical id" /proc/cpuinfo|sort -u|wc -l) 26 | arch=$(uname -m) 27 | [[ $chkdsk -eq 1 ]] && RUN_CHKDSK="-x" 28 | [[ $hostearly -eq 1 ]] && HOSTNAME_EARLY=1 29 | case $mc in 30 | yes) 31 | method="UDPCAST" 32 | ;; 33 | bt) 34 | method="Torrent-CAST" 35 | ;; 36 | *) 37 | method="NFS" 38 | ;; 39 | esac 40 | debugPause 41 | verifyNetworkConnection 42 | dots "Checking Operating System" 43 | [[ -z $deployed ]] && determineOS "$osid" 44 | echo "$osname" 45 | dots "Checking CPU Cores" 46 | cores=$(nproc) 47 | echo "$cores" 48 | dots "Send method" 49 | echo "$method" 50 | blGo=0 51 | nfsServerName="" 52 | checkin() { 53 | local poststring="$1" 54 | local php_post="$2" 55 | dots "Attempting to check in" 56 | local count=0 57 | local res="" 58 | local waittime=0 59 | while [[ $res != "##@GO" ]]; do 60 | res=$(curl -Lks --data "$poststring" ${web}service/$php_post 2>/dev/null) 61 | if [[ $res != "##@GO" ]]; then 62 | echo "Failed" 63 | debugPause 64 | echo -n " * $res (In line for " 65 | sec2string "$waittime" 66 | echo ")" 67 | let waittime+=5 68 | usleep 5000000 69 | dots "Attempting to check in" 70 | fi 71 | done 72 | echo "Done" 73 | debugPause 74 | directive="${res:3}" 75 | if [[ $directive != GO ]]; then 76 | tmpStorageIp=$(echo $queueinfo|cut -d'@' -f2 2>/dev/null) 77 | tmpStorage=$(echo $queueinfo|cut -d'@' -f3 2>/dev/null) 78 | tmpName=$(echo $queueinfo|cut -d'@' -f4 2>/dev/null) 79 | [[ -z $tmpStorage || -z $tmpStorageIp ]] && handleError "Error determining storage server! ($0)\n Args Passed: $*" 80 | storage="$tmpStorage" 81 | storageip="$tmpStorageIp" 82 | nfsServerName="$tmpName" 83 | dots "Using Storage Node" 84 | echo "$nfsServerName" 85 | debugPause 86 | fi 87 | } 88 | case $mc in 89 | [Yy][Ee][Ss]) 90 | php_post="mc_checkin.php" 91 | ;; 92 | *) 93 | php_post="Pre_Stage1.php" 94 | ;; 95 | esac 96 | sysuuid=$(dmidecode -s system-uuid) 97 | sysuuid=${sysuuid,,} 98 | case $mode in 99 | clamav) 100 | poststring="sysuuid=${sysuuid}&mac=$mac&avmode=$avmode" 101 | ;; 102 | ""|*) 103 | poststring="sysuuid=${sysuuid}&mac=$mac&type=$type" 104 | ;; 105 | esac 106 | [[ ! $capone -eq 1 ]] && checkin "$poststring" "$php_post" 107 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_fiber.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8168_FIBER_H 36 | #define _LINUX_R8168_FIBER_H 37 | 38 | enum { 39 | FIBER_MODE_NIC_ONLY = 0, 40 | FIBER_MODE_RTL8168H_RTL8211FS, 41 | FIBER_MODE_RTL8168H_MDI_SWITCH_RTL8211FS, 42 | FIBER_MODE_MAX 43 | }; 44 | 45 | enum { 46 | FIBER_STAT_NOT_CHECKED = 0, 47 | FIBER_STAT_CONNECT_EEPROM, 48 | FIBER_STAT_DISCONNECT, 49 | FIBER_STAT_CONNECT_GPO, 50 | FIBER_STAT_MAX 51 | }; 52 | 53 | enum { 54 | FIBER_LED_MODE_DEFAULT = 0, 55 | FIBER_LED_MODE_1, 56 | FIBER_LED_MODE_MAX 57 | }; 58 | 59 | #define HW_FIBER_MODE_ENABLED(_M) ((_M)->HwFiberModeVer > 0) 60 | #define HW_FIBER_STATUS_CONNECTED(_M) (((_M)->HwFiberStat == FIBER_STAT_CONNECT_EEPROM) || ((_M)->HwFiberStat == FIBER_STAT_CONNECT_GPO)) 61 | #define HW_FIBER_STATUS_DISCONNECTED(_M) ((_M)->HwFiberStat == FIBER_STAT_DISCONNECT) 62 | 63 | struct rtl8168_private; 64 | 65 | void rtl8168_hw_init_fiber_nic(struct rtl8168_private *tp); 66 | void rtl8168_hw_fiber_nic_d3_para(struct rtl8168_private *tp); 67 | void rtl8168_hw_fiber_phy_config(struct rtl8168_private *tp); 68 | void rtl8168_hw_switch_mdi_to_fiber(struct rtl8168_private *tp); 69 | void rtl8168_hw_switch_mdi_to_nic(struct rtl8168_private *tp); 70 | unsigned int rtl8168_hw_fiber_link_ok(struct rtl8168_private *tp); 71 | void rtl8168_check_fiber_link_status(struct rtl8168_private *tp); 72 | void rtl8168_check_hw_fiber_mode_support(struct rtl8168_private *tp); 73 | void rtl8168_set_fiber_mode_software_variable(struct rtl8168_private *tp); 74 | 75 | #endif /* _LINUX_R8168_FIBER_H */ 76 | -------------------------------------------------------------------------------- /dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Distros that have been tested: 4 | # - Debian 11, 12 5 | # - Ubuntu 22.04, 24.04 6 | # - RHEL 8.10, 9.4 7 | # - Fedora 39, 40 8 | # - Rocky 9.4 9 | 10 | 11 | declare -ar common_dependencies=( 12 | "wget" 13 | "tar" 14 | "git" 15 | "make" 16 | "gcc" 17 | "flex" 18 | "bison" 19 | "gcc-aarch64-linux-gnu" 20 | "cpio" 21 | "file" 22 | "rsync" 23 | "patch" 24 | "unzip" 25 | "bzip2" 26 | "findutils" 27 | ) 28 | 29 | declare -ar deb_dependencies=( 30 | "libelf-dev" 31 | "xz-utils" 32 | "g++" 33 | "libncurses-dev" 34 | ) 35 | 36 | declare -ar rhel_dependencies=( 37 | "elfutils-libelf-devel" 38 | "perl" 39 | "xz" 40 | "gcc-c++" 41 | "ncurses-devel" 42 | ) 43 | 44 | 45 | function __epel_repo_message() { 46 | echo "" 47 | echo "Please add the EPEL repository to your system." 48 | echo "The EPEL repository is needed to install the following dependencies: gcc-aarch64-linux-gnu" 49 | echo "" 50 | } 51 | 52 | 53 | function checkDependencies() { 54 | local running_os 55 | running_os=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"') 56 | package_manager="" 57 | 58 | case $running_os in 59 | "debian" | "ubuntu") 60 | dependencies=("${common_dependencies[@]}" "${deb_dependencies[@]}") 61 | package_manager="sudo apt install -y" 62 | pkgmgr() { 63 | dpkg -l 64 | } 65 | ;; 66 | "rhel" | "rocky" | "fedora") 67 | dependencies=("${common_dependencies[@]}" "${rhel_dependencies[@]}") 68 | package_manager="sudo dnf install -y" 69 | pkgmgr() { 70 | rpm -qa --qf "ii %{NAME}\n" 71 | } 72 | if [[ $running_os == "rhel" || $running_os == "rocky" ]]; then 73 | __epel_repo_message 74 | fi 75 | ;; 76 | *) 77 | echo "Untested OS: $running_os" 78 | echo "Exiting now." 79 | exit 1 80 | ;; 81 | esac 82 | 83 | missing_packages="" 84 | for package in "${dependencies[@]}"; do 85 | pkgmgr | awk '{print $2}' | cut -d':' -f1 | grep -qe "${package}" 86 | if [[ $? -ne 0 ]]; then 87 | missing_packages="${missing_packages} ${package}" 88 | fi 89 | done 90 | 91 | if [[ $missing_packages != "" ]]; then 92 | echo "The following dependencies are missing:${missing_packages}" 93 | fi 94 | } 95 | 96 | 97 | function installDependencies() { 98 | local install_dep=$1 99 | 100 | if [[ $install_dep != "y" && -n $missing_packages ]]; then 101 | echo "Exiting now, please install the packages manually or add the -i or --install-dep flag to install them automatically." 102 | exit 1 103 | fi 104 | 105 | if [[ -n $missing_packages ]]; then 106 | echo "Atempting to install missing dependencies..." 107 | $package_manager "${dependencies[@]}" > /dev/null 2>&1 108 | if [[ $? -ne 0 ]]; then 109 | echo "Failed to install dependencies, please install the packages manually. Exiting now." 110 | exit 1 111 | fi 112 | fi 113 | } 114 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_rss.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_RTL8168_RSS_H 36 | #define _LINUX_RTL8168_RSS_H 37 | 38 | #include 39 | #include 40 | 41 | #define RTL8168_RSS_INDIR_TBL_SIZE 8 42 | #define RTL8168_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ 43 | #define RTL8168_MAX_INDIRECTION_TABLE_ENTRIES 128 44 | 45 | struct rtl8168_private; 46 | struct RxDescV2; 47 | 48 | int rtl8168_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 49 | u32 *rule_locs); 50 | int rtl8168_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd); 51 | u32 rtl8168_get_rxfh_key_size(struct net_device *netdev); 52 | u32 rtl8168_rss_indir_size(struct net_device *netdev); 53 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) 54 | int rtl8168_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh); 55 | int rtl8168_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, 56 | struct netlink_ext_ack *extack); 57 | #else 58 | int rtl8168_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, 59 | u8 *hfunc); 60 | int rtl8168_set_rxfh(struct net_device *netdev, const u32 *indir, 61 | const u8 *key, const u8 hfunc); 62 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) */ 63 | void rtl8168_rx_hash(struct rtl8168_private *tp, 64 | struct RxDescV2 *desc, 65 | struct sk_buff *skb); 66 | void _rtl8168_config_rss(struct rtl8168_private *tp); 67 | void rtl8168_config_rss(struct rtl8168_private *tp); 68 | void rtl8168_init_rss(struct rtl8168_private *tp); 69 | u32 rtl8168_rss_indir_tbl_entries(struct rtl8168_private *tp); 70 | void rtl8168_disable_rss(struct rtl8168_private *tp); 71 | 72 | #endif /* _LINUX_RTL8168_RSS_H */ 73 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.capone: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | for arg in $(cat /proc/cmdline | tr -d \\0); do 4 | case $arg in 5 | initsh) 6 | ash -i 7 | ;; 8 | *) 9 | ;; 10 | esac 11 | done 12 | export capone=1 13 | clearScreen 14 | displayBanner 15 | echo " * Starting Capone" 16 | debugPause 17 | dots "Using Key Value:" 18 | dmivalue=$(dmidecode -s $dmi) 19 | echo "$dmivalue" 20 | debugPause 21 | dmi64=$(echo -n $dmivalue | base64) 22 | dots "Looking for images" 23 | count=0 24 | imgret="" 25 | while [[ -z $imgret ]]; do 26 | imgret=$(curl -Lks --data "action=imagelookup&key=${dmi64}" ${web}service/capone.php 2>/dev/null) 27 | [[ -n $imgret ]] && continue 28 | if [[ $count -ge 10 ]]; then 29 | echo "Failed" 30 | debugPause 31 | handleError "Count not find an Image definition ($0)\n Args Passed: $*" 32 | fi 33 | let count+=1 34 | usleep 5000000 35 | done 36 | echo "Done" 37 | debugPause 38 | cnt=0 39 | linedecode="" 40 | osname="" 41 | mbrfile="" 42 | defaultpart2start="" 43 | img="" 44 | osid="" 45 | imgType="" 46 | imgPartitionType="" 47 | imgFormat="" 48 | for line in $imgret; do 49 | linedecode=$(echo $line | base64 -d) 50 | [[ -z $linedecode ]] && handleError "No image definition was found for $dmivalue ($0)\n Args Passed: $*" 51 | let cnt+=1 52 | awk_returned_vars=$(echo $linedecode | awk -F'|' "{printf(\"%s %s %s %s %s %s %s\",\$1,\$2,\$3,\$4,\$5,\$6,\$7)}") 53 | read img osid imgType imgPartitionType imgFormat storage storageip <<< $awk_returned_vars 54 | determineOS "$osid" 55 | echo -n " ID $cnt) " 56 | echo -n " OS: $osname" 57 | echo -n " Image: " 58 | echo $img 59 | echo -n " Partition: " 60 | echo $imgPartitionType 61 | echo -n " Format : " 62 | case $imgFormat in 63 | 1) 64 | echo "Partimage" 65 | ;; 66 | 2) 67 | echo "Partclone split files" 68 | ;; 69 | *) 70 | echo "Partclone" 71 | ;; 72 | esac 73 | done 74 | case $cnt in 75 | 0) 76 | handleError "No image definition was found for $dmivalue ($0)\n Args Passed: $*" 77 | ;; 78 | 1) 79 | ;; 80 | *) 81 | imgchoice="" 82 | while [[ -z $imgchoice ]]; do 83 | echo -n " Multiple images found, please select an image #: " 84 | read imgchoice 85 | done 86 | cnt=0 87 | for line in $imgret; do 88 | linedecode=$(echo $line | base64 -d) 89 | let cnt+=1 90 | if [[ $cnt -eq $imgchoice ]]; then 91 | awk_returned_vars=$(echo $linedecode | awk -F'|' "{printf(\"%s %s %s %s %s %s %s\",\$1,\$2,\$3,\$4,\$5,\$6,\$7)}") 92 | read img osid imgType imgPartitionType imgFormat storage storageip <<< $awk_returned_vars 93 | determineOS "$osid" 94 | break 95 | fi 96 | done 97 | ;; 98 | esac 99 | echo " * Setting up environment to deploy image" 100 | export type="down" 101 | export mac=$(getMACAddresses) 102 | export img 103 | export osid 104 | export imgType 105 | export imgPartitionType 106 | export imgFormat 107 | export storage 108 | export storageip 109 | debugPause 110 | clear 111 | fog 112 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_rss.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_RSS_H 36 | #define _LINUX_R8126_RSS_H 37 | 38 | #include 39 | #include 40 | 41 | #define RTL8126_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ 42 | #define RTL8126_MAX_INDIRECTION_TABLE_ENTRIES 128 43 | 44 | enum rtl8126_rss_flag { 45 | RTL_8125_RSS_FLAG_HASH_UDP_IPV4 = (1 << 0), 46 | RTL_8125_RSS_FLAG_HASH_UDP_IPV6 = (1 << 1), 47 | }; 48 | 49 | struct rtl8126_private; 50 | struct RxDesc; 51 | 52 | int rtl8126_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 53 | u32 *rule_locs); 54 | int rtl8126_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd); 55 | u32 rtl8126_get_rxfh_key_size(struct net_device *netdev); 56 | u32 rtl8126_rss_indir_size(struct net_device *netdev); 57 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) 58 | int rtl8126_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh); 59 | int rtl8126_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, 60 | struct netlink_ext_ack *extack); 61 | #else 62 | int rtl8126_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, 63 | u8 *hfunc); 64 | int rtl8126_set_rxfh(struct net_device *netdev, const u32 *indir, 65 | const u8 *key, const u8 hfunc); 66 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) */ 67 | void rtl8126_rx_hash(struct rtl8126_private *tp, 68 | struct RxDesc *desc, 69 | struct sk_buff *skb); 70 | void _rtl8126_config_rss(struct rtl8126_private *tp); 71 | void rtl8126_config_rss(struct rtl8126_private *tp); 72 | void rtl8126_init_rss(struct rtl8126_private *tp); 73 | u32 rtl8126_rss_indir_tbl_entries(struct rtl8126_private *tp); 74 | void rtl8126_disable_rss(struct rtl8126_private *tp); 75 | 76 | #endif /* _LINUX_R8126_RSS_H */ 77 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_rss.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_rtl8125_RSS_H 36 | #define _LINUX_rtl8125_RSS_H 37 | 38 | #include 39 | #include 40 | 41 | #define RTL8125_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ 42 | #define RTL8125_MAX_INDIRECTION_TABLE_ENTRIES 128 43 | 44 | enum rtl8125_rss_flag { 45 | RTL_8125_RSS_FLAG_HASH_UDP_IPV4 = (1 << 0), 46 | RTL_8125_RSS_FLAG_HASH_UDP_IPV6 = (1 << 1), 47 | }; 48 | 49 | struct rtl8125_private; 50 | struct RxDesc; 51 | 52 | int rtl8125_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 53 | u32 *rule_locs); 54 | int rtl8125_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd); 55 | u32 rtl8125_get_rxfh_key_size(struct net_device *netdev); 56 | u32 rtl8125_rss_indir_size(struct net_device *netdev); 57 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) 58 | int rtl8125_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh); 59 | int rtl8125_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh, 60 | struct netlink_ext_ack *extack); 61 | #else 62 | int rtl8125_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, 63 | u8 *hfunc); 64 | int rtl8125_set_rxfh(struct net_device *netdev, const u32 *indir, 65 | const u8 *key, const u8 hfunc); 66 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) */ 67 | void rtl8125_rx_hash(struct rtl8125_private *tp, 68 | struct RxDesc *desc, 69 | struct sk_buff *skb); 70 | void _rtl8125_config_rss(struct rtl8125_private *tp); 71 | void rtl8125_config_rss(struct rtl8125_private *tp); 72 | void rtl8125_init_rss(struct rtl8125_private *tp); 73 | u32 rtl8125_rss_indir_tbl_entries(struct rtl8125_private *tp); 74 | void rtl8125_disable_rss(struct rtl8125_private *tp); 75 | 76 | #endif /* _LINUX_rtl8125_RSS_H */ 77 | -------------------------------------------------------------------------------- /Buildroot/package/chntpw/chntpw.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index 6b4531e..9be0b0e 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -7,13 +7,9 @@ 6 | # 7 | 8 | #SSLPATH=/usr/local/ssl 9 | -OSSLPATH=/usr 10 | +OSSLPATH=../../.././output/target/usr 11 | OSSLINC=$(OSSLPATH)/include 12 | 13 | -CC=gcc 14 | - 15 | -# Force 32 bit 16 | -CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 17 | OSSLLIB=$(OSSLPATH)/lib 18 | 19 | # 64 bit if default for compiler setup 20 | @@ -26,36 +22,23 @@ OSSLLIB=$(OSSLPATH)/lib 21 | LIBS=-L$(OSSLLIB) 22 | 23 | 24 | -all: chntpw chntpw.static cpnt reged reged.static samusrgrp samusrgrp.static sampasswd sampasswd.static 25 | +all: chntpw cpnt reged samusrgrp sampasswd 26 | 27 | chntpw: chntpw.o ntreg.o edlib.o libsam.o 28 | $(CC) $(CFLAGS) -o chntpw chntpw.o ntreg.o edlib.o libsam.o $(LIBS) 29 | 30 | -chntpw.static: chntpw.o ntreg.o edlib.o libsam.o 31 | - $(CC) -static $(CFLAGS) -o chntpw.static chntpw.o ntreg.o edlib.o libsam.o $(LIBS) 32 | - 33 | cpnt: cpnt.o 34 | $(CC) $(CFLAGS) -o cpnt cpnt.o $(LIBS) 35 | 36 | reged: reged.o ntreg.o edlib.o 37 | $(CC) $(CFLAGS) -o reged reged.o ntreg.o edlib.o 38 | 39 | -reged.static: reged.o ntreg.o edlib.o 40 | - $(CC) -static $(CFLAGS) -o reged.static reged.o ntreg.o edlib.o 41 | - 42 | -samusrgrp.static: samusrgrp.o ntreg.o libsam.o 43 | - $(CC) -static $(CFLAGS) -o samusrgrp.static samusrgrp.o ntreg.o libsam.o 44 | - 45 | samusrgrp: samusrgrp.o ntreg.o libsam.o 46 | $(CC) $(CFLAGS) -o samusrgrp samusrgrp.o ntreg.o libsam.o 47 | 48 | sampasswd: sampasswd.o ntreg.o libsam.o 49 | $(CC) $(CFLAGS) -o sampasswd sampasswd.o ntreg.o libsam.o 50 | 51 | -sampasswd.static: sampasswd.o ntreg.o libsam.o 52 | - $(CC) -static $(CFLAGS) -o sampasswd.static sampasswd.o ntreg.o libsam.o 53 | - 54 | - 55 | 56 | #ts: ts.o ntreg.o 57 | # $(CC) $(CFLAGS) -nostdlib -o ts ts.o ntreg.o $(LIBS) 58 | diff --git a/chntpw-presplit.c b/chntpw-presplit.c 59 | index 824fed5..a8203b9 100644 60 | --- a/chntpw-presplit.c 61 | +++ b/chntpw-presplit.c 62 | @@ -582,7 +582,7 @@ int put_grp_members_sid(int grp, struct sid_array *sarray) 63 | 64 | if (gverbose) printf("put_grp_members_sid: ajusted: mofs = %x, mlen = %x (%d)\n", mofs + 0x34 ,mlen,mlen); 65 | 66 | - if (gverbose) hexdump(&c->data, 0, c->len, 1); 67 | + if (gverbose) hexdump((char *)&c->data, 0, c->len, 1); 68 | 69 | /* Get total size of new SID data */ 70 | 71 | @@ -610,7 +610,7 @@ int put_grp_members_sid(int grp, struct sid_array *sarray) 72 | cd->members_len = sidlen; /* Update member count in C struct */ 73 | cd->grp_members = i; 74 | 75 | - if (gverbose) hexdump(&c->data, 0, c->len, 1); 76 | + if (gverbose) hexdump((char *)&c->data, 0, c->len, 1); 77 | 78 | if (!put_buf2val(hive[H_SAM], c, 0, g, 0, TPF_VK_EXACT)) { 79 | fprintf(stderr,"put_grp_members_sid: could not write back group info in value %s\n",g); 80 | diff --git a/libsam.c b/libsam.c 81 | index 2c06c11..0932db7 100644 82 | --- a/libsam.c 83 | +++ b/libsam.c 84 | @@ -511,7 +511,7 @@ int sam_put_grp_members_sid(struct hive *hdesc, int grp, struct sid_array *sarra 85 | 86 | if (gverbose) printf("put_grp_members_sid: ajusted: mofs = %x, mlen = %x (%d)\n", mofs + 0x34 ,mlen,mlen); 87 | 88 | - if (gverbose) hexdump(&c->data, 0, c->len, 1); 89 | + if (gverbose) hexdump((char *)&c->data, 0, c->len, 1); 90 | 91 | /* Get total size of new SID data */ 92 | 93 | @@ -539,7 +539,7 @@ int sam_put_grp_members_sid(struct hive *hdesc, int grp, struct sid_array *sarra 94 | cd->members_len = sidlen; /* Update member count in C struct */ 95 | cd->grp_members = i; 96 | 97 | - if (gverbose) hexdump(&c->data, 0, c->len, 1); 98 | + if (gverbose) hexdump((char *)&c->data, 0, c->len, 1); 99 | 100 | if (!put_buf2val(hdesc, c, 0, g, 0, TPF_VK_EXACT)) { 101 | fprintf(stderr,"put_grp_members_sid: could not write back group info in value %s\n",g); 102 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /var/lib/buildkite-agent/github-upload.sh 4 | [[ -z ${GITHUB_USER} || -z ${GITHUB_TOKEN} ]] && echo "Missing Github information, can't proceed." && exit 1 5 | 6 | command -v curl 7 | [[ $? -ne 0 ]] && echo "Package curl not installed, can't proceed." && exit 1 8 | command -v jq 9 | [[ $? -ne 0 ]] && echo "Package jq not installed, can't proceed." && exit 1 10 | 11 | KERNEL_VERSION=$(grep KERNEL_VERSION= build.sh | cut -d"'" -f2) 12 | BUILDROOT_VERSION=$(grep BUILDROOT_VERSION= build.sh | cut -d"'" -f2) 13 | 14 | if [[ -n "$1" && "$1" =~ ^[0-9]\.[0-9][0-9]*\.[0-9][0-9]*$ ]]; then 15 | # official release build 16 | GITHUB_TAG=$1 17 | GITHUB_NAME="FOG $1 kernels and inits" 18 | curl -s -X POST -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases -d "{ \"tag_name\":\"${GITHUB_TAG}\", \"name\":\"${GITHUB_NAME}\", \"body\":\"Linux kernel ${KERNEL_VERSION}\nBuildroot ${BUILDROOT_VERSION}\" }" > response.json 19 | elif [[ -n "$1" ]]; then 20 | # beta testing builds 21 | GITHUB_TAG="testing" 22 | GITHUB_NAME="Testing from $(date +%d.%m.%Y)" 23 | TESTING_RELEASE_ID=$(curl -s -X GET -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases/tags/${GITHUB_TAG} | jq -r .id) 24 | HEAD_SHA=$(curl -s -X GET -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/git/refs/heads/${1} | jq -r .object.sha) 25 | curl -s -X PATCH -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/git/refs/tags/${GITHUB_TAG} -d "{ \"sha\":\"${HEAD_SHA}\" }" > tag_update_response.json 26 | curl -s -X PATCH -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases/${TESTING_RELEASE_ID} -d "{ \"tag_name\":\"${GITHUB_TAG}\", \"name\":\"${GITHUB_NAME}\", \"body\":\"Linux kernel ${KERNEL_VERSION}\nBuildroot ${BUILDROOT_VERSION}\nGithub-Branch ${1}\" }" > response.json 27 | else 28 | # semi-official development builds 29 | GITHUB_TAG=$(date +%Y%m%d) 30 | GITHUB_NAME="Latest from $(date +%d.%m.%Y)" 31 | curl -s -X POST -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases -d "{ \"tag_name\":\"${GITHUB_TAG}\", \"name\":\"${GITHUB_NAME}\", \"body\":\"Linux kernel ${KERNEL_VERSION}\nBuildroot ${BUILDROOT_VERSION}\" }" > response.json 32 | fi 33 | 34 | 35 | GITHUB_RELEASE_ID=$(cat response.json | jq -r .id) 36 | 37 | [[ -z ${GITHUB_RELEASE_ID} || ${GITHUB_RELEASE_ID} == "null" ]] && echo "ID not found in response, something went wrong when trying to create or update the release on Github." && cat response.json && exit 1 38 | 39 | echo "Release created/updated on Github, tagged ${GITHUB_TAG}, id ${GITHUB_RELEASE_ID}." 40 | 41 | buildkite-agent artifact download 'dist/*' . 42 | cd dist/ 43 | 44 | for i in `ls -1` 45 | do 46 | if [[ ${i} =~ "sha256" ]] 47 | then 48 | sha256sum -c ${i} 49 | [[ $? -ne 0 ]] && echo "Checkum check failed on ${i}." && exit 1 50 | fi 51 | echo "Uploading ${i}..." 52 | if [[ -n "$1" ]]; then 53 | ASSET_ID=$(curl -s -X GET -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases/${GITHUB_RELEASE_ID}/assets | jq -r '.[] | "\(.id),\(.name)"' | grep ",${i}\$"| cut -f1 -d,) 54 | if [[ -n "${ASSET_ID}" ]]; then 55 | curl -s -X DELETE -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases/assets/${ASSET_ID} 56 | fi 57 | fi 58 | curl -s -X POST -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Content-Type: application/octet-stream" --data-binary "@${i}" "https://uploads.github.com/repos/FOGProject/fos/releases/${GITHUB_RELEASE_ID}/assets?name=${i}" > ${i}.uploaded 59 | UPLOAD_STATUS=$(cat ${i}.uploaded | jq -r .state) 60 | [[ ${UPLOAD_STATUS} != "uploaded" ]] && echo "Failed to upload file ${i}." && cat ${i}.uploaded && exit 1 61 | sleep 1 62 | done 63 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_realwow.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_REALWOW_H 36 | #define _LINUX_R8126_REALWOW_H 37 | 38 | #define SIOCDEVPRIVATE_RTLREALWOW SIOCDEVPRIVATE+3 39 | 40 | #define MAX_RealWoW_KCP_SIZE (100) 41 | #define MAX_RealWoW_Payload (64) 42 | 43 | #define KA_TX_PACKET_SIZE (100) 44 | #define KA_WAKEUP_PATTERN_SIZE (120) 45 | 46 | //HwSuppKeepAliveOffloadVer 47 | #define HW_SUPPORT_KCP_OFFLOAD(_M) ((_M)->HwSuppKCPOffloadVer > 0) 48 | 49 | enum rtl_realwow_cmd { 50 | 51 | RTL_REALWOW_SET_KCP_DISABLE=0, 52 | RTL_REALWOW_SET_KCP_INFO, 53 | RTL_REALWOW_SET_KCP_CONTENT, 54 | 55 | RTL_REALWOW_SET_KCP_ACKPKTINFO, 56 | RTL_REALWOW_SET_KCP_WPINFO, 57 | RTL_REALWOW_SET_KCPDHCP_TIMEOUT, 58 | 59 | RTLT_REALWOW_COMMAND_INVALID 60 | }; 61 | 62 | struct rtl_realwow_ioctl_struct { 63 | __u32 cmd; 64 | __u32 offset; 65 | __u32 len; 66 | union { 67 | __u32 data; 68 | void *data_buffer; 69 | }; 70 | }; 71 | 72 | typedef struct _MP_KCPInfo { 73 | u8 DIPv4[4]; 74 | u8 MacID[6]; 75 | u16 UdpPort[2]; 76 | u8 PKTLEN[2]; 77 | 78 | u16 ackLostCnt; 79 | u8 KCP_WakePattern[MAX_RealWoW_Payload]; 80 | u8 KCP_AckPacket[MAX_RealWoW_Payload]; 81 | u32 KCP_interval; 82 | u8 KCP_WakePattern_Len; 83 | u8 KCP_AckPacket_Len; 84 | u8 KCP_TxPacket[2][KA_TX_PACKET_SIZE]; 85 | } MP_KCP_INFO, *PMP_KCP_INFO; 86 | 87 | typedef struct _KCPInfo { 88 | u32 nId; // = id 89 | u8 DIPv4[4]; 90 | u8 MacID[6]; 91 | u16 UdpPort; 92 | u16 PKTLEN; 93 | } KCPInfo, *PKCPInfo; 94 | 95 | typedef struct _KCPContent { 96 | u32 id; // = id 97 | u32 mSec; // = msec 98 | u32 size; // =size 99 | u8 bPacket[MAX_RealWoW_KCP_SIZE]; // put packet here 100 | } KCPContent, *PKCPContent; 101 | 102 | typedef struct _RealWoWAckPktInfo { 103 | u16 ackLostCnt; 104 | u16 patterntSize; 105 | u8 pattern[MAX_RealWoW_Payload]; 106 | } RealWoWAckPktInfo,*PRealWoWAckPktInfo; 107 | 108 | typedef struct _RealWoWWPInfo { 109 | u16 patterntSize; 110 | u8 pattern[MAX_RealWoW_Payload]; 111 | } RealWoWWPInfo,*PRealWoWWPInfo; 112 | 113 | int rtl8126_realwow_ioctl(struct net_device *dev, struct ifreq *ifr); 114 | void rtl8126_realwow_hw_init(struct net_device *dev); 115 | void rtl8126_get_realwow_hw_version(struct net_device *dev); 116 | void rtl8126_set_realwow_d3_para(struct net_device *dev); 117 | 118 | #endif /* _LINUX_R8126_REALWOW_H */ 119 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_realwow.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8168_REALWOW_H 36 | #define _LINUX_R8168_REALWOW_H 37 | 38 | #define SIOCDEVPRIVATE_RTLREALWOW SIOCDEVPRIVATE+3 39 | 40 | #define MAX_RealWoW_KCP_SIZE (100) 41 | #define MAX_RealWoW_Payload (64) 42 | 43 | #define KA_TX_PACKET_SIZE (100) 44 | #define KA_WAKEUP_PATTERN_SIZE (120) 45 | 46 | //HwSuppKeepAliveOffloadVer 47 | #define HW_SUPPORT_KCP_OFFLOAD(_M) ((_M)->HwSuppKCPOffloadVer > 0) 48 | 49 | enum rtl_realwow_cmd { 50 | 51 | RTL_REALWOW_SET_KCP_DISABLE=0, 52 | RTL_REALWOW_SET_KCP_INFO, 53 | RTL_REALWOW_SET_KCP_CONTENT, 54 | 55 | RTL_REALWOW_SET_KCP_ACKPKTINFO, 56 | RTL_REALWOW_SET_KCP_WPINFO, 57 | RTL_REALWOW_SET_KCPDHCP_TIMEOUT, 58 | 59 | RTLT_REALWOW_COMMAND_INVALID 60 | }; 61 | 62 | struct rtl_realwow_ioctl_struct { 63 | __u32 cmd; 64 | __u32 offset; 65 | __u32 len; 66 | union { 67 | __u32 data; 68 | void *data_buffer; 69 | }; 70 | }; 71 | 72 | typedef struct _MP_KCPInfo { 73 | u8 DIPv4[4]; 74 | u8 MacID[6]; 75 | u16 UdpPort[2]; 76 | u8 PKTLEN[2]; 77 | 78 | u16 ackLostCnt; 79 | u8 KCP_WakePattern[MAX_RealWoW_Payload]; 80 | u8 KCP_AckPacket[MAX_RealWoW_Payload]; 81 | u32 KCP_interval; 82 | u8 KCP_WakePattern_Len; 83 | u8 KCP_AckPacket_Len; 84 | u8 KCP_TxPacket[2][KA_TX_PACKET_SIZE]; 85 | } MP_KCP_INFO, *PMP_KCP_INFO; 86 | 87 | typedef struct _KCPInfo { 88 | u32 nId; // = id 89 | u8 DIPv4[4]; 90 | u8 MacID[6]; 91 | u16 UdpPort; 92 | u16 PKTLEN; 93 | } KCPInfo, *PKCPInfo; 94 | 95 | typedef struct _KCPContent { 96 | u32 id; // = id 97 | u32 mSec; // = msec 98 | u32 size; // =size 99 | u8 bPacket[MAX_RealWoW_KCP_SIZE]; // put packet here 100 | } KCPContent, *PKCPContent; 101 | 102 | typedef struct _RealWoWAckPktInfo { 103 | u16 ackLostCnt; 104 | u16 patterntSize; 105 | u8 pattern[MAX_RealWoW_Payload]; 106 | } RealWoWAckPktInfo,*PRealWoWAckPktInfo; 107 | 108 | typedef struct _RealWoWWPInfo { 109 | u16 patterntSize; 110 | u8 pattern[MAX_RealWoW_Payload]; 111 | } RealWoWWPInfo,*PRealWoWWPInfo; 112 | 113 | int rtl8168_realwow_ioctl(struct net_device *dev, struct ifreq *ifr); 114 | void rtl8168_realwow_hw_init(struct net_device *dev); 115 | void rtl8168_get_realwow_hw_version(struct net_device *dev); 116 | void rtl8168_set_realwow_d3_para(struct net_device *dev); 117 | 118 | #endif /* _LINUX_R8168_REALWOW_H */ 119 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_realwow.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8125_REALWOW_H 36 | #define _LINUX_R8125_REALWOW_H 37 | 38 | #define SIOCDEVPRIVATE_RTLREALWOW SIOCDEVPRIVATE+3 39 | 40 | #define MAX_RealWoW_KCP_SIZE (100) 41 | #define MAX_RealWoW_Payload (64) 42 | 43 | #define KA_TX_PACKET_SIZE (100) 44 | #define KA_WAKEUP_PATTERN_SIZE (120) 45 | 46 | //HwSuppKeepAliveOffloadVer 47 | #define HW_SUPPORT_KCP_OFFLOAD(_M) ((_M)->HwSuppKCPOffloadVer > 0) 48 | 49 | enum rtl_realwow_cmd { 50 | 51 | RTL_REALWOW_SET_KCP_DISABLE=0, 52 | RTL_REALWOW_SET_KCP_INFO, 53 | RTL_REALWOW_SET_KCP_CONTENT, 54 | 55 | RTL_REALWOW_SET_KCP_ACKPKTINFO, 56 | RTL_REALWOW_SET_KCP_WPINFO, 57 | RTL_REALWOW_SET_KCPDHCP_TIMEOUT, 58 | 59 | RTLT_REALWOW_COMMAND_INVALID 60 | }; 61 | 62 | struct rtl_realwow_ioctl_struct { 63 | __u32 cmd; 64 | __u32 offset; 65 | __u32 len; 66 | union { 67 | __u32 data; 68 | void *data_buffer; 69 | }; 70 | }; 71 | 72 | typedef struct _MP_KCPInfo { 73 | u8 DIPv4[4]; 74 | u8 MacID[6]; 75 | u16 UdpPort[2]; 76 | u8 PKTLEN[2]; 77 | 78 | u16 ackLostCnt; 79 | u8 KCP_WakePattern[MAX_RealWoW_Payload]; 80 | u8 KCP_AckPacket[MAX_RealWoW_Payload]; 81 | u32 KCP_interval; 82 | u8 KCP_WakePattern_Len; 83 | u8 KCP_AckPacket_Len; 84 | u8 KCP_TxPacket[2][KA_TX_PACKET_SIZE]; 85 | } MP_KCP_INFO, *PMP_KCP_INFO; 86 | 87 | typedef struct _KCPInfo { 88 | u32 nId; // = id 89 | u8 DIPv4[4]; 90 | u8 MacID[6]; 91 | u16 UdpPort; 92 | u16 PKTLEN; 93 | } KCPInfo, *PKCPInfo; 94 | 95 | typedef struct _KCPContent { 96 | u32 id; // = id 97 | u32 mSec; // = msec 98 | u32 size; // =size 99 | u8 bPacket[MAX_RealWoW_KCP_SIZE]; // put packet here 100 | } KCPContent, *PKCPContent; 101 | 102 | typedef struct _RealWoWAckPktInfo { 103 | u16 ackLostCnt; 104 | u16 patterntSize; 105 | u8 pattern[MAX_RealWoW_Payload]; 106 | } RealWoWAckPktInfo,*PRealWoWAckPktInfo; 107 | 108 | typedef struct _RealWoWWPInfo { 109 | u16 patterntSize; 110 | u8 pattern[MAX_RealWoW_Payload]; 111 | } RealWoWWPInfo,*PRealWoWWPInfo; 112 | 113 | int rtl8125_realwow_ioctl(struct net_device *dev, struct ifreq *ifr); 114 | void rtl8125_realwow_hw_init(struct net_device *dev); 115 | void rtl8125_get_realwow_hw_version(struct net_device *dev); 116 | void rtl8125_set_realwow_d3_para(struct net_device *dev); 117 | 118 | #endif /* _LINUX_R8125_REALWOW_H */ 119 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/ssh/sshd_config: -------------------------------------------------------------------------------- 1 | # $OpenBSD: sshd_config,v 1.97 2015/08/06 14:53:21 deraadt Exp $ 2 | 3 | # This is the sshd server system-wide configuration file. See 4 | # sshd_config(5) for more information. 5 | 6 | # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin 7 | 8 | # The strategy used for options in the default sshd_config shipped with 9 | # OpenSSH is to specify options with their default value where 10 | # possible, but leave them commented. Uncommented options override the 11 | # default value. 12 | 13 | #Port 22 14 | #AddressFamily any 15 | #ListenAddress 0.0.0.0 16 | #ListenAddress :: 17 | 18 | # The default requires explicit activation of protocol 1 19 | #Protocol 2 20 | 21 | # HostKey for protocol version 1 22 | #HostKey /etc/ssh/ssh_host_key 23 | # HostKeys for protocol version 2 24 | #HostKey /etc/ssh/ssh_host_rsa_key 25 | #HostKey /etc/ssh/ssh_host_dsa_key 26 | #HostKey /etc/ssh/ssh_host_ecdsa_key 27 | #HostKey /etc/ssh/ssh_host_ed25519_key 28 | 29 | # Lifetime and size of ephemeral version 1 server key 30 | #KeyRegenerationInterval 1h 31 | #ServerKeyBits 1024 32 | 33 | # Ciphers and keying 34 | #RekeyLimit default none 35 | 36 | # Logging 37 | # obsoletes QuietMode and FascistLogging 38 | #SyslogFacility AUTH 39 | #LogLevel INFO 40 | 41 | # Authentication: 42 | 43 | #LoginGraceTime 2m 44 | PermitRootLogin yes 45 | #StrictModes yes 46 | #MaxAuthTries 6 47 | #MaxSessions 10 48 | 49 | #RSAAuthentication yes 50 | #PubkeyAuthentication yes 51 | 52 | # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 53 | # but this is overridden so installations will only check .ssh/authorized_keys 54 | AuthorizedKeysFile .ssh/authorized_keys 55 | 56 | #AuthorizedPrincipalsFile none 57 | 58 | #AuthorizedKeysCommand none 59 | #AuthorizedKeysCommandUser nobody 60 | 61 | # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 62 | #RhostsRSAAuthentication no 63 | # similar for protocol version 2 64 | #HostbasedAuthentication no 65 | # Change to yes if you don't trust ~/.ssh/known_hosts for 66 | # RhostsRSAAuthentication and HostbasedAuthentication 67 | #IgnoreUserKnownHosts no 68 | # Don't read the user's ~/.rhosts and ~/.shosts files 69 | #IgnoreRhosts yes 70 | 71 | # To disable tunneled clear text passwords, change to no here! 72 | PasswordAuthentication yes 73 | #PermitEmptyPasswords no 74 | 75 | # Change to no to disable s/key passwords 76 | #ChallengeResponseAuthentication yes 77 | 78 | # Kerberos options 79 | #KerberosAuthentication no 80 | #KerberosOrLocalPasswd yes 81 | #KerberosTicketCleanup yes 82 | #KerberosGetAFSToken no 83 | 84 | # GSSAPI options 85 | #GSSAPIAuthentication no 86 | #GSSAPICleanupCredentials yes 87 | 88 | # Set this to 'yes' to enable PAM authentication, account processing, 89 | # and session processing. If this is enabled, PAM authentication will 90 | # be allowed through the ChallengeResponseAuthentication and 91 | # PasswordAuthentication. Depending on your PAM configuration, 92 | # PAM authentication via ChallengeResponseAuthentication may bypass 93 | # the setting of "PermitRootLogin without-password". 94 | # If you just want the PAM account and session checks to run without 95 | # PAM authentication, then enable this but set PasswordAuthentication 96 | # and ChallengeResponseAuthentication to 'no'. 97 | #UsePAM no 98 | 99 | #AllowAgentForwarding yes 100 | #AllowTcpForwarding yes 101 | #GatewayPorts no 102 | #X11Forwarding no 103 | #X11DisplayOffset 10 104 | #X11UseLocalhost yes 105 | #PermitTTY yes 106 | #PrintMotd yes 107 | #PrintLastLog yes 108 | #TCPKeepAlive yes 109 | #UseLogin no 110 | #PermitUserEnvironment no 111 | #Compression delayed 112 | #ClientAliveInterval 0 113 | #ClientAliveCountMax 3 114 | #UseDNS no 115 | #PidFile /var/run/sshd.pid 116 | #MaxStartups 10:30:100 117 | #PermitTunnel no 118 | #ChrootDirectory none 119 | #VersionAddendum none 120 | 121 | # no default banner path 122 | #Banner none 123 | 124 | # override default of no subsystems 125 | Subsystem sftp /usr/libexec/sftp-server 126 | 127 | # Example of overriding settings on a per-user basis 128 | #Match User anoncvs 129 | # X11Forwarding no 130 | # AllowTcpForwarding no 131 | # PermitTTY no 132 | # ForceCommand cvs server 133 | -------------------------------------------------------------------------------- /patch/filesystem/fs.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Config.in b/Config.in 2 | index d730f2034b..9ad4198d14 100644 3 | --- a/Config.in 4 | +++ b/Config.in 5 | @@ -741,6 +741,24 @@ config BR2_GLOBAL_PATCH_DIR 6 | 7 | menu "Advanced" 8 | 9 | +config BR2_COMPILER_PARANOID_UNSAFE_PATH 10 | + bool "paranoid check of library/header paths" 11 | + default y 12 | + help 13 | + By default, when this option is disabled, when the Buildroot 14 | + cross-compiler will encounter an unsafe library or header path 15 | + (such as /usr/include, or /usr/lib), the compiler will display 16 | + a warning. 17 | + 18 | + By enabling this option, this warning is turned into an error, 19 | + which will completely abort the build when such unsafe paths 20 | + are encountered. 21 | + 22 | + Note that this mechanism is available for both the internal 23 | + toolchain (through the toolchain wrapper and binutils patches) 24 | + and external toolchain backends (through the toolchain 25 | + wrapper). 26 | + 27 | config BR2_FORCE_HOST_BUILD 28 | bool "Force the building of host dependencies" 29 | help 30 | diff --git a/package/Makefile.in b/package/Makefile.in 31 | index 829636900b..b2028f9a7c 100644 32 | --- a/package/Makefile.in 33 | +++ b/package/Makefile.in 34 | @@ -447,8 +447,9 @@ else ifeq ($(BR2_SHARED_STATIC_LIBS),y) 35 | SHARED_STATIC_LIBS_OPTS = --enable-static --enable-shared 36 | endif 37 | 38 | -# Used by our binutils patches. 39 | +ifeq ($(BR2_COMPILER_PARANOID_UNSAFE_PATH),y) 40 | export BR_COMPILER_PARANOID_UNSAFE_PATH=enabled 41 | +endif 42 | 43 | include package/pkg-download.mk 44 | include package/pkg-autotools.mk 45 | diff --git a/support/config-fragments/minimal.config b/support/config-fragments/minimal.config 46 | index 3430fcce11..71344e2c69 100644 47 | --- a/support/config-fragments/minimal.config 48 | +++ b/support/config-fragments/minimal.config 49 | @@ -4,4 +4,5 @@ BR2_INIT_NONE=y 50 | BR2_SYSTEM_BIN_SH_NONE=y 51 | # BR2_PACKAGE_BUSYBOX is not set 52 | # BR2_TARGET_ROOTFS_TAR is not set 53 | +BR2_COMPILER_PARANOID_UNSAFE_PATH=y 54 | BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y 55 | diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c 56 | index 8b1fb79dde..6d23b81ef8 100644 57 | --- a/toolchain/toolchain-wrapper.c 58 | +++ b/toolchain/toolchain-wrapper.c 59 | @@ -157,6 +157,7 @@ static const struct str_len_s unsafe_opts[] = { 60 | */ 61 | static void check_unsafe_path(const char *arg, 62 | const char *path, 63 | + int paranoid, 64 | int arg_has_path) 65 | { 66 | const struct str_len_s *p; 67 | @@ -165,12 +166,14 @@ static void check_unsafe_path(const char *arg, 68 | if (strncmp(path, p->str, p->len)) 69 | continue; 70 | fprintf(stderr, 71 | - "%s: ERROR: unsafe header/library path used in cross-compilation: '%s%s%s'\n", 72 | + "%s: %s: unsafe header/library path used in cross-compilation: '%s%s%s'\n", 73 | program_invocation_short_name, 74 | + paranoid ? "ERROR" : "WARNING", 75 | arg, 76 | arg_has_path ? "" : "' '", /* close single-quote, space, open single-quote */ 77 | arg_has_path ? "" : path); /* so that arg and path are properly quoted. */ 78 | - exit(1); 79 | + if (paranoid) 80 | + exit(1); 81 | } 82 | } 83 | 84 | @@ -245,6 +248,8 @@ int main(int argc, char **argv) 85 | char *progpath = argv[0]; 86 | char *basename; 87 | char *env_debug; 88 | + char *paranoid_wrapper; 89 | + int paranoid; 90 | int ret, i, count = 0, debug = 0, found_shared = 0, found_nonoption = 0; 91 | 92 | /* Debug the wrapper to see arguments it was called with. 93 | @@ -475,6 +480,12 @@ int main(int argc, char **argv) 94 | #endif 95 | } 96 | 97 | + paranoid_wrapper = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH"); 98 | + if (paranoid_wrapper && strlen(paranoid_wrapper) > 0) 99 | + paranoid = 1; 100 | + else 101 | + paranoid = 0; 102 | + 103 | /* Check for unsafe library and header paths */ 104 | for (i = 1; i < argc; i++) { 105 | const struct str_len_s *opt; 106 | @@ -491,9 +502,9 @@ int main(int argc, char **argv) 107 | i++; 108 | if (i == argc) 109 | break; 110 | - check_unsafe_path(argv[i-1], argv[i], 0); 111 | + check_unsafe_path(argv[i-1], argv[i], paranoid, 0); 112 | } else 113 | - check_unsafe_path(argv[i], argv[i] + opt->len, 1); 114 | + check_unsafe_path(argv[i], argv[i] + opt->len, paranoid, 1); 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/etc/init.d/S40network: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Start the network.... 4 | # 5 | if [[ -n $has_usb_nic ]]; then 6 | echo "Please unplug your device and replug it into the usb port" 7 | echo -n "Please press enter key to connect [Enter]" 8 | read -p "$*" 9 | echo "Sleeping for 5 seconds to allow USB to sync back with system" 10 | sleep 5 11 | fi 12 | 13 | # Geo-Grabbing kernel parameters because the variables are probably not set yet 14 | for var in $(cat /proc/cmdline); do 15 | var=$(echo "${var}" | awk -F= '{name=$1; gsub(/[+][_][+]/," ",$2); gsub(/"/,"\\\"", $2); value=$2; if (length($2) == 0 || $0 !~ /=/ || $0 ~ /nvme_core\.default_ps_max_latency_us=/) {print "";} else {printf("%s=%s", name, value)}}') 16 | [[ -z $var ]] && continue; 17 | eval "export ${var}" 2>/dev/null 18 | done 19 | 20 | # Enable loopback interface 21 | echo -e "auto lo\niface lo inet loopback\n\n" > /etc/network/interfaces 22 | /sbin/ip addr add 127.0.0.1/8 dev lo 23 | /sbin/ip link set lo up 24 | 25 | sleep 10 26 | 27 | # Generated a sorted list with primary interfaces first 28 | read p_ifaces <<< $(/sbin/ip -0 addr show | awk 'ORS=NR%2?FS:RS' | awk -F'[: ]+' 'tolower($0) ~ /link[/]?ether/ && tolower($0) ~ /'$mac'/ {print $2}' | tr '\n' ' ') 29 | read o_ifaces <<< $(/sbin/ip -0 addr show | awk 'ORS=NR%2?FS:RS' | awk -F'[: ]+' 'tolower($0) ~ /link[/]?ether/ && tolower($0) !~ /'$mac'/ {print $2}' | tr '\n' ' ') 30 | ifaces="$p_ifaces $o_ifaces" 31 | for iface in $ifaces; do 32 | echo "Starting $iface interface and waiting for the link to come up" 33 | echo -e "auto $iface\niface $iface inet dhcp\n\n" >> /etc/network/interfaces 34 | /sbin/ip link set $iface up 35 | 36 | # Wait till the interface is fully up and ready (spanning tree) 37 | timeout=0 38 | linkstate=0 39 | until [[ $linkstate -eq 1 || $timeout -ge 35 ]]; do 40 | let timeout+=1 41 | linkstate=$(/bin/cat /sys/class/net/$iface/carrier) 42 | [[ $linkstate -eq 0 ]] && sleep 1 || break 43 | done 44 | [[ $linkstate -eq 0 ]] && echo "No link detected on $iface for $timeout seconds, skipping it." && continue 45 | for retry in $(seq 3); do 46 | /sbin/udhcpc -i $iface --now 47 | ustat="$?" 48 | curl -Ikfso /dev/null "${web}"/index.php --connect-timeout 5 49 | cstat="$?" 50 | # If the udhcp is okay AND we can curl our web 51 | # we know we have link so no need to continue on. 52 | # NOTE: the link to web is kind of important, just 53 | # exiting on dhcp request is not sufficient. 54 | if [[ $ustat -eq 0 && $cstat -eq 0 ]]; then 55 | mac_curr=$(ip link show $iface | awk '/ether/ {print tolower($2)}') 56 | if [[ ! -z $setmacto ]]; then 57 | mac_sett=$(echo "$setmacto" | awk '{print tolower($1)}') 58 | if [[ "x$mac_curr" != "x$mac_sett" ]]; then 59 | ip link set dev $iface down 60 | ip link set dev $iface address $mac_sett 61 | ip link set dev $iface up 62 | /sbin/udhcpc -i $iface --now 63 | ustat="$?" 64 | curl -Ikfso /dev/null "${web}"/index.php --connect-timeout 5 65 | cstat="$?" 66 | [[ $ustat -eq 0 && $cstat -eq 0 ]] && exit 0 67 | fi 68 | fi 69 | [[ $ustat -eq 0 && $cstat -eq 0 ]] && exit 0 70 | fi 71 | echo "Either DHCP failed or we were unable to access ${web}/index.php for connection testing." 72 | # Geo-If we are on the 2nd loop, lets check to see if 73 | # spanning tree is blocking dhcp 74 | if [[ $seq -eq 2 ]]; then 75 | echo "Waiting for Spanning Tree timeout on ${iface}..." 76 | sleep 27 77 | else 78 | sleep 1 79 | fi 80 | done 81 | echo "No DHCP response on interface $iface, skipping it." 82 | done 83 | 84 | # If we end up here something went wrong as we do exit the script as soon as we get an IP! 85 | if [[ -z "$(echo $ifaces | tr -d ' ')" ]]; then # because ifaces is constructed with a space, we must strip it 86 | echo "No network interfaces found, your kernel is most probably missing the correct driver!" 87 | else 88 | echo "Failed to get an IP via DHCP! Tried on interface(s): $ifaces" 89 | fi 90 | echo "Please check your network setup and try again!" 91 | [[ -z $isdebug ]] && sleep 60 && reboot 92 | echo "Press enter to continue" 93 | read -t 60 94 | exit 1 95 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.inventory: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | [[ $mode == +(*capone*) ]] && return 3 | . /usr/share/fog/lib/funcs.sh 4 | [[ $deployed -eq 1 ]] && . /bin/fog.checkin 5 | getHardDisk 6 | doInventory 7 | gpu_array_length=${#graphics_vendors_array[@]} 8 | if [[ -z $1 ]]; then 9 | echo -e "\n\n\n" 10 | echo " +---------------------------+" 11 | echo " | System Information |" 12 | echo " +---------------------------+" 13 | dots "System Manufacturer:" 14 | echo "$sysman" 15 | dots "System Product Name:" 16 | echo "$sysproduct" 17 | dots "System Version:" 18 | echo "$sysversion" 19 | dots "System Serial Number:" 20 | echo "$sysserial" 21 | dots "System UUID:" 22 | echo "$sysuuid" 23 | dots "Computer Form Factor:" 24 | echo "$systype" 25 | usleep 1000000 26 | echo " +---------------------------+" 27 | echo " | BIOS Information |" 28 | echo " +---------------------------+" 29 | dots "BIOS Version:" 30 | echo "$biosversion" 31 | dots "BIOS Vendor:" 32 | echo "$biosvendor" 33 | dots "BIOS Date:" 34 | echo "$biosdate" 35 | usleep 1000000 36 | echo " +---------------------------+" 37 | echo " | Motherboard Information |" 38 | echo " +---------------------------+" 39 | dots "Motherboard Manufacturer:" 40 | echo "$mbman" 41 | dots "Motherboard Product Name:" 42 | echo "$mbproductname" 43 | dots "Motherboard Product Version:" 44 | echo "$mbversion" 45 | dots "Motherboard Serial Number:" 46 | echo "$mbserial" 47 | dots "Motherboard Asset Tag:" 48 | echo "$mbasset" 49 | usleep 1000000 50 | echo " +---------------------------+" 51 | echo " | CPU Information |" 52 | echo " +---------------------------+" 53 | dots "CPU Manufacturer:" 54 | echo "$cpuman" 55 | dots "CPU Version:" 56 | echo "$cpuversion" 57 | dots "CPU Current Speed:" 58 | echo "$cpucurrent" 59 | dots "CPU Max Speed:" 60 | echo "$cpumax" 61 | usleep 1000000 62 | echo " +---------------------------+" 63 | echo " | Memory Information |" 64 | echo " +---------------------------+" 65 | dots "Memory:" 66 | echo "$mem" 67 | usleep 1000000 68 | echo " +---------------------------+" 69 | echo " | Hard Disk Information |" 70 | echo " +---------------------------+" 71 | dots "Hard Disk:" 72 | echo "$hdinfo" 73 | usleep 1000000 74 | echo " +---------------------------+" 75 | echo " | Case Information |" 76 | echo " +---------------------------+" 77 | dots "Case Manufacturer:" 78 | echo "$caseman" 79 | dots "Case Version:" 80 | echo "$casever" 81 | dots "Case Serial Number:" 82 | echo "$caseserial" 83 | dots "Case Asset Number:" 84 | echo "$caseasset" 85 | usleep 1000000 86 | echo " +---------------------------+" 87 | echo " | GPU Information |" 88 | echo " +---------------------------+" 89 | for (( i=0; i<$gpu_array_length; i++ )); do 90 | dots "GPU-$i Manufacturer:" 91 | echo ${graphics_vendors_array[$i]} 92 | dots "GPU-$i Product:" 93 | echo ${graphics_products_array[$i]} 94 | done 95 | echo -e "\n\n\n" 96 | fi 97 | poststring="mac=${mac}&sysman=${sysman64}&sysproduct=${sysproduct64}&sysversion=${sysversion64}&sysserial=${sysserial64}&sysuuid=${sysuuid64}&systype=${systype64}&biosversion=${biosversion64}&biosvendor=${biosvendor64}&biosdate=${biosdate64}&mbman=${mbman64}&mbproductname=${mbproductname64}&mbversion=${mbversion64}&mbserial=${mbserial64}&mbasset=${mbasset64}&cpuman=${cpuman64}&cpuversion=${cpuversion64}&cpucurrent=${cpucurrent64}&cpumax=${cpumax64}&mem=${mem64}&hdinfo=${hdinfo64}&caseman=${caseman64}&casever=${casever64}&caseserial=${caseserial64}&caseasset=${caseasset64}&gpuvendors=${inventory_graphics_vendor64}&gpuproducts=${inventory_graphics_product64}" 98 | count=0 99 | res="" 100 | while [[ -z $res ]]; do 101 | dots "Attempting to send inventory" 102 | res=$(curl -Lks --data "$poststring" ${web}service/inventory.php 2>/dev/null) 103 | if [[ $count -ge 10 ]]; then 104 | echo "Failed" 105 | debugPause 106 | break 107 | fi 108 | if [[ -z $res ]]; then 109 | let count+=1 110 | usleep 2000000 111 | fi 112 | done 113 | echo "Done" 114 | debugPause 115 | [[ $deployed -eq 1 ]] && . /bin/fog.nonimgcomplete $mac 116 | -------------------------------------------------------------------------------- /create-usb-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | dl_url=$1 6 | 7 | if [ -z "$dl_url" ]; then 8 | echo "Usage: $0 " 9 | echo "Example: $0 https://github.com/fogproject/fos/releases/download/20231208" 10 | exit 1 11 | fi 12 | 13 | if [ -f /tmp/fogkern.img ]; then 14 | echo Nuking old FOG Debug image 15 | rm -f /tmp/fos-usb.img 16 | fi 17 | 18 | echo Make a blank 128MB disk image 19 | dd if=/dev/zero of=/tmp/fos-usb.img bs=1M count=128 20 | 21 | echo Make the partition table, partition and set it bootable. 22 | parted --script /tmp/fos-usb.img mklabel msdos mkpart p fat32 1 128 set 1 boot on 23 | 24 | echo Map the partitions from the image file 25 | kpartx -a -s /tmp/fos-usb.img 26 | LOOPDEV=$(losetup -a | grep "/tmp/fos-usb.img" | grep -o "loop[0-9]*") 27 | 28 | echo Make an vfat filesystem on the first partition. 29 | mkfs -t vfat -n GRUB /dev/mapper/${LOOPDEV}p1 30 | 31 | echo Mount the filesystem via loopback 32 | mount /dev/mapper/${LOOPDEV}p1 /mnt 33 | 34 | echo Install GRUB 35 | grub-install --removable --no-nvram --no-uefi-secure-boot --efi-directory=/mnt --boot-directory=/mnt/boot --target=x86_64-efi 36 | 37 | echo Download the FOG kernels and inits 38 | wget -P /mnt/boot/ ${dl_url}/bzImage 39 | wget -P /mnt/boot/ ${dl_url}/init.xz 40 | wget -P /mnt/boot/ https://github.com/FOGProject/fogproject/blob/dev-branch/packages/web/service/ipxe/memdisk 41 | wget -P /mnt/boot/ https://github.com/FOGProject/fogproject/blob/dev-branch/packages/web/service/ipxe/memtest.bin 42 | wget -P /mnt/boot/ https://github.com/FOGProject/fogproject/blob/dev-branch/packages/tftp/ipxe.krn 43 | wget -P /mnt/boot/ https://github.com/FOGProject/fogproject/blob/dev-branch/packages/tftp/ipxe.efi 44 | 45 | cat > /mnt/boot/README.txt << 'EOF' 46 | 47 | !! IMPORTANT !! Change the myfogip variable in the boot/grub/grub.cfg file to the IP address of your FOG server first! 48 | 49 | This is the FOG USB image. It is designed to register machines, as well as deploy and capture images from a FOG server on machines that have trouble with PXE. 50 | 51 | To use this image, you will need to create a bootable USB stick. You can use the following command to write this image to a USB stick: 52 | 53 | dd if=fos-usb.img of=/dev/sdX bs=1M 54 | 55 | Where /dev/sdX is the device name of your USB stick. Be very careful with this command, as it can destroy data on your hard drive if you specify the wrong device. 56 | 57 | Once you have written the image to the USB stick, you can boot the target system from the USB stick. The system will boot into a FOG menu that will allow you to capture an image, deploy an image, register a host, or run a memory test. 58 | 59 | EOF 60 | 61 | echo Create the grub configuration file 62 | cat > /mnt/boot/grub/grub.cfg << 'EOF' 63 | 64 | set myfogip=http://change-this-to-your-fog-ip 65 | set myimage=/boot/bzImage 66 | set myinits=/boot/init.xz 67 | set myloglevel=4 68 | set timeout=-1 69 | insmod all_video 70 | 71 | menuentry "1. FOG Image Deploy/Capture" { 72 | echo loading the kernel 73 | linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 74 | echo loading the virtual hard drive 75 | initrd $myinits 76 | echo booting kernel... 77 | } 78 | 79 | menuentry "2. Perform Full Host Registration and Inventory" { 80 | echo loading the kernel 81 | linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=manreg 82 | echo loading the virtual hard drive 83 | initrd $myinits 84 | echo booting kernel... 85 | } 86 | 87 | menuentry "3. Quick Registration and Inventory" { 88 | echo loading the kernel 89 | linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=autoreg 90 | echo loading the virtual hard drive 91 | initrd $myinits 92 | echo booting kernel... 93 | } 94 | 95 | menuentry "4. Client System Information (Compatibility)" { 96 | echo loading the kernel 97 | linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=sysinfo 98 | echo loading the virtual hard drive 99 | initrd $myinits 100 | echo booting kernel... 101 | } 102 | 103 | menuentry "5. Run Memtest86+" { 104 | linux /boot/memdisk iso raw 105 | initrd /boot/memtest.bin 106 | } 107 | 108 | menuentry "6. FOG Debug Kernel" { 109 | echo loading the kernel 110 | linux $myimage loglevel=7 init=/sbin/init root=/dev/ram0 rw ramdisk_size=275000 keymap= boottype=usb consoleblank=0 rootfstype=ext4 isdebug=yes 111 | echo loading the virtual hard drive 112 | initrd $myinits 113 | echo booting kernel... 114 | } 115 | 116 | menuentry "7. FOG iPXE Jumpstart BIOS" { 117 | echo loading the kernel 118 | linux16 /boot/ipxe.krn 119 | echo booting iPXE... 120 | } 121 | 122 | menuentry "8. FOG iPXE Jumpstart EFI" { 123 | echo chain loading the kernel 124 | insmod chain 125 | chainloader /boot/ipxe.efi 126 | echo booting iPXE-efi... 127 | } 128 | 129 | EOF 130 | 131 | echo Unmount the loopback 132 | umount /mnt 133 | 134 | echo Unmap the image 135 | kpartx -d /tmp/fos-usb.img -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_ptp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_rtl8125_PTP_H 36 | #define _LINUX_rtl8125_PTP_H 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5,11,0) 45 | #define PTP_MSGTYPE_SYNC 0x0 46 | #define PTP_MSGTYPE_DELAY_REQ 0x1 47 | #define PTP_MSGTYPE_PDELAY_REQ 0x2 48 | #define PTP_MSGTYPE_PDELAY_RESP 0x3 49 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,11,0) */ 50 | 51 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) 52 | struct clock_identity { 53 | u8 id[8]; 54 | } __packed; 55 | 56 | struct port_identity { 57 | struct clock_identity clock_identity; 58 | __be16 port_number; 59 | } __packed; 60 | 61 | struct ptp_header { 62 | u8 tsmt; /* transportSpecific | messageType */ 63 | u8 ver; /* reserved | versionPTP */ 64 | __be16 message_length; 65 | u8 domain_number; 66 | u8 reserved1; 67 | u8 flag_field[2]; 68 | __be64 correction; 69 | __be32 reserved2; 70 | struct port_identity source_port_identity; 71 | __be16 sequence_id; 72 | u8 control; 73 | u8 log_message_interval; 74 | } __packed; 75 | 76 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) */ 77 | 78 | struct rtl8125_ptp_info { 79 | s64 time_sec; 80 | u32 time_ns; 81 | u16 ts_info; 82 | }; 83 | 84 | #ifndef _STRUCT_TIMESPEC 85 | #define _STRUCT_TIMESPEC 86 | struct timespec { 87 | __kernel_old_time_t tv_sec; /* seconds */ 88 | long tv_nsec; /* nanoseconds */ 89 | }; 90 | #endif 91 | 92 | enum PTP_CMD_TYPE { 93 | PTP_CMD_SET_LOCAL_TIME = 0, 94 | PTP_CMD_DRIFT_LOCAL_TIME, 95 | PTP_CMD_LATCHED_LOCAL_TIME, 96 | }; 97 | 98 | #define PTP_CLKADJ_MODE_SET BIT_0 99 | 100 | enum PTP_CLKADJ_MOD_TYPE { 101 | NO_FUNCTION = 0, 102 | CLKADJ_MODE_SET = 1, 103 | RESERVED = 2, 104 | DIRECT_READ = 4, 105 | DIRECT_WRITE = 6, 106 | INCREMENT_STEP = 8, 107 | DECREMENT_STEP = 10, 108 | RATE_READ = 12, 109 | RATE_WRITE = 14, 110 | }; 111 | 112 | enum PTP_INSR_TYPE { 113 | EVENT_CAP_INTR = (1 << 0), 114 | TRIG_GEN_INTR = (1 << 1), 115 | RX_TS_INTR = (1 << 2), 116 | TX_TX_INTR = (1 << 3), 117 | }; 118 | 119 | enum PTP_TRX_TS_STA_REG { 120 | TRX_TS_RD = (1 << 0), 121 | TRXTS_SEL = (1 << 1), 122 | RX_TS_PDLYRSP_RDY = (1 << 8), 123 | RX_TS_PDLYREQ_RDY = (1 << 9), 124 | RX_TS_DLYREQ_RDY = (1 << 10), 125 | RX_TS_SYNC_RDY = (1 << 11), 126 | TX_TS_PDLYRSP_RDY = (1 << 12), 127 | TX_TS_PDLYREQ_RDY = (1 << 13), 128 | TX_TS_DLYREQ_RDY = (1 << 14), 129 | TX_TS_SYNC_RDY = (1 << 15), 130 | }; 131 | 132 | #define RTL_FLAG_RX_HWTSTAMP_ENABLED BIT_0 133 | 134 | struct rtl8125_private; 135 | struct RxDescV3; 136 | 137 | #if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) 138 | int rtl8125_get_ts_info(struct net_device *netdev, 139 | struct ethtool_ts_info *info); 140 | #else 141 | int rtl8125_get_ts_info(struct net_device *netdev, 142 | struct kernel_ethtool_ts_info *info); 143 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) */ 144 | 145 | void rtl8125_ptp_reset(struct rtl8125_private *tp); 146 | void rtl8125_ptp_init(struct rtl8125_private *tp); 147 | void rtl8125_ptp_suspend(struct rtl8125_private *tp); 148 | void rtl8125_ptp_stop(struct rtl8125_private *tp); 149 | 150 | int rtl8125_ptp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); 151 | 152 | void rtl8125_rx_mac_ptp_pktstamp(struct rtl8125_private *tp, struct sk_buff *skb, 153 | struct RxDescV3 *descv3); 154 | 155 | void rtl8125_set_phy_local_time(struct rtl8125_private *tp); 156 | 157 | void rtl8125_rx_phy_ptp_timestamp(struct rtl8125_private *tp, struct sk_buff *skb); 158 | 159 | #endif /* _LINUX_rtl8125_PTP_H */ 160 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.av: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | . /bin/fog.checkin 4 | clearScreen 5 | displayBanner 6 | disks="" 7 | disk="" 8 | hd="" 9 | parts="" 10 | part="" 11 | sysuuid=$(dmidecode -s system-uuid) 12 | sysuuid=${sysuuid,,} 13 | dots "Mounting Clamav" 14 | [[ ! -d /opt/fog/clamav ]] && mkdir -p /opt/fog/clamav >/dev/null 2>&1 15 | mount -o nolock,proto=tcp,rsize=32768,wsize=32768,intr,noatime $clamav /opt/fog/clamav >/tmp/mount-output 2>&1 16 | if [[ ! $? -eq 0 ]]; then 17 | echo "Failed" 18 | debugPause 19 | handleError "Unable to mount location. ($0)\n Args Passed: $*\n Reason: $(cat /tmp/mount-output | tr -d \\0)" 20 | fi 21 | echo "Done" 22 | debugPause 23 | dots "Adding clamav to path" 24 | if [[ -d /opt/fog/clamav/bin && -d /opt/fog/clamav/sbin ]]; then 25 | export PATH="$PATH:/opt/fog/clamav/bin:/opt/fog/clamav/sbin" 26 | else 27 | echo "Failed" 28 | debugPause 29 | handleError "Cannot find clamav binaries to run task. ($0)\n Args Passed: $*" 30 | fi 31 | echo "Done" 32 | debugPause 33 | dots "Updating clamav" 34 | freshclam >/dev/null 2>&1 35 | case $? in 36 | 0) 37 | echo "Done" 38 | ;; 39 | *) 40 | echo "Failed" 41 | debugPause 42 | handleError "Unable to update clamav definitions. ($0)\n Args Passed: $*" 43 | ;; 44 | esac 45 | debugPause 46 | echo "Done" 47 | debugPause 48 | dots "Getting disks to scan" 49 | getHardDisk 'true' 50 | if [[ -z $disks ]]; then 51 | echo "Failed" 52 | debugPause 53 | handleError "Unable to find any disks. ($0)\n Args Passed: $*" 54 | fi 55 | echo "Done" 56 | debugPause 57 | dots "Creating scan partition" 58 | [[ ! -d /clamavscan ]] && mkdir -p /clamavscan >/dev/null 2>&1 59 | if [[ ! -d /clamavscan ]]; then 60 | echo "Failed" 61 | debugPause 62 | handleError "Unable to create scan folder. ($0)\n Args Passed: $*" 63 | fi 64 | echo "Done" 65 | debugPause 66 | action="" 67 | case $avmode in 68 | [Ss]) 69 | modename="Scan and Report" 70 | ;; 71 | [Qq]) 72 | action="--move=/clamavscan/fog/infected" 73 | modename="Scan and Quarantine" 74 | ;; 75 | *) 76 | handleError "Unable to determine scanning mode! ($0)\n Args Passed: $*" 77 | ;; 78 | esac 79 | for disk in $disks; do 80 | dots "Using disk" 81 | echo "$disk" 82 | debugPause 83 | getPartitions "$disk" 84 | for part in $parts; do 85 | isBitlockedPartition "$part" 86 | fsTypeSetting "$part" 87 | case $fstype in 88 | [Nn][Tt][Ff][Ss]) 89 | echo " * Mounting partition $part" 90 | ntfs-3g -o remove_hiberfile,rw $part /clamavscan >/tmp/clamavscan-mount-output 2>&1 91 | ;; 92 | [Ee][Xx][Tt][Ff][Ss]) 93 | echo " * Mounting partition $part" 94 | mount -o rw $part /clamavscan >/tmp/clamavscan-mount-output 2>&1 95 | ;; 96 | *) 97 | dots "Not scanning partition" 98 | echo "$part" 99 | debugPause 100 | continue 101 | ;; 102 | esac 103 | [[ ! $? -eq 0 ]] && handleError " * Could not mount partition ($0)\n Args Passed: $*\n Reason: $(cat /tmp/clamavscan-mount-output | tr -d \\0)" 104 | debugPause 105 | dots "Creating working directories" 106 | mkdir -p /clamavscan/fog/{tmp,infected,log} >/dev/null 2>&1 107 | case $? in 108 | 0) 109 | echo "Done" 110 | ;; 111 | *) 112 | echo "Failed" 113 | debugPause 114 | umount /clamavscan >/dev/null 2>&1 115 | continue 116 | ;; 117 | esac 118 | debugPause 119 | echo -n > /clamavscan/fog/log/log.txt 120 | echo " * Scanning Partition $part" 121 | debugPause 122 | dots "Clam AV Mode" 123 | echo "$modename" 124 | debugPause 125 | dots "Starting AV scan" 126 | echo -e -n "\t" 127 | clamscan -V >/dev/null 2&>1 128 | case $? in 129 | 0) 130 | echo "Done" 131 | ;; 132 | *) 133 | echo "Failed" 134 | debugPause 135 | umount /clamavscan >/dev/null 2>&1 136 | continue 137 | ;; 138 | esac 139 | debugPause 140 | cd /clamavscan 141 | dots "Scanning" 142 | start=$(date +%s) 143 | clamscan -r --tempdir=/clamavscan/fog/tmp $action --log=/clamavscan/fog/log/log.txt --no-summary --exclude-dir=/clamavscan/fog/* 144 | case $? in 145 | 0) 146 | echo " * Scan complete, processing log file" 147 | ;; 148 | *) 149 | echo "Failed" 150 | debugPause 151 | umount /clamavscan 152 | cur=$(date +%s) 153 | diff=$((cur - start)) 154 | echo " * Clam AV failed" 155 | echo " * This may be due to a problem with the virus database files" 156 | echo " * Trying with the next partition" 157 | debugPause 158 | continue 159 | ;; 160 | esac 161 | debugPause 162 | output=$(cat /clamavscan/fog/log/log.txt | grep 'FOUND' | tr -d \\0) 163 | oIFS=$IFS 164 | IFS=$'\n' 165 | cnt=0 166 | for line in $output; do 167 | b64=$(echo $line | base64) 168 | let cnt+=1 169 | echo " * File id: $cnt" 170 | dots "Sending file id" 171 | curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&string=$b64&mode=$avmode" ${web}service/av.php 2>/dev/null 172 | case $? in 173 | 0) 174 | echo "Done" 175 | ;; 176 | *) 177 | echo "Failed" 178 | debugPause 179 | continue 180 | ;; 181 | esac 182 | debugPause 183 | cat /tmp/avstat 184 | cat /dev/null > /tmp/avstat 185 | done 186 | IFS=$oIFS 187 | umount /clamavscan >/dev/null 2>&1 188 | done 189 | done 190 | . /bin/fog.nonimgcomplete 191 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_ptp.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_PTP_H 36 | #define _LINUX_R8126_PTP_H 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #ifndef PTP_CLASS_NONE 45 | #define PTP_CLASS_NONE 0x00 46 | #endif 47 | 48 | #ifndef PTP_MSGTYPE_SYNC 49 | #define PTP_MSGTYPE_SYNC 0x0 50 | #endif 51 | #ifndef PTP_MSGTYPE_DELAY_REQ 52 | #define PTP_MSGTYPE_DELAY_REQ 0x1 53 | #endif 54 | #ifndef PTP_MSGTYPE_PDELAY_REQ 55 | #define PTP_MSGTYPE_PDELAY_REQ 0x2 56 | #endif 57 | #ifndef PTP_MSGTYPE_PDELAY_RESP 58 | #define PTP_MSGTYPE_PDELAY_RESP 0x3 59 | #endif 60 | 61 | struct rtl8126_ptp_info { 62 | s64 time_sec; 63 | u32 time_ns; 64 | u16 ts_info; 65 | }; 66 | 67 | #ifndef _STRUCT_TIMESPEC 68 | #define _STRUCT_TIMESPEC 69 | struct timespec { 70 | __kernel_old_time_t tv_sec; /* seconds */ 71 | long tv_nsec; /* nanoseconds */ 72 | }; 73 | #endif 74 | 75 | enum PTP_CMD_TYPE { 76 | PTP_CMD_SET_LOCAL_TIME = 0, 77 | PTP_CMD_DRIFT_LOCAL_TIME, 78 | PTP_CMD_LATCHED_LOCAL_TIME, 79 | }; 80 | 81 | enum PTP_CLKADJ_MOD_TYPE { 82 | NO_FUNCTION = 0, 83 | CLKADJ_MODE_SET = 1, 84 | RESERVED = 2, 85 | DIRECT_READ = 4, 86 | DIRECT_WRITE = 6, 87 | INCREMENT_STEP = 8, 88 | DECREMENT_STEP = 10, 89 | RATE_READ = 12, 90 | RATE_WRITE = 14, 91 | }; 92 | 93 | enum PTP_INSR_TYPE { 94 | EVENT_CAP_INTR = (1 << 0), 95 | TRIG_GEN_INTR = (1 << 1), 96 | RX_TS_INTR = (1 << 2), 97 | TX_TX_INTR = (1 << 3), 98 | }; 99 | 100 | enum PTP_TRX_TS_STA_REG { 101 | TRX_TS_RD = (1 << 0), 102 | TRXTS_SEL = (1 << 1), 103 | RX_TS_PDLYRSP_RDY = (1 << 8), 104 | RX_TS_PDLYREQ_RDY = (1 << 9), 105 | RX_TS_DLYREQ_RDY = (1 << 10), 106 | RX_TS_SYNC_RDY = (1 << 11), 107 | TX_TS_PDLYRSP_RDY = (1 << 12), 108 | TX_TS_PDLYREQ_RDY = (1 << 13), 109 | TX_TS_DLYREQ_RDY = (1 << 14), 110 | TX_TS_SYNC_RDY = (1 << 15), 111 | }; 112 | 113 | #define PTP_CTL_TYPE_0 (0xF3F) 114 | #define PTP_CTL_TYPE_1 (0x2FF) 115 | #define PTP_CTL_TYPE_2 (0x0FF) 116 | #define PTP_CTL_TYPE_3 (0x03F) 117 | 118 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) 119 | struct clock_identity { 120 | u8 id[8]; 121 | } __packed; 122 | 123 | struct port_identity { 124 | struct clock_identity clock_identity; 125 | __be16 port_number; 126 | } __packed; 127 | 128 | struct ptp_header { 129 | u8 tsmt; /* transportSpecific | messageType */ 130 | u8 ver; /* reserved | versionPTP */ 131 | __be16 message_length; 132 | u8 domain_number; 133 | u8 reserved1; 134 | u8 flag_field[2]; 135 | __be64 correction; 136 | __be32 reserved2; 137 | struct port_identity source_port_identity; 138 | __be16 sequence_id; 139 | u8 control; 140 | u8 log_message_interval; 141 | } __packed; 142 | 143 | /** 144 | * ptp_parse_header - Get pointer to the PTP v2 header 145 | * @skb: packet buffer 146 | * @type: type of the packet (see ptp_classify_raw()) 147 | * 148 | * This function takes care of the VLAN, UDP, IPv4 and IPv6 headers. The length 149 | * is checked. 150 | * 151 | * Note, internally skb_mac_header() is used. Make sure that the @skb is 152 | * initialized accordingly. 153 | * 154 | * Return: Pointer to the ptp v2 header or NULL if not found 155 | */ 156 | struct ptp_header *ptp_parse_header(struct sk_buff *skb, unsigned int type); 157 | 158 | /** 159 | * ptp_get_msgtype - Extract ptp message type from given header 160 | * @hdr: ptp header 161 | * @type: type of the packet (see ptp_classify_raw()) 162 | * 163 | * This function returns the message type for a given ptp header. It takes care 164 | * of the different ptp header versions (v1 or v2). 165 | * 166 | * Return: The message type 167 | */ 168 | static inline u8 ptp_get_msgtype(const struct ptp_header *hdr, 169 | unsigned int type) 170 | { 171 | u8 msgtype; 172 | 173 | if (unlikely(type & PTP_CLASS_V1)) { 174 | /* msg type is located at the control field for ptp v1 */ 175 | msgtype = hdr->control; 176 | } else { 177 | msgtype = hdr->tsmt & 0x0f; 178 | } 179 | 180 | return msgtype; 181 | } 182 | 183 | #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) */ 184 | 185 | struct rtl8126_private; 186 | struct RxDescV3; 187 | 188 | int rtl8126_get_ts_info(struct net_device *netdev, 189 | struct ethtool_ts_info *info); 190 | 191 | void rtl8126_ptp_reset(struct rtl8126_private *tp); 192 | void rtl8126_ptp_init(struct rtl8126_private *tp); 193 | void rtl8126_ptp_suspend(struct rtl8126_private *tp); 194 | void rtl8126_ptp_stop(struct rtl8126_private *tp); 195 | 196 | int rtl8126_ptp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); 197 | 198 | void rtl8126_rx_ptp_timestamp(struct rtl8126_private *tp, struct sk_buff *skb); 199 | 200 | void rtl8126_set_local_time(struct rtl8126_private *tp); 201 | 202 | #endif /* _LINUX_R8126_PTP_H */ 203 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8125/r8125_dash.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8125 is the Linux device driver released for Realtek 2.5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2025 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8125_DASH_H 36 | #define _LINUX_R8125_DASH_H 37 | 38 | #include 39 | 40 | #define SIOCDEVPRIVATE_RTLDASH SIOCDEVPRIVATE+2 41 | 42 | enum rtl_dash_cmd { 43 | RTL_DASH_ARP_NS_OFFLOAD = 0, 44 | RTL_DASH_SET_OOB_IPMAC, 45 | RTL_DASH_NOTIFY_OOB, 46 | 47 | RTL_DASH_SEND_BUFFER_DATA_TO_DASH_FW, 48 | RTL_DASH_CHECK_SEND_BUFFER_TO_DASH_FW_COMPLETE, 49 | RTL_DASH_GET_RCV_FROM_FW_BUFFER_DATA, 50 | RTL_DASH_OOB_REQ, 51 | RTL_DASH_OOB_ACK, 52 | RTL_DASH_DETACH_OOB_REQ, 53 | RTL_DASH_DETACH_OOB_ACK, 54 | 55 | RTL_FW_SET_IPV4 = 0x10, 56 | RTL_FW_GET_IPV4, 57 | RTL_FW_SET_IPV6, 58 | RTL_FW_GET_IPV6, 59 | RTL_FW_SET_EXT_SNMP, 60 | RTL_FW_GET_EXT_SNMP, 61 | RTL_FW_SET_WAKEUP_PATTERN, 62 | RTL_FW_GET_WAKEUP_PATTERN, 63 | RTL_FW_DEL_WAKEUP_PATTERN, 64 | 65 | RTLT_DASH_COMMAND_INVALID, 66 | }; 67 | 68 | struct rtl_dash_ip_mac { 69 | struct sockaddr ifru_addr; 70 | struct sockaddr ifru_netmask; 71 | struct sockaddr ifru_hwaddr; 72 | }; 73 | 74 | struct rtl_dash_ioctl_struct { 75 | __u32 cmd; 76 | __u32 offset; 77 | __u32 len; 78 | union { 79 | __u32 data; 80 | void *data_buffer; 81 | }; 82 | }; 83 | 84 | typedef struct _OSOOBHdr { 85 | __le32 len; 86 | u8 type; 87 | u8 flag; 88 | u8 hostReqV; 89 | u8 res; 90 | } 91 | OSOOBHdr, *POSOOBHdr; 92 | 93 | typedef struct _RX_DASH_BUFFER_TYPE_2 { 94 | OSOOBHdr oobhdr; 95 | u8 RxDataBuffer[0]; 96 | } 97 | RX_DASH_BUFFER_TYPE_2, *PRX_DASH_BUFFER_TYPE_2; 98 | 99 | #define ALIGN_8 (0x7) 100 | #define ALIGN_16 (0xf) 101 | #define ALIGN_32 (0x1f) 102 | #define ALIGN_64 (0x3f) 103 | #define ALIGN_256 (0xff) 104 | #define ALIGN_4096 (0xfff) 105 | 106 | #define OCP_REG_FIRMWARE_MAJOR_VERSION (0x120) 107 | 108 | #define HW_DASH_SUPPORT_DASH(_M) ((_M)->HwSuppDashVer > 0) 109 | #define HW_DASH_SUPPORT_TYPE_1(_M) ((_M)->HwSuppDashVer == 1) 110 | #define HW_DASH_SUPPORT_TYPE_2(_M) ((_M)->HwSuppDashVer == 2) 111 | #define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3) 112 | #define HW_DASH_SUPPORT_TYPE_4(_M) ((_M)->HwSuppDashVer == 4) 113 | #define HW_DASH_SUPPORT_CMAC(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || HW_DASH_SUPPORT_TYPE_3(_M)) 114 | #define HW_DASH_SUPPORT_IPC2(_M) (HW_DASH_SUPPORT_TYPE_4(_M)) 115 | #define HW_DASH_SUPPORT_GET_FIRMWARE_VERSION(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || \ 116 | HW_DASH_SUPPORT_TYPE_3(_M) || \ 117 | HW_DASH_SUPPORT_TYPE_4(_M)) 118 | 119 | #define RECV_FROM_FW_BUF_SIZE (1520) 120 | #define SEND_TO_FW_BUF_SIZE (1520) 121 | 122 | #define TXS_CC3_0 (BIT_0|BIT_1|BIT_2|BIT_3) 123 | #define TXS_EXC BIT_4 124 | #define TXS_LNKF BIT_5 125 | #define TXS_OWC BIT_6 126 | #define TXS_TES BIT_7 127 | #define TXS_UNF BIT_9 128 | #define TXS_LGSEN BIT_11 129 | #define TXS_LS BIT_12 130 | #define TXS_FS BIT_13 131 | #define TXS_EOR BIT_14 132 | #define TXS_OWN BIT_15 133 | 134 | #define TPPool_HRDY 0x20 135 | 136 | #define RXS_OWN BIT_15 137 | #define RXS_EOR BIT_14 138 | #define RXS_FS BIT_13 139 | #define RXS_LS BIT_12 140 | 141 | #define ISRIMR_DASH_INTR_EN BIT_12 142 | 143 | #define NO_BASE_ADDRESS 0x00000000 144 | 145 | /* IB2SOC registers */ 146 | #define IPC2_SWISR_DRIVER_READY 0x05 147 | #define IPC2_SWISR_DRIVER_EXIT 0x06 148 | #define IPC2_SWISR_CLIENTTOOL_SYNC_HOSTNAME 0x20 149 | #define IPC2_SWISR_DIS_DASH 0x55 150 | #define IPC2_SWISR_EN_DASH 0x56 151 | 152 | #define IPC2_IB2SOC_SET 0x10 153 | #define IPC2_IB2SOC_DATA 0x14 154 | #define IPC2_IB2SOC_CMD 0x18 155 | #define IPC2_IB2SOC_IMR 0x1C 156 | 157 | /* IPC2 registers */ 158 | #define IPC2_PCIE_BASE 0xC100 159 | #define IPC2_TX_SET_REG IPC2_PCIE_BASE 160 | #define IPC2_TX_STATUS_REG (IPC2_PCIE_BASE+0x04) 161 | #define IPC2_RX_STATUS_REG (IPC2_PCIE_BASE+0x08) 162 | #define IPC2_RX_CLEAR_REG (IPC2_PCIE_BASE+0x0C) 163 | #define IPC2_DATA_BASE 0x32000 164 | #define IPC2_BUFFER_LENGTH 0x1000 165 | #define IPC2_DATA_MASTER IPC2_DATA_BASE //dash tx buffer base 166 | #define IPC2_DATA_SLAVE (IPC2_DATA_BASE+IPC2_BUFFER_LENGTH) //dash rx buffer base 167 | #define IPC2_TX_BUFFER IPC2_DATA_MASTER 168 | #define IPC2_RX_BUFFER IPC2_DATA_SLAVE 169 | 170 | #define IPC2_TX_SEND_BIT BIT_0 171 | #define IPC2_TX_ACK_BIT BIT_8 172 | #define IPC2_RX_ROK_BIT BIT_0 173 | #define IPC2_RX_ACK_BIT BIT_8 174 | 175 | /* IPC2 write/read MMIO register */ 176 | #define RTL_DASH_IPC2_W8(tp, reg, val8) RTL_W8(tp, reg, val8) 177 | #define RTL_DASH_IPC2_W16(tp, reg, val16) RTL_W16(tp, reg, val16) 178 | #define RTL_DASH_IPC2_W32(tp, reg, val32) RTL_W32(tp, reg, val32) 179 | #define RTL_DASH_IPC2_R8(tp, reg) RTL_R8(tp, reg) 180 | #define RTL_DASH_IPC2_R16(tp, reg) RTL_R16(tp, reg) 181 | #define RTL_DASH_IPC2_R32(tp, reg) RTL_R32(tp, reg) 182 | 183 | /* DASH OOB Header Type */ 184 | #define DASH_OOB_HDR_TYPE_REQ 0x91 185 | #define DASH_OOB_HDR_TYPE_ACK 0x92 186 | 187 | struct rtl8125_private; 188 | 189 | int rtl8125_dash_ioctl(struct net_device *dev, struct ifreq *ifr); 190 | bool rtl8125_check_dash_interrupt(struct rtl8125_private *tp); 191 | void rtl8125_handle_dash_interrupt(struct net_device *dev); 192 | void rtl8125_clear_ipc2_isr(struct rtl8125_private *tp); 193 | void rtl8125_set_ipc2_soc_imr_bit(struct rtl8125_private *tp, u16 mask); 194 | void rtl8125_clear_ipc2_soc_imr_bit(struct rtl8125_private *tp, u16 mask); 195 | 196 | #endif /* _LINUX_R8125_DASH_H */ 197 | -------------------------------------------------------------------------------- /Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.sysinfo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /usr/share/fog/lib/funcs.sh 3 | for arg in $(cat /proc/cmdline | tr -d \\0); do 4 | case $arg in 5 | initsh) 6 | ash -i 7 | ;; 8 | esac 9 | done 10 | clearScreen 11 | displayBanner 12 | mac=$(getMACAddresses) 13 | oPS3=$PS3 14 | PS3="Please enter your choice: " 15 | choices="Network Information\nPartition Information\nCheck FOG Compatibility\nPing a Host\nDisplay MAC Address\nShow DMI Information" 16 | case $isdebug in 17 | [Yy][Ee][Ss]|[Yy]) 18 | choices="Quit\n$choices" 19 | ;; 20 | *) 21 | choices="Reboot\n$choices" 22 | ;; 23 | esac 24 | oIFS=$IFS 25 | IFS=$'\n' 26 | choices=$(echo -e $choices) 27 | wait_enter() { 28 | echo -e "\n\n\n" 29 | echo " * Press [Enter] to continue" 30 | read -s tmp 31 | echo -e "\n\n\n" 32 | } 33 | while :; do 34 | echo -e "\n\n\n" 35 | select choice in $choices; do 36 | case $REPLY in 37 | 1) 38 | case $isdebug in 39 | [Yy][Ee][Ss]|[Yy]) 40 | exit 0 41 | ;; 42 | *) 43 | reboot -f 44 | ;; 45 | esac 46 | ;; 47 | 2) 48 | clearScreen 49 | echo " ===================================================" 50 | echo " = Network Information =" 51 | echo " ===================================================" 52 | ip addr 2>/dev/null 53 | echo " ===================================================" 54 | echo " = DNS Information =" 55 | echo " ===================================================" 56 | cat /etc/resolv.conf 2>/dev/null 57 | wait_enter 58 | ;; 59 | 3) 60 | clearScreen 61 | echo " ===================================================" 62 | echo " = Partition Information =" 63 | echo " ===================================================" 64 | parted --list 2>/dev/null 65 | wait_enter 66 | ;; 67 | 4) 68 | clearScreen 69 | echo " ===================================================" 70 | echo " = FOG Compatibility Test =" 71 | echo " ===================================================" 72 | tmpDisk=$(parted --list 2>/dev/null | grep "Disk") 73 | tmpNic=$(ip addr | grep "link/ether") 74 | [[ -n $tmpDisk ]] && blHddOk="Pass" || blHddOk="Fail" 75 | [[ -n $tmpNic ]] && blNicOk="Pass" || blNicOk="Fail" 76 | [[ $blNicOk == Pass && $blHddOk == Pass ]] && tmpstr="Computer appears to be compatible with FOG!" || tmpstr="Computer is NOT compatibile with FOG!" 77 | echo "$tmpstr" 78 | echo " ===================================================" 79 | echo " = Results =" 80 | echo " ===================================================" 81 | echo " = Network..................................[$blNicOk] =" 82 | echo " = Disk.....................................[$blHddOk] =" 83 | echo " ===================================================" 84 | if [[ $blNicOk == Fail || $blHddOk == Fail ]]; then 85 | echo " ###################################################" 86 | echo " # Try using a newer kernel that may be compatible #" 87 | echo " # with this device. #" 88 | echo " # #" 89 | echo " # New kernels can be downloaded from the GUI. #" 90 | echo " # From the menu select: #" 91 | echo " # FOG Configuration-> #" 92 | echo " # Kernel Update #" 93 | echo " # #" 94 | echo " # Below you is some valuable information to post #" 95 | echo " # to the forums to get more help if needed! #" 96 | echo " ###################################################" 97 | lspci -nn | grep Ethernet 98 | echo " ###################################################" 99 | lsblk 100 | echo " ###################################################" 101 | fi 102 | wait_enter 103 | ;; 104 | 5) 105 | clearScreen 106 | echo " ===================================================" 107 | echo " = Ping a Host =" 108 | echo " ===================================================" 109 | regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' 110 | while [[ -z $phost ]]; do 111 | echo -n " * Enter host to ping: " 112 | read phost 113 | phost=$(echo $phost) 114 | if [[ -z $phost || $phost =~ $regex ]]; then 115 | phost="" 116 | echo " * Invalid Entry, try again!" 117 | fi 118 | done 119 | ping -c 4 $phost 120 | unset phost 121 | wait_enter 122 | ;; 123 | 6) 124 | clearScreen 125 | echo " ===================================================" 126 | echo " = System MAC Address' =" 127 | echo " ===================================================" 128 | echo $mac 129 | wait_enter 130 | ;; 131 | 7) 132 | clearScreen 133 | test="bios-vendor bios-version bios-release-date system-manufacturer system-product-name system-version system-serial-number system-uuid baseboard-manufacturer baseboard-product-name baseboard-version baseboard-serial-number baseboard-asset-tag chassis-manufacturer chassis-type chassis-version chassis-serial-number chassis-asset-tag processor-family processor-manufacturer processor-version processor-frequency" 134 | i=0 135 | IFS=$oIFS 136 | for t in $test; do 137 | str="DMI String: $t\n" 138 | v=$(dmidecode --string $t) 139 | echo -e "$str $v\n\n" 140 | let i+=1 141 | if [[ $i == 5 ]]; then 142 | echo " * Press [Enter] to Proceed" 143 | read tmp 144 | i=0 145 | fi 146 | done 147 | IFS=$'\n' 148 | wait_enter 149 | ;; 150 | *) 151 | echo "Invalid entry, try again" 152 | wait_enter 153 | ;; 154 | esac 155 | break 156 | done 157 | done 158 | IFS=$oIFS 159 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8126/r8126_dash.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8126 is the Linux device driver released for Realtek 5 Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8126_DASH_H 36 | #define _LINUX_R8126_DASH_H 37 | 38 | #include 39 | 40 | #define SIOCDEVPRIVATE_RTLDASH SIOCDEVPRIVATE+2 41 | 42 | enum rtl_dash_cmd { 43 | RTL_DASH_ARP_NS_OFFLOAD = 0, 44 | RTL_DASH_SET_OOB_IPMAC, 45 | RTL_DASH_NOTIFY_OOB, 46 | 47 | RTL_DASH_SEND_BUFFER_DATA_TO_DASH_FW, 48 | RTL_DASH_CHECK_SEND_BUFFER_TO_DASH_FW_COMPLETE, 49 | RTL_DASH_GET_RCV_FROM_FW_BUFFER_DATA, 50 | RTL_DASH_OOB_REQ, 51 | RTL_DASH_OOB_ACK, 52 | RTL_DASH_DETACH_OOB_REQ, 53 | RTL_DASH_DETACH_OOB_ACK, 54 | 55 | RTL_FW_SET_IPV4 = 0x10, 56 | RTL_FW_GET_IPV4, 57 | RTL_FW_SET_IPV6, 58 | RTL_FW_GET_IPV6, 59 | RTL_FW_SET_EXT_SNMP, 60 | RTL_FW_GET_EXT_SNMP, 61 | RTL_FW_SET_WAKEUP_PATTERN, 62 | RTL_FW_GET_WAKEUP_PATTERN, 63 | RTL_FW_DEL_WAKEUP_PATTERN, 64 | 65 | RTLT_DASH_COMMAND_INVALID, 66 | }; 67 | 68 | struct rtl_dash_ip_mac { 69 | struct sockaddr ifru_addr; 70 | struct sockaddr ifru_netmask; 71 | struct sockaddr ifru_hwaddr; 72 | }; 73 | 74 | struct rtl_dash_ioctl_struct { 75 | __u32 cmd; 76 | __u32 offset; 77 | __u32 len; 78 | union { 79 | __u32 data; 80 | void *data_buffer; 81 | }; 82 | }; 83 | 84 | struct settings_ipv4 { 85 | __u32 IPv4addr; 86 | __u32 IPv4mask; 87 | __u32 IPv4Gateway; 88 | }; 89 | 90 | struct settings_ipv6 { 91 | __u32 reserved; 92 | __u32 prefixLen; 93 | __u16 IPv6addr[8]; 94 | __u16 IPv6Gateway[8]; 95 | }; 96 | 97 | struct settings_ext_snmp { 98 | __u16 index; 99 | __u16 oid_get_len; 100 | __u8 oid_for_get[24]; 101 | __u8 reserved0[26]; 102 | __u16 value_len; 103 | __u8 value[256]; 104 | __u8 supported; 105 | __u8 reserved1[27]; 106 | }; 107 | 108 | struct wakeup_pattern { 109 | __u8 index; 110 | __u8 valid; 111 | __u8 start; 112 | __u8 length; 113 | __u8 name[36]; 114 | __u8 mask[16]; 115 | __u8 pattern[128]; 116 | __u32 reserved[2]; 117 | }; 118 | 119 | typedef struct _RX_DASH_FROM_FW_DESC { 120 | u16 length; 121 | u8 statusLowByte; 122 | u8 statusHighByte; 123 | u32 resv; 124 | u64 BufferAddress; 125 | } 126 | RX_DASH_FROM_FW_DESC, *PRX_DASH_FROM_FW_DESC; 127 | 128 | typedef struct _TX_DASH_SEND_FW_DESC { 129 | u16 length; 130 | u8 statusLowByte; 131 | u8 statusHighByte; 132 | u32 resv; 133 | u64 BufferAddress; 134 | } 135 | TX_DASH_SEND_FW_DESC, *PTX_DASH_SEND_FW_DESC; 136 | 137 | typedef struct _OSOOBHdr { 138 | u32 len; 139 | u8 type; 140 | u8 flag; 141 | u8 hostReqV; 142 | u8 res; 143 | } 144 | OSOOBHdr, *POSOOBHdr; 145 | 146 | typedef struct _RX_DASH_BUFFER_TYPE_2 { 147 | OSOOBHdr oobhdr; 148 | u8 RxDataBuffer[0]; 149 | } 150 | RX_DASH_BUFFER_TYPE_2, *PRX_DASH_BUFFER_TYPE_2; 151 | 152 | #define ALIGN_8 (0x7) 153 | #define ALIGN_16 (0xf) 154 | #define ALIGN_32 (0x1f) 155 | #define ALIGN_64 (0x3f) 156 | #define ALIGN_256 (0xff) 157 | #define ALIGN_4096 (0xfff) 158 | 159 | #define OCP_REG_CONFIG0 (0x10) 160 | #define OCP_REG_CONFIG0_REV_F (0xB8) 161 | #define OCP_REG_DASH_POLL (0x30) 162 | #define OCP_REG_HOST_REQ (0x34) 163 | #define OCP_REG_DASH_REQ (0x35) 164 | #define OCP_REG_CR (0x36) 165 | #define OCP_REG_DMEMSTA (0x38) 166 | #define OCP_REG_GPHYAR (0x60) 167 | 168 | 169 | #define OCP_REG_CONFIG0_DASHEN BIT_15 170 | #define OCP_REG_CONFIG0_OOBRESET BIT_14 171 | #define OCP_REG_CONFIG0_APRDY BIT_13 172 | #define OCP_REG_CONFIG0_FIRMWARERDY BIT_12 173 | #define OCP_REG_CONFIG0_DRIVERRDY BIT_11 174 | #define OCP_REG_CONFIG0_OOB_WDT BIT_9 175 | #define OCP_REG_CONFIG0_DRV_WAIT_OOB BIT_8 176 | #define OCP_REG_CONFIG0_TLSEN BIT_7 177 | 178 | #define HW_DASH_SUPPORT_DASH(_M) ((_M)->HwSuppDashVer > 0) 179 | #define HW_DASH_SUPPORT_TYPE_1(_M) ((_M)->HwSuppDashVer == 1) 180 | #define HW_DASH_SUPPORT_TYPE_2(_M) ((_M)->HwSuppDashVer == 2) 181 | #define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3) 182 | 183 | #define RECV_FROM_FW_BUF_SIZE (1520) 184 | #define SEND_TO_FW_BUF_SIZE (1520) 185 | 186 | #define RX_DASH_FROM_FW_OWN BIT_15 187 | #define TX_DASH_SEND_FW_OWN BIT_15 188 | #define TX_DASH_SEND_FW_OWN_HIGHBYTE BIT_7 189 | 190 | #define TXS_CC3_0 (BIT_0|BIT_1|BIT_2|BIT_3) 191 | #define TXS_EXC BIT_4 192 | #define TXS_LNKF BIT_5 193 | #define TXS_OWC BIT_6 194 | #define TXS_TES BIT_7 195 | #define TXS_UNF BIT_9 196 | #define TXS_LGSEN BIT_11 197 | #define TXS_LS BIT_12 198 | #define TXS_FS BIT_13 199 | #define TXS_EOR BIT_14 200 | #define TXS_OWN BIT_15 201 | 202 | #define TPPool_HRDY 0x20 203 | 204 | #define HostReqReg (0xC0) 205 | #define SystemMasterDescStartAddrLow (0xF0) 206 | #define SystemMasterDescStartAddrHigh (0xF4) 207 | #define SystemSlaveDescStartAddrLow (0xF8) 208 | #define SystemSlaveDescStartAddrHigh (0xFC) 209 | 210 | //DASH Request Type 211 | #define WSMANREG 0x01 212 | #define OSPUSHDATA 0x02 213 | 214 | #define RXS_OWN BIT_15 215 | #define RXS_EOR BIT_14 216 | #define RXS_FS BIT_13 217 | #define RXS_LS BIT_12 218 | 219 | #define ISRIMR_DP_DASH_OK BIT_15 220 | #define ISRIMR_DP_HOST_OK BIT_13 221 | #define ISRIMR_DP_REQSYS_OK BIT_11 222 | 223 | #define ISRIMR_DASH_INTR_EN BIT_12 224 | #define ISRIMR_DASH_INTR_CMAC_RESET BIT_15 225 | 226 | #define ISRIMR_DASH_TYPE2_ROK BIT_0 227 | #define ISRIMR_DASH_TYPE2_RDU BIT_1 228 | #define ISRIMR_DASH_TYPE2_TOK BIT_2 229 | #define ISRIMR_DASH_TYPE2_TDU BIT_3 230 | #define ISRIMR_DASH_TYPE2_TX_FIFO_FULL BIT_4 231 | #define ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE BIT_5 232 | #define ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE BIT_6 233 | 234 | #define CMAC_OOB_STOP 0x25 235 | #define CMAC_OOB_INIT 0x26 236 | #define CMAC_OOB_RESET 0x2a 237 | 238 | #define NO_BASE_ADDRESS 0x00000000 239 | #define RTL8168FP_OOBMAC_BASE 0xBAF70000 240 | #define RTL8168FP_CMAC_IOBASE 0xBAF20000 241 | #define RTL8168FP_KVM_BASE 0xBAF80400 242 | #define CMAC_SYNC_REG 0x20 243 | #define CMAC_RXDESC_OFFSET 0x90 //RX: 0x90 - 0x98 244 | #define CMAC_TXDESC_OFFSET 0x98 //TX: 0x98 - 0x9F 245 | 246 | /* cmac write/read MMIO register */ 247 | #define RTL_CMAC_W8(tp, reg, val8) writeb ((val8), tp->cmac_ioaddr + (reg)) 248 | #define RTL_CMAC_W16(tp, reg, val16) writew ((val16), tp->cmac_ioaddr + (reg)) 249 | #define RTL_CMAC_W32(tp, reg, val32) writel ((val32), tp->cmac_ioaddr + (reg)) 250 | #define RTL_CMAC_R8(tp, reg) readb (tp->cmac_ioaddr + (reg)) 251 | #define RTL_CMAC_R16(tp, reg) readw (tp->cmac_ioaddr + (reg)) 252 | #define RTL_CMAC_R32(tp, reg) ((unsigned long) readl (tp->cmac_ioaddr + (reg))) 253 | 254 | int rtl8126_dash_ioctl(struct net_device *dev, struct ifreq *ifr); 255 | void HandleDashInterrupt(struct net_device *dev); 256 | int AllocateDashShareMemory(struct net_device *dev); 257 | void FreeAllocatedDashShareMemory(struct net_device *dev); 258 | void DashHwInit(struct net_device *dev); 259 | 260 | 261 | #endif /* _LINUX_R8126_DASH_H */ 262 | -------------------------------------------------------------------------------- /KernelPackages/drivers/net/ethernet/realtek/r8168/r8168_dash.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* 3 | ################################################################################ 4 | # 5 | # r8168 is the Linux device driver released for Realtek Gigabit Ethernet 6 | # controllers with PCI-Express interface. 7 | # 8 | # Copyright(c) 2024 Realtek Semiconductor Corp. All rights reserved. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it 11 | # under the terms of the GNU General Public License as published by the Free 12 | # Software Foundation; either version 2 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, but WITHOUT 16 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | # more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along with 21 | # this program; if not, see . 22 | # 23 | # Author: 24 | # Realtek NIC software team 25 | # No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan 26 | # 27 | ################################################################################ 28 | */ 29 | 30 | /************************************************************************************ 31 | * This product is covered by one or more of the following patents: 32 | * US6,570,884, US6,115,776, and US6,327,625. 33 | ***********************************************************************************/ 34 | 35 | #ifndef _LINUX_R8168_DASH_H 36 | #define _LINUX_R8168_DASH_H 37 | 38 | #define SIOCDEVPRIVATE_RTLDASH SIOCDEVPRIVATE+2 39 | 40 | enum rtl_dash_cmd { 41 | RTL_DASH_ARP_NS_OFFLOAD = 0, 42 | RTL_DASH_SET_OOB_IPMAC, 43 | RTL_DASH_NOTIFY_OOB, 44 | 45 | RTL_DASH_SEND_BUFFER_DATA_TO_DASH_FW, 46 | RTL_DASH_CHECK_SEND_BUFFER_TO_DASH_FW_COMPLETE, 47 | RTL_DASH_GET_RCV_FROM_FW_BUFFER_DATA, 48 | RTL_DASH_OOB_REQ, 49 | RTL_DASH_OOB_ACK, 50 | RTL_DASH_DETACH_OOB_REQ, 51 | RTL_DASH_DETACH_OOB_ACK, 52 | 53 | RTL_FW_SET_IPV4 = 0x10, 54 | RTL_FW_GET_IPV4, 55 | RTL_FW_SET_IPV6, 56 | RTL_FW_GET_IPV6, 57 | RTL_FW_SET_EXT_SNMP, 58 | RTL_FW_GET_EXT_SNMP, 59 | RTL_FW_SET_WAKEUP_PATTERN, 60 | RTL_FW_GET_WAKEUP_PATTERN, 61 | RTL_FW_DEL_WAKEUP_PATTERN, 62 | 63 | RTLT_DASH_COMMAND_INVALID, 64 | }; 65 | 66 | struct rtl_dash_ip_mac { 67 | struct sockaddr ifru_addr; 68 | struct sockaddr ifru_netmask; 69 | struct sockaddr ifru_hwaddr; 70 | }; 71 | 72 | struct rtl_dash_ioctl_struct { 73 | __u32 cmd; 74 | __u32 offset; 75 | __u32 len; 76 | union { 77 | __u32 data; 78 | void *data_buffer; 79 | }; 80 | }; 81 | 82 | struct settings_ipv4 { 83 | __u32 IPv4addr; 84 | __u32 IPv4mask; 85 | __u32 IPv4Gateway; 86 | }; 87 | 88 | struct settings_ipv6 { 89 | __u32 reserved; 90 | __u32 prefixLen; 91 | __u16 IPv6addr[8]; 92 | __u16 IPv6Gateway[8]; 93 | }; 94 | 95 | struct settings_ext_snmp { 96 | __u16 index; 97 | __u16 oid_get_len; 98 | __u8 oid_for_get[24]; 99 | __u8 reserved0[26]; 100 | __u16 value_len; 101 | __u8 value[256]; 102 | __u8 supported; 103 | __u8 reserved1[27]; 104 | }; 105 | 106 | struct wakeup_pattern { 107 | __u8 index; 108 | __u8 valid; 109 | __u8 start; 110 | __u8 length; 111 | __u8 name[36]; 112 | __u8 mask[16]; 113 | __u8 pattern[128]; 114 | __u32 reserved[2]; 115 | }; 116 | 117 | typedef struct _RX_DASH_FROM_FW_DESC { 118 | __le16 length; 119 | __le16 status; 120 | __le32 resv; 121 | __le64 BufferAddress; 122 | } 123 | RX_DASH_FROM_FW_DESC, *PRX_DASH_FROM_FW_DESC; 124 | 125 | typedef struct _TX_DASH_SEND_FW_DESC { 126 | __le16 length; 127 | __le16 status; 128 | __le32 resv; 129 | __le64 BufferAddress; 130 | } 131 | TX_DASH_SEND_FW_DESC, *PTX_DASH_SEND_FW_DESC; 132 | 133 | typedef struct _OSOOBHdr { 134 | __le32 len; 135 | u8 type; 136 | u8 flag; 137 | u8 hostReqV; 138 | u8 res; 139 | } 140 | OSOOBHdr, *POSOOBHdr; 141 | 142 | typedef struct _RX_DASH_BUFFER_TYPE_2 { 143 | OSOOBHdr oobhdr; 144 | u8 RxDataBuffer[0]; 145 | } 146 | RX_DASH_BUFFER_TYPE_2, *PRX_DASH_BUFFER_TYPE_2; 147 | 148 | #define ALIGN_8 (0x7) 149 | #define ALIGN_16 (0xf) 150 | #define ALIGN_32 (0x1f) 151 | #define ALIGN_64 (0x3f) 152 | #define ALIGN_256 (0xff) 153 | #define ALIGN_4096 (0xfff) 154 | 155 | #define OCP_REG_CONFIG0 (0x10) 156 | #define OCP_REG_CONFIG0_REV_F (0xB8) 157 | #define OCP_REG_DASH_POLL (0x30) 158 | #define OCP_REG_HOST_REQ (0x34) 159 | #define OCP_REG_DASH_REQ (0x35) 160 | #define OCP_REG_CR (0x36) 161 | #define OCP_REG_DMEMSTA (0x38) 162 | #define OCP_REG_GPHYAR (0x60) 163 | #define OCP_REG_FIRMWARE_MAJOR_VERSION (0x120) 164 | 165 | 166 | #define OCP_REG_CONFIG0_DASHEN BIT_15 167 | #define OCP_REG_CONFIG0_OOBRESET BIT_14 168 | #define OCP_REG_CONFIG0_APRDY BIT_13 169 | #define OCP_REG_CONFIG0_FIRMWARERDY BIT_12 170 | #define OCP_REG_CONFIG0_DRIVERRDY BIT_11 171 | #define OCP_REG_CONFIG0_OOB_WDT BIT_9 172 | #define OCP_REG_CONFIG0_DRV_WAIT_OOB BIT_8 173 | #define OCP_REG_CONFIG0_TLSEN BIT_7 174 | 175 | #define HW_DASH_SUPPORT_DASH(_M) ((_M)->HwSuppDashVer > 0) 176 | #define HW_DASH_SUPPORT_TYPE_1(_M) ((_M)->HwSuppDashVer == 1) 177 | #define HW_DASH_SUPPORT_TYPE_2(_M) ((_M)->HwSuppDashVer == 2) 178 | #define HW_DASH_SUPPORT_TYPE_3(_M) ((_M)->HwSuppDashVer == 3) 179 | #define HW_DASH_SUPPORT_CMAC(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || HW_DASH_SUPPORT_TYPE_3(_M)) 180 | #define HW_DASH_SUPPORT_GET_FIRMWARE_VERSION(_M) (HW_DASH_SUPPORT_TYPE_2(_M) || \ 181 | HW_DASH_SUPPORT_TYPE_3(_M)) 182 | 183 | #define RECV_FROM_FW_BUF_SIZE (2048) 184 | #define SEND_TO_FW_BUF_SIZE (2048) 185 | 186 | #define RX_DASH_FROM_FW_OWN BIT_15 187 | #define TX_DASH_SEND_FW_OWN BIT_15 188 | 189 | #define TXS_CC3_0 (BIT_0|BIT_1|BIT_2|BIT_3) 190 | #define TXS_EXC BIT_4 191 | #define TXS_LNKF BIT_5 192 | #define TXS_OWC BIT_6 193 | #define TXS_TES BIT_7 194 | #define TXS_UNF BIT_9 195 | #define TXS_LGSEN BIT_11 196 | #define TXS_LS BIT_12 197 | #define TXS_FS BIT_13 198 | #define TXS_EOR BIT_14 199 | #define TXS_OWN BIT_15 200 | 201 | #define TPPool_HRDY 0x20 202 | 203 | #define HostReqReg (0xC0) 204 | #define SystemMasterDescStartAddrLow (0xF0) 205 | #define SystemMasterDescStartAddrHigh (0xF4) 206 | #define SystemSlaveDescStartAddrLow (0xF8) 207 | #define SystemSlaveDescStartAddrHigh (0xFC) 208 | 209 | //DASH Request Type 210 | #define WSMANREG 0x01 211 | #define OSPUSHDATA 0x02 212 | 213 | #define RXS_OWN BIT_15 214 | #define RXS_EOR BIT_14 215 | #define RXS_FS BIT_13 216 | #define RXS_LS BIT_12 217 | 218 | #define ISRIMR_DP_DASH_OK BIT_15 219 | #define ISRIMR_DP_HOST_OK BIT_13 220 | #define ISRIMR_DP_REQSYS_OK BIT_11 221 | 222 | #define ISRIMR_DASH_INTR_EN BIT_12 223 | #define ISRIMR_DASH_INTR_CMAC_RESET BIT_15 224 | 225 | #define ISRIMR_DASH_TYPE2_ROK BIT_0 226 | #define ISRIMR_DASH_TYPE2_RDU BIT_1 227 | #define ISRIMR_DASH_TYPE2_TOK BIT_2 228 | #define ISRIMR_DASH_TYPE2_TDU BIT_3 229 | #define ISRIMR_DASH_TYPE2_TX_FIFO_FULL BIT_4 230 | #define ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE BIT_5 231 | #define ISRIMR_DASH_TYPE2_RX_DISABLE_IDLE BIT_6 232 | 233 | #define CMAC_OOB_STOP 0x25 234 | #define CMAC_OOB_INIT 0x26 235 | #define CMAC_OOB_RESET 0x2a 236 | 237 | #define NO_BASE_ADDRESS 0x00000000 238 | #define RTL8168FP_OOBMAC_BASE 0xBAF70000 239 | #define RTL8168FP_CMAC_IOBASE 0xBAF20000 240 | #define RTL8168FP_KVM_BASE 0xBAF80400 241 | #define CMAC_SYNC_REG 0x20 242 | #define CMAC_RXDESC_OFFSET 0x90 //RX: 0x90 - 0x98 243 | #define CMAC_TXDESC_OFFSET 0x98 //TX: 0x98 - 0x9F 244 | 245 | /* cmac write/read MMIO register */ 246 | #define RTL_CMAC_W8(tp, reg, val8) writeb ((val8), tp->cmac_ioaddr + (reg)) 247 | #define RTL_CMAC_W16(tp, reg, val16) writew ((val16), tp->cmac_ioaddr + (reg)) 248 | #define RTL_CMAC_W32(tp, reg, val32) writel ((val32), tp->cmac_ioaddr + (reg)) 249 | #define RTL_CMAC_R8(tp, reg) readb (tp->cmac_ioaddr + (reg)) 250 | #define RTL_CMAC_R16(tp, reg) readw (tp->cmac_ioaddr + (reg)) 251 | #define RTL_CMAC_R32(tp, reg) ((unsigned long) readl (tp->cmac_ioaddr + (reg))) 252 | 253 | int rtl8168_dash_ioctl(struct net_device *dev, struct ifreq *ifr); 254 | bool CheckDashInterrupt(struct net_device *dev, u16 status); 255 | void HandleDashInterrupt(struct net_device *dev); 256 | int AllocateDashShareMemory(struct net_device *dev); 257 | void FreeAllocatedDashShareMemory(struct net_device *dev); 258 | void DashHwInit(struct net_device *dev); 259 | 260 | 261 | #endif /* _LINUX_R8168_DASH_H */ 262 | --------------------------------------------------------------------------------