diff options
Diffstat (limited to 'rescue')
-rwxr-xr-x | rescue/Flash/scripts/backup_systemloop | 106 | ||||
-rwxr-xr-x | rescue/Flash/scripts/clear_systemloop | 89 | ||||
-rw-r--r-- | rescue/Flash/scripts/rescue_common | 205 | ||||
-rwxr-xr-x | rescue/Flash/scripts/reset_rootpass | 99 | ||||
-rwxr-xr-x | rescue/Flash/scripts/reset_userpass | 110 | ||||
-rwxr-xr-x | rescue/Flash/scripts/restore_systemloop | 167 | ||||
-rwxr-xr-x | rescue/Flash/scripts/test_badblocks | 69 | ||||
-rwxr-xr-x | rescue/Flash/scripts/upgrade | 307 | ||||
-rwxr-xr-x | rescue/Flash/scripts/upgrade.merge-users | 52 | ||||
-rw-r--r-- | rescue/Makefile | 2 | ||||
-rw-r--r-- | rescue/NEWS | 3 | ||||
-rwxr-xr-x | rescue/guessmounts | 2 | ||||
-rwxr-xr-x | rescue/install_bootloader | 4 | ||||
-rw-r--r-- | rescue/list.xml | 2 | ||||
-rwxr-xr-x | rescue/make_partimage_save_rest_all | 2 | ||||
-rwxr-xr-x | rescue/rescue-doc | 14 | ||||
-rwxr-xr-x | rescue/restore-image-lib.sh | 4 | ||||
-rw-r--r-- | rescue/tree/etc/hosts | 2 | ||||
-rw-r--r-- | rescue/tree/etc/issue | 2 | ||||
-rwxr-xr-x | rescue/tree/etc/rc.sysinit | 2 |
20 files changed, 19 insertions, 1224 deletions
diff --git a/rescue/Flash/scripts/backup_systemloop b/rescue/Flash/scripts/backup_systemloop deleted file mode 100755 index 65c3185e6..000000000 --- a/rescue/Flash/scripts/backup_systemloop +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - mkdir -p $rootdir - - if ! mount_usbroot $rootdir; then - return 1 - fi - - if [ x"$version" = x"1.0" ]; then - mkdir -p $tmpdir/shared - if ! mount_sharedroot $tmpdir/shared; then - return 1 - fi - fi - - if [ ! -d $dir ]; then - mkdir $dir - fi - - return 0 -} - -function doit() { - - clear - echo - echo -n 'Creating backup file. This can take some time: ' - - bzip2 -c $loop > $target 2> /tmp/rescue-backup.err & - - sleep 2 - - while ps | grep -q bzip2; do - progress - done - - sync - - echo - echo - - errsize=$(ls -la /tmp/rescue-backup.err | cut -d' ' -f5) - if [ $errsize -ne 0 ]; then - echo "Error compressing user files into $target" - return 1 - else - echo 'Backup file created!' - fi - - echo - - return 0 -} - -function cleanup() { - - if [ x"$version" = x"1.0" ]; then - umount $tmpdir/shared > /dev/null 2>&1 - rmdir $tmpdir/shared - fi - - umount $rootdir > /dev/null 2>&1 - rmdir $rootdir $tmpdir 2> /dev/null - - return 0 -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -if [ x"$version" = x"1.0" ]; then - dir="$tmpdir/shared/backup" - loop="$rootdir/loopbacks/system.loop" -else - dir="$rootdir/backup" - loop="$rootdir/.loopbacks/system.loop" -fi - -file="backup-$(date +%Y%m%d).bz2" -target="$dir/$file" - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup -exit 0 diff --git a/rescue/Flash/scripts/clear_systemloop b/rescue/Flash/scripts/clear_systemloop deleted file mode 100755 index 4152b16bf..000000000 --- a/rescue/Flash/scripts/clear_systemloop +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - mkdir -p $rootdir - - if ! mount_usbroot $rootdir; then - return 1 - fi - - return 0 -} - -function doit() { - - clear - echo - echo "WARNING!" - echo - echo "Mandriva Flash will be reset to factory defaults!" - echo -n "All user files, customizations and new packages installed " - echo "will be removed." - echo - echo "This process may take a few minutes." - echo - echo -n "Do you want to continue? [N/y] " - read confirm - - if [ x"$confirm" = x"y" -o x"$confirm" = x"Y" ]; then - - if [ ! -f $loop ] || [ x"$version" != x"1.0" ]; then - dd if=/dev/zero of=$loop bs=1000000 count=1000 - fi - - if [ x"$version" = x"1.0" ]; then - /sbin/mkfs.ext2 -q -F $loop - fi - - echo - if [ $? -ne 0 ]; then - echo 'Error resetting device to factory defaults' - return 1 - else - echo 'Mandriva Flash was restored to factory defaults!' - fi - fi - - echo - - return 0 -} - -function cleanup() { - - umount $rootdir > /dev/null 2>&1 - rmdir $rootdir $tmpdir 2> /dev/null -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -if [ x"$version" = x"1.0" ]; then - loop="$rootdir/loopbacks/system.loop" -else - loop="$rootdir/.loopbacks/system.loop" -fi - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup diff --git a/rescue/Flash/scripts/rescue_common b/rescue/Flash/scripts/rescue_common deleted file mode 100644 index 77435e6da..000000000 --- a/rescue/Flash/scripts/rescue_common +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash - -function detect_version() { - version="" - if has_label Share; then - version="1.0" - elif has_label MDVUSBROOT; then - version="1.05" - elif has_label Mdv_Flash; then - version="2.0" - elif has_label MDV_FLASH; then - version="2.05" - fi - usbroot_device=$_device - source_version_variables - - [ -n "$version" ] -} - -function source_version_variables { - local _version - _version=$1 - [ -z "$_version" ] && _version=$version - if [ "$_version" = "1.0" ]; then - label=MDVUSBROOT - boot_rel="/boot" - loopbacks_rel="/loopbacks" - elif [ "$_version" = "1.05" ]; then - label=MDVUSBROOT - boot_rel="/.boot" - loopbacks_rel="/.loopbacks" - elif [ "$_version" = "2.0" ]; then - label=Mdv_Flash - boot_rel="/.boot" - loopbacks_rel="/.loopbacks" - elif [ "$_version" = "2.05" ]; then - label=MDV_FLASH - boot_rel="/.boot" - loopbacks_rel="/.loopbacks" - fi -} - -function has_label() { - local _label _tmpdir - _label=$1 - - _tmpdir="/tmp/$$" - - mkdir -p $_tmpdir - - nash --force > /dev/null 2>&1 <<EOF -mount -t vfat LABEL=$_label $_tmpdir -EOF - - rc=$? - - _device=`perl -ne 'my @l = split; $l[1] eq "'$_tmpdir'" and print "$l[0]\n"' /proc/mounts` - [ -z "$_device" ] && rc=1 - - umount $_tmpdir 2> /dev/null - rmdir $_tmpdir 2> /dev/null - - return $rc -} - -function check_vendor() { - - # list of supported vendors/models - - # mandriva flash 1.0 (france) - vendors[0]="13fe" - models[0]="1a00" - # mandriva flash 1.0 (brazil) - vendors[1]="0930" - models[1]="653e" - # mandriva flash 4GB (france) - vendors[2]="13fe" - models[2]="1d00" - - rc=1 - - mount -t usbfs none /proc/bus/usb 2> /dev/null - - i=0 - while [ ! -z "${vendors[$i]}" ]; do - - grep "P:" /proc/bus/usb/devices | grep -q \ - "Vendor=${vendors[$i]} ProdID=${models[$i]}" - if [ $? -eq 0 ]; then - rc=0 - break - fi - - let i++ - done - - umount /proc/bus/usb 2> /dev/null - - return $rc -} - -function insert_pendrive() { - - _tmpdir="/tmp/rescue-temp" - mkdir -p $_tmpdir - - modprobe usb-storage > /dev/null 2>&1 - modprobe vfat > /dev/null 2>&1 - - echo - echo -n 'Please insert your Mandriva Flash pen drive and press ENTER when ready: ' - read READY - echo - echo -n 'Detecting pen drive: ' - - for ((i=0; $i <= 15 ; i++)); do - detect_version && nash --force > /dev/null 2>&1 <<EOF -mount -t vfat LABEL=$label $_tmpdir -EOF - if [ $? -ne 0 ]; then - echo -n '.' - sleep 1 - else - echo -n ' found!' - - if ! check_vendor; then - echo - echo "This is not an official Mandriva Flash key!" - echo - fi - - cat /proc/mounts | grep $_tmpdir | cut -d' ' -f1 | \ - sed 's/[0-9]*$//g' > /tmp/rescue-device - umount $_tmpdir - rmdir $_tmpdir 2> /dev/null - - return 0 - fi - done - - rmdir $_tmpdir 2> /dev/null - - echo - echo - echo "Couldn't detect Mandriva Flash pen drive!" - echo - - return 1 -} - -function mount_usbroot() { - - nash --force > /dev/null 2>&1 <<EOF -mount -t vfat LABEL=$label $1 -EOF - if [ $? -ne 0 ]; then - echo "Error mounting device labeled $label" - return 1 - fi - - return 0 -} - -function mount_sharedroot() { - - nash --force > /dev/null 2>&1 <<EOF -mount -t vfat LABEL=Share $1 -EOF - if [ $? -ne 0 ]; then - echo "Error mounting device labeled Share" - return 1 - fi - - return 0 -} - -function progress() { - - echo -ne '\b|' - usleep 100000 - echo -ne '\b/' - usleep 100000 - echo -ne '\b-' - usleep 100000 - echo -ne '\b\\' - usleep 100000 -} - -function lumount() { - local dir=$1 - loop=$(perl -ne '@l = split; if ($l[1] eq "'$dir'") { print $l[0]; exit }' /proc/mounts) - umount $dir - losetup -d $loop -} - -function set_sfs_loop() { - local dir=$1 - sfs_loop_std="$dir$loopbacks_rel/distrib.sqfs" - sfs_loop_lzma="$dir$loopbacks_rel/distrib-lzma.sqfs" - if [ -e $sfs_loop_lzma ]; then - sfs_loop=$sfs_loop_lzma - else - sfs_loop=$sfs_loop_std - fi -} diff --git a/rescue/Flash/scripts/reset_rootpass b/rescue/Flash/scripts/reset_rootpass deleted file mode 100755 index 9fd81155a..000000000 --- a/rescue/Flash/scripts/reset_rootpass +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - modprobe unionfs > /dev/null 2>&1 - modprobe sqlzma > /dev/null 2>&1 - modprobe squashfs-lzma > /dev/null 2>&1 - modprobe squashfs > /dev/null 2>&1 - modprobe loop > /dev/null 2>&1 - - mkdir -p $rootdir - mkdir -p $tmpdir/squash - mkdir -p $tmpdir/user - mkdir -p $tmpdir/union - - if ! mount_usbroot $rootdir; then - return 1 - fi - - set_sfs_loop $rootdir - - mount -t squashfs -o loop $sfs_loop $tmpdir/squash > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting distrib.sqfs" - return 1 - fi - - mount -t ext2 -o loop $sys_loop $tmpdir/user > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting system.loop" - return 1 - fi - - mount -t unionfs -o dirs=$tmpdir/user=rw:$tmpdir/squash=ro \ - none $tmpdir/union - if [ $? -ne 0 ]; then - echo "Error creating union of distrib.sqfs and system.loop" - return 1 - fi - - chroot $tmpdir/union /etc/init.d/keytable start &> /dev/null - chroot $tmpdir/union /usr/bin/unicode_start - - return 0 -} - -function doit() { - - clear - echo - chroot $tmpdir/union passwd root - echo - echo - - return 0 -} - -function cleanup() { - - chroot $tmpdir/union /usr/bin/unicode_stop - - umount $tmpdir/union > /dev/null 2>&1 - lumount $tmpdir/user > /dev/null 2>&1 - lumount $tmpdir/squash > /dev/null 2>&1 - umount $rootdir > /dev/null 2>&1 - - rmdir $tmpdir/union $tmpdir/user $tmpdir/squash 2> /dev/null - rmdir $rootdir $tmpdir 2> /dev/null -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -sys_loop="$rootdir$loopbacks_rel/system.loop" -sfs_loop= # - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup -exit 0 diff --git a/rescue/Flash/scripts/reset_userpass b/rescue/Flash/scripts/reset_userpass deleted file mode 100755 index e7c5477eb..000000000 --- a/rescue/Flash/scripts/reset_userpass +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - modprobe unionfs > /dev/null 2>&1 - modprobe sqlzma > /dev/null 2>&1 - modprobe squashfs-lzma > /dev/null 2>&1 - modprobe squashfs > /dev/null 2>&1 - modprobe loop > /dev/null 2>&1 - - mkdir -p $rootdir - mkdir -p $tmpdir/squash - mkdir -p $tmpdir/user - mkdir -p $tmpdir/union - - if ! mount_usbroot $rootdir; then - return 1 - fi - - set_sfs_loop $rootdir - - mount -t squashfs -o loop $sfs_loop $tmpdir/squash > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting distrib.sqfs" - return 1 - fi - - mount -t ext2 -o loop $sys_loop $tmpdir/user > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting system.loop" - return 1 - fi - - mount -t unionfs -o dirs=$tmpdir/user=rw:$tmpdir/squash=ro \ - none $tmpdir/union > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error creating union of distrib.sqfs and system.loop" - return 1 - fi - - chroot $tmpdir/union /etc/init.d/keytable start &> /dev/null - chroot $tmpdir/union /usr/bin/unicode_start - - return 0 -} - -function doit() { - - username=$(tail -1 $tmpdir/union/etc/passwd | cut -d ':' -f1) - - clear - echo - echo -n "What is your username? [$username] " - read name - - if [ -z "$name" ]; then - name="$username" - fi - - echo - echo - chroot $tmpdir/union passwd $name - echo - echo - - return 0 -} - -function cleanup() { - - chroot $tmpdir/union /usr/bin/unicode_stop - - umount $tmpdir/union > /dev/null 2>&1 - lumount $tmpdir/user > /dev/null 2>&1 - lumount $tmpdir/squash > /dev/null 2>&1 - umount $rootdir > /dev/null 2>&1 - - rmdir $tmpdir/union $tmpdir/user $tmpdir/squash 2> /dev/null - rmdir $rootdir $tmpdir 2> /dev/null -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -sys_loop="$rootdir$loopbacks_rel/system.loop" -sfs_loop= # - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup -exit 0 diff --git a/rescue/Flash/scripts/restore_systemloop b/rescue/Flash/scripts/restore_systemloop deleted file mode 100755 index 39c56e030..000000000 --- a/rescue/Flash/scripts/restore_systemloop +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - mkdir -p $rootdir - - if ! mount_usbroot $rootdir; then - return 1 - fi - - if [ x"$version" = x"1.0" ]; then - mkdir -p $tmpdir/shared - if ! mount_sharedroot $tmpdir/shared; then - return 1 - fi - fi - - return 0 -} - -function doit() { - - if [ ! -d $dir ]; then - echo - echo "Can't find a backup directory in the Share partition" - echo - return 0 - fi - - cd $dir - i=1 - for file in $(ls -c1 backup-*.bz2 2> /dev/null | sort -r | head -10); do - files[$i]="$file" - let i++ - done - cd - > /dev/null - - if [ $i -eq 1 ]; then - echo - echo 'No backup files found!' - echo - return 0 - fi - - while [ true ]; do - - clear - echo - echo "The following backup files were found:" - echo - - i=1 - while [ -n "${files[$i]}" ]; do - echo "[$i] ${files[$i]}" - let i++ - done - let i-- - echo - echo '[0] Cancel / Return to main menu' - - echo - echo 'Select from the list above, the file that you want to restore.' - echo 'The most recent files come first in the list.' - echo - echo -n "What backup file do you want to restore? [1] " - read option - - if [ -z "$option" ]; then - option=1 - fi - if [ x"$option" = x"0" ]; then - return 0 - fi - - if [ ! -f $dir/${files[$option]} ]; then - echo - echo "Error reading backup file ${files[$option]}!" - echo - echo -n 'Do you want to restore another backup file? [N/y] ' - read confirm - - if [ x"$confirm" = x"y" -o x"$confirm" = x"Y" ]; then - continue - else - return 0 - fi - else - - echo - echo -n 'Restoring backup file. This can take some time: ' - - bunzip2 -c $dir/${files[$option]} > $loop \ - 2> /tmp/rescue-backup.err & - - sleep 2 - - while ps | grep -q bunzip2; do - progress - done - - sync - echo - echo - - errsize=$(ls -la /tmp/rescue-backup.err | cut -d' ' -f5) - if [ $errsize -ne 0 ]; then - echo 'Error restoring user files!' - echo - return 1 - else - echo 'Backup file restored!' - echo - break - fi - fi - done - - return 0 -} - -function cleanup() { - - if [ x"$version" = x"1.0" ]; then - umount $tmpdir/shared > /dev/null 2>&1 - rmdir $tmpdir/shared 2> /dev/null - fi - - umount $rootdir > /dev/null 2>&1 - rmdir $rootdir $tmpdir 2> /dev/null - - return 0 -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -if [ x"$version" = x"1.0" ]; then - dir="$tmpdir/shared/backup" - loop="$rootdir/loopbacks/system.loop" -else - dir="$rootdir/backup" - loop="$rootdir/.loopbacks/system.loop" -fi - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup -exit 0 diff --git a/rescue/Flash/scripts/test_badblocks b/rescue/Flash/scripts/test_badblocks deleted file mode 100755 index 3fb1f34d8..000000000 --- a/rescue/Flash/scripts/test_badblocks +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -function prepare() { - - return 0 -} - -function doit() { - - clear - echo - echo "WARNING!" - echo - echo "Searching for bad blocks in Mandriva Flash is a slow process." - echo - echo -n "Do you want to continue? [N/y] " - read confirm - - echo - echo - - device=$(cat /tmp/rescue-device) - - if [ x"$confirm" = x"y" -o x"$confirm" = x"Y" ]; then - - /sbin/badblocks -n -v -s ${device}1 - if [ x"$version" = x"1.0" ]; then - /sbin/badblocks -n -v -s ${device}2 - fi - fi - - echo - echo 'Bad blocks scan completed!' - echo - - return 0 -} - -function cleanup() { - - umount $rootdir > /dev/null 2>&1 - rmdir $rootdir $tmpdir 2> /dev/null -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -cleanup diff --git a/rescue/Flash/scripts/upgrade b/rescue/Flash/scripts/upgrade deleted file mode 100755 index 87510b421..000000000 --- a/rescue/Flash/scripts/upgrade +++ /dev/null @@ -1,307 +0,0 @@ -#!/bin/bash - -# import functions library -source rescue_common - -tmpdir="/tmp/flash-rescue-root" -rootdir="$tmpdir/pen" - -media_dir="/tmp/media" -upgrade_dir="$media_dir/upgrade" - - -config_files_network_scripts="etc/sysconfig/network-scripts/ifcfg-* \ - etc/sysconfig/network-scripts/cellular.d \ - etc/sysconfig/network-scripts/vpn.d \ - etc/sysconfig/network-scripts/wireless.d" - -config_files_users="etc/passwd etc/shadow etc/group etc/gshadow" -config_files_time="etc/localtime etc/ntp etc/ntp.conf" -config_files="etc/sysconfig/* $config_files_users $config_files_time \ - etc/wpa_supplicant.conf etc/shorewall etc/kde \ - etc/udev/rules.d/61-*_config.rules" - -config_files_to_remove="etc/sysconfig/harddrake2" - -mozilla_files=".apps/FirefoxPortable/Data/profile/*.sqlite \ - .apps/FirefoxPortable/Data/profile/prefs.js \ - .apps/FirefoxPortable/Data/profile/key3.db \ - .apps/FirefoxPortable/Data/profile/signons*.txt \ - .apps/FirefoxPortable/Data/profile/Bookmarks.html \ - .apps/FirefoxPortable/Data/profile/Cookies.txt \ - .apps/FirefoxPortable/Data/profile/Downloads.rdf \ - .apps/FirefoxPortable/Data/profile/History.dat \ - .apps/ThunderbirdPortable/Data/profile/prefs.js \ - .apps/ThunderbirdPortable/Data/profile/abook.mab \ - .apps/ThunderbirdPortable/Data/profile/Mail \ - .apps/ThunderbirdPortable/Data/profile/ImapMail" - -function prepare() { - - echo "Mounting Mandriva Flash key..." - echo - - modprobe unionfs > /dev/null 2>&1 - modprobe sqlzma > /dev/null 2>&1 - modprobe squashfs-lzma > /dev/null 2>&1 - modprobe squashfs > /dev/null 2>&1 - modprobe loop > /dev/null 2>&1 - - mkdir -p $rootdir - mkdir -p $tmpdir/squash - mkdir -p $tmpdir/user - mkdir -p $tmpdir/union - - if ! mount_usbroot $rootdir; then - return 1 - fi - - set_sfs_loop $rootdir - - mount -t ext2 -o loop $sys_loop $tmpdir/user > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting system.loop" - return 1 - fi - - return 0 -} - -function get_existing_rpms() { - - echo "Getting list of installed packages..." - echo - - mount -t squashfs -o loop $sfs_loop $tmpdir/squash > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting distrib.sqfs" - return 1 - fi - - mount -t unionfs -o dirs=$tmpdir/user=rw:$tmpdir/squash=ro \ - none $tmpdir/union - if [ $? -ne 0 ]; then - echo "Error creating union of distrib.sqfs and system.loop" - return 1 - fi - - chroot $tmpdir/squash rpm -qa | sort > /tmp/previous_rpms.list - if [ $? -ne 0 ]; then - echo "Error getting list of vanilla rpms installed on previous key" - fi - - chroot $tmpdir/union rpm -qa | sort > /tmp/existing_rpms.list - if [ $? -ne 0 ]; then - echo "Error getting list of rpms installed prior to upgrade" - fi - - umount $tmpdir/union > /dev/null 2>&1 - lumount $tmpdir/squash > /dev/null 2>&1 - - mkdir -p $tmpdir/user/root - diff /tmp/previous_rpms.list /tmp/existing_rpms.list | sed -n 's/^> //p' > $tmpdir/user/root/new_existing_rpms.list - - return 0 -} - -function move_files() { - for i in $*; do - if [ -e $i ]; then - dir=`dirname $i` - [ "$dir" = "." ] || mkdir -p ..keep/$dir - mv $i ..keep/$dir || { echo "Error moving $i"; return 1; } - fi - done - - return 0 -} - -function remove_non_user_nor_config_files() { - - echo "Filtering system configuration files and user accounts..." - echo - - cd $tmpdir/user - - rm -rf $config_files_to_remove - - if [ -e ..keep ]; then - mv ..keep ..keep.bak - fi - if [ -e ..keep ]; then - echo "remove_non_user_nor_config_files can't work with existing temp dir" - return 1 - fi - - mkdir ..keep - - move_files $config_files_network_scripts || return 1 - rm -rf etc/sysconfig/network-scripts - - move_files home root $config_files || return 1 - rm -rf * - rm -rf .[^.]* - - mv ..keep/* . - rmdir ..keep - - cd - > /dev/null - - return 0 -} - -function backup_portable_apps_user_data() { - echo "Backing up Firefox and Thunderbird user data..." - echo - - cd $rootdir - - if [ -e ..keep ]; then - mv ..keep ..keep.bak - fi - - if [ -e ..keep ]; then - echo "remove_non_user_nor_config_files can't work with existing temp dir" - return 1 - fi - - mkdir ..keep - - move_files $mozilla_files - - cd - > /dev/null - - return 0 -} - -function restore_portable_apps_user_data() { - echo "Restoring Firefox and Thunderbird user data..." - echo - - cd $rootdir/..keep || return 1 - tar c -C $rootdir/..keep . | tar x -C $rootdir - rm -rf $rootdir/..keep - cd - > /dev/null - - return 0 -} - -function copy_new_version() { - - echo "Copying new Mandriva Flash system..." - - rm -rf $rootdir$boot_rel - rm -f $rootdir$loopbacks_rel/.*sqf - rm -f $rootdir$loopbacks_rel/.*sqfs - [ -d "$modules_dir" ] && rm -rf $modules_dir - - tar c -C $upgrade_dir . | pv -s `du -sb $upgrade_dir | cut -f 1` | tar x -C $rootdir - echo - - chmod -R u+w $rootdir - chmod -R u-w $rootdir$boot_rel $rootdir$loopbacks_rel - - new_label=$(source_version_variables "2.05"; echo $label) - MTOOLS_SKIP_CHECK=1 mlabel -i $usbroot_device ::$new_label - - return 0 -} - -function merge_config_files() { - - echo "Merging user and group accounts in new system..." - echo - - mount -t squashfs -o loop $sfs_loop $tmpdir/squash > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Error mounting distrib.sqfs" - return 1 - fi - - upgrade.merge-users $tmpdir/user/etc $tmpdir/squash/etc - - mount -t unionfs -o dirs=$tmpdir/user=rw:$tmpdir/squash=ro \ - none $tmpdir/union - if [ $? -ne 0 ]; then - echo "Error creating union of distrib.sqfs and system.loop" - return 1 - fi - - #- reapply lang configuration, mostly to rewrite kdeglobals - chroot $tmpdir/union perl -I/usr/lib/libDrakX -Mlang -e "lang::write(lang::read())" &>/dev/null - - #- remove KDE sessions file so that previous compiz usage does not break session - rm -f $tmpdir/union/home/*/.kde/share/config/ksmserverrc &>/dev/null - - #- remove KDE autostart files that should have been migrated by startkde... - rm -f $tmpdir/union/home/*/.kde/Autostart/{alignment-icons,openkmenu}.desktop &>/dev/null - - return 0 -} - -function doit() { - - if [ -d $tmpdir/user/var/lib/rpm/Packages ]; then - get_existing_rpms || return 1 - fi - - remove_non_user_nor_config_files || return 1 - - backup_portable_apps_user_data || return 1 - - copy_new_version || return 1 - - restore_portable_apps_user_data || return 1 - - merge_config_files || return 1 - - return 0 -} - -function cleanup() { - cd / - - umount $tmpdir/union > /dev/null 2>&1 - lumount $tmpdir/user > /dev/null 2>&1 - lumount $tmpdir/squash > /dev/null 2>&1 - umount $rootdir > /dev/null 2>&1 - - rmdir $tmpdir/union $tmpdir/user $tmpdir/squash 2> /dev/null - rmdir $rootdir $tmpdir 2> /dev/null -} - -clear -trap cleanup SIGINT - -version="" -if ! insert_pendrive; then - exit 1 -fi - -#- works only when upgrading versions with the same layout -sys_loop="$rootdir$loopbacks_rel/system.loop" -sfs_loop= # - -modules_dir="$rootdir$loopbacks_rel/modules" - -echo - -if ! prepare; then - cleanup - exit 1 -fi - -if ! doit; then - cleanup - exit 1 -fi - -echo "Please wait, finishing copy to key..." -echo - -cleanup - -echo "Congratulations! Your Mandriva Flash system is now upgraded." -echo - -exit 0 diff --git a/rescue/Flash/scripts/upgrade.merge-users b/rescue/Flash/scripts/upgrade.merge-users deleted file mode 100755 index 297960e91..000000000 --- a/rescue/Flash/scripts/upgrade.merge-users +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; - -@ARGV == 2 or die "merge_users <existing files dir> <new files dir>\n"; - -my ($existing_dir, $new_dir) = @ARGV; - -merge('passwd', 'shadow'); -merge('group', 'gshadow'); - -sub merge { - my ($main, $shadow) = @_; - - my @new = cat_("$new_dir/$main"); - my %new_ids = map { (split ':')[2] => $_ } @new; - - my %names_to_have; - foreach (cat_("$existing_dir/$main")) { - my @l = split ':'; - next if $l[0] eq 'nobody' || $l[2] < 500; - if (my $e = $new_ids{$l[2]}) { - $_ eq $e or warn "ERROR: conflicting entries:\n $_ $e"; - } else { - push @new, $_; - $names_to_have{$l[0]} = 1; - } - } - - my @new_shadow = grep { !/^root:/ } cat_("$new_dir/$shadow"); - foreach (cat_("$existing_dir/$shadow")) { - my ($name) = split ':'; - if ($name eq 'root') { - unshift @new_shadow, $_; - } elsif ($names_to_have{$name}) { - push @new_shadow, $_; - } - } - - if (rename "$existing_dir/$main", "$existing_dir/$main.old") { - output("$existing_dir/$main", @new); - } else { - warn "rename $existing_dir/$main failed: $?\n"; - <STDIN>; - } - if (rename "$existing_dir/$shadow", "$existing_dir/$shadow.old") { - output("$existing_dir/$shadow", @new_shadow); - } else { - warn "rename $existing_dir/$shadow failed: $?\n"; - <STDIN>; - } -} diff --git a/rescue/Makefile b/rescue/Makefile index cbc1a981b..4a6edd9e9 100644 --- a/rescue/Makefile +++ b/rescue/Makefile @@ -1,6 +1,6 @@ include ../Makefile.config -VERSION=1.21 +VERSION=1.22 PRODUCT=drakx-installer-rescue RESCUE = rescue.sqfs diff --git a/rescue/NEWS b/rescue/NEWS index 078c48ef2..557db4c4e 100644 --- a/rescue/NEWS +++ b/rescue/NEWS @@ -1,3 +1,6 @@ +Version 1.22 - 24 February 2011, by Pascal "pterjan" Terjan + +- cleaning for Mageia import - include /etc/netconfig (needed by mount.nfs) Version 1.18 - 13 April 2010, by Olivier "blino" Blin diff --git a/rescue/guessmounts b/rescue/guessmounts index 33530ef8c..37e2249a1 100755 --- a/rescue/guessmounts +++ b/rescue/guessmounts @@ -61,7 +61,7 @@ foreach (@$normal_parts) { } fs::type::true_local_fs_types() or next; if (my $release_file = common::release_file($target)) { - print STDERR "=> found a Mandriva Linux root partition on $dev\n=> type $fs, version `", + print STDERR "=> found a %s root partition on $dev\n=> type $fs, version `", chomp_(cat_("$target$release_file")), "'\n"; @fstab = fs::read_fstab($target, '/etc/fstab'); $root = $dev; diff --git a/rescue/install_bootloader b/rescue/install_bootloader index e8bc04ad8..fa7b92543 100755 --- a/rescue/install_bootloader +++ b/rescue/install_bootloader @@ -30,7 +30,7 @@ my $release = common::mandrake_release($::prefix) || }; if ($release) { - $release =~ /Mandrake|Mandriva/ or die "release file doesn't contain 'Mandriva', exiting.\n"; + $release =~ /Mageia|Mandriva/ or die "release file doesn't contain '%s', exiting.\n"; } elsif (fs::get::mntpoint2part($::prefix, [ fs::read_fstab('', '/proc/mounts') ])) { die "unknown distribution mounted in $::prefix\n"; } else { @@ -59,7 +59,7 @@ if (@main_methods == 0) { my $install = $bootloader::{'install_raw_' . $main_method} or die "unknown bootloader method install_raw_$main_method\n"; -print "About to re-install Boot Loader $main_method of following Mandriva Linux distribution:\n\t", +print "About to re-install Boot Loader $main_method of following %s distribution:\n\t", $release, "\n"; if (!$auto) { print "=> ok? <press Enter to continue, 'n' and Enter to cancel> "; diff --git a/rescue/list.xml b/rescue/list.xml index b9e73ccaa..17ab5c3d1 100644 --- a/rescue/list.xml +++ b/rescue/list.xml @@ -149,7 +149,7 @@ /var/run/utmp <if ARCH="i.86|x86_64"> - <from dir="/lib/grub/ARCH-mandriva" expand="glob"> + <from dir="/lib/grub/ARCH-mageia" expand="glob"> stage1 stage2 *_stage1_5 diff --git a/rescue/make_partimage_save_rest_all b/rescue/make_partimage_save_rest_all index a7af52130..929ffd2c1 100755 --- a/rescue/make_partimage_save_rest_all +++ b/rescue/make_partimage_save_rest_all @@ -57,7 +57,7 @@ EOF ln -s $partimage_dir$data_dir .tmp$dir fi - genisoimage -f -o part_$action.iso -r -J -hide-rr-moved -nobak -cache-inodes -publisher Mandriva -V 'mdk part save/rest' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .tmp + genisoimage -f -o part_$action.iso -r -J -hide-rr-moved -nobak -cache-inodes -publisher Mageia -V 'part save/rest' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .tmp mkcd --addmd5 part_$action.iso done diff --git a/rescue/rescue-doc b/rescue/rescue-doc index fa03d1be3..c324ac9e1 100755 --- a/rescue/rescue-doc +++ b/rescue/rescue-doc @@ -13,15 +13,15 @@ problem? The rescue system on this CD is a very basic text-based environment for rescuing systems that no longer boot. You will not find an easy-to-use graphical environment in this rescue -system, nor the Mandriva detection/configuration libraries. +system, nor the detection/configuration libraries. The vast majority of problems that can affect a Linux system are much easier to repair on a running system than by booting into "rescue mode". In fact, there are very few problems which aren't easier to resolve in the comfortable environment of a fully -installed Mandriva Linux system than in this spartan "rescue -system" shell. Some of the most common problems include: +installed system than in this spartan "rescue system" shell. +Some of the most common problems include: - bad or missing X (video display) configuration - adding/removing/reconfiguring hardware @@ -45,13 +45,9 @@ system is the right tool. Some common examples include: just modify what's necessary to boot into a running system, then complete the fix from there. -In case you have found a new problem which should be handled by -"rescue mode" but currently isn't, please report it to -<pixel@mandriva.com>. - -For more information on troubleshooting a Mandriva Linux system, +For more information on troubleshooting your system, please consult the official manuals, the documentation on -MandrivaLinux.com, MandrivaClub.org, or the MandrivaExpert.com support forum. +wiki.mageia.org or support forum at forum.mageia.org. <press 'q' (qwerty keyboard) to continue> )); diff --git a/rescue/restore-image-lib.sh b/rescue/restore-image-lib.sh index ea610ab21..3451f7be5 100755 --- a/rescue/restore-image-lib.sh +++ b/rescue/restore-image-lib.sh @@ -1,7 +1,7 @@ #!/bin/bash -TITLE="Mandriva Installer" -BACKTITLE="Mandriva" +TITLE="%s Installer" +BACKTITLE="%s" MIN_DISKSIZE=5000000 debug="/dev/null" 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/issue b/rescue/tree/etc/issue index 2bbd2b38a..d4aee6d89 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;40mMandriva Linux 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 diff --git a/rescue/tree/etc/rc.sysinit b/rescue/tree/etc/rc.sysinit index 03a709afd..0e1a9f687 100755 --- a/rescue/tree/etc/rc.sysinit +++ b/rescue/tree/etc/rc.sysinit @@ -6,7 +6,7 @@ KADIR="/ka2" export PATH=/bin:/sbin:/usr/bin:/usr/sbin -echo -e "\t\t\tWelcome to \\033[1;36mMandriva\\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 / |