|
Line
Link Here
|
| 0 |
-- a/mkinitrd |
0 |
++ b/mkinitrd |
|
Lines 1148-1155
Link Here
|
| 1148 |
(cd ${root_dir:-/} ; cp -R --parents $initrd_devices $tmp_mnt ) |
1148 |
(cd ${root_dir:-/} ; cp -R --parents $initrd_devices $tmp_mnt ) |
| 1149 |
else |
1149 |
else |
| 1150 |
mkdir -p $tmp_mnt/{tmp,root,lib/klibc/dev} |
1150 |
mkdir -p $tmp_mnt/{tmp,root,lib/klibc/dev} |
|
|
1151 |
mknod $tmp_mnt/dev/console c 5 1 |
| 1152 |
mknod $tmp_mnt/dev/null c 1 3 |
| 1153 |
mknod $tmp_mnt/dev/kmsg c 1 11 |
| 1151 |
mknod $tmp_mnt/lib/klibc/dev/console c 5 1 |
1154 |
mknod $tmp_mnt/lib/klibc/dev/console c 5 1 |
| 1152 |
mknod $tmp_mnt/lib/klibc/dev/null c 1 3 |
1155 |
mknod $tmp_mnt/lib/klibc/dev/null c 1 3 |
|
|
1156 |
mknod $tmp_mnt/lib/klibc/dev/kmsg c 1 11 |
| 1153 |
fi |
1157 |
fi |
| 1154 |
|
1158 |
|
| 1155 |
mkdir -p $tmp_mnt${initrd_shell%/*} |
1159 |
mkdir -p $tmp_mnt${initrd_shell%/*} |
|
Lines 1230-1237
Link Here
|
| 1230 |
fi |
1234 |
fi |
| 1231 |
done |
1235 |
done |
| 1232 |
mkdir -p $tmp_mnt/lib/klibc/sbin |
1236 |
mkdir -p $tmp_mnt/lib/klibc/sbin |
| 1233 |
for klibc_bin in ata_id scsi_id usb_id \ |
1237 |
for klibc_bin in ata_id scsi_id usb_id vol_id dasd_id; do |
| 1234 |
vol_id; do |
|
|
| 1235 |
cp_bin /lib/klibc/sbin/$klibc_bin \ |
1238 |
cp_bin /lib/klibc/sbin/$klibc_bin \ |
| 1236 |
$tmp_mnt/lib/klibc/sbin |
1239 |
$tmp_mnt/lib/klibc/sbin |
| 1237 |
if [ ! -e $tmp_mnt/sbin/$klibc_bin ]; then |
1240 |
if [ ! -e $tmp_mnt/sbin/$klibc_bin ]; then |
|
Lines 1266-1273
Link Here
|
| 1266 |
cp_bin /usr/share/mkinitrd/hotplug.sh $tmp_mnt/sbin/hotplug.sh |
1269 |
cp_bin /usr/share/mkinitrd/hotplug.sh $tmp_mnt/sbin/hotplug.sh |
| 1267 |
fi |
1270 |
fi |
| 1268 |
|
1271 |
|
| 1269 |
# all dev nodes belong to root, according to udev.permissions |
1272 |
# all dev nodes belong to root, but some may be |
| 1270 |
# but some may be owned by a group other than root |
1273 |
# owned by a group other than root |
| 1271 |
# getent passwd | sed '/^root:/s/^\([^:]\+\):[^:]*:\([^:]\+\):\([^:]\+\):.*/\1::\2:\3:::/p;d' > $tmp_mnt/etc/passwd |
1274 |
# getent passwd | sed '/^root:/s/^\([^:]\+\):[^:]*:\([^:]\+\):\([^:]\+\):.*/\1::\2:\3:::/p;d' > $tmp_mnt/etc/passwd |
| 1272 |
echo 'root::0:0:::' > $tmp_mnt/etc/passwd |
1275 |
echo 'root::0:0:::' > $tmp_mnt/etc/passwd |
| 1273 |
getent group | sed 's/^\([^:]\+\):[^:]*:\([^:]\+\):.*/\1::\2:/' > $tmp_mnt/etc/group |
1276 |
getent group | sed 's/^\([^:]\+\):[^:]*:\([^:]\+\):.*/\1::\2:/' > $tmp_mnt/etc/group |
|
Lines 1353-1369
Link Here
|
| 1353 |
|
1356 |
|
| 1354 |
fi |
1357 |
fi |
| 1355 |
cp_bin /sbin/path_id $tmp_mnt/sbin |
1358 |
cp_bin /sbin/path_id $tmp_mnt/sbin |
| 1356 |
cp_bin /sbin/udev.*.sh $tmp_mnt/sbin |
1359 |
for udev_script in /sbin/udev.*.sh; do |
|
|
1360 |
# we don't have bash in initramfs |
| 1361 |
if grep -q /bin/bash $udev_script; then |
| 1362 |
continue |
| 1363 |
fi |
| 1364 |
cp_bin $udev_script $tmp_mnt/sbin |
| 1365 |
done |
| 1357 |
mkdir -p $tmp_mnt/etc/udev/rules.d |
1366 |
mkdir -p $tmp_mnt/etc/udev/rules.d |
| 1358 |
# Create our own udev.conf |
1367 |
# Create our own udev.conf |
| 1359 |
echo "udev_root=\"/dev\"" > $tmp_mnt/etc/udev/udev.conf |
1368 |
echo "udev_root=\"/dev\"" > $tmp_mnt/etc/udev/udev.conf |
| 1360 |
echo "udev_db=\"/dev/.udevdb\"" >> $tmp_mnt/etc/udev/udev.conf |
1369 |
echo "udev_db=\"/dev/.udevdb\"" >> $tmp_mnt/etc/udev/udev.conf |
| 1361 |
echo "udev_rules=\"/etc/udev/rules.d\"" >> $tmp_mnt/etc/udev/udev.conf |
1370 |
echo "udev_rules=\"/etc/udev/rules.d\"" >> $tmp_mnt/etc/udev/udev.conf |
| 1362 |
cp /etc/udev/rules.d/* $tmp_mnt/etc/udev/rules.d |
1371 |
cp /etc/udev/rules.d/*.rules $tmp_mnt/etc/udev/rules.d |
| 1363 |
# comment out binaries not available in initrd |
|
|
| 1364 |
for file in $tmp_mnt/etc/udev/rules.d/*; do |
| 1365 |
sed 's@\(.*/usr/.*\)@#(mkinitrd) \1@g' -i $file |
| 1366 |
done |
| 1367 |
fi |
1372 |
fi |
| 1368 |
|
1373 |
|
| 1369 |
if [ "$mkinit_type" = "ramfs" ] ; then |
1374 |
if [ "$mkinit_type" = "ramfs" ] ; then |
|
Lines 1525-1530
Link Here
|
| 1525 |
fi |
1530 |
fi |
| 1526 |
fi |
1531 |
fi |
| 1527 |
|
1532 |
|
|
|
1533 |
if [ -n "$use_udev" ] ; then |
| 1534 |
# comment out rules with tools not available in initramfs |
| 1535 |
for tool in $(sed 's:.*"\(/.*bin/[^ "]*\).*:\1:' /etc/udev/rules.d/*.rules | grep '^/.*bin/' | sort -u); do |
| 1536 |
if [ -x "$tmp_mnt$tool" ]; then |
| 1537 |
# tool exists, keep the rule |
| 1538 |
continue |
| 1539 |
fi |
| 1540 |
# comment out all rules using this tool |
| 1541 |
for file in $tmp_mnt/etc/udev/rules.d/*.rules; do |
| 1542 |
sed "s@\(.*$tool.*\)@#(mkinitrd) \1@" -i $file |
| 1543 |
done; |
| 1544 |
done |
| 1545 |
fi |
| 1546 |
|
| 1528 |
cat /dev/null > $linuxrc |
1547 |
cat /dev/null > $linuxrc |
| 1529 |
chmod 755 $linuxrc |
1548 |
chmod 755 $linuxrc |
| 1530 |
|
1549 |
|