├── .github └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── aeeon ├── up │ ├── Makefile │ ├── buildimage.go │ ├── corebootconfig │ ├── flash.config │ ├── linuxboot-linux.config │ ├── runcoreboot │ └── ts.config.txt └── upxtreme │ ├── .gitignore │ ├── Makefile │ ├── class_key │ ├── class_key.pub │ ├── classhostkey │ ├── classhostkey.pub │ ├── cpu.config │ ├── flash.config │ └── sshd.config ├── amd └── rome │ ├── 5.5-rc3.config │ ├── Makefile │ ├── class_key │ ├── class_key.pub │ ├── classhostkey │ ├── classhostkey.pub │ ├── cpu-linux.config │ ├── flash.config │ ├── flashkernel.config │ └── sshd-linux.config ├── ampere └── jade │ ├── Makefile │ └── flash.config ├── bytedance └── g220a │ ├── Makefile │ └── config_g220a.config ├── cubie └── board │ ├── Makefile │ ├── RUNKEA │ ├── config-5.4.0 │ ├── cpu.config-5.4.0 │ ├── kea6.conf │ └── nbp ├── digitalloggers └── atomicpi │ ├── .gitignore │ ├── 50-cloud-init.yaml │ ├── CHOOSEKERNEL │ ├── Makefile │ ├── READROM │ ├── TESTOVMF │ ├── UTKDEMO │ ├── VERIFYROM │ ├── WRITEROM │ ├── class_key │ ├── class_key.pub │ ├── classhostkey │ ├── classhostkey.pub │ ├── cpu.config │ ├── cpuflash.config │ ├── dhcpd.config.192.168.0.1 │ ├── edk2bdsdxe.ffs │ ├── edk2shell.ffs │ ├── flash.config │ ├── grub │ └── grub.cfg │ ├── grubnetx64.efi.signed │ ├── linuxboot-linux.netboot.config │ ├── linuxboot-linux.tiny.config │ ├── loopprint0.asm │ ├── netconsole │ ├── pxelinux.cfg │ ├── C0A80002 │ └── default │ ├── pxelinux.cfg_default │ ├── sshd.config │ └── tftpserve ├── hpe └── dl360gen10 │ ├── Makefile │ ├── README.md │ ├── config-4.14.111 │ ├── config-5.4.0 │ └── updateInitramfs.sh ├── intel ├── generic │ ├── .gitignore │ ├── Makefile │ ├── config-4.14.111 │ ├── config-5.4.0 │ ├── config-5.7 │ └── cpu.config ├── hw │ ├── .gitignore │ ├── Makefile │ ├── corebootflash.config │ ├── cpu.config │ ├── cpuflash.config │ ├── etc │ │ └── README │ ├── flash.config │ ├── insert.go │ └── src │ │ └── uinit │ │ └── main.go ├── minplatform │ ├── Makefile │ └── linuxboot-linux.tiny.config └── s2600 │ ├── Makefile │ ├── flashkernel.config │ ├── linuxboot-linux.tiny.config │ └── netbootkernel.config ├── lenovo ├── hr630 │ ├── .gitignore │ ├── Makefile │ └── config-4.14.111 ├── sr630 │ ├── Makefile │ └── config-4.14.111 └── thinkpad │ ├── Makefile │ └── config-4.14.111 ├── marvel └── macchiatobin │ ├── .gitignore │ ├── Makefile │ └── config-5.6.3 ├── opentitanpilot └── dresden │ ├── .gitignore │ ├── Makefile │ └── flash.config ├── pcengines ├── apu │ ├── Makefile │ ├── TEST │ └── config-4.14.111 └── apu2 │ ├── Makefile │ ├── class_key │ ├── class_key.pub │ ├── classhostkey │ ├── classhostkey.pub │ ├── cpu.config │ ├── flash.config │ └── sshd.config ├── qemu └── x86_64 │ ├── .gitignore │ ├── Makefile │ └── flash.config ├── seeed └── beaglev │ ├── BOOTCMDS │ ├── Makefile │ ├── cpu.config │ ├── flash-5.14.esmil.config │ └── flash.config ├── slimboot ├── Makefile └── config-4.14.111 ├── st └── st32mp1517c │ ├── .gitignore │ ├── Makefile │ └── flash.config ├── tianocore └── ovmf │ ├── Dockerfile │ └── Makefile ├── tyan7106 ├── .gitignore ├── BURN ├── DXECLEANER ├── L ├── LIST ├── LOG ├── Makefile ├── NOTES ├── RUN3 ├── RUN4 ├── bin.reset ├── blacklist ├── chipsec-4.13.0-rc7.ko ├── chipsec_out ├── config-4.13.0-rc7 ├── config-4.14.111 └── pox.tcz └── walmart └── robot ├── .gitignore ├── Makefile ├── boot ├── bootSCREEN ├── config-3.4.43 └── config-5.10.0 /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | # Triggers the workflow on push or pull request events but only for the 4 | # master branch. 5 | push: 6 | branches: [master] 7 | pull_request: 8 | branches: [master] 9 | 10 | # Triggers the workflow every day at 23:00. 11 | schedule: 12 | - cron: '0 23 * * *' 13 | 14 | # Allows you to run this workflow manually from the Actions tab 15 | workflow_dispatch: 16 | 17 | # A workflow run is made up of one or more jobs that can run sequentially or in 18 | # parallel. 19 | jobs: 20 | # This workflow contains a single job called "build" 21 | build: 22 | # The type of runner that the job will run on 23 | runs-on: ubuntu-latest 24 | 25 | # Environment variables 26 | env: 27 | # Setup $GOPATH 28 | GOPATH: ${{ github.workspace }}/go 29 | # Turn off modules because they are broken. 30 | GO111MODULE: off 31 | 32 | # Run the build for each one of these configurations in parallel. 33 | strategy: 34 | matrix: 35 | # The `${{ matrix.mainboard }}` variable is replaced with each of these. 36 | mainboard: 37 | # '-' is used instead of '/' due to restrictions on artifact upload. 38 | - aeeon-up 39 | - aeeon-upxtreme 40 | - amd-rome 41 | - ampere-jade 42 | - bytedance-g220a 43 | - cubie-board 44 | - digitalloggers-atomicpi 45 | - hpe-dl360gen10 46 | - intel-generic 47 | - intel-hw 48 | - intel-minplatform 49 | - intel-s2600 50 | - lenovo-hr630 51 | - lenovo-sr630 52 | - lenovo-thinkpad 53 | - marvel-macchiatobin 54 | - opentitanpilot-dresden 55 | - pcengines-apu 56 | - pcengines-apu2 57 | - seeed-beaglev 58 | - slimboot 59 | - st-st32mp1517c 60 | - tyan7106 61 | - qemu-x86_64 62 | - walmart-robot 63 | 64 | # Do not cancel all jobs steps if a single one fails. 65 | fail-fast: false 66 | 67 | # Steps represent a sequence of tasks that will be executed as part of the 68 | # job. 69 | steps: 70 | - name: Set up Go 71 | uses: actions/setup-go@v3 72 | with: 73 | go-version: 1.19 74 | id: go 75 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can 76 | # access it. 77 | - uses: actions/checkout@v3 78 | 79 | - name: Install dependent packages 80 | run: | 81 | sudo apt-get update 82 | sudo apt-get install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi{,hf} libelf-dev u-boot-tools 83 | 84 | # Runs a set of commands using the runners shell 85 | - name: Make ${{ matrix.mainboard }} kernel 86 | run: | 87 | PATH=$PATH:$GOPATH/bin 88 | cd $(echo ${{ matrix.mainboard }} | tr '-' '/') 89 | make fetch 90 | make flashkernel 91 | - name: Upload Artifact 92 | uses: actions/upload-artifact@v3 93 | with: 94 | name: ${{ matrix.mainboard }} 95 | path: | 96 | **/flashkernel 97 | **/flashinitramfs.cpio 98 | retention-days: 30 99 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # don't want these ever 55 | uinit 56 | *.rom 57 | *.lzma 58 | *.pub 59 | 60 | # files specific to this project 61 | apu.bin 62 | apuorigin.bin 63 | cpuapu.bin 64 | image.bin 65 | initramfs.*.cpio 66 | kernel 67 | kernel.xz 68 | *.bin 69 | amitse 70 | AMITSE 71 | amitse* 72 | AMITSE* 73 | 74 | 75 | me_cleaner 76 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | echo pick one of debian-packages or repos 3 | 4 | debian-packages: 5 | sudo apt-get install bison flex zlib1g-dev golang build-essential git gcc isc-dhcp-server tftpd-hpa minicom flashrom 6 | echo The next command may get an error and that is ok if you have qemu-system-x86_64 7 | sudo apt-get install qemu-system-x86 8 | 9 | getmecleaner: 10 | go get -u github.com/u-root/u-root 11 | go get -u github.com/u-root/cpu/... 12 | git clone git://github.com/corna/me_cleaner 13 | @echo Now add $(PWD)/me_cleaner to PATH 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mainboards 2 | linuxboot for various mainboards 3 | 4 | ## Latest Build Status 5 | 6 | [![](http://github-actions.40ants.com/linuxboot/mainboards/matrix.svg)](https://github.com/linuxboot/mainboards) 7 | -------------------------------------------------------------------------------- /aeeon/up/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, uroot, flashkernel, or image.bin 5 | 6 | image.bin: 7 | utk \ 8 | -xzPath /usr/bin/xz \ 9 | ROM.bin \ 10 | remove Nb.* \ 11 | remove IntelIsh.* \ 12 | remove Ip.* \ 13 | remove Tcp.* \ 14 | remove Usb.* \ 15 | remove Udp.* \ 16 | remove Dhcp.* \ 17 | remove .np.* \ 18 | remove .tftp.* \ 19 | remove Http.* \ 20 | remove .*Dns.* \ 21 | remove Arp.* \ 22 | remove .*NetworkStackSetupScreen.* \ 23 | remove Iscsi.* \ 24 | remove Scsi.* \ 25 | remove Fat.* \ 26 | remove Ahci.* \ 27 | remove Partition.* \ 28 | remove Sata.* \ 29 | remove Disk.* \ 30 | remove Whea.* \ 31 | remove .*Pxe.* \ 32 | remove Ata.* \ 33 | remove AmiSeri.* \ 34 | remove IntelGop.* \ 35 | remove Logo.* \ 36 | remove Mouse.* \ 37 | remove .*Keyboard.* \ 38 | remove FlashDriver \ 39 | remove HiiDataBase \ 40 | remove EbcDxe \ 41 | remove AMITSE \ 42 | remove AMITSE.* \ 43 | remove Mmc.* \ 44 | remove Tcg.* \ 45 | remove Ish.* \ 46 | remove Setup \ 47 | save image.bin 48 | utk image.bin table | guid2english | grep Free 49 | echo \ 50 | remove AmiTc.* \ 51 | echo need 0x16b4a0 52 | 53 | flashkernel: uroot bzImage 54 | cp linux/arch/x86/boot/bzImage flashkernel 55 | 56 | netboot: netbooturoot bzImage 57 | cp linux/arch/x86/boot/bzImage kernel 58 | 59 | readrom: 60 | echo You need to get a ROM image from *somewhere* 61 | echo Once you do, put it in ROM.bin 62 | 63 | writerom: image.bin 64 | echo Here is where you would do the flashrom, e.g. 65 | echo sudo flashrom -p dediprog -w image.bin 66 | 67 | netbooturoot: 68 | go run github.com/u-root/u-root -o linux/initramfs.linux_amd64.cpio -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp github.com/u-root/u-root/cmds/boot/* 69 | 70 | uroot.lzma: uroot 71 | lzma -f -k initramfs.linux_amd64.cpio 72 | 73 | uroot: 74 | go run github.com/u-root/u-root -o initramfs.linux_amd64.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 75 | -defaultsh="" \ 76 | github.com/u-root/cpu/cmds/cpud 77 | 78 | alluroot: 79 | go run github.com/u-root/u-root -o initramfs.linux_amd64.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 80 | github.com/u-root/cpu/cmds/cpud \ 81 | all 82 | lzma -k -f initramfs.linux_amd64.cpio 83 | ls -l initramfs* 84 | cp *lzma linux 85 | 86 | bzImage: 87 | cp linuxboot-linux.config linux/.config 88 | (cd linux && make oldconfig && make -j32) 89 | 90 | stablebzImage: 91 | echo the config is from https://github.com/emutex/ubilinux-kernel/issues/2#issue-294853930 92 | cp ts.config.txt linux/.config 93 | (cd linux && make oldconfig && make -j32) 94 | 95 | fetch: getkernel geturoot getfiano getrom 96 | 97 | getkernel: 98 | rm -rf linux 99 | git clone --depth=1 https://github.com/linuxboot/linux 100 | 101 | getstablekernel: 102 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.10.tar.xz 103 | xzcat kernel.xz | tar x 104 | mv linux-5.3.10 linux 105 | 106 | upgetkernel: 107 | rm -rf linux 108 | git clone --depth=1 https://github.com/emutex/ubilinux-kernel.git -b upboard-4.9 linux 109 | 110 | getfiano: 111 | go get -u github.com/linuxboot/fiano/cmds/utk 112 | go install github.com/linuxboot/fiano/cmds/utk 113 | getrom: 114 | echo you can put a wget here 115 | echo and unxip it 116 | echo and cp it to sr630.bin 117 | geturoot: 118 | go get -u github.com/u-root/u-root 119 | go get -u github.com/u-root/cpu/... 120 | 121 | -------------------------------------------------------------------------------- /aeeon/up/buildimage.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "log" 7 | "os" 8 | "os/exec" 9 | ) 10 | 11 | func shell(s string, a ...string) { 12 | 13 | c := exec.Command(s, a...) 14 | c.Stdout, c.Stderr = os.Stdout, os.Stderr 15 | if err := c.Run(); err != nil { 16 | log.Fatal(err) 17 | } 18 | } 19 | 20 | func main() { 21 | shell("make", "uroot.lzma") 22 | // Stat the image, add it to .config 23 | fi, err := os.Stat("initramfs.linux_amd64.cpio.lzma") 24 | if err != nil { 25 | log.Fatal(err) 26 | } 27 | b, err := ioutil.ReadFile("linuxboot-linux.config") 28 | if err != nil { 29 | log.Fatal(err) 30 | } 31 | c := []byte(string(b) + fmt.Sprintf("\nCONFIG_CMDLINE_BOOL=y\nCONFIG_CMDLINE=\"earlyprintk=ttyS0,115200,keep console=ttyS0,115200, initrd=0x0xffa7a000,%d\"", fi.Size())) 32 | if err := ioutil.WriteFile("linux/.config", c, 0644); err != nil { 33 | log.Fatal(err) 34 | } 35 | shell("make", "kernel") 36 | } 37 | -------------------------------------------------------------------------------- /aeeon/up/runcoreboot: -------------------------------------------------------------------------------- 1 | rm build/coreboot.rom 2 | make 3 | cp build/coreboot.rom . 4 | dd if=initramfs.linux_amd64.cpio.lzma of=coreboot.rom conv=notrunc bs=4096 seek=634 5 | /usr/bin/qemu-system-x86_64 -machine q35 -bios coreboot.rom -serial /dev/tty -nographic 6 | -------------------------------------------------------------------------------- /aeeon/upxtreme/.gitignore: -------------------------------------------------------------------------------- 1 | *.cpio 2 | linux 3 | *.gz 4 | *kernel 5 | pxelinux.cfg 6 | 7 | -------------------------------------------------------------------------------- /aeeon/upxtreme/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make flashpxeboot.bin 13 | # scp -i class_key -P 2022 flashpxeboot.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w flashpxeboot.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make flashpxeboot.bin 23 | # cpu board flashrom -w flashpxeboot.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make flashpxeboot.bin 30 | # flashrom -w flashpxeboot.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # flashpxeboot.bin produces a flash image which will pxeboot. 34 | # cpu.bin produces a flash image that starts a cpu daemon. 35 | # 36 | # You can test the flash image kernel with qemu 37 | # make flashtest 38 | 39 | default: sshdkernel flash cpukernel 40 | 41 | flash: flashpxeboot.bin 42 | 43 | flashtest: testflashkernel 44 | 45 | usefultargets: 46 | echo fetch, uroot, kernel, or image.bin 47 | 48 | flashpxeboot.bin: dxeremove.bin flashkernel flashinitramfs.cpio.lzma 49 | utk \ 50 | -xzPath /usr/bin/xz \ 51 | $< \ 52 | replace_pe32 Shell flashkernel \ 53 | save $@ 54 | dd if=flashinitramfs.cpio.lzma of=$@ bs=4096 seek=360 conv=notrunc 55 | 56 | cpu.bin: edk2.bin cpuflashkernel cpu.cpio.lzma 57 | utk \ 58 | -xzPath /usr/bin/xz \ 59 | $< \ 60 | replace_pe32 Shell cpuflashkernel \ 61 | save $@ 62 | NOT GOING dd if=cpu.cpio.lzma of=$@ bs=4096 seek=360 conv=notrunc 63 | 64 | edk2.bin: dxeremove.bin 65 | echo Note, this inserts the edk2 bds and shell 66 | echo Only flash this image if you have an sf100. 67 | echo It will not be able to boot anything. 68 | utk \ 69 | -xzPath /usr/bin/xz \ 70 | $< \ 71 | insert_dxe edk2bdsdxe.ffs insert_dxe edk2shell.ffs \ 72 | save $@ 73 | 74 | dxeremove.bin: image.bin 75 | echo note, we remove DXE to the point the image is not viable 76 | echo until you put a kernel in it in place of the shell. 77 | utk $< \ 78 | comment FlashDriver_do_not_remove_efi_panics \ 79 | comment S3Save_do_not_remove_gets_error \ 80 | comment testremove \ 81 | comment FlashDriver_do_not_remove_efi_panics \ 82 | comment S3Save_do_not_remove_gets_error \ 83 | comment testremove \ 84 | remove Ahci.* \ 85 | remove AMITSE \ 86 | remove AMITSE.* \ 87 | remove Arp.* \ 88 | remove Ata.* \ 89 | remove Bds \ 90 | remove Button.* \ 91 | remove CryptoD.* \ 92 | remove .*Dhcp.* \ 93 | remove Dhcp6Dxe \ 94 | remove Disk.* \ 95 | remove EbcDxe \ 96 | remove Fat.* \ 97 | remove .*ftp.* \ 98 | remove .*harging.* \ 99 | remove I2c.* \ 100 | remove IntelGopV.* \ 101 | remove IntelIsh.* \ 102 | remove Ip4.* \ 103 | remove Ip6Dxe \ 104 | remove Iscsi.* \ 105 | remove Ish.* \ 106 | remove .*Keyboard.* \ 107 | remove Logo.* \ 108 | remove Maxim.* \ 109 | remove Mmc.* \ 110 | remove MnpDxe \ 111 | remove Mouse.* \ 112 | remove Mtftp4Dxe \ 113 | remove Mtftp6Dxe \ 114 | remove NetworkStackSetupScreen \ 115 | remove Partition.* \ 116 | remove .*PxeDxe.* \ 117 | remove RandomNumberGen \ 118 | remove ReFlash \ 119 | remove Sata.* \ 120 | remove Scsi.* \ 121 | remove SnpDxe \ 122 | remove SoftKbd \ 123 | remove Tcp.* \ 124 | remove TcpDxe \ 125 | remove TimestampDxe \ 126 | remove Udp.* \ 127 | remove Udp4.* \ 128 | remove Udp6Dxe \ 129 | remove UefiPxe.* \ 130 | remove Uhcd \ 131 | remove Usb.* \ 132 | remove Whea.* \ 133 | remove Xpower.* \ 134 | comment S3Save_do_not_remove_gets_error \ 135 | comment below_still_unknown \ 136 | comment TcgMor \ 137 | comment AmiTcgNvflagSample \ 138 | comment AmiTcgPlatformDxe \ 139 | comment TcgDxeplatform \ 140 | comment Tpm20PlatformDxe \ 141 | comment CrbTpm20Acpi \ 142 | comment TcgSmm \ 143 | comment TcgDxe \ 144 | comment Tcg2Dxe \ 145 | comment TcgPlatformSetupPolicy \ 146 | save $@ 147 | chmod a-w $@ 148 | 149 | hap.bin: tighten.bin 150 | cp $< $@ 151 | me_cleaner.py -s $@ 152 | chmod a-w $@ 153 | 154 | tighten.bin: image.bin 155 | utk $< tighten_me save $@ 156 | 157 | sshdkernel: sshd.cpio.lzma sshd.config 158 | cp sshd.config linux/.config 159 | (cd linux && make oldconfig && make -j32) 160 | cp linux/arch/x86/boot/bzImage $@ 161 | 162 | cpukernel: cpu.cpio.lzma cpu.config 163 | cp cpu.config linux/.config 164 | (cd linux && make oldconfig && make -j32) 165 | cp linux/arch/x86/boot/bzImage $@ 166 | 167 | cpuflashkernel: cpu.cpio.lzma cpuflash.config 168 | cp cpuflash.config linux/.config 169 | (cd linux && make oldconfig && make -j32) 170 | cp linux/arch/x86/boot/bzImage $@ 171 | 172 | readrom: 173 | echo You need to get a ROM image from *somewhere* 174 | echo Once you do, put it in ROM.bin 175 | 176 | writerom: image.bin 177 | echo Here is where you would do the flashrom, e.g. 178 | echo sudo flashrom -p dediprog -w image.bin 179 | 180 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 181 | lzma -f -k $< 182 | 183 | flashinitramfs.cpio: Makefile 184 | u-root -o $@ -build=bb \ 185 | -uinitcmd=/bbin/pxeboot \ 186 | github.com/u-root/u-root/cmds/boot/pxeboot \ 187 | github.com/u-root/u-root/cmds/core/cat \ 188 | github.com/u-root/u-root/cmds/core/elvish \ 189 | github.com/u-root/u-root/cmds/core/init \ 190 | github.com/u-root/u-root/cmds/core/ip \ 191 | github.com/u-root/u-root/cmds/core/ls \ 192 | github.com/u-root/u-root/cmds/core/kexec \ 193 | github.com/u-root/u-root/cmds/core/pci \ 194 | github.com/u-root/u-root/cmds/core/wget \ 195 | 196 | # this target builds an initramfs with only one program, the cpu server. 197 | # It depends on the kernel setting the IP address. 198 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 199 | cpu.cpio.lzma: Makefile 200 | u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 201 | -defaultsh="" \ 202 | github.com/u-root/cpu/cmds/cpud 203 | lzma -f -k cpu.cpio 204 | 205 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 206 | # the intent is to demonstrate the capability of http loading. 207 | # It depends on the kernel setting the IP address. 208 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 209 | sshd.cpio.lzma: Makefile 210 | u-root -o sshd.cpio -build=bb \ 211 | -uinitcmd=/bbin/sshd \ 212 | -files class_key.pub:authorized_keys \ 213 | -files classhostkey:id_rsa \ 214 | -files /usr/bin/vi \ 215 | -files /usr/share/vim \ 216 | -files /usr/share/terminfo \ 217 | -files /bin/bash \ 218 | -files /usr/sbin/flashrom \ 219 | -files /usr/bin/xz \ 220 | all 221 | lzma -f -k sshd.cpio 222 | ls -l sshd.cpio.* 223 | 224 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 225 | cp $< linux/.config 226 | echo CONFIG_CMDLINE_BOOL=y >> linux/.config 227 | echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 228 | stat -c 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ initrdmem=0xff968000,%s"' flashinitramfs.cpio.lzma >> linux/.config 229 | (cd linux && make oldconfig && make -j32) 230 | cp linux/arch/x86/boot/bzImage $@ 231 | 232 | testflashkernel: flashkernel 233 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 234 | 235 | testcpukernel: cpukernel 236 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 237 | 238 | # These stanzas fetch code. 239 | fetch: getkernel geturoot getfiano getrom 240 | 241 | getkernel: 242 | rm -rf linux 243 | git clone --depth=1 -b working_hack --single-branch https://github.com/linuxboot/linux 244 | 245 | getfiano: 246 | go get -u github.com/linuxboot/fiano/cmds/utk 247 | go install github.com/linuxboot/fiano/cmds/utk 248 | go install github.com/linuxboot/fiano/cmds/guid2english 249 | getrom: 250 | echo you can put a wget here 251 | echo and unxip it 252 | echo and cp it to image.bin 253 | geturoot: 254 | go get -u github.com/u-root/u-root 255 | go get -u github.com/u-root/cpu/... 256 | 257 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 258 | sshd-pxeserver: 259 | echo Consider Disabling any system services ... 260 | echo e.g. sudo systemctl stop tftpd-hpa.service 261 | echo e.g. sudo systemctl stop isc-dhcp-server 262 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 263 | 264 | # Serve the combined cpu-kernel and cpu-initramfs image. 265 | cpu-pxeserver: 266 | echo Consider Disabling any system services ... 267 | echo e.g. sudo systemctl stop tftpd-hpa.service 268 | echo e.g. sudo systemctl stop isc-dhcp-server 269 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 270 | 271 | ssh: 272 | ssh -i class_key -p 2022 root@up 273 | -------------------------------------------------------------------------------- /aeeon/upxtreme/class_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA4zGICkjqlAPbYH0MZGN79zDJi88uC1pbc7cUcHQPp8R9iet0 3 | 2Q594DiOsJhAc9ALDkVopAmDMew1OO9vwZXAkv00hPhnEHFSXJP31zaoWvQkbS/Z 4 | /Ghl8gTTrPpJo+gJ3kCINwM1Z+IEQbjlE1EsvgKQEWQMCN32cD52F1L0UpkRaRzP 5 | FKKxfMOKYCIIbFDbC1iAAsjuIOunlATy4OT1IbNBhkdX2Mx2kTchaJxry4LL+NDs 6 | sIvfrtMJ/5gmIWKYnc4mXr2ozD4ZvCm7ooEnQshSgXXTpjl1AuEJvnaczr+ij66w 7 | KUQhzK3Ukjo99b8xhih4pVlU661KAbezziyuFwIDAQABAoIBAFbib1s3jXYzj2b0 8 | C5Qss5DR+JHeFobC9GxpXIiw6ffH3harlBEaSKtCFdeVMjjYHBJGGwF4ndKuuZ/f 9 | eYa35WCRMs+TS57vJ4c+Ey8buQCnk3KqNRwhNLN8gxMI2La1G2kCltUrBfaHagdU 10 | VU6w4YJ86mmsMCoH8KH2USUUVVlsdbEgi6oQzPusw4le8a4shTX40YaBi90hv7XX 11 | MshqZDscjM/mqXJVMq8fLJ6IDYeNVLNw3GhlHrlitO2Kheil7ptgrftYdTVqvScR 12 | VNL4lFP6rq3N1BN0eisAwyB2A0mf/sCVc0fKA0qsNsODoVw9g7HBTjx6IFpbQ0Kh 13 | derDBgkCgYEA+tAZftg8z2A+YFdA/fTGxLS82BCsIKJ1kaizDWcshcdZ6AQ2vNwT 14 | JwxzOwiS/Tu1hqNHaE0tYV9cW8hKZC2CdsIquPEEewPNqnwzh6bhUiPmjlPF3Dea 15 | pX2LHklCAOXLtnJqf1ZmbhhWbj/2TIITr/Iq5ae5rk32QAwsyvphswMCgYEA5+Rh 16 | rMVYlXLSss/9rl+89ecrj0ZmXK5HNsheHdI+444wSgIoNP90Z7FHygDAWSV+RWsN 17 | ibpEQxACGhtSgK6IU+9w35fXrEcTfTwyrC5lMxipS5BCkBTSNm9QfASaIZE4Oz+d 18 | Z0ifjCCeG8ppZm/kVscP08BYNsuu3xSttDDi4l0CgYEAizhcDpbFGm9X8G4+ezkV 19 | 5DZW5LBMe0jybcnwqa3tfsyrUSiVobufPfuhMtGNlddA6d1UU8cTO4uNXr0M3hKM 20 | 6pLY2BOg4w+3Z7zNdaziQY//+Fzz5UtQIjBPup37bzgfHcTg7JHvBYmo4EXM16cU 21 | eoO34AZ8AQ7xc5fOfVUCSjUCgYEA5Pn9fMVtYDz+UnTQkQOWKdZ3i8U/RFsOlMir 22 | LpUxZi87/Yg9vX9VqSJDufKd/Cjqk49O0eWsi+/ds3uxLsGoegEgGpjr7QBN/UaY 23 | 3q39XcQHP0cWgwEcRYYLGjrNG0IzHUYGnjr22D5JATYQd4cbGJj9RuFR+eGMLllT 24 | 4G65Sj0CgYEAptcid0C4Dodg2LeA+E0dduec9uK4Qj4NkeoEcTw6fBInuP9vkIU7 25 | LyHDfXKVbCTHC79oc8oQ8OpeVvH999PU15g7MFAUdjrd2MCIEWcQ9WjJr0V3sVn4 26 | Nze3kVUWRsXhIoG0yWh6SHbc/HKFhKymtxvdPnbP4qajfcCGIKuIA2c= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /aeeon/upxtreme/class_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjMYgKSOqUA9tgfQxkY3v3MMmLzy4LWltztxRwdA+nxH2J63TZDn3gOI6wmEBz0AsORWikCYMx7DU472/BlcCS/TSE+GcQcVJck/fXNqha9CRtL9n8aGXyBNOs+kmj6AneQIg3AzVn4gRBuOUTUSy+ApARZAwI3fZwPnYXUvRSmRFpHM8UorF8w4pgIghsUNsLWIACyO4g66eUBPLg5PUhs0GGR1fYzHaRNyFonGvLgsv40Oywi9+u0wn/mCYhYpidziZevajMPhm8KbuigSdCyFKBddOmOXUC4Qm+dpzOv6KPrrApRCHMrdSSOj31vzGGKHilWVTrrUoBt7POLK4X rminnich@xcpu 2 | -------------------------------------------------------------------------------- /aeeon/upxtreme/classhostkey: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEogIBAAKCAQEA20e7SsGzrPyXMosKhgXMbvIPSe27ilhgcWw4I1NWsPMWhYEU 3 | DnM66JiqImyN3tTiimwH7WewKxy4opGLbk2ohYvNQBALNXNr1cV7usAQREAIbafp 4 | zZ6mO0gcWjrdsN31aTzMmEXO3dkS+wtEQzKBe/eFjlJbutHvEQkvYWtPeHTtBlVy 5 | wcJEc59orcE+HNXrXLcPuJZF37Z5HkEMNGDWvAutHmnXc3C0cKd+bOdhpTx7DAaW 6 | Fmj1GdL7WMPBQk1qKo4uE8lqOjTB5qwCGhWPtZFgD6QwYIKtZ/VFWMzUytc6ciRw 7 | b5ob6+0+mbL3IFb1XZDbOC3gSbGPV4V0xZrVtwIDAQABAoIBABlIF+vykUishrIp 8 | Hbl+Cafw+JpJconszpHFLGPGRAR6wmn6C9nupygSEeuOIH1Ehin3cqKIheMymIcF 9 | yNGa2ocrKyrrrp8nA5POBQnvAvEbgN1Dss0mMXw8QCiXCOBPdu//NoeH5OXnFS0k 10 | i2ZD+HHWg+t4y2Kqual5KaFNwgfdHJw9vmL/JFzzx2ZuVmIiAl7Pn9dNAu3JgaT2 11 | cHNEPxw04Pc0rsNd9NiMEuaijRPJhn2ZeDAdyo+RvrK6wI0ZiopG+3ZztKhJ65zT 12 | 7si2DjLpr8PMMgYPgMFy1YyoPKokYqnoSrLXMh2Lquy75145aysWNxVa640MNfp6 13 | vrFSCqECgYEA9T5GkrZ+7DCJfaPST7lqDBB7uON0DAYaSwUSxNVsu+UMAxSlXB25 14 | fYq3TzJzM+rJcDf5JPQLP2gD2BMYQIQZeHsgoV1UKVxZfJi3YpPCg3uNWxLTzut7 15 | TGawJBFULNoIrsxh0gLSsFP4RcDTWNUe31+3sD8SirrEz+GWjF9Nc0UCgYEA5OXt 16 | uApDOx8q6XkjNwMNZZJdQ+VeDQh8Wg8mPDNKwg7VejI7idV87tn7LjAa4TcKemRi 17 | WnLMeb98h0VZiWve2UwstiI5yiZon3f7jEJDop9jvg8/Cj2MgEc2hxKxZQxIN2k3 18 | sFfYMUtTr4Q2WT3Gm3aNERpgjhJjf2dFvMJulssCgYBHSUTmXJnkOe+dT8NQXUsQ 19 | GrJ7+dG/tP5rlBvyjz8+FsQ5GQVAE3vZnDrQkI+gJb1MG1kWfsHOOoPziQlhp4Rn 20 | 2xKPFTvjke6JIzMbOmwuH/nk4UIkQZrjiG3m7gqTxwUDGnHMw/lOO/pM/FHy3nBM 21 | 6dvRJWRUYxnWe3JxdzpiKQKBgEzBLS2Bg3nXwbP4gu53f46Hve5+g0MrjUdFvTSC 22 | npbkEoGfRoe5puMRBUE/sEPFCSZxcumRhS9uHnvdrWB/Y4LKIFQStf4rUvnmadtm 23 | fPeTKwcYZbMxYGPDfW1dv057B9xM0/e1/TDKaY15cCAMrwSChFsv1SDO2b5nCuN4 24 | 70xxAoGAbRDd2cxSICb+msM17yF1rGEzvcJRI1rjiTK71Gkt2VqfBPk1belz1vY8 25 | E/KkPMHwhWEMSuCrXnaxYrLZg4cvtbYy7tC+wgn1nXwfON8Cpmm74s0O6ufeE7dh 26 | S4Bsitze0ougzTMGLQO/9M7He/fPqjM4DIi+PvfpAl/ZUXdD/48= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /aeeon/upxtreme/classhostkey.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbR7tKwbOs/JcyiwqGBcxu8g9J7buKWGBxbDgjU1aw8xaFgRQOczromKoibI3e1OKKbAftZ7ArHLiikYtuTaiFi81AEAs1c2vVxXu6wBBEQAhtp+nNnqY7SBxaOt2w3fVpPMyYRc7d2RL7C0RDMoF794WOUlu60e8RCS9ha094dO0GVXLBwkRzn2itwT4c1etctw+4lkXftnkeQQw0YNa8C60eaddzcLRwp35s52GlPHsMBpYWaPUZ0vtYw8FCTWoqji4TyWo6NMHmrAIaFY+1kWAPpDBggq1n9UVYzNTK1zpyJHBvmhvr7T6ZsvcgVvVdkNs4LeBJsY9XhXTFmtW3 rminnich@xcpu 2 | -------------------------------------------------------------------------------- /amd/rome/class_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA4zGICkjqlAPbYH0MZGN79zDJi88uC1pbc7cUcHQPp8R9iet0 3 | 2Q594DiOsJhAc9ALDkVopAmDMew1OO9vwZXAkv00hPhnEHFSXJP31zaoWvQkbS/Z 4 | /Ghl8gTTrPpJo+gJ3kCINwM1Z+IEQbjlE1EsvgKQEWQMCN32cD52F1L0UpkRaRzP 5 | FKKxfMOKYCIIbFDbC1iAAsjuIOunlATy4OT1IbNBhkdX2Mx2kTchaJxry4LL+NDs 6 | sIvfrtMJ/5gmIWKYnc4mXr2ozD4ZvCm7ooEnQshSgXXTpjl1AuEJvnaczr+ij66w 7 | KUQhzK3Ukjo99b8xhih4pVlU661KAbezziyuFwIDAQABAoIBAFbib1s3jXYzj2b0 8 | C5Qss5DR+JHeFobC9GxpXIiw6ffH3harlBEaSKtCFdeVMjjYHBJGGwF4ndKuuZ/f 9 | eYa35WCRMs+TS57vJ4c+Ey8buQCnk3KqNRwhNLN8gxMI2La1G2kCltUrBfaHagdU 10 | VU6w4YJ86mmsMCoH8KH2USUUVVlsdbEgi6oQzPusw4le8a4shTX40YaBi90hv7XX 11 | MshqZDscjM/mqXJVMq8fLJ6IDYeNVLNw3GhlHrlitO2Kheil7ptgrftYdTVqvScR 12 | VNL4lFP6rq3N1BN0eisAwyB2A0mf/sCVc0fKA0qsNsODoVw9g7HBTjx6IFpbQ0Kh 13 | derDBgkCgYEA+tAZftg8z2A+YFdA/fTGxLS82BCsIKJ1kaizDWcshcdZ6AQ2vNwT 14 | JwxzOwiS/Tu1hqNHaE0tYV9cW8hKZC2CdsIquPEEewPNqnwzh6bhUiPmjlPF3Dea 15 | pX2LHklCAOXLtnJqf1ZmbhhWbj/2TIITr/Iq5ae5rk32QAwsyvphswMCgYEA5+Rh 16 | rMVYlXLSss/9rl+89ecrj0ZmXK5HNsheHdI+444wSgIoNP90Z7FHygDAWSV+RWsN 17 | ibpEQxACGhtSgK6IU+9w35fXrEcTfTwyrC5lMxipS5BCkBTSNm9QfASaIZE4Oz+d 18 | Z0ifjCCeG8ppZm/kVscP08BYNsuu3xSttDDi4l0CgYEAizhcDpbFGm9X8G4+ezkV 19 | 5DZW5LBMe0jybcnwqa3tfsyrUSiVobufPfuhMtGNlddA6d1UU8cTO4uNXr0M3hKM 20 | 6pLY2BOg4w+3Z7zNdaziQY//+Fzz5UtQIjBPup37bzgfHcTg7JHvBYmo4EXM16cU 21 | eoO34AZ8AQ7xc5fOfVUCSjUCgYEA5Pn9fMVtYDz+UnTQkQOWKdZ3i8U/RFsOlMir 22 | LpUxZi87/Yg9vX9VqSJDufKd/Cjqk49O0eWsi+/ds3uxLsGoegEgGpjr7QBN/UaY 23 | 3q39XcQHP0cWgwEcRYYLGjrNG0IzHUYGnjr22D5JATYQd4cbGJj9RuFR+eGMLllT 24 | 4G65Sj0CgYEAptcid0C4Dodg2LeA+E0dduec9uK4Qj4NkeoEcTw6fBInuP9vkIU7 25 | LyHDfXKVbCTHC79oc8oQ8OpeVvH999PU15g7MFAUdjrd2MCIEWcQ9WjJr0V3sVn4 26 | Nze3kVUWRsXhIoG0yWh6SHbc/HKFhKymtxvdPnbP4qajfcCGIKuIA2c= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /amd/rome/class_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjMYgKSOqUA9tgfQxkY3v3MMmLzy4LWltztxRwdA+nxH2J63TZDn3gOI6wmEBz0AsORWikCYMx7DU472/BlcCS/TSE+GcQcVJck/fXNqha9CRtL9n8aGXyBNOs+kmj6AneQIg3AzVn4gRBuOUTUSy+ApARZAwI3fZwPnYXUvRSmRFpHM8UorF8w4pgIghsUNsLWIACyO4g66eUBPLg5PUhs0GGR1fYzHaRNyFonGvLgsv40Oywi9+u0wn/mCYhYpidziZevajMPhm8KbuigSdCyFKBddOmOXUC4Qm+dpzOv6KPrrApRCHMrdSSOj31vzGGKHilWVTrrUoBt7POLK4X rminnich@xcpu 2 | -------------------------------------------------------------------------------- /amd/rome/classhostkey: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEogIBAAKCAQEA20e7SsGzrPyXMosKhgXMbvIPSe27ilhgcWw4I1NWsPMWhYEU 3 | DnM66JiqImyN3tTiimwH7WewKxy4opGLbk2ohYvNQBALNXNr1cV7usAQREAIbafp 4 | zZ6mO0gcWjrdsN31aTzMmEXO3dkS+wtEQzKBe/eFjlJbutHvEQkvYWtPeHTtBlVy 5 | wcJEc59orcE+HNXrXLcPuJZF37Z5HkEMNGDWvAutHmnXc3C0cKd+bOdhpTx7DAaW 6 | Fmj1GdL7WMPBQk1qKo4uE8lqOjTB5qwCGhWPtZFgD6QwYIKtZ/VFWMzUytc6ciRw 7 | b5ob6+0+mbL3IFb1XZDbOC3gSbGPV4V0xZrVtwIDAQABAoIBABlIF+vykUishrIp 8 | Hbl+Cafw+JpJconszpHFLGPGRAR6wmn6C9nupygSEeuOIH1Ehin3cqKIheMymIcF 9 | yNGa2ocrKyrrrp8nA5POBQnvAvEbgN1Dss0mMXw8QCiXCOBPdu//NoeH5OXnFS0k 10 | i2ZD+HHWg+t4y2Kqual5KaFNwgfdHJw9vmL/JFzzx2ZuVmIiAl7Pn9dNAu3JgaT2 11 | cHNEPxw04Pc0rsNd9NiMEuaijRPJhn2ZeDAdyo+RvrK6wI0ZiopG+3ZztKhJ65zT 12 | 7si2DjLpr8PMMgYPgMFy1YyoPKokYqnoSrLXMh2Lquy75145aysWNxVa640MNfp6 13 | vrFSCqECgYEA9T5GkrZ+7DCJfaPST7lqDBB7uON0DAYaSwUSxNVsu+UMAxSlXB25 14 | fYq3TzJzM+rJcDf5JPQLP2gD2BMYQIQZeHsgoV1UKVxZfJi3YpPCg3uNWxLTzut7 15 | TGawJBFULNoIrsxh0gLSsFP4RcDTWNUe31+3sD8SirrEz+GWjF9Nc0UCgYEA5OXt 16 | uApDOx8q6XkjNwMNZZJdQ+VeDQh8Wg8mPDNKwg7VejI7idV87tn7LjAa4TcKemRi 17 | WnLMeb98h0VZiWve2UwstiI5yiZon3f7jEJDop9jvg8/Cj2MgEc2hxKxZQxIN2k3 18 | sFfYMUtTr4Q2WT3Gm3aNERpgjhJjf2dFvMJulssCgYBHSUTmXJnkOe+dT8NQXUsQ 19 | GrJ7+dG/tP5rlBvyjz8+FsQ5GQVAE3vZnDrQkI+gJb1MG1kWfsHOOoPziQlhp4Rn 20 | 2xKPFTvjke6JIzMbOmwuH/nk4UIkQZrjiG3m7gqTxwUDGnHMw/lOO/pM/FHy3nBM 21 | 6dvRJWRUYxnWe3JxdzpiKQKBgEzBLS2Bg3nXwbP4gu53f46Hve5+g0MrjUdFvTSC 22 | npbkEoGfRoe5puMRBUE/sEPFCSZxcumRhS9uHnvdrWB/Y4LKIFQStf4rUvnmadtm 23 | fPeTKwcYZbMxYGPDfW1dv057B9xM0/e1/TDKaY15cCAMrwSChFsv1SDO2b5nCuN4 24 | 70xxAoGAbRDd2cxSICb+msM17yF1rGEzvcJRI1rjiTK71Gkt2VqfBPk1belz1vY8 25 | E/KkPMHwhWEMSuCrXnaxYrLZg4cvtbYy7tC+wgn1nXwfON8Cpmm74s0O6ufeE7dh 26 | S4Bsitze0ougzTMGLQO/9M7He/fPqjM4DIi+PvfpAl/ZUXdD/48= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /amd/rome/classhostkey.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbR7tKwbOs/JcyiwqGBcxu8g9J7buKWGBxbDgjU1aw8xaFgRQOczromKoibI3e1OKKbAftZ7ArHLiikYtuTaiFi81AEAs1c2vVxXu6wBBEQAhtp+nNnqY7SBxaOt2w3fVpPMyYRc7d2RL7C0RDMoF794WOUlu60e8RCS9ha094dO0GVXLBwkRzn2itwT4c1etctw+4lkXftnkeQQw0YNa8C60eaddzcLRwp35s52GlPHsMBpYWaPUZ0vtYw8FCTWoqji4TyWo6NMHmrAIaFY+1kWAPpDBggq1n9UVYzNTK1zpyJHBvmhvr7T6ZsvcgVvVdkNs4LeBJsY9XhXTFmtW3 rminnich@xcpu 2 | -------------------------------------------------------------------------------- /ampere/jade/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Ampere Jade. 2 | # This is only partially done. It is derived from other ARM 3 | # systems. 4 | # The goal is to create a kernel we can start from the UEFI shell. At present, 5 | # when we do this, we get this: 6 | # FS3:\EFI\opensuse\> Image 7 | # EFI stub: Booting Linux Kernel... 8 | # EFI stub: Generating empty DTB 9 | # EFI stub: Exiting boot services and installing virtual address map... 10 | GO_PATH := $(shell go env GOPATH) 11 | 12 | default: flashkernel 13 | 14 | flash: tiny.bin 15 | 16 | flashtest: testflashkernel 17 | 18 | usefultargets: 19 | echo fetch, uroot, kernel, or image.bin 20 | 21 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 22 | lzma -f -k $< 23 | 24 | flashinitramfs.cpio: Makefile 25 | GOARCH=arm64 u-root -o $@ \ 26 | -uroot-source=$(value GO_PATH)/src/github.com/u-root/u-root \ 27 | -build=bb all \ 28 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/exp/acpicat \ 29 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/exp/acpigrep \ 30 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/exp/disk_unlock \ 31 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/exp/dmidecode \ 32 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/exp/ipmidump 33 | 34 | # this target builds an initramfs with only one program, the cpu server. 35 | # It depends on the kernel setting the IP address. 36 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 37 | cpu.cpio.lzma: Makefile 38 | GOARCH=arm64 go run github.com/u-root/u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 39 | -defaultsh="" \ 40 | github.com/u-root/cpu/cmds/cpud 41 | lzma -f -k cpu.cpio 42 | 43 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 44 | # the intent is to demonstrate the capability of http loading. 45 | # It depends on the kernel setting the IP address. 46 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 47 | sshd.cpio.lzma: Makefile 48 | GOARCH=arm64 go run github.com/u-root/u-root -o sshd.cpio -build=bb \ 49 | -uinitcmd=/bbin/sshd \ 50 | -files class_key.pub:authorized_keys \ 51 | -files classhostkey:id_rsa \ 52 | -files /usr/bin/vi \ 53 | -files /usr/share/vim \ 54 | -files /usr/share/terminfo \ 55 | -files /bin/bash \ 56 | -files /usr/sbin/flashrom \ 57 | -files /usr/bin/xz \ 58 | all 59 | lzma -f -k sshd.cpio 60 | ls -l sshd.cpio.* 61 | 62 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 63 | cp $< linux/.config 64 | (cd linux && ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make oldconfig && ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j32) 65 | cp linux/arch/arm64/boot/Image $@ 66 | 67 | testflashkernel: flashkernel 68 | qemu-system-aarch64 -machine virt -cpu cortex-a57 -kernel flashkernel -nographic -initrd flashinitramfs.cpio.lzma -append "console=ttyAMA0,115200 keep_bootcon" 69 | 70 | # These stanzas fetch code. 71 | fetch: getkernel geturoot 72 | 73 | getkernel: 74 | rm -rf linux 75 | git clone --depth=1 -b v5.7 --single-branch https://github.com/torvalds/linux 76 | (cd linux && make mrproper) 77 | (cd linux && ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make tinyconfig) 78 | 79 | geturoot: 80 | go get -u github.com/u-root/u-root 81 | # go get -u github.com/u-root/cpu/... 82 | 83 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 84 | sshd-pxeserver: 85 | echo Consider Disabling any system services ... 86 | echo e.g. sudo systemctl stop tftpd-hpa.service 87 | echo e.g. sudo systemctl stop isc-dhcp-server 88 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 89 | 90 | # Serve the combined cpu-kernel and cpu-initramfs image. 91 | cpu-pxeserver: 92 | echo Consider Disabling any system services ... 93 | echo e.g. sudo systemctl stop tftpd-hpa.service 94 | echo e.g. sudo systemctl stop isc-dhcp-server 95 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 96 | 97 | ssh: 98 | ssh -i class_key -p 2022 root@up 99 | -------------------------------------------------------------------------------- /bytedance/g220a/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, flashkernel, testflashkernel and housekeeping 5 | 6 | flashkernel: config_g220a.config flashinitramfs.cpio.lzma Makefile 7 | cp $< linux/.config 8 | cp flashinitramfs.cpio.lzma linux/ 9 | # echo CONFIG_CMDLINE_BOOL=y >> linux/.config 10 | # echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 11 | # stat -c 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200"' flashinitramfs.cpio.lzma >> linux/.config 12 | (cd linux && make oldconfig && make -j32) 13 | cp linux/arch/x86/boot/bzImage $@ 14 | 15 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 16 | lzma -f -k $< 17 | 18 | flashinitramfs.cpio: Makefile 19 | go run github.com/u-root/u-root -o $@ -build=bb \ 20 | -uinitcmd=/bbin/console \ 21 | github.com/u-root/u-root/cmds/boot/pxeboot \ 22 | github.com/u-root/u-root/cmds/core/cat \ 23 | github.com/u-root/u-root/cmds/core/elvish \ 24 | github.com/u-root/u-root/cmds/core/init \ 25 | github.com/u-root/u-root/cmds/core/ip \ 26 | github.com/u-root/u-root/cmds/core/ls \ 27 | github.com/u-root/u-root/cmds/core/kexec \ 28 | github.com/u-root/u-root/cmds/core/pci \ 29 | github.com/u-root/u-root/cmds/core/wget \ 30 | github.com/u-root/u-root/cmds/exp/console \ 31 | 32 | fetch: getkernel geturoot getfiano 33 | 34 | getkernel: 35 | rm -rf linux 36 | git clone --depth=1 -b working_hack --single-branch https://github.com/linuxboot/linux 37 | 38 | getfiano: 39 | go get -u github.com/linuxboot/fiano/cmds/utk 40 | go install github.com/linuxboot/fiano/cmds/utk 41 | go install github.com/linuxboot/fiano/cmds/guid2english 42 | 43 | geturoot: 44 | go get -u github.com/u-root/u-root 45 | go get -u github.com/u-root/cpu/... 46 | 47 | testflashkernel: flashkernel 48 | echo ^C will exit qemu! be careful! 49 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma -monitor /dev/null 50 | 51 | housekeeping: 52 | rm -rf flashinitramfs.cpio \ 53 | flashinitramfs.cpio.lzma \ 54 | flashkernel \ 55 | 56 | -------------------------------------------------------------------------------- /cubie/board/Makefile: -------------------------------------------------------------------------------- 1 | VER=5.4.0 2 | default: build 3 | 4 | build: uCore flashkernel 5 | 6 | # this target builds an initramfs with only one program, the cpu server. 7 | # It depends on the kernel setting the IP address. 8 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 9 | cpu.cpio: 10 | GOARCH=arm u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 11 | -defaultsh="" \ 12 | github.com/u-root/cpu/cmds/cpud 13 | 14 | uCore: netbooturoot 15 | mkimage -A arm -n 'u-root for Allwinner A10' -d uroot.cpio -T ramdisk uCore 16 | 17 | qemu: uCore flashkernel 18 | qemu-system-arm -kernel flashkernel -machine cubieboard -serial stdio -initrd uCore -append 'console=ttyAM0 earlyprintk=ttyAM0,115200,keep' -display none 19 | echo NO 20 | exit 0 21 | 22 | netbooturoot: 23 | GOARCH=arm u-root \ 24 | -o uroot.cpio \ 25 | -files ~/.ssh/cpu_rsa.pub:key.pub \ 26 | -files ~/.ssh/cpu_rsa:id_rsa \ 27 | -files ~/.ssh/authorized_keys:authorized_keys \ 28 | all 29 | 30 | flashkernel: 31 | cp config-$(VER) linux/.config 32 | (cd linux && ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make oldconfig && ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j32) 33 | mkimage -C none -A arm -n 'kernel for Allwinner A10' -d linux/arch/arm/boot/zImage -T kernel -a 0x40008000 -e 0x40008000 kernel 34 | cp linux/arch/arm/boot/zImage flashkernel 35 | 36 | fetch: getkernel geturoot 37 | 38 | getkernel: 39 | rm -rf linux 40 | git clone git://github.com/linux-sunxi/linux-sunxi.git -b sunxi-next --depth=1 linux 41 | (cd linux && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig) 42 | 43 | geturoot: 44 | go get -u github.com/u-root/u-root 45 | 46 | packages: 47 | sudo apt install gcc-arm-linux-gnueabihf 48 | sudo apt install u-boot-tools 49 | -------------------------------------------------------------------------------- /cubie/board/RUNKEA: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo kea-dhcp6 -d -d -d -c kea6.conf 3 | -------------------------------------------------------------------------------- /cubie/board/kea6.conf: -------------------------------------------------------------------------------- 1 | { 2 | # DHCPv6 configuration starts on the next line 3 | "Dhcp6": { 4 | 5 | # First we set up global values 6 | "valid-lifetime": 4000, 7 | "renew-timer": 1000, 8 | "rebind-timer": 2000, 9 | "preferred-lifetime": 3000, 10 | 11 | # Next we setup the interfaces to be used by the server. 12 | "interfaces-config": { 13 | "interfaces": [ "enx00e04c6800ee"] 14 | }, 15 | 16 | # And we specify the type of lease database 17 | "lease-database": { 18 | "type": "memfile", 19 | "persist": true, 20 | "name": "./kea/dhcp6.leases" 21 | }, 22 | 23 | # Finally, we list the subnets from which we will be leasing addresses. 24 | "subnet6": [ 25 | { 26 | "rapid-commit": true, 27 | "subnet": "2001:db8:0:1::/56", 28 | "id": 1024, 29 | "interface": "enx00e04c6800ee", 30 | "pools": [ 31 | { 32 | "pool": "2001:db8:0:1::10-2001:db8:0:1::ffff" 33 | } 34 | ] 35 | } 36 | ], 37 | 38 | "option-data": [ 39 | { 40 | "name": "dns-servers", 41 | "code": 23, 42 | "csv-format": true, 43 | "space": "dhcp6", 44 | "data": "2001:4860:4860::8888, 2001:4860:4860::8844" 45 | }, 46 | { 47 | "name": "bootfile-url", 48 | "code": 59, 49 | "csv-format": true, 50 | "space": "dhcp6", 51 | "data": "http://[2001:db8:0:1::128]:80/nbp" 52 | } 53 | ] 54 | # DHCPv6 configuration ends with the next line 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /cubie/board/nbp: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | kernel http://[2001:db8:0:1::128]:80/uImage 3 | initrd http://[2001:db8:0:1::128]:80/uCore 4 | boot 5 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/.gitignore: -------------------------------------------------------------------------------- 1 | /*.cpio 2 | /*.lzma 3 | /linux 4 | /*kernel 5 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/50-cloud-init.yaml: -------------------------------------------------------------------------------- 1 | # This file is generated from information provided by 2 | # the datasource. Changes to it will not persist across an instance. 3 | # To disable cloud-init's network configuration capabilities, write a file 4 | # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: 5 | # network: {config: disabled} 6 | network: 7 | ethernets: 8 | ens33: 9 | addresses: [] 10 | dhcp4: true 11 | enx00e04c68017a: 12 | addresses: [192.168.0.1/24, "2001:db8:0:1::129/56"] 13 | dhcp4: false 14 | enxa0cec8cbc29b: 15 | addresses: [192.168.0.1/24, "2001:db8:0:1::129/56"] 16 | dhcp4: false 17 | enx00e04c6800ee: 18 | addresses: [192.168.0.1/24, "2001:db8:0:1::129/56"] 19 | dhcp4: false 20 | enx00e04c680a0f: 21 | addresses: [192.168.0.1/24, "2001:db8:0:1::129/56"] 22 | dhcp4: false 23 | version: 2 24 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/CHOOSEKERNEL: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | utk \ 4 | -xzPath \ 5 | /usr/bin/xz \ 6 | upimagewithup2dxeremovemore.bin \ 7 | replace_pe32 \ 8 | Shell_Full \ 9 | $1 \ 10 | save \ 11 | /tmp/xxx.bin 12 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make flashpxeboot.bin 13 | # scp -i class_key -P 2022 flashpxeboot.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w flashpxeboot.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make flashpxeboot.bin 23 | # cpu board flashrom -w flashpxeboot.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make flashpxeboot.bin 30 | # flashrom -w flashpxeboot.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # flashpxeboot.bin produces a flash image which will pxeboot. 34 | # cpu.bin produces a flash image that starts a cpu daemon. 35 | # 36 | # You can test the flash image kernel with qemu 37 | # make flashtest 38 | 39 | default: sshdkernel flash cpukernel 40 | 41 | flash: flashpxeboot.bin 42 | 43 | flashtest: testflashkernel 44 | 45 | usefultargets: 46 | echo fetch, uroot, kernel, or image.bin 47 | 48 | flashpxeboot.bin: edk2.bin flashkernel flashinitramfs.cpio.lzma 49 | utk \ 50 | -xzPath /usr/bin/xz \ 51 | $< \ 52 | replace_pe32 Shell flashkernel \ 53 | save $@ 54 | dd if=flashinitramfs.cpio.lzma of=$@ bs=4096 seek=360 conv=notrunc 55 | 56 | cpu.bin: edk2.bin cpuflashkernel cpu.cpio.lzma 57 | utk \ 58 | -xzPath /usr/bin/xz \ 59 | $< \ 60 | replace_pe32 Shell cpuflashkernel \ 61 | save $@ 62 | NOT GOING dd if=cpu.cpio.lzma of=$@ bs=4096 seek=360 conv=notrunc 63 | 64 | edk2.bin: dxeremove.bin 65 | echo Note, this inserts the edk2 bds and shell 66 | echo Only flash this image if you have an sf100. 67 | echo It will not be able to boot anything. 68 | utk \ 69 | -xzPath /usr/bin/xz \ 70 | $< \ 71 | insert_dxe edk2bdsdxe.ffs insert_dxe edk2shell.ffs \ 72 | save $@ 73 | 74 | dxeremove.bin: hap.bin 75 | echo note, we remove DXE to the point the image is not viable 76 | echo until you put a kernel in it in place of the shell. 77 | utk $< \ 78 | comment FlashDriver_do_not_remove_efi_panics \ 79 | comment S3Save_do_not_remove_gets_error \ 80 | comment testremove \ 81 | comment FlashDriver_do_not_remove_efi_panics \ 82 | comment S3Save_do_not_remove_gets_error \ 83 | comment testremove \ 84 | remove Ahci.* \ 85 | remove AMITSE \ 86 | remove AMITSE.* \ 87 | remove Arp.* \ 88 | remove Ata.* \ 89 | remove Bds \ 90 | remove Button.* \ 91 | remove CryptoD.* \ 92 | remove .*Dhcp.* \ 93 | remove Dhcp6Dxe \ 94 | remove Disk.* \ 95 | remove EbcDxe \ 96 | remove Fat.* \ 97 | remove .*ftp.* \ 98 | remove .*harging.* \ 99 | remove I2c.* \ 100 | remove IntelGopV.* \ 101 | remove IntelIsh.* \ 102 | remove Ip4.* \ 103 | remove Ip6Dxe \ 104 | remove Iscsi.* \ 105 | remove Ish.* \ 106 | remove .*Keyboard.* \ 107 | remove Logo.* \ 108 | remove Maxim.* \ 109 | remove Mmc.* \ 110 | remove MnpDxe \ 111 | remove Mouse.* \ 112 | remove Mtftp4Dxe \ 113 | remove Mtftp6Dxe \ 114 | remove NetworkStackSetupScreen \ 115 | remove Partition.* \ 116 | remove .*PxeDxe.* \ 117 | remove RandomNumberGen \ 118 | remove ReFlash \ 119 | remove Sata.* \ 120 | remove Scsi.* \ 121 | remove SnpDxe \ 122 | remove SoftKbd \ 123 | remove Tcp.* \ 124 | remove TcpDxe \ 125 | remove TimestampDxe \ 126 | remove Udp.* \ 127 | remove Udp4.* \ 128 | remove Udp6Dxe \ 129 | remove UefiPxe.* \ 130 | remove Uhcd \ 131 | remove Usb.* \ 132 | remove Whea.* \ 133 | remove Xpower.* \ 134 | comment S3Save_do_not_remove_gets_error \ 135 | comment below_still_unknown \ 136 | comment TcgMor \ 137 | comment AmiTcgNvflagSample \ 138 | comment AmiTcgPlatformDxe \ 139 | comment TcgDxeplatform \ 140 | comment Tpm20PlatformDxe \ 141 | comment CrbTpm20Acpi \ 142 | comment TcgSmm \ 143 | comment TcgDxe \ 144 | comment Tcg2Dxe \ 145 | comment TcgPlatformSetupPolicy \ 146 | save $@ 147 | chmod a-w $@ 148 | 149 | hap.bin: tighten.bin 150 | cp $< $@ 151 | me_cleaner.py -s $@ 152 | chmod a-w $@ 153 | 154 | tighten.bin: image.bin 155 | utk $< tighten_me save $@ 156 | 157 | sshdkernel: sshd.cpio.lzma sshd.config 158 | cp sshd.config linux/.config 159 | (cd linux && make oldconfig && make -j32) 160 | cp linux/arch/x86/boot/bzImage $@ 161 | 162 | cpukernel: cpu.cpio.lzma cpu.config 163 | cp cpu.config linux/.config 164 | (cd linux && make oldconfig && make -j32) 165 | cp linux/arch/x86/boot/bzImage $@ 166 | 167 | cpuflashkernel: cpu.cpio.lzma cpuflash.config 168 | cp cpuflash.config linux/.config 169 | (cd linux && make oldconfig && make -j32) 170 | cp linux/arch/x86/boot/bzImage $@ 171 | 172 | readrom: 173 | echo You need to get a ROM image from *somewhere* 174 | echo Once you do, put it in ROM.bin 175 | 176 | writerom: image.bin 177 | echo Here is where you would do the flashrom, e.g. 178 | echo sudo flashrom -p dediprog -w image.bin 179 | 180 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 181 | lzma -f -k $< 182 | 183 | flashinitramfs.cpio: Makefile 184 | u-root -o $@ -build=bb \ 185 | -uinitcmd=/bbin/pxeboot \ 186 | github.com/u-root/u-root/cmds/boot/pxeboot \ 187 | github.com/u-root/u-root/cmds/core/cat \ 188 | github.com/u-root/u-root/cmds/core/elvish \ 189 | github.com/u-root/u-root/cmds/core/init \ 190 | github.com/u-root/u-root/cmds/core/ip \ 191 | github.com/u-root/u-root/cmds/core/ls \ 192 | github.com/u-root/u-root/cmds/core/kexec \ 193 | github.com/u-root/u-root/cmds/core/pci \ 194 | github.com/u-root/u-root/cmds/core/wget \ 195 | 196 | # this target builds an initramfs with only one program, the cpu server. 197 | # It depends on the kernel setting the IP address. 198 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 199 | cpu.cpio.lzma: Makefile 200 | u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 201 | -defaultsh="" \ 202 | github.com/u-root/cpu/cmds/cpud 203 | lzma -f -k cpu.cpio 204 | 205 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 206 | # the intent is to demonstrate the capability of http loading. 207 | # It depends on the kernel setting the IP address. 208 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 209 | sshd.cpio.lzma: Makefile 210 | u-root -o sshd.cpio -build=bb \ 211 | -uinitcmd=/bbin/sshd \ 212 | -files class_key.pub:authorized_keys \ 213 | -files classhostkey:id_rsa \ 214 | -files /usr/bin/vi \ 215 | -files /usr/share/vim \ 216 | -files /usr/share/terminfo \ 217 | -files /bin/bash \ 218 | -files /usr/sbin/flashrom \ 219 | -files /usr/bin/xz \ 220 | all 221 | lzma -f -k sshd.cpio 222 | ls -l sshd.cpio.* 223 | 224 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 225 | cp $< linux/.config 226 | echo CONFIG_CMDLINE_BOOL=y >> linux/.config 227 | echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 228 | stat -c 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ initrdmem=0xff968000,%s"' flashinitramfs.cpio.lzma >> linux/.config 229 | (cd linux && make oldconfig && make -j32) 230 | cp linux/arch/x86/boot/bzImage $@ 231 | 232 | testflashkernel: flashkernel 233 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 234 | 235 | testcpukernel: cpukernel 236 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 237 | 238 | # These stanzas fetch code. 239 | fetch: getkernel geturoot getfiano getrom 240 | 241 | getkernel: 242 | rm -rf linux 243 | git clone --depth=1 -b working_hack --single-branch https://github.com/linuxboot/linux 244 | 245 | getfiano: 246 | go get -u github.com/linuxboot/fiano/cmds/utk 247 | go install github.com/linuxboot/fiano/cmds/utk 248 | go install github.com/linuxboot/fiano/cmds/guid2english 249 | getrom: 250 | echo you can put a wget here 251 | echo and unxip it 252 | echo and cp it to image.bin 253 | geturoot: 254 | go get -u github.com/u-root/u-root 255 | go get -u github.com/u-root/cpu/... 256 | 257 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 258 | sshd-pxeserver: 259 | echo Consider Disabling any system services ... 260 | echo e.g. sudo systemctl stop tftpd-hpa.service 261 | echo e.g. sudo systemctl stop isc-dhcp-server 262 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 263 | 264 | # Serve the combined cpu-kernel and cpu-initramfs image. 265 | cpu-pxeserver: 266 | echo Consider Disabling any system services ... 267 | echo e.g. sudo systemctl stop tftpd-hpa.service 268 | echo e.g. sudo systemctl stop isc-dhcp-server 269 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 270 | 271 | ssh: 272 | ssh -i class_key -p 2022 root@up 273 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/READROM: -------------------------------------------------------------------------------- 1 | sudo flashrom -p dediprog:voltage=1.8 -r $* 2 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/TESTOVMF: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | rm -f /tmp/xxx.bin 4 | utk -xzPath /usr/bin/xz \ 5 | /mnt/hgfs/rminnich/Downloads/OVMF.fd \ 6 | remove BdsDxe insert_dxe up2bds.ffs \ 7 | remove Shell insert_dxe up2shellfull.ffs \ 8 | save /tmp/xxx.fd 9 | /usr/bin/qemu-system-x86_64 -nographic -net none -bios /tmp/xxx.fd 10 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/UTKDEMO: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | echo "Make sure me_cleaner.py is in our path" 4 | which me_cleaner.py 5 | echo "Make sure utk is in our path" 6 | which utk 7 | echo "Make sure guid2english is in our path" 8 | which guid2english 9 | echo "Let's go!" 10 | touch image.bin 11 | read -p "Hit return to see the original UEFI image structure" 12 | utk image.bin table | guid2english | less 13 | echo "Cut the ME area down to a smaller area" 14 | make tighten.bin 15 | read -p "hit to see the changed UEFI structure" i 16 | utk tighten.bin table | guid2english | less 17 | read -p "hit return to continue to setting HAP bit" i 18 | chmod +w hap.bin 19 | make hap.bin 20 | # read -p "hit return to continue" i 21 | # utk hap.bin table | guid2english | less 22 | read -p "hit return to remove DXEs" i 23 | chmod +w dxeremove.bin 24 | make dxeremove.bin 25 | # read -p "hit return to see the post-removal table" i 26 | # utk dxeremove.bin table | guid2english | less 27 | read -p "Hit return to add BdsDxe and UEFIShellDxe built from source" i 28 | make edk2.bin 29 | read -p "hit return to see the new UEFI image" i 30 | utk edk2.bin table | guid2english | less 31 | read -p "hit return to Replace shell binary with kernel and add initramfs" i 32 | make tiny.bin 33 | read -p "hit return to see the final image" i 34 | utk tiny.bin table | guid2english | less 35 | read -p "to see how the kernel finds the initrd hit return" i 36 | grep initrd= linux/.config 37 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/VERIFYROM: -------------------------------------------------------------------------------- 1 | sudo flashrom -p dediprog:voltage=1.8 -v $* 2 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/WRITEROM: -------------------------------------------------------------------------------- 1 | sudo flashrom -p dediprog:voltage=1.8 -w $* 2 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/class_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA4zGICkjqlAPbYH0MZGN79zDJi88uC1pbc7cUcHQPp8R9iet0 3 | 2Q594DiOsJhAc9ALDkVopAmDMew1OO9vwZXAkv00hPhnEHFSXJP31zaoWvQkbS/Z 4 | /Ghl8gTTrPpJo+gJ3kCINwM1Z+IEQbjlE1EsvgKQEWQMCN32cD52F1L0UpkRaRzP 5 | FKKxfMOKYCIIbFDbC1iAAsjuIOunlATy4OT1IbNBhkdX2Mx2kTchaJxry4LL+NDs 6 | sIvfrtMJ/5gmIWKYnc4mXr2ozD4ZvCm7ooEnQshSgXXTpjl1AuEJvnaczr+ij66w 7 | KUQhzK3Ukjo99b8xhih4pVlU661KAbezziyuFwIDAQABAoIBAFbib1s3jXYzj2b0 8 | C5Qss5DR+JHeFobC9GxpXIiw6ffH3harlBEaSKtCFdeVMjjYHBJGGwF4ndKuuZ/f 9 | eYa35WCRMs+TS57vJ4c+Ey8buQCnk3KqNRwhNLN8gxMI2La1G2kCltUrBfaHagdU 10 | VU6w4YJ86mmsMCoH8KH2USUUVVlsdbEgi6oQzPusw4le8a4shTX40YaBi90hv7XX 11 | MshqZDscjM/mqXJVMq8fLJ6IDYeNVLNw3GhlHrlitO2Kheil7ptgrftYdTVqvScR 12 | VNL4lFP6rq3N1BN0eisAwyB2A0mf/sCVc0fKA0qsNsODoVw9g7HBTjx6IFpbQ0Kh 13 | derDBgkCgYEA+tAZftg8z2A+YFdA/fTGxLS82BCsIKJ1kaizDWcshcdZ6AQ2vNwT 14 | JwxzOwiS/Tu1hqNHaE0tYV9cW8hKZC2CdsIquPEEewPNqnwzh6bhUiPmjlPF3Dea 15 | pX2LHklCAOXLtnJqf1ZmbhhWbj/2TIITr/Iq5ae5rk32QAwsyvphswMCgYEA5+Rh 16 | rMVYlXLSss/9rl+89ecrj0ZmXK5HNsheHdI+444wSgIoNP90Z7FHygDAWSV+RWsN 17 | ibpEQxACGhtSgK6IU+9w35fXrEcTfTwyrC5lMxipS5BCkBTSNm9QfASaIZE4Oz+d 18 | Z0ifjCCeG8ppZm/kVscP08BYNsuu3xSttDDi4l0CgYEAizhcDpbFGm9X8G4+ezkV 19 | 5DZW5LBMe0jybcnwqa3tfsyrUSiVobufPfuhMtGNlddA6d1UU8cTO4uNXr0M3hKM 20 | 6pLY2BOg4w+3Z7zNdaziQY//+Fzz5UtQIjBPup37bzgfHcTg7JHvBYmo4EXM16cU 21 | eoO34AZ8AQ7xc5fOfVUCSjUCgYEA5Pn9fMVtYDz+UnTQkQOWKdZ3i8U/RFsOlMir 22 | LpUxZi87/Yg9vX9VqSJDufKd/Cjqk49O0eWsi+/ds3uxLsGoegEgGpjr7QBN/UaY 23 | 3q39XcQHP0cWgwEcRYYLGjrNG0IzHUYGnjr22D5JATYQd4cbGJj9RuFR+eGMLllT 24 | 4G65Sj0CgYEAptcid0C4Dodg2LeA+E0dduec9uK4Qj4NkeoEcTw6fBInuP9vkIU7 25 | LyHDfXKVbCTHC79oc8oQ8OpeVvH999PU15g7MFAUdjrd2MCIEWcQ9WjJr0V3sVn4 26 | Nze3kVUWRsXhIoG0yWh6SHbc/HKFhKymtxvdPnbP4qajfcCGIKuIA2c= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/class_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjMYgKSOqUA9tgfQxkY3v3MMmLzy4LWltztxRwdA+nxH2J63TZDn3gOI6wmEBz0AsORWikCYMx7DU472/BlcCS/TSE+GcQcVJck/fXNqha9CRtL9n8aGXyBNOs+kmj6AneQIg3AzVn4gRBuOUTUSy+ApARZAwI3fZwPnYXUvRSmRFpHM8UorF8w4pgIghsUNsLWIACyO4g66eUBPLg5PUhs0GGR1fYzHaRNyFonGvLgsv40Oywi9+u0wn/mCYhYpidziZevajMPhm8KbuigSdCyFKBddOmOXUC4Qm+dpzOv6KPrrApRCHMrdSSOj31vzGGKHilWVTrrUoBt7POLK4X rminnich@xcpu 2 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/classhostkey: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEogIBAAKCAQEA20e7SsGzrPyXMosKhgXMbvIPSe27ilhgcWw4I1NWsPMWhYEU 3 | DnM66JiqImyN3tTiimwH7WewKxy4opGLbk2ohYvNQBALNXNr1cV7usAQREAIbafp 4 | zZ6mO0gcWjrdsN31aTzMmEXO3dkS+wtEQzKBe/eFjlJbutHvEQkvYWtPeHTtBlVy 5 | wcJEc59orcE+HNXrXLcPuJZF37Z5HkEMNGDWvAutHmnXc3C0cKd+bOdhpTx7DAaW 6 | Fmj1GdL7WMPBQk1qKo4uE8lqOjTB5qwCGhWPtZFgD6QwYIKtZ/VFWMzUytc6ciRw 7 | b5ob6+0+mbL3IFb1XZDbOC3gSbGPV4V0xZrVtwIDAQABAoIBABlIF+vykUishrIp 8 | Hbl+Cafw+JpJconszpHFLGPGRAR6wmn6C9nupygSEeuOIH1Ehin3cqKIheMymIcF 9 | yNGa2ocrKyrrrp8nA5POBQnvAvEbgN1Dss0mMXw8QCiXCOBPdu//NoeH5OXnFS0k 10 | i2ZD+HHWg+t4y2Kqual5KaFNwgfdHJw9vmL/JFzzx2ZuVmIiAl7Pn9dNAu3JgaT2 11 | cHNEPxw04Pc0rsNd9NiMEuaijRPJhn2ZeDAdyo+RvrK6wI0ZiopG+3ZztKhJ65zT 12 | 7si2DjLpr8PMMgYPgMFy1YyoPKokYqnoSrLXMh2Lquy75145aysWNxVa640MNfp6 13 | vrFSCqECgYEA9T5GkrZ+7DCJfaPST7lqDBB7uON0DAYaSwUSxNVsu+UMAxSlXB25 14 | fYq3TzJzM+rJcDf5JPQLP2gD2BMYQIQZeHsgoV1UKVxZfJi3YpPCg3uNWxLTzut7 15 | TGawJBFULNoIrsxh0gLSsFP4RcDTWNUe31+3sD8SirrEz+GWjF9Nc0UCgYEA5OXt 16 | uApDOx8q6XkjNwMNZZJdQ+VeDQh8Wg8mPDNKwg7VejI7idV87tn7LjAa4TcKemRi 17 | WnLMeb98h0VZiWve2UwstiI5yiZon3f7jEJDop9jvg8/Cj2MgEc2hxKxZQxIN2k3 18 | sFfYMUtTr4Q2WT3Gm3aNERpgjhJjf2dFvMJulssCgYBHSUTmXJnkOe+dT8NQXUsQ 19 | GrJ7+dG/tP5rlBvyjz8+FsQ5GQVAE3vZnDrQkI+gJb1MG1kWfsHOOoPziQlhp4Rn 20 | 2xKPFTvjke6JIzMbOmwuH/nk4UIkQZrjiG3m7gqTxwUDGnHMw/lOO/pM/FHy3nBM 21 | 6dvRJWRUYxnWe3JxdzpiKQKBgEzBLS2Bg3nXwbP4gu53f46Hve5+g0MrjUdFvTSC 22 | npbkEoGfRoe5puMRBUE/sEPFCSZxcumRhS9uHnvdrWB/Y4LKIFQStf4rUvnmadtm 23 | fPeTKwcYZbMxYGPDfW1dv057B9xM0/e1/TDKaY15cCAMrwSChFsv1SDO2b5nCuN4 24 | 70xxAoGAbRDd2cxSICb+msM17yF1rGEzvcJRI1rjiTK71Gkt2VqfBPk1belz1vY8 25 | E/KkPMHwhWEMSuCrXnaxYrLZg4cvtbYy7tC+wgn1nXwfON8Cpmm74s0O6ufeE7dh 26 | S4Bsitze0ougzTMGLQO/9M7He/fPqjM4DIi+PvfpAl/ZUXdD/48= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/classhostkey.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbR7tKwbOs/JcyiwqGBcxu8g9J7buKWGBxbDgjU1aw8xaFgRQOczromKoibI3e1OKKbAftZ7ArHLiikYtuTaiFi81AEAs1c2vVxXu6wBBEQAhtp+nNnqY7SBxaOt2w3fVpPMyYRc7d2RL7C0RDMoF794WOUlu60e8RCS9ha094dO0GVXLBwkRzn2itwT4c1etctw+4lkXftnkeQQw0YNa8C60eaddzcLRwp35s52GlPHsMBpYWaPUZ0vtYw8FCTWoqji4TyWo6NMHmrAIaFY+1kWAPpDBggq1n9UVYzNTK1zpyJHBvmhvr7T6ZsvcgVvVdkNs4LeBJsY9XhXTFmtW3 rminnich@xcpu 2 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/dhcpd.config.192.168.0.1: -------------------------------------------------------------------------------- 1 | allow booting; 2 | allow bootp; 3 | option option-128 code 128 = string; 4 | option option-129 code 129 = text; 5 | next-server 192.168.0.1; 6 | filename "grubnetx64.efi.signed"; 7 | option domain-name "coreboot.org"; 8 | option domain-name-servers ns1.google.com, ns2.google.com; 9 | default-lease-time 600; 10 | max-lease-time 7200; 11 | ddns-update-style none; 12 | authoritative; 13 | default-lease-time 600; 14 | max-lease-time 7200; 15 | log-facility local7; 16 | subnet 192.168.0.0 netmask 255.255.255.0 { 17 | option routers 192.168.0.1; 18 | # Specify the subnet-mask 19 | option subnet-mask 255.255.255.0; 20 | # Specify the range of leased IP addresses 21 | range 192.168.0.2 192.168.0.128; 22 | } 23 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/edk2bdsdxe.ffs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxboot/mainboards/8e04ab8f21fce057958bd062514dbeebdfe437c6/digitalloggers/atomicpi/edk2bdsdxe.ffs -------------------------------------------------------------------------------- /digitalloggers/atomicpi/edk2shell.ffs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxboot/mainboards/8e04ab8f21fce057958bd062514dbeebdfe437c6/digitalloggers/atomicpi/edk2shell.ffs -------------------------------------------------------------------------------- /digitalloggers/atomicpi/grub/grub.cfg: -------------------------------------------------------------------------------- 1 | timeout=0 2 | menuentry "NERF with linuxboot build no graphics" { 3 | linux kernel ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 4 | initrd /initramfs.linux_amd64.cpio.lzma 5 | } 6 | 7 | menuentry "NERF with linuxboot build no graphics and a netconsole" { 8 | linux kernel ip=dhcp earlyprintk=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ 9 | initrd /initramfs.linux_amd64.cpio.lzma 10 | } 11 | 12 | menuentry "NERF with linuxboot build no graphics initramfs in SPI" { 13 | linux kernel ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 initrd=0xff968000,1294143 14 | } 15 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/grubnetx64.efi.signed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxboot/mainboards/8e04ab8f21fce057958bd062514dbeebdfe437c6/digitalloggers/atomicpi/grubnetx64.efi.signed -------------------------------------------------------------------------------- /digitalloggers/atomicpi/loopprint0.asm: -------------------------------------------------------------------------------- 1 | # nasm -f bin 2 | bits 64 3 | section .header 4 | DOS: 5 | dw 0x5a4d ;e_magic 6 | times 29 dw 0 ;unused 7 | dd 0x40 ;e_lfanew 8 | 9 | PECOFF: 10 | dd `PE\0\0` ;Signature 11 | dw 0x8664 ;Machine 12 | dw 3 ;NumberOfSections 13 | dd 0 ;TimeDateStamp 14 | dd 0 ;PointerToSymbolTable 15 | dd 0 ;NumberOfSymbols 16 | dw 160 ;SizeOfOptionalHeader 17 | dw 0x202 ;Characteristics 18 | dw 0x20b ;Magic 19 | db 0 ;MajorLinkerVersion 20 | db 0 ;MinorLinkerVersion 21 | dd 0x200 ;SizeOfCode 22 | dd 0x400 ;SizeOfInitializedData 23 | dd 0 ;SizeOfUninitializedData 24 | dd 0x0 ;AddressOfEntryPoint 25 | dd 0x0 ;BaseOfCode 26 | dq 0x0 ;ImageBase 27 | dd 0x1000 ;SectionAlignment 28 | dd 0x200 ;FileAlignment 29 | dw 0 ;MajorOperatingSystemVersion 30 | dw 0 ;MinorOperatingSystemVersion 31 | dw 0 ;MajorImageVersion 32 | dw 0 ;MinorImageVersion 33 | dw 0 ;MajorSubsystemVersion 34 | dw 0 ;MinorSubsystemVersion 35 | dd 0 ;Reserved 36 | dd 0x3000 ;SizeOfImage 37 | dd 0x200 ;SizeOfHeaders 38 | dd 0 ;CheckSum 39 | dw 10 ;Subsystem 40 | dw 0 ;DllCharacteristics 41 | dq 0 ;SizeOfStackReserve 42 | dq 0 ;SizeOfStackCommit 43 | dq 0 ;SizeOfHeapReserve 44 | dq 0 ;SizeOfHeapCommit 45 | dd 0 ;LoaderFlags 46 | dd 6 ;NumberOfRvaAndSizes 47 | 48 | DIRS: 49 | times 40 db 0 ;unused dirs for this app 50 | dd 0x1000 ;VirtualAddress(.reloc) 51 | dd 8 ;Size(.reloc) 52 | 53 | SECTS: 54 | .1: 55 | dq `.text` ;Name 56 | dd codesize ;VirtualSize 57 | dd 0x0 ;VirtualAddress 58 | dd 0x200 ;SizeOfRawData 59 | dd 0x200 ;PointerToRawData 60 | dd 0 ;PointerToRelocations 61 | dd 0 ;PointerToLinenumbers 62 | dw 0 ;NumberOfRelocations 63 | dw 0 ;NumberOfLinenumbers 64 | dd 0x60500020 ;Characteristics 65 | 66 | .2: 67 | dq `.reloc` 68 | dd 0x8 69 | dd 0x1000 70 | dd 0x200 71 | dd 0x400 72 | dd 0 73 | dd 0 74 | dw 0 75 | dw 0 76 | dd 0x42100040 77 | 78 | .3: 79 | dq `.data` 80 | dd datasize 81 | dd 0x2000 82 | dd 0x200 83 | dd 0x600 84 | dd 0 85 | dd 0 86 | dw 0 87 | dw 0 88 | dd 0xc0100040 89 | 90 | section .text follows=.header align=0x200 91 | a: 92 | mov rax, 48 93 | mov rdx, 1016 94 | db 0xee 95 | jmp a 96 | sub rsp, 40 97 | 98 | mov rcx, [rdx+64] 99 | lea rdx, [rel hello] 100 | call [rcx+8] 101 | 102 | add rsp, 40 103 | ret 104 | 105 | codesize equ $ - $$ 106 | 107 | section .reloc follows=.text align=0x200 108 | dd 0 ;PageRVA 109 | dd 8 ;BlockSize 110 | 111 | section .data follows=.reloc align=0x200 vstart=0x2200 ;yeah this is the trick! 112 | hello: 113 | db __utf16__ `hello world!\n\r\0` 114 | 115 | datasize equ $ - $$ 116 | align 0x200,db 0 117 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/netconsole: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | netcat -l -u 192.168.0.1 6666 3 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/pxelinux.cfg/C0A80002: -------------------------------------------------------------------------------- 1 | prompt 0 2 | timeout 300 3 | ONTIMEOUT local 4 | DEFAULT cpu 5 | 6 | MENU TITLE PXE Menu 7 | 8 | LABEL flash 9 | MENU LABEL flash 10 | kernel http://192.168.0.1/tinykernel 11 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 memmap=256M!1G netconsole=6666@192.168.0.2/,6666@192.168.0.1/ 12 | 13 | LABEL reflash 14 | MENU LABEL reflash 15 | kernel http://192.168.0.1/sshdkernel 16 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 17 | 18 | LABEL reflashslow 19 | MENU LABEL reflash 20 | kernel sshdkernel 21 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 22 | 23 | LABEL cpu 24 | MENU LABEL cpu 25 | kernel http://192.168.0.1/cpukernel 26 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 27 | 28 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/pxelinux.cfg/default: -------------------------------------------------------------------------------- 1 | prompt 0 2 | timeout 300 3 | ONTIMEOUT local 4 | DEFAULT cpu 5 | 6 | MENU TITLE PXE Menu 7 | 8 | LABEL flash 9 | MENU LABEL flash 10 | kernel http://192.168.0.1/tinykernel 11 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 memmap=256M!1G netconsole=6666@192.168.0.2/,6666@192.168.0.1/ 12 | 13 | LABEL reflash 14 | MENU LABEL reflash 15 | kernel http://192.168.0.1/sshdkernel 16 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 17 | 18 | LABEL reflashslow 19 | MENU LABEL reflash 20 | kernel sshdkernel 21 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 22 | 23 | LABEL cpu 24 | MENU LABEL cpu 25 | kernel http://192.168.0.1/cpukernel 26 | append ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 27 | 28 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/pxelinux.cfg_default: -------------------------------------------------------------------------------- 1 | prompt 0 2 | timeout 300 3 | ONTIMEOUT local 4 | DEFAULT cpu 5 | 6 | MENU TITLE PXE Menu 7 | 8 | LABEL flash 9 | MENU LABEL flash 10 | kernel http://192.168.0.1/tinykernel 11 | append initrd=http://192.168.0.1/flashinitramfs.cpio.lzma ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 memmap=256M!1G netconsole=6666@192.168.0.2/,6666@192.168.0.1/ 12 | 13 | LABEL reflash 14 | MENU LABEL reflash 15 | kernel http://192.168.0.1/kernel 16 | append initrd=http://192.168.0.1/biguroot.cpio.lzma ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 17 | 18 | LABEL reflashslow 19 | MENU LABEL reflash 20 | kernel kernel 21 | append initrd=/biguroot.cpio.lzma ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 22 | 23 | LABEL cpu 24 | MENU LABEL cpu 25 | kernel http://192.168.0.1/kernel 26 | append initrd=http://192.168.0.1/initramfs.linux_amd64.cpio.lzma ip=dhcp earlyprintk=ttyS0,115200 console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ intel-spi.writeable=1 debug loglevel=8 27 | 28 | -------------------------------------------------------------------------------- /digitalloggers/atomicpi/tftpserve: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo https://wiki.up-community.org/Enable_PXE_boot 5 | sudo netplan apply 6 | ip a 7 | sudo service isc-dhcp-server restart 8 | sudo systemctl restart tftpd-hpa 9 | echo Serving IP4 but you can get ip6 via other means 10 | echo dont forget to get this 11 | echo http://archive.ubuntu.com/ubuntu/dists/trusty/main/uefi/grub2-amd64/current/grubnetx64.efi.signed 12 | 13 | exit 0 14 | mkdir -p /tmp/kea 15 | sudo kea-dhcp6 -d -d -d -c ~/bin/kea6.conf 16 | 17 | 18 | echo sudo tar xvf /mnt/hgfs/rminnich/Downloads/netboot.tar.gz 19 | -------------------------------------------------------------------------------- /hpe/dl360gen10/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR ?= 5 2 | STABLE = $(MAJOR).4 3 | CONFIG ?= $(MAJOR).4.0 4 | KEYPATH ?= "" 5 | 6 | default: build 7 | 8 | build: 9 | echo fetch, uroot, flashkernel, or image.bin 10 | 11 | image.bin: flashkernel 12 | utk \ 13 | -xzPath /usr/bin/xz \ 14 | ROM.bin \ 15 | remove TraceHubStatusCodeHandlerRuntimeDxe \ 16 | remove TraceHubStatusCodeHandlerSmm \ 17 | remove StatusCodeHandlerRuntimeDxeUsb \ 18 | remove DataHubDxe \ 19 | remove HpBootMenuApp \ 20 | remove TxtDxe \ 21 | remove HstiIhvProviderDxe \ 22 | remove LegacyRegion2 \ 23 | remove EbcDxe \ 24 | remove LegacyInterrupt \ 25 | remove PciHotPlug \ 26 | remove HwpLvtSmm \ 27 | remove IsPlatformSupportWhea \ 28 | remove WheaSupport \ 29 | remove WheaErrorInj \ 30 | remove WheaPlatformBoot \ 31 | remove WheaErrorLog \ 32 | remove LastBootErrorLog \ 33 | remove McBankErrorInjection \ 34 | remove OpaPlatCfg \ 35 | remove DataHubStdErrDxe \ 36 | remove HpLogStdErrToMem \ 37 | remove HpBiosLogToAhsDxe \ 38 | remove HpBiosLogToAhsSmm \ 39 | remove ServerConfigLock \ 40 | remove ServerConfigLockDxe \ 41 | remove IntelligentProvisioningApp \ 42 | remove ErrorInformationApp \ 43 | remove ImlViewApp \ 44 | remove EmbeddedDiagsApp \ 45 | remove HpPlotPciRebootTestDriver \ 46 | remove HpNvDimmDxe \ 47 | remove HpNvDimmBlkIoDxe \ 48 | remove NvDimmFwUpdate \ 49 | remove HpType10NvdimmPowerMonitorDxe \ 50 | remove FirmwarePerformanceSmm \ 51 | remove HpType10NvdimmCommonDataDxe \ 52 | remove HpNvDimmMemScan \ 53 | remove HpNvDimmTelemetryDxe \ 54 | remove BackupRestore \ 55 | remove HpBackupRestoreDxe \ 56 | remove HpSecureErase \ 57 | remove HpSecureEraseDxe \ 58 | remove TerminalDxe \ 59 | remove IsaSerialDxe \ 60 | remove LegacyBiosDxe \ 61 | remove HpLegacyBootDxe \ 62 | remove LegacyBiosPlatform \ 63 | remove HpPostCodeWorkerDxe \ 64 | remove HpPostCodeWorkerSmm \ 65 | replace_pe32 Shell flashkernel \ 66 | save image.bin 67 | 68 | flashkernel: uroot injectkeys bzImage 69 | cp linux/arch/x86/boot/bzImage flashkernel 70 | 71 | netboot: netbooturoot bzImage 72 | cp linux/arch/x86/boot/bzImage kernel 73 | 74 | readrom: 75 | echo You need to get a ROM image from *somewhere* 76 | echo Once you do, put it in ROM.bin 77 | 78 | writerom: image.bin 79 | echo Here is where you would do the flashrom, e.g. 80 | echo sudo flashrom -p dediprog -w image.bin 81 | 82 | netbooturoot: 83 | u-root -build=bb -uinitcmd="hostname dl360Gen10" \ 84 | github.com/u-root/u-root/cmds/core/hostname \ 85 | github.com/u-root/u-root/cmds/core/init \ 86 | github.com/u-root/u-root/cmds/core/id \ 87 | github.com/u-root/u-root/cmds/core/cat \ 88 | github.com/u-root/u-root/cmds/core/ls \ 89 | github.com/u-root/u-root/cmds/core/ip \ 90 | github.com/u-root/u-root/cmds/core/elvish \ 91 | github.com/u-root/u-root/cmds/core/sshd \ 92 | github.com/u-root/u-root/cmds/core/scp \ 93 | github.com/u-root/u-root/cmds/core/pci \ 94 | github.com/u-root/u-root/cmds/core/dhclient \ 95 | github.com/u-root/u-root/cmds/core/rsdp \ 96 | github.com/u-root/u-root/cmds/boot/* 97 | 98 | cp /tmp/initramfs.linux_amd64.cpio . 99 | lzma -k -f initramfs.linux_amd64.cpio 100 | ls -l initramfs* 101 | cp *lzma linux/ 102 | 103 | uroot: 104 | u-root -build=bb -uinitcmd="hostname dl360Gen10" \ 105 | github.com/u-root/u-root/cmds/core/hostname \ 106 | github.com/u-root/u-root/cmds/core/dd \ 107 | github.com/u-root/u-root/cmds/core/init \ 108 | github.com/u-root/u-root/cmds/core/id \ 109 | github.com/u-root/u-root/cmds/core/cat \ 110 | github.com/u-root/u-root/cmds/core/ls \ 111 | github.com/u-root/u-root/cmds/core/ip \ 112 | github.com/u-root/u-root/cmds/core/elvish \ 113 | github.com/u-root/u-root/cmds/core/more \ 114 | github.com/u-root/u-root/cmds/core/mount \ 115 | github.com/u-root/u-root/cmds/core/sshd \ 116 | github.com/u-root/u-root/cmds/core/scp \ 117 | github.com/u-root/u-root/cmds/core/dmesg \ 118 | github.com/u-root/u-root/cmds/core/grep \ 119 | github.com/u-root/u-root/cmds/core/pci \ 120 | github.com/u-root/u-root/cmds/core/dhclient \ 121 | github.com/u-root/u-root/cmds/core/rsdp \ 122 | github.com/u-root/u-root/cmds/boot/* 123 | 124 | cp /tmp/initramfs.linux_amd64.cpio . 125 | lzma -k -f initramfs.linux_amd64.cpio 126 | ls -l initramfs* 127 | cp *lzma linux/ 128 | 129 | injectkeys: 130 | ifneq ($(KEYPATH),"") 131 | echo "Executing updateInitramfs script" 132 | $(shell ./updateInitramfs.sh ${KEYPATH}) 133 | endif 134 | 135 | bzImage: 136 | cp config-$(CONFIG) linux/.config 137 | (cd linux && make oldconfig && make -j32) 138 | 139 | fetch: getkernel geturoot getfiano getrom 140 | getkernel: 141 | rm -rf linux 142 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v$(MAJOR).x/linux-$(STABLE).tar.xz 143 | xzcat kernel.xz | tar x 144 | mv linux-$(STABLE) linux 145 | getfiano: 146 | go get -u github.com/linuxboot/fiano/cmds/utk 147 | go install github.com/linuxboot/fiano/cmds/utk 148 | getrom: 149 | @echo If you plan to flash to hardware, 150 | @echo you will need to get a rom imagei 151 | @echo and put it in rom.bin 152 | @echo you can get it via wget, flashrom, whatever. 153 | @echo If you are not targeting hardware, you can 154 | @echo make flashkernel 155 | @echo and run that kernel via qemu 156 | 157 | geturoot: 158 | go get -v -u github.com/u-root/u-root 159 | 160 | -------------------------------------------------------------------------------- /hpe/dl360gen10/README.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 Hewlett Packard Enterprise Development LP. 2 | 3 | Initial support for DL360 Gen 10 4 | Maintainer: jean-marie.verdun@hpe.com / vejmarie 5 | 6 | "Code" inspired from the intel default motherboard 7 | 8 | Can be tested by using the public HPE Continuous Integration platform available at https://osfci.tech 9 | 10 | Feel free to contribute ! 11 | -------------------------------------------------------------------------------- /hpe/dl360gen10/updateInitramfs.sh: -------------------------------------------------------------------------------- 1 | rm -r tmp 2 | mkdir tmp 3 | cp initramfs.linux_amd64.cpio tmp 4 | cd tmp 5 | sudo cpio -idv < initramfs.linux_amd64.cpio 6 | sudo mkdir etc/sshd 7 | cd etc/sshd 8 | sudo ssh-keygen -t rsa -P "$2" -f id_rsa 2>&1 >/dev/null 9 | test -f "$1" && sudo cp $1 authorized_keys 10 | cd ../.. 11 | rm initramfs.linux_amd64.cpio 12 | rm /tmp/initramfs.linux_amd64.cpio 13 | sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | xz -9 --format=lzma > /tmp/initramfs.linux_amd64.cpio.lzma 14 | cd .. 15 | sudo rm -r tmp 16 | cp /tmp/initramfs.linux_amd64.cpio.lzma . 17 | cp *lzma linux 18 | exit 0 19 | -------------------------------------------------------------------------------- /intel/generic/.gitignore: -------------------------------------------------------------------------------- 1 | image.bin 2 | initramfs.linux_amd64.cpio 3 | initramfs.linux_amd64.cpio.lzma 4 | kernel 5 | kernel.xz 6 | linux 7 | *kernel 8 | *cpio 9 | sr630.bin 10 | -------------------------------------------------------------------------------- /intel/generic/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR ?= 5 2 | STABLE = $(MAJOR).4 3 | CONFIG ?= $(MAJOR).4.0 4 | default: build 5 | 6 | build: 7 | echo fetch, uroot, kernel, or image.bin 8 | 9 | image.bin: flashkernel 10 | utk \ 11 | -xzPath /usr/bin/xz \ 12 | ROM.bin \ 13 | remove Ip.* \ 14 | remove Tcp.* \ 15 | remove Usb.* \ 16 | remove Udp.* \ 17 | remove Dhcp.* \ 18 | remove .np.* \ 19 | remove .tftp.* \ 20 | remove Http.* \ 21 | remove .*Dns.* \ 22 | remove Arp.* \ 23 | remove .*NetworkStackSetupScreen.* \ 24 | remove Iscsi.* \ 25 | remove Scsi.* \ 26 | remove Fat.* \ 27 | remove Ahci.* \ 28 | remove Partition.* \ 29 | remove Sata.* \ 30 | remove Disk.* \ 31 | remove Whea.* \ 32 | remove .*Pxe.* \ 33 | remove Ata.* \ 34 | remove AMITSE \ 35 | replace_pe32 FullShell flashkernel \ 36 | save image.bin 37 | 38 | cpukernel: cpu.cpio.lzma cpu.config 39 | cp cpu.config linux/.config 40 | (cd linux && make oldconfig && make -j32) 41 | cp linux/arch/x86/boot/bzImage $@ 42 | # this target builds an initramfs with only one program, the cpu server. 43 | # It depends on the kernel setting the IP address. 44 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 45 | cpu.cpio.lzma: Makefile 46 | u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 47 | -defaultsh="" \ 48 | github.com/u-root/cpu/cmds/cpud 49 | lzma -f -k cpu.cpio 50 | 51 | flashkernel: uroot bzImage 52 | cp linux/arch/x86/boot/bzImage flashkernel 53 | 54 | netboot: netbooturoot bzImage 55 | cp linux/arch/x86/boot/bzImage kernel 56 | 57 | readrom: 58 | echo You need to get a ROM image from *somewhere* 59 | echo Once you do, put it in ROM.bin 60 | 61 | writerom: image.bin 62 | echo Here is where you would do the flashrom, e.g. 63 | echo sudo flashrom -p dediprog -w image.bin 64 | 65 | netbooturoot: 66 | u-root -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp github.com/u-root/u-root/cmds/boot/* 67 | cp /tmp/initramfs.linux_amd64.cpio . 68 | lzma -k -f initramfs.linux_amd64.cpio 69 | ls -l initramfs* 70 | cp *lzma linux 71 | 72 | uroot: 73 | u-root -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/exp/rush github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp 74 | cp /tmp/initramfs.linux_amd64.cpio . 75 | lzma -k -f initramfs.linux_amd64.cpio 76 | ls -l initramfs* 77 | cp *lzma linux 78 | 79 | bzImage: 80 | cp config-$(CONFIG) linux/.config 81 | (cd linux && make oldconfig && make -j32) 82 | 83 | fetch: getkernel geturoot getfiano getrom 84 | getkernel: 85 | rm -rf linux 86 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v$(MAJOR).x/linux-$(STABLE).tar.xz 87 | xzcat kernel.xz | tar x 88 | mv linux-$(STABLE) linux 89 | getfiano: 90 | go get -u github.com/linuxboot/fiano/cmds/utk 91 | go install github.com/linuxboot/fiano/cmds/utk 92 | getrom: 93 | @echo If you plan to flash to hardware, 94 | @echo you will need to get a rom imagei 95 | @echo and put it in rom.bin 96 | @echo you can get it via wget, flashrom, whatever. 97 | @echo If you are not targeting hardware, you can 98 | @echo make flashkernel 99 | @echo and run that kernel via qemu 100 | 101 | geturoot: 102 | go get -u github.com/u-root/u-root 103 | 104 | -------------------------------------------------------------------------------- /intel/hw/.gitignore: -------------------------------------------------------------------------------- 1 | /*.bin 2 | /*.lzma 3 | /*.cpio 4 | /flashkernel 5 | /linux 6 | /bootcmds 7 | /etc 8 | -------------------------------------------------------------------------------- /intel/hw/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make flashpxeboot.bin 13 | # scp -i class_key -P 2022 flashpxeboot.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w flashpxeboot.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make flashpxeboot.bin 23 | # cpu board flashrom -w flashpxeboot.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make flashpxeboot.bin 30 | # flashrom -w flashpxeboot.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # flashpxeboot.bin produces a flash image which will pxeboot. 34 | # cpu.bin produces a flash image that starts a cpu daemon. 35 | # 36 | # You can test the flash image kernel with qemu 37 | # make flashtest 38 | # This now includes a uinit as an example of how to write them. 39 | # We also show an example of using the em100 40 | # 41 | # New to this board class, uniquely, is coreboot support. To use coreboot, 42 | # make coreboot 43 | # To fire up the em100 44 | # make em100 45 | # 46 | # you need to supply the coreboot.rom anda corebootem100.map 47 | default: flash 48 | 49 | coreboot: coreboot2x.rom 50 | 51 | coreboot.rom: corebootflashkernel coreboot.rom 52 | - cbfstool coreboot.rom remove -n fallback/payload 53 | cbfstool coreboot.rom add-payload -n fallback/payload -f corebootflashkernel 54 | 55 | coreboot2x.rom: coreboot.rom 56 | cat coreboot.rom coreboot.rom > coreboot2x.rom 57 | 58 | corebootem100: coreboot 59 | em100 -p float --stop --set MX25L25635F --start -Tt -b -M corebootem100.map -d coreboot2x.rom 60 | 61 | em100: flash 62 | em100 -p float --stop --set MX25L25635F -d flashpxeboot.bin --start 63 | 64 | flash: flashpxeboot.bin 65 | 66 | flashtest: testflashkernel 67 | 68 | usefultargets: 69 | echo fetch, uroot, kernel, or image.bin 70 | 71 | flashpxeboot.bin: dxeremove.bin flashkernel flashinitramfs.cpio.lzma insert.go 72 | utk \ 73 | -xzPath /usr/bin/xz \ 74 | $< \ 75 | replace_pe32 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1 flashkernel \ 76 | save $@ 77 | go run insert.go flashpxeboot.bin flashinitramfs.cpio.lzma 2785280 5603328 78 | 79 | cpu.bin: dxeremove.bin cpuflashkernel cpu.cpio.lzma insert.go 80 | utk \ 81 | -xzPath /usr/bin/xz \ 82 | $< \ 83 | replace_pe32 .*Shell cpuflashkernel \ 84 | save $@ 85 | go run insert.go cpu.bin cpu.cpio.lzma 2785280 5603328 86 | 87 | edk2.bin: dxeremove.bin 88 | echo Note, this inserts the edk2 bds and shell 89 | echo Only flash this image if you have an sf100. 90 | echo It will not be able to boot anything. 91 | utk \ 92 | -xzPath /usr/bin/xz \ 93 | $< \ 94 | insert_dxe edk2bdsdxe.ffs insert_dxe edk2shell.ffs \ 95 | save $@ 96 | 97 | dxeremove.bin: tighten.bin 98 | echo note, we remove DXE to the point the image is not viable 99 | echo until you put a kernel in it in place of the shell. 100 | utk $< \ 101 | remove Ahci.* \ 102 | comment AmiTcgNvflagSample \ 103 | comment AmiTcgPlatformDxe \ 104 | comment AMITSE \ 105 | comment AMITSE.* \ 106 | remove Arp.* \ 107 | remove Ata.* \ 108 | comment Bds \ 109 | comment below_still_unknown \ 110 | remove Button.* \ 111 | comment CrbTpm20Acpi \ 112 | remove CryptoD.* \ 113 | remove .*Dhcp.* \ 114 | remove Dhcp6Dxe \ 115 | remove Disk.* \ 116 | remove EbcDxe \ 117 | remove Fat.* \ 118 | comment FlashDriver_do_not_remove_efi_panics \ 119 | comment FlashDriver_do_not_remove_efi_panics \ 120 | remove .*ftp.* \ 121 | remove .*harging.* \ 122 | remove I2c.* \ 123 | remove IntelGopV.* \ 124 | remove IntelIsh.* \ 125 | remove Ip4.* \ 126 | remove Ip6Dxe \ 127 | remove Iscsi.* \ 128 | remove Ish.* \ 129 | remove .*Keyboard.* \ 130 | comment leavefornow \ 131 | remove Logo.* \ 132 | remove Maxim.* \ 133 | remove Mmc.* \ 134 | remove MnpDxe \ 135 | remove Mouse.* \ 136 | remove Mtftp4Dxe \ 137 | remove Mtftp6Dxe \ 138 | remove NetworkStackSetupScreen \ 139 | remove Partition.* \ 140 | remove .*PxeDxe.* \ 141 | remove RandomNumberGen \ 142 | remove ReFlash \ 143 | comment S3Save_do_not_remove_gets_error \ 144 | comment S3Save_do_not_remove_gets_error \ 145 | comment S3Save_do_not_remove_gets_error \ 146 | remove Sata.* \ 147 | remove Scsi.* \ 148 | remove SnpDxe \ 149 | remove SoftKbd \ 150 | comment Tcg2Dxe \ 151 | comment TcgDxe \ 152 | comment TcgDxeplatform \ 153 | comment TcgMor \ 154 | comment TcgPlatformSetupPolicy \ 155 | comment TcgSmm \ 156 | remove Tcp.* \ 157 | remove TcpDxe \ 158 | comment testremove \ 159 | comment testremove \ 160 | remove TimestampDxe \ 161 | comment Tpm20PlatformDxe \ 162 | remove Udp.* \ 163 | remove Udp4.* \ 164 | remove Udp6Dxe \ 165 | remove UefiPxe.* \ 166 | remove Uhcd \ 167 | remove Usb.* \ 168 | remove Whea.* \ 169 | remove Xpower.* \ 170 | save $@ 171 | chmod a-w $@ 172 | 173 | hap.bin: tighten.bin 174 | cp $< $@ 175 | me_cleaner.py -s $@ 176 | chmod a-w $@ 177 | 178 | tighten.bin: image.bin 179 | utk $< tighten_me save $@ 180 | 181 | sshdkernel: sshd.cpio.lzma sshd.config 182 | cp sshd.config linux/.config 183 | (cd linux && make oldconfig && make -j32) 184 | cp linux/arch/x86/boot/bzImage $@ 185 | 186 | cpukernel: cpu.cpio.lzma cpu.config 187 | cp cpu.config linux/.config 188 | (cd linux && make oldconfig && make -j32) 189 | cp linux/arch/x86/boot/bzImage $@ 190 | 191 | cpuflashkernel: cpu.cpio.lzma cpuflash.config 192 | cp cpuflash.config linux/.config 193 | (cd linux && make oldconfig && make -j32) 194 | cp linux/arch/x86/boot/bzImage $@ 195 | 196 | readrom: 197 | echo You need to get a ROM image from *somewhere* 198 | echo Once you do, put it in ROM.bin 199 | 200 | writerom: image.bin 201 | echo Here is where you would do the flashrom, e.g. 202 | echo sudo flashrom -p dediprog -w image.bin 203 | 204 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 205 | lzma -f -k $< 206 | 207 | flashinitramfs.cpio: Makefile src/uinit/main.go bootcmds 208 | GOPATH=`go env GOPATH`:$(PWD) u-root -o $@ -build=bb \ 209 | -files bootcmds \ 210 | -files etc \ 211 | -files ~/.ssh/cpu_rsa.pub:key.pub \ 212 | uinit \ 213 | github.com/u-root/u-root/cmds/boot/boot \ 214 | github.com/u-root/u-root/cmds/boot/fbnetboot \ 215 | github.com/u-root/u-root/cmds/boot/fitboot \ 216 | github.com/u-root/u-root/cmds/boot/pxeboot \ 217 | github.com/u-root/u-root/cmds/core/cat \ 218 | github.com/u-root/u-root/cmds/core/cp \ 219 | github.com/u-root/u-root/cmds/core/dhclient \ 220 | github.com/u-root/u-root/cmds/core/echo \ 221 | github.com/u-root/u-root/cmds/core/elvish \ 222 | github.com/u-root/u-root/cmds/core/init \ 223 | github.com/u-root/u-root/cmds/core/ip \ 224 | github.com/u-root/u-root/cmds/core/ls \ 225 | github.com/u-root/u-root/cmds/core/kexec \ 226 | github.com/u-root/u-root/cmds/core/mkdir \ 227 | github.com/u-root/u-root/cmds/core/mount \ 228 | github.com/u-root/u-root/cmds/core/unmount \ 229 | github.com/u-root/u-root/cmds/core/pci \ 230 | github.com/u-root/u-root/cmds/exp/fixrsdp \ 231 | github.com/u-root/cpu/cmds/cpud 232 | 233 | cbinitramfs.cpio.lzma: cbinitramfs.cpio 234 | lzma -f -k $< 235 | 236 | cbinitramfs.cpio: Makefile src/uinit/main.go bootcmds 237 | GOPATH=`go env GOPATH`:$(PWD) u-root -o $@ -build=bb \ 238 | uinit \ 239 | github.com/u-root/u-root/cmds/boot/boot \ 240 | github.com/u-root/u-root/cmds/boot/fitboot \ 241 | github.com/u-root/u-root/cmds/core/cat \ 242 | github.com/u-root/u-root/cmds/core/cp \ 243 | github.com/u-root/u-root/cmds/core/dhclient \ 244 | github.com/u-root/u-root/cmds/core/echo \ 245 | github.com/u-root/u-root/cmds/core/elvish \ 246 | github.com/u-root/u-root/cmds/core/init \ 247 | github.com/u-root/u-root/cmds/core/ip \ 248 | github.com/u-root/u-root/cmds/core/ls \ 249 | github.com/u-root/u-root/cmds/core/kexec \ 250 | github.com/u-root/u-root/cmds/core/mkdir \ 251 | github.com/u-root/u-root/cmds/core/mount \ 252 | github.com/u-root/u-root/cmds/core/unmount \ 253 | github.com/u-root/u-root/cmds/core/pci \ 254 | github.com/u-root/u-root/cmds/exp/fixrsdp \ 255 | 256 | # this target builds an initramfs with only one program, the cpu server. 257 | # It depends on the kernel setting the IP address. 258 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 259 | cpu.cpio.lzma: Makefile 260 | u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 261 | -defaultsh="" \ 262 | github.com/u-root/cpu/cmds/cpud 263 | lzma -f -k cpu.cpio 264 | 265 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 266 | # the intent is to demonstrate the capability of http loading. 267 | # It depends on the kernel setting the IP address. 268 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 269 | sshd.cpio.lzma: Makefile 270 | u-root -o sshd.cpio -build=bb \ 271 | -uinitcmd=/bbin/sshd \ 272 | -files class_key.pub:authorized_keys \ 273 | -files classhostkey:id_rsa \ 274 | -files /usr/bin/vi \ 275 | -files /usr/share/vim \ 276 | -files /usr/share/terminfo \ 277 | -files /bin/bash \ 278 | -files /usr/sbin/flashrom \ 279 | -files /usr/bin/xz \ 280 | all 281 | lzma -f -k sshd.cpio 282 | ls -l sshd.cpio.* 283 | 284 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 285 | cp $< linux/.config 286 | (cd linux && make oldconfig && make -j32) 287 | cp linux/arch/x86/boot/bzImage $@ 288 | 289 | corebootflashkernel: corebootflash.config flashinitramfs.cpio.lzma Makefile 290 | cp $< linux/.config 291 | (cd linux && make oldconfig && make -j32) 292 | cp linux/arch/x86/boot/bzImage $@ 293 | 294 | testflashkernel: flashkernel 295 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 296 | 297 | testcpukernel: cpukernel 298 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 299 | 300 | # These stanzas fetch code. 301 | fetch: getkernel geturoot getfiano getrom 302 | touch bootcmds 303 | 304 | getkernel: 305 | rm -rf linux 306 | git clone --depth=1 -b v5.8 --single-branch https://github.com/torvalds/linux 307 | 308 | getfiano: 309 | go get -u github.com/linuxboot/fiano/cmds/utk 310 | go install github.com/linuxboot/fiano/cmds/utk 311 | go install github.com/linuxboot/fiano/cmds/guid2english 312 | getrom: 313 | echo you can put a wget here 314 | echo and unzip it 315 | echo and cp it to image.bin 316 | geturoot: 317 | go get -u github.com/u-root/u-root 318 | go get -u github.com/u-root/cpu/... 319 | 320 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 321 | sshd-pxeserver: 322 | echo Consider Disabling any system services ... 323 | echo e.g. sudo systemctl stop tftpd-hpa.service 324 | echo e.g. sudo systemctl stop isc-dhcp-server 325 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 326 | 327 | # Serve the combined cpu-kernel and cpu-initramfs image. 328 | cpu-pxeserver: 329 | echo Consider Disabling any system services ... 330 | echo e.g. sudo systemctl stop tftpd-hpa.service 331 | echo e.g. sudo systemctl stop isc-dhcp-server 332 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 333 | 334 | ssh: 335 | ssh -i class_key -p 2022 root@up 336 | -------------------------------------------------------------------------------- /intel/hw/etc/README: -------------------------------------------------------------------------------- 1 | Add files to this directory which you wish included in 2 | the ROM image. Such files might include utilities 3 | such as Intel's NIC utilities. 4 | -------------------------------------------------------------------------------- /intel/hw/insert.go: -------------------------------------------------------------------------------- 1 | // insert an initramfs, checking sizes. 2 | 3 | package main 4 | 5 | import ( 6 | "io/ioutil" 7 | "log" 8 | "os" 9 | "strconv" 10 | ) 11 | 12 | func main() { 13 | // Arguments are simple: 14 | // image file 15 | // initramfs file 16 | // offset in target 17 | // size limit 18 | if len(os.Args) != 5 { 19 | log.Fatalf("Usage: %s image initramfs offset max-allowed-initramfs-size", os.Args[0]) 20 | } 21 | 22 | image, initramfs, offset, size := os.Args[1], os.Args[2], os.Args[3], os.Args[4] 23 | 24 | img, err := ioutil.ReadFile(image) 25 | if err != nil { 26 | log.Fatal(err) 27 | } 28 | ramfs, err := ioutil.ReadFile(initramfs) 29 | if err != nil { 30 | log.Fatal(err) 31 | } 32 | off, err := strconv.ParseUint(offset, 0, 24) 33 | if err != nil { 34 | log.Fatal(err) 35 | } 36 | sz, err := strconv.ParseUint(size, 0, 24) 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | 41 | if uint64(len(ramfs)) > sz { 42 | log.Fatalf("Size of %q (%d) > allowed size (%d)", initramfs, len(ramfs), sz) 43 | } 44 | if off > uint64(len(img)) { 45 | log.Fatal("Off (%d) is > image size (%d)", off, len(img)) 46 | } 47 | if off+sz > uint64(len(img)) { 48 | log.Fatal("Off (%d) is > image size (%d)", off, len(img)) 49 | } 50 | 51 | copy(img[off:], ramfs[:]) 52 | log.Printf("Inserted %q, %d bytes actual size, with max allowed size of %d, at offset %d bytes, into %q, %d bytes", 53 | initramfs, len(ramfs), sz, off, image, len(img)) 54 | if err := ioutil.WriteFile(image, img, 0666); err != nil { 55 | log.Fatal(err) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /intel/hw/src/uinit/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This is an example uinit for a board which has special requirements. 6 | // First, it fixes the RSDP so that it will be found by whatever 7 | // kernel comes next. Next, it mounts in this case (e.g.) /dev/sda5. 8 | // Finally, it reads /bootcmds, a file which contains 0 or more 9 | // commands, one per line. 10 | // debug prints are on by default but can be turned off via 11 | // -d=false 12 | // The location of the command file is controlled by -cmd switch. 13 | package main 14 | 15 | import ( 16 | "flag" 17 | "io/ioutil" 18 | "log" 19 | "os" 20 | "os/exec" 21 | "strings" 22 | "time" 23 | 24 | "github.com/u-root/u-root/pkg/shlex" 25 | ) 26 | 27 | var ( 28 | bootcmd = flag.String("bootcmd", "/bootcmds", "File containing boot command line") 29 | debug = flag.Bool("d", true, "Print debug statement") 30 | v = func(string, ...interface{}) {} 31 | ) 32 | 33 | func main() { 34 | flag.Parse() 35 | if *debug { 36 | v = log.Printf 37 | } 38 | var bootcmds = []*exec.Cmd{ 39 | exec.Command("fixrsdp"), 40 | exec.Command("mount", "/dev/sda6", "/mnt"), 41 | } 42 | 43 | for _, c := range bootcmds { 44 | v("Run %v", c) 45 | c.Stdout, c.Stderr = os.Stdout, os.Stderr 46 | if err := c.Run(); err != nil { 47 | log.Printf("cmd '%q' fails: %v", c, err) 48 | } 49 | } 50 | 51 | log.Print("-----> Hit ^C within 10 seconds to stop booting") 52 | time.Sleep(10 * time.Second) 53 | if cmds, err := ioutil.ReadFile(*bootcmd); err != nil { 54 | log.Printf("Can not open %q: %v; will not attempt to boot", *bootcmd, err) 55 | } else { 56 | bootcmds = []*exec.Cmd{} 57 | lines := strings.Split(string(cmds), "\n") 58 | for _, l := range lines { 59 | if len(l) == 0 { 60 | break 61 | } 62 | f := shlex.Argv(l) 63 | var args []string 64 | if len(f) > 1 { 65 | args = f[1:] 66 | } 67 | v("Add command %q %q", f[0], args) 68 | bootcmds = append(bootcmds, exec.Command(f[0], args...)) 69 | } 70 | } 71 | for _, c := range bootcmds { 72 | v("Run %v", c) 73 | c.Stdout, c.Stderr = os.Stdout, os.Stderr 74 | if err := c.Run(); err != nil { 75 | log.Fatalf("cmd '%q' fails: %v", c, err) 76 | } 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /intel/minplatform/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, flashkernel, testflashkernel and housekeeping 5 | 6 | flashkernel: linuxboot-linux.tiny.config flashinitramfs.cpio.lzma Makefile 7 | cp $< linux/.config 8 | cp flashinitramfs.cpio.lzma linux/ 9 | echo CONFIG_CMDLINE_BOOL=y >> linux/.config 10 | echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 11 | stat -c 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200"' flashinitramfs.cpio.lzma >> linux/.config 12 | (cd linux && make oldconfig && make -j32) 13 | cp linux/arch/x86/boot/bzImage $@ 14 | 15 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 16 | lzma -f -k $< 17 | 18 | flashinitramfs.cpio: Makefile 19 | go run github.com/u-root/u-root -o $@ -build=bb \ 20 | -uinitcmd=/bbin/console \ 21 | github.com/u-root/u-root/cmds/boot/pxeboot \ 22 | github.com/u-root/u-root/cmds/core/cat \ 23 | github.com/u-root/u-root/cmds/core/elvish \ 24 | github.com/u-root/u-root/cmds/core/init \ 25 | github.com/u-root/u-root/cmds/core/ip \ 26 | github.com/u-root/u-root/cmds/core/ls \ 27 | github.com/u-root/u-root/cmds/core/kexec \ 28 | github.com/u-root/u-root/cmds/core/pci \ 29 | github.com/u-root/u-root/cmds/core/wget \ 30 | github.com/u-root/u-root/cmds/exp/console \ 31 | 32 | fetch: getkernel geturoot getfiano 33 | 34 | getkernel: 35 | rm -rf linux 36 | git clone --depth=1 -b working_hack --single-branch https://github.com/linuxboot/linux 37 | 38 | getfiano: 39 | go get -u github.com/linuxboot/fiano/cmds/utk 40 | go install github.com/linuxboot/fiano/cmds/utk 41 | go install github.com/linuxboot/fiano/cmds/guid2english 42 | 43 | geturoot: 44 | go get -u github.com/u-root/u-root 45 | go get -u github.com/u-root/cpu/... 46 | 47 | testflashkernel: flashkernel 48 | echo ^C will exit qemu! be careful! 49 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma -monitor /dev/null 50 | 51 | housekeeping: 52 | rm -rf flashinitramfs.cpio \ 53 | flashinitramfs.cpio.lzma \ 54 | flashkernel \ 55 | 56 | -------------------------------------------------------------------------------- /intel/s2600/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i ../../class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i ../../class_key -P 2022 board:/image.bin image.bin 12 | # make tiny.bin 13 | # scp -i ../../class_key -P 2022 tiny.bin board:/tiny.bin 14 | # ssh -i ../../class_key -p 2022 board flashrom -w tiny.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make tiny.bin 23 | # cpu board flashrom -w tiny.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make tiny.bin 30 | # flashrom -w tiny.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # You can test the flash image kernel with qemu 34 | # make flashtest 35 | GO_PATH := $(shell go env GOPATH) 36 | 37 | default: sshdkernel flash cpukernel 38 | 39 | flash: tiny.bin 40 | 41 | flashtest: testflashkernel 42 | 43 | usefultargets: 44 | echo fetch, uroot, kernel, or image.bin 45 | 46 | tiny.bin: dxeremove.bin flashkernel flashinitramfs.cpio.lzma 47 | utk \ 48 | -xzPath /usr/bin/xz \ 49 | $< \ 50 | replace_pe32 Shell flashkernel \ 51 | save $@ 52 | dd if=flashinitramfs.cpio.lzma of=$@ bs=4096 seek=360 conv=notrunc 53 | 54 | dxeremove.bin: hap.bin 55 | echo note, we remove DXE to the point the image is not viable 56 | echo until you put a kernel in it in place of the shell. 57 | utk $< \ 58 | comment FlashDriver_do_not_remove_efi_panics \ 59 | comment S3Save_do_not_remove_gets_error \ 60 | comment testremove \ 61 | comment FlashDriver_do_not_remove_efi_panics \ 62 | comment S3Save_do_not_remove_gets_error \ 63 | comment testremove \ 64 | remove Ahci.* \ 65 | remove AMITSE \ 66 | remove AMITSE.* \ 67 | remove Arp.* \ 68 | remove Ata.* \ 69 | remove Bds \ 70 | remove Button.* \ 71 | remove CryptoD.* \ 72 | remove .*Dhcp.* \ 73 | remove Dhcp6Dxe \ 74 | remove Disk.* \ 75 | remove EbcDxe \ 76 | remove Fat.* \ 77 | remove .*ftp.* \ 78 | remove .*harging.* \ 79 | remove I2c.* \ 80 | remove IntelGopV.* \ 81 | remove IntelIsh.* \ 82 | remove Ip4.* \ 83 | remove Ip6Dxe \ 84 | remove Iscsi.* \ 85 | remove Ish.* \ 86 | remove .*Keyboard.* \ 87 | remove Logo.* \ 88 | remove Maxim.* \ 89 | remove Mmc.* \ 90 | remove MnpDxe \ 91 | remove Mouse.* \ 92 | remove Mtftp4Dxe \ 93 | remove Mtftp6Dxe \ 94 | remove NetworkStackSetupScreen \ 95 | remove Partition.* \ 96 | remove .*PxeDxe.* \ 97 | remove RandomNumberGen \ 98 | remove ReFlash \ 99 | remove Sata.* \ 100 | remove Scsi.* \ 101 | remove SnpDxe \ 102 | remove SoftKbd \ 103 | remove Tcp.* \ 104 | remove TcpDxe \ 105 | remove TimestampDxe \ 106 | remove Udp.* \ 107 | remove Udp4.* \ 108 | remove Udp6Dxe \ 109 | remove UefiPxe.* \ 110 | remove Uhcd \ 111 | remove Usb.* \ 112 | remove Whea.* \ 113 | remove Xpower.* \ 114 | comment S3Save_do_not_remove_gets_error \ 115 | comment below_still_unknown \ 116 | comment TcgMor \ 117 | comment AmiTcgNvflagSample \ 118 | comment AmiTcgPlatformDxe \ 119 | comment TcgDxeplatform \ 120 | comment Tpm20PlatformDxe \ 121 | comment CrbTpm20Acpi \ 122 | comment TcgSmm \ 123 | comment TcgDxe \ 124 | comment Tcg2Dxe \ 125 | comment TcgPlatformSetupPolicy \ 126 | save $@ 127 | chmod a-w $@ 128 | 129 | hap.bin: image.bin 130 | cp $< $@ 131 | me_cleaner.py -s $@ 132 | chmod a-w $@ 133 | 134 | tighten.bin: image.bin 135 | utk $< tighten_me save $@ 136 | 137 | sshdkernel: sshd.cpio.lzma netbootkernel.config 138 | cp netbootkernel.config linux/.config 139 | (cd linux && make oldconfig && make -j32) 140 | cp linux/arch/x86/boot/bzImage $@ 141 | 142 | # at the moment, the kernel used for the cpu command and the sshdkernel 143 | # are the same. 144 | cpukernel: sshdkernel 145 | cp sshdkernel $@ 146 | 147 | readrom: 148 | echo You need to get a ROM image from *somewhere* 149 | echo Once you do, put it in ROM.bin 150 | 151 | writerom: image.bin 152 | echo Here is where you would do the flashrom, e.g. 153 | echo sudo flashrom -p dediprog -w image.bin 154 | 155 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 156 | lzma -f -k $< 157 | 158 | flashinitramfs.cpio: Makefile 159 | go run $(value GO_PATH)/src/github.com/u-root/u-root -o $@ -build=bb \ 160 | -uinitcmd=/bbin/pxeboot \ 161 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/boot/pxeboot \ 162 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/cat \ 163 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/elvish \ 164 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/init \ 165 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/ip \ 166 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/ls \ 167 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/kexec \ 168 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/pci \ 169 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/wget \ 170 | 171 | # this target builds an initramfs with only one program, the cpu server. 172 | # It depends on the kernel setting the IP address. 173 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 174 | cpu.cpio.lzma: Makefile 175 | go run $(value GO_PATH)/u-root/u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 176 | -defaultsh="" \ 177 | $(value GO_PATH)/u-root/cpu/cmds/cpud 178 | lzma -f -k cpu.cpio 179 | 180 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 181 | # the intent is to demonstrate the capability of http loading. 182 | # It depends on the kernel setting the IP address. 183 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 184 | sshd.cpio.lzma: Makefile 185 | go run $(value GO_PATH)/u-root/u-root -o sshd.cpio -build=bb \ 186 | -uinitcmd=/bbin/sshd \ 187 | -files ../../class_key.pub:authorized_keys \ 188 | -files ../../classhostkey:id_rsa \ 189 | -files /usr/bin/vi \ 190 | -files /usr/share/vim \ 191 | -files /usr/share/terminfo \ 192 | -files /bin/bash \ 193 | -files /usr/sbin/flashrom \ 194 | -files /usr/bin/xz \ 195 | all 196 | lzma -f -k sshd.cpio 197 | ls -l sshd.cpio.* 198 | 199 | flashkernel: linuxboot-linux.tiny.config flashinitramfs.cpio.lzma Makefile 200 | cp $< linux/.config 201 | echo CONFIG_CMDLINE_BOOL=y >> linux/.config 202 | echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 203 | stat -c 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200 netconsole=6666@192.168.0.2/,6666@192.168.0.1/ initrd=0xff968000,%s"' flashinitramfs.cpio.lzma >> linux/.config 204 | (cd linux && make oldconfig && make -j32) 205 | cp linux/arch/x86/boot/bzImage $@ 206 | 207 | testflashkernel: flashkernel 208 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 209 | 210 | # These stanzas fetch code. 211 | fetch: getkernel geturoot getfiano getrom 212 | 213 | getkernel: 214 | rm -rf linux 215 | git clone --depth=1 -b v5.8 https://github.com/torvalds/linux 216 | 217 | getfiano: 218 | go get -u github.com/linuxboot/fiano/cmds/utk 219 | go install github.com/linuxboot/fiano/cmds/utk 220 | go install github.com/linuxboot/fiano/cmds/guid2english 221 | getrom: 222 | echo you can put a wget here 223 | echo and unxip it 224 | echo and cp it to image.bin 225 | geturoot: 226 | go get -u github.com/u-root/u-root 227 | # go get -u github.com/u-root/cpu/... 228 | 229 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 230 | sshd-pxeserver: 231 | echo Consider Disabling any system services ... 232 | echo e.g. sudo systemctl stop tftpd-hpa.service 233 | echo e.g. sudo systemctl stop isc-dhcp-server 234 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 235 | 236 | # Serve the combined cpu-kernel and cpu-initramfs image. 237 | cpu-pxeserver: 238 | echo Consider Disabling any system services ... 239 | echo e.g. sudo systemctl stop tftpd-hpa.service 240 | echo e.g. sudo systemctl stop isc-dhcp-server 241 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 242 | ssh: 243 | ssh -i class_key -p 2022 root@up 244 | -------------------------------------------------------------------------------- /lenovo/hr630/.gitignore: -------------------------------------------------------------------------------- 1 | image.bin 2 | initramfs.linux_amd64.cpio 3 | initramfs.linux_amd64.cpio.lzma 4 | kernel 5 | kernel.xz 6 | linux 7 | sr630.bin 8 | -------------------------------------------------------------------------------- /lenovo/hr630/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, uroot, flashkernel, or image.bin 5 | 6 | image.bin: flashkernel 7 | utk \ 8 | -xzPath /usr/bin/xz \ 9 | sr630.bin \ 10 | remove Ip.* \ 11 | remove Tcp.* \ 12 | remove Usb.* \ 13 | remove Udp.* \ 14 | remove Dhcp.* \ 15 | remove .np.* \ 16 | remove .tftp.* \ 17 | remove Http.* \ 18 | remove .*Dns.* \ 19 | remove Arp.* \ 20 | remove .*NetworkStackSetupScreen.* \ 21 | remove Iscsi.* \ 22 | remove Scsi.* \ 23 | remove Fat.* \ 24 | remove Ahci.* \ 25 | remove Partition.* \ 26 | remove Sata.* \ 27 | remove Disk.* \ 28 | remove Whea.* \ 29 | remove .*Pxe.* \ 30 | remove Ata.* \ 31 | remove AMITSE \ 32 | replace_pe32 FullShell flashkernel \ 33 | save image.bin 34 | 35 | flashkernel: uroot bzImage 36 | cp linux/arch/x86/boot/bzImage flashkernel 37 | 38 | readrom: 39 | echo note: for this to work you need to plug in power 40 | echo also .... flashrom will not work you need sf100 on windows 41 | sudo flashrom -p dediprog -r sr630.bin 42 | 43 | writerom: image.bin 44 | sudo flashrom -p dediprog -w sr630.bin 45 | 46 | uroot: 47 | go run github.com/u-root/u-root -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/exp/rush github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp 48 | cp /tmp/initramfs.linux_amd64.cpio . 49 | lzma -k -f initramfs.linux_amd64.cpio 50 | ls -l initramfs* 51 | cp *lzma linux 52 | 53 | bzImage: 54 | cp config-4.14.111 linux/.config 55 | (cd linux && make oldconfig && make -j32) 56 | 57 | fetch: getkernel geturoot getfiano getrom 58 | getkernel: 59 | rm -rf linux 60 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 61 | xzcat kernel.xz | tar x 62 | mv linux-4.14.111 linux 63 | getfiano: 64 | go get -u github.com/linuxboot/fiano/cmds/utk 65 | go install github.com/linuxboot/fiano/cmds/utk 66 | getrom: 67 | echo you can put a wget here 68 | echo and unxip it 69 | echo and cp it to sr630.bin 70 | geturoot: 71 | go get -u github.com/u-root/u-root 72 | 73 | # everything from here below was part of an experiment and can be ignored. 74 | experiment: 75 | echo b to build, i for initramfs, q for qemu, d to dxeclean 76 | 77 | b: buildbzimage 78 | 79 | d: 80 | ForthUTK sr630.bin fv 'AMITSE|Ata.*|Disk.*|.*Ftp.*|.*Dhcp.*|Tcp.*|.*Pxe.*|.*Udp.*' ix r r tag /tmp/x saverom /tmp/x fv linux/arch/x86/boot/bzImage splat drop /tmp/x saverom ./DXECLEANER clean 81 | 82 | d98: 83 | ForthUTK 98.splat fv ./DXECLEANER clean 84 | 85 | d4: 86 | ForthUTK RUN4.4.rom fv ./DXECLEANER clean 87 | 88 | buildbzimage: 89 | (cd linux && make -j32 && ls -l arch/x86/boot/bzImage) 90 | 91 | i: 92 | (cd ~/go/src/github.com/linuxboot/dut/uinit/&&go build) 93 | cp ~/go/src/github.com/linuxboot/dut/uinit/uinit . 94 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files id_rsa.pub github.com/linuxboot/dut/uinit github.com/u-root/u-root/cmds/init github.com/u-root/u-root/xcmds/rush github.com/u-root/u-root/cmds/ls github.com/u-root/u-root/cmds/ip github.com/u-root/u-root/cmds/elvish github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/cmds/scp 95 | cp /tmp/initramfs.linux_amd64.cpio . 96 | lzma -k -f initramfs.linux_amd64.cpio 97 | ls -l initramfs* 98 | cp *lzma linux 99 | 100 | burn: bigi b 101 | ForthUTK remove100.rom fv linux/arch/x86/boot/bzImage splat remove100big.rom saverom < /dev/null 102 | ./BURN remove100big.rom 103 | 104 | bigi: 105 | (cd ~/go/src/github.com/linuxboot/dut/uinit/&&go build) 106 | cp ~/go/src/github.com/linuxboot/dut/uinit/uinit . 107 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files key.pub minimal github.com/linuxboot/dut/uinit github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/xcmds/pox github.com/u-root/u-root/cmds/scp github.com/u-root/u-root/cmds/cpio 108 | cp /tmp/initramfs.linux_amd64.cpio . 109 | lzma -k -f initramfs.linux_amd64.cpio 110 | ls -l initramfs* 111 | cp *lzma linux 112 | 113 | cleanme: 114 | utk dxeclean.bin dxecleaner_blacklist ./DXECLEANER ./blacklist 115 | 116 | q: 117 | /usr/bin/qemu-system-x86_64 -kernel linux/arch/x86/boot/bzImage -serial stdio -monitor /dev/null -m 8192 -nographic 118 | findit: 119 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated ' < xxx 120 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated[1] | [.Value.Name]'< xxx 121 | 122 | all: 123 | utk sr630.bin \ 124 | remove Ip.* \ 125 | remove Tcp.* \ 126 | remove Usb.* \ 127 | remove Udp.* \ 128 | remove Dhcp.* \ 129 | remove .np.* \ 130 | remove .tftp.* \ 131 | remove Http.* \ 132 | remove .*Dns.* \ 133 | remove Arp.* \ 134 | remove .*NetworkStackSetupScreen.* \ 135 | remove Iscsi.* \ 136 | remove Scsi.* \ 137 | remove Fat.* \ 138 | remove Ahci.* \ 139 | remove Partition.* \ 140 | remove Sata.* \ 141 | remove Disk.* \ 142 | remove Whea.* \ 143 | remove .*Pxe.* \ 144 | remove Ata.* \ 145 | replace_pe32 FullShell bzImage \ 146 | save x.bin \ 147 | remove .*Ipmi.* \ 148 | save ipmisucks.bin \ 149 | remove DxeIpmiBmcInitialize \ 150 | remove SmmBmcElog \ 151 | remove BmcAcpi \ 152 | remove SmmIpmiBmcInitialize \ 153 | remove BmcElog \ 154 | remove BmcLanConfig \ 155 | save removeBMCcrap.bin \ 156 | remove SecurityStubDxe \ 157 | save removesomecrap.bin \ 158 | comment TimestampDxe \ 159 | comment Legacy8259 \ 160 | comment HiiDatabase \ 161 | comment DataHubDxe \ 162 | comment EnglishDxe \ 163 | comment here \ 164 | comment PcRtc \ 165 | comment FpgaDxe \ 166 | comment LegacyInterrupt \ 167 | comment SmartTimer \ 168 | comment LegacySredir \ 169 | comment LegacyRegion2 \ 170 | comment TcgLegacy \ 171 | comment LegacySmmSredir \ 172 | comment DevicePathDxe \ 173 | comment CpuIo2Dxe \ 174 | comment CpuMpDxe \ 175 | comment SmmAccess \ 176 | comment WdtDxe \ 177 | save commentmorecrap.bin \ 178 | comment SetupConfigUpdateDxeNeonCityEPRP \ 179 | comment StaticSkuDataDxeNeonCityEPRP \ 180 | comment OpromUpdateDxeNeonCityEPRP \ 181 | comment SmbiosDataUpdateDxeNeonCityEPRP \ 182 | comment IioCfgUpdateDxeNeonCityEPRP \ 183 | comment SlotDataUpdateDxeNeonCityEPRP \ 184 | comment SetupConfigUpdateDxeLightningRidgeEXRP \ 185 | comment StaticSkuDataDxeLightningRidgeEXRP \ 186 | comment OpromUpdateDxeLightningRidgeEXRP \ 187 | comment SmbiosDataUpdateDxeLightningRidgeEXRP \ 188 | comment IioCfgUpdateDxeLightningRidgeEXRP \ 189 | comment SlotDataUpdateDxeLightningRidgeEXRP \ 190 | comment OpromUpdateDxeNeonCityFPGA \ 191 | comment SetupConfigUpdateDxeNeonCityFPGA \ 192 | comment SmbiosDataUpdateDxeNeonCityFPGA \ 193 | comment StaticSkuDataDxeNeonCityFPGA \ 194 | comment IioCfgUpdateDxeNeonCityFPGA \ 195 | comment SlotDataUpdateDxeNeonCityFPGA \ 196 | comment FpgaConfigDataDxeNeonCityFPGA \ 197 | comment IioCfgUpdateDxeLightningRidgeEXECB1 \ 198 | comment OpromUpdateDxeLightningRidgeEXECB1 \ 199 | comment SetupConfigUpdateDxeLightningRidgeEXECB1 \ 200 | comment SlotDataUpdateDxeLightningRidgeEXECB1 \ 201 | comment SmbiosDataUpdateDxeLightningRidgeEXECB1 \ 202 | comment StaticSkuDataDxeLightningRidgeEXECB1 \ 203 | comment IioCfgUpdateDxeLightningRidgeEXECB2 \ 204 | comment OpromUpdateDxeLightningRidgeEXECB2 \ 205 | comment SetupConfigUpdateDxeLightningRidgeEXECB2 \ 206 | comment SlotDataUpdateDxeLightningRidgeEXECB2 \ 207 | comment SmbiosDataUpdateDxeLightningRidgeEXECB2 \ 208 | comment StaticSkuDataDxeLightningRidgeEXECB2 \ 209 | comment IioCfgUpdateDxeLightningRidgeEXECB3 \ 210 | comment OpromUpdateDxeLightningRidgeEXECB3 \ 211 | comment SetupConfigUpdateDxeLightningRidgeEXECB3 \ 212 | comment SlotDataUpdateDxeLightningRidgeEXECB3 \ 213 | comment SmbiosDataUpdateDxeLightningRidgeEXECB3 \ 214 | comment StaticSkuDataDxeLightningRidgeEXECB3 \ 215 | comment IioCfgUpdateDxeLightningRidgeEXECB4 \ 216 | comment OpromUpdateDxeLightningRidgeEXECB4 \ 217 | comment SetupConfigUpdateDxeLightningRidgeEXECB4 \ 218 | comment SlotDataUpdateDxeLightningRidgeEXECB4 \ 219 | comment SmbiosDataUpdateDxeLightningRidgeEXECB4 \ 220 | comment StaticSkuDataDxeLightningRidgeEXECB4 \ 221 | comment IioCfgUpdateDxeNeonCityEPECB \ 222 | comment OpromUpdateDxeNeonCityEPECB \ 223 | comment SetupConfigUpdateDxeNeonCityEPECB \ 224 | comment SlotDataUpdateDxeNeonCityEPECB \ 225 | comment SmbiosDataUpdateDxeNeonCityEPECB \ 226 | comment StaticSkuDataDxeNeonCityEPECB \ 227 | save commentsetupcrap.bin \ 228 | comment PchSerialGpio \ 229 | comment PchSmbusDxe \ 230 | comment IioInit \ 231 | comment PpmInitialize \ 232 | comment CpuArchDxe \ 233 | comment PchInitDxe \ 234 | comment start_dxecleaner \ 235 | remove AB7ED12E-1D78-4635-AB87-23F00A911EC7 \ 236 | save fail.bin \ 237 | comment HeciInitDxe \ 238 | comment SpsDxe \ 239 | comment SpsSmm \ 240 | comment Aint13 \ 241 | comment Setup \ 242 | comment ServerMgmtSetup \ 243 | comment ACPI \ 244 | comment S3SaveStateDxe \ 245 | comment BootScriptExecutorDxe \ 246 | comment SioDxeInit \ 247 | comment OA3 \ 248 | comment OptionRomPolicy \ 249 | comment PciRootBridge \ 250 | comment PciDxeInit \ 251 | comment PciOutOfResourceSetupPage \ 252 | comment RuntimeMemoryHoleVar \ 253 | comment ExportHiiDb \ 254 | comment DpcDxe \ 255 | comment AmiBoardInfo2 \ 256 | comment ReFlash \ 257 | comment CsmDxe \ 258 | comment UbaConfigDatabaseDxe \ 259 | comment HardwareSignatureEntry \ 260 | comment KbcEmulDxe \ 261 | comment EsrtDxe \ 262 | comment NvmeInt13 \ 263 | comment OpalSecurity \ 264 | comment AcpiPlatform \ 265 | comment AcpiVTD \ 266 | comment PlatformCpuPolicy \ 267 | comment PciPlatform \ 268 | comment PlatformEarlyDxe \ 269 | comment PlatformType \ 270 | comment S3NvramSave \ 271 | comment UuidDxe \ 272 | comment OpaPlatCfg \ 273 | comment MemorySubClass \ 274 | comment SocketSetup \ 275 | comment FpgaSocketSetup \ 276 | comment HstiPlatformDxe \ 277 | comment HstiIhvProviderDxe \ 278 | comment IsPlatformSupportWhea \ 279 | comment OemVtdRmrr \ 280 | comment MePolicyInitDxe \ 281 | comment SpsAcpiHooks \ 282 | comment Platform \ 283 | comment FpkSetup \ 284 | comment SystemBoardDxe \ 285 | comment UbaInitDxe \ 286 | comment CsmRt32 \ 287 | comment AmiRedFishApi \ 288 | comment AmiDeviceGuardApi \ 289 | comment TxtDxe \ 290 | comment Smbios \ 291 | comment SmbiosBoard \ 292 | comment SmbiosGetFlashData \ 293 | comment AmiTcgNvflagSample \ 294 | comment AmiTcgPlatformDxe \ 295 | comment TcgDxeplatform \ 296 | comment Tpm20PlatformDxe \ 297 | comment Tpm20Acpi \ 298 | comment TpmSmbiosDxe \ 299 | comment Uhcd \ 300 | comment SBDXE \ 301 | comment Metronome \ 302 | comment WatchdogTimer \ 303 | comment CpuIoDxe \ 304 | comment CRBDxe \ 305 | comment EndlessbootDxe \ 306 | comment TyanDxe \ 307 | comment TyanBadDimmDxe \ 308 | comment S7106_PROJECT_DXE \ 309 | comment CapsuleRuntimeDxe \ 310 | comment RuntimeDxe \ 311 | comment PiSmmIpl \ 312 | comment CpuCsrAccess \ 313 | comment CrystalRidge \ 314 | comment JedecNvDimm \ 315 | comment PchResetRuntime \ 316 | comment SmmControl \ 317 | comment CryptoDXE \ 318 | comment GenericElog \ 319 | comment PlatformReset \ 320 | comment SvSmmSupport \ 321 | comment TraceHubStatusCodeHandlerRuntimeDxe \ 322 | comment SmiFlashDxe \ 323 | comment ConSplitter \ 324 | comment GraphicsConsole \ 325 | comment GenericSio \ 326 | comment PciBus \ 327 | comment TerminalSrc \ 328 | comment SerialIo \ 329 | comment CsmBlockIo \ 330 | comment CsmVideo \ 331 | comment IScsiDxe \ 332 | comment PostReport \ 333 | comment DcScreen \ 334 | comment Nvme \ 335 | comment PiSmmCore \ 336 | comment FlashDriverSmm \ 337 | comment NvramSmm \ 338 | comment CpuIo2Smm \ 339 | comment SmmLockBox \ 340 | comment PcRtcSmm \ 341 | comment PiSmmCpuDxeSmm \ 342 | comment MemRas \ 343 | comment CpuCsrAccessSMM \ 344 | comment CrystalRidgeSMM \ 345 | comment JedecNvDimmSMM \ 346 | comment IioSmm \ 347 | comment FpgaSmm \ 348 | comment HwpLvtSmm \ 349 | comment SmbusRecovery \ 350 | comment QuiesceSupport \ 351 | comment PchInitSmm \ 352 | comment PchSmiDispatcher \ 353 | comment PchSmbusSmm \ 354 | comment HeciSmm \ 355 | comment Heci3Smm \ 356 | comment CryptoSMM \ 357 | comment MicrocodeUpdate \ 358 | comment SmmS3SaveState \ 359 | comment SmmGenericSio \ 360 | comment OA3_SMM \ 361 | comment SmmPciRbIo \ 362 | comment RuntimeMemoryHoleSmm \ 363 | comment SmiVariable \ 364 | comment RuntimeSmm \ 365 | comment SmmGenericElog \ 366 | comment KbcEmul \ 367 | comment NvmeSmm \ 368 | comment Ofbd \ 369 | comment AcpiSmmPlatform \ 370 | comment PowerButtonHandler \ 371 | comment EmcaErrorLog \ 372 | comment PartialMirrorHandler \ 373 | comment MainErrorHandler \ 374 | comment PlatformErrorHandler \ 375 | comment ProcessorErrorHandler \ 376 | comment AmiErrorHandlerMain \ 377 | comment FpgaErrorHandler \ 378 | comment PcieErrorHandler \ 379 | comment PcieErrorEnable \ 380 | comment McBankErrorInjection \ 381 | comment LastBootErrorLog \ 382 | comment SvSmmHandler \ 383 | comment TraceHubStatusCodeHandlerSmm \ 384 | comment RTCWakeup \ 385 | comment SmbiosDmiEdit \ 386 | comment SmiFlash \ 387 | comment TcgSmm \ 388 | comment TpmClearOnRollbackSmm \ 389 | comment TcoSmi \ 390 | comment AcpiModeEnable \ 391 | comment PiSmmCommunicationSmm \ 392 | comment TyanNvdimmAdrTrigger \ 393 | comment FullShell \ 394 | comment StatusCodeDxe \ 395 | comment StatusCodeSmm \ 396 | comment FlashDriver \ 397 | comment NvramDxe \ 398 | comment PcdDxe \ 399 | comment DxeSelStatusCode \ 400 | comment DxeFrb \ 401 | comment CmosDxe \ 402 | comment RegAccessDxe \ 403 | comment RegAccessSMM \ 404 | comment SecureBootDXE \ 405 | comment TcgDxe \ 406 | comment Tcg2Dxe \ 407 | comment TcgPlatformSetupPolicy \ 408 | comment TyanBoardDXE \ 409 | comment AMITSE \ 410 | comment AMITSESetupData \ 411 | comment OPAPlatConfigSkt0 \ 412 | comment OPAPlatConfigSkt1 \ 413 | comment PeiCore 414 | -------------------------------------------------------------------------------- /lenovo/sr630/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, uroot, flashkernel, or image.bin 5 | 6 | image.bin: flashkernel 7 | utk \ 8 | -xzPath /usr/bin/xz \ 9 | sr630.bin \ 10 | remove Ip.* \ 11 | remove Tcp.* \ 12 | remove Usb.* \ 13 | remove Udp.* \ 14 | remove Dhcp.* \ 15 | remove .np.* \ 16 | remove .tftp.* \ 17 | remove Http.* \ 18 | remove .*Dns.* \ 19 | remove Arp.* \ 20 | remove .*NetworkStackSetupScreen.* \ 21 | remove Iscsi.* \ 22 | remove Scsi.* \ 23 | remove Fat.* \ 24 | remove Ahci.* \ 25 | remove Partition.* \ 26 | remove Sata.* \ 27 | remove Disk.* \ 28 | remove Whea.* \ 29 | remove .*Pxe.* \ 30 | remove Ata.* \ 31 | remove AMITSE \ 32 | replace_pe32 FullShell flashkernel \ 33 | save image.bin 34 | 35 | flashkernel: uroot bzImage 36 | cp linux/arch/x86/boot/bzImage flashkernel 37 | 38 | readrom: 39 | echo note: for this to work you need to plug in power 40 | echo also .... flashrom will not work you need sf100 on windows 41 | sudo flashrom -p dediprog -r sr630.bin 42 | 43 | writerom: image.bin 44 | sudo flashrom -p dediprog -w sr630.bin 45 | 46 | uroot: 47 | go run github.com/u-root/u-root -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/exp/rush github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp 48 | cp /tmp/initramfs.linux_amd64.cpio . 49 | lzma -k -f initramfs.linux_amd64.cpio 50 | ls -l initramfs* 51 | cp *lzma linux 52 | 53 | bzImage: 54 | cp config-4.14.111 linux/.config 55 | (cd linux && make oldconfig && make -j32) 56 | 57 | fetch: getkernel geturoot getfiano getrom 58 | getkernel: 59 | rm -rf linux 60 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 61 | xzcat kernel.xz | tar x 62 | mv linux-4.14.111 linux 63 | getfiano: 64 | go get -u github.com/linuxboot/fiano/cmds/utk 65 | go install github.com/linuxboot/fiano/cmds/utk 66 | getrom: 67 | echo you can put a wget here 68 | echo and unxip it 69 | echo and cp it to sr630.bin 70 | geturoot: 71 | go get -u github.com/u-root/u-root 72 | 73 | # everything from here below was part of an experiment and can be ignored. 74 | experiment: 75 | echo b to build, i for initramfs, q for qemu, d to dxeclean 76 | 77 | b: buildbzimage 78 | 79 | d: 80 | ForthUTK sr630.bin fv 'AMITSE|Ata.*|Disk.*|.*Ftp.*|.*Dhcp.*|Tcp.*|.*Pxe.*|.*Udp.*' ix r r tag /tmp/x saverom /tmp/x fv linux/arch/x86/boot/bzImage splat drop /tmp/x saverom ./DXECLEANER clean 81 | 82 | d98: 83 | ForthUTK 98.splat fv ./DXECLEANER clean 84 | 85 | d4: 86 | ForthUTK RUN4.4.rom fv ./DXECLEANER clean 87 | 88 | buildbzimage: 89 | (cd linux && make -j32 && ls -l arch/x86/boot/bzImage) 90 | 91 | i: 92 | (cd ~/go/src/github.com/linuxboot/dut/uinit/&&go build) 93 | cp ~/go/src/github.com/linuxboot/dut/uinit/uinit . 94 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files id_rsa.pub github.com/linuxboot/dut/uinit github.com/u-root/u-root/cmds/init github.com/u-root/u-root/xcmds/rush github.com/u-root/u-root/cmds/ls github.com/u-root/u-root/cmds/ip github.com/u-root/u-root/cmds/elvish github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/cmds/scp 95 | cp /tmp/initramfs.linux_amd64.cpio . 96 | lzma -k -f initramfs.linux_amd64.cpio 97 | ls -l initramfs* 98 | cp *lzma linux 99 | 100 | burn: bigi b 101 | ForthUTK remove100.rom fv linux/arch/x86/boot/bzImage splat remove100big.rom saverom < /dev/null 102 | ./BURN remove100big.rom 103 | 104 | bigi: 105 | (cd ~/go/src/github.com/linuxboot/dut/uinit/&&go build) 106 | cp ~/go/src/github.com/linuxboot/dut/uinit/uinit . 107 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files key.pub minimal github.com/linuxboot/dut/uinit github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/xcmds/pox github.com/u-root/u-root/cmds/scp github.com/u-root/u-root/cmds/cpio 108 | cp /tmp/initramfs.linux_amd64.cpio . 109 | lzma -k -f initramfs.linux_amd64.cpio 110 | ls -l initramfs* 111 | cp *lzma linux 112 | 113 | cleanme: 114 | utk dxeclean.bin dxecleaner_blacklist ./DXECLEANER ./blacklist 115 | 116 | q: 117 | /usr/bin/qemu-system-x86_64 -kernel linux/arch/x86/boot/bzImage -serial stdio -monitor /dev/null -m 8192 -nographic 118 | findit: 119 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated ' < xxx 120 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated[1] | [.Value.Name]'< xxx 121 | 122 | all: 123 | utk sr630.bin \ 124 | remove Ip.* \ 125 | remove Tcp.* \ 126 | remove Usb.* \ 127 | remove Udp.* \ 128 | remove Dhcp.* \ 129 | remove .np.* \ 130 | remove .tftp.* \ 131 | remove Http.* \ 132 | remove .*Dns.* \ 133 | remove Arp.* \ 134 | remove .*NetworkStackSetupScreen.* \ 135 | remove Iscsi.* \ 136 | remove Scsi.* \ 137 | remove Fat.* \ 138 | remove Ahci.* \ 139 | remove Partition.* \ 140 | remove Sata.* \ 141 | remove Disk.* \ 142 | remove Whea.* \ 143 | remove .*Pxe.* \ 144 | remove Ata.* \ 145 | replace_pe32 FullShell bzImage \ 146 | save x.bin \ 147 | remove .*Ipmi.* \ 148 | save ipmisucks.bin \ 149 | remove DxeIpmiBmcInitialize \ 150 | remove SmmBmcElog \ 151 | remove BmcAcpi \ 152 | remove SmmIpmiBmcInitialize \ 153 | remove BmcElog \ 154 | remove BmcLanConfig \ 155 | save removeBMCcrap.bin \ 156 | remove SecurityStubDxe \ 157 | save removesomecrap.bin \ 158 | comment TimestampDxe \ 159 | comment Legacy8259 \ 160 | comment HiiDatabase \ 161 | comment DataHubDxe \ 162 | comment EnglishDxe \ 163 | comment here \ 164 | comment PcRtc \ 165 | comment FpgaDxe \ 166 | comment LegacyInterrupt \ 167 | comment SmartTimer \ 168 | comment LegacySredir \ 169 | comment LegacyRegion2 \ 170 | comment TcgLegacy \ 171 | comment LegacySmmSredir \ 172 | comment DevicePathDxe \ 173 | comment CpuIo2Dxe \ 174 | comment CpuMpDxe \ 175 | comment SmmAccess \ 176 | comment WdtDxe \ 177 | save commentmorecrap.bin \ 178 | comment SetupConfigUpdateDxeNeonCityEPRP \ 179 | comment StaticSkuDataDxeNeonCityEPRP \ 180 | comment OpromUpdateDxeNeonCityEPRP \ 181 | comment SmbiosDataUpdateDxeNeonCityEPRP \ 182 | comment IioCfgUpdateDxeNeonCityEPRP \ 183 | comment SlotDataUpdateDxeNeonCityEPRP \ 184 | comment SetupConfigUpdateDxeLightningRidgeEXRP \ 185 | comment StaticSkuDataDxeLightningRidgeEXRP \ 186 | comment OpromUpdateDxeLightningRidgeEXRP \ 187 | comment SmbiosDataUpdateDxeLightningRidgeEXRP \ 188 | comment IioCfgUpdateDxeLightningRidgeEXRP \ 189 | comment SlotDataUpdateDxeLightningRidgeEXRP \ 190 | comment OpromUpdateDxeNeonCityFPGA \ 191 | comment SetupConfigUpdateDxeNeonCityFPGA \ 192 | comment SmbiosDataUpdateDxeNeonCityFPGA \ 193 | comment StaticSkuDataDxeNeonCityFPGA \ 194 | comment IioCfgUpdateDxeNeonCityFPGA \ 195 | comment SlotDataUpdateDxeNeonCityFPGA \ 196 | comment FpgaConfigDataDxeNeonCityFPGA \ 197 | comment IioCfgUpdateDxeLightningRidgeEXECB1 \ 198 | comment OpromUpdateDxeLightningRidgeEXECB1 \ 199 | comment SetupConfigUpdateDxeLightningRidgeEXECB1 \ 200 | comment SlotDataUpdateDxeLightningRidgeEXECB1 \ 201 | comment SmbiosDataUpdateDxeLightningRidgeEXECB1 \ 202 | comment StaticSkuDataDxeLightningRidgeEXECB1 \ 203 | comment IioCfgUpdateDxeLightningRidgeEXECB2 \ 204 | comment OpromUpdateDxeLightningRidgeEXECB2 \ 205 | comment SetupConfigUpdateDxeLightningRidgeEXECB2 \ 206 | comment SlotDataUpdateDxeLightningRidgeEXECB2 \ 207 | comment SmbiosDataUpdateDxeLightningRidgeEXECB2 \ 208 | comment StaticSkuDataDxeLightningRidgeEXECB2 \ 209 | comment IioCfgUpdateDxeLightningRidgeEXECB3 \ 210 | comment OpromUpdateDxeLightningRidgeEXECB3 \ 211 | comment SetupConfigUpdateDxeLightningRidgeEXECB3 \ 212 | comment SlotDataUpdateDxeLightningRidgeEXECB3 \ 213 | comment SmbiosDataUpdateDxeLightningRidgeEXECB3 \ 214 | comment StaticSkuDataDxeLightningRidgeEXECB3 \ 215 | comment IioCfgUpdateDxeLightningRidgeEXECB4 \ 216 | comment OpromUpdateDxeLightningRidgeEXECB4 \ 217 | comment SetupConfigUpdateDxeLightningRidgeEXECB4 \ 218 | comment SlotDataUpdateDxeLightningRidgeEXECB4 \ 219 | comment SmbiosDataUpdateDxeLightningRidgeEXECB4 \ 220 | comment StaticSkuDataDxeLightningRidgeEXECB4 \ 221 | comment IioCfgUpdateDxeNeonCityEPECB \ 222 | comment OpromUpdateDxeNeonCityEPECB \ 223 | comment SetupConfigUpdateDxeNeonCityEPECB \ 224 | comment SlotDataUpdateDxeNeonCityEPECB \ 225 | comment SmbiosDataUpdateDxeNeonCityEPECB \ 226 | comment StaticSkuDataDxeNeonCityEPECB \ 227 | save commentsetupcrap.bin \ 228 | comment PchSerialGpio \ 229 | comment PchSmbusDxe \ 230 | comment IioInit \ 231 | comment PpmInitialize \ 232 | comment CpuArchDxe \ 233 | comment PchInitDxe \ 234 | comment start_dxecleaner \ 235 | remove AB7ED12E-1D78-4635-AB87-23F00A911EC7 \ 236 | save fail.bin \ 237 | comment HeciInitDxe \ 238 | comment SpsDxe \ 239 | comment SpsSmm \ 240 | comment Aint13 \ 241 | comment Setup \ 242 | comment ServerMgmtSetup \ 243 | comment ACPI \ 244 | comment S3SaveStateDxe \ 245 | comment BootScriptExecutorDxe \ 246 | comment SioDxeInit \ 247 | comment OA3 \ 248 | comment OptionRomPolicy \ 249 | comment PciRootBridge \ 250 | comment PciDxeInit \ 251 | comment PciOutOfResourceSetupPage \ 252 | comment RuntimeMemoryHoleVar \ 253 | comment ExportHiiDb \ 254 | comment DpcDxe \ 255 | comment AmiBoardInfo2 \ 256 | comment ReFlash \ 257 | comment CsmDxe \ 258 | comment UbaConfigDatabaseDxe \ 259 | comment HardwareSignatureEntry \ 260 | comment KbcEmulDxe \ 261 | comment EsrtDxe \ 262 | comment NvmeInt13 \ 263 | comment OpalSecurity \ 264 | comment AcpiPlatform \ 265 | comment AcpiVTD \ 266 | comment PlatformCpuPolicy \ 267 | comment PciPlatform \ 268 | comment PlatformEarlyDxe \ 269 | comment PlatformType \ 270 | comment S3NvramSave \ 271 | comment UuidDxe \ 272 | comment OpaPlatCfg \ 273 | comment MemorySubClass \ 274 | comment SocketSetup \ 275 | comment FpgaSocketSetup \ 276 | comment HstiPlatformDxe \ 277 | comment HstiIhvProviderDxe \ 278 | comment IsPlatformSupportWhea \ 279 | comment OemVtdRmrr \ 280 | comment MePolicyInitDxe \ 281 | comment SpsAcpiHooks \ 282 | comment Platform \ 283 | comment FpkSetup \ 284 | comment SystemBoardDxe \ 285 | comment UbaInitDxe \ 286 | comment CsmRt32 \ 287 | comment AmiRedFishApi \ 288 | comment AmiDeviceGuardApi \ 289 | comment TxtDxe \ 290 | comment Smbios \ 291 | comment SmbiosBoard \ 292 | comment SmbiosGetFlashData \ 293 | comment AmiTcgNvflagSample \ 294 | comment AmiTcgPlatformDxe \ 295 | comment TcgDxeplatform \ 296 | comment Tpm20PlatformDxe \ 297 | comment Tpm20Acpi \ 298 | comment TpmSmbiosDxe \ 299 | comment Uhcd \ 300 | comment SBDXE \ 301 | comment Metronome \ 302 | comment WatchdogTimer \ 303 | comment CpuIoDxe \ 304 | comment CRBDxe \ 305 | comment EndlessbootDxe \ 306 | comment TyanDxe \ 307 | comment TyanBadDimmDxe \ 308 | comment S7106_PROJECT_DXE \ 309 | comment CapsuleRuntimeDxe \ 310 | comment RuntimeDxe \ 311 | comment PiSmmIpl \ 312 | comment CpuCsrAccess \ 313 | comment CrystalRidge \ 314 | comment JedecNvDimm \ 315 | comment PchResetRuntime \ 316 | comment SmmControl \ 317 | comment CryptoDXE \ 318 | comment GenericElog \ 319 | comment PlatformReset \ 320 | comment SvSmmSupport \ 321 | comment TraceHubStatusCodeHandlerRuntimeDxe \ 322 | comment SmiFlashDxe \ 323 | comment ConSplitter \ 324 | comment GraphicsConsole \ 325 | comment GenericSio \ 326 | comment PciBus \ 327 | comment TerminalSrc \ 328 | comment SerialIo \ 329 | comment CsmBlockIo \ 330 | comment CsmVideo \ 331 | comment IScsiDxe \ 332 | comment PostReport \ 333 | comment DcScreen \ 334 | comment Nvme \ 335 | comment PiSmmCore \ 336 | comment FlashDriverSmm \ 337 | comment NvramSmm \ 338 | comment CpuIo2Smm \ 339 | comment SmmLockBox \ 340 | comment PcRtcSmm \ 341 | comment PiSmmCpuDxeSmm \ 342 | comment MemRas \ 343 | comment CpuCsrAccessSMM \ 344 | comment CrystalRidgeSMM \ 345 | comment JedecNvDimmSMM \ 346 | comment IioSmm \ 347 | comment FpgaSmm \ 348 | comment HwpLvtSmm \ 349 | comment SmbusRecovery \ 350 | comment QuiesceSupport \ 351 | comment PchInitSmm \ 352 | comment PchSmiDispatcher \ 353 | comment PchSmbusSmm \ 354 | comment HeciSmm \ 355 | comment Heci3Smm \ 356 | comment CryptoSMM \ 357 | comment MicrocodeUpdate \ 358 | comment SmmS3SaveState \ 359 | comment SmmGenericSio \ 360 | comment OA3_SMM \ 361 | comment SmmPciRbIo \ 362 | comment RuntimeMemoryHoleSmm \ 363 | comment SmiVariable \ 364 | comment RuntimeSmm \ 365 | comment SmmGenericElog \ 366 | comment KbcEmul \ 367 | comment NvmeSmm \ 368 | comment Ofbd \ 369 | comment AcpiSmmPlatform \ 370 | comment PowerButtonHandler \ 371 | comment EmcaErrorLog \ 372 | comment PartialMirrorHandler \ 373 | comment MainErrorHandler \ 374 | comment PlatformErrorHandler \ 375 | comment ProcessorErrorHandler \ 376 | comment AmiErrorHandlerMain \ 377 | comment FpgaErrorHandler \ 378 | comment PcieErrorHandler \ 379 | comment PcieErrorEnable \ 380 | comment McBankErrorInjection \ 381 | comment LastBootErrorLog \ 382 | comment SvSmmHandler \ 383 | comment TraceHubStatusCodeHandlerSmm \ 384 | comment RTCWakeup \ 385 | comment SmbiosDmiEdit \ 386 | comment SmiFlash \ 387 | comment TcgSmm \ 388 | comment TpmClearOnRollbackSmm \ 389 | comment TcoSmi \ 390 | comment AcpiModeEnable \ 391 | comment PiSmmCommunicationSmm \ 392 | comment TyanNvdimmAdrTrigger \ 393 | comment FullShell \ 394 | comment StatusCodeDxe \ 395 | comment StatusCodeSmm \ 396 | comment FlashDriver \ 397 | comment NvramDxe \ 398 | comment PcdDxe \ 399 | comment DxeSelStatusCode \ 400 | comment DxeFrb \ 401 | comment CmosDxe \ 402 | comment RegAccessDxe \ 403 | comment RegAccessSMM \ 404 | comment SecureBootDXE \ 405 | comment TcgDxe \ 406 | comment Tcg2Dxe \ 407 | comment TcgPlatformSetupPolicy \ 408 | comment TyanBoardDXE \ 409 | comment AMITSE \ 410 | comment AMITSESetupData \ 411 | comment OPAPlatConfigSkt0 \ 412 | comment OPAPlatConfigSkt1 \ 413 | comment PeiCore 414 | -------------------------------------------------------------------------------- /lenovo/thinkpad/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, uroot, flashkernel, or image.bin 5 | 6 | image.bin: flashkernel coreboot.bin 7 | cp coreboot.bin image.bin 8 | chmod +w image.bin 9 | cbfstool image.bin print 10 | cbfstool image.bin remove -n img/nerf 11 | cbfstool image.bin remove -n genroms/pxe.rom 12 | cbfstool image.bin add-payload -n img/nerf -f flashkernel 13 | cbfstool image.bin print 14 | qemu: flashkernel 15 | sudo /usr/bin/qemu-system-x86_64 -kernel flashkernel \ 16 | -cpu max \ 17 | -s \ 18 | -m 1024m \ 19 | -machine q35 \ 20 | -object rng-random,filename=/dev/urandom,id=rng0 \ 21 | -device virtio-rng-pci,rng=rng0 \ 22 | -device e1000,netdev=n1 \ 23 | -netdev user,id=n1,hostfwd=tcp:127.0.0.1:23-:2222,net=192.168.1.0/24,host=192.168.1.1 \ 24 | -serial stdio \ 25 | -append earlyprintk=ttyS0,115200\ console=ttyS0 \ 26 | -monitor /dev/null \ 27 | 28 | 29 | # add the following line to qemu if you want to snoop packets. 30 | -object filter-dump,id=f1,netdev=n1,file=/tmp/vm0.pcap \ 31 | 32 | 33 | flashkernel: uroot bzImage 34 | cp linux/arch/x86/boot/bzImage flashkernel 35 | 36 | netbootkernel: netbooturoot bzImage 37 | cp linux/arch/x86/boot/bzImage kernel 38 | 39 | readrom: 40 | sudo flashrom -p internal -r coreboot.bin 41 | 42 | writerom: image.bin 43 | sudo flashrom -p internal -w image.bin 44 | 45 | netbooturoot: 46 | go run github.com/u-root/u-root -build=bb github.com/u-root/u-root/cmds/core/init github.com/u-root/u-root/cmds/core/ls github.com/u-root/u-root/cmds/core/ip github.com/u-root/u-root/cmds/core/elvish github.com/u-root/u-root/cmds/core/sshd github.com/u-root/u-root/cmds/core/scp github.com/u-root/u-root/cmds/boot/* 47 | cp /tmp/initramfs.linux_amd64.cpio . 48 | lzma -k -f initramfs.linux_amd64.cpio 49 | ls -l initramfs* 50 | cp *lzma linux 51 | 52 | uroot: 53 | go run github.com/u-root/u-root -initcmd=/bbin/cpu -build=bb -files ~/.ssh/cpu_rsa.pub:key.pub \ 54 | all \ 55 | github.com/u-root/cpu/cmds/cpu 56 | cp /tmp/initramfs.linux_amd64.cpio . 57 | lzma -k -f initramfs.linux_amd64.cpio 58 | ls -l initramfs* 59 | cp *lzma linux 60 | 61 | bzImage: 62 | cp config-4.14.111 linux/.config 63 | (cd linux && make oldconfig && make -j32) 64 | 65 | fetch: getkernel geturoot getfiano getrom 66 | getkernel: 67 | rm -rf linux 68 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 69 | xzcat kernel.xz | tar x 70 | mv linux-4.14.111 linux 71 | getrom: 72 | echo you create the flashkernel 73 | echo on the APU2: flashrom -r coreboot.bin -p internal 74 | echo copy that file here and for safety: 75 | echo chmod a-w coreboot.bin 76 | geturoot: 77 | go get -u github.com/u-root/u-root 78 | go get -u github.com/u-root/cpu/... 79 | getfiano: 80 | go get -u github.com/linuxboot/fiano/cmds/utk 81 | go install github.com/linuxboot/fiano/cmds/utk 82 | go install github.com/linuxboot/fiano/cmds/guid2english 83 | -------------------------------------------------------------------------------- /marvel/macchiatobin/.gitignore: -------------------------------------------------------------------------------- 1 | /linux 2 | 3 | *.cpio 4 | *.cpio.xz 5 | tfa 6 | /binaries-marvell/ 7 | /mv-ddr-marvell/ 8 | -------------------------------------------------------------------------------- /marvel/macchiatobin/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i ../../class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i ../../class_key -P 2022 board:/image.bin image.bin 12 | # make tiny.bin 13 | # scp -i ../../class_key -P 2022 tiny.bin board:/tiny.bin 14 | # ssh -i ../../class_key -p 2022 board flashrom -w tiny.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make tiny.bin 23 | # cpu board flashrom -w tiny.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make tiny.bin 30 | # flashrom -w tiny.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # You can test the flash image kernel with qemu 34 | # make flashtest 35 | 36 | 37 | MARVELL_GIT?=https://github.com/MarvellEmbeddedProcessors 38 | TOOLCHAIN?=aarch64-linux-gnu- 39 | 40 | default: flash-image.bin 41 | 42 | u-root: 43 | go install github.com/u-root/u-root 44 | @echo Make sure $(GOPATH)/bin is in your PATH 45 | @echo if GOPATH is empty, then put ~/go/bin in your PATH 46 | 47 | todo: sshdkernel flash cpukernel 48 | 49 | flash-image.bin: flashkernel sd 50 | 51 | sd: 52 | (cd tfa && make \ 53 | CROSS_COMPILE=$(TOOLCHAIN) \ 54 | Arch=arm64 \ 55 | SCP_BL2=../binaries-marvell/mrvl_scp_bl2_8040.img \ 56 | BL33=../linux/arch/arm64/boot/Image.gz \ 57 | BL33_DTB=../linux/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb \ 58 | USE_COHERENT_MEM=0 \ 59 | ARM_LINUX_KERNEL_AS_BL33=1 \ 60 | MV_DDR_PATH=../mv-ddr-marvell \ 61 | PLAT=a80x0_mcbin \ 62 | all fip) 63 | echo build result is tfa/build/a80x0_mcbin/release/flash-image.bin 64 | 65 | flashtest: testflashkernel 66 | 67 | usefultargets: 68 | echo fetch, uroot, kernel, apt (for crossbuild) or image.bin 69 | 70 | tiny.bin: flashkernel flashinitramfs.cpio.xz 71 | 72 | sshdkernel: sshd.cpio.xz netbootkernel.config 73 | cp netbootkernel.config linux/.config 74 | (cd linux && make oldconfig && make -j32) 75 | cp linux/arch/x86/boot/bzImage $@ 76 | 77 | # at the moment, the kernel used for the cpu command and the sshdkernel 78 | # are the same. 79 | cpukernel: sshdkernel 80 | cp sshdkernel $@ 81 | 82 | writerom: flash-image.bin 83 | @echo Use this command. It will not be run from this Makefile 84 | @echo dd if=flash-image.bin of=/dev/null skip=1 85 | 86 | flashinitramfs.cpio.xz: flashinitramfs.cpio 87 | xz --check=crc32 -f -k $< 88 | 89 | flashinitramfs.cpio: u-root Makefile 90 | GOARCH=arm64 u-root -o $@ -build=bb \ 91 | -uinitcmd=/bbin/pxeboot \ 92 | github.com/u-root/u-root/cmds/boot/pxeboot \ 93 | github.com/u-root/u-root/cmds/core/cat \ 94 | github.com/u-root/u-root/cmds/core/elvish \ 95 | github.com/u-root/u-root/cmds/core/init \ 96 | github.com/u-root/u-root/cmds/core/ip \ 97 | github.com/u-root/u-root/cmds/core/ls \ 98 | github.com/u-root/u-root/cmds/core/kexec \ 99 | github.com/u-root/u-root/cmds/core/pci \ 100 | github.com/u-root/u-root/cmds/core/wget \ 101 | 102 | # this target builds an initramfs with only one program, the cpu server. 103 | # It depends on the kernel setting the IP address. 104 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 105 | cpu.cpio.xz: u-root Makefile 106 | GOARCH=arm64 u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 107 | -defaultsh="" \ 108 | github.com/u-root/cpu/cmds/cpud 109 | xz --check=crc32 -f -k cpu.cpio 110 | 111 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 112 | # the intent is to demonstrate the capability of http loading. 113 | # It depends on the kernel setting the IP address. 114 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 115 | sshd.cpio.xz: u-root Makefile 116 | GOARCH=arm64 u-root -o sshd.cpio -build=bb \ 117 | -uinitcmd=/bbin/sshd \ 118 | -files ../../class_key.pub:authorized_keys \ 119 | -files ../../classhostkey:id_rsa \ 120 | -files /usr/bin/vi \ 121 | -files /usr/share/vim \ 122 | -files /usr/share/terminfo \ 123 | -files /bin/bash \ 124 | -files /usr/sbin/flashrom \ 125 | -files /usr/bin/xz \ 126 | all 127 | xz --check=crc32 -f -k sshd.cpio 128 | ls -l sshd.cpio.* 129 | 130 | flashkernel: config-5.6.3 flashinitramfs.cpio.xz 131 | cp $< linux/.config 132 | (cd linux && CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make oldconfig && CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make -j32) 133 | 134 | testflashkernel: flashkernel 135 | qemu-system-arm64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.xz 136 | 137 | # These stanzas fetch code. 138 | fetch: getkernel geturoot gettfa fetchblobs 139 | 140 | gettfa: 141 | rm -rf tfa 142 | echo NOT THIS ONE git clone https://github.com/fozog/arm-trusted-firmware.git tfa 143 | git clone --branch linuxboot4mcbin https://github.com/fozog/arm-trusted-firmware.git tfa 144 | 145 | getkernel: 146 | rm -rf linux 147 | git clone --depth=1 -b v5.6 --single-branch https://github.com/torvalds/linux 148 | 149 | geturoot: 150 | go get -u github.com/u-root/u-root 151 | go get -u github.com/u-root/cpu/... 152 | 153 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 154 | sshd-pxeserver: 155 | echo Consider Disabling any system services ... 156 | echo e.g. sudo systemctl stop tftpd-hpa.service 157 | echo e.g. sudo systemctl stop isc-dhcp-server 158 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 159 | 160 | fetchblobs: 161 | rm -rf mv-ddr-marvell binaries-marvell 162 | git clone --branch mv_ddr-armada-atf-mainline $(MARVELL_GIT)/mv-ddr-marvell.git 163 | git clone --branch binaries-marvell-armada-17.10 $(MARVELL_GIT)/binaries-marvell 164 | 165 | apt: 166 | sudo apt install gcc-aarch64-linux-gnu 167 | 168 | # Serve the combined cpu-kernel and cpu-initramfs image. 169 | cpu-pxeserver: 170 | echo Consider Disabling any system services ... 171 | echo e.g. sudo systemctl stop tftpd-hpa.service 172 | echo e.g. sudo systemctl stop isc-dhcp-server 173 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 174 | ssh: 175 | ssh -i class_key -p 2022 root@up 176 | -------------------------------------------------------------------------------- /opentitanpilot/dresden/.gitignore: -------------------------------------------------------------------------------- 1 | /*.csv 2 | /*.bin 3 | /*.lzma 4 | /*.cpio 5 | /flashkernel 6 | /linux 7 | -------------------------------------------------------------------------------- /opentitanpilot/dresden/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make flashpxeboot.bin 13 | # scp -i class_key -P 2022 flashpxeboot.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w flashpxeboot.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make flashpxeboot.bin 23 | # cpu board flashrom -w flashpxeboot.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make flashpxeboot.bin 30 | # flashrom -w flashpxeboot.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # flashpxeboot.bin produces a flash image which will pxeboot. 34 | # cpu.bin produces a flash image that starts a cpu daemon. 35 | # 36 | # You can test the flash image kernel with qemu 37 | # make flashtest 38 | 39 | default: flash 40 | 41 | flash: flashpxeboot.bin 42 | 43 | redgreen: 44 | utk dxeremove.bin table | guid2english |grep File | grep -v PAD | grep -v PEIM | grep -v RAW | grep -v IMAGE | grep -v Sec | awk '{print $$2","$$3",red"}' | sort > red.csv 45 | utk image.bin table | guid2english |grep File | grep -v PAD | grep -v PEIM | grep -v RAW | grep -v IMAGE | grep -v Sec | awk '{print $$2","$$3",green"}' | sort > green.csv 46 | join -a 2 -t , -j1 red.csv green.csv | sed 's/red.*green/red/' > jj.csv 47 | 48 | flashtest: testflashkernel 49 | 50 | usefultargets: 51 | echo fetch, uroot, kernel, or image.bin 52 | 53 | flashpxeboot.bin: dxeremove.bin flashkernel flashinitramfs.cpio.lzma 54 | utk \ 55 | -xzPath /usr/bin/xz \ 56 | $< \ 57 | replace_pe32 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1 flashkernel \ 58 | save $@ 59 | 60 | cpu.bin: dxeremove.bin cpukernel 61 | utk \ 62 | -xzPath /usr/bin/xz \ 63 | $< \ 64 | replace_pe32 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1 cpukernel \ 65 | save $@ 66 | 67 | edk2.bin: dxeremove.bin 68 | echo Note, this inserts the edk2 bds and shell 69 | echo Only flash this image if you have an sf100. 70 | echo It will not be able to boot anything. 71 | utk \ 72 | -xzPath /usr/bin/xz \ 73 | $< \ 74 | insert_dxe edk2bdsdxe.ffs insert_dxe edk2shell.ffs \ 75 | save $@ 76 | 77 | dxeremove.bin: image.bin Makefile 78 | rm -f dxeremove.bin 79 | echo tighten.bin did not go well. 80 | echo note, we remove DXE to the point the image is not viable 81 | echo until you put a kernel in it in place of the shell. 82 | utk $< \ 83 | comment FlashDriver_do_not_remove_efi_panics \ 84 | comment S3Save_do_not_remove_gets_error \ 85 | comment testremove \ 86 | comment FlashDriver_do_not_remove_efi_panics \ 87 | comment S3Save_do_not_remove_gets_error \ 88 | comment leavefornow \ 89 | comment AMITSE \ 90 | comment AMITSE.* \ 91 | comment Bds \ 92 | comment testremove \ 93 | remove Ahci.* \ 94 | remove Arp.* \ 95 | remove Ata.* \ 96 | remove Button.* \ 97 | remove CryptoD.* \ 98 | remove .*Dhcp.* \ 99 | remove Dhcp6Dxe \ 100 | remove Disk.* \ 101 | remove EbcDxe \ 102 | remove Fat.* \ 103 | remove .*ftp.* \ 104 | remove .*harging.* \ 105 | remove .*Http.* \ 106 | remove I2c.* \ 107 | remove IntelGopV.* \ 108 | remove IntelIsh.* \ 109 | remove Ip4.* \ 110 | remove Ip6Dxe \ 111 | remove Iscsi.* \ 112 | remove Ish.* \ 113 | remove .*Keyboard.* \ 114 | remove Logo.* \ 115 | remove Maxim.* \ 116 | remove Mmc.* \ 117 | remove MnpDxe \ 118 | remove Mouse.* \ 119 | remove Mtftp4Dxe \ 120 | remove Mtftp6Dxe \ 121 | remove NetworkStackSetupScreen \ 122 | remove Partition.* \ 123 | remove .*PxeDxe.* \ 124 | remove RandomNumberGen \ 125 | remove ReFlash \ 126 | remove Sata.* \ 127 | remove Scsi.* \ 128 | remove SnpDxe \ 129 | remove SoftKbd \ 130 | remove Tcp.* \ 131 | remove TcpDxe \ 132 | remove TimestampDxe \ 133 | remove Udp.* \ 134 | remove Udp4.* \ 135 | remove Udp6Dxe \ 136 | remove UefiPxe.* \ 137 | remove Uhcd \ 138 | remove Usb.* \ 139 | remove Whea.* \ 140 | remove Xpower.* \ 141 | remove .*HotPl.* \ 142 | comment try \ 143 | remove .*Tcg.* \ 144 | remove .*Tpm.* \ 145 | remove Tls.* \ 146 | comment BiosVideo.* \ 147 | comment .*BootMan.* \ 148 | remove .*Capsule.* \ 149 | remove Capsule.* \ 150 | comment Terminal.* \ 151 | remove Dns.* \ 152 | remove FirmwarePerformanceDxe \ 153 | remove Hsti.* \ 154 | comment fails \ 155 | comment Legacy82.* \ 156 | comment GenericMemoryTest.* \ 157 | comment BiosG.* \ 158 | comment end_fails \ 159 | comment S3Save_do_not_remove_gets_error \ 160 | comment below_still_unknown \ 161 | comment TcgMor \ 162 | comment AmiTcgNvflagSample \ 163 | comment AmiTcgPlatformDxe \ 164 | comment TcgDxeplatform \ 165 | comment Tpm20PlatformDxe \ 166 | comment CrbTpm20Acpi \ 167 | comment TcgSmm \ 168 | comment TcgDxe \ 169 | comment Tcg2Dxe \ 170 | comment TcgPlatformSetupPolicy \ 171 | save $@ 172 | 173 | hap.bin: tighten.bin 174 | cp $< $@ 175 | me_cleaner.py -s $@ 176 | chmod a-w $@ 177 | 178 | tighten.bin: image.bin 179 | utk $< tighten_me save $@ 180 | 181 | sshdkernel: sshd.cpio.lzma sshd.config 182 | cp sshd.config linux/.config 183 | (cd linux && make oldconfig && make -j32) 184 | cp linux/arch/x86/boot/bzImage $@ 185 | 186 | cpukernel: cpu.cpio.lzma cpu.config 187 | cp cpu.config linux/.config 188 | (cd linux && make oldconfig && make -j32) 189 | cp linux/arch/x86/boot/bzImage $@ 190 | 191 | cpuflashkernel: cpu.cpio.lzma cpuflash.config 192 | cp cpuflash.config linux/.config 193 | (cd linux && make oldconfig && make -j32) 194 | cp linux/arch/x86/boot/bzImage $@ 195 | 196 | readrom: 197 | echo You need to get a ROM image from *somewhere* 198 | echo Once you do, put it in ROM.bin 199 | 200 | writerom: image.bin 201 | echo Here is where you would do the flashrom, e.g. 202 | echo sudo flashrom -p dediprog -w image.bin 203 | 204 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 205 | lzma -f -k $< 206 | 207 | flashinitramfs.cpio: Makefile 208 | u-root -o $@ \ 209 | -defaultsh="/bbin/rush" \ 210 | github.com/u-root/u-root/cmds/boot/boot \ 211 | github.com/u-root/u-root/cmds/core/cat \ 212 | github.com/u-root/u-root/cmds/exp/rush \ 213 | github.com/u-root/u-root/cmds/core/init \ 214 | github.com/u-root/u-root/cmds/core/ip \ 215 | github.com/u-root/u-root/cmds/core/ls \ 216 | github.com/u-root/u-root/cmds/core/mount \ 217 | github.com/u-root/u-root/cmds/core/pci \ 218 | 219 | # this target builds an initramfs with only one program, the cpu server. 220 | # It depends on the kernel setting the IP address. 221 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 222 | cpu.cpio.lzma: Makefile 223 | u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 224 | -defaultsh="" \ 225 | github.com/u-root/cpu/cmds/cpud 226 | lzma -f -k cpu.cpio 227 | 228 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 229 | # the intent is to demonstrate the capability of http loading. 230 | # It depends on the kernel setting the IP address. 231 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 232 | sshd.cpio.lzma: Makefile 233 | u-root -o sshd.cpio -build=bb \ 234 | -uinitcmd=/bbin/sshd \ 235 | -files class_key.pub:authorized_keys \ 236 | -files classhostkey:id_rsa \ 237 | -files /usr/bin/vi \ 238 | -files /usr/share/vim \ 239 | -files /usr/share/terminfo \ 240 | -files /bin/bash \ 241 | -files /usr/sbin/flashrom \ 242 | -files /usr/bin/xz \ 243 | all 244 | lzma -f -k sshd.cpio 245 | ls -l sshd.cpio.* 246 | 247 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 248 | cp $< linux/.config 249 | (cd linux && make oldconfig && make -j32) 250 | cp linux/arch/x86/boot/bzImage $@ 251 | 252 | testflashkernel: flashkernel 253 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 254 | 255 | testcpukernel: cpukernel 256 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 257 | 258 | # These stanzas fetch code. 259 | fetch: getkernel geturoot getfiano getrom 260 | 261 | getkernel: 262 | rm -rf linux 263 | git clone --depth=1 -b v5.8 --single-branch https://github.com/torvalds/linux 264 | 265 | getfiano: 266 | go get -u github.com/linuxboot/fiano/cmds/utk 267 | go install github.com/linuxboot/fiano/cmds/utk 268 | go install github.com/linuxboot/fiano/cmds/guid2english 269 | getrom: 270 | echo you can put a wget here 271 | echo and unzip it 272 | echo and cp it to image.bin 273 | geturoot: 274 | go get -u github.com/u-root/u-root 275 | go get -u github.com/u-root/cpu/... 276 | 277 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 278 | sshd-pxeserver: 279 | echo Consider Disabling any system services ... 280 | echo e.g. sudo systemctl stop tftpd-hpa.service 281 | echo e.g. sudo systemctl stop isc-dhcp-server 282 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 283 | 284 | # Serve the combined cpu-kernel and cpu-initramfs image. 285 | cpu-pxeserver: 286 | echo Consider Disabling any system services ... 287 | echo e.g. sudo systemctl stop tftpd-hpa.service 288 | echo e.g. sudo systemctl stop isc-dhcp-server 289 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 290 | 291 | ssh: 292 | ssh -i class_key -p 2022 root@up 293 | -------------------------------------------------------------------------------- /pcengines/apu/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, uroot, flashkernel, or image.bin 5 | 6 | image.bin: flashkernel apu.bin 7 | cp apu.bin image.bin 8 | chmod +w image.bin 9 | cbfstool image.bin print 10 | cbfstool image.bin remove -n img/nerf 11 | cbfstool image.bin remove -n genroms/pxe.rom 12 | cbfstool image.bin add-payload -n img/nerf -f flashkernel 13 | cbfstool image.bin print 14 | 15 | flashkernel: uroot bzImage 16 | cp linux/arch/x86/boot/bzImage flashkernel 17 | 18 | readrom: 19 | sudo flashrom -p internal -r apu.bin 20 | 21 | writerom: image.bin 22 | sudo flashrom -p internal -w image.bin 23 | 24 | uroot: 25 | go run github.com/u-root/u-root -build=bb -initcmd=/bbin/cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 26 | github.com/u-root/cpu/cmds/cpud \ 27 | github.com/u-root/u-root/cmds/core/cat \ 28 | github.com/u-root/u-root/cmds/core/dhclient \ 29 | github.com/u-root/u-root/cmds/core/elvish \ 30 | github.com/u-root/u-root/cmds/core/init \ 31 | github.com/u-root/u-root/cmds/core/ip \ 32 | github.com/u-root/u-root/cmds/core/ls \ 33 | github.com/u-root/u-root/cmds/core/ps \ 34 | github.com/u-root/u-root/cmds/core/pwd \ 35 | github.com/u-root/u-root/cmds/core/rm \ 36 | github.com/u-root/u-root/cmds/core/shutdown 37 | cp /tmp/initramfs.linux_amd64.cpio . 38 | lzma -k -f initramfs.linux_amd64.cpio 39 | ls -l initramfs* 40 | cp *lzma linux 41 | 42 | bzImage: 43 | cp config-4.14.111 linux/.config 44 | (cd linux && make oldconfig && make -j32) 45 | 46 | fetch: getkernel geturoot getfiano getrom 47 | getkernel: 48 | rm -rf linux 49 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 50 | xzcat kernel.xz | tar x 51 | mv linux-4.14.111 linux 52 | getrom: 53 | echo you create the kernel 54 | echo on the APU2: flashrom -r apu.bin -p internal 55 | echo copy that file here and for safety: 56 | echo chmod a-w apu.bin 57 | geturoot: 58 | go get -u github.com/u-root/u-root 59 | go get -u github.com/u-root/cpu/... 60 | getfiano: 61 | go get -u github.com/linuxboot/fiano/cmds/utk 62 | go install github.com/linuxboot/fiano/cmds/utk 63 | go install github.com/linuxboot/fiano/cmds/guid2english 64 | 65 | -------------------------------------------------------------------------------- /pcengines/apu/TEST: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | sudo \ 4 | /usr/bin/qemu-system-x86_64 -kernel kernel \ 5 | -cpu max \ 6 | -s \ 7 | -m 1024m \ 8 | -machine q35 \ 9 | -object rng-random,filename=/dev/urandom,id=rng0 \ 10 | -device virtio-rng-pci,rng=rng0 \ 11 | -device e1000,netdev=n1 \ 12 | -netdev user,id=n1,hostfwd=tcp:127.0.0.1:23-:2222,net=192.168.1.0/24,host=192.168.1.1 \ 13 | -serial stdio \ 14 | -append 'earlyprintk=ttyS0,115200 console=ttyS0' \ 15 | -monitor /dev/null 16 | 17 | -------------------------------------------------------------------------------- /pcengines/apu2/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make tiny.bin 13 | # scp -i class_key -P 2022 tiny.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w tiny.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make tiny.bin 23 | # cpu board flashrom -w tiny.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make tiny.bin 30 | # flashrom -w tiny.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # You can test the flash image kernel with qemu 34 | # make flashtest 35 | 36 | default: sshdkernel flashkernel cpukernel 37 | echo you can add any of these targets to the apu2 image. 38 | echo as img/nerf. You can also set priority. 39 | 40 | flashtest: testflashkernel 41 | 42 | usefultargets: 43 | echo fetch, sshdkernel, flashkernel, cpukernel, etc. 44 | 45 | sshdkernel: sshd.cpio.lzma sshd.config 46 | cp sshd.config linux/.config 47 | (cd linux && make oldconfig && make -j32) 48 | cp linux/arch/x86/boot/bzImage $@ 49 | 50 | cpukernel: cpu.cpio.lzma cpu.config 51 | cp cpu.config linux/.config 52 | (cd linux && make oldconfig && make -j32) 53 | cp linux/arch/x86/boot/bzImage $@ 54 | 55 | readrom: 56 | echo You need to get a ROM image from *somewhere* 57 | echo Once you do, put it in ROM.bin 58 | 59 | writerom: image.bin 60 | echo Here is where you would do the flashrom, e.g. 61 | echo and maybe a cbfstool 62 | echo cbfstool apu2.rom remove -n img/nerf 63 | echo cbfstool apu2.rom add-payload -n img/nerf -f cpukernel 64 | echo sudo flashrom -p internal -w image.bin 65 | 66 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 67 | lzma -f -k $< 68 | 69 | flashinitramfs.cpio: Makefile 70 | go run github.com/u-root/u-root -o $@ -build=bb \ 71 | -uinitcmd=/bbin/pxeboot \ 72 | github.com/u-root/u-root/cmds/boot/pxeboot \ 73 | github.com/u-root/u-root/cmds/core/cat \ 74 | github.com/u-root/u-root/cmds/core/elvish \ 75 | github.com/u-root/u-root/cmds/core/init \ 76 | github.com/u-root/u-root/cmds/core/ip \ 77 | github.com/u-root/u-root/cmds/core/ls \ 78 | github.com/u-root/u-root/cmds/core/kexec \ 79 | github.com/u-root/u-root/cmds/core/pci \ 80 | github.com/u-root/u-root/cmds/core/wget \ 81 | 82 | # this target builds an initramfs with only one program, the cpu server. 83 | # It depends on the kernel setting the IP address. 84 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 85 | cpu.cpio.lzma: Makefile 86 | go run github.com/u-root/u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 87 | -defaultsh="" \ 88 | github.com/u-root/cpu/cmds/cpud 89 | lzma -f -k cpu.cpio 90 | 91 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 92 | # the intent is to demonstrate the capability of http loading. 93 | # It depends on the kernel setting the IP address. 94 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 95 | sshd.cpio.lzma: Makefile 96 | go run github.com/u-root/u-root -o sshd.cpio -build=bb \ 97 | -uinitcmd=/bbin/sshd \ 98 | -files class_key.pub:authorized_keys \ 99 | -files classhostkey:id_rsa \ 100 | -files /usr/bin/vi \ 101 | -files /usr/share/vim \ 102 | -files /usr/share/terminfo \ 103 | -files /bin/bash \ 104 | -files /usr/sbin/flashrom \ 105 | -files /usr/bin/xz \ 106 | all 107 | lzma -f -k sshd.cpio 108 | ls -l sshd.cpio.* 109 | 110 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 111 | cp $< linux/.config 112 | (cd linux && make oldconfig && make -j32) 113 | cp linux/arch/x86/boot/bzImage $@ 114 | 115 | testflashkernel: flashkernel 116 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 117 | 118 | testcpukernel: cpukernel 119 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 120 | 121 | # These stanzas fetch code. 122 | fetch: getkernel geturoot getrom 123 | 124 | getkernel: 125 | rm -rf linux 126 | git clone --depth=1 -b v5.7 --single-branch https://github.com/torvalds/linux 127 | 128 | getrom: 129 | echo you can use flashrom to read the apu2 image. 130 | 131 | geturoot: 132 | go get -u github.com/u-root/u-root 133 | go get -u github.com/u-root/cpu/... 134 | 135 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 136 | sshd-pxeserver: 137 | echo Consider Disabling any system services ... 138 | echo e.g. sudo systemctl stop tftpd-hpa.service 139 | echo e.g. sudo systemctl stop isc-dhcp-server 140 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 141 | 142 | # Serve the combined cpu-kernel and cpu-initramfs image. 143 | cpu-pxeserver: 144 | echo Consider Disabling any system services ... 145 | echo e.g. sudo systemctl stop tftpd-hpa.service 146 | echo e.g. sudo systemctl stop isc-dhcp-server 147 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 148 | 149 | ssh: 150 | ssh -i class_key -p 2022 root@up 151 | -------------------------------------------------------------------------------- /pcengines/apu2/class_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA4zGICkjqlAPbYH0MZGN79zDJi88uC1pbc7cUcHQPp8R9iet0 3 | 2Q594DiOsJhAc9ALDkVopAmDMew1OO9vwZXAkv00hPhnEHFSXJP31zaoWvQkbS/Z 4 | /Ghl8gTTrPpJo+gJ3kCINwM1Z+IEQbjlE1EsvgKQEWQMCN32cD52F1L0UpkRaRzP 5 | FKKxfMOKYCIIbFDbC1iAAsjuIOunlATy4OT1IbNBhkdX2Mx2kTchaJxry4LL+NDs 6 | sIvfrtMJ/5gmIWKYnc4mXr2ozD4ZvCm7ooEnQshSgXXTpjl1AuEJvnaczr+ij66w 7 | KUQhzK3Ukjo99b8xhih4pVlU661KAbezziyuFwIDAQABAoIBAFbib1s3jXYzj2b0 8 | C5Qss5DR+JHeFobC9GxpXIiw6ffH3harlBEaSKtCFdeVMjjYHBJGGwF4ndKuuZ/f 9 | eYa35WCRMs+TS57vJ4c+Ey8buQCnk3KqNRwhNLN8gxMI2La1G2kCltUrBfaHagdU 10 | VU6w4YJ86mmsMCoH8KH2USUUVVlsdbEgi6oQzPusw4le8a4shTX40YaBi90hv7XX 11 | MshqZDscjM/mqXJVMq8fLJ6IDYeNVLNw3GhlHrlitO2Kheil7ptgrftYdTVqvScR 12 | VNL4lFP6rq3N1BN0eisAwyB2A0mf/sCVc0fKA0qsNsODoVw9g7HBTjx6IFpbQ0Kh 13 | derDBgkCgYEA+tAZftg8z2A+YFdA/fTGxLS82BCsIKJ1kaizDWcshcdZ6AQ2vNwT 14 | JwxzOwiS/Tu1hqNHaE0tYV9cW8hKZC2CdsIquPEEewPNqnwzh6bhUiPmjlPF3Dea 15 | pX2LHklCAOXLtnJqf1ZmbhhWbj/2TIITr/Iq5ae5rk32QAwsyvphswMCgYEA5+Rh 16 | rMVYlXLSss/9rl+89ecrj0ZmXK5HNsheHdI+444wSgIoNP90Z7FHygDAWSV+RWsN 17 | ibpEQxACGhtSgK6IU+9w35fXrEcTfTwyrC5lMxipS5BCkBTSNm9QfASaIZE4Oz+d 18 | Z0ifjCCeG8ppZm/kVscP08BYNsuu3xSttDDi4l0CgYEAizhcDpbFGm9X8G4+ezkV 19 | 5DZW5LBMe0jybcnwqa3tfsyrUSiVobufPfuhMtGNlddA6d1UU8cTO4uNXr0M3hKM 20 | 6pLY2BOg4w+3Z7zNdaziQY//+Fzz5UtQIjBPup37bzgfHcTg7JHvBYmo4EXM16cU 21 | eoO34AZ8AQ7xc5fOfVUCSjUCgYEA5Pn9fMVtYDz+UnTQkQOWKdZ3i8U/RFsOlMir 22 | LpUxZi87/Yg9vX9VqSJDufKd/Cjqk49O0eWsi+/ds3uxLsGoegEgGpjr7QBN/UaY 23 | 3q39XcQHP0cWgwEcRYYLGjrNG0IzHUYGnjr22D5JATYQd4cbGJj9RuFR+eGMLllT 24 | 4G65Sj0CgYEAptcid0C4Dodg2LeA+E0dduec9uK4Qj4NkeoEcTw6fBInuP9vkIU7 25 | LyHDfXKVbCTHC79oc8oQ8OpeVvH999PU15g7MFAUdjrd2MCIEWcQ9WjJr0V3sVn4 26 | Nze3kVUWRsXhIoG0yWh6SHbc/HKFhKymtxvdPnbP4qajfcCGIKuIA2c= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /pcengines/apu2/class_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjMYgKSOqUA9tgfQxkY3v3MMmLzy4LWltztxRwdA+nxH2J63TZDn3gOI6wmEBz0AsORWikCYMx7DU472/BlcCS/TSE+GcQcVJck/fXNqha9CRtL9n8aGXyBNOs+kmj6AneQIg3AzVn4gRBuOUTUSy+ApARZAwI3fZwPnYXUvRSmRFpHM8UorF8w4pgIghsUNsLWIACyO4g66eUBPLg5PUhs0GGR1fYzHaRNyFonGvLgsv40Oywi9+u0wn/mCYhYpidziZevajMPhm8KbuigSdCyFKBddOmOXUC4Qm+dpzOv6KPrrApRCHMrdSSOj31vzGGKHilWVTrrUoBt7POLK4X rminnich@xcpu 2 | -------------------------------------------------------------------------------- /pcengines/apu2/classhostkey: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEogIBAAKCAQEA20e7SsGzrPyXMosKhgXMbvIPSe27ilhgcWw4I1NWsPMWhYEU 3 | DnM66JiqImyN3tTiimwH7WewKxy4opGLbk2ohYvNQBALNXNr1cV7usAQREAIbafp 4 | zZ6mO0gcWjrdsN31aTzMmEXO3dkS+wtEQzKBe/eFjlJbutHvEQkvYWtPeHTtBlVy 5 | wcJEc59orcE+HNXrXLcPuJZF37Z5HkEMNGDWvAutHmnXc3C0cKd+bOdhpTx7DAaW 6 | Fmj1GdL7WMPBQk1qKo4uE8lqOjTB5qwCGhWPtZFgD6QwYIKtZ/VFWMzUytc6ciRw 7 | b5ob6+0+mbL3IFb1XZDbOC3gSbGPV4V0xZrVtwIDAQABAoIBABlIF+vykUishrIp 8 | Hbl+Cafw+JpJconszpHFLGPGRAR6wmn6C9nupygSEeuOIH1Ehin3cqKIheMymIcF 9 | yNGa2ocrKyrrrp8nA5POBQnvAvEbgN1Dss0mMXw8QCiXCOBPdu//NoeH5OXnFS0k 10 | i2ZD+HHWg+t4y2Kqual5KaFNwgfdHJw9vmL/JFzzx2ZuVmIiAl7Pn9dNAu3JgaT2 11 | cHNEPxw04Pc0rsNd9NiMEuaijRPJhn2ZeDAdyo+RvrK6wI0ZiopG+3ZztKhJ65zT 12 | 7si2DjLpr8PMMgYPgMFy1YyoPKokYqnoSrLXMh2Lquy75145aysWNxVa640MNfp6 13 | vrFSCqECgYEA9T5GkrZ+7DCJfaPST7lqDBB7uON0DAYaSwUSxNVsu+UMAxSlXB25 14 | fYq3TzJzM+rJcDf5JPQLP2gD2BMYQIQZeHsgoV1UKVxZfJi3YpPCg3uNWxLTzut7 15 | TGawJBFULNoIrsxh0gLSsFP4RcDTWNUe31+3sD8SirrEz+GWjF9Nc0UCgYEA5OXt 16 | uApDOx8q6XkjNwMNZZJdQ+VeDQh8Wg8mPDNKwg7VejI7idV87tn7LjAa4TcKemRi 17 | WnLMeb98h0VZiWve2UwstiI5yiZon3f7jEJDop9jvg8/Cj2MgEc2hxKxZQxIN2k3 18 | sFfYMUtTr4Q2WT3Gm3aNERpgjhJjf2dFvMJulssCgYBHSUTmXJnkOe+dT8NQXUsQ 19 | GrJ7+dG/tP5rlBvyjz8+FsQ5GQVAE3vZnDrQkI+gJb1MG1kWfsHOOoPziQlhp4Rn 20 | 2xKPFTvjke6JIzMbOmwuH/nk4UIkQZrjiG3m7gqTxwUDGnHMw/lOO/pM/FHy3nBM 21 | 6dvRJWRUYxnWe3JxdzpiKQKBgEzBLS2Bg3nXwbP4gu53f46Hve5+g0MrjUdFvTSC 22 | npbkEoGfRoe5puMRBUE/sEPFCSZxcumRhS9uHnvdrWB/Y4LKIFQStf4rUvnmadtm 23 | fPeTKwcYZbMxYGPDfW1dv057B9xM0/e1/TDKaY15cCAMrwSChFsv1SDO2b5nCuN4 24 | 70xxAoGAbRDd2cxSICb+msM17yF1rGEzvcJRI1rjiTK71Gkt2VqfBPk1belz1vY8 25 | E/KkPMHwhWEMSuCrXnaxYrLZg4cvtbYy7tC+wgn1nXwfON8Cpmm74s0O6ufeE7dh 26 | S4Bsitze0ougzTMGLQO/9M7He/fPqjM4DIi+PvfpAl/ZUXdD/48= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /pcengines/apu2/classhostkey.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbR7tKwbOs/JcyiwqGBcxu8g9J7buKWGBxbDgjU1aw8xaFgRQOczromKoibI3e1OKKbAftZ7ArHLiikYtuTaiFi81AEAs1c2vVxXu6wBBEQAhtp+nNnqY7SBxaOt2w3fVpPMyYRc7d2RL7C0RDMoF794WOUlu60e8RCS9ha094dO0GVXLBwkRzn2itwT4c1etctw+4lkXftnkeQQw0YNa8C60eaddzcLRwp35s52GlPHsMBpYWaPUZ0vtYw8FCTWoqji4TyWo6NMHmrAIaFY+1kWAPpDBggq1n9UVYzNTK1zpyJHBvmhvr7T6ZsvcgVvVdkNs4LeBJsY9XhXTFmtW3 rminnich@xcpu 2 | -------------------------------------------------------------------------------- /qemu/x86_64/.gitignore: -------------------------------------------------------------------------------- 1 | flashinitramfs.cpio 2 | flashkernel 3 | linux/ 4 | -------------------------------------------------------------------------------- /qemu/x86_64/Makefile: -------------------------------------------------------------------------------- 1 | GO_PATH := $(shell go env GOPATH) 2 | 3 | flashinitramfs.cpio: 4 | u-root -o $@ \ 5 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/boot/pxeboot \ 6 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/cat \ 7 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/elvish \ 8 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/init \ 9 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/ip \ 10 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/ls \ 11 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/kexec \ 12 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/pci \ 13 | $(value GO_PATH)/src/github.com/u-root/u-root/cmds/core/wget 14 | 15 | flashkernel: flash.config flashinitramfs.cpio 16 | cp $< linux/.config 17 | echo CONFIG_CMDLINE_BOOL=y >> linux/.config 18 | echo CONFIG_CMDLINE_OVERRIDE=y >> linux/.config 19 | echo 'CONFIG_CMDLINE="noefi ip=dhcp earlyprintk=ttyS0,115200,keep console=ttyS0,115200"' >> linux/.config 20 | (cd linux && make olddefconfig && make -j32) 21 | cp linux/arch/x86/boot/bzImage $@ 22 | 23 | testflashkernel: flashkernel flashinitramfs.cpio 24 | qemu-system-x86_64 -kernel flashkernel -nographic -initrd flashinitramfs.cpio 25 | 26 | fetch: getkernel geturoot 27 | 28 | getkernel: 29 | rm -rf linux 30 | git clone --depth=1 -b v5.8 https://github.com/torvalds/linux 31 | 32 | geturoot: 33 | go get -u github.com/u-root/u-root 34 | -------------------------------------------------------------------------------- /seeed/beaglev/BOOTCMDS: -------------------------------------------------------------------------------- 1 | fatls mmc 0:1 2 | fatload mmc 0:1 ${kernel_addr_r} Image.gz 3 | fatload mmc 0:1 ${kernel_addr_r} Image 4 | fatload mmc 0:1 ${fdt_addr_r} u-boot.dtb 5 | fatload mmc 0:1 ${ramdisk_addr_r} cpu.cpio.gz 6 | booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r} 7 | 8 | -------------------------------------------------------------------------------- /seeed/beaglev/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a kernel, uboot image, and initramfs from u-root 2 | # 3 | # sshdkernel produces a kernel with a built-in initramfs for netboot 4 | # It provides (and starts) an sshd. 5 | # ssh -i class_key -p 2022 board date 6 | # 7 | # The cpu image uses a cpud as its init, and you 8 | # can cpu to it to run commands. 9 | # to flash the flash image. 10 | # e.g. 11 | # cpu board date 12 | # cpu is way more convenient than ssh/scp if you can learn it. 13 | # you can also just 14 | # cpu board 15 | # NOTE: those commands are running on the board, and they all work 16 | # 17 | # You can test the flash image kernel with qemu 18 | # make flashtest 19 | 20 | MAJOR ?= 5 21 | STABLE = $(MAJOR).14 22 | CONFIG ?= $(MAJOR).14.esmil 23 | LINUX=linux-$(CONFIG) 24 | KERNCONFIG=$(CONFIG).config 25 | 26 | default: flash 27 | echo you can add any of these targets to the beaglev image. 28 | echo as img/nerf. You can also set priority. 29 | 30 | flash: flashkernel 31 | 32 | flashtest: testflashkernel 33 | 34 | usefultargets: 35 | echo fetch, sshdkernel, flashkernel, cpukernel, etc. 36 | 37 | sshdkernel: sshd.cpio.lzma sshd.config 38 | cp sshd.config $(LINUX)/.config 39 | (cd $(LINUX) && make oldconfig && make -j32) 40 | cp $(LINUX)/arch/x86/boot/bzImage $@ 41 | 42 | cp: cpukernel cpu.cpio.gz 43 | sudo mount /dev/sdb1 /mnt 44 | sudo cp u-boot.* Image.gz cpu.cpio.gz BOOTCMDS /mnt 45 | sudo umount /mnt 46 | 47 | cpu: cpukernel u-boot.bin u-boot.dtb cpu.cpio.gz 48 | echo Now copy these things to the stick. 49 | echo e.g. assuming it is mounted at /mnt 50 | echo sudo cp u-boot.* Image.gz cpu.cpio.gz BOOTCMDS /mnt 51 | 52 | cpukernel: cpu.config cpu.cpio Makefile 53 | cp cpu.config $(LINUX)/.config 54 | (cd $(LINUX) && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j4 oldconfig && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j4 && mkdir -p boot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv INSTALL_PATH=/tmp zinstall) 55 | cp $(LINUX)/arch/riscv/boot/Image.gz cpuImage.gz 56 | cp $(LINUX)/arch/riscv/boot/Image cpuImage 57 | 58 | readrom: 59 | echo You need to get a ROM image from *somewhere* 60 | echo Once you do, put it in ROM.bin 61 | 62 | u-boot.bin: ubootconfig 63 | (cd uboot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv u-boot.bin) 64 | cp uboot/u-boot.bin $@ 65 | 66 | u-boot.dtb: ubootconfig 67 | (cd uboot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv u-boot.dtb) 68 | cp uboot/u-boot.dtb $@ 69 | 70 | ubootconfig: Makefile 71 | (cd uboot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv starfive_vic7100_beagle_v_smode_defconfig) 72 | 73 | OLDubootconfig: Makefile 74 | echo This is idempotent 75 | sed -i 's/CONFIG_SYS_TEXT_BASE=.*/CONFIG_SYS_TEXT_BASE=0x80020000/p' uboot/configs/starfive_vic7100_beagle_v_smode_defconfig 76 | (cd uboot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv starfive_vic7100_beagle_v_smode_defconfig) 77 | 78 | writerom: image.bin 79 | echo Here is where you would do the flashrom, e.g. 80 | echo and maybe a cbfstool 81 | echo cbfstool beaglev.rom remove -n img/nerf 82 | echo cbfstool beaglev.rom add-payload -n img/nerf -f cpukernel 83 | echo sudo flashrom -p internal -w image.bin 84 | 85 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 86 | lzma -f -k $< 87 | 88 | flashinitramfs.cpio: Makefile 89 | echo NO GO111MODULE=off GOARCH=riscv64 u-root -o $@ -files ~/.ssh/cpu_rsa.pub:key.pub \ 90 | -defaultsh="" \ 91 | -uinitcmd /bbin/cpud \ 92 | github.com/u-root/u-root/cmds/core/init \ 93 | github.com/u-root/cpu/cmds/cpud 94 | GO111MODULE=off GOARCH=riscv64 u-root -o $@ -files ~/.ssh/cpu_rsa.pub:key.pub \ 95 | -uinitcmd /bbin/cpud \ 96 | github.com/u-root/u-root/cmds/core/init \ 97 | github.com/u-root/u-root/cmds/core/elvish \ 98 | github.com/u-root/cpu/cmds/cpud 99 | 100 | # This target builds a full-featured initramfs INCLUDING cpud. 101 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 102 | cpu.cpio.gz: cpu.cpio Makefile 103 | gzip -f -k cpu.cpio 104 | 105 | cpu.cpio: 106 | GO111MODULE=off GOARCH=riscv64 u-root -o cpu.cpio -files ~/.ssh/cpu_rsa.pub:key.pub \ 107 | all \ 108 | github.com/u-root/cpu/cmds/cpud 109 | 110 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 111 | # the intent is to demonstrate the capability of http loading. 112 | # It depends on the kernel setting the IP address. 113 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 114 | sshd.cpio.lzma: Makefile 115 | go run github.com/u-root/u-root -o sshd.cpio -build=bb \ 116 | -uinitcmd=/bbin/sshd \ 117 | -files class_key.pub:authorized_keys \ 118 | -files classhostkey:id_rsa \ 119 | -files /usr/bin/vi \ 120 | -files /usr/share/vim \ 121 | -files /usr/share/terminfo \ 122 | -files /bin/bash \ 123 | -files /usr/sbin/flashrom \ 124 | -files /usr/bin/xz \ 125 | all 126 | lzma -f -k sshd.cpio 127 | ls -l sshd.cpio.* 128 | 129 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 130 | cp flash-$(KERNCONFIG) $(LINUX)/.config 131 | (cd $(LINUX) && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j4 oldconfig && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j4 && mkdir -p boot && make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv INSTALL_PATH=/tmp zinstall) 132 | cp $(LINUX)/arch/riscv/boot/Image.gz flashImage.gz 133 | cp $(LINUX)/arch/riscv/boot/Image flashImage 134 | ls -l flashImage* 135 | 136 | testflashkernel: flashkernel 137 | qemu-system-x86_64 -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 138 | 139 | testcpukernel: cpukernel 140 | qemu-system-x86_64 -kernel cpukernel -nographic -serial /dev/tty 141 | 142 | # These stanzas fetch code. 143 | fetch: getkernel geturoot getrom getuboot 144 | 145 | getkernel: 146 | rm -rf $(LINUX) 147 | git clone https://github.com/starfive-tech/beagle_kernel_5.10 $(LINUX) 148 | (cd $(LINUX) && git checkout -b starfive origin/beaglev) 149 | # fyi: make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv starfive_vic7100_evb_sd_net_fedora_defconfig 150 | # Change to taste 151 | 152 | getrom: 153 | echo you can use flashrom to read the beaglev image. 154 | 155 | geturoot: 156 | go get -u github.com/u-root/u-root 157 | go get -u github.com/u-root/cpu/... 158 | 159 | getuboot: 160 | git clone https://github.com/starfive-tech/beagle_uboot-opensbi uboot 161 | 162 | packages: 163 | echo this sucks. 164 | sudo apt-get \ 165 | install \ 166 | autoconf \ 167 | automake \ 168 | autotools-dev \ 169 | bc \ 170 | bison \ 171 | build-essential \ 172 | curl \ 173 | flex \ 174 | gawk \ 175 | gdisk \ 176 | git \ 177 | gperf \ 178 | libgmp-dev \ 179 | libmpc-dev \ 180 | libmpfr-dev \ 181 | libncurses-dev \ 182 | libssl-dev \ 183 | libtool \ 184 | patchutils \ 185 | python \ 186 | screen \ 187 | texinfo \ 188 | unzip \ 189 | zlib1g-dev \ 190 | device-tree-compiler 191 | sudo apt install gcc-riscv64-linux-gnu u-boot-tools 192 | 193 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 194 | sshd-pxeserver: 195 | echo Consider Disabling any system services ... 196 | echo e.g. sudo systemctl stop tftpd-hpa.service 197 | echo e.g. sudo systemctl stop isc-dhcp-server 198 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 199 | 200 | # Serve the combined cpu-kernel and cpu-initramfs image. 201 | cpu-pxeserver: 202 | echo Consider Disabling any system services ... 203 | echo e.g. sudo systemctl stop tftpd-hpa.service 204 | echo e.g. sudo systemctl stop isc-dhcp-server 205 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 206 | 207 | ssh: 208 | ssh -i class_key -p 2022 root@up 209 | -------------------------------------------------------------------------------- /slimboot/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: 4 | echo fetch, flashkernel, or qemu 5 | 6 | qemu: flashkernel 7 | qemu-system-x86_64 -kernel flashkernel -serial stdio -monitor /dev/null 8 | 9 | flashkernel: uroot bzImage 10 | cp linux/arch/x86/boot/bzImage flashkernel 11 | 12 | uroot: 13 | go run github.com/u-root/u-root -build=bb all 14 | cp /tmp/initramfs.linux_amd64.cpio . 15 | lzma -k -f initramfs.linux_amd64.cpio 16 | ls -l initramfs* 17 | cp *lzma linux 18 | 19 | bzImage: 20 | cp config-4.14.111 linux/.config 21 | (cd linux && make oldconfig && make -j32) 22 | 23 | fetch: getkernel geturoot 24 | getkernel: 25 | rm -rf linux 26 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 27 | xzcat kernel.xz | tar x 28 | mv linux-4.14.111 linux 29 | geturoot: 30 | go get -u github.com/u-root/u-root 31 | 32 | -------------------------------------------------------------------------------- /st/st32mp1517c/.gitignore: -------------------------------------------------------------------------------- 1 | flashinitramfs.cpio 2 | flashinitramfs.cpio.lzma 3 | flashkernel 4 | linux 5 | -------------------------------------------------------------------------------- /st/st32mp1517c/Makefile: -------------------------------------------------------------------------------- 1 | # This is the makefile for a flash image, a netbootable sshd image, 2 | # and a netbootable cpu image. 3 | # 4 | # sshdkernel produces a kernel with a built-in initramfs for netboot 5 | # It provides (and starts) an sshd, and also has flashrom. 6 | # Hence you can ssh to a node, flashrom -r on it, scp the 7 | # image back, process it, scp the new image to the node, and 8 | # write with flashrom. 9 | # e.g. 10 | # ssh -i class_key -p 2022 board flashrom -r image.bin -p internal 11 | # scp -i class_key -P 2022 board:/image.bin image.bin 12 | # make tiny.bin 13 | # scp -i class_key -P 2022 tiny.bin board:/tiny.bin 14 | # ssh -i class_key -p 2022 board flashrom -w tiny.bin -p internal 15 | # 16 | # The cpu image uses a cpud as its init, and you 17 | # can cpu to it to run commands, including flashrom -p internal 18 | # to flash the flash image. 19 | # e.g. 20 | # cpu board flashrom -r image.bin -p internal 21 | # Note this writes image image.bin to the host directoy; no scp needed 22 | # make tiny.bin 23 | # cpu board flashrom -w tiny.bin -p internal 24 | # cpu is way more convenient than ssh/scp if you can learn it. 25 | # you can also just 26 | # cpu board 27 | # and once you are in: 28 | # flashrom -r image.bin -p internal 29 | # make tiny.bin 30 | # flashrom -w tiny.bin -p internal 31 | # NOTE: those commands are running on the board, and they all work 32 | # 33 | # You can test the flash image kernel with qemu 34 | # make flashtest 35 | 36 | default: flash 37 | 38 | flash: tiny.bin 39 | 40 | flashtest: testflashkernel 41 | 42 | usefultargets: 43 | echo fetch, uroot, flashkernel, or image.bin 44 | 45 | flashinitramfs.cpio.lzma: flashinitramfs.cpio 46 | lzma -f -k $< 47 | 48 | flashinitramfs.cpio: Makefile 49 | GOARCH=arm u-root -o $@ -build=bb \ 50 | -uinitcmd=/bbin/pxeboot \ 51 | github.com/u-root/u-root/cmds/boot/pxeboot \ 52 | github.com/u-root/u-root/cmds/core/cat \ 53 | github.com/u-root/u-root/cmds/core/elvish \ 54 | github.com/u-root/u-root/cmds/core/init \ 55 | github.com/u-root/u-root/cmds/core/ip \ 56 | github.com/u-root/u-root/cmds/core/ls \ 57 | github.com/u-root/u-root/cmds/core/kexec \ 58 | github.com/u-root/u-root/cmds/core/pci \ 59 | github.com/u-root/u-root/cmds/core/wget \ 60 | 61 | # this target builds an initramfs with only one program, the cpu server. 62 | # It depends on the kernel setting the IP address. 63 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 64 | cpu.cpio.lzma: Makefile 65 | GOARCH=arm go run github.com/u-root/u-root -o cpu.cpio -build=bb -initcmd=cpud -files ~/.ssh/cpu_rsa.pub:key.pub \ 66 | -defaultsh="" \ 67 | github.com/u-root/cpu/cmds/cpud 68 | lzma -f -k cpu.cpio 69 | 70 | # this target builds an initramfs with all of u-root, AND all of /bin, /usr/bin, /sbin, /usr/sbin, /etc 71 | # the intent is to demonstrate the capability of http loading. 72 | # It depends on the kernel setting the IP address. 73 | # You need ip=dhcp OR ip=fixed.ip.address.here in the command line 74 | sshd.cpio.lzma: Makefile 75 | GOARCH=arm go run github.com/u-root/u-root -o sshd.cpio -build=bb \ 76 | -uinitcmd=/bbin/sshd \ 77 | -files class_key.pub:authorized_keys \ 78 | -files classhostkey:id_rsa \ 79 | -files /usr/bin/vi \ 80 | -files /usr/share/vim \ 81 | -files /usr/share/terminfo \ 82 | -files /bin/bash \ 83 | -files /usr/sbin/flashrom \ 84 | -files /usr/bin/xz \ 85 | all 86 | lzma -f -k sshd.cpio 87 | ls -l sshd.cpio.* 88 | 89 | flashkernel: flash.config flashinitramfs.cpio.lzma Makefile 90 | cp $< linux/.config 91 | (cd linux && ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make oldconfig && ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make -j32) 92 | cp linux/arch/arm/boot/zImage $@ 93 | 94 | testflashkernel: flashkernel 95 | qemu-system-arm -machine ast2600-evb -kernel flashkernel -nographic -serial /dev/tty -initrd flashinitramfs.cpio.lzma 96 | 97 | # These stanzas fetch code. 98 | fetch: getkernel geturoot 99 | 100 | getkernel: 101 | rm -rf linux 102 | git clone --depth=1 -b working_hack --single-branch https://github.com/linuxboot/linux 103 | (cd linux && make mrproper) 104 | (cd linux && ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make tinyconfig) 105 | 106 | geturoot: 107 | go get -u github.com/u-root/u-root 108 | go get -u github.com/u-root/cpu/... 109 | 110 | # Serve the combined sshd-kernel and sshd-initramfs image. This includes flashrom 111 | sshd-pxeserver: 112 | echo Consider Disabling any system services ... 113 | echo e.g. sudo systemctl stop tftpd-hpa.service 114 | echo e.g. sudo systemctl stop isc-dhcp-server 115 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename sshdkernel -http-dir . -interface $(NETWORK) 116 | 117 | # Serve the combined cpu-kernel and cpu-initramfs image. 118 | cpu-pxeserver: 119 | echo Consider Disabling any system services ... 120 | echo e.g. sudo systemctl stop tftpd-hpa.service 121 | echo e.g. sudo systemctl stop isc-dhcp-server 122 | sudo `go env GOPATH`/bin/pxeserver -tftp-dir . -bootfilename cpukernel -http-dir . -interface $(NETWORK) 123 | 124 | ssh: 125 | ssh -i class_key -p 2022 root@up 126 | -------------------------------------------------------------------------------- /tianocore/ovmf/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16.4-buster 2 | 3 | LABEL description="Testing environment for Linuxboot in OVMF" 4 | 5 | # Install dependencies 6 | RUN apt update 7 | RUN apt install -y \ 8 | acpica-tools \ 9 | bc \ 10 | bison \ 11 | build-essential \ 12 | cpio \ 13 | flex \ 14 | kmod \ 15 | libelf-dev \ 16 | libncurses5-dev \ 17 | libssl-dev \ 18 | nasm \ 19 | qemu-system \ 20 | uuid-dev 21 | 22 | # Get the correct version of UTK 23 | RUN git clone https://github.com/linuxboot/fiano /go/src/github.com/linuxboot/fiano 24 | RUN cd /go/src/github.com/linuxboot/fiano/cmds/utk && git checkout v5.0.0 && GO111MODULE=off go install 25 | 26 | # Working directory for mounting git repo in 27 | RUN mkdir /linuxboot-ovmf 28 | WORKDIR /linuxboot-ovmf 29 | 30 | ENTRYPOINT ["/bin/bash"] 31 | -------------------------------------------------------------------------------- /tianocore/ovmf/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME := linuxboot-ovmf 2 | 3 | docker-build: Dockerfile 4 | docker build -t $(CONTAINER_NAME) -f $< . 5 | 6 | docker-run: 7 | docker run --tty --interactive --rm --volume "$(shell pwd)":/$(CONTAINER_NAME) $(CONTAINER_NAME) 8 | -------------------------------------------------------------------------------- /tyan7106/.gitignore: -------------------------------------------------------------------------------- 1 | /EATIT 2 | /DIT 3 | /bzImage 4 | *.bin 5 | /linux 6 | /chipsec.cpio 7 | 8 | -------------------------------------------------------------------------------- /tyan7106/BURN: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | echo TEST $1 5 | echo "date" > /dev/ttyUSB1 6 | echo "./0" > /dev/ttyUSB1 7 | echo "./pg" > /dev/ttyUSB1 8 | sudo ~rminnich/bin/em100 -c W25Q256FV -s -d $1 -r 9 | echo "date" > /dev/ttyUSB1 10 | echo "sleeping 50 because this piece of shit can't take it" 11 | sleep 50 12 | echo "./0" > /dev/ttyUSB1 13 | sleep 5 14 | echo "./1" > /dev/ttyUSB1 15 | sleep 10 16 | exit 0 17 | ./uinit -m tester 18 | echo "ALL DONE" 19 | -------------------------------------------------------------------------------- /tyan7106/DXECLEANER: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | echo TEST $1 5 | echo "date" > /dev/ttyUSB1 6 | echo "./0" > /dev/ttyUSB1 7 | echo "./pg" > /dev/ttyUSB1 8 | sudo ~rminnich/bin/em100 -c W25Q256FV -s -d $1 -r 9 | echo "date" > /dev/ttyUSB1 10 | echo "sleeping 50 because this piece of shit can't take it" 11 | sleep 50 12 | echo "./0" > /dev/ttyUSB1 13 | sleep 5 14 | echo "./1" > /dev/ttyUSB1 15 | sleep 10 16 | ./uinit -m tester 17 | echo "ALL DONE" 18 | -------------------------------------------------------------------------------- /tyan7106/L: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ~/go/bin/utk dxeclean.bin find 5AAB83E5-F027-4CA7-BFD0-16358CC9E453 \ 3 | find 55E76644-78A5-4A82-A900-7126A5798892 \ 4 | find E8F6A75C-3CDA-4B00-9837-8CA2A1F34EAC \ 5 | find 67820532-7613-4DD3-9ED7-3D9BE3A7DA63 \ 6 | find 899407D7-99FE-43D8-9A21-79EC328CAC21 \ 7 | find 1B08A1DB-F91A-4FA1-A911-255C417F1CF7 \ 8 | find 16D0A23E-C09C-407D-A14A-AD058FDD0CA1 \ 9 | find BDCE85BB-FBAA-4F4E-9264-501A2C249581 \ 10 | find FA20568B-548B-4B2B-81EF-1BA08D4A3CEC \ 11 | find 4E82091E-32A1-4689-8A00-CDE41ED63CDD \ 12 | find 4A3602BC-1A05-4C82-99B4-588CD2A32CD5 \ 13 | find 76D5CF91-0C55-434E-97C2-D2825C82E610 \ 14 | find 734E8BE9-4801-4A31-A3FA-D61CCB601CA9 \ 15 | find 80E66E0A-CCD1-43FA-A7B1-2D5EE0F13910 \ 16 | find 502B04F3-71AB-47B4-BEAE-4736EA190AA4 \ 17 | find CDC1C80D-E6D3-4A42-9229-75F3BEFCF109 \ 18 | find DCB2CE8E-73A7-4962-B2FD-95688B5A5BDD \ 19 | find 271B424E-A4CC-4E0E-90A2-7EA4841F12F3 \ 20 | find A210F973-229D-4F4D-AA37-9895E6C9EABA \ 21 | find 9F3A0016-AE55-4288-829D-D55FD3AAC347 \ 22 | find 70E1A818-0BE1-4449-BFD4-9EF68C7F02A8 \ 23 | find A062CF1F-8473-4AA3-8793-600BC4FFE9A8 \ 24 | find E0471A15-76DC-4203-8B27-6DB4F8BA644A \ 25 | find B7EE4835-84CE-4B15-BF52-2D11574CE470 \ 26 | find 81A4F912-E72F-44ED-8931-16A9FE9650E0 \ 27 | find 999BD818-7DF7-4A9A-A502-9B75033E6A0F \ 28 | find C9A6DE36-FDFF-4FAF-8343-85D9E3470F43 \ 29 | find 59AF16B0-661D-4865-A381-38DE68385D8D \ 30 | find 87AB821C-79B8-4EF6-A913-21D22063F55F \ 31 | find 64A11188-5B86-4F59-A702-73365896E65E \ 32 | find 76A7B4FC-C8D5-462D-A4D2-6E88338A772A \ 33 | find AA7B4695-00B4-4468-AD92-99370AC031C5 \ 34 | find E2441B64-7EF4-41FE-B3A3-8CAA7F8D3017 \ 35 | find 7F8D35BD-0CE3-4654-B5D3-73FC4B38AABF \ 36 | find 2E6A521C-F697-402D-9774-98B2B7E140F3 \ 37 | find 62DC08AC-A651-4EE9-AF81-EAA9261E9780 \ 38 | find 536DF136-BD96-4E1E-ADF5-6B637C139063 \ 39 | find F282DD45-CA7B-40EC-9618-99381C08F409 \ 40 | find 6A3DEF38-0A45-4107-A74E-ABF2B8EAED86 \ 41 | find 6B6FD380-2C55-42C6-98BF-CBBC5A9AA666 \ 42 | find BCEA6548-E204-4486-8F2A-36E13C7838CE \ 43 | 44 | exit 0 45 | 46 | | jq -r '..|.UUID?|select(type=="string")' | sort -u 47 | -------------------------------------------------------------------------------- /tyan7106/LIST: -------------------------------------------------------------------------------- 1 | remove AB7ED12E-1D78-4635-AB87-23F00A911EC7 \ 2 | remove 8F4B8F82-9B91-4028-86E6-F4DB7D4C1DFF \ 3 | remove 53BCC14F-C24F-434C-B294-8ED2D4CC1860 \ 4 | remove 9B680FCE-AD6B-4F3A-B60B-F59899003443 \ 5 | remove CD3BAFB6-50FB-4FE8-8E4E-AB74D2C1A600 \ 6 | remove 13AC6DD0-73D0-11D4-B06B-00AA00BD6DE7 \ 7 | remove 348C4D62-BFBD-4882-9ECE-C80BB1C4783B \ 8 | remove C10194E7-DEB2-4AF4-9EEE-BFFDE4D7D4C7 \ 9 | remove A19B1FE7-C1BC-49F8-875F-54A5D542443F \ 10 | remove 62D171CB-78CD-4480-8678-C6A2A797A8DE \ 11 | remove 79CA4208-BBA1-4A9A-8456-E1E66A81484E \ 12 | remove 378D7B65-8DA9-4773-B6E4-A47826A833E1 \ 13 | remove 40BEAB40-CECE-4909-B133-20A413AE19E9 \ 14 | remove 63809859-F029-41C3-9F34-EEEB9EA787A5 \ 15 | 16 | -------------------------------------------------------------------------------- /tyan7106/Makefile: -------------------------------------------------------------------------------- 1 | GOPATH ?= $(HOME)/go 2 | 3 | default: build 4 | 5 | build: 6 | echo fetch, uroot, flashkernel, or image.bin 7 | 8 | image.bin: flashkernel 9 | cp linux/arch/x86/boot/bzImage flashkernel 10 | $(GOPATH)/bin/utk tyan7106.bin \ 11 | remove Ip.* \ 12 | remove Tcp.* \ 13 | remove Usb.* \ 14 | remove Udp.* \ 15 | remove Dhcp.* \ 16 | remove .np.* \ 17 | remove .tftp.* \ 18 | remove Http.* \ 19 | remove .*Dns.* \ 20 | remove Arp.* \ 21 | remove .*NetworkStackSetupScreen.* \ 22 | remove Iscsi.* \ 23 | remove Scsi.* \ 24 | remove Fat.* \ 25 | remove Ahci.* \ 26 | remove Partition.* \ 27 | remove Sata.* \ 28 | remove Disk.* \ 29 | remove Whea.* \ 30 | remove .*Pxe.* \ 31 | remove Ata.* \ 32 | remove AMITSE \ 33 | replace_pe32 FullShell flashkernel \ 34 | save image.bin 35 | 36 | flashkernel: uroot bzImage 37 | cp linux/arch/x86/boot/bzImage flashkernel 38 | 39 | uroot: 40 | u-root -files key.pub:key.pub -files key.pub:authorized_keys -files ssh_host_rsa_key:id_rsa github.com/u-root/u-root/cmds/core/* github.com/u-root/cpu/cmds/cpu 41 | cp /tmp/initramfs.linux_amd64.cpio . 42 | lzma -k -f initramfs.linux_amd64.cpio 43 | ls -l initramfs* 44 | cp *lzma linux 45 | 46 | bzImage: 47 | cp config-4.14.111 linux/.config 48 | (cd linux && make oldconfig && make -j32) 49 | 50 | fetch: 51 | rm -rf linux 52 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.111.tar.xz 53 | xzcat kernel.xz | tar x 54 | mv linux-4.14.111 linux 55 | go get -u github.com/linuxboot/fiano/cmds/utk 56 | wget ftp://ftp.tyan.com/bios/S7106GM2NR-L2_v204.zip 57 | unzip S7106GM2NR-L2_v204.zip 58 | cp 7106V204.ROM tyan7106.bin 59 | go get -u github.com/u-root/u-root 60 | go get -u github.com/u-root/cpu/... 61 | 62 | # everything from here below was part of an experiment and can be ignored. 63 | experiment: 64 | echo b to build, i for initramfs, q for qemu, d to dxeclean 65 | 66 | b: buildbzimage 67 | 68 | d: 69 | ForthUTK tyan7106.bin fv 'AMITSE|Ata.*|Disk.*|.*Ftp.*|.*Dhcp.*|Tcp.*|.*Pxe.*|.*Udp.*' ix r r tag /tmp/x saverom /tmp/x fv linux/arch/x86/boot/bzImage splat drop /tmp/x saverom ./DXECLEANER clean 70 | 71 | d98: 72 | ForthUTK 98.splat fv ./DXECLEANER clean 73 | 74 | d4: 75 | ForthUTK RUN4.4.rom fv ./DXECLEANER clean 76 | 77 | buildbzimage: 78 | (cd linux && make -j32 && ls -l arch/x86/boot/bzImage) 79 | 80 | i: 81 | (cd $(GOPATH)/src/github.com/linuxboot/dut/uinit/&&go build) 82 | cp $(GOPATH)/src/github.com/linuxboot/dut/uinit/uinit . 83 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files id_rsa.pub github.com/linuxboot/dut/uinit github.com/u-root/u-root/cmds/init github.com/u-root/u-root/xcmds/rush github.com/u-root/u-root/cmds/ls github.com/u-root/u-root/cmds/ip github.com/u-root/u-root/cmds/elvish github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/cmds/scp 84 | cp /tmp/initramfs.linux_amd64.cpio . 85 | lzma -k -f initramfs.linux_amd64.cpio 86 | ls -l initramfs* 87 | cp *lzma linux 88 | 89 | burn: bigi b 90 | ForthUTK remove100.rom fv linux/arch/x86/boot/bzImage splat remove100big.rom saverom < /dev/null 91 | ./BURN remove100big.rom 92 | 93 | bigi: 94 | (cd $(GOPATH)/src/github.com/linuxboot/dut/uinit/&&go build) 95 | cp $(GOPATH)/src/github.com/linuxboot/dut/uinit/uinit . 96 | go run $(GOPATH)/src/github.com/u-root/u-root -build=bb -files key.pub minimal github.com/linuxboot/dut/uinit github.com/u-root/u-root/xcmds/sshd github.com/u-root/u-root/xcmds/pox github.com/u-root/u-root/cmds/scp github.com/u-root/u-root/cmds/cpio 97 | cp /tmp/initramfs.linux_amd64.cpio . 98 | lzma -k -f initramfs.linux_amd64.cpio 99 | ls -l initramfs* 100 | cp *lzma linux 101 | 102 | cleanme: 103 | $(GOPATH)/bin/utk dxeclean.bin dxecleaner_blacklist ./DXECLEANER ./blacklist 104 | 105 | q: 106 | /usr/bin/qemu-system-x86_64 -kernel linux/arch/x86/boot/bzImage -serial stdio -monitor /dev/null -m 8192 -nographic 107 | findit: 108 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated ' < xxx 109 | jq -c 'to_entries[] | .value | select(.Type == "EFI_FV_FILETYPE_DRIVER") | .Sections [] | .Encapsulated[1] | [.Value.Name]'< xxx 110 | 111 | all: 112 | $(GOPATH)/bin/utk tyan7106.bin \ 113 | remove Ip.* \ 114 | remove Tcp.* \ 115 | remove Usb.* \ 116 | remove Udp.* \ 117 | remove Dhcp.* \ 118 | remove .np.* \ 119 | remove .tftp.* \ 120 | remove Http.* \ 121 | remove .*Dns.* \ 122 | remove Arp.* \ 123 | remove .*NetworkStackSetupScreen.* \ 124 | remove Iscsi.* \ 125 | remove Scsi.* \ 126 | remove Fat.* \ 127 | remove Ahci.* \ 128 | remove Partition.* \ 129 | remove Sata.* \ 130 | remove Disk.* \ 131 | remove Whea.* \ 132 | remove .*Pxe.* \ 133 | remove Ata.* \ 134 | replace_pe32 FullShell bzImage \ 135 | save x.bin \ 136 | remove .*Ipmi.* \ 137 | save ipmisucks.bin \ 138 | remove DxeIpmiBmcInitialize \ 139 | remove SmmBmcElog \ 140 | remove BmcAcpi \ 141 | remove SmmIpmiBmcInitialize \ 142 | remove BmcElog \ 143 | remove BmcLanConfig \ 144 | save removeBMCcrap.bin \ 145 | remove SecurityStubDxe \ 146 | save removesomecrap.bin \ 147 | comment TimestampDxe \ 148 | comment Legacy8259 \ 149 | comment HiiDatabase \ 150 | comment DataHubDxe \ 151 | comment EnglishDxe \ 152 | comment here \ 153 | comment PcRtc \ 154 | comment FpgaDxe \ 155 | comment LegacyInterrupt \ 156 | comment SmartTimer \ 157 | comment LegacySredir \ 158 | comment LegacyRegion2 \ 159 | comment TcgLegacy \ 160 | comment LegacySmmSredir \ 161 | comment DevicePathDxe \ 162 | comment CpuIo2Dxe \ 163 | comment CpuMpDxe \ 164 | comment SmmAccess \ 165 | comment WdtDxe \ 166 | save commentmorecrap.bin \ 167 | comment SetupConfigUpdateDxeNeonCityEPRP \ 168 | comment StaticSkuDataDxeNeonCityEPRP \ 169 | comment OpromUpdateDxeNeonCityEPRP \ 170 | comment SmbiosDataUpdateDxeNeonCityEPRP \ 171 | comment IioCfgUpdateDxeNeonCityEPRP \ 172 | comment SlotDataUpdateDxeNeonCityEPRP \ 173 | comment SetupConfigUpdateDxeLightningRidgeEXRP \ 174 | comment StaticSkuDataDxeLightningRidgeEXRP \ 175 | comment OpromUpdateDxeLightningRidgeEXRP \ 176 | comment SmbiosDataUpdateDxeLightningRidgeEXRP \ 177 | comment IioCfgUpdateDxeLightningRidgeEXRP \ 178 | comment SlotDataUpdateDxeLightningRidgeEXRP \ 179 | comment OpromUpdateDxeNeonCityFPGA \ 180 | comment SetupConfigUpdateDxeNeonCityFPGA \ 181 | comment SmbiosDataUpdateDxeNeonCityFPGA \ 182 | comment StaticSkuDataDxeNeonCityFPGA \ 183 | comment IioCfgUpdateDxeNeonCityFPGA \ 184 | comment SlotDataUpdateDxeNeonCityFPGA \ 185 | comment FpgaConfigDataDxeNeonCityFPGA \ 186 | comment IioCfgUpdateDxeLightningRidgeEXECB1 \ 187 | comment OpromUpdateDxeLightningRidgeEXECB1 \ 188 | comment SetupConfigUpdateDxeLightningRidgeEXECB1 \ 189 | comment SlotDataUpdateDxeLightningRidgeEXECB1 \ 190 | comment SmbiosDataUpdateDxeLightningRidgeEXECB1 \ 191 | comment StaticSkuDataDxeLightningRidgeEXECB1 \ 192 | comment IioCfgUpdateDxeLightningRidgeEXECB2 \ 193 | comment OpromUpdateDxeLightningRidgeEXECB2 \ 194 | comment SetupConfigUpdateDxeLightningRidgeEXECB2 \ 195 | comment SlotDataUpdateDxeLightningRidgeEXECB2 \ 196 | comment SmbiosDataUpdateDxeLightningRidgeEXECB2 \ 197 | comment StaticSkuDataDxeLightningRidgeEXECB2 \ 198 | comment IioCfgUpdateDxeLightningRidgeEXECB3 \ 199 | comment OpromUpdateDxeLightningRidgeEXECB3 \ 200 | comment SetupConfigUpdateDxeLightningRidgeEXECB3 \ 201 | comment SlotDataUpdateDxeLightningRidgeEXECB3 \ 202 | comment SmbiosDataUpdateDxeLightningRidgeEXECB3 \ 203 | comment StaticSkuDataDxeLightningRidgeEXECB3 \ 204 | comment IioCfgUpdateDxeLightningRidgeEXECB4 \ 205 | comment OpromUpdateDxeLightningRidgeEXECB4 \ 206 | comment SetupConfigUpdateDxeLightningRidgeEXECB4 \ 207 | comment SlotDataUpdateDxeLightningRidgeEXECB4 \ 208 | comment SmbiosDataUpdateDxeLightningRidgeEXECB4 \ 209 | comment StaticSkuDataDxeLightningRidgeEXECB4 \ 210 | comment IioCfgUpdateDxeNeonCityEPECB \ 211 | comment OpromUpdateDxeNeonCityEPECB \ 212 | comment SetupConfigUpdateDxeNeonCityEPECB \ 213 | comment SlotDataUpdateDxeNeonCityEPECB \ 214 | comment SmbiosDataUpdateDxeNeonCityEPECB \ 215 | comment StaticSkuDataDxeNeonCityEPECB \ 216 | save commentsetupcrap.bin \ 217 | comment PchSerialGpio \ 218 | comment PchSmbusDxe \ 219 | comment IioInit \ 220 | comment PpmInitialize \ 221 | comment CpuArchDxe \ 222 | comment PchInitDxe \ 223 | comment start_dxecleaner \ 224 | remove AB7ED12E-1D78-4635-AB87-23F00A911EC7 \ 225 | save fail.bin \ 226 | comment HeciInitDxe \ 227 | comment SpsDxe \ 228 | comment SpsSmm \ 229 | comment Aint13 \ 230 | comment Setup \ 231 | comment ServerMgmtSetup \ 232 | comment ACPI \ 233 | comment S3SaveStateDxe \ 234 | comment BootScriptExecutorDxe \ 235 | comment SioDxeInit \ 236 | comment OA3 \ 237 | comment OptionRomPolicy \ 238 | comment PciRootBridge \ 239 | comment PciDxeInit \ 240 | comment PciOutOfResourceSetupPage \ 241 | comment RuntimeMemoryHoleVar \ 242 | comment ExportHiiDb \ 243 | comment DpcDxe \ 244 | comment AmiBoardInfo2 \ 245 | comment ReFlash \ 246 | comment CsmDxe \ 247 | comment UbaConfigDatabaseDxe \ 248 | comment HardwareSignatureEntry \ 249 | comment KbcEmulDxe \ 250 | comment EsrtDxe \ 251 | comment NvmeInt13 \ 252 | comment OpalSecurity \ 253 | comment AcpiPlatform \ 254 | comment AcpiVTD \ 255 | comment PlatformCpuPolicy \ 256 | comment PciPlatform \ 257 | comment PlatformEarlyDxe \ 258 | comment PlatformType \ 259 | comment S3NvramSave \ 260 | comment UuidDxe \ 261 | comment OpaPlatCfg \ 262 | comment MemorySubClass \ 263 | comment SocketSetup \ 264 | comment FpgaSocketSetup \ 265 | comment HstiPlatformDxe \ 266 | comment HstiIhvProviderDxe \ 267 | comment IsPlatformSupportWhea \ 268 | comment OemVtdRmrr \ 269 | comment MePolicyInitDxe \ 270 | comment SpsAcpiHooks \ 271 | comment Platform \ 272 | comment FpkSetup \ 273 | comment SystemBoardDxe \ 274 | comment UbaInitDxe \ 275 | comment CsmRt32 \ 276 | comment AmiRedFishApi \ 277 | comment AmiDeviceGuardApi \ 278 | comment TxtDxe \ 279 | comment Smbios \ 280 | comment SmbiosBoard \ 281 | comment SmbiosGetFlashData \ 282 | comment AmiTcgNvflagSample \ 283 | comment AmiTcgPlatformDxe \ 284 | comment TcgDxeplatform \ 285 | comment Tpm20PlatformDxe \ 286 | comment Tpm20Acpi \ 287 | comment TpmSmbiosDxe \ 288 | comment Uhcd \ 289 | comment SBDXE \ 290 | comment Metronome \ 291 | comment WatchdogTimer \ 292 | comment CpuIoDxe \ 293 | comment CRBDxe \ 294 | comment EndlessbootDxe \ 295 | comment TyanDxe \ 296 | comment TyanBadDimmDxe \ 297 | comment S7106_PROJECT_DXE \ 298 | comment CapsuleRuntimeDxe \ 299 | comment RuntimeDxe \ 300 | comment PiSmmIpl \ 301 | comment CpuCsrAccess \ 302 | comment CrystalRidge \ 303 | comment JedecNvDimm \ 304 | comment PchResetRuntime \ 305 | comment SmmControl \ 306 | comment CryptoDXE \ 307 | comment GenericElog \ 308 | comment PlatformReset \ 309 | comment SvSmmSupport \ 310 | comment TraceHubStatusCodeHandlerRuntimeDxe \ 311 | comment SmiFlashDxe \ 312 | comment ConSplitter \ 313 | comment GraphicsConsole \ 314 | comment GenericSio \ 315 | comment PciBus \ 316 | comment TerminalSrc \ 317 | comment SerialIo \ 318 | comment CsmBlockIo \ 319 | comment CsmVideo \ 320 | comment IScsiDxe \ 321 | comment PostReport \ 322 | comment DcScreen \ 323 | comment Nvme \ 324 | comment PiSmmCore \ 325 | comment FlashDriverSmm \ 326 | comment NvramSmm \ 327 | comment CpuIo2Smm \ 328 | comment SmmLockBox \ 329 | comment PcRtcSmm \ 330 | comment PiSmmCpuDxeSmm \ 331 | comment MemRas \ 332 | comment CpuCsrAccessSMM \ 333 | comment CrystalRidgeSMM \ 334 | comment JedecNvDimmSMM \ 335 | comment IioSmm \ 336 | comment FpgaSmm \ 337 | comment HwpLvtSmm \ 338 | comment SmbusRecovery \ 339 | comment QuiesceSupport \ 340 | comment PchInitSmm \ 341 | comment PchSmiDispatcher \ 342 | comment PchSmbusSmm \ 343 | comment HeciSmm \ 344 | comment Heci3Smm \ 345 | comment CryptoSMM \ 346 | comment MicrocodeUpdate \ 347 | comment SmmS3SaveState \ 348 | comment SmmGenericSio \ 349 | comment OA3_SMM \ 350 | comment SmmPciRbIo \ 351 | comment RuntimeMemoryHoleSmm \ 352 | comment SmiVariable \ 353 | comment RuntimeSmm \ 354 | comment SmmGenericElog \ 355 | comment KbcEmul \ 356 | comment NvmeSmm \ 357 | comment Ofbd \ 358 | comment AcpiSmmPlatform \ 359 | comment PowerButtonHandler \ 360 | comment EmcaErrorLog \ 361 | comment PartialMirrorHandler \ 362 | comment MainErrorHandler \ 363 | comment PlatformErrorHandler \ 364 | comment ProcessorErrorHandler \ 365 | comment AmiErrorHandlerMain \ 366 | comment FpgaErrorHandler \ 367 | comment PcieErrorHandler \ 368 | comment PcieErrorEnable \ 369 | comment McBankErrorInjection \ 370 | comment LastBootErrorLog \ 371 | comment SvSmmHandler \ 372 | comment TraceHubStatusCodeHandlerSmm \ 373 | comment RTCWakeup \ 374 | comment SmbiosDmiEdit \ 375 | comment SmiFlash \ 376 | comment TcgSmm \ 377 | comment TpmClearOnRollbackSmm \ 378 | comment TcoSmi \ 379 | comment AcpiModeEnable \ 380 | comment PiSmmCommunicationSmm \ 381 | comment TyanNvdimmAdrTrigger \ 382 | comment FullShell \ 383 | comment StatusCodeDxe \ 384 | comment StatusCodeSmm \ 385 | comment FlashDriver \ 386 | comment NvramDxe \ 387 | comment PcdDxe \ 388 | comment DxeSelStatusCode \ 389 | comment DxeFrb \ 390 | comment CmosDxe \ 391 | comment RegAccessDxe \ 392 | comment RegAccessSMM \ 393 | comment SecureBootDXE \ 394 | comment TcgDxe \ 395 | comment Tcg2Dxe \ 396 | comment TcgPlatformSetupPolicy \ 397 | comment TyanBoardDXE \ 398 | comment AMITSE \ 399 | comment AMITSESetupData \ 400 | comment OPAPlatConfigSkt0 \ 401 | comment OPAPlatConfigSkt1 \ 402 | comment PeiCore 403 | -------------------------------------------------------------------------------- /tyan7106/NOTES: -------------------------------------------------------------------------------- 1 | GPIO control functions in 2 | /usr/libexec/itami-host-power-control-common.sh 3 | 4 | /bin/reset works but I can't get power button to do anything useful. 5 | 6 | if I remove CsmDxe, then I can't warm reboot from the kernel 7 | 8 | The power cycle bits are a mess, DXECLEANER now has a reliable one. 9 | -------------------------------------------------------------------------------- /tyan7106/bin.reset: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this is the reset script for the BMC so we don't have to deal with awful 3 | # curl scripts. 4 | sleep 1 5 | echo 0 > /sys/class/gpio/gpio315/value 6 | sleep 1 7 | echo 1 > /sys/class/gpio/gpio315/value 8 | sleep 5 9 | echo 0 > /sys/class/gpio/gpio315/value 10 | -------------------------------------------------------------------------------- /tyan7106/blacklist: -------------------------------------------------------------------------------- 1 | 3FFCAE95-23CF-4967-94F5-16352F68E43B 2 | 13F4EA8E-BFF1-43BF-8F44-80BCC96040F1 3 | 274F0C8F-9E57-41D8-9966-29CCD48D31C2 4 | C1C418F9-591D-461C-82A2-B9CD96DFEA86 5 | DE23ACEE-CF55-4FB6-AA77-984AB53DE823 6 | FC1B7640-3466-4C06-B1CC-1C935394B5C2 7 | 90CB75DB-71FC-489D-AACF-943477EC7212 8 | WdtDxe 9 | HeciInitDxe 10 | SpsDxe 11 | Aint13 12 | Setup 13 | ServerMgmtSetup 14 | .*ACPI.* 15 | S3SaveStateDxe 16 | BootScriptExecutorDxe 17 | SioDxeInit 18 | LegacySredir 19 | OA3 20 | OptionRomPolicy 21 | PciRootBridge 22 | PciDxeInit 23 | PciOutOfResourceSetupPage 24 | RuntimeMemoryHoleVar 25 | ExportHiiDb 26 | DpcDxe 27 | AmiBoardInfo2 28 | ReFlash 29 | CsmDxe 30 | UbaConfigDatabaseDxe 31 | HardwareSignatureEntry 32 | KbcEmulDxe 33 | EsrtDxe 34 | NvmeInt13 35 | OpalSecurity 36 | .*Acpi.* 37 | PlatformCpuPolicy 38 | LegacyRegion2 39 | PciPlatform 40 | PlatformEarlyDxe 41 | PlatformType 42 | S3NvramSave 43 | UuidDxe 44 | OpaPlatCfg 45 | MemorySubClass 46 | SocketSetup 47 | FpgaSocketSetup 48 | 49 | -------------------------------------------------------------------------------- /tyan7106/chipsec-4.13.0-rc7.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxboot/mainboards/8e04ab8f21fce057958bd062514dbeebdfe437c6/tyan7106/chipsec-4.13.0-rc7.ko -------------------------------------------------------------------------------- /tyan7106/chipsec_out: -------------------------------------------------------------------------------- 1 | 2019/01/10 22:38:05 os.Args is [uname -p 2> /dev/null]: you need to specify which command to invoke. 2 | [*] Ignoring unsupported platform warning and continue execution 3 | ################################################################ 4 | ## ## 5 | ## CHIPSEC: Platform Hardware Security Assessment Framework ## 6 | ## ## 7 | ################################################################ 8 | [CHIPSEC] Version 1.3.5.dev1 9 | [CHIPSEC] Arguments: -i 10 | [CHIPSEC] API mode: using OS native API (not using CHIPSEC kernel module) 11 | ERROR: Unsupported Platform: VID = 0x8086, DID = 0x2020 12 | ERROR: Platform is not supported (Unsupported Platform: VID = 0x8086, DID = 0x2020). 13 | WARNING: Platform dependent functionality is likely to be incorrect 14 | [CHIPSEC] OS : Linux 4.13.0-rc7-onie+ #125 SMP Thu Jan 10 15:35:51 PST 2019 x86_64 15 | [CHIPSEC] Platform: UnknownPlatform 16 | [CHIPSEC] VID: 8086 17 | [CHIPSEC] DID: 2020 18 | 19 | [*] loading common modules from ".home.rminnich.projects.NERF.chipsec.chipsec.modules.common" .. 20 | [+] loaded chipsec.modules.common.spi_lock 21 | [+] loaded chipsec.modules.common.spi_fdopss 22 | [+] loaded chipsec.modules.common.spi_desc 23 | [+] loaded chipsec.modules.common.spi_access 24 | [+] loaded chipsec.modules.common.smrr 25 | [+] loaded chipsec.modules.common.smm 26 | [+] loaded chipsec.modules.common.rtclock 27 | [+] loaded chipsec.modules.common.ia32cfg 28 | [+] loaded chipsec.modules.common.bios_wp 29 | [+] loaded chipsec.modules.common.bios_ts 30 | [+] loaded chipsec.modules.common.bios_smi 31 | [+] loaded chipsec.modules.common.bios_kbrd_buffer 32 | [+] loaded chipsec.modules.common.uefi.s3bootscript 33 | [+] loaded chipsec.modules.common.uefi.access_uefispec 34 | [+] loaded chipsec.modules.common.secureboot.variables 35 | [*] No platform specific modules to load 36 | [*] loading modules from ".home.rminnich.projects.NERF.chipsec.chipsec.modules" .. 37 | [+] loaded chipsec.modules.smm_dma 38 | [+] loaded chipsec.modules.remap 39 | [+] loaded chipsec.modules.memconfig 40 | [*] running loaded modules .. 41 | 42 | [*] running module: chipsec.modules.common.spi_lock 43 | [x][ ======================================================================= 44 | [x][ Module: SPI Flash Controller Configuration Lock 45 | [x][ ======================================================================= 46 | ERROR: Exception occurred during chipsec.modules.common.spi_lock.run(): ''FlashLockDown'' 47 | 48 | [*] running module: chipsec.modules.common.spi_fdopss 49 | [x][ ======================================================================= 50 | [x][ Module: SPI Flash Descriptor Security Override Pin-Strap 51 | [x][ ======================================================================= 52 | ERROR: Couldn't find definition of required configuration registers (HSFS) 53 | 54 | [*] running module: chipsec.modules.common.spi_desc 55 | [x][ ======================================================================= 56 | [x][ Module: SPI Flash Region Access Control 57 | [x][ ======================================================================= 58 | ERROR: Exception occurred during chipsec.modules.common.spi_desc.run(): ''FRAP'' 59 | 60 | [*] running module: chipsec.modules.common.spi_access 61 | ERROR: Exception occurred during chipsec.modules.common.spi_access.run(): ''HSFS'' 62 | 63 | [*] running module: chipsec.modules.common.smrr 64 | [x][ ======================================================================= 65 | [x][ Module: CPU SMM Cache Poisoning / System Management Range Registers 66 | [x][ ======================================================================= 67 | ERROR: Couldn't find definition of required configuration registers 68 | 69 | [*] running module: chipsec.modules.common.smm 70 | [x][ ======================================================================= 71 | [x][ Module: Compatible SMM memory (SMRAM) Protection 72 | [x][ ======================================================================= 73 | ERROR: Couldn't find definition of required registers (PCI0.0.0_SMRAMC) 74 | 75 | [*] running module: chipsec.modules.common.rtclock 76 | Skipping module chipsec.modules.common.rtclock since it is not supported in this platform 77 | 78 | [*] running module: chipsec.modules.common.ia32cfg 79 | [x][ ======================================================================= 80 | [x][ Module: IA32 Feature Control Lock 81 | [x][ ======================================================================= 82 | [*] Verifying IA32_Feature_Control MSR is locked on all logical CPUs.. 83 | ERROR: Exception occurred during chipsec.modules.common.ia32cfg.run(): ''Ia32FeatureControlLock'' 84 | 85 | [*] running module: chipsec.modules.common.bios_wp 86 | ERROR: Exception occurred during chipsec.modules.common.bios_wp.run(): ''HSFS'' 87 | 88 | [*] running module: chipsec.modules.common.bios_ts 89 | [x][ ======================================================================= 90 | [x][ Module: BIOS Interface Lock (including Top Swap Mode) 91 | [x][ ======================================================================= 92 | ERROR: BiosInterfaceLockDown (BILD) control is not defined 93 | 94 | [*] running module: chipsec.modules.common.bios_smi 95 | [x][ ======================================================================= 96 | [x][ Module: SMI Events Configuration 97 | [x][ ======================================================================= 98 | ERROR: Couldn't find definition of required configuration registers 99 | 100 | [*] running module: chipsec.modules.common.bios_kbrd_buffer 101 | [x][ ======================================================================= 102 | [x][ Module: Pre-boot Passwords in the BIOS Keyboard Buffer 103 | [x][ ======================================================================= 104 | [*] Keyboard buffer head pointer = 0x1E (at 0x41A), tail pointer = 0x1E (at 0x41C) 105 | [*] Keyboard buffer contents (at 0x41E): 106 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 107 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 108 | [*] Checking contents of the keyboard buffer.. 109 | 110 | [+] PASSED: Keyboard buffer looks empty. Pre-boot passwords don't seem to be exposed 111 | 112 | [*] running module: chipsec.modules.common.uefi.s3bootscript 113 | [x][ ======================================================================= 114 | [x][ Module: S3 Resume Boot-Script Protections 115 | [x][ ======================================================================= 116 | [+] Didn't find any S3 boot-scripts in EFI variables 117 | [!] WARNING: S3 Boot-Script was not found. Firmware may be using other ways to store/locate it 118 | 119 | [*] running module: chipsec.modules.common.uefi.access_uefispec 120 | [x][ ======================================================================= 121 | [x][ Module: Access Control of EFI Variables 122 | [x][ ======================================================================= 123 | [*] Testing UEFI variables .. 124 | 125 | [-] Variables with attributes that differ from UEFI spec: 126 | 127 | [+] PASSED: All checked EFI variables are protected according to spec. 128 | 129 | [*] running module: chipsec.modules.common.secureboot.variables 130 | [x][ ======================================================================= 131 | [x][ Module: Attributes of Secure Boot EFI Variables 132 | [x][ ======================================================================= 133 | [!] Secure Boot variable SecureBoot is not found 134 | [!] Secure Boot variable SetupMode is not found 135 | [!] Secure Boot variable PK is not found 136 | [!] Secure Boot variable KEK is not found 137 | [!] Secure Boot variable db is not found 138 | [!] Secure Boot variable dbx is not found 139 | 140 | [*] Secure Boot appears to be disabled 141 | [*] SKIPPED: None of required Secure Boot variables found. Secure Boot is not enabled 142 | 143 | [*] running module: chipsec.modules.smm_dma 144 | [x][ ======================================================================= 145 | [x][ Module: SMM TSEG Range Configuration Check 146 | [x][ ======================================================================= 147 | ERROR: Exception occurred during chipsec.modules.smm_dma.run(): ''PCI0.0.0_TSEGMB'' 148 | 149 | [*] running module: chipsec.modules.remap 150 | Skipping module chipsec.modules.remap since it is not supported in this platform 151 | 152 | [*] running module: chipsec.modules.memconfig 153 | Skipping module chipsec.modules.memconfig since it is not supported in this platform 154 | 155 | [CHIPSEC] *************************** SUMMARY *************************** 156 | [CHIPSEC] Time elapsed 0.014 157 | [CHIPSEC] Modules total 18 158 | [CHIPSEC] Modules failed to run 11: 159 | ERROR: chipsec.modules.common.spi_lock 160 | ERROR: chipsec.modules.common.spi_fdopss 161 | ERROR: chipsec.modules.common.spi_desc 162 | ERROR: chipsec.modules.common.spi_access 163 | ERROR: chipsec.modules.common.smrr 164 | ERROR: chipsec.modules.common.smm 165 | ERROR: chipsec.modules.common.ia32cfg 166 | ERROR: chipsec.modules.common.bios_wp 167 | ERROR: chipsec.modules.common.bios_ts 168 | ERROR: chipsec.modules.common.bios_smi 169 | ERROR: chipsec.modules.smm_dma 170 | [CHIPSEC] Modules passed 2: 171 | [+] PASSED: chipsec.modules.common.bios_kbrd_buffer 172 | [+] PASSED: chipsec.modules.common.uefi.access_uefispec 173 | [CHIPSEC] Modules failed 0: 174 | [CHIPSEC] Modules with warnings 1: 175 | [!] WARNING: chipsec.modules.common.uefi.s3bootscript 176 | [CHIPSEC] Modules skipped 4: 177 | [*] SKIPPED: chipsec.modules.common.rtclock 178 | [*] SKIPPED: chipsec.modules.common.secureboot.variables 179 | [*] SKIPPED: chipsec.modules.remap 180 | [*] SKIPPED: chipsec.modules.memconfig 181 | [CHIPSEC] Modules with Exceptions 6: 182 | ERROR: chipsec.modules.common.spi_lock 183 | ERROR: chipsec.modules.common.spi_desc 184 | ERROR: chipsec.modules.common.spi_access 185 | ERROR: chipsec.modules.common.ia32cfg 186 | ERROR: chipsec.modules.common.bios_wp 187 | ERROR: chipsec.modules.smm_dma 188 | [CHIPSEC] ***************************************************************** 189 | Exception: python exited with 51 190 | , line 1: python /home/rminnich/projects/NERF/chipsec/chipsec_main.py -i 191 | -------------------------------------------------------------------------------- /tyan7106/pox.tcz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxboot/mainboards/8e04ab8f21fce057958bd062514dbeebdfe437c6/tyan7106/pox.tcz -------------------------------------------------------------------------------- /walmart/robot/.gitignore: -------------------------------------------------------------------------------- 1 | BAK.TAR 2 | *~ 3 | SFS/ 4 | bak/ 5 | build-arm-sfs.sh 6 | linux/ 7 | netbooturoot.cpio 8 | netbooturoot.sfs 9 | webboot 10 | wifi 11 | 12 | -------------------------------------------------------------------------------- /walmart/robot/Makefile: -------------------------------------------------------------------------------- 1 | MAJOR ?= 5 2 | STABLE = $(MAJOR).10 3 | CONFIG ?= $(MAJOR).10.0 4 | default: netbooturoot.sfs 5 | 6 | cp:netbooturoot.sfs 7 | sudo mount /dev/sdb1 /mnt 8 | sudo cp netbooturoot.sfs /mnt/ 9 | sudo umount /mnt 10 | 11 | build: 12 | echo fetch, uroot, flashkernel, or image.bin 13 | 14 | image.bin: flashkernel coreboot.bin 15 | cp coreboot.bin image.bin 16 | chmod +w image.bin 17 | cbfstool image.bin print 18 | cbfstool image.bin remove -n img/nerf 19 | cbfstool image.bin remove -n genroms/pxe.rom 20 | cbfstool image.bin add-payload -n img/nerf -f flashkernel 21 | cbfstool image.bin print 22 | 23 | uCore: netbooturoo.cpio 24 | mkimage -A arm -n 'u-root for Allwinner A10' -d netbooturoot.cpio -T ramdisk uCore 25 | 26 | qemu: uCore flashkernel 27 | qemu-system-arm -kernel flashkernel -machine cubieboard -serial stdio -initrd uCore -append 'console=ttyS0 earlyprintk=ttyS0,115200,keep' 28 | echo NO 29 | exit 0 30 | qemu-system-arm -kernel uImage -machine cubieboard -serial stdio -initrd initramfs.linux_arm.cpio 31 | echo NO 32 | exit 0 33 | sudo /usr/bin/qemu-system-x86_64 -kernel flashkernel \ 34 | -cpu max \ 35 | -s \ 36 | -m 1024m \ 37 | -machine q35 \ 38 | -object rng-random,filename=/dev/urandom,id=rng0 \ 39 | -device virtio-rng-pci,rng=rng0 \ 40 | -device e1000,netdev=n1 \ 41 | -netdev user,id=n1,hostfwd=tcp:127.0.0.1:23-:2222,net=192.168.1.0/24,host=192.168.1.1 \ 42 | -serial stdio \ 43 | -append earlyprintk=ttyS0,115200\ console=ttyS0 \ 44 | -monitor /dev/null \ 45 | 46 | 47 | # add the following line to qemu if you want to snoop packets. 48 | -object filter-dump,id=f1,netdev=n1,file=/tmp/vm0.pcap \ 49 | 50 | 51 | netbootkernel: netbooturoot.cpio bzImage 52 | cp linux/arch/arm/boot/bzImage kernel 53 | 54 | readrom: 55 | sudo flashrom -p internal -r coreboot.bin 56 | 57 | writerom: image.bin 58 | sudo flashrom -p internal -w image.bin 59 | 60 | netbooturoot.sfs: netbooturoot.cpio 61 | sudo rm -rf SFS 62 | mkdir -p SFS 63 | (cd SFS && sudo cpio -iv < ../$<) 64 | rm -f $@ 65 | sudo mksquashfs SFS $@ -comp xz 66 | 67 | netbooturoot.cpio: Makefile 68 | GOARCH=arm go build -o wifi github.com/u-root/webboot/cmds/wifi 69 | GOARCH=arm go build -o webboot github.com/u-root/webboot/cmds/webboot 70 | GOARCH=arm u-root -build=bb \ 71 | -o $@ \ 72 | -files ~/.ssh/cpu_rsa.pub:key.pub \ 73 | -files ~/.ssh/cpu_rsa:id_rsa \ 74 | -files ~/.ssh/authorized_keys:authorized_keys \ 75 | -files ~/arm/etc:etc \ 76 | -files ~/arm/bin:bin \ 77 | -files ~/arm/sbin:sbin \ 78 | -files ~/arm/usr:usr \ 79 | -files bak/drv/8188fu.ko.lzma:8188fu.ko.lzma \ 80 | -files boot:boot \ 81 | -files bootSCREEN \ 82 | -files wifi \ 83 | -files webboot \ 84 | all \ 85 | github.com/u-root/cpu/cmds/cpud 86 | 87 | # for later: 88 | #mkdir /tmp/r 89 | # mkdir /tmp/m 90 | # mount -t vfat /dev/mmcblk0p1 /tmp/m 91 | # mount -t squashfs /tmp/m/u-root-victure.sfs /tmp/r 92 | 93 | uroot: 94 | GOARCH=arm u-root -build=bb \ 95 | -files ~/.ssh/cpu_rsa.pub:key.pub \ 96 | all \ 97 | github.com/u-root/cpu/cmds/cpu 98 | cp /tmp/initramfs.linux_arm.cpio cpu.cpio 99 | 100 | flashkernel: Makefile 101 | cp config-$(CONFIG) linux/.config 102 | (cd linux && ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make oldconfig && ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j32) 103 | mkimage -C none -A arm -n 'walmart robot' -d linux/arch/arm/boot/zImage -T flashkernel -a 0xc1000000 -e 0xc1000000 flashkernel 104 | cp linux/arch/arm/boot/zImage kernel 105 | 106 | fetch: getkernel geturoot getfiano getrom getpackages 107 | 108 | getpackages: 109 | sudo apt install gcc-9-arm-linux-gnueabihf gcc-10-multilib-arm-linux-gnueabihf 110 | 111 | getkernel: 112 | rm -rf linux 113 | wget -O kernel.xz https://cdn.kernel.org/pub/linux/kernel/v$(MAJOR).x/linux-$(STABLE).tar.xz 114 | xzcat kernel.xz | tar x 115 | mv linux-$(STABLE) linux 116 | 117 | getrom: 118 | echo you create the kernel 119 | echo on the APU2: flashrom -r coreboot.bin -p internal 120 | echo copy that file here and for safety: 121 | echo chmod a-w coreboot.bin 122 | geturoot: 123 | go get -u github.com/u-root/u-root 124 | getfiano: 125 | go get -u github.com/linuxboot/fiano/cmds/utk 126 | go install github.com/linuxboot/fiano/cmds/utk 127 | -------------------------------------------------------------------------------- /walmart/robot/boot: -------------------------------------------------------------------------------- 1 | # u root 2 | echo screen fucks up the boot args, do this first step in minicom. 3 | # setenv bootargs 'console=ttySGK0,115200 mem=36M rootfstype=squashfs root=/dev/mtdblock2 init=linuxrc mtdparts=gk_flash:320K(U),1664K(K),1152K(R),384K(C),-(A) single' 4 | # fatload mmc 0 0xc1000000 uimage-goke-g1702s-9p 5 | # bootm 6 | cat >/dev/null << EOF 7 | mount /dev 8 | mount /sys 9 | mount /tmp 10 | mount /proc 11 | mdev -s 12 | mkdir /tmp/r 13 | mkdir /tmp/m 14 | mount -t vfat /dev/mmcblk0p1 /tmp/m 15 | mount -t squashfs /tmp/m/netbooturoot.sfs /tmp/r 16 | EOF 17 | 18 | # Now the script 19 | # just run /tmp/r/boot 20 | echo EXIT and run SCREEN 21 | exit 0 22 | 23 | /tmp/r/wifi 24 | mount -o bind /dev /tmp/r/dev 25 | mount -o bind /sys /tmp/r/sys 26 | mount -o bind /proc /tmp/r/proc 27 | /tmp/r/bbin/chroot /tmp/r/ /init 28 | cpud -d -init& 29 | 30 | ### 31 | 32 | HERE 33 | modprobe /bak/drv/gkptz-2823.ko.lzma 34 | insmod !$ 35 | insmod /bak/drv/gkptz-2823.ko.lzma 36 | insmod /bak/drv/8188fu.ko.lzma 37 | insmod /bak/drv/GobiNet.ko.lzma 38 | ifconfig -a 39 | history 40 | # the standard system 41 | setenv bootargs 'console=ttySGK0,115200 mem=36M rootfstype=squashfs root=/dev/mtdblock2 init=linuxrc mtdparts=gk_flash:320K(U),1664K(K),1152K(R),384K(C),-(A) single' 42 | sf probe;sf read 0xc1000000 0x50000 0x1A0000;bootm 0xc1000000; 43 | 44 | GK7102S # printenv 45 | [PROCESS_SEPARATORS] printenv 46 | arm_freq=0x00112032 47 | baudrate=115200 48 | bootargs=console=ttySGK0,115200 mem=36M rootfstype=squashfs root=/dev/mtdblock2 init=linuxrc mtdparts=gk_flash:320K(U),1664K(K),1152K(R),384K(C),-(A) 49 | bootcmd=sf probe;sf read 0xc1000000 0x50000 0x1A0000;bootm 0xc1000000; 50 | bootdelay=1 51 | bootfile=zImage 52 | bsbsize=1M 53 | consoledev=ttySGK0 54 | ethact=gk7101 55 | ethaddr=3C:97:0E:22:E1:14 56 | gatewayip=11.1.4.1 57 | hostname="gk7102" 58 | ipaddr=192.168.11.34 59 | loadaddr=0xC1000000 60 | mem=36M 61 | netdev=eth0 62 | netmask=255.255.255.0 63 | nfsserver=11.1.4.19 64 | phytype=0 65 | rootfstype=ubi.mtd=3 rootfstype=ubifs root=ubi0:rootfs 66 | rootpath=/opt/work 67 | serverip=192.168.11.100 68 | sfboot=setenv bootargs console=${consoledev},${baudrate} noinitrd mem=${mem} rw ${rootfstype} init=linuxrc ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev} mac=${ethaddr} phytype=${phytype};sf probe 0 0;sf read ${loadaddr} ${sfkernem 69 | sfkernel=0x50000 70 | stderr=serial 71 | stdin=serial 72 | stdout=serial 73 | tftpboot=setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:${rootpath},proto=tcp,nfsvers=3,nolock ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev} mac=${ethaddr} phytype=${phytype} console=${consoledev},${baudrate} mem=${mem};tftpbm 74 | 75 | Environment size: 1270/65532 bytes 76 | -------------------------------------------------------------------------------- /walmart/robot/bootSCREEN: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | insmod /tmp/r/8188fu.ko.lzma 4 | mkdir /tmp/var 5 | # PATH="/bak/ap:$PATH" /bak/ap/start-ap.sh gokewifi 6 | ifconfig -a 7 | TERM=screen 8 | /tmp/r/bbin/stty rows 24 cols 80 9 | PATH=$PATH:/tmp/r/bbin:/tmp/r 10 | /tmp/r/wifi 11 | mount -o bind /dev /tmp/r/dev 12 | mount -o bind /sys /tmp/r/sys 13 | mount -o bind /proc /tmp/r/proc 14 | /tmp/r/bbin/chroot /tmp/r/ /init 15 | cpud -d -init& 16 | 17 | --------------------------------------------------------------------------------