1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
#!/bin/bash
#
# Description: universal (distro independent) generator for initial
# ramdisks for linux diskless clients
#
# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006
# Nico Dietrich
# Felix Endres
#
# Version: 0.4.0a
#
# Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg
# debug level of script itself
DEBUG=1
# debug level of the initramfs (to trigger the addition of specific
# binaries and kernel modules)
IRFSDEBUG=1
COMETCEXCL="XF86Config*\nissue*\nmtab*\nfstab*\n"
COMDIRINDXS="/tmp/scratch /var/lib/nobody"
# distro specific settings read from configuration file
# D_SYSCONFDIR - system wide configuration settings in /etc - sysconfig in
# SuSE and RedHat, default in Debian and Ubuntu, conf.d in Gentoo
# D_ETCEXCL - list of files, wildcards to be excluded from /etc when using
# bind mounts
# D_DIRINBINDMNT - lists of directories to be created in bind mounted rw
# part of the client filesystem
# D_RODIRSINRW - ReadOnly Directories in RW part of filesystem to save on
# TempFS usage
# D_DIRINDXS - directories in client filesystem which should be present
# anyhow
# D_BINDMNT - any code which is specific in bind mount environment
# D_RCDIRS - runlevel directories relative to /etc
# D_HWMODTOIGNORE -
D_SYSCONFDIR="<set in ~/distro-config/distro file>"
D_ETCEXCL="<set in ~/distro-config/distro file>"
D_BINDMPTS="<set in ~/distro-config/distro file>"
D_DIRINBINDMNT="<set in ~/distro-config/distro file>"
D_RODIRSINRW="<set in ~/distro-config/distro file>"
D_DIRINDXS="<set in ~/distro-config/distro file>"
D_BINDMNT="<set in ~/distro-config/distro file>"
D_INITDIR="<set in ~/distro-config/distro file>"
D_INITBOOTD="<set in ~/distro-config/distro file>"
D_RCDIRS="<set in ~/distro-config/distro file>"
D_RCDIRSINRW="<set in ~/distro-config/distro file>"
D_INITSCRIPTS="<set in ~/distro-config/distro file>"
D_XF86CONFFILE="<set in ~/distro-config/distro file>"
D_XFONTPATH="<set in ~/distro-config/distro file>"
D_DEFAULTCOUNTRY="<set in ~/distro-config/distro file>"
#########################################################################
# End of global variable declaration, nothing needed to be changed at
# default below that line
usage()
{
echo -e "mkdxsinitrd [-gh] [-k Kernelversion] [-i Pfad] [-f Module] [-n Module] [-r Pfad] [-s Bildgröße]\n"
echo "OPTIONEN"
echo " -g Benutze glibc als Basisbibliothek in der ramdisk."
echo " -h Zeige Informationen zur Benutzung."
echo " -k Kernelversion"
echo " mkdxsinitrd versucht die aktuellste Kernelversion zu finden."
echo " Falls dies nicht klappt, oder eine andere Kernelversion"
echo " gewünscht ist kann diese hier angegeben werden (funktioniert"
echo " natürlich nur für auf dem Hostsystem vorhandene Kernelversion"
echo " nen)."
echo " -i path/file"
echo " Optionale Angabe wo die erstellte ramdisk hingeschrieben werden"
echo " soll."
echo " -f Modulliste"
echo " Kernelmodule die benutzt werden sollen um das Rootfilesystem"
echo " über das dem Netzwerk zu mounten (z.B. nfs, nbd dnbd)."
echo " -n Modulliste"
echo " Kernelmodule zum Betrieb der Clientnetzwerkkarten (z.B. e100 tg3"
echo " via-rhine)."
echo " -r path"
echo " Pfad zum Wurzelverzeichnis des zu exportierenden Betriebsystems"
echo " (z.B. /export/10.1)."
echo " -s screensize (for splash)"
echo " -d debug (add special modules to initramfs)"
echo " -D Name"
echo " Name der Distribution der Betriebsystemvorlage"
echo " -v Version"
echo " Versionskennung der Distribution der Betriebsystemvorlage"
exit 0
}
# replaces which to find executables inside ROOTDIR
binfinder()
{
local PROGRAM="$1"
local RET=1
for ELEMENT in bin sbin usr/bin usr/sbin usr/local/bin usr/bin/X11; do
if [ -f "${ROOTDIR}/$ELEMENT/$PROGRAM" ] && \
[ -x "${ROOTDIR}/$ELEMENT/$PROGRAM" ]; then
printf '%s\n' "${ROOTDIR}/$ELEMENT/$PROGRAM"
RET=0
break
fi
done
return "$RET"
}
# copy some binary to given destination. Takes binary in $1 and
# destination in $2
cobi()
{
local DEST=$2
local FPTB=`binfinder $1`
if [ -z ${FPTB} ] ; then
return 1;
elif [ -L ${FPTB} ] ; then
# do not copy the link but the binary the link points to
local LINKDEST=`ls -la ${FPTB} | sed -e "s,.* ,,"`
case $LINKDEST in
/*) FPTB=${ROOTDIR}${LINKDEST}
;;
*) ;;
esac
cp ${FPTB} ${INSTDIR}/${DEST}
else
cp ${FPTB} ${INSTDIR}/${DEST}
fi
# get an idea which libraries are needed
chroot ${ROOTDIR} ldd ${FPTB#${ROOTDIR}*} >> ${INSTDIR}/tmp/libraries
}
# replace copy
repco()
{
local FILENAME=$1
DATE=`date +%m-%d-%Y`
# do not forget to define all variables which should be replaced within
# the start and configuration scripts. All comment lines will be deleted.
if [ -d initrd-stuff/${FILENAME} ] ; then
[ -d ${INSTDIR}/${FILENAME} ] || mkdir -p ${INSTDIR}/${FILENAME}
else
if file initrd-stuff/${FILENAME}| grep "ELF" &>/dev/null ; then
cp initrd-stuff/${FILENAME} ${INSTDIR}/${FILENAME}
elif [ -L initrd-stuff/${FILENAME} ] ; then
cp -a initrd-stuff/${FILENAME} ${INSTDIR}/${FILENAME%/*}
else
sed -e "s,@@@INSTDIR@@@,${INSTDIR},g;s,@@@KERNVER@@@,${KERNVER},g" \
-e "s,@@@DISTRO@@@,${DISTRO},g;s,@@@NETIF@@@,${NET_IF},g" \
-e "s,@@@NWMODULES@@@,${NWMODULES},g" \
-e "s,@@@COMDIRINDXS@@@,${COMDIRINDXS},g" \
-e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \
-e "s,@@@DATE@@@,${DATE},g;/^#[^!].*/d" \
initrd-stuff/${FILENAME} >> ${INSTDIR}/${FILENAME}
fi
fi
}
# this function incrementally concats and copies distro-specific functions,
# configuration variables and files
copy_distro_stuff() {
# Konzept geaendert!!!
#Konzept der Konfiguration mittels
#functions-* und config-* zu veraendert: Es gibt eine Default-Konfig, die
#dann von der jeweiligen Version angepasst wird - Ketten von sowas wie
#config-9.3 wird von config-10.0 wird von config-10.1 ueberschrieben usw.
#soll durch einfaches config-default -> config-9.3, ... -> config-10.0
#... abgeloest werden. Das erlaubt langfristig auch dafuer zu sorgen, dass
#im config-def alles Wesentliche bezogen auf die aktuellsten Version drin
#ist.
# # first insert dependencies
# case $1 in
# suse)
# case $2 in
# 9.3)
# ;;
# 10.0)
# copy_distro_stuff suse 9.3
# ;;
# 10.1)
# copy_distro_stuff suse 10.0
# ;;
# esac
# ;;
# debian)
# ;;
# ubuntu)
# ;;
# gentoo)
# ;;
# esac
# copy first the default distro dependent configuration (variables) and
# function files, then append to each the distro/version specific file
# variables, functions set in default might that way be overwritten by
# definitions in distro/version specific files
cat distro-specs/$1/config-default >${INSTDIR}/etc/sysconfig/config
cat distro-specs/$1/config-$2 >>${INSTDIR}/etc/sysconfig/config
cat distro-specs/$1/functions-default >${INSTDIR}/etc/distro-functions
cat distro-specs/$1/functions-$2 >>${INSTDIR}/etc/distro-functions
# would be cool not to copy .svn here ...
# fixme!! works only for etc directories. If dir exists then next copy places
# file into the existing dir
cp -a distro-specs/$1/files-default ${INSTDIR}/etc/sysconfig/files 2>/dev/null
# ... so remove them afterwards ...
find ${INSTDIR}/etc/sysconfig/files \
-regex ".*/\..*" -exec rm -rf {} 2>/dev/null \;
}
# This function makes the directory of this script to the present working directory
# It is called within precheck()
# Does also work when called by symbolic links (even for nested links).
goto_script_dir()
{
[ $DEBUG -ge 2 ] && echo "Aufgerufen wurde $0, checking if it is a link"
calleddetails=`ls -l $0` # get the file flags (e.g. lrwxrwxrwx)
[ $DEBUG -ge 2 ] && echo $calleddetails
calleddir=${0%/*} # Strip the filename from path
[ $DEBUG -ge 2 ] && echo "Wechsele ins Verzeichnis des aufgerufenen scripts/links ($calleddir)"
cd $calleddir
while index=`expr index "$calleddetails" "l"`;
[ $index -eq 1 ]; do
[ $DEBUG -ge 2 ] && echo "It is a link"
target=`echo $calleddetails | awk '{print $NF}'`
[ $DEBUG -ge 2 ] && echo "The target of the link is: $target"
hasslash=`expr index "$target" "/"`
if [ $hasslash -ne 0 ]; then
targetpath=${target%/*} # extract the pathname
[ $DEBUG -ge 2 ] && echo "Following link to $targetpath"
cd $targetpath
else
[ $DEBUG -ge 2 ] && echo "It is in the same directory as the link"
fi
targetfile=`basename $target`
[ $DEBUG -ge 2 ] && echo "The target file of the link is: $targetfile"
calleddetails=`ls -l $targetfile` # get the file flags (e.g. lrwxrwxrwx)
[ $DEBUG -ge 2 ] && echo $calleddetails
done
[ $DEBUG -ge 2 ] && pwd
}
#########################################################################
# End of function declaration
while getopts :hgk:i:r:o:s:f:n:Sut:d:v:I:V:a: a ; do
case $a in
\:|\?)
case $OPTARG in
k) echo "-k requires kernel version parameter";;
i) echo "-i requires initrd path parameter";;
f) echo "-f requires file system module list parameter";;
n) echo "-n requires network module list parameter";;
r) echo "-r requires root dir parameter";;
s) echo "-s requires image size(s)";;
t) echo "-t requires tmp dir parameter";;
d) echo "-d requires debug level (integer)";;
D) echo "-D requires linux Distribution name";;
v) echo "-v requires linux distribution version";;
I) echo "-I requires network interface parameter";;
V) echo "-V requires an executable to run inside linuxrc";;
*) echo "Unknown option: -$OPTARG"
echo "Try mkinitrd -h";;
esac
exit 1
;;
g) use_glibc=1;;
k) KERNVER=$OPTARG;;
i) INITRD_PATH=$OPTARG ;;
f) FSMODULES=$OPTARG;;
n) NWMODULES=$OPTARG ;;
r) ROOTDIR=$OPTARG;;
s) SPLASH=$OPTARG;;
t) INSTDIR=$OPTARG;;
d) IRFSDEBUG=$OPTARG;;
D) DISTRO=$OPTARG;;
v) DISTRO_VER=$OPTARG;;
I) NET_IF=$OPTARG;; # Not in use
a) acpi_dsdt="$OPTARG";; # Not in use
S) use_selinux=1;; # Not in use
l) local_init_script="$OPTARG";; # Not in use
u) sysfs_root=1 # Not in use
use_udev=
;;
h) usage;;
esac
done
shift $(expr $OPTIND - 1)
#########################################################################
# End of parameter, argument interpretation
#Change to the directory this script is located in
goto_script_dir
if [ -z "$INSTDIR" ] ; then
INSTDIR=/tmp/dxs-instrd
fi
rm -rf ${INSTDIR}
mkdir -p ${INSTDIR}/{dev,proc,tmp,mnt,root,bin,sys,lib}
ln -s /bin ${INSTDIR}/sbin
mkdir -p ${INSTDIR}/usr/share
# needed for KNOPPIX hwsetup not to confuse with ${D_SYSCONFDIR}
mkdir -p ${INSTDIR}/etc/sysconfig
# if still no distro name set, try to find it using significant files
if [ -z "${DISTRO}" ] ; then
if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then
DISTRO=suse
DISTRO_VER=`grep "VERSION" ${ROOTDIR}/etc/SuSE-release | sed "s/.*= //"`
elif [ -e ${ROOTDIR}/etc/lsb-release ] ; then
. ${ROOTDIR}/etc/lsb-release
DISTRO=${DISTRIB_ID}
DISTRO_VER=${DISTRIB_RELEASE}
elif [ -e ${ROOTDIR}/etc/debian_version ] ; then
DISTRO=debian
DISTRO_VER=`cat ${ROOTDIR}/etc/debian_version`
elif [ -e ${ROOTDIR}/etc/gentoo-release ] ; then
DISTRO=gentoo
# any idea on the versioning scheme??
DISTRO_VER=""
else
echo -e "Could not detect client distribution type and version. Please \
specify\nas command line argument (-d <distro-name> -v <distro-version>)"
exit 1;
fi
fi
case "${DISTRO}" in
Debian*|debian*|Sarge*|sarge*)
DISTRO=debian
case "${DISTRO_VER}" in
Sarge*|sarge*|3.1*|*)
DISTRO_VER=3.1
mkdir -p ${INSTDIR}/lib/udev
cp -r ${ROOTDIR}/lib/udev/* ${INSTDIR}/lib/udev/
;;
esac
;;
Ubuntu*|ubuntu*)
DISTRO=ubuntu
case "${DISTRO_VER}" in
Breezy*|breezy*|*)
DISTRO_VER=5.10
cp ${ROOTDIR}/lib/libnss_compat.so.2 ${INSTDIR}/lib
;;
esac
;;
Gentoo*|gentoo*)
DISTRO=gentoo
case "${DISTRO_VER}" in
2005*|*)
DISTRO_VER=2005.1
;;
esac
;;
SuSE*|suse*|Suse*|SuSe*|SUSE*|*)
DISTRO=suse
case "${DISTRO_VER}" in
9*)
DISTRO_VER=9.3
# might be needed for older udev/hotplug
# cp -a ${ROOTDIR}/etc/hotplug* ${INSTDIR}/etc
;;
10.0)
DISTRO_VER=10.0
;;
10*)
DISTRO_VER=10.1
;;
esac
#cp -a /etc/sysconfig/{hardware,network} ${INSTDIR}/etc/sysconfig
;;
esac
# hotplug/udev style and stuff
cp -a ${ROOTDIR}/etc/udev ${INSTDIR}/etc
# an dieser stelle sollte jetzt sichergestellt sein, dass sowohl DISTRO als auch DISTRO_VER eindeutig gesetzt sind!
copy_distro_stuff ${DISTRO} ${DISTRO_VER}
# devices needed rather early (copied from /tmp to /dev in init)
mknod ${INSTDIR}/tmp/console c 5 1 &>/dev/null
mknod ${INSTDIR}/tmp/null c 1 3 &>/dev/null
mknod ${INSTDIR}/tmp/kmsg c 1 11 &>/dev/null
mknod ${INSTDIR}/tmp/ctl b 241 255 &>/dev/null
#if no klibc - klibc shell seems not to have enough functionality :-(
for bbins in bash ash sh; do
if cobi ${bbins} bin ; then
ln -fs ${bbins} ${INSTDIR}/bin/sh
[ "${bbins}" != "bash" ] && ln -fs ${bbins} ${INSTDIR}/bin/bash
break
else echo "Binary not found (${bbins})"; fi
done
# if no klibc
for bbins in ip ifconfig; do
if cobi ${bbins} bin ; then
[ "${bbins}" = "ifconfig" ] && cobi route bin
break
else echo "Binary not found"; fi
done
# needed standard binaries
for bbins in \
cat chmod chown chroot cp expr fdisk killall ln ls mkdir mkfs.ext2 \
modprobe mount portmap rmmod sed sort rm tar umount
do
cobi ${bbins} bin || echo "Program ${bbins} not found"
done
# one of the dhcp clients
for dhcp in dhclient dhcpcd pump ipconfig ; do
binfinder $dhcp && break;
done
cobi $dhcp bin
mkdir -p ${INSTDIR}/var/{lib,run}
# tftp client binary for configuration via file - get machine-setup per
# tftp from dhcp (or specified other) server
## irgendwann mal nur konditional ...
for tftp in atftp tftp ; do
binfinder $tftp && break
done
cobi $tftp bin
cp /lib/libnss_files.so.2 ${INSTDIR}/lib
# debug binaries
if [ $IRFSDEBUG -gt 2 ] ; then
for bbins in \
date lsmod lsof ps strace time
do
cobi ${bbins} bin || echo "Program ${bbins} not found"
done
fi
# style of hotplug/udev/dev (for etc directories see above!!)
for bbins in udev udevd udevstart udevtrigger udevsend
do
cobi ${bbins} bin &>/dev/null || echo "Program ${bbins} not found"
done
# if nfs
mkdir -p ${INSTDIR}/var/lib/nfs/state
# if nbd or dnbd
if [ -n "${FSMODULES}" ] ; then
for i in ${FSMODULES}; do
case "$i" in
dnbd)
cobi dnbd-client bin
;;
nbd)
cobi nbd-client bin
;;
esac
done
fi
# if unionfs
cobi unionctl bin &>/dev/null || echo "Program unionctl not found"
# if cowloop
cobi cowdev bin &>/dev/null || echo "Program cowdev not found"
# distro specific additional stuff
case "${DISTRO}" in
debian*)
cp ${ROOTDIR}/lib/libnss_compat.so.2 ${INSTDIR}/lib;;
esac
# add needed libraries depending on choosen binaries. use chroot
# on ldd, otherwise the detection does not work properly. ldd has to be
# static linked binary
for lib in `cat ${INSTDIR}/tmp/libraries 2>/dev/null | \
sed -e "s,tls,,;s,i686/cmov,," \
-ne 's:\t\(.* => \)\?\(/.*\) (0x[0-9a-f]*):\2:p' | sort -u` ; do
baselib=`basename ${lib}`
test -e ${INSTDIR}/lib/${baselib} || \
cp /${ROOTDIR}/${lib} ${INSTDIR}/lib
done
rm ${INSTDIR}/tmp/libraries
# add kernel modules and dependency files
if [ -z "$KERNVER" ] ; then
KERNVER=`ls -l ${ROOTDIR}/boot/vmlinuz | grep vmlinuz | sed "s/.*vmlinuz-//"`
fi
if [ -z "$KERNVER" ] ; then
KERNVER=`ls -l ${ROOTDIR}/vmlinuz | grep vmlinuz | sed "s/.*vmlinuz-//"`
fi
# if no vmlinuz found, go for vmlinuz-x.yz.uv...
if [ -z "$KERNVER" ] ; then
KERNVER=`ls -lt ${ROOTDIR}/boot/vmlinuz* | grep vmlinuz | sed -n "1,1s/.*vmlinuz-//p"`
echo "No vmlinuz-link found. Using kernel version "$KERNVER
fi
if [ -z "$KERNVER" ] ; then
echo "No kernel version set or detected - please use the -k flag! Exiting..."
exit 1
fi
if [ -z "$NWMODULES" ] ; then
NWMODULES="forcedeth e1000 e100 tg3 via-rhine r8169 pcnet32"
fi
if [ -z "$FSMODULES" ] ; then
FSMODULES="nbd nfs"
fi
if [ -z "$INITRD_PATH" ] ; then
INITRD_PATH="${ROOTDIR}/tmp/dxsinitrd.gz"
fi
# define modules to put into initial ramdisk for debugging
#DEBUGMODULES="uhci_hcd usbhid"
if [ $IRFSDEBUG -gt 1 ] ; then
DEBUGMODULES="uhci-hcd ohci-hcd usbhid"
else
DEBUGMODULES=""
fi
# put all needed modules into initial ramdisk
mkdir -p ${INSTDIR}/lib/modules/${KERNVER}
for module in af_packet unix ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do
mod=`cd /${ROOTDIR}; find "lib/modules/${KERNVER}" -name ${module}.ko \
2>/dev/null`
if [ -n "$mod" ] ; then
mpath=${INSTDIR}/${mod%/*}
mkdir -p ${mpath}
cp ${ROOTDIR}/$mod ${mpath}
# fixmee!! selection of dependent modules could be handled a little bit
# more clever
rdirprefix="${ROOTDIR}/lib/modules/${KERNVER}/kernel"
ddirprefix="${INSTDIR}/lib/modules/${KERNVER}/kernel"
case "$module" in
e100|8139too|via-rhine|sis900|epic100|sundance|8139cp|eepro100|pcnet32)
cp ${rdirprefix}/drivers/net/mii.ko \
${ddirprefix}/drivers/net &>/dev/null
;;
nfs)
# create directory structure for modules needed and copy them
# to the proper place (as expected by modprobe/modules.dep)
mkdir -p ${ddirprefix}/net/sunrpc
mkdir -p ${ddirprefix}/fs/lockd ${ddirprefix}/fs/nfs_common
cp ${rdirprefix}/net/sunrpc/sunrpc.ko \
${ddirprefix}/net/sunrpc &>/dev/null
cp ${rdirprefix}/fs/lockd/lockd.ko \
${ddirprefix}/fs/lockd &>/dev/null
cp ${rdirprefix}/fs/nfs_common/nfs_acl.ko \
${ddirprefix}/fs/nfs_common &>/dev/null
;;
ext3)
mkdir -p ${ddirprefix}/fs/jbd
cp ${rdirprefix}/fs/jbd/jbd.ko \
${ddirprefix}/fs/jbd
;;
esac
fi
done
cp ${ROOTDIR}/lib/modules/${KERNVER}/modules.* \
${INSTDIR}/lib/modules/${KERNVER}
# initial ramdisk scripts: init, functions, servconfig, hwautocfg, ...
# copy and replace variable names
for dirs in `find initrd-stuff/* ! -regex ".*/\..*"` ; do
repco ${dirs##initrd-stuff/}
done
chmod 755 ${INSTDIR}/init \
${INSTDIR}/bin/{servconfig,hwautocfg,screenres,dhcpmkconfig}
# add the common client configuration file
if [ -f /etc/dxs/client.cfg/machine-setup.default ] ; then
cp /etc/dxs/client.cfg/machine-setup.default \
${INSTDIR}/etc/machine-setup
# fixme: dirty hack if the installer does not creates a normal file
elif [ -f /etc/dxs/client.cfg/machine-setup.default.new ] ; then
cp /etc/dxs/client.cfg/machine-setup.default.new \
${INSTDIR}/etc/machine-setup
elif [ -f ../installer/default_files/machine-setup.default ] ; then
cp ../installer/default_files/machine-setup.default \
${INSTDIR}/etc/machine-setup
else
#inserted password for root for debugging purposes
echo -e "# default for machine-setup does not exist\n# root logins are \
disabled\nroot_pw='"'$1$T7VD/mmQ$aCP1WEaWplEsHe9khv4kK.'"'" \
> ${INSTDIR}/etc/machine-setup
fi
# custom init script for normal client start after initramfs
# fixme: should be handled the same way as user-supplied init scripts
if [ -f /etc/dxs/client.cfg/boot.local.default ] ; then
cp /etc/dxs/client.cfg/boot.local.default ${INSTDIR}/etc/boot.local
fi
# finally copy user-supplied preinit and postinit files
# fixme: where are these files coming from??
#for i in vendor_preinit vendor_postinit ; do
# if [ -f /etc/dxs/init.local/"${i}" ] ; then
# cp /etc/dxs/init.local/"$i" ${INSTDIR}/bin/"$i"
# fi
#done
#########################################################################
# End of file copy procedures
# finally create the compressed initial ramdisk cpio archive
pushd . > /dev/null 2>&1
cd ${INSTDIR}
find . ! -name "*~" | cpio -H newc --create | gzip -9 > $INITRD_PATH
popd > /dev/null 2>&1
|