Kaydet (Commit) cbec120b authored tarafından Your Name's avatar Your Name

systemd-udev support added

üst 31134ec5
......@@ -26,9 +26,9 @@ copy_binary(){
install $i ${WORKDIR}/lib/$lib || true
done
msg "Install" "$(which $bins)"
install $(which $bins) ${WORKDIR}/xbin/$bins
install $(which $bins) ${WORKDIR}/xbin/$(basename $bins)
else
inf "Not found" "$bins"
warn "Not found" "$bins"
fi
done
}
......@@ -17,7 +17,10 @@ if [ "$skipglibc" != "true" ] && [ "$skipudev" != "true" ] ; then
done
touch ${WORKDIR}/etc/modprobe.d/modprobe.conf
#copy binaries
copy_binary udevadm udevd tmpfiles
copy_binary udevadm udevd tmpfiles /lib/systemd/systemd-udevd
if [ -f ${WORKDIR}/xbin/systemd-udevd ] && [ ! -f ${WORKDIR}/xbin/udevd ] ; then
ln -s systemd-udevd ${WORKDIR}/xbin/udevd
fi
else
warn "udev will not install"
fi
if [ "$debug" == "true" ] ; then
copy_binary nano ldd strace
ln -s /busybox ${WORKDIR}/xbin/bash
fi
echo "/busybox ash" > ${WORKDIR}/autorun/00-pause.sh
\ No newline at end of file
......@@ -3,7 +3,6 @@ if [ -f "/lib/initrd/busybox" ] ; then
else
bb="$(which busybox)"
fi
msg "$bb"
if [ -f "$bb" ] ; then
set +e
bbdyn=$(LANG="C" ldd $bb | grep "not a dynamic executable")
......
......@@ -60,7 +60,19 @@ parse_args(){
generate_workdir(){
msg "Creating workdir" "$WORKDIR"
rm -f $WORKDIR
mkdir -p $WORKDIR
mkdir -p $WORKDIR/autorun
mkdir -p $WORKDIR/lib
# Debian support (multiarch not supported)
ln -s lib $WORKDIR/lib23
ln -s lib $WORKDIR/lib64
ln -s ../ $WORKDIR/lib/$(uname -m)-linux-gnu
# create fake /usr directory
mkdir -p $WORKDIR/usr
ln -s ../lib $WORKDIR/usr/lib
ln -s ../lib $WORKDIR/usr/lib32
ln -s ../lib $WORKDIR/usr/lib64
ln -s ../bin $WORKDIR/usr/bin
ln -s ../xbin $WORKDIR/usr/xbin
cp -prf $src/scripts $WORKDIR/scripts
for file in functions vars common init
do
......
......@@ -4,5 +4,4 @@ msg "Starting" "GNU/Linux"
if [ ! -n $quiet ] ; then
exec >/dev/null
exec 2>/dev/null
fi
fi
\ No newline at end of file
inf "Starting" "dmesg"
/busybox dmesg -n 1 || true
[ -n $debug ] || dmesg -w &
\ No newline at end of file
......@@ -2,24 +2,34 @@
msg "Loading filesystem drivers"
ls /lib/modules/*/fs/ | sed "s/^/modprobe /g" | sed "s/$/ &/g" > /fs
sh /fs &>/dev/null
msg "Loading crypto drivers"
ls /lib/modules/*/crypto/ | sed "s/^/modprobe /g" | sed "s/$/ &/g" > /crypto
sh /crypto &>/dev/null
load_modules(){
debug "Listing kernel modules"
cd /lib/modules/*
find crypto lib block ata md firewire scsi \
message pcmcia virtio host storage \
-type f 2> /dev/null | sed "s/.*\///g" | grep "\.ko" | sed "s/.ko.*/ &/g" | sed "s/^/modprobe /g"> /load_modules.sh
msg "Trying to load kernel modules"
sh /load_modules.sh &>/dev/null
}
if [ -x /xbin/udevd -a -x /xbin/udevadm ] && [ "$noudev" != "true" ]; then
msg "Triggering udev"
mdev -s
{
/xbin/udevd --daemon
/xbin/udevadm trigger --action=add --type=subsystems
/xbin/udevadm trigger --action=add --type=devices
/xbin/udevadm trigger --action=change --type=devices
/xbin/udevadm settle
} || load_modules
vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1
vgchange --sysinit --activate y >/dev/null 2>&1
else
warn "Eudev not found or disabled"
debug "Listing kernel modules"
cd /lib/modules/*
find crypto lib block ata md firewire scsi \
message pcmcia virtio host storage \
-type f 2> /dev/null | sed "s/.*\///g" | grep "\.ko" | sed "s/.ko.*/ &/g" | sed "s/^/modprobe /g"> /load_modules.sh
msg "Trying to load kernel modules"
sh /load_modules.sh &>/dev/null
fi
load_modules
fi
\ No newline at end of file
......@@ -4,7 +4,11 @@ if [ -f /xbin/fsck ] ; then
inf "Running" "fsck"
touch /etc/mtab
touch /etc/fstab
/xbin/fsck.$rootfstype "$root" &>/dev/null
if [ "${fsck_force}" == "true" ] ; then
/xbin/fsck "$root" -y -f &>/dev/null
else
/xbin/fsck "$root" -y &>/dev/null
fi
else
warn "fsck not found"
fi
......@@ -152,7 +152,6 @@ msg "Waiting for $device"
umount -lf $tmp
}
if [ "$boot" == "live" ]; then
live_boot || fallback_shell
msg "Booting from live-media" "($root)"
......
......@@ -13,8 +13,6 @@ if [ -f /rootfs/$subdir/etc/initrd.local ]; then
inf "Running local initrd scripts"
. /rootfs/$subdir/etc/initrd.local || true
fi
msg "Checking init"
[ -f "/rootfs/$subdir/$init" ] || fallback_shell
debug "Switching root"
exec env -i \
"TERM=$TERM" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment