[archiso] Integrate omit_kill_nbd_client logic in hook.
This makes archiso_pxe_nbd functionallity full-independient from archiso profiles (configs/*). Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
14743f4202
commit
a55fc14e24
@ -12,6 +12,7 @@ install-hooks:
|
|||||||
# hooks/install are needed by mkinitcpio
|
# hooks/install are needed by mkinitcpio
|
||||||
install -D -m 644 hooks/archiso $(DESTDIR)/lib/initcpio/hooks/archiso
|
install -D -m 644 hooks/archiso $(DESTDIR)/lib/initcpio/hooks/archiso
|
||||||
install -D -m 644 install/archiso $(DESTDIR)/lib/initcpio/install/archiso
|
install -D -m 644 install/archiso $(DESTDIR)/lib/initcpio/install/archiso
|
||||||
|
install -D -m 644 archiso_pxe_nbd $(DESTDIR)/lib/initcpio/archiso_pxe_nbd
|
||||||
install -D -m 644 hooks/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd
|
install -D -m 644 hooks/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd
|
||||||
install -D -m 644 install/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd
|
install -D -m 644 install/archiso_pxe_nbd $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd
|
||||||
install -D -m 644 hooks/archiso_loop_mnt $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt
|
install -D -m 644 hooks/archiso_loop_mnt $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt
|
||||||
@ -31,6 +32,7 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)/usr/bin/testiso
|
rm -f $(DESTDIR)/usr/bin/testiso
|
||||||
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso
|
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso
|
||||||
rm -f $(DESTDIR)/lib/initcpio/install/archiso
|
rm -f $(DESTDIR)/lib/initcpio/install/archiso
|
||||||
|
rm -f $(DESTDIR)/lib/initcpio/archiso_pxe_nbd
|
||||||
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd
|
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_pxe_nbd
|
||||||
rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd
|
rm -f $(DESTDIR)/lib/initcpio/install/archiso_pxe_nbd
|
||||||
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt
|
rm -f $(DESTDIR)/lib/initcpio/hooks/archiso_loop_mnt
|
||||||
|
6
archiso/archiso_pxe_nbd
Normal file
6
archiso/archiso_pxe_nbd
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
omit_kill_nbd_client() {
|
||||||
|
add_omit_pids $(< /run/archiso/nbd_client.pid)
|
||||||
|
}
|
||||||
|
|
||||||
|
add_hook shutdown_prekillall omit_kill_nbd_client
|
||||||
|
add_hook single_prekillall omit_kill_nbd_client
|
@ -91,5 +91,6 @@ archiso_pxe_nbd_mount_handler () {
|
|||||||
else
|
else
|
||||||
mkdir -p /run/archiso
|
mkdir -p /run/archiso
|
||||||
pidof nbd-client > /run/archiso/nbd_client.pid
|
pidof nbd-client > /run/archiso/nbd_client.pid
|
||||||
|
cp /archiso_pxe_nbd ${newroot}/etc/rc.d/functions.d/
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ build ()
|
|||||||
|
|
||||||
add_binary "/usr/sbin/nbd-client" "/bin/nbd-client"
|
add_binary "/usr/sbin/nbd-client" "/bin/nbd-client"
|
||||||
add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig"
|
add_binary "/lib/initcpio/ipconfig" "/bin/ipconfig"
|
||||||
|
|
||||||
|
add_file "/lib/initcpio/archiso_pxe_nbd" "/archiso_pxe_nbd"
|
||||||
}
|
}
|
||||||
|
|
||||||
help ()
|
help ()
|
||||||
|
@ -47,6 +47,7 @@ make_setup_mkinitcpio() {
|
|||||||
cp /lib/initcpio/hooks/${_hook} ${work_dir}/root-image/lib/initcpio/hooks
|
cp /lib/initcpio/hooks/${_hook} ${work_dir}/root-image/lib/initcpio/hooks
|
||||||
cp /lib/initcpio/install/${_hook} ${work_dir}/root-image/lib/initcpio/install
|
cp /lib/initcpio/install/${_hook} ${work_dir}/root-image/lib/initcpio/install
|
||||||
done
|
done
|
||||||
|
cp /lib/initcpio/archiso_pxe_nbd ${work_dir}/root-image/lib/initcpio
|
||||||
: > ${work_dir}/build.${FUNCNAME}
|
: > ${work_dir}/build.${FUNCNAME}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
if [[ -f /run/archiso/nbd_client.pid ]]; then
|
|
||||||
omit_kill_nbd_client() {
|
|
||||||
add_omit_pids $(< /run/archiso/nbd_client.pid)
|
|
||||||
}
|
|
||||||
|
|
||||||
add_hook shutdown_prekillall omit_kill_nbd_client
|
|
||||||
add_hook single_prekillall omit_kill_nbd_client
|
|
||||||
fi
|
|
Loading…
Reference in New Issue
Block a user