moving files around to reduce confusion
[catalyst.git] / livecd / runscript / alpha-archscript.sh
1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/alpha-archscript.sh,v 1.1 2004/03/04 23:29:45 zhen Exp $
4
5 case $1 in
6         kernel)
7                 genkernel_args=""
8                 export genkernel_args
9         ;;
10
11         preclean)
12                 # Add entries for ttyS0 and ttyS1 to /etc/inittab.
13                 echo "t0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt100" >> ${clst_chroot_path}/etc/inittab
14                 echo "t1:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100" >> ${clst_chroot_path}/etc/inittab
15         ;;
16
17         clean)
18         ;;
19
20         bootloader)
21                 # Time to create a filesystem tree for the ISO at
22                 # $clst_cdroot_path. We extract the "cdtar" to this directory,
23                 # which will normally contains a pre-built binary
24                 # boot-loader/filesystem skeleton for the ISO. 
25                 
26                 cdtar=$clst_livecd_cdtar
27                 [ "$cdtar" = "" ] && die "No livecd/cdtar specified (required)"
28                 tar xjpvf $cdtar -C $clst_cdroot_path || die \
29                     "Couldn't extract cdtar $cdtar"
30                 if [ "$clst_boot_kernel" = "" ]
31                 then
32                         echo "No boot/kernel setting defined, exiting."
33                         exit 1
34                 fi
35                 first=""
36                 for x in $clst_boot_kernel
37                 do
38                         if [ ! -e "$clst_chroot_path/tmp/binaries/$x.tar.bz2" ] 
39                         then
40                                 echo "Can't find kernel tarball at $clst_chroot_path/tmp/binaries/$x.tar.bz2"
41                                 exit 1
42                         fi
43                         tar xjvf $clst_chroot_path/tmp/binaries/$x.tar.bz2 -C \
44                             $clst_cdroot_path/boot
45                         # change kernel name from "kernel" to "gentoo", for
46                         # example
47                         mv $clst_cdroot_path/boot/kernel \
48                             $clst_cdroot_path/boot/$x
49                         # change initrd name from "initrd" to "gentoo.igz",
50                         # for example
51                         mv $clst_cdroot_path/boot/initrd \
52                             $clst_cdroot_path/boot/$x.igz
53                 done
54
55                 acfg=$clst_cdroot_path/etc/aboot.conf
56                 bctr=0
57                 for x in $clst_boot_kernel
58                 do
59                         echo -n "${bctr}:/boot/$x " >> $acfg
60                         echo -n "initrd=/boot/$x.igz root=/dev/ram0 " >> $acfg
61                         echo "init=/linuxrc ${cmdline_opts} cdroot" >> $acfg
62                         ((bctr=$bctr+1))
63                 done
64         ;;
65
66         cdfs)
67         ;;
68
69         iso)
70                 # this is for the livecd-final target, and calls the proper
71                 # command to build the iso file
72                 case $clst_livecd_cdfstype in
73                         zisofs)
74                                 mkisofs -J -R -l -z -o ${clst_iso_path} $clst_cdroot_path
75                         ;;
76                         *)
77                                 mkisofs -J -R -l -o ${clst_iso_path} $clst_cdroot_path
78                         ;;
79                 esac
80                 isomarkboot $clst_iso_path /boot/bootlx
81         ;;
82 esac