Add support for building as a coreboot payload
This commit is contained in:
parent
f482e41008
commit
0c56ae16e8
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -34,3 +34,6 @@
|
||||||
path = relibc
|
path = relibc
|
||||||
url = https://gitlab.redox-os.org/redox-os/relibc.git
|
url = https://gitlab.redox-os.org/redox-os/relibc.git
|
||||||
branch = master
|
branch = master
|
||||||
|
[submodule "bootloader-coreboot"]
|
||||||
|
path = bootloader-coreboot
|
||||||
|
url = https://gitlab.redox-os.org/redox-os/bootloader-coreboot.git
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -3,6 +3,8 @@ include mk/config.mk
|
||||||
|
|
||||||
all: build/harddrive.bin
|
all: build/harddrive.bin
|
||||||
|
|
||||||
|
coreboot: build/coreboot.elf
|
||||||
|
|
||||||
live: build/livedisk.bin
|
live: build/livedisk.bin
|
||||||
|
|
||||||
iso: build/livedisk.iso
|
iso: build/livedisk.iso
|
||||||
|
|
1
bootloader-coreboot
Submodule
1
bootloader-coreboot
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit f88d1c95e27c4ae6ce5bcc6ffeaf561811c88d47
|
304
config/coreboot.toml
Normal file
304
config/coreboot.toml
Normal file
|
@ -0,0 +1,304 @@
|
||||||
|
# This is the default configuration file
|
||||||
|
|
||||||
|
# General settings
|
||||||
|
[general]
|
||||||
|
# Do not prompt if settings are not defined
|
||||||
|
prompt = false
|
||||||
|
|
||||||
|
# Package settings
|
||||||
|
[packages]
|
||||||
|
#acid = {}
|
||||||
|
#audiod = {}
|
||||||
|
#autoconf = {}
|
||||||
|
#automake = {}
|
||||||
|
#bash = {}
|
||||||
|
#binutils = {}
|
||||||
|
#ca-certificates = {}
|
||||||
|
#cairo = {}
|
||||||
|
#cairodemo = {}
|
||||||
|
#cargo = {}
|
||||||
|
#cleye = {}
|
||||||
|
#cmatrix = {}
|
||||||
|
#contain = {}
|
||||||
|
coreutils = {}
|
||||||
|
#cpal = {}
|
||||||
|
#curl = {}
|
||||||
|
#dash = {}
|
||||||
|
#diffutils = {}
|
||||||
|
#dosbox = {}
|
||||||
|
#drivers = {}
|
||||||
|
#drivers-041 = {}
|
||||||
|
#duktape = {}
|
||||||
|
#eduke32 = {}
|
||||||
|
#exampled = {}
|
||||||
|
#expat = {}
|
||||||
|
#extrautils = {}
|
||||||
|
#fd = {}
|
||||||
|
#ffmpeg = {}
|
||||||
|
#findutils = {}
|
||||||
|
#freeciv = {}
|
||||||
|
#freedoom = {}
|
||||||
|
#freeglut = {}
|
||||||
|
#freetype = {}
|
||||||
|
#friar = {} # mio patch
|
||||||
|
#game-2048 = {}
|
||||||
|
#games = {}
|
||||||
|
#gawk = {}
|
||||||
|
#gcc = {}
|
||||||
|
#gears = {}
|
||||||
|
#generaluser-gs = {}
|
||||||
|
#gettext = {}
|
||||||
|
#gigalomania = {}
|
||||||
|
#git = {}
|
||||||
|
#glib = {}
|
||||||
|
#glium = {}
|
||||||
|
#glutin = {}
|
||||||
|
#gnu-binutils = {}
|
||||||
|
#gnu-grep = {}
|
||||||
|
#gnu-make = {}
|
||||||
|
#gstreamer = {}
|
||||||
|
#harfbuzz = {}
|
||||||
|
#hematite = {}
|
||||||
|
#init = {}
|
||||||
|
#installer = {}
|
||||||
|
ion = {}
|
||||||
|
ipcd = {}
|
||||||
|
#jansson = {}
|
||||||
|
#keyboard-sfx = {}
|
||||||
|
#lci = {}
|
||||||
|
#libc-bench = {}
|
||||||
|
#libffi = {}
|
||||||
|
#libiconv = {}
|
||||||
|
#libjpeg = {}
|
||||||
|
#liborbital = {}
|
||||||
|
#libpng = {}
|
||||||
|
#libsodium = {}
|
||||||
|
#llvm = {}
|
||||||
|
#logd = {}
|
||||||
|
#lua = {}
|
||||||
|
#mdp = {}
|
||||||
|
#mesa = {}
|
||||||
|
#mesa_glu = {}
|
||||||
|
#miniserve = {}
|
||||||
|
#nasm = {}
|
||||||
|
#ncdu = {}
|
||||||
|
#ncurses = {}
|
||||||
|
#ncursesw = {}
|
||||||
|
#netdb = {}
|
||||||
|
#netstack = {}
|
||||||
|
#netsurf = {}
|
||||||
|
#netutils = {}
|
||||||
|
#newlib = {}
|
||||||
|
#newlibtest = {}
|
||||||
|
nulld = {}
|
||||||
|
#openjazz = {}
|
||||||
|
#openssl = {}
|
||||||
|
#openttd = {}
|
||||||
|
#openttd-opengfx = {}
|
||||||
|
#openttd-openmsx = {}
|
||||||
|
#openttd-opensfx = {}
|
||||||
|
orbdata = {}
|
||||||
|
orbital = {}
|
||||||
|
orbterm = {}
|
||||||
|
orbutils = {}
|
||||||
|
#osdemo = {}
|
||||||
|
#pastel = {}
|
||||||
|
#patch = {}
|
||||||
|
#pcre = {}
|
||||||
|
#periodictable = {}
|
||||||
|
#perl = {}
|
||||||
|
#pixelcannon = {}
|
||||||
|
#pixman = {}
|
||||||
|
#pkgutils = {}
|
||||||
|
#powerline = {}
|
||||||
|
#prboom = {}
|
||||||
|
ptyd = {}
|
||||||
|
#python = {}
|
||||||
|
#qemu = {}
|
||||||
|
randd = {}
|
||||||
|
#readline = {} # ncurses
|
||||||
|
#redoxfs = {}
|
||||||
|
#redox-ssh = {}
|
||||||
|
#relibc = {}
|
||||||
|
#ripgrep = {}
|
||||||
|
#rodioplay = {}
|
||||||
|
#rs-nes = {}
|
||||||
|
#rust = {}
|
||||||
|
#rust64 = {}
|
||||||
|
#rust-cairo = {}
|
||||||
|
#rust-cairo-demo = {}
|
||||||
|
#rustual-boy = {}
|
||||||
|
#schismtracker = {}
|
||||||
|
#scummvm = {}
|
||||||
|
#sdl = {}
|
||||||
|
#sdl2 = {}
|
||||||
|
#sdl_gfx = {}
|
||||||
|
#sdl_image = {}
|
||||||
|
#sdl_mixer = {}
|
||||||
|
#sdl_ttf = {}
|
||||||
|
#sdl-player = {}
|
||||||
|
#sed = {}
|
||||||
|
#servo = {}
|
||||||
|
#shellstorm = {}
|
||||||
|
#smith = {}
|
||||||
|
#sodium = {}
|
||||||
|
#sopwith = {}
|
||||||
|
#ssh = {}
|
||||||
|
#syobonaction = {}
|
||||||
|
#terminfo = {}
|
||||||
|
#termplay = {}
|
||||||
|
#timidity = {}
|
||||||
|
#ttf-hack = {}
|
||||||
|
#userutils = {}
|
||||||
|
uutils = {}
|
||||||
|
#vim = {}
|
||||||
|
#vttest = {}
|
||||||
|
#webrender = {}
|
||||||
|
#winit = {}
|
||||||
|
#xz = {}
|
||||||
|
zerod = {}
|
||||||
|
#zlib = {}
|
||||||
|
|
||||||
|
# User settings
|
||||||
|
[users.root]
|
||||||
|
password = "password"
|
||||||
|
uid = 0
|
||||||
|
gid = 0
|
||||||
|
name = "root"
|
||||||
|
home = "/root"
|
||||||
|
|
||||||
|
[users.user]
|
||||||
|
# Password is unset
|
||||||
|
password = ""
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/init.d/00_base"
|
||||||
|
data = """
|
||||||
|
nulld
|
||||||
|
zerod
|
||||||
|
randd
|
||||||
|
ipcd
|
||||||
|
#logd
|
||||||
|
ptyd
|
||||||
|
#pcid /etc/pcid/filesystem.toml
|
||||||
|
"""
|
||||||
|
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/init.d/10_net"
|
||||||
|
# data = """
|
||||||
|
# smolnetd
|
||||||
|
# dnsd
|
||||||
|
# dhcpd -b
|
||||||
|
# """
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/init.d/20_orbital"
|
||||||
|
data = """
|
||||||
|
#audiod
|
||||||
|
orbital display:2/activate orblogin launcher
|
||||||
|
"""
|
||||||
|
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/init.d/30_console"
|
||||||
|
# data = """
|
||||||
|
# getty display:2
|
||||||
|
# getty debug: -J
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/net/dns"
|
||||||
|
# data = """
|
||||||
|
# 208.67.222.222
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/net/ip"
|
||||||
|
# data = """
|
||||||
|
# 10.0.2.15
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/net/ip_router"
|
||||||
|
# data = """
|
||||||
|
# 10.0.2.2
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/net/ip_subnet"
|
||||||
|
# data = """
|
||||||
|
# 255.255.255.0
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/net/mac"
|
||||||
|
# data = """
|
||||||
|
# 54-52-00-ab-cd-ef
|
||||||
|
# """
|
||||||
|
#
|
||||||
|
# [[files]]
|
||||||
|
# path = "/etc/pkg.d/50_redox"
|
||||||
|
# data = "https://static.redox-os.org/pkg"
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/group"
|
||||||
|
data = """
|
||||||
|
root;0;root
|
||||||
|
user;1000;user
|
||||||
|
sudo;1;user
|
||||||
|
"""
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/hostname"
|
||||||
|
data = """
|
||||||
|
redox
|
||||||
|
"""
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/issue"
|
||||||
|
data = """
|
||||||
|
########## Redox OS ##########
|
||||||
|
# Login with the following: #
|
||||||
|
# `user` #
|
||||||
|
# `root`:`password` #
|
||||||
|
##############################
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/etc/motd"
|
||||||
|
data = """
|
||||||
|
Welcome to Redox OS!
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/usr/bin"
|
||||||
|
data = "/bin"
|
||||||
|
symlink = true
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/usr/games"
|
||||||
|
data = "/games"
|
||||||
|
symlink = true
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/usr/include"
|
||||||
|
data = "/include"
|
||||||
|
symlink = true
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/usr/lib"
|
||||||
|
data = "/lib"
|
||||||
|
symlink = true
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/usr/share"
|
||||||
|
data = "/share"
|
||||||
|
symlink = true
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path = "/tmp"
|
||||||
|
data = ""
|
||||||
|
directory= true
|
||||||
|
# 0o1777
|
||||||
|
mode = 1023
|
27
initfs_coreboot.toml
Normal file
27
initfs_coreboot.toml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# This is the default configuration file
|
||||||
|
|
||||||
|
# General settings
|
||||||
|
[general]
|
||||||
|
# Do not prompt if settings are not defined
|
||||||
|
prompt = false
|
||||||
|
|
||||||
|
# Package settings
|
||||||
|
[packages]
|
||||||
|
drivers = {}
|
||||||
|
init = {}
|
||||||
|
redoxfs = {}
|
||||||
|
|
||||||
|
[[files]]
|
||||||
|
path="/etc/init.rc"
|
||||||
|
data="""
|
||||||
|
export PATH /bin
|
||||||
|
export TMPDIR /tmp
|
||||||
|
vesad T G
|
||||||
|
stdio display:1
|
||||||
|
ps2d us
|
||||||
|
pcid /etc/pcid/initfs.toml
|
||||||
|
redoxfs disk/live: file
|
||||||
|
cd file:
|
||||||
|
export PATH file:/bin
|
||||||
|
run.d /etc/init.d
|
||||||
|
"""
|
|
@ -24,6 +24,12 @@ build/livedisk.iso: build/livedisk.bin.gz
|
||||||
build/iso/
|
build/iso/
|
||||||
isohybrid $@
|
isohybrid $@
|
||||||
|
|
||||||
|
bootloader-coreboot/build/bootloader: build/kernel_coreboot
|
||||||
|
$(MAKE) -C bootloader-coreboot clean build/bootloader KERNEL="$(ROOT)/$<"
|
||||||
|
|
||||||
|
build/coreboot.elf: bootloader-coreboot/build/bootloader
|
||||||
|
cp $< $@
|
||||||
|
|
||||||
bootloader-efi/build/redox_bootloader/boot.efi:
|
bootloader-efi/build/redox_bootloader/boot.efi:
|
||||||
$(MAKE) -C bootloader-efi build/redox_bootloader/boot.efi
|
$(MAKE) -C bootloader-efi build/redox_bootloader/boot.efi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,14 @@ build/initfs.tag: initfs.toml prefix
|
||||||
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/
|
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
build/initfs_coreboot.tag: initfs_coreboot.toml prefix
|
||||||
|
rm -f build/libkernel_coreboot.a
|
||||||
|
rm -rf build/initfs_coreboot
|
||||||
|
mkdir -p build/initfs_coreboot
|
||||||
|
export PATH="$(PREFIX_PATH):$$PATH" && \
|
||||||
|
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_coreboot/
|
||||||
|
touch $@
|
||||||
|
|
||||||
build/initfs_live.tag: initfs_live.toml prefix
|
build/initfs_live.tag: initfs_live.toml prefix
|
||||||
rm -f build/libkernel_live.a
|
rm -f build/libkernel_live.a
|
||||||
rm -rf build/initfs_live
|
rm -rf build/initfs_live
|
||||||
|
|
12
mk/kernel.mk
12
mk/kernel.mk
|
@ -4,6 +4,12 @@ build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*
|
||||||
cd kernel && \
|
cd kernel && \
|
||||||
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 --emit link=../$@
|
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 --emit link=../$@
|
||||||
|
|
||||||
|
build/libkernel_coreboot.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_coreboot.tag
|
||||||
|
export PATH="$(PREFIX_PATH):$$PATH" && \
|
||||||
|
export INITFS_FOLDER=$(ROOT)/build/initfs_coreboot && \
|
||||||
|
cd kernel && \
|
||||||
|
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 --emit link=../$@
|
||||||
|
|
||||||
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_live.tag
|
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_live.tag
|
||||||
export PATH="$(PREFIX_PATH):$$PATH" && \
|
export PATH="$(PREFIX_PATH):$$PATH" && \
|
||||||
export INITFS_FOLDER=$(ROOT)/build/initfs_live && \
|
export INITFS_FOLDER=$(ROOT)/build/initfs_live && \
|
||||||
|
@ -16,6 +22,12 @@ build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
|
||||||
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
|
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
|
||||||
$(OBJCOPY) --strip-debug $@
|
$(OBJCOPY) --strip-debug $@
|
||||||
|
|
||||||
|
build/kernel_coreboot: kernel/linkers/$(ARCH).ld build/libkernel_coreboot.a build/live.o
|
||||||
|
export PATH="$(PREFIX_PATH):$$PATH" && \
|
||||||
|
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_coreboot.a build/live.o && \
|
||||||
|
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
|
||||||
|
$(OBJCOPY) --strip-debug $@
|
||||||
|
|
||||||
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
|
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
|
||||||
export PATH="$(PREFIX_PATH):$$PATH" && \
|
export PATH="$(PREFIX_PATH):$$PATH" && \
|
||||||
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
|
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
|
||||||
|
|
Loading…
Reference in a new issue