Permalink
Browse files

Make init try to find squashfs on existing rootfs before trying to se…

…arch other devices
  • Loading branch information...
NiKiZe committed Jul 16, 2016
1 parent 6d23e8d commit e97479ddbd02075e1ed44e39460b9aa3b85ac306
Showing with 12 additions and 0 deletions.
  1. +12 −0 mainfiles/init
@@ -831,6 +831,18 @@ sysresccd_find_file() # $1=devtype, $2=filepath $3=mountdir, $4=mode
mountdir="$3" # where to mount the device if we find it
mountmode="$4" # mount mode: either 'ro' or 'rw'

case "${devtype}" in
auto) # extra search on rootfs
if [ -e ${filepath} ]
then
SEARCHDEVICE="/"
ln -s ${filepath} ${mountdir}
good_msg "File ${filepath} found on already mounted filesystem, link created in ${mountdir}"
return 0
fi
;;
esac

searchdevices="$(sysresccd_find_devices ${devtype})"

SEARCHDEVICE='' # result returned

1 comment on commit e97479d

@NiKiZe

This comment has been minimized.

Copy link
Owner

NiKiZe commented on e97479d Jul 16, 2016

@fdupoux first, sorry for try to reach a systemrescuecd maintainer in this manner.

Made a post on the forum a while back: https://www.system-rescue-cd.org/forums/viewtopic.php?f=18&t=5922 asking for advice on how we could automate the boot process when we load the squashfs sysrcd.dat by it's own cpio and loaded on The root fs.

This is the code I came up with, would be great if it could be merged to main sysrcd so me, @robinsmidsrod and others who boots systemrescuecd with iPXE, can do so easier.

minimal ipxe example

#!ipxe
isset ${kbmap} || set kbmap us
cpuid --ext 29 && set bitn 64 || set bitn 32

kernel altker${bitn} initrd=initram.igz initrd=sysrcd.dat edd=off vga=791 scandelay=0 dodhcp setkmap=${kbmap} nomdadm nodmraid rootpass=l

initrd initram.igz
initrd -n sysrcd.dat sysrcd.dat.cpio

boot

More examples of how we currently do it can be seen in the forum post
Also for completeness, my latest efi compatible boot script: http://b800.org/sysr/sysrcd.efi.ipxe

Final version of script that is currently in use today; http://b800.org/sysr/sysrcd.ipxe

Please sign in to comment.