/[sandbox]/r2d2/hardened-livecd/trunk/x86-archscript.sh
Gentoo

Contents of /r2d2/hardened-livecd/trunk/x86-archscript.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (show annotations) (download) (as text)
Thu Feb 10 00:05:18 2005 UTC (9 years, 6 months ago) by r2d2
File MIME type: text/x-sh
File size: 4327 byte(s)
Initial revision

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvs/hardened-livecd/x86-archscript.sh,v 1.1 2005/02/10 00:05:19 r2d2 Exp $
4
5 case $1 in
6 kernel)
7 ;;
8
9 preclean)
10 ;;
11
12 clean)
13 ;;
14
15 bootloader)
16 # CDFSTYPE and loop_opts are exported from the default
17 # runscript
18
19 # Time to create a filesystem tree for the ISO at $clst_cdroot_path.
20 # We extract the "cdtar" to this directory, which will normally contains a pre-built
21 # binary boot-loader/filesystem skeleton for the ISO.
22
23 cdtar=${clst_livecd_cdtar}
24 [ -z "${cdtar}" ] && die "Required key livecd/cdtar not defined, exiting"
25 tar xjpvf ${cdtar} -C ${clst_cdroot_path} || die "Couldn't extract cdtar ${cdtar}"
26
27 [ -z "${clst_boot_kernel}" ] && die "Required key boot/kernel not defined, exiting."
28
29 first=""
30 for x in ${clst_boot_kernel}
31 do
32 kbinary="${clst_chroot_path}/usr/portage/packages/gk_binaries/${x}-${clst_version_stamp}.tar.bz2"
33
34 if [ -z "${first}" ]
35 then
36 # grab name of first kernel
37 first="${x}"
38 fi
39
40 # unpack the kernel that was compiled in kmerge.sh
41 [ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}"
42 tar xjvf "${kbinary}" -C "${clst_cdroot_path}"/isolinux
43
44 #change kernel name from "kernel" to "gentoo", for example
45 mv "${clst_cdroot_path}"/isolinux/kernel* "${clst_cdroot_path}"/isolinux/"${x}"
46
47 #change initrd name from "initrd" to "gentoo.igz", for example
48 mv "${clst_cdroot_path}"/isolinux/initrd* "${clst_cdroot_path}"/isolinux/"${x}".igz
49 done
50
51 # the rest of this function sets up the config file for isolinux
52 icfg=${clst_cdroot_path}/isolinux/isolinux.cfg
53 kmsg=${clst_cdroot_path}/isolinux/kernels.msg
54 hmsg=${clst_cdroot_path}/isolinux/help.msg
55 echo "default ${first}" > ${icfg}
56 echo "timeout 150" >> ${icfg}
57 echo "prompt 1" >> ${icfg}
58 echo "display boot.msg" >> ${icfg}
59 echo "F1 kernels.msg" >> ${icfg}
60 echo "F2 help.msg" >> ${icfg}
61
62 # figure out what device manager we are using and handle it accordingly
63 if [ "${clst_livecd_devmanager}" == "udev" ]
64 then
65 cmdline_opts="${cmdline_opts} udev nodevfs"
66 fi
67
68 echo "Available kernels:" > ${kmsg}
69 cp ${clst_sharedir}/livecd/files/x86-help.msg ${hmsg}
70
71 for x in ${clst_boot_kernel}
72 do
73
74 eval custom_kopts=\$${x}_kernelopts
75 echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}"
76 echo >> ${icfg}
77 echo "label ${x}" >> ${icfg}
78 echo " kernel ${x}" >> ${icfg}
79
80 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
81 then
82 echo " append initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=ht ${cmdline_opts} ${custom_kopts} cdroot vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme}" >> ${icfg}
83 else
84 echo " append initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=ht ${cmdline_opts} ${custom_kopts} cdroot vga=791 dokeymap splash=silent" >> ${icfg}
85 fi
86
87 echo >> ${icfg}
88 echo " ${x}" >> ${kmsg}
89 echo "label ${x}-noX" >> ${icfg}
90 echo " kernel ${x}" >> ${icfg}
91 if [ "${clst_livecd_splash_type}" == "gensplash" -a -n "${clst_livecd_splash_theme}" ]
92 then
93 echo " append initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=ht ${cmdline_opts} ${custom_kopts} cdroot vga=791 dokeymap splash=silent,theme:${clst_livecd_splash_theme} softlevel=noX" >> ${icfg}
94 else
95 echo " append initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=ht ${cmdline_opts} ${custom_kopts} cdroot vga=791 dokeymap splash=silent softlevel=noX" >> ${icfg}
96 fi
97
98
99 echo >> ${icfg}
100 echo " ${x}-noX" >> ${kmsg}
101 echo "label ${x}-nofb" >> ${icfg}
102 echo " kernel ${x}" >> ${icfg}
103 echo " append initrd=${x}.igz root=/dev/ram0 init=/linuxrc acpi=ht ${cmdline_opts} ${custom_kopts} cdroot" >> ${icfg}
104 echo >> ${icfg}
105 echo " ${x}-nofb" >> ${kmsg}
106 done
107
108 if [ -f ${clst_cdroot_path}/isolinux/memtest86 ]
109 then
110 echo >> $icfg
111 echo " memtest86" >> $kmsg
112 echo "label memtest86" >> $icfg
113 echo " kernel memtest86" >> $icfg
114 fi
115 ;;
116
117 cdfs)
118 ;;
119
120 iso)
121 #this is for the livecd-stage2 target, and calls the proper command to build the iso file
122 mkisofs -J -R -l -o ${2} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -z ${clst_cdroot_path}
123 ;;
124 esac

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords author date id revision

  ViewVC Help
Powered by ViewVC 1.1.20