diff options
Diffstat (limited to 'rescue/tree/etc/rc.sysinit')
| -rwxr-xr-x | rescue/tree/etc/rc.sysinit | 66 |
1 files changed, 45 insertions, 21 deletions
diff --git a/rescue/tree/etc/rc.sysinit b/rescue/tree/etc/rc.sysinit index e228c91ba..e22696e78 100755 --- a/rescue/tree/etc/rc.sysinit +++ b/rescue/tree/etc/rc.sysinit @@ -1,34 +1,35 @@ #!/bin/sh action() { echo $1; shift; $*; } +DATE=`date +%Y%m%d-%Hh%M` export PATH=/bin:/sbin:/usr/bin:/usr/sbin -echo -e "\t\t\tWelcome to \\033[1;36mMandrake\\033[0;39m Linux" +echo -e "\t\t\tWelcome to \\033[1;36mMageia\\033[0;39m Linux" action "Remounting root filesystem in read-write mode" mount -n -o remount,rw / -ln -s /tmp/stage2/etc/* /etc 2>/dev/null - -rm -f /dev ; cp -a /tmp/stage2/dev /dev +echo "Starting udev" +mkdir /run +mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run +mkdir -p /run/udev/rules.d +export UDEVRULESD=/run/udev/rules.d -mkdir /mnt /var/log +/usr/lib/systemd/systemd-udevd --daemon --resolve-names=never +udevadm trigger --type=subsystems --action=add +udevadm trigger --type=devices --action=add -mkdir /proc -action "Mounting proc filesystem" mount -n -t proc /proc /proc +ln -s /tmp/stage2/etc/* /etc 2>/dev/null +# make passwd changable +rm -f /etc/passwd +cp /tmp/stage2/etc/passwd /etc/ -if grep -q sysfs /proc/filesystems; then - mkdir /sys - action "Mounting sysfs on /sys" mount -t sysfs none /sys -fi +mkdir -p /mnt /var/log >/etc/mtab mount -f / mount -f /proc -#- free up stage1 memory -umount /stage1/proc/bus/usb /stage1/proc /stage1 - # Set the hostname. action "Setting hostname rescue" hostname rescue echo rescue > /etc/HOSTNAME @@ -36,27 +37,50 @@ echo rescue > /etc/HOSTNAME # Loads common modules ( no kerneld :( ) echo "Loading additional modules..." load() { modprobe $* 2>/dev/null; } -load ide-mod -load ide-probe -load ide-disk -load ide-cd +load ide-gd_mod +load ide-cd_mod load floppy load af_packet load isofs load vfat load ext3 +load ext4 load reiserfs +load nilfs2 +load btrfs load xfs load jfs load loop load sd_mod load sr_mod -/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 -/sbin/route add 127.0.0.1 lo +action "Bringing up local loop interface" ifconfig lo up + +# disable the weird echoprt in cooked mode for user interaction: +stty sane + +#LANGUAGE (filled by make_rescue_img) grep -q noauto /proc/cmdline || drvinst SERIAL_USB -if ! grep -q expert /proc/cmdline; then +partimage_default_dir=/data/box +partimage_dir=`perl -lne 'print $1 if /BOX=(\S+)/' /proc/cmdline` +[ -z "$partimage_dir" ] && partimage_dir=$partimage_default_dir +partimage_server=`perl -lne 'print $1 if /\bpserver=(\S+)/' /proc/cmdline` + +if grep -q save_all /proc/cmdline; then + partimage_whole_disk -s $partimage_server save_all $partimage_default_dir +elif grep -q rest_all /proc/cmdline; then + if [ -d /tmp/image$partimage_dir ]; then + partimage_whole_disk rest_all /tmp/image$partimage_dir + else + partimage_whole_disk -s $partimage_server rest_all $partimage_dir + fi +elif grep -q oem /proc/cmdline; then + /tmp/image/oem-rescue.sh +elif grep -q restore /proc/cmdline; then + /usr/sbin/restore-image.sh +elif ! grep -q expert /proc/cmdline; then + echo "starting GUI" rescue-gui fi |
