fix: Add detecting if /sbin/init is a symlink
because systemd
This commit is contained in:
parent
45c84c281a
commit
9c8920067f
1 changed files with 7 additions and 1 deletions
|
@ -73,9 +73,15 @@ echo "tty1::wait:/sbin/getty -n -l /third_stage.sh 38400 tty1" > /etc/inittab
|
||||||
|
|
||||||
# here be dragons
|
# here be dragons
|
||||||
|
|
||||||
|
init_file=/old_root/sbin/init
|
||||||
|
init_link=$(readlink $init_file)
|
||||||
|
if [[ "$init_link" != "" ]]; then
|
||||||
|
init_file=/old_root$init_link
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "set follow-fork-mode child
|
echo -e "set follow-fork-mode child
|
||||||
set solib-absolute-prefix /old_root
|
set solib-absolute-prefix /old_root
|
||||||
file /old_root$(cat /proc/1/cmdline)
|
file $init_file
|
||||||
attach 1
|
attach 1
|
||||||
call (int)execl(\"/sbin/init\", \"/sbin/init\", 0)
|
call (int)execl(\"/sbin/init\", \"/sbin/init\", 0)
|
||||||
" | gdb
|
" | gdb
|
||||||
|
|
Loading…
Reference in a new issue