Changeset 3319 in MondoRescue


Ignore:
Timestamp:
Dec 1, 2014, 11:35:39 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • Backport most mindi modifications done in the 3.2 branch into 3.0 in order to have soon a 2.1.8 version which is probably Fedora 17+ compatible (all modifications up to 2014-10-16)
Location:
branches/3.0/mindi
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/analyze-my-lvm

    r3066 r3319  
    1313GetValueFromField() {
    1414    local res
    15     grep -i "$2" "$1" | perl -pi -e 's/\s*(.*)\s\s\s+(.+)$/$2/;s/\sT[i]*B/t/;s/\sG[i]*B/g/;s/\sM[i]*B/m/;s/\sK[i]*B/k/'
     15    grep -i "$2" "$1" | perl -p -e 's/\s*(.*)\s\s\s+(.+)$/$2/;s/\sT[i]*B/t/;s/\sG[i]*B/g/;s/\sM[i]*B/m/;s/\sK[i]*B/k/'
    1616}
    1717
  • branches/3.0/mindi/deplist.d/ProLiant.conf

    r3094 r3319  
    77/usr/sbin/hpacuscripting
    88/opt/compaq/hpacucli/bld/.hpacuscripting
     9/opt/compaq/hpacucli/bld/libcpqimgr-x86_64.so
    910/sbin/hponcfg
    1011# XML file under /opt/hp/hp-scripting-tools/etc/conrep.xml
  • branches/3.0/mindi/deplist.d/base.conf

    r2964 r3319  
    4040/usr/bin/setfacl
    4141
     42#
     43/bin/lsblk
     44
    4245# On RHEL
    4346/usr/bin/bzip2
  • branches/3.0/mindi/deplist.d/lvm.conf

    r2465 r3319  
    9393/usr/sbin/lvs
    9494/usr/sbin/lvscan
     95
     96/usr/sbin/lvmetad
  • branches/3.0/mindi/deplist.d/minimal.conf

    r3160 r3319  
    5454# Required by ssh as dlopened
    5555/lib/libnss_compat.so
     56/lib64/libnss_compat.so
    5657/usr/lib/libnss_compat.so
    5758/usr/lib64/libnss_compat.so
    5859/lib/libnss_files.so
     60/lib64/libnss_files.so
    5961/usr/lib/libnss_files.so
    6062/usr/lib64/libnss_files.so
  • branches/3.0/mindi/deplist.d/udev.conf

    r3172 r3319  
    1515/sbin/udev.static
    1616/sbin/udevsend
     17/sbin/biosdevname
    1718/etc/udev
    1819/etc/hotplug.d
     20
     21/usr/sbin/dmeventd
     22/usr/bin/systemctl
    1923
    2024# On ArchLinux
     
    2327
    2428# Systemd
    25 /usr/lib/systemd/systemd-udevd
     29/etc/systemd
     30/usr/lib/systemd
     31/usr/lib/kernel
     32/usr/lib/tmpfiles.d
     33/var/lib/systemd
     34/usr/share/systemd
     35/usr/sbin/runlevel
     36/usr/sbin/udevadm
     37/usr/sbin/halt
     38/usr/bin/bootctl
     39/usr/bin/halt
     40/usr/bin/hostnamectl
     41/usr/bin/journalctl
     42/usr/bin/kernel-install
     43/usr/bin/localectl
     44/usr/bin/loginctl
     45/usr/bin/machinectl
     46/usr/bin/poweroff
     47/usr/bin/reboot
     48/usr/bin/systemd
     49/usr/bin/systemd-analyze
     50/usr/bin/systemd-ask-password
     51/usr/bin/systemd-cat
     52/usr/bin/systemd-cgls
     53/usr/bin/systemd-cgtop
     54/usr/bin/systemd-coredumpctl
     55/usr/bin/systemd-delta
     56/usr/bin/systemd-detect-virt
     57/usr/bin/systemd-inhibit
     58/usr/bin/systemd-machine-id-setup
     59/usr/bin/systemd-notify
     60/usr/bin/systemd-nspawn
     61/usr/bin/systemd-run
     62/usr/bin/systemd-stdio-bridge
     63/usr/bin/systemd-tmpfiles
     64/usr/bin/systemd-tty-ask-password-agent
     65/usr/bin/timedatectl
     66
     67# systemd needs dbus
     68/usr/bin/dbus-daemon
     69/usr/bin/dbus-launch
     70/etc/dbus-1
     71/usr/share/dbus-1
     72/var/run/dbus
     73/usr/lib64/dbus-1
     74/usr/bin/dbus-binding-tool
     75/usr/bin/dbus-cleanup-sockets
     76/usr/bin/dbus-monitor
     77/usr/bin/dbus-send
     78/usr/bin/dbus-uuidgen
    2679
    2780/sbin/udevstart.static
  • branches/3.0/mindi/install.sh

    r3173 r3319  
    5454    MANDIR=${HEAD}$MANDIR/man8
    5555fi
     56if [ _"$SBINDIR" = _"" ]; then
     57    subsbin=$local/sbin
     58    SBINDIR=$local/sbin
     59else
     60    subsbin=$SBINDIR
     61    SBINDIR=${HEAD}$SBINDIR
     62fi
    5663if [ _"$DOCDIR" = _"" ]; then
    5764    DOCDIR=$local/share/doc/mindi-$MINDIVER
     
    7077
    7178echo "Creating target directories ..."
    72 install -m 755 -d $conf $locallib/mindi $MANDIR $local/sbin $CACHEDIR $conf/deplist.d
     79install -m 755 -d $conf $locallib/mindi $MANDIR $SBINDIR $CACHEDIR $conf/deplist.d
    7380
    7481echo "Copying files ..."
     
    8390
    8491# Substitute variables for mindi
    85 sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" mindi > $local/sbin/mindi
    86 chmod 755 $local/sbin/mindi
     92sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$sublocal~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$subconf~" -e "s~^MINDI_LIB=LLL~MINDI_LIB=$sublocallib~" mindi > $SBINDIR/mindi
     93chmod 755 $SBINDIR/mindi
    8794install -m 644 mindi.8 $MANDIR
    8895
    8996# Manage perl script man pages
    9097for s in mindi-bkphw mindi-get-perl-modules parted2fdisk.pl; do
    91     install -m 755 $s $local/sbin
    92     pod2man -c "$s a MondoRescue tool" --section=8 --release="$VERSTR" $local/sbin/$s > $s.8
     98    install -m 755 $s $SBINDIR
     99    pod2man -c "$s a MondoRescue tool" --section=8 --release="$VERSTR" $SBINDIR/$s > $s.8
    93100    install -m 644 $s.8 $MANDIR
    94101    # Generate the list of perl modules needed at restore time for mindi
    95     cat > $conf/perl-scripts << EOF
    96 $sublocal/sbin/$s
     102    cat >> $conf/perl-scripts << EOF
     103$subsbin/$s
    97104EOF
    98105done
    99 (cd $MANDIR ; ln -s parted2fdisk.pl.8 parted2fdisk.9)
     106(cd $MANDIR ; if [ ! -f parted2fdisk.9 ]; then ln -s parted2fdisk.pl.8 parted2fdisk.9; fi)
    100107
    101108if [ "_$PREFIX" = "_" ] && [ ! -f $locallib/mindi/rootfs/bin/busybox ]; then
     
    105112# Managing parted2fdisk
    106113if [ "$ARCH" = "ia64" ] ; then
    107     (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
    108     install -s -m 755 $local/sbin/parted2fdisk.pl $locallib/mindi/rootfs/sbin/parted2fdisk
     114    (cd $SBINDIR && ln -sf parted2fdisk.pl parted2fdisk)
     115    install -s -m 755 $SBINDIR/parted2fdisk.pl $locallib/mindi/rootfs/sbin/parted2fdisk
    109116else
    110117    # FHS requires fdisk under /sbin
    111     (cd $local/sbin && ln -sf ../../sbin/fdisk parted2fdisk)
     118    (cd $SBINDIR && ln -sf ../../sbin/fdisk parted2fdisk)
    112119    echo "Symlinking fdisk to parted2fdisk"
    113120    ( cd $locallib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
     
    116123if [ "$PKGBUILDMINDI" != "true" ]; then
    117124    chown -R root:root $locallib/mindi $conf # $DOCDIR
    118     chown root:root $local/sbin/mindi $MANDIR/mindi.8 $locallib/mindi/analyze-my-lvm $local/sbin/parted2fdisk.pl
     125    chown root:root $SBINDIR/mindi $MANDIR/mindi.8 $locallib/mindi/analyze-my-lvm $SBINDIR/parted2fdisk.pl
    119126    if [ "$ARCH" = "ia64" ] ; then
    120         chown root:root $local/sbin/parted2fdisk
     127        chown root:root $SBINDIR/parted2fdisk
    121128    fi
    122129fi
  • branches/3.0/mindi/mindi

    r3260 r3319  
    373373    local r res mapfile mappath included_item included_list keyfile mp locale
    374374    LogAll "INFO: Analyzing your keyboard's configuration."
    375     KEYDIR=/lib/kbd
     375    KEYDIR=/usr/lib/kbd
    376376    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd     # Slackware
    377377    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/lib/kbd
    378     [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd
    379378    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share
    380379    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole
    381380    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup
     381    [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd
    382382    if [ ! -e "$KEYDIR" ] ; then
    383383        LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time."
     
    387387        LogFile "INFO: Red Hat-style config detected."
    388388        keyfile=/etc/sysconfig/keyboard
     389    elif [ -e "/etc/vconsole.conf" ] ; then
     390        LogFile "INFO: New Fedora style config detected."
     391        keyfile=/etc/vconsole.conf
    389392    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    390393        LogFile "INFO: Slackware-style config detected."
     
    445448    locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'`
    446449    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    447     [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2`     # Gentoo & ArchLinux
     450    [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2`     # Gentoo, ArchLinux & New fedora
    448451    [ ! "$locale" ] && locale=`grep -E 'XkbLayout' "$keyfile" | grep -v '^#' | awk '{print $3}' | tr -d '"'`        #  Fedora 19
    449452    LogFile "INFO: locale=$locale"
     
    487490FindLdlinux32Binary() {
    488491    LDLINUXC32=/usr/lib/syslinux/ldlinux.c32
    489     [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/ldlinux.c32
    490492    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/ldlinux.c32
    491493    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/syslinux/ldlinux.c32
    492494    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib/syslinux/ldlinux.c32
    493495    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib64/syslinux/ldlinux.c32
     496    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/modules/bios/ldlinux.c32
     497    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/modules/bios/ldlinux.c32
    494498    #[ ! -e "$LDLINUXC32" ] && LDLINUXC32=`find / -name ldlinux.c32 | grep -x "/.*/ldlinux.c32"`
    495499    if [ ! -e "$LDLINUXC32" ]; then
     
    504508FindMboot32Binary() {
    505509    MBOOTC32=/usr/lib/syslinux/mboot.c32
    506     [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/mboot.c32
    507510    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/mboot.c32
    508511    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/syslinux/mboot.c32
    509512    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib/syslinux/mboot.c32
    510513    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32
     514    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/modules/bios/mboot.c32
     515    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/modules/bios/mboot.c32
    511516    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
    512517    [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
     
    521526    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib/syslinux/isolinux.bin
    522527    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib64/syslinux/isolinux.bin
     528    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/lib/ISOLINUX/isolinux.bin
    523529    [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"`
    524530    [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
     
    729735    local lcMagicExt2fs="EXT2-fs: blocksize too small for device."
    730736    local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device."
    731     local lcMagicInitfs="<6>checking if image is initramfs...|[<]6[>]Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"
     737    local lcMagicInitfs="<6>checking if image is initramfs...|[<]*6[>]*Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"
    732738
    733739    # local variables
     
    17601766            if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    17611767                echo -en "Press <enter> to continue.\n"
     1768                echo -en "$BOOT_MEDIA_MESSAGE"
    17621769            elif [ ! "$MINDI_TMP" ] ; then
    17631770                echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
     
    23852392        if [ "$?" -eq "0" ] ; then
    23862393            # Used by ia64
    2387             fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2394            fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23882395        else
    2389             fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2396            fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23902397        fi
    23912398        echo "$fkern_ver"
     
    25862593    # Copy of files mandatory for ssh to automate mount if sshfs is used
    25872594    mkdir $mountpoint/.ssh
    2588     cp -rp ~root/.ssh/* $mountpoint/.ssh 2> /dev/null
    2589     echo > $mountpoint/tmp/myssh << EOF
     2595    cp -a ~root/.ssh/* $mountpoint/.ssh 2> /dev/null
     2596    cat > $mountpoint/tmp/myssh << EOF
    25902597ssh -o StrictHostKeyChecking=no $*
    25912598EOF
     
    25932600
    25942601    # Copy of files mandatory for ld.so
    2595     cp -rp /etc/ld.so.c* $mountpoint/etc
     2602    cp -a /etc/ld.so.c* $mountpoint/etc
    25962603
    25972604    # Handle the case where busybox and mount are dynamically linked
     
    26022609    fi
    26032610
    2604     # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps)
     2611    # Copy of files from the minimal env needed as per the deplist.d/minimal.conf & udev.conf file (which includes all busybox deps)
    26052612    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
    2606     for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do
    2607         if [ -r $f ]; then
    2608             echo $f >> $MINDI_TMP/minimal.lis
    2609             LocateDeps $f >> $MINDI_TMP/minimal2.lis
     2613    for f in `cat $DEPLIST_DIR/minimal.conf $DEPLIST_DIR/udev.conf | grep -vE " *#.*|^#" | sort -u` ; do
     2614        if [ -d $f ]; then
     2615            for g in `find $f`; do
     2616                echo $g >> $MINDI_TMP/minimal.lis
     2617                LocateDeps $g  >> $MINDI_TMP/minimal2.lis
     2618            done
     2619        else
     2620            if [ -r $f ]; then
     2621                echo $f >> $MINDI_TMP/minimal.lis
     2622                LocateDeps $f >> $MINDI_TMP/minimal2.lis
     2623            fi
    26102624        fi
    26112625    done
     
    26402654        LogIt "INFO: udev device manager found"
    26412655        tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log
    2642         # This avoids NIC remapping if on another machine at restore time on Debian at least
    2643         rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules
    2644         # This avoids NIC remapping if on another machine at restore time on Ubuntu at least
    2645         rm -f ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules
     2656        # This avoids NIC remapping if on another machine at restore time on Debian/Ubuntu at least
     2657        rm -f ./etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules
    26462658        # Do not do it if it's a link (Ubuntu 64 bits #503)
    2647         if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [  ! -h "/lib64/udev" ]; then
     2659        if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then
    26482660            tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib64/udev analysis" $MINDI_TMP/$$.log
    26492661        fi
     
    26532665        if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [  ! -h "/lib/udev" ]; then
    26542666            tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log
     2667        fi
     2668        if [ -e "/usr/lib/udev" ] && [ ! -h "/usr/lib" ] && [  ! -h "/usr/lib/udev" ]; then
     2669            tar cf - -C / /usr/lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /usr/lib/udev analysis" $MINDI_TMP/$$.log
    26552670        fi
    26562671        if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ] || [ -x /usr/lib/systemd/systemd-udevd ]; then
     
    26642679                    while [ -h $j ]; do
    26652680                        lis="$lis $j"
    2666                         j=`readlink $j`
     2681                        j=`readlink -f $j`
    26672682                    done
    26682683                    lis="$lis $j"
     
    26782693                    [ "$j" != "" ] && rm -f $j
    26792694                fi
     2695                echo "$i" >> $MINDI_TMP/udev.lis
    26802696            done
    26812697            tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log
     
    27762792    # Copy FW in case some drivers needs it
    27772793    for d in "/lib" "/usr/lib"; do
    2778         if [ -d "$d/firmware" ]; then
     2794        if [ -d "$d/firmware" -a ! -h $d ]; then
    27792795            cp -a "$d/firmware" "$mountpoint/$d"
    27802796        fi
     
    27832799    # Copy multipath dynamic libraries in case multipath is used (RHEL 6.4 and later)
    27842800    for d in "/lib" "/usr/lib" "/lib64" "/usr/lib64"; do
    2785         if [ -d "$d/multipath" ]; then
     2801        if [ -d "$d/multipath" -a ! -h $d ]; then
    27862802            cp -a "$d/multipath" "$mountpoint/$d"
    27872803        fi
  • branches/3.0/mindi/rootfs/etc/group

    r1733 r3319  
    1717cdrom::24:
    1818tape::26:
     19lock::54:
    1920plugdev::46:
    2021audio::81:
     
    2425fuse::106:
    2526nogroup::65534:
     27rpc:x:491:
     28rpcuser:x:490:
     29messagebus:x:499:
     30dbus:x:81:
     31polkitd:x:998
  • branches/3.0/mindi/rootfs/etc/init.d/rcS

    r3244 r3319  
    55# init script launched during the restore process
    66#------------------------------------------------------------
    7 
    87
    98CaughtSoftReset() {
     
    7574ExtractDevTarballs() {
    7675    cd /
    77     for fname in ataraid.tgz ida.tgz i2o.tgz rd.tgz raw.tgz cciss.tgz nst.tgz dm.tgz vc.tgz ; do
    78         if [ ! -e "/$fname" ] ; then
    79             LogIt "/$fname not found; cannot extract to /." 1
    80         else
    81             echo -en "\rExtracting /$fname...     "
    82             tar -zxf /$fname || LogIt "Error occurred while extracting /$fname"
    83         fi
    84     done
     76    if [ -x /usr/lib/systemd/systemd-udevd ]; then
     77        # Just use vc dev files. The other are useless and create huge delays with LVM
     78        tar -zxf /vc.tgz || LogIt "Error occurred while extracting /vc.tgz"
     79    else
     80        for fname in ataraid.tgz ida.tgz i2o.tgz rd.tgz raw.tgz cciss.tgz nst.tgz dm.tgz vc.tgz ; do
     81            if [ ! -e "/$fname" ] ; then
     82                LogIt "/$fname not found; cannot extract to /." 1
     83            else
     84                echo -en "\rExtracting /$fname...     "
     85                tar -zxf /$fname || LogIt "Error occurred while extracting /$fname"
     86            fi
     87        done
     88    fi
    8589    echo -en "\r"
    8690    LogIt "Extracted additional /dev entries OK.     " 1
     
    98102        opt="-c"
    99103    fi
     104    echo "Launching terminals on other ttys - Use ALT+F[2-6] to use them"
    100105    openvt $opt 2 /bin/sh
    101106    openvt $opt 3 /bin/sh
     
    105110    openvt $opt 7 /bin/sh /sbin/wait-for-petris
    106111    openvt $opt 8 /usr/bin/tail -f $LOGFILE
    107     openvt $opt 9 /usr/bin/tail -f /var/log/messages
     112    if [ -f /var/log/messages ]; then
     113        openvt $opt 9 /usr/bin/tail -f /var/log/messages
     114    fi
    108115    # May avoid shell error messages
    109116    chmod 666 /dev/tty* /dev/console
    110117    # By default first serial line is configured as tty
    111     # Required to have a correct serial console support (MP on ia64 or VSP with iLO2 e.g.)
     118    # Required to have a correct serial console support (MP on ia64 or VSP with iLO e.g.)
    112119    for i in `cat /proc/cmdline` ; do
    113120        echo $i | grep -qi serial= && serial=`echo $i | cut -d= -f2`
    114121    done
    115122    # Doing that is only valid when using a real serial line
    116     if [[ $serial != "" && -e $serial ]]; then
     123    if [[ $serial != "" && -e $serial ]]; then
    117124        LogIt "Redirecting serial $serial to /dev/tty" 1
    118125        ln -s -f $serial /dev/tty
     
    288295    fi
    289296    if [ "$res" -eq "0" ] ; then
    290         LogIt "OK, I am running on a CD-ROM. Good." 3
     297        LogIt "OK, I am running on a CD-ROM. Good." 1
    291298        CD_MOUNTED_OK=yes
    292299    else
    293         LogIt "You probably not have the right drivers" 3
    294         LogIt "to support the hardware on which we are running" 3
    295         LogIt "Your archives are probably fine but" 3
    296         LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 3
     300        LogIt "You probably not have the right drivers" 1
     301        LogIt "to support the hardware on which we are running" 1
     302        LogIt "Your archives are probably fine but" 1
     303        LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 1
    297304        CD_MOUNTED_OK=""
    298305    fi
     
    324331    if [ ! -e "/dev/.devfsd" ] ; then
    325332        mount -t devfs devfs /dev 2>> $LOGFILE
    326             if [ "$?" -ne "0" ] ; then
    327         LogIt "Error while trying to mount devfs"
     333        if [ "$?" -ne "0" ] ; then
     334            LogIt "Error while trying to mount devfs"
    328335        else
    329         LogIt "Devfs mounted OK"
     336            LogIt "Devfs mounted OK"
    330337        fi
    331338    fi
     
    372379
    373380RunUdevd() {
    374     # Inspiration from Mandriva 2008.0 startup script
    375     echo "Preparing udev environment..."
    376     LogIt "Preparing udev environment..."
     381    # Initial Inspiration from Mandriva 2008.0 startup script
     382    LogIt "Preparing udev environment..." 1
    377383    mv /dev /dev.static
    378384    mkdir /dev
    379     mount -n -o size=5M,mode=0755 -t tmpfs none /dev
    380     MakeExtraNodes
    381     mount -n -t devpts -o mode=620 none /dev/pts
     385    # Contributed during LinuxCon Japan !
     386    if [ -x /usr/lib/systemd/systemd-udevd ]; then
     387        mount -n -t devtmpfs none /dev
     388    else
     389        mount -n -o size=5M,mode=0755 -t tmpfs none /dev
     390        MakeExtraNodes
     391        mount -n -t devpts -o mode=620 none /dev/pts
     392    fi
     393    mkdir -p /dev/shm
    382394    mount -n -t tmpfs  none /dev/shm
    383395    if [ -e /proc/sys/kernel/hotplug ]; then
     
    396408    ps | grep -v grep |grep udevd 2> /dev/null 1> /dev/null
    397409    if [ $? -ne 0 ]; then
     410        echo "Waiting for udev to start..."
    398411        if [ -x /sbin/udevd ]; then
    399412            /sbin/udevd --daemon &
     
    401414            /usr/bin/udevd --daemon &
    402415        elif [ -x /usr/lib/systemd/systemd-udevd ]; then
    403             /usr/lib/systemd/systemd-udevd -daemon &
    404         fi
    405         echo "Waiting for udev to start..."
     416            # from https://github.com/hut/minirc/blob/master/rc
     417            echo "INFO: This is the systemd version of udev"
     418            # Contributed during LinuxCon Japan
     419            #mount -n -t tmpfs tmpfs /sys/fs/cgroup
     420            #mount -n -t cgroup cgroup /sys/fs/cgroup/systemd
     421            mkdir -p /run/udev
     422            mkdir -p /run/systemd/journal
     423            /usr/lib/systemd/systemd-udevd --daemon
     424            udevadm trigger --action=add --type=subsystems
     425            udevadm trigger --action=add --type=devices
     426        fi
    406427        sleep 5
    407         LogIt "udev started manually"
     428        LogIt "udev started manually" 1
    408429    fi
    409430    mkdir -p /dev/.udev/queue/
     
    481502    fi
    482503    if [ -e "/tmp/i-want-my-lvm" ] ; then
     504        # Recent LVM need this caching daemon to work
     505        if [ -x /usr/sbin/lvmetad ]; then
     506            mkdir -p /run/lvm
     507            /usr/sbin/lvmetad
     508        fi
    483509        LogIt "Scanning LVM's..." 1
    484510        if which lvm ; then
     
    494520        for d in $MINDI_EXCLUDE_DEVS ; do
    495521            echo "LVM exclusion == $d"
     522            # LVM: $4 to be checked if changed
    496523            EXCLUDE_VGS=`grep " $d" /tmp/i-want-my-lvm | grep vgcreate | awk '{print $4}'`
    497524            vg=`echo $EXCLUDE_VGS | sed "s/ /|/g"`
     
    508535                echo "vgcfgrestore $v" >> /tmp/restorevgs
    509536                # Remove LVs from mountlist
     537                # LVM: sed to be checked if changed
    510538                EXCLUDE_LVS=`grep " $v" /tmp/i-want-my-lvm | grep lvcreate | sed "s/^.*-n \([^ ][^ ]*\) .*$/$1/"`
    511539                for l in $EXCLUDE_LVS; do
    512540                    # FIXME: Should search for all possible device names here
    513                     grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new
    514                     grep -Ev "/dev/mapper/${v}-$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt
     541                    if [ -f "/tmp/mountlist.txt" ]; then
     542                        grep -Ev "/dev/$v/$l" /tmp/mountlist.txt > /tmp/mountlist.txt.new
     543                        grep -Ev "/dev/mapper/${v}-$l" /tmp/mountlist.txt.new > /tmp/mountlist.txt
     544                    fi
    515545                done
    516546            done
    517547        done
    518548
     549        # LVM: remove #
    519550        grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
    520551        chmod +x /tmp/start-lvm
     
    577608        return;
    578609    fi
    579     if [ "`grep mpath /tmp/mountlist.txt`" ]; then
     610    if [ -f "/tmp/mountlist.txt" ] && [ "`grep mpath /tmp/mountlist.txt`" ]; then
    580611        if [ -x /sbin/multipath ]; then
    581612            echo "Starting Mpath..."
     
    602633    fi
    603634
    604     raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     635    if [ -f "/tmp/mountlist.txt" ]; then
     636        raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     637    else
     638        raid_devices=""
     639    fi
     640
    605641    if which raidstart > /dev/null 2> /dev/null ; then
    606642        for i in $raid_devices ; do
     
    693729        umount /tmp/tmpfs > /dev/null 2> /dev/null
    694730        rmdir /tmp/tmpfs
    695         ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondo-restore
     731        ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondorestore
    696732        LogIt "Failed to mount /tmp/tmpfs; using ugly softlink instead"
    697733    else
     
    845881export PATH GROOVY USER LOGFILE ARCH
    846882
     883mount -o remount,rw /
     884rm -f $LOGFILE
     885
     886mkdir /proc 2> /dev/null
     887mount /proc /proc -t proc
     888
     889# Creates log file
     890LogIt ""
     891# Backup fd
     892exec 4>&2 5>&1
     893# Redirect every message to the LOGFILE
     894exec > >(tee -a ${LOGFILE})
     895exec 2> >(tee -a ${LOGFILE} >&2)
     896
    847897echo "Welcome to init (from mindi ${MINDI_VER}-r${MINDI_REV})"
    848898
    849 mount -o remount rw /
     899mkdir /sys 2> /dev/null
     900mount /sys /sys -t sysfs
     901
    850902[ ! "$GROOVY" ] && Die "I'm not groovy!"
    851903for i in $GROOVY /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do
    852904    mkdir -p $i
    853905done
    854 #/bin/update
    855 mkdir /proc 2> /dev/null
    856 mount /proc/ /proc -v -t proc
    857 mkdir /sys 2> /dev/null
    858 mount /sys/ /sys -v -t sysfs 2>> $LOGFILE
    859906# For ESX 3
    860907[ -d /proc/vmware ] && ! grep -q /vmfs /proc/mounts && mount -t vmfs /vmfs /vmfs
     
    879926    for d in $MINDI_EXCLUDE_DEVS ; do
    880927        echo "Mountlist exclusion == $d"
    881         perl -i -ne 'print $_ unless m~$d~' /tmp/mountlist.txt
     928        if [ -e "/tmp/mountlist.txt" ]; then
     929            perl -i -ne 'print $_ unless m~$d~' /tmp/mountlist.txt
     930        fi
    882931    done
    883932else
     
    902951LaunchTerminals
    903952
    904 # Keeping kernel silent  for module insertion
     953# Keeping kernel silent for module insertion
    905954PKLVL=`cut -f1 /proc/sys/kernel/printk`
    906955echo 0 > /proc/sys/kernel/printk
     
    9651014sleep 2
    9661015#clear
    967 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
     1016if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ -e "/tmp/mountlist.txt" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
    9681017    LogIt "Creating /dev/md/* softlinks just in case." 1
    9691018    mkdir -p /dev/md
     
    10441093    LogIt "Calling post-init"
    10451094    # start-netfs moved it under /tmp as the NFS share is already unmounted
    1046     if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
     1095    if [ _"$pre" != _"" ] && [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    10471096        pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
    10481097    fi
    1049     if [ -x $pre ]; then
     1098    if [ _"$pre" != _"" ] && [ -x $pre ]; then
    10501099        echo "Executing preliminary script $pre"
    10511100        LogIt "Executing preliminary script $pre"
     
    10591108if [ "`grep -i "post=" /proc/cmdline`" ] ; then
    10601109    for i in `cat /proc/cmdline` ; do
    1061         echo $i | grep -qi post= && post=`echo $i | cut -d= -f2`
     1110        echo $i | grep -qi post= && post=`echo $i | cut -d= -f2`
    10621111    done
    10631112    # start-netfs moved it under /tmp as the NFS share is already unmounted
  • branches/3.0/mindi/rootfs/etc/passwd

    r2953 r3319  
    1313rpcuser:x:491:490:system user for nfs-utils:/var/lib/nfs:/bin/false
    1414nobody:x:65534:100:nobody:/dev/null:
     15messagebus:x:499:499:system user for dbus:/:/sbin/nologin
     16dbus:x:81:81:system user for dbus:/:/sbin/nologin
     17polkitd:x999:998:polkitd:/:/sbin/nologin
  • branches/3.0/mindi/rootfs/etc/shadow

    r2425 r3319  
    11root:*:13956:0:99999:7:::
     2halt:*:13956:0:99999:7:::
     3operator:*:13956:0:99999:7:::
     4shutdown:*:13956:0:99999:7:::
     5sync:*:13956:0:99999:7:::
    26bin:*:13956:0:99999:7:::
     7ftp:*:13956:0:99999:7:::
    38daemon:*:13956:0:99999:7:::
    49adm:*:13956:0:99999:7:::
     
    1217operator:*:13956:0:99999:7:::
    1318games:*:13956:0:99999:7:::
     19rpc:*:13956:0:99999:7:::
     20rpcuser:*:13956:0:99999:7:::
    1421nobody:*:13956:0:99999:7:::
     22messagebus:*:13956:0:99999:7:::
     23dbus:*:13956:0:99999:7:::
     24polkitd:*:13956:0:99999:7:::
  • branches/3.0/mindi/rootfs/etc/udev-links.conf

    r2441 r3319  
    1919M ppp       c 108 0
    2020M loop0     b 7 0
     21M loop1     b 7 1
     22M loop2     b 7 2
    2123D net
    2224M net/tun   c 10 200
     
    3638M lp0       c   6 0
    3739M rawctl    c 162 0
     40M kmsg      c 1 11
    3841# sometimes, nvidia driver is slow to create these devices and X failed to start:
    3942M nvidia0   c 195 0
     
    5659
    5760M null      c   1 3
     61M zero      c   1 5
     62M random    c   1 8
     63M urandom   c   1 9
     64M ram0      c   1 0
     65M ram1      c   1 1
     66M ram2      c   1 2
    5867M fuse      c   10 229
  • branches/3.0/mindi/rootfs/sbin/post-init

    r2915 r3319  
    55#------------------------------------------------------------
    66
    7 
    8 sleep 1
    9 
    10 echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
    11 cat /tmp/mountlist.txt >> $LOGFILE
     7if [ -f "/tmp/mountlist.txt" ]; then
     8    echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
     9    cat /tmp/mountlist.txt >> $LOGFILE
     10fi
    1211
    1312iso=`grep iso /proc/cmdline`
     
    6867fi
    6968
     69# Now suppress msg redirection to avoid poluting log file
     70exec 2>&4 >&5 4>&- 5>&-
     71
    7072if [ "$compare" ] ; then
    7173    LogIt "------------------COMPARE MODE-----------------" 1
  • branches/3.0/mindi/rootfs/sbin/start-netfs

    r3178 r3319  
    7070
    7171        # If same system, map to the right MAC address
    72         hwaddr_found=`ifconfig $ipdev | /bin/grep HWaddr | awk '{print $NF}'`
    73         if [ "$hwaddr" != "$hwaddr_found" ]; then
    74             ipdev_new=`ifconfig -a | /bin/grep $hwaddr | awk '{print $1}'`
    75             if [ "$ipdev_new" != "" ]; then
    76                 LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)"
    77                 ipdev=$ipdev_new
    78             else
    79                 LogIt "NOTE: Interface $ipdev kept despite it doesn't match the $hwaddr MAC address"
     72        if [ "$hwaddr" != "" ]; then
     73            hwaddr_found=`ifconfig $ipdev | grep HWaddr | awk '{print $NF}'`
     74            if [ "$hwaddr" != "$hwaddr_found" ]; then
     75                ipdev_new=`ifconfig -a | grep $hwaddr | awk '{print $1}'`
     76                if [ "$ipdev_new" != "" ]; then
     77                    LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)"
     78                    ipdev=$ipdev_new
     79                else
     80                    LogIt "NOTE: Interface $ipdev kept despite it doesn't match the $hwaddr MAC address"
     81                fi
    8082            fi
    8183        fi
     
    115117    elif [ "$proto" = "smbfs" ]; then
    116118        LogIt "Mounting SMBFS share ($netfsmount) on /tmp/isodir..."
    117         mount -t cifs $netfsopt $netfsmount /tmp/isodir -o ro
     119        mount -t cifs $netfsmount /tmp/isodir -o ro $netfsopt
    118120    elif [ "$proto" != "" ]; then
    119121        if [ -x /sbin/rpcbind ]; then
    120             "Startng rpcbind daemon..."
    121             /sbin/rpcbind &
     122            echo "Starting rpcbind daemon..."
     123            /sbin/rpcbind -w &
    122124        fi
    123125        LogIt "Mounting Network share ($netfsmount) on /tmp/isodir..."
Note: See TracChangeset for help on using the changeset viewer.