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} ]
ln -s ${filepath} ${mountdir}
good_msg "File ${filepath} found on already mounted filesystem, link created in ${mountdir}"
return 0

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

SEARCHDEVICE='' # result returned

1 comment on commit e97479d


This comment has been minimized.

Copy link

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: 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

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


More examples of how we currently do it can be seen in the forum post
Also for completeness, my latest efi compatible boot script:

Final version of script that is currently in use today;

Please sign in to comment.