Makefile000064400000000000000000000022711077717167500125400ustar00rootroot00000000000000# # $Id: Makefile,v 1.5 2005/05/04 13:27:25 rider Exp $ # # Makefile for the separator project. TOPDIR = $(CURDIR) PACKAGE = spt DATADIR = /usr/share/$(PACKAGE) BINDIR = /usr/bin/ VERSION = $(shell cat data/VERSION) SOURCEDIR = $(TOPDIR)/SOURCES DATAFILES = data all: rpm tar: $(SOURCEDIR)/$(PACKAGE)-$(VERSION).tar.bz2 $(SOURCEDIR)/$(PACKAGE)-$(VERSION).tar.bz2: mkdir -p $(SOURCEDIR) rm -f $(SOURCEDIR)/$(PACKAGE)-$(VERSION).tar.bz2 rm -Rf ~/tmp/$(PACKAGE)-$(VERSION) mkdir ~/tmp/$(PACKAGE)-$(VERSION) cp -a . ~/tmp/$(PACKAGE)-$(VERSION)/ find ~/tmp/$(PACKAGE)-$(VERSION)/ -type d -name "CVS"|xargs rm -Rf pushd ~/tmp/$(PACKAGE)-$(VERSION)/;make clean;rm -Rf SPECS;popd pushd ~/tmp/;tar cvfj $(SOURCEDIR)/$(PACKAGE)-$(VERSION).tar.bz2 $(PACKAGE)-$(VERSION)/;popd clean: rm -Rf *.tar.bz *~ tmp SOURCES TMP BUILD SRPMS RPMS install: mkdir -p $(DESTDIR){$(DATADIR),$(BINDIR)} cp -a $(DATAFILES)/* $(DESTDIR)$(DATADIR)/ install -m755 scripts/* $(DESTDIR)$(BINDIR)/ rpm: SRPMS/$(PACKAGE)-$(VERSION)*src.rpm SRPMS/$(PACKAGE)-$(VERSION)*src.rpm: $(SOURCEDIR)/$(PACKAGE)-$(VERSION).tar.bz2 rpmbuild -ba --define "_topdir $(TOPDIR)" --define "_tmpdir $(TOPDIR)/tmp" SPECS/$(PACKAGE).spec data/000075500000000000000000000000001077717167500120075ustar00rootroot00000000000000data/VERSION000064400000000000000000000000041077717167500130510ustar00rootroot000000000000000.5 data/hooks-common/000075500000000000000000000000001077717167500144205ustar00rootroot00000000000000data/hooks-common/00resolv000075500000000000000000000001251077717167500160160ustar00rootroot00000000000000#!/bin/sh /bin/echo "127.0.0.1 localhost" > /etc/hosts /bin/echo > /etc/resolv.conf data/hooks-common/02root000075500000000000000000000001111077717167500154640ustar00rootroot00000000000000#!/bin/sh /usr/sbin/usermod -p "" root chown -R root.auth /etc/tcb/root data/hooks-common/03gfxboot000075500000000000000000000003761077717167500161670ustar00rootroot00000000000000#!/bin/sh [ -f "/usr/share/gfxboot/$THEME/bootlogo" ] || exit 0 mkdir -p /.isolinux cd /.isolinux cp -a "/usr/share/gfxboot/$THEME/bootlogo" bootlogo.cpio cpio -Vuid < bootlogo.cpio rm -f bootlogo.cpio printf "init\nlanguages\n" |cpio -Vo > ./bootlogo data/hooks-common/04memtest000075500000000000000000000002251077717167500161670ustar00rootroot00000000000000#!/bin/sh mkdir -p /.isolinux MEMTEST="$(find /boot/ -name 'memtest*' -print -quit)" [ -z "$MEMTEST" ] || install -D "$MEMTEST" /.isolinux/memtest data/hooks-common/05bootsplash000075500000000000000000000005031077717167500166670ustar00rootroot00000000000000#!/bin/sh RESOLUTION_DEFAULT="800x600" if [ -d "/etc/bootsplash/themes/current/config" -a -x "/sbin/splash" ]; then mkdir -p /.splash themefile="/etc/bootsplash/themes/current/config/bootsplash-$RESOLUTION_DEFAULT.cfg" if [ -f "$themefile" ]; then /sbin/splash -f -s "$themefile" > /.splash/bootsplash fi fi data/profile-default/000075500000000000000000000000001077717167500150715ustar00rootroot00000000000000data/profile-default/config000064400000000000000000000004151077717167500162610ustar00rootroot00000000000000PUBLISHER="Your Name" ORIGIN="ALT Linux based" SUITE="UserLiveCD" CODENAME="please, edit config file" VERSION="3.1.xxx" THEME=Compact KERNEL_ADD="kernel-image-std-smp kernel-modules-sk98lin-std-smp" LANGS="ru_RU:be_BY:uk_UA:tt_RU" COMPONENTS=live CDFILENAME="live.iso" data/profile-default/initfs000064400000000000000000000024671077717167500163210ustar00rootroot00000000000000dir /dev 0755 0 0 nod /dev/mem 0600 0 0 c 1 1 nod /dev/null 0666 0 0 c 1 3 nod /dev/ptyp0 0600 0 0 c 2 0 nod /dev/ttyp0 0600 0 0 c 3 0 nod /dev/tty0 0600 0 0 c 4 0 nod /dev/tty1 0600 0 0 c 4 1 nod /dev/tty2 0600 0 0 c 4 2 nod /dev/tty3 0600 0 0 c 4 3 nod /dev/tty4 0600 0 0 c 4 4 nod /dev/tty5 0600 0 0 c 4 5 nod /dev/tty6 0600 0 0 c 4 6 nod /dev/tty7 0600 0 0 c 4 7 nod /dev/ttyS0 0600 0 0 c 4 64 nod /dev/tty 0600 0 0 c 5 0 nod /dev/console 0600 0 0 c 5 1 nod /dev/ram3 0640 0 0 b 1 3 nod /dev/fd0 0640 0 0 b 2 0 nod /dev/fd1 0640 0 0 b 2 1 nod /dev/loop0 0640 0 0 b 7 0 nod /dev/loop1 0640 0 0 b 7 1 nod /dev/loop2 0640 0 0 b 7 2 nod /dev/loop3 0640 0 0 b 7 3 nod /dev/cloop 0640 0 0 b 240 0 dir /image 0755 0 0 dir /modules 0755 0 0 dir /sbin 0755 0 0 dir /bin 0755 0 0 dir /etc/terminfo 0755 0 0 dir /etc/terminfo/l 0755 0 0 dir /etc 0755 0 0 dir /proc 0755 0 0 dir /sys 0755 0 0 dir /root 0755 0 0 dir /tmp 0755 0 0 dir /var 0755 0 0 file /sys/.t /dev/null 0644 0 0 file /init @LIBDIR@/propagator/bin/init 0755 0 0 file /sbin/stage1 @LIBDIR@/propagator/bin/stage1 0755 0 0 file /modules/modules.mar @MODDIR@/modules.mar 0644 0 0 file /modules/modules.map @MODDIR@/modules.map 0644 0 0 file /modules/modules.dep @MODDIR@/modules.dep 0644 0 0 file /.VERSION @DOTVERSION@ 0644 0 0 slink /sbin/modprobe stage1 0755 0 0 data/profile-default/isolinux.cfg.in000064400000000000000000000003551077717167500200340ustar00rootroot00000000000000default live prompt 1 timeout 0 display boot.msg implicit 0 label live kernel alt0/vmlinuz append initrd=alt0/full.cz live fastboot automatic=method:cdrom stagename=altlinux label memtest kernel memtest label disk LOCALBOOT -1 data/profile-default/live/000075500000000000000000000000001077717167500160305ustar00rootroot00000000000000data/profile-default/live/config000064400000000000000000000000301077717167500172110ustar00rootroot00000000000000OUT=altlinux IDENT=live data/profile-default/live/hooks.d/000075500000000000000000000000001077717167500173755ustar00rootroot00000000000000data/profile-default/live/hooks.d/00resolv000077700000000000000000000000001077717167500275752/usr/share/spt/hooks-common/00resolvustar00rootroot00000000000000data/profile-default/live/hooks.d/01_locales000075500000000000000000000002211077717167500212400ustar00rootroot00000000000000#!/bin/sh #setup supported variable if [ -n "$LANGS" ];then mkdir -p /etc/sysconfig echo "SUPPORTED=$LANGS" >/etc/sysconfig/i18n fi data/profile-default/live/hooks.d/01console000075500000000000000000000014251077717167500211300ustar00rootroot00000000000000#!/bin/sh LIBDIR="$(getconf LIBDIR)" cat <> /etc/sysconfig/i18n SYSFONT=UniCyr_8x16 LC_CTYPE=ru_RU.CP1251 LC_MONETARY=ru_RU.CP1251 LANGUAGE=ru_RU.CP1251 LC_TIME=ru_RU.CP1251 LC_NUMERIC=ru_RU.CP1251 LC_COLLATE=ru_RU.CP1251 LC_MESSAGES=ru_RU.CP1251 LANG=ru_RU.CP1251 SYSFONTACM=cp1251 E_O_F cat <> /etc/sysconfig/keyboard KBCHARSET=cp1251 DISABLE_WINDOWS_KEY=yes BACKSPACE=Delete KEYTABLE=ru_ct_sh-CP1251 E_O_F mkdir -p /etc/sysconfig/console/{consolefonts,consoletrans} ln -s $LIBDIR/kbd/consolefonts/UniCyr_8x16.psf.gz /etc/sysconfig/console/consolefonts/UniCyr_8x16.psf.gz ln -s $LIBDIR/kbd/consoletrans/cp1251.acm.gz /etc/sysconfig/console/consoletrans/cp1251.acm.gz gzip -dc $LIBDIR/kbd/keymaps/i386/qwerty/ru_ct_sh-CP1251.kmap.gz > /etc/sysconfig/console/default.kmap data/profile-default/live/hooks.d/01system000075500000000000000000000043321077717167500210120ustar00rootroot00000000000000#!/bin/sh setup_live() { echo "Setting up live cd" /bin/sh -e <<__EOF__ cd / unset DURING_INSTALL [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus --nofork -v [ ! -f /etc/firsttime.d/menu ] || rm -f /etc/firsttime.d/menu if [ -d /etc/firsttime.d ];then for i in /etc/firsttime.d/*; do \$i; done ||: fi if [ -x /sbin/depmod ]; then for i in /lib/modules/*; do /sbin/depmod -a -F /boot/System.map-\$(basename \$i) \$(basename \$i) done fi __EOF__ cat << __EOF__ >> /etc/remounttab /mnt /media size=50k __EOF__ cat << __EOF__ >> /etc/overlaytab /etc /dev /var /lib /bin /sbin /home /root __EOF__ cat << __EOF__ >> /etc/sysconfig/network NETWORKING=yes FORWARD_IPV4=false HOSTNAME=$SUITE DOMAINNAME=localhost __EOF__ cat << __EOF__ >> /etc/HOSTNAME $SUITE.localhost __EOF__ cat <<__EOF__>> /etc/init.d/remount_rw # Remount root fs parts via tmpfs #!/bin/bash REMOUNTTAB=/etc/remounttab LIVETAB=/etc/overlaytab if [ -s \$REMOUNTTAB ]; then grep -ve '^\(#\|\$\)' \$REMOUNTTAB |while read mntpt dev opt; do if [ -d \$mntpt ]; then [ -n "\$dev" ] || dev=/dev/shm echo -n "Remounting \$mntpt read/write:" (cd \$mntpt && tar cp --same-owner --same-permissions . 2> /dev/null) |\ (mount -n -ttmpfs \${opt:+-o \$opt} \$dev \$mntpt && tar xp -C \$mntpt/ 2>/dev/null) && echo_success || echo_failure echo fi done if [ -s \$LIVETAB ]; then grep -ve '^\(#\|\$\)' \$LIVETAB |while read mntpt dev fs opt; do if [ -d \$mntpt ]; then mkdir -p /mnt/root/\$mntpt [ ! -f "\$dev" ] || mount -n \${fs:+-t \$fs} \${opt:+-o \$opt} \$dev /mnt/root/\$mntpt echo -n "Remounting \$mntpt to overlay:" mount -n -tunionfs -o dirs=/mnt/root/\$mntpt=rw:\$mntpt=ro /mnt/root/\$mntpt \$mntpt && echo_success || echo_failure echo fi done fi else action "Remounting root filesystem in read/write mode:" mount -n -o remount,rw / fi __EOF__ chmod +x /etc/init.d/remount_rw echo "REMOUNT_ROOTFS_RW_COMMAND=/etc/init.d/remount_rw" >> /etc/sysconfig/init } setup_live echo "/dev/root / auto defaults,ro 0 0" >>/etc/fstab echo "tmpfs /tmp tmpfs defaults 0 0" >>/etc/fstab # stage1 need this mkdir -p /image data/profile-default/live/hooks.d/02root000077700000000000000000000000001077717167500267232/usr/share/spt/hooks-common/02rootustar00rootroot00000000000000data/profile-default/live/hooks.d/02users000075500000000000000000000001751077717167500206310ustar00rootroot00000000000000#!/bin/sh /usr/sbin/useradd -p "" altlinux -G audio,radio,proc,cdrom,cdwriter,wheel chown -R altlinux.auth /etc/tcb/altlinux data/profile-default/live/hooks.d/02xkb000075500000000000000000000003651077717167500202550ustar00rootroot00000000000000#!/bin/sh cat << EOF > /home/altlinux/.xsession.d/xkb /usr/bin/update-menus setxkbmap -layout 'us,ru' setxkbmap -model pc105 setxkbmap -variant ',winkeys' setxkbmap -option grp:ctrl_shift_toggle EOF chmod +x $ROOT/home/altlinux/.xsession.d/xkb data/profile-default/live/hooks.d/03services000075500000000000000000000002121077717167500213040ustar00rootroot00000000000000#!/bin/sh #/sbin/chkconfig network on ||: #/sbin/chkconfig syslogd on ||: /sbin/chkconfig random on ||: /sbin/chkconfig rawdevices on ||: data/profile-default/live/hooks.d/04autologin000075500000000000000000000003511077717167500214670ustar00rootroot00000000000000#!/bin/sh #setup runlevel [ -z "$runlevel" ] && runlevel=5 subst "s,^\(id:\)\(.*\)\(:initdefault.*\),\\1$runlevel\\3," /etc/inittab #setup autologin cat <> /etc/sysconfig/autologin USER=altlinux AUTOLOGIN=yes E_O_F data/profile-default/live/packages000064400000000000000000000050331077717167500175320ustar00rootroot00000000000000# kernel and hardware kernel-image-std-smp kernel-modules-drm-std-smp kernel-modules-unionfs-std-smp kernel-modules-alsa-std-smp kernel-modules-oss-std-smp kernel-modules-nvidia-std-smp kernel-modules-fglrx-std-smp kernel-modules-sk98lin-std-smp #kernel-modules-matroxdriver-std-smp nvidia_glx_common nvidia_glx_1.0.9746 nvclock-qt nvclock nvidia-settings nvidia-xconfig fglrx_glx fglrx-tools driconf #matroxdriver_glx libhw-tools udev dbus hal pciutils xorg-x11-server xorg-x11-drv-amd xorg-x11-drv-apm xorg-x11-drv-ark xorg-x11-drv-ati xorg-x11-drv-chips xorg-x11-drv-cirrus xorg-x11-drv-cyrix xorg-x11-drv-evdev xorg-x11-drv-fbdev xorg-x11-drv-glint xorg-x11-drv-i740 xorg-x11-drv-intel xorg-x11-drv-joystick xorg-x11-drv-mga xorg-x11-drv-multimedia xorg-x11-drv-neomagic xorg-x11-drv-nv xorg-x11-drv-openchrome xorg-x11-drv-rendition xorg-x11-drv-s3 xorg-x11-drv-s3virge xorg-x11-drv-savage xorg-x11-drv-siliconmotion xorg-x11-drv-sis xorg-x11-drv-synaptics xorg-x11-drv-tdfx xorg-x11-drv-tga xorg-x11-drv-trident xorg-x11-drv-tseng xorg-x11-drv-vesa xorg-x11-drv-vmware xorg-x11-drv-void xorg-x11-drv-voodoo xorg-x11-dri-* xorg-x11-xdm xorg-x11-xfs xorg-x11-xauth xorg-x11-utils xorg-x11-apps xorg-x11-extensions* XFree86-cyr_rfx-fonts* xinit pmount lm_sensors wm-select etcnet hardware # base packagers interactivesystem su unionfs-utils design-bootloader-Compact strace binutils mc syslogd glibc-utils glibc-gconv-modules glibc-nss shadow-utils slocate #filesystems section evms-ncurses evms-cli evms-gui evms dosfstools reiser4progs reiserfsprogs squashfsprogs ntfsprogs xfsprogs jfsprogs e2fsprogs cfdisk testdisk # sound alsa-utils aumix # block devices section hdparm smartmontools # network configuration dhcpcd iftop zcip xinetd portmap # other xorg-x11-xdm vim-console fluxbox #wmpager #wmhdplop #firefox #firefox-ru #firefox-adblock_plus #tor #privoxy #mozilla #mozilla-plugin-djvu #mozilla-plugin-mozplugger #xpdf* openssh-clients #qca-tls #psi rsync dmtr40in-fonts #rpm-build #gcc-c++ #distcc #nexuiz-client-common #nexuiz-client-sdl #nexuiz-data ppracer #transcode #dvd+rw-tools #dvdrecord #MPlayer openssh-server # dtd #tetex #tetex-afm #tetex-bibtex8 #tetex-context #tetex-doc #tetex-dvilj #tetex-dvips #tetex-latex #tetex-xdvi #tetex-bibtex8-gost #tetex-latex-babelbib #tetex-latex-beamer #tetex-latex-bibtopic #tetex-latex-feynmf #tetex-latex-listings #tetex-latex-pgf #tetex-latex-preview #tetex-latex-rcs #tetex-latex-tipa #tetex-latex-tipa-doc #tetex-latex-xcolor #tetex-latex-xymtex #tetex-latex-xymtex-doc #cm-super-fonts-* fonts-ttf-ms #lyx #TeXmacs data/profile-default/modules000064400000000000000000000035661077717167500164760ustar00rootroot00000000000000nls_koi8-r.ko nls_cp866.ko fat.ko 3c501.ko 3c503.ko 3c505.ko 3c507.ko 3c509.ko 3c515.ko 3c574_cs.ko 3c589_cs.ko 3c59x.ko 8139too.ko 82596.ko 8390.ko a100u2w.ko aacraid.ko acenic.ko aec62xx.ko af_packet.ko aha152x_cs.ko aha152x.ko aha1542.ko aic7xxx.ko alim15x3.ko amd74xx.ko amd8111e.ko ata_piix.ko atiixp.ko atl1.ko atp870u.ko axnet_cs.ko BusLogic.ko catc.ko cciss.ko cdrom.ko squashfs.ko cmd64x.ko cpqarray.ko cs5520.ko cs5530.ko cs89x0.ko cy82c693.ko DAC960.ko de4x5.ko de600.ko de620.ko depca.ko dgrs.ko dmfe.ko dpt_i2o.ko dtc.ko e1000.ko e100.ko e2100.ko eepro100.ko eepro.ko eexpress.ko ehci-hcd.ko epic100.ko eth16i.ko ewrk3.ko ext2 fdomain_cs.ko fdomain.ko fealnx.ko fmvj18x_cs.ko forcedeth.ko gdth.ko generic.ko g_NCR5380.ko jmicron.ko hamachi.ko hp100.ko hp.ko hp-plus.ko hpt34x.ko hpt366.ko ibmtr_cs.ko ide-cd.ko ide-core.ko ide-cs.ko ide-disk.ko ide-generic.ko in2000.ko ips.ko isofs.ko it821x.ko kaweth.ko lance.ko lockd.ko loop.ko megaraid_mbox.ko mii.ko natsemi.ko NCR53c406a.ko ne2k-pci.ko ne.ko netwave_cs.ko nfs.ko nmclan_cs.ko ns87415.ko ohci-hcd.ko opti621.ko pata_marvell.ko pcnet32.ko pcnet_cs.ko pdc202xx_new.ko pdc202xx_old.ko pegasus.ko piix.ko ppp_async.ko ppp_generic.ko psi240i.ko qla1280.ko qlogic_cs.ko qlogicfas.ko qlogicfc.ko qlogicisp.ko r8169.ko rz1000.ko sata_nv.ko sata_promise.ko sata_sil.ko sata_sis.ko sata_svw.ko sata_sx4.ko sata_uli.ko sata_via.ko sata_vsc.ko sb1000.ko sc1200.ko scsi_mod.ko sd_mod.ko serial_cs.ko serverworks.ko siimage.ko sis5513.ko sis900.ko sk98lin.ko slc90e66.ko slhc.ko smc9194.ko smc91c92_cs.ko smc-ultra.ko sr_mod.ko starfire.ko sundance.ko sunrpc.ko sym53c416.ko sym53c8xx.ko t128.ko tlan.ko tmscsim.ko triflex.ko trm290.ko tulip.ko uhci-hcd.ko ultrastor.ko usbcore.ko usbnet.ko usb-storage.ko usbhid.ko via82cxxx.ko via-rhine.ko wavelan_cs.ko wd7000.ko wd.ko winbond-840.ko xirc2ps_cs.ko xircom_cb.ko yellowfin.ko vfat.ko reiserfs.ko ext3.ko data/profile-default/syslinux.cfg.in000064400000000000000000000003541077717167500200570ustar00rootroot00000000000000default live prompt 1 timeout 0 display boot.msg implicit 0 label live kernel alt0/vmlinuz append initrd=alt0/full.cz live fastboot automatic=method:disk stagename=altlinux label memtest kernel memtest label disk LOCALBOOT -1 data/profile-rescue/000075500000000000000000000000001077717167500147335ustar00rootroot00000000000000data/profile-rescue/config000064400000000000000000000004021077717167500161170ustar00rootroot00000000000000PUBLISHER="L.A. Kostis" ORIGIN="ALT Linux based" SUITE="RescueLiveCD" CODENAME="Aconite" VERSION="3.1.xxx" THEME=Compact KERNEL_ADD="kernel-image-std-smp kernel-modules-sk98lin-std-smp" LANGS="ru_RU:be_BY:uk_UA:tt_RU" COMPONENTS=live CDFILENAME="rescue.iso" data/profile-rescue/initfs000064400000000000000000000024671077717167500161630ustar00rootroot00000000000000dir /dev 0755 0 0 nod /dev/mem 0600 0 0 c 1 1 nod /dev/null 0666 0 0 c 1 3 nod /dev/ptyp0 0600 0 0 c 2 0 nod /dev/ttyp0 0600 0 0 c 3 0 nod /dev/tty0 0600 0 0 c 4 0 nod /dev/tty1 0600 0 0 c 4 1 nod /dev/tty2 0600 0 0 c 4 2 nod /dev/tty3 0600 0 0 c 4 3 nod /dev/tty4 0600 0 0 c 4 4 nod /dev/tty5 0600 0 0 c 4 5 nod /dev/tty6 0600 0 0 c 4 6 nod /dev/tty7 0600 0 0 c 4 7 nod /dev/ttyS0 0600 0 0 c 4 64 nod /dev/tty 0600 0 0 c 5 0 nod /dev/console 0600 0 0 c 5 1 nod /dev/ram3 0640 0 0 b 1 3 nod /dev/fd0 0640 0 0 b 2 0 nod /dev/fd1 0640 0 0 b 2 1 nod /dev/loop0 0640 0 0 b 7 0 nod /dev/loop1 0640 0 0 b 7 1 nod /dev/loop2 0640 0 0 b 7 2 nod /dev/loop3 0640 0 0 b 7 3 nod /dev/cloop 0640 0 0 b 240 0 dir /image 0755 0 0 dir /modules 0755 0 0 dir /sbin 0755 0 0 dir /bin 0755 0 0 dir /etc/terminfo 0755 0 0 dir /etc/terminfo/l 0755 0 0 dir /etc 0755 0 0 dir /proc 0755 0 0 dir /sys 0755 0 0 dir /root 0755 0 0 dir /tmp 0755 0 0 dir /var 0755 0 0 file /sys/.t /dev/null 0644 0 0 file /init @LIBDIR@/propagator/bin/init 0755 0 0 file /sbin/stage1 @LIBDIR@/propagator/bin/stage1 0755 0 0 file /modules/modules.mar @MODDIR@/modules.mar 0644 0 0 file /modules/modules.map @MODDIR@/modules.map 0644 0 0 file /modules/modules.dep @MODDIR@/modules.dep 0644 0 0 file /.VERSION @DOTVERSION@ 0644 0 0 slink /sbin/modprobe stage1 0755 0 0 data/profile-rescue/isolinux.cfg.in000064400000000000000000000003551077717167500176760ustar00rootroot00000000000000default live prompt 1 timeout 0 display boot.msg implicit 0 label live kernel alt0/vmlinuz append initrd=alt0/full.cz live fastboot automatic=method:cdrom stagename=altlinux label memtest kernel memtest label disk LOCALBOOT -1 data/profile-rescue/live/000075500000000000000000000000001077717167500156725ustar00rootroot00000000000000data/profile-rescue/live/config000064400000000000000000000000301077717167500170530ustar00rootroot00000000000000OUT=altlinux IDENT=live data/profile-rescue/live/hooks.d/000075500000000000000000000000001077717167500172375ustar00rootroot00000000000000data/profile-rescue/live/hooks.d/00resolv000077700000000000000000000000001077717167500274372/usr/share/spt/hooks-common/00resolvustar00rootroot00000000000000data/profile-rescue/live/hooks.d/01console000077700000000000000000000000001077717167500326762/usr/share/spt/profile-default/live/hooks.d/01consoleustar00rootroot00000000000000data/profile-rescue/live/hooks.d/01system000077700000000000000000000000001077717167500324422/usr/share/spt/profile-default/live/hooks.d/01systemustar00rootroot00000000000000data/profile-rescue/live/hooks.d/02root000077700000000000000000000000001077717167500265652/usr/share/spt/hooks-common/02rootustar00rootroot00000000000000data/profile-rescue/live/hooks.d/02users000075500000000000000000000001751077717167500204730ustar00rootroot00000000000000#!/bin/sh /usr/sbin/useradd -p "" altlinux -G audio,radio,proc,cdrom,cdwriter,wheel chown -R altlinux.auth /etc/tcb/altlinux data/profile-rescue/live/hooks.d/03services000075500000000000000000000003101077717167500211450ustar00rootroot00000000000000#!/bin/sh #/sbin/chkconfig network on ||: #/sbin/chkconfig syslogd on ||: /sbin/chkconfig mdadm off ||: /sbin/chkconfig hotplug off ||: /sbin/chkconfig random on ||: /sbin/chkconfig rawdevices on ||: data/profile-rescue/live/packages000064400000000000000000000006301077717167500173720ustar00rootroot00000000000000basesystem kernel-image-std-smp kernel-modules-sk98lin-std-smp interactivesystem unionfs-utils strace mc etcnet glibc-nss shadow-utils udev hotplug pciutils libhw-tools #filesystems section evms-ncurses evms-cli evms dosfstools reiser4progs reiserfsprogs xfsprogs jfsprogs e2fsprogs cfdisk parted # network configuration dhcpcd zcip portmap mdadm #network tools nfs-clients openssh-clients apt lftp rsync data/profile-rescue/modules000064400000000000000000000035661077717167500163400ustar00rootroot00000000000000nls_koi8-r.ko nls_cp866.ko fat.ko 3c501.ko 3c503.ko 3c505.ko 3c507.ko 3c509.ko 3c515.ko 3c574_cs.ko 3c589_cs.ko 3c59x.ko 8139too.ko 82596.ko 8390.ko a100u2w.ko aacraid.ko acenic.ko aec62xx.ko af_packet.ko aha152x_cs.ko aha152x.ko aha1542.ko aic7xxx.ko alim15x3.ko amd74xx.ko amd8111e.ko ata_piix.ko atiixp.ko atl1.ko atp870u.ko axnet_cs.ko BusLogic.ko catc.ko cciss.ko cdrom.ko squashfs.ko cmd64x.ko cpqarray.ko cs5520.ko cs5530.ko cs89x0.ko cy82c693.ko DAC960.ko de4x5.ko de600.ko de620.ko depca.ko dgrs.ko dmfe.ko dpt_i2o.ko dtc.ko e1000.ko e100.ko e2100.ko eepro100.ko eepro.ko eexpress.ko ehci-hcd.ko epic100.ko eth16i.ko ewrk3.ko ext2 fdomain_cs.ko fdomain.ko fealnx.ko fmvj18x_cs.ko forcedeth.ko gdth.ko generic.ko g_NCR5380.ko jmicron.ko hamachi.ko hp100.ko hp.ko hp-plus.ko hpt34x.ko hpt366.ko ibmtr_cs.ko ide-cd.ko ide-core.ko ide-cs.ko ide-disk.ko ide-generic.ko in2000.ko ips.ko isofs.ko it821x.ko kaweth.ko lance.ko lockd.ko loop.ko megaraid_mbox.ko mii.ko natsemi.ko NCR53c406a.ko ne2k-pci.ko ne.ko netwave_cs.ko nfs.ko nmclan_cs.ko ns87415.ko ohci-hcd.ko opti621.ko pata_marvell.ko pcnet32.ko pcnet_cs.ko pdc202xx_new.ko pdc202xx_old.ko pegasus.ko piix.ko ppp_async.ko ppp_generic.ko psi240i.ko qla1280.ko qlogic_cs.ko qlogicfas.ko qlogicfc.ko qlogicisp.ko r8169.ko rz1000.ko sata_nv.ko sata_promise.ko sata_sil.ko sata_sis.ko sata_svw.ko sata_sx4.ko sata_uli.ko sata_via.ko sata_vsc.ko sb1000.ko sc1200.ko scsi_mod.ko sd_mod.ko serial_cs.ko serverworks.ko siimage.ko sis5513.ko sis900.ko sk98lin.ko slc90e66.ko slhc.ko smc9194.ko smc91c92_cs.ko smc-ultra.ko sr_mod.ko starfire.ko sundance.ko sunrpc.ko sym53c416.ko sym53c8xx.ko t128.ko tlan.ko tmscsim.ko triflex.ko trm290.ko tulip.ko uhci-hcd.ko ultrastor.ko usbcore.ko usbnet.ko usb-storage.ko usbhid.ko via82cxxx.ko via-rhine.ko wavelan_cs.ko wd7000.ko wd.ko winbond-840.ko xirc2ps_cs.ko xircom_cb.ko yellowfin.ko vfat.ko reiserfs.ko ext3.ko data/profile-rescue/syslinux.cfg.in000064400000000000000000000003541077717167500177210ustar00rootroot00000000000000default live prompt 1 timeout 0 display boot.msg implicit 0 label live kernel alt0/vmlinuz append initrd=alt0/full.cz live fastboot automatic=method:disk stagename=altlinux label memtest kernel memtest label disk LOCALBOOT -1 docs/000075500000000000000000000000001077717167500120265ustar00rootroot00000000000000docs/spt.txt000064400000000000000000000124021077717167500133740ustar00rootroot00000000000000Создание основанных на ALTLinux Sisyphus решений с помощью spt --------------------------------------------------------------- автор: LAKostis последняя редакция: 31.01.2007 версия: 0.9 Введение Описание spt Типовые решения --------------- Для создания решения необходимы след. пакеты из репозитария Сизиф: - spt (для сборки загрузочного iso образа) - свежая копия Сизифа (смонтированная локально или доступная по сети). процесс установки данных пакетов: $ apt-get install spt как минимум, нужен spt >= 0.5.0. Для работы spt >= 0.4.0-alt2.1 в /etc/hasher-priv/user.d/ необходимо добавить параметры allow_ttydev=YES и allowed_mountpoints=/dev/pts. подготовка директории создаем директорию, где мы будем творить :) $ mkdir workdir 1. Копируем подходящий профиль из /usr/share/spt/profile-*. Например, для livecd нужен profile-default: $ cp -a /usr/share/spt/profile-default workdir/profile потом заходим в workdir/profile, и правим там файлы по вкусу: - profile/config - общая конфигурация решения, в основном меняются KERNEL_ADD (ядро и модули, нужные на stage1) и строки, идентифицирующие сборку (PUBLISHER ORIGIN SUITE CODENAME VERSION). Теоретически можно менять тему/язык, но пока в spt это нереализовано. Сборочная архитектура задается через ARCH, нужно в случае кросс-сборки (i586 на x86-64). COMPONENTS - список обрабатываемых стадий (компонентов), которые нужны для организации решения. Для LiveCD достаточно одного компонента, собственно live. На практике компоненты являются директориями внутри профиля, с собственными файлами конфигурации (например, live/config), где можно задавать след. параметры: - OUT - имя конечного файла компонента - IDENT - имя папки, где содержится список пакетов компонента. Также эта переменная идентифицирует компонент на стадии сборки. - profile/modules - список модулей ядра, которые необходимо использовать при загрузке stage1. - profile/$IDENT/packages - список пакетов для установки, редактируется по-вкусу :) Например, если нужен десктопный вариант livecd, надо добавить ttf и bitmap шрифты (это fonts-ttf-* и fonts-bitmap-*) + WM/DE. Ввиду того, что сейчас нет в сизифе виртуальных пакетов для "вытягивания" какого-либо популярного DE (типа KDE или GNOME), придется довольствоваться icewm или fluxbox. ВНИМАНИЕ! Убедитесь, что названия ядер (и их модулей) в $KERNEL_ADD и profile/$IDENT/packages совпадают, иначе получите нерабочий stage2 - profile/$IDENT/hooks.d - туда кладутся скрипты, отрабатывающие после создания структуры каталогов. Например, в livecd я положил скрипты для корректировки раскладки клавиатуры/i18n/стартовых сервисов. Также туда можно сделать симлинки из /usr/share/spt/hooks-common или других профилей, если у нас планируется выполнять одинаковые действия. 2. Создание ISO9660 образа $ spt --mkiso workdir где workdir - директория с уже созданными временными файлами далее происходит генерация working chroot, его сжатие в squashfs (для livecd), формирование stage1 компонентов, загрузочных файлов и генерация .iso образа. Если .iso вам не нужен (например, в случае загрузки по сети), то можно использовать ключ --skip-iso. В случае, если OUT у нас отличается от altlinux, придется об этом сказать syslinux/isolinux: - перед запуском spt идем в profile/isolinux.cfg.in и делаем в нем след. изменения: строку "append initrd=alt0/full.cz live fastboot automatic=method:cdrom" заменяем на "append initrd=alt0/full.cz live fastboot automatic=method:cdrom stagename=", где stage - название созданного squashfs раздела (по-умолчанию, это altlinux). Профиль для OpenVZ ------------------- имя профиля - profile-ovz доступные типы образа - tbz2/tgz модицируемые файлы и переменные: profile/config - можно менять COMPONENTS в случае сборки образа в несколько стадий. profile/*/config - можно поменять OUT, например, чтобы на выходе получить более привычное altlinux-3.0.tar.gz, можно указать OUT в виде OUT=altlinux-3.0 примерная команда запуска: $ spt --image-type=tgz workdir, где workdir/profile является наследником profile-ovz LiveCD ------ имя профиля - profile-default доступные типы образа - squashfs обязательные переменные: KERNEL_ADD - ядро и модули для stage1 критичные переменные: CDFILENAME - название .iso образа загрузка по PXE: - устанавливаем tftp-server, dhcp-server, syslinux - копируем содержимое workdir/*.iso (нужна папка isolinux/ внутри iso образа) в /var/lib/tftpboot - копируем /usr/lib/syslinux/pxelinux.0 в /var/lib/tftpboot - прописываем в /etc/dhcp/dhcpd.conf следующее: ddns-update-style none; authoritative; subnet xxxxxx.0 netmask 255.255.255.0 { host pxeclient { hardware ethernet 00:0e:a6:5c:01:a0; fixed-address xxxxxxxxx; filename "/pxelinux.0"; # tftp сервер, где лежит pxelinux.0 next-server xxxxxxxxx; } } - включаем tftp в /etc/xinet.d/, добавляем запись для in.tftpd в /etc/hosts.allow - делаем каталог с altlinux доступным по nfs (можно ro) - создаем /var/lib/tfptboot/pxelinux.cfg/default след содержания: default live prompt 1 timeout 0 label live kernel alt0/vmlinuz append initrd=alt0/full.cz live fastboot automatic=method:nfs,network:dhcp,server:xxxxxx,directory:workdir/out stagename=altlinux label harddisk LOCALBOOT -1 - пробуем загрузиться. Должно все получится. scripts/000075500000000000000000000000001077717167500125655ustar00rootroot00000000000000scripts/spt000075500000000000000000000264531077717167500133330ustar00rootroot00000000000000#!/bin/sh -e export LC_ALL=C LANG=C LANGUAGE=C export GZIP_OPTS=${GZIP:=-9} . spt-sh-functions number= mkiso=1 mkboot=1 nobootsplash= nocleanup= nocompress= quiet= isoname= profile_dir= ARCH= apt_config= apt_prefix= excludedocs= image_type='squashfs' outdir= tmpdir= exit_handler() { local rc=$? trap - EXIT if [ -z "$nocleanup" ]; then hsh ${number:+--number="$number"} --cleanup -- "$workdir" rm -rf -- "$tmpdir" "$outdir" fi exit $rc } make_boot() { rm -rf -- "$outdir/isolinux" [ ! -d "$chroot/.isolinux" ] || cp -ra -- "$chroot/.isolinux" "$outdir/isolinux" } make_splash() { rm -rf -- "$outdir/splash" [ ! -f "$chroot/.splash/bootsplash" ] || cp -ra -- "$chroot/.splash" "$outdir/splash" } create_image() { Verbose "Creating image for \`$IDENT'." [ -z "$nocompress" ] || EXTRAOPTS=${EXTRAOPTS:-"-noI -noD -noF"} case "$image_type" in squashfs) init_chroot_progs "squashfsprogs" cp -a "$tmpdir/.archive.tar" "$chroot/tmp/" cat >"$tmpdir/mkfs"<<-EOF mkdir -p /tmp/.archive tar -C /tmp/.archive -xf /tmp/.archive.tar mksquashfs /tmp/.archive /.altlinux.img $EXTRAOPTS EOF chroot_exec "$tmpdir/mkfs" ;; tbz2) mkiso= cat "$tmpdir/.archive.tar" | bzip2 -f > "$workdir/$OUT.tar.bz2" ;; tgz) mkiso= cat "$tmpdir/.archive.tar" | gzip -f "$GZIP_OPTS" > "$workdir/$OUT.tar.gz" ;; tar) mkiso= cp -f "$tmpdir/.archive.tar" "$workdir/$OUT.tar" ;; *) Fatal 'Unsupported image type.' ;; esac # move image from chroot to outdir [ ! -f "$chroot/.altlinux.img" ] || mv -f -- "$chroot/.altlinux.img" "$outdir/$OUT" } make_image() { [ -z "$COPYONLY" ] || return 0 init_chroot_progs # Install packages local copy_init_list="$(grep -hs '^[^#]' "$profile_dir/$IDENT/packages" "$profile_dir/$IDENT/packages.$CDFILENAME")" [ -z "$copy_init_list" ] || hsh-install "$workdir" $verbose $quiet $excludedocs \ ${number:+--number="$number"} \ $copy_init_list [ -z "$FILES" ] || rsync $verbose -rtlpC "$profile_dir/$FILES" "$chroot/.in/" || Fatal "Could not copy additional files for \`$comp' component." chmod +r $chroot/.{host,in,out} chroot_mkdev # Run postinstll hacks Verbose "Run hooks for: $IDENT" postinstall "$profile_dir/$IDENT" [ -z "$mkboot" ] || make_boot [ ! -z "$nobootsplash" ] || make_splash # make archive for image Verbose "Creating archive image for \`$IDENT'." cp -at "$chroot/.host" /bin/tar cat >"$tmpdir/mktar"<<-EOF tar --numeric-owner \ --exclude /.archive.tar --exclude /.host --exclude /.image --exclude /.iso --exclude /.isolinux \ --exclude /.splash --exclude /.in --exclude /.out --exclude /.fakedata --exclude /usr/lib*/*fakeroot* \ -cf /.archive.tar / EOF chroot_exec "$tmpdir/mktar" && Verbose 'Chroot image arhivation complete.' || Fatal 'Chroot image arhivation failed.' [ ! -f "$chroot/.archive.tar" ] || cp -at "$tmpdir" "$chroot/.archive.tar" [ -n "$NOIMAGE" ] || create_image } copyonly() { [ -n "$COPYONLY" ] || return 0 local copy_init_list= copy_filelist packages if [ -n "$HOOKPKGS" ]; then Verbose "Installation packages for hook" hsh-install "$workdir" $verbose $quiet $excludedocs ${number:+--number="$number"} $HOOKPKGS fi packages="$profile_dir/$IDENT/packages" # $packages - file may be empty or not exist [ ! -f "$packages" ] || copy_init_list="$(grep -hs '^[^#]' "$profile_dir/$IDENT/packages" "$profile_dir/$IDENT/packages.$CDFILENAME")" ||: copy_filelist="$(print_uris setup filesystem rpm $copy_init_list)" || Fatal 'Failed to generate package file list.' [ -n "$copy_filelist" ] || Fatal 'Nothing to copy.' mkdir -p -- "$chroot/.in/$INSTALLDIR" echo $copy_filelist | xargs install -p -m644 $verbose -t "$chroot/.in/$INSTALLDIR/" -- || Fatal "Could not copy packages from $IDENT packages to \`/.in'." [ -z "$FILES" ] || rsync $verbose -rtlpC "$profile_dir/$FILES" "$chroot/.in/" || Fatal "Could not copy additional files for \`$comp' component." chroot_run rsync -rtlpC --delete-before "/.in/" "$imgdir/" find "$chroot/.in/" -mindepth 1 -delete # Run postinstll hacks Verbose "Run hooks for: $IDENT" postinstall "$profile_dir/$IDENT" # Cleanup after all chroot_run rm -rf -- "$imgdir" } runto_components() { local cmd comp local IDENT VENDOR COPYONLY INSTALLDIR NOIMAGE EXTRAOPTS FILES OUT cmd="$1" && shift for comp in $COMPONENTS; do IDENT="packages" VENDOR="ALTLinux" COPYONLY= INSTALLDIR= NOIMAGE= EXTRAOPTS= FILES= OUT= . "$profile_dir/$comp/config" || Fatal "File \`$profile_dir/$comp/config' not found." if [ ! -f "$profile_dir/$IDENT/packages" ]; then Verbose "$profile_dir/$IDENT/packages: not found" continue fi if [ ! -s "$profile_dir/$IDENT/packages" ]; then Verbose "$profile_dir/$IDENT/packages: empty" continue fi Verbose "Making component $comp" eval "$cmd" "$@" done } show_help() { [ -z "$*" ] || Info "$*" cat < Valid options are: --number=NUMBER subconfig identifier --noiso do not make ISO image --noboot do not make boot actions (like initrd/syslinux/etc) --nobootsplash do not add bootsplash image --no-cleanup do not remove temporary directory --no-compress do not compress squashfs image --isoname=NAME ISO image filename --image-type=TYPE image archive/filesystem type: TYPE: squashfs squashfs (default) ext2 ext2fs tbz2 tarball + bzip2 (always --noiso) tgz tarball + gzip (always --noiso) --excludedocs exclude docs during install --arch=ARCH target architecture --apt-config=FILE path to custom apt.conf file --apt-prefix=DIR path to apt directory prefix (e.g. /usr) -p, --profile-dir=DIR path to profile dir. -q, --quiet try to be more quiet -v, --verbose print a message from each action -V, --version print program version and exit -h, --help show this text and exit Report bugs to http://bugs.altlinux.org/ EOF exit } TEMP=`getopt -n $PROG -o p:,v,q,V,h -l noiso,noboot,nobootsplash,no-cleanup,no-compress,number:,isoname:,image-type:,excludedocs,arch:,apt-config:,apt-prefix:,profile-dir:,verbose,help,quiet,version -- "$@"` || show_usage eval set -- "$TEMP" while :; do case "$1" in --noiso) mkiso= ;; --noboot) mkboot= mkiso= ;; --nobootsplash) nobootsplash=1 ;; --no-cleanup) nocleanup=1 ;; --no-compress) nocompress=1 ;; --number) shift [ -z "$1" ] || number="$1" ;; --isoname) shift; isoname="${1##*/}"; mkiso=1 ;; --image-type) shift; case "$1" in squashfs) image_type="$1" ;; tbz2|tgz|tar) image_type="$1" mkboot= mkiso= ;; *) Fatal "--image-type: $1: not known image type." ;; esac ;; --excludedocs) excludedocs=--excludedocs ;; --arch) shift; ARCH="$1" [ -x "$ARCH" ] || ARCH=$(uname -m) ;; --apt-config) shift apt_config="$(readlink -ev "$1")" && [ -r "$apt_config" ] || Fatal "$1: file not available." ;; --apt-prefix) shift apt_prefix="$(readlink -ev "$1")" && [ -d "$apt_prefix" -a -x "$apt_prefix" ] || Fatal "$1: directory not available." ;; -p|--profile-dir) shift; profile_dir="$1" ;; -v|--verbose) verbose=-v ;; -q|--quiet) quiet=-q ;; -h|--help) show_help ;; -V|--version) print_version "$PROG" ;; --) shift; break ;; *) Fatal "Unrecognized option: $1" ;; esac shift done # Exactly one argument, please. [ "$#" -ge 1 ] || show_help 'Insufficient arguments.' [ "$#" -le 1 ] || show_usage 'Too many arguments.' [ -d "$1" ] || mkdir "$1" workdir="$(readlink -ev "$1")" && shift profile_dir="${profile_dir:-$workdir/profile}" [ -f "$profile_dir/config" ] || show_usage 'Profile in workdir not found. Please, init directories stucture first.' . "$profile_dir/config" [ -n "$COMPONENTS" ] || Fatal "Please, add COMPONENTS to configuration file" chroot="$workdir/chroot" tmpdir="$workdir/tmp" outdir="$workdir/out" trap exit_handler HUP PIPE INT QUIT TERM EXIT remkdir "$tmpdir" remkdir "$outdir" runto_components make_image [ -n "$mkiso" -o -n "$mkboot" ] || exit 0 # install init packages init_chroot_progs "mar propagator syslinux mkisofs rsync glibc-utils $KERNEL_ADD" isodir=/.iso imgdir=/.image rsync $verbose -rtlpC "$outdir/" "$chroot/$imgdir/" chroot_run mkdir -p "$isodir/isolinux/alt0" chroot_run rsync -rtlpC "$imgdir/" "$isodir/" rm -rf -- "$chroot/$imgdir" # COPYONLY handle runto_components copyonly # syslinux stuff addisolinux= if [ -f "$profile_dir/isolinux.cfg.in" ]; then cp "$profile_dir/isolinux.cfg.in" "$chroot/.in/isolinux.cfg" addisolinux=1 fi [ ! -f "$profile_dir/syslinux.cfg.in" ] || cp "$profile_dir/syslinux.cfg.in" "$chroot/.in/syslinux.cfg" # copy profile & utils cp -af "$profile_dir"/{modules,initfs} "$chroot/.host/" # copy optional files [ ! -d "$profile_dir/isofiles" ] || rsync -rtlpC "$profile_dir/isofiles/" "$chroot/.host/isofiles/" CDFILENAME=${isoname:-$CDFILENAME} CDFILENAME=${CDFILENAME:-livecd.iso} cat >"$tmpdir/mkboot"< /tmp/.VERSION if [ -z "$nobootsplash" -a -f $isodir/splash/bootsplash ]; then mv $isodir/splash /bootsplash fi if [ -f /tmp/mkmar/modules ]; then cat "\$libdir/propagator/initfs" /tmp/mkmar/modules > $isodir/isolinux/alt0/full.cz sed -e "/@MODDIR@/d" \ -e "s|@DOTVERSION@|/tmp/.VERSION|" \ -e "s|@LIBDIR@|\$libdir|" \ < /.host/initfs | gencpio - | gzip -c \ >> $isodir/isolinux/alt0/full.cz else sed -e "s|@MODDIR@|/tmp/mkmar|g" \ -e "s|@DOTVERSION@|/tmp/.VERSION|" \ -e "s|@LIBDIR@|\$libdir|" \ < /.host/initfs | gencpio - | gzip -c \ > $isodir/isolinux/alt0/full.cz fi mkdir -p $isodir/.disk echo "${PUBLISHER:+$PUBLISHER }${VERSION:+$VERSION }${LABEL:+$LABEL }${CODENAME:+($CODENAME)}" > $isodir/.disk/info mkisofs -b isolinux/isolinux.bin \ -c isolinux/boot.cat \ -copyright "LICENSE.html" \ --volset "\$(cat $isodir/.disk/info)" \ -V "$SUITE" \ -publisher "$PUBLISHER" \ -sysid "$ORIGIN" \ -no-emul-boot \ -boot-info-table \ -boot-load-size 4 \ -J -l -r \ -o "/tmp/$CDFILENAME" "$isodir" EOF chroot_exec "$tmpdir/mkboot" && Verbose 'Boot stuff make complete.' || Fatal 'Boot stuff make failed.' [ ! -f "$chroot/tmp/$CDFILENAME" ] || cp -af "$chroot/tmp/$CDFILENAME" "$workdir/" chroot_run rm -f "/tmp/$CDFILENAME" scripts/spt-sh-functions000075500000000000000000000156331077717167500157470ustar00rootroot00000000000000#!/bin/sh -e # # Copyright (C) 2003-2005 Dmitry V. Levin # Copyright (C) 2005 Anton D. Kachalov # Copyright (C) 2006-2007 Konstantin A. Lepikhov # Copyright (C) 2006-2007 Alexey S. Gladkov # # This file defines functions used by spt scripts. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # PROG="${0##*/}" Info() { printf %s\\n "$PROG: $*" >&2 } verbose= Verbose() { [ -n "$verbose" ] || return 0 Info "$*" } Fatal() { printf %s\\n "$PROG: Fatal $*" >&2 exit 1 } print_version() { local prog="$1" && shift cat < Modified by Konstantin A. Lepikhov Modified by Alexey S. Gladkov Copyright (C) 2005 Anton D. Kachalov Copyright (C) 2006-2007 Konstantin A. Lepikhov Copyright (C) 2006-2007 Alexey S. Gladkov This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. EOF exit } show_usage() { [ -z "$*" ] || Info "$*" printf %s\\n "Try \`$PROG --help' for more information." >&2 exit 1 } remkdir() { rm -rf -- "$1" mkdir -- "$1" } workdir= chroot_run() { local out if ! out="$(hsh-run $verbose $quiet ${number:+--number="$number"} --rooter "$workdir" -- "$@" 2>&1)"; then printf %s\\n "$out" >&2 Fatal 'failed to run cmd in chroot.' fi } workdir= chroot_exec() { local out local script="$1" if ! out="$(hsh-run $verbose $quiet ${number:+--number="$number"} --rooter --execute="$script" "$workdir" 2>&1)"; then printf %s\\n "$out" >&2 fi } workdir= chroot_mkdev() { # Create essential tty devices. echo "\ 600 /dev/console c 5 1 600 /dev/tty0 c 4 0 666 /dev/tty c 5 0 666 /dev/ptmx c 5 2" | while read mode name type major minor ; do hsh-fakedev $verbose $quiet ${number:+--number="$number"} -o root -m "$mode" "$workdir" "$name" "$type" "$major" "$minor" || Fatal 'Failed to create tty devices.' done } quiet= verbose= workdir= init_chroot_progs() { # These directories may confuse users. We need to help them. rm -rf -- "$workdir/repo" hsh "$workdir" $quiet $verbose $excludedocs \ ${ARCH:+--target="$ARCH"} \ ${LANGS:+--install-langs="$LANGS"} \ ${apt_config:+--apt-config=$apt_config} \ ${apt_prefix:+--apt-prefix=$apt_prefix} \ ${number:+--number="$number"} \ --initroot-only \ --save-fakeroot \ --without-stuff \ --pkg-init-list="setup filesystem rpm fakeroot>=0:0.7.3 findutils tar $*" \ --pkg-build-list=',' || Fatal 'Failed to initialize boot.' rm -rf -- "$workdir/repo" } workdir= gen_aptbox() { local dir [ "$#" -eq 0 ] && dir="$workdir" || dir="$1" rm -rf -- "$dir/aptbox" mkaptbox "$dir" $quiet $verbose \ ${target:+--target="$ARCH"} \ ${apt_config:+--apt-config="$apt_config"} \ ${apt_prefix:+--apt-prefix="$apt_prefix"} } chroot= postinstall() { local script scrname identdir identdir="$1" && shift [ -d "$identdir/hooks.d" ] || return 0 chroot_run chown root:root / chroot_run chmod 755 / for script in "$identdir/hooks.d"/*; do [ "$script" != "$identdir/hooks.d/*" ] || break [ -x "$script" ] || continue scrname=${script##*/} cp -aL -- "$script" "$chroot/.host/$scrname-run" cat >"$chroot/.host/spt-hook"</dev/null 2>&1 aptbox="$tmpdir/aptbox" if ! out="$("$aptbox/apt-get" -q -y --print-uris install -- "$@" 2>&1)"; then printf %s\\n "$out" >&2 Fatal 'failed to calculate package file list.' fi local all_pattern="'\\([a-z]\\+\\):\\([^']\\+\\)' .*" local local_pattern="'\\(file\\|copy\\):\\([^']\\+\\)' .*" local all_uris if ! all_uris="$(printf %s "$out" |sed -ne "s/^$all_pattern/\\2/pg")"; then printf %s\\n "$out" >&2 Fatal 'failed to filter package file list.' fi local local_uris cached_uris= if ! local_uris="$(printf %s "$out" |sed -ne "s/^$local_pattern/\\2/pg")"; then printf %s\\n "$out" >&2 Fatal 'failed to filter package file list.' fi if [ "$all_uris" != "$local_uris" ]; then if [ -z "$APT_Get_PrintLocalFile" ]; then if ! out="$("$aptbox/apt-get" -o APT::Get::PrintLocalFile=yes -q -y --print-uris install -- "$@" 2>&1)"; then printf %s\\n "$out" >&2 Fatal 'calculated package file list is not local and apt-get does not support APT::Get::PrintLocalFile option.' fi if ! cached_uris="$(printf %s "$out" |sed -ne "s/^$all_pattern/\\2/pg")" || [ -n "$cached_uris" ]; then printf %s\\n "$out" >&2 Fatal 'calculated package file list is not local and apt-get does not support APT::Get::PrintLocalFile option.' fi APT_Get_PrintLocalFile=1 fi if [ -n "$verbose" ]; then "$aptbox/apt-get" -y -d install -- "$@" >&2 || Fatal 'failed to download packages from calculated package file list.' else if ! out="$("$aptbox/apt-get" -y -d install -- "$@" 2>&1)"; then printf %s\\n "$out" >&2 Fatal 'failed to download packages from calculated package file list.' fi fi if ! out="$("$aptbox/apt-get" -o APT::Get::PrintLocalFile=yes -q -y --print-uris install -- "$@" 2>&1)"; then printf %s\\n "$out" >&2 Fatal 'failed to calculate local package file list.' fi if ! cached_uris="$(printf %s "$out" |grep ^/)" || [ -z "$cached_uris" ]; then printf %s\\n "$out" >&2 Fatal 'failed to calculate local package file list.' fi fi if [ -n "$cached_uris" ]; then [ -n "$local_uris" ] && local_uris="$local_uris $cached_uris" || local_uris="$cached_uris" fi printf %s "$local_uris" && Verbose 'calculated package file list.' }