#!/bin/sh #---------------------------------------------------------------------------- # /etc/init.d/mountfs - initial boot script # # Creation : 2015-06-13 hbfl # Last Update: $Id$ # # Copyright (c) 2015-@@YEAR@@ the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- # mount devices #---------------------------------------------------------------------------- lsb=false if ${lsb} then # read init-functions . /lib/lsb/init-functions else # read functions . /etc/init.d/functions fi # --------------------------------------------------------------------------- # usage # --------------------------------------------------------------------------- usage() { cat </dev/null evaluate_retval # Remove fsck-related file system watermarks. /usr/bin/rm -f /fastboot /forcefsck # Make sure /dev/pts exists /usr/bin/mkdir -p /dev/pts /bin/sync /bin/umount /initrd 2>/dev/null # check for /etc/mtab -> regular file if ! /usr/bin/readlink /etc/mtab | /usr/bin/grep -wq 'proc/self/mounts' then /bin/rm /etc/mtab fi /bin/rm -f /var/boot-ext/* if ${lsb} then log_info_msg "Mounting remaining file systems...\n" else boot_mesg " * Mounting remaining file systems..." fi # mount remaining fs from fstab /bin/mount -av 2>/dev/null evaluate_retval # remount all acl enabled filesystems with acl,user_xattr, # if kernel supports acl (excluding /boot) for pseudofile in /proc/{ksyms,kallsyms} do if [ -e "${pseudofile}" ] && /usr/bin/grep -q 'posix_acl_' "${pseudofile}" then /bin/mount -t ext2,ext3,ext4,xfs | while read dev on point type typ options do case "${type}" in ext*) # check if already mounted with user_xattr acl if ! /sbin/tune2fs -l "${dev}" | /usr/bin/grep -q 'user_xattr' && [ "${point}" != "/boot" ] then /bin/mount -o remount,acl,user_xattr ${point} fi ;; xfs) /bin/mount -o remount,acl,user_xattr ${point} ;; esac done fi done if [ -d /etc/init.d/boot.d ] then for j in /etc/init.d/boot.d/S* # start cleanup scripts do if [ -x ${j} ] then ${j} start fi done fi } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { while [ ${#} -gt 0 ] do case "${1}" in -q|--quiet) _quiet=true shift ;; *) _action=${1} shift ;; esac done case "${_action}" in start) start ;; *) usage exit 1 ;; esac exit 0 } # --------------------------------------------------------------------------- # call function main # --------------------------------------------------------------------------- main "${@}" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------