Line 18... |
Line 18... |
18 |
# changes need for SL5:
|
18 |
# changes need for SL5:
|
19 |
# - initrd blocksize to 4096 (instead of 1024)
|
19 |
# - initrd blocksize to 4096 (instead of 1024)
|
20 |
# - add fscache (for NFS support)
|
20 |
# - add fscache (for NFS support)
|
21 |
# - add ide-cd, cdrom (for CD-ROM support)
|
21 |
# - add ide-cd, cdrom (for CD-ROM support)
|
22 |
# read $KERNEL from $1, can overwrite setting in livecd.conf
|
22 |
# read $KERNEL from $1, can overwrite setting in livecd.conf
|
23 |
# add aufs (replace for unionfs)
|
23 |
# add aufs (replacement for unionfs)
|
24 |
# add rev to static-binaries (for unionfs of aufs)
|
24 |
# add rev to static-binaries (for unionctl of aufs)
|
25 |
#
|
25 |
#
|
26 |
|
26 |
|
27 |
# . ../config || exit 1
|
27 |
# . ../config || exit 1
|
28 |
|
28 |
|
29 |
. ../../livecd.conf || exit 1
|
29 |
. ../../livecd.conf || exit 1
|
Line 84... |
Line 84... |
84 |
MOUNTDIR=/tmp/initrd_mountdir_$$
|
84 |
MOUNTDIR=/tmp/initrd_mountdir_$$
|
85 |
INITRD_TREE=/tmp/initrd_tree_$$
|
85 |
INITRD_TREE=/tmp/initrd_tree_$$
|
86 |
|
86 |
|
87 |
LMK="lib/modules/$KERNEL"
|
87 |
LMK="lib/modules/$KERNEL"
|
88 |
|
88 |
|
- |
|
89 |
UNIONFS_TYPE=""
|
- |
|
90 |
|
89 |
if [ ! -e /$LMK/kernel/fs/unionfs/unionfs.ko ] && \
|
91 |
if [ -e /$LMK/kernel/fs/unionfs/unionfs.ko ] || \
|
90 |
[ ! -e kernel-modules/${KERNEL}_$ARCH/unionfs.ko.gz ]; then
|
92 |
[ -e kernel-modules/${KERNEL}_$ARCH/unionfs.ko.gz ]; then
|
- |
|
93 |
UNIONFS_TYPE="unionfs"
|
- |
|
94 |
fi
|
91 |
if [ ! -e /$LMK/kernel/fs/aufs/aufs.ko ] && \
|
95 |
if [ -e /$LMK/kernel/fs/aufs/aufs.ko ] || \
|
92 |
[ ! -e kernel-modules/${KERNEL}_$ARCH/aufs.ko.gz ]; then
|
96 |
[ -e kernel-modules/${KERNEL}_$ARCH/aufs.ko.gz ]; then
|
- |
|
97 |
UNIONFS_TYPE="aufs"
|
- |
|
98 |
fi
|
- |
|
99 |
if [ ! $UNIONFS_TYPE ]; then
|
93 |
echo "ERROR: aufs or unionfs kernel module not found."
|
100 |
echo "ERROR: Neither aufs nor unionfs kernel module not found."
|
94 |
exit 1
|
101 |
exit 1
|
95 |
fi
|
- |
|
96 |
fi
|
102 |
fi
|
97 |
|
103 |
|
98 |
if [ ! -e /$LMK/kernel/fs/squashfs/squashfs.ko ] && \
|
104 |
if [ ! -e /$LMK/kernel/fs/squashfs/squashfs.ko ] && \
|
99 |
[ ! -e kernel-modules/${KERNEL}_$ARCH/squashfs.ko.gz ]; then
|
105 |
[ ! -e kernel-modules/${KERNEL}_$ARCH/squashfs.ko.gz ]; then
|
100 |
echo "ERROR: Squashfs kernel module not found."
|
106 |
echo "ERROR: Squashfs kernel module not found."
|
101 |
exit 1
|
107 |
exit 1
|
102 |
fi
|
108 |
fi
|
103 |
|
109 |
|
104 |
# if [ ! -d "kernel-modules/${KERNEL}_$ARCH" ]; then
|
- |
|
105 |
# echo "The directory kernel-modules/${KERNEL}_$ARCH doesn't exist. Please create it and copy"
|
- |
|
106 |
# echo "squashFS and unionFS modules for your kernel version to it."
|
- |
|
107 |
# exit 1
|
- |
|
108 |
# fi
|
- |
|
109 |
|
- |
|
110 |
debug "creating empty directory $INITRD_TREE"
|
- |
|
111 |
rm -Rf $INITRD_TREE
|
- |
|
112 |
mkdir $INITRD_TREE
|
- |
|
113 |
|
- |
|
114 |
debug "creating directories"
|
110 |
debug "creating directories"
|
115 |
mkdir -p $INITRD_TREE/{etc,dev,bin,mnt,livecd,proc,lib,sbin,sys,tmp,var/log}
|
111 |
mkdir -p $INITRD_TREE/{etc,dev,bin,mnt,livecd,proc,lib,sbin,sys,tmp,var/log}
|
116 |
|
112 |
|
117 |
debug "creating some essential devices in rootdisk"
|
113 |
debug "creating some essential devices in rootdisk"
|
118 |
mknod $INITRD_TREE/dev/console c 5 1
|
114 |
mknod $INITRD_TREE/dev/console c 5 1
|
Line 147... |
Line 143... |
147 |
|
143 |
|
148 |
# lspci and pcitable for network card detection
|
144 |
# lspci and pcitable for network card detection
|
149 |
cp static-binaries/lspci $INITRD_TREE/sbin
|
145 |
cp static-binaries/lspci $INITRD_TREE/sbin
|
150 |
cp static-binaries/pcitable $INITRD_TREE/bin
|
146 |
cp static-binaries/pcitable $INITRD_TREE/bin
|
151 |
|
147 |
|
152 |
# rev for unionfs (of aufs)
|
148 |
# rev needed for unionctl of aufs
|
- |
|
149 |
if [ "$UNIONFS_TYPE" = "aufs" ]; then
|
153 |
cp static-binaries/rev $INITRD_TREE/bin
|
150 |
cp static-binaries/rev $INITRD_TREE/bin
|
154 |
|
151 |
fi
|
155 |
|
152 |
|
156 |
LMK="lib/modules/$KERNEL"
|
153 |
LMK="lib/modules/$KERNEL"
|
157 |
|
154 |
|
158 |
#necessary modules and dependency files
|
155 |
# necessary modules and dependency files
|
159 |
mkdir -p $INITRD_TREE/$LMK/kernel/fs
|
156 |
mkdir -p $INITRD_TREE/$LMK/kernel/fs
|
160 |
cp kernel-modules/${KERNEL}_$ARCH/unionfs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
157 |
cp kernel-modules/${KERNEL}_$ARCH/unionfs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
161 |
cp kernel-modules/${KERNEL}_$ARCH/aufs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
158 |
cp kernel-modules/${KERNEL}_$ARCH/aufs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
162 |
cp kernel-modules/${KERNEL}_$ARCH/squashfs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
159 |
cp kernel-modules/${KERNEL}_$ARCH/squashfs.ko.gz $INITRD_TREE/$LMK/kernel/fs 2>/dev/null
|
163 |
rcopy_ex /$LMK/kernel/fs/unionfs $INITRD_TREE 2>/dev/null
|
160 |
rcopy_ex /$LMK/kernel/fs/unionfs $INITRD_TREE 2>/dev/null
|
164 |
rcopy_ex /$LMK/kernel/fs/aufs $INITRD_TREE 2>/dev/null
|
161 |
rcopy_ex /$LMK/kernel/fs/aufs $INITRD_TREE 2>/dev/null
|
165 |
rcopy_ex /$LMK/kernel/fs/squashfs $INITRD_TREE 2>/dev/null
|
162 |
rcopy_ex /$LMK/kernel/fs/squashfs $INITRD_TREE 2>/dev/null
|
166 |
|
163 |
|
167 |
#copy filesystem modules, if not directly copied into kernel
|
164 |
# copy filesystem modules, if not directly copied into kernel
|
168 |
rcopy_ex /$LMK/kernel/lib/zlib_inflate $INITRD_TREE 2>/dev/null
|
165 |
rcopy_ex /$LMK/kernel/lib/zlib_inflate $INITRD_TREE 2>/dev/null
|
169 |
rcopy_ex /$LMK/kernel/drivers/block/loop* $INITRD_TREE 2>/dev/null
|
166 |
rcopy_ex /$LMK/kernel/drivers/block/loop* $INITRD_TREE 2>/dev/null
|
170 |
|
167 |
|
171 |
rcopy_ex /$LMK/kernel/fs/isofs $INITRD_TREE 2>/dev/null
|
168 |
rcopy_ex /$LMK/kernel/fs/isofs $INITRD_TREE 2>/dev/null
|
172 |
rcopy_ex /$LMK/kernel/fs/fat $INITRD_TREE 2>/dev/null
|
169 |
rcopy_ex /$LMK/kernel/fs/fat $INITRD_TREE 2>/dev/null
|
Line 215... |
Line 212... |
215 |
rcopy_ex /$LMK/kernel/drivers/usb/host/uhci-hcd* $INITRD_TREE 2>/dev/null
|
212 |
rcopy_ex /$LMK/kernel/drivers/usb/host/uhci-hcd* $INITRD_TREE 2>/dev/null
|
216 |
rcopy_ex /$LMK/kernel/drivers/scsi/scsi_mod.ko $INITRD_TREE 2>/dev/null
|
213 |
rcopy_ex /$LMK/kernel/drivers/scsi/scsi_mod.ko $INITRD_TREE 2>/dev/null
|
217 |
rcopy_ex /$LMK/kernel/drivers/scsi/sd_mod.ko $INITRD_TREE 2>/dev/null
|
214 |
rcopy_ex /$LMK/kernel/drivers/scsi/sd_mod.ko $INITRD_TREE 2>/dev/null
|
218 |
rcopy_ex /$LMK/kernel/drivers/scsi/sr_mod.ko $INITRD_TREE 2>/dev/null
|
215 |
rcopy_ex /$LMK/kernel/drivers/scsi/sr_mod.ko $INITRD_TREE 2>/dev/null
|
219 |
|
216 |
|
220 |
#disk (scsi, ide, raid, pcmcia) modules
|
217 |
# disk (scsi, ide, raid, pcmcia) modules
|
221 |
#rcopy_ex /$LMK/kernel/drivers/scsi $INITRD_TREE
|
218 |
#rcopy_ex /$LMK/kernel/drivers/scsi $INITRD_TREE
|
222 |
#rcopy_ex /$LMK/kernel/drivers/ide $INITRD_TREE
|
219 |
#rcopy_ex /$LMK/kernel/drivers/ide $INITRD_TREE
|
223 |
#rcopy_ex /$LMK/kernel/drivers/pcmcia $INITRD_TREE
|
220 |
#rcopy_ex /$LMK/kernel/drivers/pcmcia $INITRD_TREE
|
224 |
|
221 |
|
225 |
#disk sata (some sata modules)
|
222 |
# disk sata (some sata modules)
|
226 |
rcopy_ex /$LMK/kernel/drivers/scsi/libata.ko $INITRD_TREE 2>/dev/null
|
223 |
rcopy_ex /$LMK/kernel/drivers/scsi/libata.ko $INITRD_TREE 2>/dev/null
|
227 |
rcopy_ex /$LMK/kernel/drivers/scsi/ata_piix.ko $INITRD_TREE 2>/dev/null
|
224 |
rcopy_ex /$LMK/kernel/drivers/scsi/ata_piix.ko $INITRD_TREE 2>/dev/null
|
228 |
rcopy_ex /$LMK/kernel/drivers/scsi/ahci.ko $INITRD_TREE 2>/dev/null
|
225 |
rcopy_ex /$LMK/kernel/drivers/scsi/ahci.ko $INITRD_TREE 2>/dev/null
|
229 |
|
226 |
|
230 |
|
227 |
|