Достаточно интересная проблема с Samsung SCX-4321, после установки --> ребут --> летит система , а теперь подробнее:
-Дистрибутив debian etch - lenny, i386
-Sane, cups последнии версии из репозитария.
-Подключение мфу - usb.
Драйверы с nodevice.com, далее после распаковки есть autorun, с графическим инсталятором, после установки все идельно - работает и принтер и сканер, кажется жизнь прекрасна, НО после ребута где-то в стадии монтирование корневой фс, гаснет монитор и т.д, система уходит в себя ;(, в sigle user mode тоже самое.
В cups принтер сажается на mfp:/dev/mfp4.
Чуть позже предоставлю более подробную картину, логи ;(, мб кто-нибудь сталкивался с таким явлением.
потому что не надо ставить из таких инсталляторов.
Он там свои либы glibc ставить и ещё всякую хрень творит.
Согласен, посоветуете вручную все раскидать ?
Установочный сценарий:
Код:
#! /bin/sh
# {
### Common procedures
wait_to_allow_to_see_info_line() {
sleep 2
}
abort_execution() {
echo "ERROR: $1, execution aborted"
wait_to_allow_to_see_info_line
exit 4
}
shell_script_execution_disable() {
test -n "$1" || return
test -n "$MODIFIER_ID_STRING" || return
TMP_FILE_ENA=/tmp/`basename $1`-dis.tmp
cat $1 > $TMP_FILE_ENA
echo "exit 0 # $MODIFIER_ID_STRING" > $1
cat $TMP_FILE_ENA >> $1
rm -f $TMP_FILE_ENA
}
shell_script_execution_enable() {
test -n "$1" || return
test -n "$MODIFIER_ID_STRING" || return
TMP_FILE_DIS=/tmp/`basename $1`-ena.tmp
cat $1 | grep -v "`echo $MODIFIER_ID_STRING`" > $TMP_FILE_DIS
cat $TMP_FILE_DIS > $1
rm -f $TMP_FILE_DIS
}
remove_strings_containig_pattern() {
GPAT=""
for w in $2 ; do
GPAT="${GPAT}${w}"
if [ "$w" != "$3" ]; then
GPAT="${GPAT}\ "
fi
done
test -n "$1" || return
test -n "$2" || return
TMP_FILE_RSP=/tmp/`basename $1`-rsp.tmp
cat $1 | grep -v "$GPAT" > $TMP_FILE_RSP
cat $TMP_FILE_RSP > $1
rm -f $TMP_FILE_RSP
}
check_package()
{
if [ -f /etc/slackware-version ]; then
result=`ls /var/log/packages/$1-* 2> /dev/null`
rv=$?
result=`echo $result | awk -F '-' '{print $2}'`
else
result=`rpm -q --queryformat '%{VERSION}' $1 2>/dev/null`
rv=$?
fi
#d echo DEBUG: XXX check_package $1 : result=$result rv=$rv
return $rv
}
is_x11_running() {
if ps -C X > /dev/null; then
return 0
fi
return 1
}
detect_system_packages() {
# RPM_DETECTED=0
CUPS_DETECTED=1
GS_DETECTED=1
SANE_DETECTED=1
# if test -n "`rpm --version 2> /dev/null`" ; then
# RPM_DETECTED=1
# fi
if ! check_package cups ; then
if ! test -f /etc/cups/printers.conf && ! test -e /usr/sbin/cupsd ; then
CUPS_DETECTED=0
fi
fi
if ! check_package ghostscript ; then
if test -z "`gs --version 2> /dev/null`" ; then
GS_DETECTED=0
fi
fi
if ! check_package sane ; then
if ! check_package sane-backends ; then
if ! test -f /usr/lib${PLSFX}/libsane.so.1 ; then
SANE_DETECTED=0
fi
fi
fi
}
check_related_packages() {
TOTAL_RELATED_PACKAGES_INSTALLED=`ls -ld /opt/*/mfp/uninstall/guiuninstall 2> /dev/null | wc | awk '{print $1}'`
}
check_this_package() {
THIS_PACKAGE_ALREADY_INSTALLED=`ls -ld /opt/${VENDOR}/mfp/uninstall/guiuninstall 2> /dev/null | wc | awk '{print $1}'`
}
set_firmware_device_name() {
if [ "$MODEL" = "mfp560" ]; then
FIRMWARE_DEVICE_NAME="MFP 560 Series"
elif [ "$MODEL" = "mfp750" ]; then
FIRMWARE_DEVICE_NAME="MFP 750 Series"
elif [ "$MODEL" = "clx3160" ]; then
FIRMWARE_DEVICE_NAME="CLX-3160 Series"
elif [ "$MODEL" = "scx4100" ]; then
FIRMWARE_DEVICE_NAME="SCX-4100 Series"
elif [ "$MODEL" = "scx4200" ]; then
FIRMWARE_DEVICE_NAME="SCX-4200 Series"
elif [ "$MODEL" = "scx4x16" ]; then
FIRMWARE_DEVICE_NAME="SCX-4x16 Series"
elif [ "$MODEL" = "scx4x20" ]; then
FIRMWARE_DEVICE_NAME="SCX-4x20 Series"
elif [ "$MODEL" = "scx4x21" ]; then
FIRMWARE_DEVICE_NAME="SCX-4x21 Series"
elif [ "$MODEL" = "scx5312f" ]; then
FIRMWARE_DEVICE_NAME="SCX-5x12 Series"
elif [ "$MODEL" = "scx5x30" ]; then
FIRMWARE_DEVICE_NAME="SCX-5x30 Series"
elif [ "$MODEL" = "scx6x20" ]; then
FIRMWARE_DEVICE_NAME="SCX-6x20 Series"
elif [ "$MODEL" = "scx6x22ps" ]; then
FIRMWARE_DEVICE_NAME="SCX-6x22 Series"
elif [ "$MODEL" = "sf531p" ]; then
FIRMWARE_DEVICE_NAME="SF-530 Series"
else
FIRMWARE_DEVICE_NAME=
fi
}
prepare_shared_libraries() {
if [ "$USE_WRAPPERS" = "1" ]; then
( cd /opt/${VENDOR}/mfp/lib${PLSFX} && \
mv libqt-mt.so.3 libqt-mt.so.3.0.5 ; \
ln -s -f libqt-mt.so.3.0.5 libqt-mt.so.3.0 ; \
ln -s -f libqt-mt.so.3.0.5 libqt-mt.so.3 ; \
ln -s -f libqt-mt.so.3.0.5 libqt-mt.so ; \
)
else
rm -f /opt/${VENDOR}/mfp/lib${PLSFX}/libqt-mt.so.3
fi
}
check_libstdcxx() {
LIBSTDCXX_FILES=`ls /usr/lib${PLSFX}/libstdc++.so.5* 2> /dev/null`
LIBSTDCXX_ARC="noarch/libstdc++-5-${HARDWARE_PLATFORM}.tar.gz"
if test -z "$LIBSTDCXX_FILES" -a -f $LIBSTDCXX_ARC ; then
echo -n "libstdc++.so.5 (gcc 3.0.x .. 3.3.x) not found, install ... "
zcat $LIBSTDCXX_ARC | tar -xf - -C /
ldconfig
echo "done"
fi
if [ ! -h /usr/lib/libstdc++-libc6.2-2.so.3 -o ! -f /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so ]; then
echo -n "libstdc++ v3 (gcc 2.96) not found, install ... "
zcat noarch/libstdc++-3.tar.gz | tar -xf - -C /
ldconfig
echo "done"
fi
}
check_libtiff() {
LIBTIFF_FILES=`ls /usr/lib${PLSFX}/libtiff.so.3* 2> /dev/null`
LIBTIFF_ARC="noarch/libtiff-3-${HARDWARE_PLATFORM}.tar.gz"
if test -z "$LIBTIFF_FILES" -a -f $LIBTIFF_ARC ; then
echo -n "libtiff.so.3 not found, install ... "
zcat $LIBTIFF_ARC | tar -xf - -C /
ldconfig
echo "done"
fi
}
setup_wrappers() {
QT_APPLICATIONS='Configurator ImageManager printeradd printertest shhv slpr slprhelper smfpscan'
SETUID_ROOT_APPLICATIONS='Configurator slprhelper'
( cd /opt/${VENDOR}/mfp/bin && \
mkdir -p ../share
chown root:root ldwrap ldwrapx
chmod 755 ldwrap
chmod 4755 ldwrapx
for FNAME in $QT_APPLICATIONS ; do
mv $FNAME ../share/${FNAME}.bin
chown root:root ../share/${FNAME}.bin
chmod 755 ../share/${FNAME}.bin
if echo $SETUID_ROOT_APPLICATIONS | grep -q -w "$FNAME" ; then
ln -s -f ldwrapx $FNAME
else
ln -s -f ldwrap $FNAME
fi
done
# chmod 4755 ../share/Configurator.bin # root privililiges are set in ldwrapx
# chmod 4755 ../share/slpr.bin # see comment on slpr below
)
}
create_script_start_web_browser() {
mkdir -p /opt/$VENDOR/mfp/bin
cat > /opt/$VENDOR/mfp/bin/start_web_browser.sh <<EOF
#!/bin/sh
WEB_BROWSER=\`which firefox 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which mozilla 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which konqueror 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which galeon 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which opera 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which netscape 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which epiphany 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=\`which mozilla-firefox 2> /dev/null\`
if test -z "\$WEB_BROWSER" ; then
WEB_BROWSER=true
fi
fi
fi
fi
fi
fi
fi
fi
\$WEB_BROWSER \$1
EOF
chmod 755 /opt/$VENDOR/mfp/bin/start_web_browser.sh
}
write_desktop_directory() {
if test -z "$1" ; then
return 1
fi
cat > $1 <<EOF
[Desktop Entry]
Name=$VENDOR Unified Driver
Name[C]=$VENDOR Unified Driver
Comment=$VENDOR Unified Driver
Comment[C]=$VENDOR Unified Driver
Icon=/opt/$VENDOR/mfp/share/images/Configurator.png
Type=Directory
EOF
}
fix_desktop_file_ownership() {
DIR_NAME=`dirname $1`
DIR_LSLDN=`ls -ldn $DIR_NAME`
OWNERSHIP="`echo $DIR_LSLDN | awk '{print \$3}'`:`echo $DIR_LSLDN | awk '{print \$4}'`"
if test -n "$OWNERSHIP" ; then
chown "$OWNERSHIP" $1
fi
}
write_configurator_desktop_file() {
if test -z "$1" ; then
return 1
fi
cat > $1 <<EOF
[Desktop Entry]
Name=$VENDOR Unified Driver Configurator
Name[C]=$VENDOR Unified Driver Configurator
Comment=Manage your printers and scanners here
Comment[C]=Manage your printers and scanners here
Type=Application
Exec=/opt/$VENDOR/mfp/bin/Configurator
Path=/opt/$VENDOR/mfp/bin
Icon=/opt/$VENDOR/mfp/share/images/Configurator.png
Terminal=0
TerminalOptions=
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
fix_desktop_file_ownership $1
}
write_toner_reorder_desktop_file() {
VENDOR_C=$VENDOR
if [ "$VENDOR" = "DELL" ] ; then
VENDOR_C=Dell
URL_SUPPLIERS=http://www.dell.com/supplies
else
return 0
fi
if test -z "$1" ; then
return 1
fi
cat > $1 <<EOF
[Desktop Entry]
Name=$VENDOR_C Toner Reorder
Name[C]=$VENDOR_C Toner Reorder
Comment=Order Toner Cartridge Online
Comment[C]=Order Toner Cartridge Online
Type=Application
Exec=/opt/$VENDOR/mfp/bin/start_web_browser.sh $URL_SUPPLIERS
Path=/opt/$VENDOR/mfp/bin
Icon=/opt/$VENDOR/mfp/share/images/TonerReorder.png
Terminal=0
TerminalOptions=
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
fix_desktop_file_ownership $1
create_script_start_web_browser
}
write_helpviewer_desktop_file() {
if test -z "$1" ; then
return 1
fi
cat > $1 <<EOF
[Desktop Entry]
Name=$VENDOR Unified Driver Help
Name[C]=$VENDOR Unified Driver Help
Comment=HTML help viewer utility
Comment[C]=HTML help viewer utility
Type=Application
Exec=/opt/$VENDOR/mfp/bin/shhv
Path=/opt/$VENDOR/mfp/bin
Icon=/opt/$VENDOR/mfp/share/images/HelpViewer.png
Terminal=0
TerminalOptions=
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
}
write_uninstall_desktop_file() {
if test -z "$1" ; then
return 1
fi
cat > $1 <<EOF
[Desktop Entry]
Name=Uninstall $VENDOR Unified Driver
Name[C]=Uninstall $VENDOR Unified Driver
Comment=$VENDOR Unified Driver uninstallation script
Comment[C]=$VENDOR Unified Driver uninstallation script
Type=Application
Exec=/opt/$VENDOR/mfp/uninstall/uninstall.sh
Path=/opt/$VENDOR/mfp/uninstall
Icon=/opt/$VENDOR/mfp/share/images/Uninstall.png
Terminal=0
TerminalOptions=
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
}
append_categories() {
if test -n "$1" ; then
echo "Categories=Application;SystemSetup;X-${VENDOR}-Config-UD;" >> $1
fi
}
handle_menu() {
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
if [ -d "$1" ] && mkdir -p "$1/${VENDOR}_UD" ; then
write_desktop_directory $1/${VENDOR}_UD/.directory
write_configurator_desktop_file $1/${VENDOR}_UD/${VENDOR}Configurator.desktop
write_helpviewer_desktop_file $1/${VENDOR}_UD/${VENDOR}HelpViewer.desktop
write_uninstall_desktop_file $1/${VENDOR}_UD/${VENDOR}UninstallUD.desktop
fi
elif [ "$SCRIPT_MODE" = "UNINSTALL" ] ; then
rm -rf $1/${VENDOR}_UD
fi
}
handle_menu_redhat89() {
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
if ! grep -q "$VENDOR Unified Driver" /etc/X11/desktop-menus/applications.menu ; then
${HARDWARE_PLATFORM}/install/vendormenu /etc/X11/desktop-menus/applications.menu
fi
write_desktop_directory $2/${VENDOR}_UD.directory
write_configurator_desktop_file $1/${VENDOR}ConfiguratorUD.desktop
append_categories $1/${VENDOR}ConfiguratorUD.desktop
write_helpviewer_desktop_file $1/${VENDOR}HelpViewerUD.desktop
append_categories $1/${VENDOR}HelpViewerUD.desktop
write_uninstall_desktop_file $1/${VENDOR}UninstallUD.desktop
append_categories $1/${VENDOR}UninstallUD.desktop
elif [ "$SCRIPT_MODE" = "UNINSTALL" ] ; then
rm -f $1/.directory \
$2/${VENDOR}_UD.directory \
$1/${VENDOR}ConfiguratorUD.desktop \
$1/${VENDOR}HelpViewerUD.desktop \
$1/${VENDOR}UninstallUD.desktop
fi
}
handle_menu_freedesktop() {
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
if ! grep -q "$VENDOR Unified Driver" "$3" ; then
${HARDWARE_PLATFORM}/install/vendormenu -f $3
fi
write_desktop_directory $2/${VENDOR}_UD.directory
write_configurator_desktop_file $1/${VENDOR}ConfiguratorUD.desktop
append_categories $1/${VENDOR}ConfiguratorUD.desktop
write_helpviewer_desktop_file $1/${VENDOR}HelpViewerUD.desktop
append_categories $1/${VENDOR}HelpViewerUD.desktop
write_uninstall_desktop_file $1/${VENDOR}UninstallUD.desktop
append_categories $1/${VENDOR}UninstallUD.desktop
elif [ "$SCRIPT_MODE" = "UNINSTALL" ] ; then
rm -f $2/${VENDOR}_UD.directory \
$1/${VENDOR}ConfiguratorUD.desktop \
$1/${VENDOR}HelpViewerUD.desktop \
$1/${VENDOR}UninstallUD.desktop
fi
}
write_directory_for_update_menus() {
echo "?package(menu): charset=\"utf8\" section=\"/\" needs=\"x11\" title=\"$VENDOR Unified Driver\" icon=\"/opt/$VENDOR/mfp/share/images/Configurator.png\"" >> $1
}
write_entry_for_update_menus() {
echo "?package(menu): charset=\"utf8\" command=\"$1\" section=\"$VENDOR Unified Driver/\" needs=\"x11\" title=\"$2\" icon=\"$3\"" >> $4
}
handle_menu_with_update_menus() {
ENTRY_DIR=/usr/lib/menu
PACKAGE_STRING="$VENDOR Unified Driver"
rm -f $ENTRY_DIR/${VENDOR}_UD
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
write_directory_for_update_menus $ENTRY_DIR/${VENDOR}_UD
write_entry_for_update_menus \
/opt/$VENDOR/mfp/bin/Configurator \
"$PACKAGE_STRING Configurator" \
/opt/$VENDOR/mfp/share/images/Configurator.png \
$ENTRY_DIR/${VENDOR}_UD
write_entry_for_update_menus \
/opt/$VENDOR/mfp/bin/shhv \
"$PACKAGE_STRING Help" \
/opt/$VENDOR/mfp/share/images/HelpViewer.png \
$ENTRY_DIR/${VENDOR}_UD
write_entry_for_update_menus \
/opt/$VENDOR/mfp/uninstall/uninstall.sh \
"Uninstall $PACKAGE_STRING" \
/opt/$VENDOR/mfp/share/images/Uninstall.png \
$ENTRY_DIR/${VENDOR}_UD
fi
}
create_menu_entries_local() {
mkdir -p $MFP_INSTALL_DIR/share/desktop-directories
mkdir -p $MFP_INSTALL_DIR/share/applications
write_desktop_directory $MFP_INSTALL_DIR/share/desktop-directories/${VENDOR}_UD.directory
write_configurator_desktop_file $MFP_INSTALL_DIR/share/applications/${VENDOR}ConfiguratorUD.desktop
append_categories $MFP_INSTALL_DIR/share/applications/${VENDOR}ConfiguratorUD.desktop
write_helpviewer_desktop_file $MFP_INSTALL_DIR/share/applications/${VENDOR}HelpViewerUD.desktop
append_categories $MFP_INSTALL_DIR/share/applications/${VENDOR}HelpViewerUD.desktop
write_uninstall_desktop_file $MFP_INSTALL_DIR/share/applications/${VENDOR}UninstallUD.desktop
append_categories $MFP_INSTALL_DIR/share/applications/${VENDOR}UninstallUD.desktop
}
process_desktop_files() {
DESKTOP_NAMES='Desktop Desktop2 KDesktop .gnome-desktop'
for USER_HOME in `awk -F ':' '{print $6}' /etc/passwd` ; do
for DESKTOP_SUBDIR in $DESKTOP_NAMES ; do
if [ -d $USER_HOME/$DESKTOP_SUBDIR ]; then
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
write_configurator_desktop_file \
$USER_HOME/$DESKTOP_SUBDIR/${VENDOR}Configurator.desktop
write_toner_reorder_desktop_file \
$USER_HOME/$DESKTOP_SUBDIR/${VENDOR}TonerReorder.desktop
elif [ "$SCRIPT_MODE" = "UNINSTALL" ] ; then
rm -f $USER_HOME/$DESKTOP_SUBDIR/${VENDOR}Configurator.desktop
rm -f $USER_HOME/$DESKTOP_SUBDIR/${VENDOR}TonerReorder.desktop
fi
fi
done
done
}
process_desktop_menus() {
if test -n "`which update-menus 2> /dev/null`" && ! echo "$LINUX_DIST" | grep -q "MANDRIVA_2007_AND_ABOVE" ; then
handle_menu_with_update_menus
update-menus
return
fi
if echo "$LINUX_DIST" | grep -q "UBUNTU\|MANDRIVA_2007_AND_ABOVE" ; then
# Freedesktop.org Menu ( Both GNOME and KDE )
if test -f /etc/xdg/menus/applications.menu ; then
DIR_FILES_LOCATION=/usr/share/desktop-menu-files
if test -d /usr/share/desktop-directories ; then
DIR_FILES_LOCATION=/usr/share/desktop-directories
fi
handle_menu_freedesktop /usr/share/applications $DIR_FILES_LOCATION /etc/xdg/menus/applications.menu
return
fi
fi
# GNOME Menu
if test -d /usr/share/gnome/apps ; then
handle_menu /usr/share/gnome/apps
elif test -d /etc/X11/applnk ; then
handle_menu /etc/X11/applnk
fi
# KDE Menu
if test -f /etc/X11/desktop-menus/applications.menu ; then
handle_menu_redhat89 /usr/share/applications /usr/share/desktop-menu-files
elif test -d /etc/opt/kde*/share/applnk/SuSE ; then
handle_menu /etc/opt/kde*/share/applnk/SuSE
elif test -d /opt/kde*/share/applnk ; then
handle_menu /opt/kde*/share/applnk
elif test -d /usr/share/applnk ; then
if test -d /usr/share/applnk-mdk ; then
handle_menu /usr/share/applnk-mdk
if test -d /var/lib/gnome/Mandrake ; then
handle_menu /var/lib/gnome/Mandrake
fi
else
if ! test -d /etc/X11/applnk ; then
# if no entries installed in /etc/X11/applnk only
# This condition resolves duplicated menu
# entries in Fedora 3,4
handle_menu /usr/share/applnk
elif `cat /etc/issue | grep -q 'Fedora Core release [5-9]' 2> /dev/null` ; then
# ... but in Fedora 5 (and above ?) we need these entries again
handle_menu /usr/share/applnk
fi
fi
fi
}
process_psu_and_smart_panel() {
if [ "$SCRIPT_MODE" = "INSTALL" ] ; then
if [ -e ./psu/install.sh ]; then
./psu/install.sh
fi
if [ -e ./smartpanel/install.sh ]; then
./smartpanel/install.sh
fi
elif [ "$SCRIPT_MODE" = "UNINSTALL" ] ; then
if [ -e /opt/${VENDOR}/PSU/uninstall.sh ]; then
/opt/${VENDOR}/PSU/uninstall.sh
fi
if [ -e /opt/${VENDOR}/SmartPanel/uninstall.sh ]; then
/opt/${VENDOR}/SmartPanel/uninstall.sh
fi
fi
}
### Install procedures
start_usb() {
if ! test -d /proc/bus/usb ; then
echo "INFO: Starting USB ..."
# Start USB here. Does we need all this commented staff ?
# FIXME: usb printer module in kernel 2.6 name is usblp.
# FIXME: Other module names may change also ( uhci_hcd, ehci_hcd, etc. ).
# /sbin/modprobe usbcore
# /sbin/modprobe usb-uhci 2>/dev/null
# /sbin/modprobe uhci 2>/dev/null
# /sbin/modprobe usb-ohci 2>/dev/null
# mount -t usbdevfs usbdevfs /proc/bus/usb
# /sbin/modprobe printer
# /sbin/modprobe scanner
else
echo "INFO: Checking USB ... OK"
fi
}
install_kernel_modules() {
# Iinstall modules for all kernels found
for KERN_MOD_DIR in /lib/modules/* ; do
KERNEL_RELEASE=`basename $KERN_MOD_DIR`
if [ -d /lib/modules/$KERNEL_RELEASE/kernel ]; then
# Directory with kernel modules found
MOD_DIR=/lib/modules/$KERNEL_RELEASE/kernel/drivers/mfpportctrl
if [ ! -d $HARDWARE_PLATFORM/modules/$KERNEL_RELEASE ]; then
# We have NOT modules for this kernel
PVSTR=`cat /proc/version 2>/dev/null`
if echo $PVSTR | grep -q "Linux version 2.4" >/dev/null 2>/dev/null ; then
# Try to install genegic modules for kernel 2.4
if echo $PVSTR | grep -q "gcc version 3" >/dev/null 2>/dev/null ; then
KERNEL_RELEASE=generic-2.4-gcc302
else
KERNEL_RELEASE=generic-2.4-gcc296
fi
fi
fi
if [ -d $HARDWARE_PLATFORM/modules/$KERNEL_RELEASE ]; then
# We have modules for this kernel or can use generic
mkdir -p $MOD_DIR
cp -a -f $HARDWARE_PLATFORM/modules/$KERNEL_RELEASE/* $MOD_DIR/
chmod 555 $MOD_DIR/*
chown root:root $MOD_DIR/*
else
echo "WARNING: Unsupported kernel $KERNEL_RELEASE"
fi
fi
done
}
insert_kernel_modules() {
# This is unmodified code from mfp_load.sh
# Do we need it ?
# All these directories are created in libmfp mfp_get_devices()
module="mfpport"
probemodule="mfpportprobe"
probedevice="probe"
dev_dir="mfpports"
major=222
probemajor=223
rmmod $probemodule > /dev/null 2>&1
rmmod $module > /dev/null 2>&1
rm -f /dev/${dev_dir}/[0-3]
rm -f /dev/${dev_dir}/${probedevice}
if [ -d /dev/${dev_dir} ]; then
rmdir /dev/${dev_dir}
fi
#insmod -f $module $* || exit 1
#major=`awk '$2="'$module'" {print $1}' /proc/devices`
mkdir /dev/${dev_dir}
mknod /dev/${dev_dir}/0 c $major 0
mknod /dev/${dev_dir}/1 c $major 1
mknod /dev/${dev_dir}/2 c $major 2
mknod /dev/${dev_dir}/3 c $major 3
chmod 'go+r+w+x' /dev/${dev_dir}
chmod 'go+r+w' /dev/${dev_dir}/0
chmod 'go+r+w' /dev/${dev_dir}/1
chmod 'go+r+w' /dev/${dev_dir}/2
chmod 'go+r+w' /dev/${dev_dir}/3
#insmod -f $probemodule $* || exit 1
#major=`awk '$2="'$probemodule'" {print $1}' /proc/devices`
mknod /dev/${dev_dir}/${probedevice} c $probemajor 0
chmod 'go+r+w' /dev/${dev_dir}/${probedevice}
}
set_parport_pc_parameters() {
# Add options for parport_pc module if someone did not it before
if [ "$PLSFX" = "64" -a "$LINUX_DIST" = "SUSE_92" ]; then
OPT_LINE="options parport_pc io=0x378 irq=7 dma=none"
else
OPT_LINE="options parport_pc io=0x378 irq=7 dma=3"
fi
if ( uname -r | grep -q '^2\.[6-9]\|^[3-9]' ) ; then
if [ "$LINUX_DIST" = "SUSE_91" ] ; then
MOD_CONFIG_FILE=modprobe.conf.local
else
MOD_CONFIG_FILE=modprobe.conf
fi
else
MOD_CONFIG_FILE=modules.conf
fi
if ! ( cat /etc/$MOD_CONFIG_FILE | grep -q "$OPT_LINE" ) ; then
echo "$OPT_LINE" >> /etc/$MOD_CONFIG_FILE
echo "$OPT_LINE" > /etc/mfpcommon.modules.conf
fi
if test -f /etc/dynamic/scripts/lp.script ; then
shell_script_execution_disable /etc/dynamic/scripts/lp.script
fi
}
modify_depmod_call() {
# Do we need it ?
#Update configuration file
CURR_PATH=$PWD
if [ -f /etc/rc.d/rc.sysinit ]; then
cd /etc/rc.d
cat rc.sysinit | sed -e 's/depmod -A/depmod -A -q/' -e 's/depmod -A -q -q -q/depmod -A -q/' -e 's/depmod -A -q -q/depmod -A -q/' > $VENDOR_LC.rc.sysinit
if [ -f $VENDOR_LC.rc.sysinit ] ; then
mv -f rc.sysinit rc.sysinit.bak
cp -f $VENDOR_LC.rc.sysinit rc.sysinit
chmod 755 rc.sysinit
fi
cd "$CURR_PATH"
else
echo Unable to update /etc/rc.d/rc.sysinit
fi
}
restart_cups() {
if test -e /etc/init.d/cups ; then
CUPS_SCRIPT=/etc/init.d/cups
elif test -e /etc/init.d/cupsys ; then
CUPS_SCRIPT=/etc/init.d/cupsys
else
echo "INFO: can't restart CUPS - script not found"
wait_to_allow_to_see_info_line
return
fi
if $CUPS_SCRIPT restart ; then
echo "INFO: CUPS restart OK"
else
echo "INFO: CUPS restart FAILED"
fi
wait_to_allow_to_see_info_line
}
register_cups_printer() {
mkdir -p /usr/share/cups/model/${VENDOR_LC}/cms
cp -a /opt/${VENDOR}/mfp/share/ppd/cms/* /usr/share/cups/model/${VENDOR_LC}/cms/
chmod 444 /usr/share/cups/model/${VENDOR_LC}/cms/*
for MODNAME in $MODEL_LIST ; do
cat /opt/${VENDOR}/mfp/share/ppd/${MODNAME}.ppd | \
gzip -9 > /usr/share/cups/model/${VENDOR_LC}/${MODNAME}.ppd.gz
chmod 444 /usr/share/cups/model/${VENDOR_LC}/${MODNAME}.ppd.gz
done
if test -d /usr/share/ppd ; then
if test -h /usr/share/ppd/${VENDOR_LC} ; then
# Check symlink first, change it if exist
rm -f /usr/share/ppd/${VENDOR_LC}
ln -s /usr/share/cups/model/${VENDOR_LC} /usr/share/ppd/
elif test -d /usr/share/ppd/${VENDOR_LC} ; then
# Copy files into existing directory
cp -a /usr/share/cups/model/${VENDOR_LC}/*.ppd.* /usr/share/ppd/${VENDOR_LC}/
else
# Create symlink
rm -f /usr/share/ppd/${VENDOR_LC}
ln -s /usr/share/cups/model/${VENDOR_LC} /usr/share/ppd/
fi
fi
restart_cups
if test "$IN_TEXTMODE" = "1" || ! $HARDWARE_PLATFORM/install/printeradd 2> /dev/null ; then
set_firmware_device_name
if test -n "$FIRMWARE_DEVICE_NAME" ; then
DEVICE_LINE=`/usr/lib${PLSFX}/cups/backend/mfp 2>/dev/null | grep "$FIRMWARE_DEVICE_NAME" | head -n 1`
if [ "$DEVICE_LINE" != "" ] ; then
DEVICE_PORT=`echo $DEVICE_LINE | awk '{print $2}'`
else
DEVICE_PORT="mfp:/dev/mfp4"
fi
lpadmin -p $MODEL -m samsung/$MODEL.ppd.gz -v $DEVICE_PORT
lpadmin -p $MODEL -E
lpadmin -d $MODEL
lpoptions -p $MODEL -o scaling=100 -o page-left=13 -o page-top=13 -o page-right=13 -o page-bottom=13
else
echo "ERROR: " "Invalid default model" && sleep 5
fi
fi
}
register_sane_backend() {
for SCDIR in /etc/sane.d /usr/local/etc/sane.d ; do
if [ -w ${SCDIR}/dll.conf ] ; then
if ! grep -q '^smfp$' ${SCDIR}/dll.conf ; then
echo "smfp" >> ${SCDIR}/dll.conf
fi
if grep -q geniusvp2 ${SCDIR}/dll.conf ; then
# Comment out geniusvp2 backend
cat ${SCDIR}/dll.conf > /tmp/mfp_dll_conf.tmp
cat /tmp/mfp_dll_conf.tmp | sed 's/geniusvp2/#geniusvp2/' > ${SCDIR}/dll.conf
rm -f /tmp/mfp_dll_conf.tmp
fi
chmod 664 ${SCDIR}/dll.conf
fi
done
# Create dll.conf if it does not exist
DLL_CONFS=`ls /etc/sane.d/dll.conf /usr/local/etc/sane.d/dll.conf 2> /dev/null`
if test -z "$DLL_CONFS" ; then
echo "smfp" >> /etc/sane.d/dll.conf
fi
}
save_configuration_files() {
TEMP_CONFIG_DIR="/tmp/mfp_${VENDOR}_install"
mkdir -p $TEMP_CONFIG_DIR || abort_execution "Can not create directory $TEMP_CONFIG_DIR"
if test -f $MFP_INSTALL_DIR/share/OEM.ini; then
cp -a -f $MFP_INSTALL_DIR/share/OEM.ini $TEMP_CONFIG_DIR/
else
touch $TEMP_CONFIG_DIR/OEM.ini
fi
if test -f /etc/sane.d/smfp.conf; then
cp -a -f /etc/sane.d/smfp.conf $TEMP_CONFIG_DIR/
fi
}
merge_configuration_files() {
test -d "$TEMP_CONFIG_DIR" || return 0
# Merge OEM.ini
FSRC=$TEMP_CONFIG_DIR/OEM.ini
FDST=$MFP_INSTALL_DIR/share/OEM.ini
# Set SCANNER to 1 if is is 1 in SRC or DST
if cat $FDST 2> /dev/null | grep -q 'SCANNER=0' ; then
if cat $FSRC 2> /dev/null | grep -q 'SCANNER=1' ; then
cat $FDST | sed 's/SCANNER=0/SCANNER=1/' > $TEMP_CONFIG_DIR/sed_output.tmp
cat $TEMP_CONFIG_DIR/sed_output.tmp > $FDST
fi
fi
# Add model from SRC if it does not exist in DST
cat $FSRC 2> /dev/null | while read t ; do
if echo "$t" | grep -q 'MODEL' ; then
if ! cat $FDST 2> /dev/null | grep -q "$t" ; then
echo "$t" >> $FDST
fi
fi
done
cp -a -f $FDST $MFP_INSTALL_DIR/uninstall/OEM.ini
# Merge smfp.conf
FDSTS=$TEMP_CONFIG_DIR/smfp.conf
if test -f $FDSTS; then
FSRCS=noarch/at_root/etc/sane.d/smfp.conf
chmod 644 $FDSTS
${HARDWARE_PLATFORM}/install/vendormenu -sm $FDSTS $FSRCS
cp -a -f $FDSTS /etc/sane.d/smfp.conf
fi
rm -f $TEMP_CONFIG_DIR/*
rmdir $TEMP_CONFIG_DIR
}
wrap_setuid_third_party_application() {
if echo "$1" | grep -q "/" ; then
APP_NAME=$1
else
APP_NAME=`which $1 2> /dev/null`
fi
NEW_NAME=${APP_NAME}.bin
if test -n "$APP_NAME" ; then
if ! test -f "$NEW_NAME" && ! test -d "$NEW_NAME"; then
mv "$APP_NAME" "$NEW_NAME"
cp -af /opt/${VENDOR}/mfp/bin/suwrap "$APP_NAME"
chown root:root "$APP_NAME"
chmod 4755 "$APP_NAME"
fi
fi
}
wrap_setuid_ooo_application() {
WRAPPING_BIN=`ls /usr/lib*/*/program/$1.bin /opt/*/program/$1.bin 2> /dev/null | head -1`
if test -n "$WRAPPING_BIN" ; then
${2}wrap_setuid_third_party_application $WRAPPING_BIN
fi
}
symlink_sane_backend_and_mfpport_libraries() {
( cd /usr/lib$1 && \
rm -f libmfp.so libmfp.so.1 libmfpdetect.so libmfpdetect.so.1 ; \
ln -s -f libmfp.so.1.0.1 libmfp.so.1 ; true ln -s -f libmfpdetect.so.1.0.1 libmfpdetect.so.1 ; \
ln -s -f libmfp.so.1 libmfp.so ; true ln -s -f libmfpdetect.so.1 libmfpdetect.so )
( cd /usr/lib$1/sane && \
rm -f libsane-smfp.so libsane-smfp.so.1 ; \
ln -s -f libsane-smfp.so.1.0.1 libsane-smfp.so.1 ; \
ln -s -f libsane-smfp.so.1 libsane-smfp.so )
}
# Main installation procedure
do_install() {
SCRIPT_MODE=INSTALL
if [ "$THIS_PACKAGE_ALREADY_INSTALLED" = "0" ]; then
rm -rf /opt/$VENDOR/mfp
INCREMENT_MODE=0
else
save_configuration_files
INCREMENT_MODE=1
fi
mkdir -p $MFP_INSTALL_DIR || abort_execution "Can not create directory $MFP_INSTALL_DIR"
# Install common files begin {
echo "INFO: Installing common files ..."
( cd ${HARDWARE_PLATFORM}/at_opt && tar -cf - . | tar -xf - -C $MFP_INSTALL_DIR )
( cd ${HARDWARE_PLATFORM} && tar -cf - lib${PLSFX} | tar -xf - -C $MFP_INSTALL_DIR )
( cd ${HARDWARE_PLATFORM}/at_root && tar -cf - . | tar -xf - -C / )
( cd noarch/at_opt && tar -cf - . | tar -xf - -C $MFP_INSTALL_DIR )
( cd noarch/at_root && tar -cf - . | tar -xf - -C / )
# Install OEM.ini
cp -a -f OEM.ini $MFP_INSTALL_DIR/share/OEM.ini
cp -a -f OEM.ini $MFP_INSTALL_DIR/uninstall/OEM.ini
merge_configuration_files
prepare_shared_libraries
if [ "$USE_WRAPPERS" = "1" ]; then
setup_wrappers
fi
wait_to_allow_to_see_info_line
echo "INFO: Installing MFP port and SANE backend libraries ..."
symlink_sane_backend_and_mfpport_libraries ${PLSFX}
if [ "${PLSFX}" = "64" ]; then
# Install 32-bit SANE backend on 64-bit platform if possible
LIBSANE_FILES=`ls /usr/lib/libsane.so.1.*.* /usr/lib64/libsane.so.1.*.*`
LIBSANE_FILES_TOTAL=`echo $LIBSANE_FILES | wc | awk '{print $2}'`
# If two libsane.so.1.x.x files in lib and lib64 exist ...
if [ "$LIBSANE_FILES_TOTAL" = "2" ]; then
# ... and they differ
if ! diff $LIBSANE_FILES 1> /dev/null 2> /dev/null ; then
# then install 32-bit sane backend also
LIBSTDCXX_FILES=`ls /usr/lib/libstdc++.so.5* 2> /dev/null`
LIBSTDCXX_ARC="noarch/libstdc++-5-i386.tar.gz"
if test -z "$LIBSTDCXX_FILES" -a -f $LIBSTDCXX_ARC ; then
zcat $LIBSTDCXX_ARC | tar -xf - -C /
fi
( cd i386/at_root && tar -cf - usr/lib/libmfp* usr/lib/sane | tar -xf - -C / )
symlink_sane_backend_and_mfpport_libraries
fi
fi
fi
wait_to_allow_to_see_info_line
# Install common files end }
start_usb
# if this directory does not exist then usermode mfplib is used
if [ -d $HARDWARE_PLATFORM/modules ]; then
echo "INFO: Installing kernel modules ..."
install_kernel_modules
# insert_kernel_modules
fi
set_parport_pc_parameters
# modify_depmod_call
# echo "INFO: Updating module dependencies ..."
# depmod -a 2>/dev/null
# Substitute CUPS lpr with slpr begin {
echo "INFO: Installing GUI lpr ..."
# Save lpr.cups if it was not done before
if [ ! -f /usr/bin/lpr.cups.orig ]; then
if [ -f /usr/bin/lpr.cups ]; then
cp -a -f /usr/bin/lpr.cups /usr/bin/lpr.cups.orig
fi
fi
# Save lpr if it was not done before
if [ ! -f /usr/bin/lpr.orig ]; then
mv -f /usr/bin/lpr /usr/bin/lpr.orig 2> /dev/null || \
echo "ERROR: " "/usr/bin/lpr does not exist. Try reinstall CUPS" && sleep 5
# abort_execution "/usr/bin/lpr does not exist. Try reinstall CUPS"
else
rm -f /usr/bin/lpr
fi
ln -s $MFP_INSTALL_DIR/bin/slpr /usr/bin/lpr
wait_to_allow_to_see_info_line
echo "INFO: Fixing file ownership and permissions ..."
find $MFP_INSTALL_DIR -exec chown root:root \{\} \;
if [ "$USE_WRAPPERS" != "1" ]; then
chmod 4755 $MFP_INSTALL_DIR/bin/Configurator
# OpenOffice does NOT like suid root on lpr, commented out
# chmod 4755 $MFP_INSTALL_DIR/bin/slpr
# Use slprhelper instead
chmod 4755 $MFP_INSTALL_DIR/bin/slprhelper
else
chmod 4755 $MFP_INSTALL_DIR/bin/ldwrapx
fi
chown root:root /usr/lib${PLSFX}/cups/backend/mfp
chmod 4755 /usr/lib${PLSFX}/cups/backend/mfp
wait_to_allow_to_see_info_line
# Substitute CUPS lpr with slpr end }
echo "INFO: Registering SANE backend ..."
if cat ./OEM.ini 2> /dev/null | grep -q 'SCANNER=1' ; then
register_sane_backend
fi
wait_to_allow_to_see_info_line
echo "INFO: Registering CUPS printer ..."
register_cups_printer
wait_to_allow_to_see_info_line
# wrap_setuid_third_party_application xsane
# wrap_setuid_third_party_application xscanimage
# wrap_setuid_ooo_application soffice
# wrap_setuid_ooo_application swriter
# wrap_setuid_ooo_application simpress
# wrap_setuid_ooo_application scalc
create_menu_entries_local
process_desktop_files
process_desktop_menus
process_psu_and_smart_panel
# Install begin {
# Install end }
echo "INFO: Finishing installation ..."
wait_to_allow_to_see_info_line
}
### Uninstall procedures
unregister_cups_printers() {
# FIXME: check if CUPS running and run it if not
PPD_DIST=`ls /opt/${VENDOR}/mfp/share/ppd/*.ppd 2>/dev/null`
PPD_CUPS=`ls /etc/cups/ppd/*.ppd 2>/dev/null`
#d echo PPD_DIST=\"$PPD_DIST\"
#d echo PPD_CUPS=\"$PPD_CUPS\"
if test -z "$PPD_DIST" || test -z "$PPD_DIST" ; then
return
fi
PRINTERS_TO_UNINSTALL=""
for fn_cups in $PPD_CUPS ; do
MODEL_STRING_CUPS=`grep '*ModelName:' $fn_cups | awk -F\" '{print $2}'`
#d echo MODEL_STRING_CUPS=\"$MODEL_STRING_CUPS\"
for fn_dist in $PPD_DIST ; do
MODEL_STRING_DIST=`grep '*ModelName:' $fn_dist | awk -F\" '{print $2}'`
#d echo MODEL_STRING_DIST=\"$MODEL_STRING_DIST\"
if [ "$MODEL_STRING_CUPS" = "$MODEL_STRING_DIST" ]; then
PRINTERS_TO_UNINSTALL="$PRINTERS_TO_UNINSTALL `basename $fn_cups .ppd`"
fi
done
done
# echo PRINTERS_TO_UNINSTALL=\"$PRINTERS_TO_UNINSTALL\"
for printer_name in $PRINTERS_TO_UNINSTALL ; do
echo "INFO: Removing printer $printer_name ..."
lpadmin -x $printer_name 2> /dev/null || true
wait_to_allow_to_see_info_line
done
# This will remove symlink, but will not remove directory
# which may contain third-party files
rm -f /usr/share/ppd/${VENDOR_LC}
rm -rf /usr/share/cups/model/${VENDOR_LC}/cms
for MODNAME in $MODEL_LIST ; do
#obs lpadmin -x $MODNAME 2>/dev/null
rm -f /usr/share/cups/model/${VENDOR_LC}/${MODNAME}.ppd.gz
done
rmdir /usr/share/cups/model/${VENDOR_LC} 2> /dev/null || true
}
unregister_sane_backend() {
for SCDIR in /etc/sane.d /usr/local/etc/sane.d ; do
if [ -w ${SCDIR}/dll.conf ] ; then
cat ${SCDIR}/dll.conf | grep -v "smfp" | \
sed 's/geniusvp2/#geniusvp2/' > /tmp/mfp_dll_conf.tmp
cat /tmp/mfp_dll_conf.tmp > ${SCDIR}/dll.conf
rm -f /tmp/mfp_dll_conf.tmp
fi
done
}
remove_modules_from_kernel() {
# This is unmodified code from mfp_unload.sh
module="mfpport"
probemodule="mfpportprobe"
probedevice="probe"
dev_dir="mfpports"
rmmod $probemodule > /dev/null 2>&1
rmmod $module > /dev/null 2>&1
rm -f /dev/${dev_dir}/[0-3]
rm -f /dev/${dev_dir}/${probedevice}
if [ -d /dev/${dev_dir} ]; then
rmdir /dev/${dev_dir}
fi
}
restore_parport_pc_parameters() {
# Remove options of parport_pc module if we added them during install
if [ -f /etc/mfpcommon.modules.conf ] ; then
if [ "$PLSFX" = "64" -a "$LINUX_DIST" = "SUSE_92" ]; then
OPT_LINE="options parport_pc io=0x378 irq=7 dma=none"
else
OPT_LINE="options parport_pc io=0x378 irq=7 dma=3"
fi
if ( uname -r | grep -q '^2\.[6-9]\|^[3-9]' ) ; then
if [ "$LINUX_DIST" = "SUSE_91" ] ; then
MOD_CONFIG_FILE=modprobe.conf.local
else
MOD_CONFIG_FILE=modprobe.conf
fi
else
MOD_CONFIG_FILE=modules.conf
fi
if ( cat /etc/$MOD_CONFIG_FILE | grep -q "$OPT_LINE" ) ; then
cat /etc/$MOD_CONFIG_FILE | grep -v "$OPT_LINE" > /etc/mfpcommon.modules.conf
cat /etc/mfpcommon.modules.conf > /etc/$MOD_CONFIG_FILE
fi
rm -f /etc/mfpcommon.modules.conf
fi
if test -f /etc/dynamic/scripts/lp.script ; then
shell_script_execution_enable /etc/dynamic/scripts/lp.script
fi
}
uninstall_common_files() {
echo "INFO: Restoring CUPS lpr ..."
rm -f /usr/bin/lpr
if [ -f /usr/bin/lpr.cups.orig ]; then
mv -f /usr/bin/lpr.cups.orig /usr/bin/lpr.cups
fi
if [ -f /usr/bin/lpr.orig ]; then
mv -f /usr/bin/lpr.orig /usr/bin/lpr
fi
wait_to_allow_to_see_info_line
echo "INFO: Unregistering SANE backend ..."
unregister_sane_backend
wait_to_allow_to_see_info_line
echo "INFO: Uninstalling common files ..."
rm -f /usr/lib*/libmfp.so*
rm -f /usr/lib*/libmfpdetect.so*
rm -f /usr/lib*/cups/backend/mfp
rm -f /usr/lib*/cups/filter/pscms
rm -f /usr/lib*/cups/filter/rastertosamsungpcl
rm -f /usr/lib*/cups/filter/rastertosamsungspl
rm -f /usr/lib*/cups/filter/rastertosamsungsplc
rm -f /usr/lib*/sane/libsane-smfp.so*
rm -f /etc/sane.d/smfp.conf
wait_to_allow_to_see_info_line
remove_modules_from_kernel
for MOD_DIR in /lib/modules/*/kernel/drivers/mfpportctrl ; do
if [ -d $MOD_DIR ]; then
rm -f $MOD_DIR/*
rmdir $MOD_DIR 2> /dev/null || true
fi
done
restore_parport_pc_parameters
# Restore original imagetoraster CUPS filter
if [ -f /usr/lib${PLSFX}/cups/filter/imagetoraster.cups ] ; then
mv -f /usr/lib${PLSFX}/cups/filter/imagetoraster.cups /usr/lib${PLSFX}/cups/filter/imagetoraster
fi
# Remove Help configuration files
rm -f /root/.shhvrc /root/.shhvfavs /home/*/.shhvrc /home/*/.shhvfavs
}
unwrap_setuid_third_party_application() {
if echo "$1" | grep -q "/" ; then
APP_NAME=$1
else
APP_NAME=`which $1 2> /dev/null`
fi
NEW_NAME=${APP_NAME}.bin
if test -n "$APP_NAME" ; then
if test -f "$NEW_NAME" && ! test -d "$NEW_NAME"; then
rm -f "$APP_NAME"
mv "$NEW_NAME" "$APP_NAME"
fi
fi
}
# Main uninstall procedure
do_uninstall() {
SCRIPT_MODE=UNINSTALL
echo "INFO: Unregistering CUPS printer ..."
unregister_cups_printers
wait_to_allow_to_see_info_line
check_related_packages
if [ "$TOTAL_RELATED_PACKAGES_INSTALLED" = "1" ]; then
# The last from the group of related packages. Remove common files.
unwrap_setuid_third_party_application xsane
unwrap_setuid_third_party_application xscanimage
wrap_setuid_ooo_application soffice un
wrap_setuid_ooo_application swriter un
wrap_setuid_ooo_application simpress un
wrap_setuid_ooo_application scalc un
uninstall_common_files
else
# Remove slpr to check if lpr would became broken link after uninstall
rm -f /opt/$VENDOR/mfp/bin/slpr
# Check if lpr is broken link
if ! test -x /usr/bin/lpr ; then
for SLPR_FILE in `ls -tr /opt/*/mfp/bin/slpr 2> /dev/null` ; do
if test -x $SLPR_FILE ; then
rm -f /usr/bin/lpr
ln -s -f $SLPR_FILE /usr/bin/lpr
fi
done
fi
fi
process_desktop_files
process_desktop_menus
process_psu_and_smart_panel
echo "INFO: Finishing uninstall ..."
if test -d /etc/qt-smfp ; then
rm -rf /etc/qt-smfp
fi
# Remove persistent settings created by QSettings
for f in $VENDOR_LC scanconf image_editor scfgtools ; do
rm -f /home/*/.qt/${f}rc /usr/lib*/qt*/etc/settings/${f}rc /etc/X11/${f}rc
rm -f /home/*/.qt/.${f}rc.* /usr/lib*/qt*/etc/settings/.${f}rc.* /etc/X11/.${f}rc.*
done
test -n "$VENDOR" || abort_execution "VENDOR undefined"
# ( rm -rf /opt/$VENDOR/mfp 2> /dev/null && rmdir /opt/$VENDOR 2> /dev/null )
exec /bin/sh -c "rm -rf /opt/$VENDOR/mfp 2> /dev/null && rmdir /opt/$VENDOR 2> /dev/null"
wait_to_allow_to_see_info_line
}
# Text mode procedures
ask_any_key_or_q() {
read -p '**** Press any key to continue or q to quit: ' -n 1 KEY_PRESSED
echo ""
if test "$KEY_PRESSED" = "q" || test "$KEY_PRESSED" = "Q" ; then
echo "**** $RUN_MODE terminated by user"
exit 0
fi
}
run_textmode_dialog() {
test "`id -u`" = "0" || abort_execution "Root priviliges required"
test -n "$VENDOR" || abort_execution "VENDOR undefined"
MFP_INSTALL_DIR="/opt/$VENDOR/mfp"
IN_TEXTMODE=1
if [ "$RUN_MODE" = "uninstall" ]; then
echo "**** Running text mode uninstall"
ask_any_key_or_q
do_uninstall
echo "**** Text mode uninstall finished"
else
echo "**** Running text mode install"
ask_any_key_or_q
do_install
echo "**** Text mode install finished"
fi
}
print_message_qt_not_found() {
echo "**** It seems Qt library is not installed, or X display is not accessible."
echo "**** Custom Qt library will be configured for use with this package."
}
# Script execution starts here }
# test "$1" != "STAGE_GUI_INSTALLER" -a "$1" != "STAGE_GUI_UNINSTALL" && date > /tmp/install.log
cd `dirname $0`
OEM_FILE=./OEM.ini . ./set_variables.sh ./OEM.ini
MODIFIER_ID_STRING="Inserted by Unified Linux Driver"
MODEL_LIST=`cat ./OEM.ini 2> /dev/null | grep 'MODEL=' | awk -F= '{print $2}'`
# The first model in the list is default
# Default model is used if printeradd is not succeeded
MODEL=`cat ./OEM.ini 2> /dev/null | grep 'MODEL=' | head -1 | awk -F= '{print $2}'`
test -n "$HARDWARE_PLATFORM" || abort_execution "HARDWARE_PLATFORM undefined"
if [ "$HARDWARE_PLATFORM" != "i386" -a "$HARDWARE_PLATFORM" != "x86_64" ]; then
abort_execution "Unsuppored hardware platform \"$HARDWARE_PLATFORM\""
fi
#x# GLIBC_VERSION_TWO_DIGITS=`ls /lib/ld-*.so 2> /dev/null | sed s:/lib/ld-:: | cut -b 1-3`
#x# if [ "$GLIBC_VERSION_TWO_DIGITS" = "2.2" ]; then
#x# HARDWARE_PLATFORM="i386-glibc22"
#x# fi
if [ "`basename $0`" = "uninstall.sh" ]; then
RUN_MODE=uninstall
else
check_libstdcxx
check_libtiff
RUN_MODE=install
fi
PARAMS="$@"
USE_WRAPPERS=0
if echo "$PARAMS" | grep -q -- -.*u ; then
RUN_MODE=uninstall
fi
if echo "$PARAMS" | grep -q -- -.*t ; then
if test -z "ls -d /usr/lib*/*/lib/libqt-mt* /usr/lib*/libqt-mt* /opt/*/lib/libqt-mt* /usr/local/*/lib/libqt-mt* 2> /dev/null" ; then
print_message_qt_not_found
USE_WRAPPERS=1
fi
run_textmode_dialog
exit 0
fi
if [ "$1" != "STAGE_GUI_INSTALLER" -a "$1" != "STAGE_GUI_UNINSTALL" ] ; then
rm -f /tmp/${VENDOR}_UD-install-use-wrappers
if ! ./${HARDWARE_PLATFORM}/share/guiinstall.bin --check-gui ; then
print_message_qt_not_found
USE_WRAPPERS=1
# Pass use_wrappers flag to GUI stage
touch /tmp/${VENDOR}_UD-install-use-wrappers
fi
else
# Check use_wrappers flag in GUI stage
if test -f /tmp/${VENDOR}_UD-install-use-wrappers ; then
USE_WRAPPERS=1
rm -f /tmp/${VENDOR}_UD-install-use-wrappers
else
USE_WRAPPERS=0
fi
fi
if echo "$PARAMS" | grep -q -w -- -c ; then
sh check_installation.sh
exit 0
fi
# Add distribution binary dir to the PATH. shhv may be run from guiinstall or guiuninstall.
CUR_DIR=`pwd`
export PATH=${CUR_DIR}/${HARDWARE_PLATFORM}/at_opt/bin:${PATH}
if test -z "$MODEL" ; then
./autorun_gui &
exit 0
fi
if [ "$1" != "STAGE_GUI_INSTALLER" -a "$1" != "STAGE_GUI_UNINSTALL" ] ; then
if [ "$RUN_MODE" = "uninstall" ]; then
GUI_EXECUTABLE=guiuninstall
P1="-p"
P2="./models/$MODEL"
P3="-e"
P4="./uninstall.sh"
P5="-a"
P6="uninstall"
else
detect_system_packages
GUI_EXECUTABLE=guiinstall
P1="CUPS=$CUPS_DETECTED"
P2="GS=$GS_DETECTED"
P3="SANE=$SANE_DETECTED"
P4=
P5=
P6=
fi
if [ "$USE_WRAPPERS" = "1" ]; then
if test -e ./${HARDWARE_PLATFORM}/install/${GUI_EXECUTABLE} ; then
GUIEXEC=./${HARDWARE_PLATFORM}/install/${GUI_EXECUTABLE}
elif test -e ./${GUI_EXECUTABLE} ; then
GUIEXEC=./${GUI_EXECUTABLE}
else
echo "GUI mode installer not found, proceeding in text mode"
run_textmode_dialog
exit 0
fi
else
if test -e ./${HARDWARE_PLATFORM}/share/${GUI_EXECUTABLE}.bin ; then
GUIEXEC=./${HARDWARE_PLATFORM}/share/${GUI_EXECUTABLE}.bin
elif test -e ../share/${GUI_EXECUTABLE}.bin ; then
GUIEXEC=../share/${GUI_EXECUTABLE}.bin
else
echo "GUI mode installer not found, proceeding in text mode"
run_textmode_dialog
exit 0
fi
fi
if ! $GUIEXEC --check-gui ; then
echo "GUI mode installer execution failed, proceeding in text mode"
run_textmode_dialog
exit 0
fi
if [ "$USE_WRAPPERS" = "1" ]; then
# Make native qtrc accessible for custom libqt too
NATIVE_QTRC=`ls /usr/lib*/qt*/etc/settings/qtrc /etc/qtrc 2> /dev/null | head -1`
if test -n "$NATIVE_QTRC"; then
mkdir -p /etc/qt-smfp
rm -f /etc/qt-smfp/qtrc
ln -s -f $NATIVE_QTRC /etc/qt-smfp/qtrc
fi
fi
$GUIEXEC $P1 $P2 $P3 $P4 $P5 $P6
# guiinstall or guiuninstall will run this script again with
# STAGE_GUI_INSTALLER or STAGE_GUI_UNINSTALL as the first parameter.
# You may think this script continues execution from
# the line 'GUI installer stage continues here' below.
exit 0
fi
# GUI installer stage continues here
test -n "$VENDOR" || abort_execution "VENDOR undefined"
MFP_INSTALL_DIR="/opt/$VENDOR/mfp"
if [ "$1" = "STAGE_GUI_UNINSTALL" ] ; then
do_uninstall
exit 0
fi
# If not 'uninstall and exit' then do installation
do_install
exit 0
Aug 6 19:34:33 core0 shutdown[9322]: shutting down for system reboot
Aug 6 19:35:09 core0 squid[3371]: Squid Parent: child process 3373 exited with status 0
Aug 6 19:35:12 core0 kernel: Kernel logging (proc) stopped.
ebuild это конечно хорошо, но система на deb* ;(
Система падает при монтировании /dev, есть возможность переустановить любые компоненты (netinst диск есть), с чего начать ?