mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2026-01-03 15:20:19 +01:00
Fix using findroot when /sbin/init is an absolute symlink (#340)
Also add basic safeguards against bad usrmerge implementations: that would be when /sbin is a absolute symlink instead of a relative one.
This commit is contained in:
parent
aa8a7b0aa2
commit
99fb673748
|
|
@ -4,6 +4,7 @@ SystemRescue ChangeLog
|
|||
------------------------------------------------------------------------------
|
||||
10.03 (YYYY-MM-DD):
|
||||
------------------------------------------------------------------------------
|
||||
* Fix using findroot when /sbin/init is an absolute symlink (#340)
|
||||
* Added sleuthkit (Tools for raw file system inspection) (#349)
|
||||
* Added timeshift (snapshot-based backup solution) (#350)
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,15 @@ run_hook() {
|
|||
echo "Checking for ${init} on device ${curdev} ..."
|
||||
if mount -r ${curdev} ${newroot} 2>/dev/null
|
||||
then
|
||||
if test -x ${newroot}/${init}
|
||||
# check if /sbin is a symlink and if it is absolute or relative
|
||||
if test -L "${newroot}/sbin" && readlink "${newroot}/sbin" | grep -q "^/"
|
||||
then
|
||||
echo "Absolute /sbin symlink on device ${curdev}"
|
||||
echo "This usrmerge layout is currently not supported by findroot."
|
||||
umount ${newroot}
|
||||
continue
|
||||
fi
|
||||
if test -x ${newroot}/${init} || test -L ${newroot}/${init}
|
||||
then
|
||||
echo "Found ${init} on device ${curdev}"
|
||||
rootcount=$((rootcount + 1))
|
||||
|
|
|
|||
Loading…
Reference in a new issue