3 Commits

Author SHA1 Message Date
Jay Larson
f977ad5793 Cleaned up init.d/mountfs and added support for ZFS 2017-06-16 10:46:16 -05:00
Jay Larson
c635cf014c Removed debug messages in usher 2017-05-20 09:26:33 -05:00
Jay Larson
17afdf7765 The following changes were made:
* removed quotes around chroot command in usher
  * removed hwclock from Required-Start in checkfs
  * removed $local_fs from Required-Start in hostname
  * updated mountvirtfs to create /run/utmp
  * added 2 conditionals to readsvcs() in update-rc
2017-05-20 09:18:03 -05:00
7 changed files with 47 additions and 66 deletions

View File

@@ -17,7 +17,7 @@ DESC = This package supplies the base system init scripts for sysvinit
ARCHIVE := '' ARCHIVE := ''
SRCDIR := $(PWD)/SRC/initscripts SRCDIR := $(PWD)/SRC/initscripts
PATCHDIR := $(PWD)/SRC/patches PATCHDIR := $(PWD)/SRC/patches
VERSION := 1.0-0 VERSION := 1.2-0
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux

View File

@@ -8,7 +8,7 @@ case $1 in
;; ;;
postinst) postinst)
if [[ ${TARGET} ]]; then if [[ ${TARGET} ]]; then
chroot ${TARGET} 'update-rc required' chroot ${TARGET} update-rc required
else else
update-rc required update-rc required
fi fi

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: checkfs # Provides: checkfs
# Required-Start: udev swap $time hostname hwclock # Required-Start: udev swap $time hostname
# Required-Stop: # Required-Stop:
# Should-Start: # Should-Start:
# Should-Stop: # Should-Stop:

View File

@@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: hostname # Provides: hostname
# Required-Start: $local_fs # Required-Start:
# Required-Stop: $local_fs # Required-Stop:
# Should-Start: # Should-Start:
# Should-Stop # Should-Stop
# Default-Start: S # Default-Start: S

View File

@@ -1,17 +1,4 @@
#!/bin/sh #!/bin/sh
########################################################################
# Begin mountfs
#
# Description : File System Mount Script
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version : LFS 7.0
#
########################################################################
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: $local_fs # Provides: $local_fs
# Required-Start: udev checkfs # Required-Start: udev checkfs
@@ -20,67 +7,59 @@
# Should-Stop: # Should-Stop:
# Default-Start: S # Default-Start: S
# Default-Stop: 0 6 # Default-Stop: 0 6
# Short-Description: Mounts/unmounts local filesystems defined in /etc/fstab. # Short-Description: Mounts/unmounts local filesystems
# Description: Remounts root filesystem read/write and mounts all # Description: Remounts root filesystem read/write and mounts all
# remaining local filesystems defined in /etc/fstab on # remaining local filesystems defined in /etc/fstab or
# start. Remounts root filesystem read-only and unmounts # in ZFS. Remounts root filesystem read-only and unmounts
# remaining filesystems on stop. # remaining filesystems on stop.
# X-LFS-Provided-By: LFS
# X-Required: true # X-Required: true
### END INIT INFO ### END INIT INFO
. /lib/lsb/init-functions . /lib/lsb/init-functions
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# needs work!!
# probably need to split up
# separate scripts for / and
# network filesystems
#
# Ok, so network filesystems
# init scripts should be included
# as part of the package. This
# script should only be for
# standard local filesystems
#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
case "$1" in case "$1" in
start) start)
log_init_msg "Remounting root file system in read-write mode" log_init_msg "Remounting root file system in read-write mode"
mount -o remount,rw / >/dev/null && log_success_msg || log_failure_msg mount -o remount,rw / >/dev/null && log_success_msg || log_failure_msg
# Remove fsck-related file system watermarks. if [ -f /fastboot ]; then
rm -f /fastboot /forcefsck log_init_msg "Clearing /fastboot"
rm /fastboot && log_success_msg || log_failure_msg
fi
# Make sure /dev/pts exists if [ -f /forcefsck ]; then
# mkdir -p /dev/pts log_init_msg "Clearing /forcefsk"
rm /forcefsck && log_success_msg || log_failure_msg
fi
# This will mount all filesystems that do not have _netdev in if [ -x /sbin/zpool ]; then
# their option list. _netdev denotes a network filesystem. if zpool list rpool 2>&1 > /dev/null; then
log_init_msg "Mounting ZFS file systems"
zfs mount -a && log_success_msg || log_failure_msg
fi
fi
log_init_msg "Mounting remaining file systems" log_init_msg "Mounting remaining file systems"
mount -a -O no_netdev >/dev/null && log_success_msg || log_failure_msg mount -a -O no_netdev >/dev/null && log_success_msg || log_failure_msg
exit $failed ;;
;;
stop) stop)
# Don't unmount virtual file systems like /run log_init_msg "Unmounting all file systems"
log_init_msg "Unmounting all file systems" umount -a -d -r -t notmpfs,nosysfs,nodevtmpfs,noproc,nodevpts \
umount -a -d -r -t notmpfs,nosysfs,nodevtmpfs,noproc,nodevpts >/dev/null && \ >/dev/null && log_success_msg || log_failure_msg
log_success_msg || log_failure_msg
# Make sure / is mounted read only (umount bug) if [ -x /sbin/zpool ]; then
mount -o remount,ro / if zpool list rpool 2>&1 > /dev/null; then
log_init_msg "Unmounting ZFS file systems"
zfs umount -a && log_success_msg || log_failure_msg
fi
fi
# Make all LVM volume groups unavailable, if appropriate mount -o remount,ro /
# This fails if swap or / are on an LVM partition ;;
#if [ -x /sbin/vgchange ]; then /sbin/vgchange -an > /dev/null; fi
;;
*) *)
echo "Usage: $0 [start|stop]" echo "Usage: $0 [start|stop]"
exit 1 exit 1
;; ;;
esac esac
exit 0 exit 0

View File

@@ -84,7 +84,7 @@ mountrun () {
chmod 1777 /run/shm || return 1 chmod 1777 /run/shm || return 1
if grep -q '^utmp:' /etc/group; then if grep -q '^utmp:' /etc/group; then
chmod 664 /run/utmp chmod 664 /run/utmp >> /run/utmp
chgrp utmp /run/utmp chgrp utmp /run/utmp
fi fi

View File

@@ -180,14 +180,15 @@ sub readsvcs {
error( int( $! ), "opendir(): " . INITDIR . ": $!" ); error( int( $! ), "opendir(): " . INITDIR . ": $!" );
foreach my $svcname ( sort( readdir( DIR ) ) ) { foreach my $svcname ( sort( readdir( DIR ) ) ) {
if ( ! -X INITDIR . "/$svcname" ) { if ( ! -f INITDIR . "/$svcname" ||
! -X INITDIR . "/$svcname" ) {
next; next;
} }
$services->{$svcname} = readinfo( INITDIR . "/$svcname" ); $services->{$svcname} = readinfo( INITDIR . "/$svcname" );
if ( ! @{$services->{$svcname}{'Provides'}} ) { if ( ! @{$services->{$svcname}{'Provides'}} ) {
undef( $services->{$svcname} ); delete( $services->{$svcname} );
next; next;
} }
@@ -207,7 +208,8 @@ sub sdepends {
my $sdepends = shift || []; my $sdepends = shift || [];
my $stack = shift || []; my $stack = shift || [];
if ( @$stack > 99 ) { if ( $stack->[0] && grep( $_ eq $service->{'name'}, @$stack )
|| @$stack > 99 ) {
return; return;
} }