diff options
Diffstat (limited to 'rescue/tree')
| -rw-r--r-- | rescue/tree/etc/hosts | 2 | ||||
| -rw-r--r-- | rescue/tree/etc/inittab | 16 | ||||
| -rw-r--r-- | rescue/tree/etc/issue | 3 | ||||
| -rw-r--r-- | rescue/tree/etc/passwd | 2 | ||||
| -rw-r--r-- | rescue/tree/etc/profile | 4 | ||||
| -rwxr-xr-x | rescue/tree/etc/rc.sysinit | 66 | ||||
| -rwxr-xr-x | rescue/tree/sbin/fakeshutdown | 6 | ||||
| -rwxr-xr-x | rescue/tree/sbin/modprobe | 66 | ||||
| -rw-r--r-- | rescue/tree/usr/share/symlinks | 2 |
9 files changed, 77 insertions, 90 deletions
diff --git a/rescue/tree/etc/hosts b/rescue/tree/etc/hosts index a9bbdee7f..d02c36416 100644 --- a/rescue/tree/etc/hosts +++ b/rescue/tree/etc/hosts @@ -1 +1 @@ -127.0.0.1 mandrake-rescue +127.0.0.1 mageia-rescue diff --git a/rescue/tree/etc/inittab b/rescue/tree/etc/inittab index 771d7c0d4..6a30c0360 100644 --- a/rescue/tree/etc/inittab +++ b/rescue/tree/etc/inittab @@ -1,5 +1,5 @@ -#Inittab for Mandrake Rescue Disk -#Author: Daouda Lo <daouda@mandrakesoft.com> +#Inittab for Mageia Rescue Disk +#Author: Daouda Lo id:3:initdefault: si::sysinit:/etc/rc.sysinit @@ -7,8 +7,10 @@ re:6:wait:/etc/rc.reboot ca:12345:ctrlaltdel:/sbin/fakeshutdown 1:12345:respawn:/sbin/mingetty --autologin root tty1 -2:23:respawn:/sbin/mingetty tty2 -3:23:respawn:/sbin/mingetty tty3 -4:23:respawn:/sbin/mingetty tty4 -5:23:respawn:/sbin/mingetty tty5 -6:23:respawn:/sbin/mingetty tty6 +2:23:respawn:/sbin/mingetty --autologin root tty2 +3:23:respawn:/sbin/mingetty --autologin root tty3 +4:23:respawn:/sbin/mingetty --autologin root tty4 +5:23:respawn:/sbin/mingetty --autologin root tty5 +6:23:respawn:/sbin/mingetty --autologin root tty6 +s0:2345:respawn:/sbin/agetty -h -t 60 ttyS0 9600 ansi +#s1:2345:respawn:/sbin/agetty -h -t 60 ttyS1 115200,9600 linux diff --git a/rescue/tree/etc/issue b/rescue/tree/etc/issue index f4799bad2..c5a4c7fb8 100644 --- a/rescue/tree/etc/issue +++ b/rescue/tree/etc/issue @@ -11,7 +11,7 @@ [1;30;44m [40m [47m [40m [44m [40m[2[1;37;4[0m [1;30;44m [40m [47m [40m [30;44m [40m[2C[1;37;40m[0m [1;30;44m [40m [47m [40m [2C[1;37;40m[0m -[1;30;44m [40m [47m [40m [2C[1;37;40mMandrakelinux Rescue Disk[0m +[1;30;44m [40m [47m [40m [2C[1;37;40mMageia Linux Rescue Disk[0m [1;30;44m [43m [30;47m [43m [40m [2C[1;37;40m[0m [1;30;44m [43m [47m [43m [40m [2C [1;30;44m [43m [47m [43m [40m[2C @@ -24,5 +24,6 @@ Use [1;33;40mloadkeys[0m to change your keyboard layout (eg: loadkeys fr) Use [1;33;40mmodprobe[0m to load modules (eg: modprobe snd-card-fm801) Use [1;33;40mdrvinst[0m to install drivers according to detected devices Use [1;33;40mlsparts[0m to list your partitions with types +Use [1;33;40mstartssh[0m to start an ssh daemon Use [1;33;40mrescue-gui[0m to go back to the rescue menu diff --git a/rescue/tree/etc/passwd b/rescue/tree/etc/passwd index 568451e4e..3a1254f77 100644 --- a/rescue/tree/etc/passwd +++ b/rescue/tree/etc/passwd @@ -1,3 +1,3 @@ -root::0:0::/:/bin/bash +root::0:0::/root:/bin/bash shutdown:*:6:0:shutdown:/sbin:/sbin/shutdown halt:*:7:0:halt:/sbin:/sbin/halt diff --git a/rescue/tree/etc/profile b/rescue/tree/etc/profile index 3b5ac21cc..800ce85ae 100644 --- a/rescue/tree/etc/profile +++ b/rescue/tree/etc/profile @@ -1,12 +1,12 @@ # /etc/profile -# (c) Mandrakesoft, Chmouel Boudjnah <chmouel@mandrakesoft.com> +# (c) Mandrakesoft, Chmouel Boudjnah <chmouel> # System wide environment and startup programs # Functions and aliases go in /etc/bashrc PROFILE_LOADED=1 -export PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin +PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/mnt/sbin:/mnt/bin:/mnt/usr/sbin:/mnt/usr/bin PS1="[root@rescue \w]\\$ " ls () { /bin/ls --color=auto -F "$@";} 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 diff --git a/rescue/tree/sbin/fakeshutdown b/rescue/tree/sbin/fakeshutdown index 3511020ff..309f26c6c 100755 --- a/rescue/tree/sbin/fakeshutdown +++ b/rescue/tree/sbin/fakeshutdown @@ -1,7 +1,7 @@ #!/usr/bin/perl # -# Guillaume Cottenceau (gc@mandrakesoft.com) +# Guillaume Cottenceau (gc) # # Copyright 2001 Mandrakesoft # @@ -13,8 +13,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l } - +# From MDK::Common: +sub cat_ { open(my $F, '<', $_[0]) or die "cat of file $_[0] failed: $!\n"; my @l = <$F>; wantarray() ? @l : join '', @l } print "\n"; diff --git a/rescue/tree/sbin/modprobe b/rescue/tree/sbin/modprobe index 774101d7c..704ee6b0f 100755 --- a/rescue/tree/sbin/modprobe +++ b/rescue/tree/sbin/modprobe @@ -1,56 +1,18 @@ #!/usr/bin/perl -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l } - -sub read_already_loaded() { - foreach (cat_("/proc/modules")) { - my ($name) = split; - $conf{$name}{loaded} = 1; - } -} - -sub load_deps($) { - my ($file) = @_; - - local *F; - open F, $file or log::l("error opening $file: $!"), return 0; - foreach (<F>) { - my ($f, $deps) = split ':'; - push @{$deps{$f}}, split ' ', $deps; - } +use lib qw(/usr/lib/libDrakX); +use list_modules; +use modules; + +# based on install::commands +sub modprobe { + !@_ || $_[0] =~ /^-?-h/ and die "usage: modprobe <module> [<options...>]\n"; + my $name; + # kernel calls us with modprobe -q -- <module>, so ignore options + do { $name = shift } while substr($name, 0, 1) eq "-"; + list_modules::load_default_moddeps(); + modules::load_with_options([ $name ], { $name => join(' ', @_) }); } -my $module_extension = cat_('/proc/version') =~ /^Linux version 2.4/ ? '.o' : '.ko'; - -my %mappings = ("usb-ohci" => "ohci-hcd", - "usb-uhci" => "uhci-hcd", - "uhci" => "uhci-hcd", - "printer" => "usblp", - "bcm4400" => "b44", - "3c559" => "3c359", - "3c90x" => "3c59x", - "dc395x_trm" => "dc395x", - "audigy" => "snd-emu10k1"); - -sub load { - my ($name, @options) = @_; - $name =~ s/\.k?o$//; - - $name = $mappings{$name} || $name; #- 2.4 -> 2.6 compat mappings - - $conf{$name}{loaded} and return; - eval { load($_, 'prereq') } foreach @{$deps{$name}}; - - system("packdrake -x /modules/modules.cz* /tmp $name$module_extension"); - -r "/tmp/$name$module_extension" or die "can't find module $name\n"; - system("/sbin/insmod /tmp/$name$module_extension"); - my $retval = $?; - system("rm /tmp/$name$module_extension"); - $retval and die("insmod $name failed"); -} - -!@ARGV || $ARGV[0] =~ /-h/ and die "usage: modprobe <module> [<options...>]\n"; - -read_already_loaded(); -load_deps("/modules/modules.dep"); -load(@ARGV); +$::isInstall = 1; +modprobe(@ARGV); diff --git a/rescue/tree/usr/share/symlinks b/rescue/tree/usr/share/symlinks index 1c34ff204..659a42c8c 100644 --- a/rescue/tree/usr/share/symlinks +++ b/rescue/tree/usr/share/symlinks @@ -1,11 +1,9 @@ /bin /boot -/dev /etc/fstab /etc/inittab /etc/rc.sysinit /lib /lib64 -/modules /sbin /usr |
