#!/bin/sh # set release name echo "ALT Linux 5.0 PLC" > /etc/altlinux-release # replace inittab mv -f -- /etc/inittab.plc /etc/inittab # stage1 need this mkdir -p /image # set password echo "root:\$2a\$08\$dBejTFwbEeeLLwoTjgkPU.NQ7FG/Vln4DCscIPQubM4akrxdn38wa:14792::::::" > /etc/tcb/root/shadow useradd admin -g adm -G wheel,disk echo "admin:\$2a\$08\$qGjau56.16CvipkuVhNe/.IXfMnLZWRLFYPpxGRLQmdlnndAH9Dom:14792::::::" > /etc/tcb/admin/shadow # set /etc/fstab echo "proc /proc proc nosuid,noexec,gid=proc 0 0" > /etc/fstab echo "devpts /dev/pts devpts nosuid,noexec,gid=tty,mode=620 0 0" >> /etc/fstab echo "shmfs /dev/shm tmpfs nosuid 0 0" >> /etc/fstab echo "tmpfs /tmp tmpfs nosuid 0 0" >> /etc/fstab # set locale echo "LANG=uk_UA.UTF-8" > /etc/sysconfig/i18n echo "SUPPORTED=uk_UA:ru_RU:en_US" >> /etc/sysconfig/i18n # set default network if_name=eth0 if [ ! -e /etc/net/ifaces/${if_name} ]; then mkdir /etc/net/ifaces/${if_name}; fi echo "BOOTPROTO=dhcp-static" > /etc/net/ifaces/${if_name}/options echo "192.168.0.1" >> /etc/net/ifaces/${if_name}/ipv4address echo "127.0.0.1 localhost" > /etc/hosts echo > /etc/resolv.conf # set clock echo > /etc/adjtime echo "UTC=\"true\"" > /etc/sysconfig/clock echo "ZONE=\"Europe/Kiev\"" >> /etc/sysconfig/clock rm -f /etc/localtime cp /usr/share/zoneinfo/Europe/Kiev /etc/localtime rm -rf /usr/share/zoneinfo # init services chkconfig oscadad on #remove all docs, license and icons rm -rf /usr/share/{doc,man,info} #rm -rf /usr/share/{license,gfxboot,icons} # remove rpm db rm -rf /var/lib/rpm/* # remove apt data files rm -rf /var/cache/apt /var/lib*/apt # remove unneeded translations for i in /usr/share/locale/*; do if [ ${i##*/} != "en" ] && [ ${i##*/} != "ru" ] && [ ${i##*/} != "uk" ]; then rm -rf ${i}; fi; done # remove unneeded locales for i in `find /usr/lib/locale -mindepth 1 -maxdepth 1 -type d \! -name 'en_US*' -a \! -name 'ru_RU*' -a \! -name 'uk_UA*'`; do rm -rf ${i}; done # run depmod for i in /lib*/modules/*; do #remove modules k_mod=/lib/modules/${i##*/} k_dir=${k_mod}/kernel c_dir=${k_mod}/choosing if [ ! -e ${c_dir} ]; then mkdir ${c_dir} -m 0755; fi if [ -e ${k_dir} ]; then # Copy need drivers for kf in af_packet dm-mod hid-gaff hid-pl hid-cypress hid-zpff hid-gyration hid-sony hid-ntrig hid-samsung hid-microsoft hid-tmff hid-monterey \ hid-ezkey hid-apple hid-a4tech hid-logitech ff-memless hid-cherry hid-sunplus hid-petalynx hid-belkin hid-chicony usbhid evdev ohci-hcd \ serio_raw ehci-hcd usbcore sg cs5535_gpio via-rhine geode-rng mii rng-core rtc-cmos rtc-core rtc-lib ac button it87 hwmon-vid hwmon \ slot ipic ext3 jbd mbcache ata_generic pata_acpi pata_cs5536 pata_amd libata sd_mod crc-t10dif scsi_mod softdog; do fr=`find ${k_dir} -name ${kf}.ko` if [ $fr ]; then cp ${fr} ${c_dir}; fi; done # Remove left drivers rm -rf ${k_dir} fi /sbin/depmod -a -F /boot/System.map-${i##*/} ${i##*/} done # remove image's boot directory rm -rf /boot # remove ogfs rm -f /lib*/evms/*/ogfs* # udev needed this ln -sf /proc/mounts /etc/mtab # enable portmap chkconfig portmap on sed -i 's,#\(PORTMAP_ARGS="-l".*\),\1,' /etc/sysconfig/portmap