malekith: bootdisk Makefile.am,NONE,1.1, mkpkg,NONE,1.1, packages,NONE,1.1, root.sh,NONE,1.1, ui.sh,NONE,1.1

Michał Moskal malekith w pld-linux.org
Pon, 18 Mar 2002, 10:29:09 CET


Module name:    bootdisk
Changes by:     malekith

 

--- NEW FILE: Makefile.am ---
EXTRA_DIST = mkpkg packages root.sh ui.sh

all: pkg-stamp force-scripts

pkg-stamp: mkpkg packages
	sh mkpkg all
	touch pkg-stamp

force-scripts: ../installer-rc
	sh mkpkg root
	sh mkpkg ui

../installer-rc:
	$(MAKE) -C .. installer-rc

../lists-pkg-root:
	$(MAKE) -C .. lists-pkg

clean-local:
	rm -f pkg-stamp
	rm -f *-pkg.tar.gz
	rm -rf pkg-root

 

--- NEW FILE: mkpkg ---
#!/bin/sh
#
# Copyright (c) 2002 Michal Moskal <malekith w pld.org.pl>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by Michal Moskal.
# 4. Neither the name of the author nor the names of any co-contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY MICHAL MOSKAL AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

rpmdir=$HOME/rpm/RPMS/
export rpmdir

scriptsdir="../scripts"

pkgfile="./packages"

set -e

targetpkg="$1"

if test -z "$targetpkg" ; then
  echo "usage: $0 pkgname" 1>&2
  exit 1
fi

pkg=
copy_mode=

start_pkg () 
{
  echo "making $pkg"
  rm -rf pkg-root
  mkdir pkg-root
}

finalize_pkg ()
{
  echo -n "taring $pkg... "
  (cd pkg-root && tar cf - .) | gzip -9nf > $pkg-pkg.tar.gz
  rm -rf pkg-root
  echo done
}

add_file ()
{
  if [ "$target" = "" ] ; then
    target="/bin"
  fi
  echo "  $file -> $target"
  mkdir -p pkg-root/$target
  
  if [ "$rpm" = "@script" ] ; then
    cp $scriptsdir/$file pkg-root/$target
  elif [ "$rpm" = "@cp" ] ; then
    cp -r $file pkg-root/$target
  else
    if test -r $rpm.cpio ; then
      : ok
    else
      echo -n "  *** unrpming $rpm... "
      rpm2cpio $rpmdir/$rpm-[0-9]* > $rpm.cpio
      echo done
    fi
    rm -rf cpiodir
    mkdir cpiodir
    cd cpiodir
    cpio --quiet --make-directories --extract .$file < ../$rpm.cpio
    cd ..
    mv cpiodir/$file pkg-root/$target
    rm -rf cpiodir
  fi

  if test "$symlink" ; then
    mkdir -p pkg-root/$symlink
    ln -s $target/`basename $file` pkg-root/$symlink
  fi
}

while read a0 a1 a2 a3 a4 ; do
  case "$a0" in
    @pkg )
      if test "$pkg" ; then
        finalize_pkg
      fi
      if [ "$targetpkg" = "all" -o "$a1" = "$targetpkg" ] ; then
        pkg="$a1"
	start_pkg
      else
        pkg=
      fi
      ;;
    @sh )
      if test "$pkg" ; then
        cd pkg-root
        echo "  + $a1 $a2 $a3 $a4"
        pkg=$pkg $a1 $a2 $a3 $a4
	cd ..
      fi
      ;;
    @shell )
      if test "$pkg" ; then
        cd pkg-root
	echo "  *** running $a1 $a2 $a3 $a4"
        pkg=$pkg sh ../$a1 $a2 $a3 $a4
	cd ..
      fi
      ;;
    @mkdir )
      if test "$pkg" ; then
        cd pkg-root
	echo "  + mkdir -p $a1 $a2 $a3 $a4"
        mkdir -p $a1 $a2 $a3 $a4
	cd ..
      fi
      ;;
    "#" | "" )
      ;;
    * )
      if test "$pkg" ; then
        rpm="$a0" file="$a1" target="$a2" symlink="$a3" add_file
      fi
      ;;
  esac
done < $pkgfile

if test "$pkg" ; then
  finalize_pkg
fi

rm -f *.cpio

 

--- NEW FILE: packages ---
# this file contains list of binaries and scripts to be put into
# particular installer packages

@pkg ext2
e2fsprogs	/sbin/mke2fs

@pkg fdisk
util-linux	/sbin/fdisk
e2fsprogs	/sbin/badblocks

@pkg jfs
jfsutils	/sbin/mkfs.jfs

@pkg md
mdctl		/sbin/mdctl

@pkg net
iproute2	/sbin/ip
snarf		/usr/bin/snarf
dhcpcd		/sbin/dhcpcd
@script		pldbug
@script		shirc

@pkg parted
parted		/usr/sbin/parted

@pkg reiserfs
reiserfsprogs	/sbin/mkreiserfs

@pkg xfs
xfsprogs	/sbin/mkfs.xfs

@pkg pcmcia
pcmcia-cs	/sbin/cardmgr
pcmcia-cs	/sbin/cardctl
pcmcia-cs	/sbin/probe
pcmcia-cs	/sbin/ide_info
pcmcia-cs	/sbin/scsi_info
pcmcia-cs	/sbin/ifport
pcmcia-cs	/sbin/ifuser
pcmcia-cs	/etc/pcmcia/*	/etc/pcmcia
@mkdir		var/lib/pcmcia var/run
@sh		rm -f etc/pcmcia/network*
@sh		cp ../../config/pcmcia-network etc/pcmcia/network

@pkg poldek
poldek		/usr/bin/poldek		/dest/installer/bin	/bin

@pkg root
e3		/usr/bin/e3*
ash		/bin/ash
busybox		/usr/bin/busybox
busybox		/usr/lib/busybox/busybox.links	/etc
@shell		root.sh

@pkg ui
dml		/usr/bin/dml
@shell		ui.sh

@pkg trace
ltrace		/usr/bin/ltrace
ltrace		/etc/ltrace.conf	/etc

@pkg libc
@cp		/lib/ld-linux.so.2	/dest/installer/lib	/lib
@cp		/lib/libc.so.6		/dest/installer/lib	/lib
@cp		/lib/libdl.so.2		/dest/installer/lib	/lib
@cp		/lib/libnsl.so.1	/dest/installer/lib	/lib
@cp		/lib/libnss_dns.so.2	/dest/installer/lib	/lib
@cp		/lib/libnss_files.so.2	/dest/installer/lib	/lib
@cp		/lib/libresolv.so.2	/dest/installer/lib	/lib

@pkg msdos
@cp		/sbin/mkdosfs		/dest/installer/bin	/bin

@pkg pci
@cp		/sbin/lspci		/dest/installer/bin	/bin
@cp		/usr/share/misc/pci.ids	/usr/share/misc

@pkg rpm
@cp		/usr/lib/rpm/macros	/dest/usr/lib/rpm	/usr/lib/rpm
@cp		../config/rpmpopt-4.0	/dest/usr/lib/rpm	/usr/lib/rpm
@cp		/usr/lib/rpm/rpmrc	/dest/usr/lib/rpm	/usr/lib/rpm
@mkdir		dest/var/lib/rpm var/lib/rpm

@pkg lists
@cp		../lists-pkg-root/etc	/

 

--- NEW FILE: root.sh ---
#!/bin/sh

set -e

. ../../installer-rc

install -d {lib/modules/$KERNEL_VER,mnt,proc,usr}
install -d {var/{run,log},tmp,src,dest,doc}
ln -sf . lib/modules/$KERNEL_VER/misc
ln -sf bin sbin
ln -sf ../bin usr/bin
ln -sf ../bin usr/sbin
ln -sf ../lib usr/lib
ln -sf ash bin/sh
for f in `ls bin/e3-* | grep -v e3-editor.sh` ; do
  mv $f `echo $f | sed -e 's/e3-//'`
done
if test -L bin/e3 ; then
  : ok
else
  rm bin/e3c
fi
for f in `cat etc/busybox.links` ; do
  ln -s busybox bin/`basename $f`
done
rm etc/busybox.links
install -m 755 ../../scripts/rc etc
install -m 755 ../../scripts/HOWTO.sh bin/howto
for f in modprobe vfjuggle init-wrapper shell ; do
  install -m 755 ../../scripts/$f bin
done
for f in fstab mtab inittab ld.so.conf group nsswitch.conf passwd protocols \
         services motd motd.bye motd.pl motd.bye.pl modules.dep ; do
  install -m 644 ../../config/$f etc
done
install -m 644 ../../installer-rc etc

mv etc/motd etc/motd.en
mv etc/motd.bye etc/motd.bye.en
ln -s motd.en etc/motd
ln -s motd.bye.en etc/motd.bye

for f in etc/motd.* ; do
  cp $f ttt
  sed -e "s/@builddate@/`date '+%Y%m%d'`/g" ttt > $f
  rm -f ttt
done

install -m 644 ../../doc/devices.txt doc
install -m 644 ../../doc/install-HOWTO doc

sed -e 's@^datafile=.*@datafile=/etc/sh-scan-pci.list-net@' \
	../../batch-installer/pci/sh-scan-pci > bin/detect-net-devices
chmod 755 bin/detect-net-devices
sed -e 's@^datafile=.*@datafile=/etc/sh-scan-pci.list-scsi@' \
	../../batch-installer/pci/sh-scan-pci > bin/detect-scsi-devices
chmod 755 bin/detect-scsi-devices
install -m 644 ../../batch-installer/pci/sh-scan-pci.list-{net,scsi} etc

for f in setup installer load-config \
	 installer-{functions,prep,validate,dest,pkgs,boot,conf,raid-functions} ; do
  install -m 755 ../../batch-installer/$f bin
done
ln -s load-config	 bin/save-config
ln -s installer-prep     bin/load_package
ln -s installer-prep     bin/load_module
ln -s installer-prep     bin/installer-prep-source
ln -s installer-validate bin/installer-validate-source
ln -s installer-validate bin/installer-validate-draft

install -d usr/share/fonts
install -m 644 ../../config/lat2-16.psfu.gz usr/share/fonts/l2.psfu.gz

install ../../batch-installer/installer.conf	  etc/installer.conf
install ../../batch-installer/ui/data/groups	  etc/installer.groups
install ../../batch-installer/installer.sysconf   etc/installer.sysconf

install -d etc/installer.pkgsets
here=$PWD
cd ../../batch-installer; sh mkallpkgsets $here/etc/installer.pkgsets
cd $here
install etc/installer.pkgsets/basic etc/installer.pkgs

 

--- NEW FILE: ui.sh ---
#!/bin/sh

set -e

install -d etc usr/share/terminfo/{l,v} usr/lib/installer
install -m 644 /usr/share/terminfo/l/linux usr/share/terminfo/l
install -m 644 /usr/share/terminfo/v/vt100 usr/share/terminfo/v
# terminfo for dml
ln -s vt100 usr/share/terminfo/v/vt102
# ui for batch-installer
install -m 755 ../../batch-installer/ui/ui-{functions,main,makeform,pkgs,conf,parted,dialogs,parted2,wizard} bin
# localization
for f in ../../batch-installer/po/*.gmo; do
  install -m 644 $f usr/lib/installer/`basename $f .gmo`.mo
done  
install -m 644 ../../config/dml.conf etc
# device descriptions
install -m 644 ../../modules-list/{eth,scsi-low}.list.in etc



Więcej informacji o liście dyskusyjnej pld-installer