[PATCH 1/4] Have linuxrc.s390 callable as "reboot" or "shutdown", just like init.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 loader/linuxrc.s390 |   18 +++++++++---------
 scripts/mk-images   |    8 ++++----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index a3ee665..26dc90f 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -92,8 +92,8 @@ function checkipv4()
 
 function doshutdown()
 {
-    echo $"about to exec shutdown"
-    exec /sbin/shutdown
+    echo $"about to exec halt"
+    exec /sbin/halt
     exit 0
 }
 
@@ -109,8 +109,8 @@ function doreboot()
         popd >/dev/null 2>&1
     fi
 
-    echo $"about to exec shutdown -r"
-    exec /sbin/shutdown -r
+    echo $"about to exec reboot"
+    exec /sbin/reboot
     exit 0
 }
 
@@ -2702,6 +2702,11 @@ function final_check() {
 
 ### MAIN ###
 
+case "${0/.*\//}" in
+    "reboot")   doreboot ;;
+    "shutdown") doshutdown ;;
+esac
+
 init_main
 udev_setup
 
@@ -3054,11 +3059,6 @@ EOF
 
     echo -n $$ > /var/run/init.pid
 
-    # shutdown (halt) on SIGUSR1
-    trap doshutdown SIGUSR1
-    # reboot on SIGUSR2
-    trap doreboot SIGUSR2
-
     startinetd
 
     if [ -n "$RUNKS" ]; then
diff --git a/scripts/mk-images b/scripts/mk-images
index aefc5b0..475f904 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -634,17 +634,17 @@ makeinitrd() {
     instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/$LOADERBIN $MBD_DIR /sbin/loader
     if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then
         instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/init $MBD_DIR /sbin/init
-        ln -s ./init $MBD_DIR/sbin/reboot
-        ln -s ./init $MBD_DIR/sbin/halt
-        ln -s ./init $MBD_DIR/sbin/poweroff
     else
-        instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/shutdown $MBD_DIR /sbin/shutdown
         instbin $IMGPATH /usr/lib/anaconda-runtime/loader/linuxrc.s390 $MBD_DIR /sbin/init
         instbin $IMGPATH /usr/lib/anaconda-runtime/loader/lsznet.raw $MBD_DIR /sbin/lsznet
         instbin $IMGPATH /usr/lib/anaconda-runtime/loader/controlunits.sh $MBD_DIR /sbin/controlunits
         instbin $IMGPATH /usr/sbin/dasdfmt $MBD_DIR /sbin/dasdfmt
     fi
 
+    ln -s ./init $MBD_DIR/sbin/reboot
+    ln -s ./init $MBD_DIR/sbin/halt
+    ln -s ./init $MBD_DIR/sbin/poweroff
+
     if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then
        install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz
        install -m 644 $SCREENFONT $MBD_DIR/etc/screenfont.gz
-- 
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux