projects
/
grml-debootstrap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Install signal handler to always cleanup chroot.
[grml-debootstrap.git]
/
chroot-script
diff --git
a/chroot-script
b/chroot-script
index
a711641
..
d0f71f3
100755
(executable)
--- a/
chroot-script
+++ b/
chroot-script
@@
-116,15
+116,6
@@
EOF
}
# }}}
}
# }}}
-# create default devices {{{
-makedev() {
- if ! [ -r /dev/hda20 ] ; then
- echo "Creating generic devices in /dev - this might take a while..."
- cd /dev && MAKEDEV generic
- fi
-}
-# }}}
-
# make sure services do not start up {{{
install_policy_rcd() {
if ! [ -r /usr/sbin/policy-rc.d ] ; then
# make sure services do not start up {{{
install_policy_rcd() {
if ! [ -r /usr/sbin/policy-rc.d ] ; then
@@
-426,8
+417,24
@@
finalize() {
}
# }}}
}
# }}}
+# signal handler {{{
+signal_handler() {
+ finalize
+ [ -n "$1" ] && EXIT="$1" || EXIT="1"
+ exit "$EXIT"
+}
+# }}}
+
+# set signal handler {{{
+trap signal_handler HUP INT QUIT TERM
+# }}}
+
# execute the functions {{{
# execute the functions {{{
- for i in chrootmirror grmlrepos kernelimg_conf makedev install_policy_rcd \
+
+ # always execute install_policy_rcd
+ install_policy_rcd
+
+ for i in chrootmirror grmlrepos kernelimg_conf \
kernel packages extrapackages reconfigure hosts interfaces \
timezone fstab hostname initrd grub_config passwords custom_scripts \
services ; do
kernel packages extrapackages reconfigure hosts interfaces \
timezone fstab hostname initrd grub_config passwords custom_scripts \
services ; do