clean up /proc/cmdline with dracut and allow dracut to boot with secure mode to fix #1261

This commit is contained in:
Josh Burks
2024-06-18 08:08:28 -07:00
committed by Jonathon Anderson
parent 2b82c2074a
commit d62743ee11
4 changed files with 11 additions and 7 deletions

View File

@@ -8,6 +8,8 @@ do
if [ -n "${archive}" ] if [ -n "${archive}" ]
then then
info "Loading ${archive}" info "Loading ${archive}"
(curl --silent -L "${archive}" | gzip -d | cpio -im --directory="${NEWROOT}") || die "Unable to load ${archive}" #Load only runtime overlays from a static privledge port
[[ "$archive" == *"runtime"* ]] && localport="--local-port 986" || localport=""
(curl --silent $localport -L "${archive}" | gzip -d | cpio -im --directory="${NEWROOT}") || die "Unable to load ${archive}"
fi fi
done done

View File

@@ -14,7 +14,7 @@ depends() {
} }
install() { install() {
inst_multiple cpio curl inst_multiple cpio curl dmidecode
inst_hook cmdline 30 "$moddir/parse-wwinit.sh" inst_hook cmdline 30 "$moddir/parse-wwinit.sh"
inst_hook pre-mount 30 "$moddir/load-wwinit.sh" inst_hook pre-mount 30 "$moddir/load-wwinit.sh"
} }

View File

@@ -6,10 +6,12 @@
if [ "${root}" = "wwinit" ] if [ "${root}" = "wwinit" ]
then then
info "root=${root}" info "root=${root}"
export wwinit_container=$(getarg wwinit.container=); info "wwinit.container=${wwinit_container}" export wwinit_uri="http://$(getarg wwinit.uri)/provision/$(getarg wwid)?assetkey=$(dmidecode -s chassis-asset-tag)&uuid=$(dmidecode -s system-uuid)&stage="
export wwinit_system=$(getarg wwinit.system=); info "wwinit.system=${wwinit_system}" export wwinit_container="${wwinit_uri}container&compress=gz"; info "wwinit.container=${wwinit_container}"
export wwinit_runtime=$(getarg wwinit.runtime=); info "wwinit.runtime=${wwinit_runtime}" export wwinit_system="${wwinit_uri}system&compress=gz"; info "wwinit.system=${wwinit_system}"
export wwinit_kmods=$(getarg wwinit.kmods=); info "wwinit.kmods=${wwinit_kmods}" export wwinit_runtime="${wwinit_uri}runtime&compress=gz"; info "wwinit.runtime=${wwinit_runtime}"
wwinit_kmods_passed=$(getarg wwinit.kmods=)
[ -n "$wwinit_kmods_passed" ] && export wwinit_kmods="${wwinit_uri}kmods&compress=gz"; info "wwinit.kmods=${wwinit_kmods}"
wwinit_tmpfs_size=$(getarg wwinit.tmpfs.size=) wwinit_tmpfs_size=$(getarg wwinit.tmpfs.size=)
if [ -n "$wwinit_tmpfs_size" ] if [ -n "$wwinit_tmpfs_size" ]

View File

@@ -29,7 +29,7 @@ echo Downloading initramfs
initrd --name initramfs ${uri}&stage=initramfs || goto reboot initrd --name initramfs ${uri}&stage=initramfs || goto reboot
set dracut_net rd.neednet=1 {{range $devname, $netdev := .NetDevs}}{{if and $netdev.Hwaddr $netdev.Device}} ifname={{$netdev.Device}}:{{$netdev.Hwaddr}} {{end}}{{end}} set dracut_net rd.neednet=1 {{range $devname, $netdev := .NetDevs}}{{if and $netdev.Hwaddr $netdev.Device}} ifname={{$netdev.Device}}:{{$netdev.Hwaddr}} {{end}}{{end}}
set dracut_wwinit root=wwinit wwinit.container=${uri}&stage=container&compress=gz wwinit.system=${uri}&stage=system&compress=gz wwinit.runtime=${uri}&stage=runtime&compress=gz {{if ne .KernelOverride ""}}wwinit.kmods=${uri}&stage=kmods&compress=gz{{end}} init=/init set dracut_wwinit root=wwinit wwinit_uri={{.Ipaddr}}:{{.Port}} {{if ne .KernelOverride ""}}wwinit.kmods=true{{end}} init=/init
echo Booting initramfs echo Booting initramfs
#echo Network KernelArgs: ${dracut_net} #echo Network KernelArgs: ${dracut_net}