File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/local-top.zip
Back
PK �P�Z%�4� � lvm2nu ȯ�� #!/bin/sh PREREQ="mdadm mdrun multipath" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac if [ ! -e /sbin/lvm ]; then exit 0 fi lvchange_activate() { lvm lvchange -aay -y --sysinit --ignoreskippedcluster "$@" } activate() { local dev="$1" # Make sure that we have a non-empty argument if [ -z "$dev" ]; then return 1 fi case "$dev" in # Take care of lilo boot arg, risky activating of all vg fe[0-9]*) lvchange_activate exit 0 ;; # FIXME: check major /dev/root) lvchange_activate exit 0 ;; /dev/mapper/*) eval $(dmsetup splitname --nameprefixes --noheadings --rows "${dev#/dev/mapper/}") if [ "$DM_VG_NAME" ] && [ "$DM_LV_NAME" ]; then lvchange_activate "$DM_VG_NAME/$DM_LV_NAME" fi ;; /dev/*/*) # Could be /dev/VG/LV; use lvs to check if lvm lvs -- "$dev" >/dev/null 2>&1; then lvchange_activate "$dev" fi ;; esac } activate "$ROOT" activate "$resume" exit 0 PK �P�Z���V�! �! cryptrootnu ȯ�� #!/bin/sh PREREQ="cryptroot-prepare" # # Standard initramfs preamble # prereqs() { # Make sure that cryptroot is run last in local-top local req for req in "${0%/*}"/*; do script="${req##*/}" if [ "$script" != "${0##*/}" ]; then printf '%s\n' "$script" fi done } case $1 in prereqs) prereqs exit 0 ;; esac . /scripts/functions [ -f /lib/cryptsetup/functions ] || return 0 . /lib/cryptsetup/functions # wait_for_source() # Wait for encrypted $CRYPTTAB_SOURCE . Set $CRYPTTAB_SOURCE # to its normalized device name when it shows up; # return 1 if timeout. wait_for_source() { wait_for_udev 10 if crypttab_resolve_source; then # the device is here already, no need to loop return 0 fi # If the source device hasn't shown up yet, give it a little while # to allow for asynchronous device discovery (e.g. USB). # # We also need to take into account RAID or other devices that may # only be available on local-block stage. So, wait 5 seconds upfront, # in local-top; if that fails, end execution relying on local-block # invocations. Allow $ROOTDELAY/4 invocations with 1s sleep times (with # a minimum of 20 invocations), and if after that we still fail, then it's # really time to give-up. Variable $initrd_cnt tracks the re-invocations. # # Part of the lines below has been taken from initramfs-tools # scripts/local's local_device_setup(), as suggested per # https://launchpad.net/bugs/164044 . local slumber=5 if [ "${CRYPTROOT_STAGE-}" = "local-block" ]; then slumber=1 fi cryptsetup_message "Waiting for encrypted source device $CRYPTTAB_SOURCE..." while [ $slumber -gt 0 ]; do sleep 1 if [ -x /scripts/local-block/lvm2 ]; then # activate any VG that might hold $CRYPTTAB_SOURCE /scripts/local-block/lvm2 "$CRYPTTAB_SOURCE" fi if crypttab_resolve_source; then wait_for_udev 10 return 0 fi slumber=$(( $slumber - 1 )) done return 1 } # setup_mapping() # Set up a crypttab(5) mapping defined by $CRYPTTAB_NAME, # $CRYPTTAB_SOURCE, $CRYPTTAB_KEY, $CRYPTTAB_OPTIONS. setup_mapping() { local dev initrd_cnt # We control here the number of re-invocations of this script from # local-block - the heuristic is $ROOTDELAY/4, with a minimum of 20. if [ -f "$CRYPTROOT_COUNT_FILE" ]; then initrd_cnt="$(cat <"$CRYPTROOT_COUNT_FILE")" else initrd_cnt="${ROOTDELAY:-180}" initrd_cnt=$(( initrd_cnt/4 )) if [ $initrd_cnt -lt 20 ]; then initrd_cnt=20 fi echo "$initrd_cnt" >"$CRYPTROOT_COUNT_FILE" fi # The same target can be specified multiple times # e.g. root and resume lvs-on-lvm-on-crypto if dm_blkdevname "$CRYPTTAB_NAME" >/dev/null; then return 0 fi crypttab_parse_options --export --missing-path=fail || return 1 if ! wait_for_source; then if [ $initrd_cnt -eq 0 ]; then # we've given up if [ -n "$panic" ]; then panic "ALERT! encrypted source device $CRYPTTAB_SOURCE does not exist, can't unlock $CRYPTTAB_NAME." else # let the user fix matters if they can echo " ALERT! encrypted source device $CRYPTTAB_SOURCE does not exist, can't unlock $CRYPTTAB_NAME." echo " Check cryptopts=source= bootarg: cat /proc/cmdline" echo " or missing modules, devices: cat /proc/modules; ls /dev" panic "Dropping to a shell." fi return 1 # can't continue because environment is lost else initrd_cnt=$(( initrd_cnt - 1 )) echo "$initrd_cnt" >"$CRYPTROOT_COUNT_FILE" return 0 # allow some attempts on local-block stage fi fi # our `cryptroot-unlock` script searches for cryptsetup processes # with a given CRYPTTAB_NAME it their environment export CRYPTTAB_NAME if [ -z "${CRYPTTAB_OPTION_keyscript+x}" ]; then # no keyscript: interactive unlocking, or key file if [ "${CRYPTTAB_KEY#/FIXME-initramfs-rootmnt/}" != "$CRYPTTAB_KEY" ]; then # skip the mapping for now if the root FS is not mounted yet sed -rn 's/^\s*[^#[:blank:]]\S*\s+(\S+)\s.*/\1/p' /proc/mounts | grep -Fxq -- "$rootmnt" || return 1 # substitute the "/FIXME-initramfs-rootmnt/" prefix by the real root FS mountpoint otherwise CRYPTTAB_KEY="$rootmnt/${CRYPTTAB_KEY#/FIXME-initramfs-rootmnt/}" fi if [ "$CRYPTTAB_KEY" != "none" ]; then if [ ! -e "$CRYPTTAB_KEY" ]; then cryptsetup_message "ERROR: Skipping target $CRYPTTAB_NAME: non-existing key file $CRYPTTAB_KEY" return 1 fi # try only once if we have a key file CRYPTTAB_OPTION_tries=1 fi fi local count=0 maxtries="${CRYPTTAB_OPTION_tries:-3}" fstype vg rv while [ $maxtries -le 0 ] || [ $count -lt $maxtries ]; do if [ -z "${CRYPTTAB_OPTION_keyscript+x}" ] && [ "$CRYPTTAB_KEY" != "none" ]; then # unlock via keyfile unlock_mapping "$CRYPTTAB_KEY" else # unlock interactively or via keyscript run_keyscript "$count" | unlock_mapping fi rv=$? count=$(( $count + 1 )) if [ $rv -ne 0 ]; then cryptsetup_message "ERROR: $CRYPTTAB_NAME: cryptsetup failed, bad password or options?" sleep 1 continue elif ! dev="$(dm_blkdevname "$CRYPTTAB_NAME")"; then cryptsetup_message "ERROR: $CRYPTTAB_NAME: unknown error setting up device mapping" return 1 fi if ! fstype="$(get_fstype "$dev")" || [ "$fstype" = "unknown" ]; then if [ "$CRYPTTAB_TYPE" != "luks" ]; then # bad password for plain dm-crypt device? or mkfs not run yet? cryptsetup_message "ERROR: $CRYPTTAB_NAME: unknown fstype, bad password or options?" wait_for_udev 10 /sbin/cryptsetup remove -- "$CRYPTTAB_NAME" sleep 1 continue fi elif [ "$fstype" = lvm2 ]; then if [ ! -x /sbin/lvm ]; then cryptsetup_message "WARNING: $CRYPTTAB_NAME: lvm is not available" return 1 elif vg="$(lvm pvs --noheadings -o vg_name --config 'log{prefix=""}' -- "$dev")"; then # activate the VG held by the PV we just unlocked lvm lvchange -a ay --sysinit -- "$vg" fi fi cryptsetup_message "$CRYPTTAB_NAME: set up successfully" wait_for_udev 10 return 0 done cryptsetup_message "ERROR: $CRYPTTAB_NAME: maximum number of tries exceeded" exit 1 } ####################################################################### # Begin real processing mkdir -p /cryptroot # might not exist yet if the main system has no crypttab(5) # Do we have any kernel boot arguments? if ! grep -qE '^(.*\s)?cryptopts=' /proc/cmdline; then # ensure $TABFILE exists and has a mtime greater than the boot time # (existing $TABFILE is preserved) touch -- "$TABFILE" else # let the read builtin unescape the '\' as GRUB substitutes '\' by '\\' in the cmdline tr ' ' '\n' </proc/cmdline | sed -n 's/^cryptopts=//p' | while IFS= read cryptopts; do # skip empty values (which can be used to disable the initramfs # scripts for a particular boot, cf. #873840) [ -n "$cryptopts" ] || continue unset -v target source key options IFS="," for x in $cryptopts; do case "$x" in target=*) target="${x#target=}";; source=*) source="${x#source=}";; key=*) key="${x#key=}";; *) options="${options+$options,}$x";; esac done if [ -z "${source:+x}" ]; then cryptsetup_message "ERROR: Missing source= value in kernel parameter cryptopts=$cryptopts" else # preserve mangling printf '%s %s %s %s\n' "${target:-cryptroot}" "$source" "${key:-none}" "${options-}" fi done >"$TABFILE" fi # Do we have any settings from the $TABFILE? if [ -s "$TABFILE" ]; then # Create locking directory before invoking cryptsetup(8) to avoid warnings mkdir -pm0700 /run/cryptsetup modprobe -q dm_crypt crypttab_foreach_entry setup_mapping fi exit 0 PK �P�ZO�9( 9( iscsinu ȯ�� #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac parse_root_param () { target="$1" auth="$2" OLDIFS="$IFS" IFS=":" set -- $target IFS="$OLDIFS" tmp_ISCSI_TARGET_IP="$1" if [ -n "$2" ] ; then if [ x"$2" != x"6" ] ; then echo "Warning: unsupported protocol specified for iSCSI root parameter, assuming 6 (TCP)" >&2 fi fi tmp_ISCSI_TARGET_PORT="$3" tmp_ISCSI_ROOT_LUN="$4" tmp_ISCSI_TARGET_NAME="$5" shift 5 while [ -n "$1" ] ; do tmp_ISCSI_TARGET_NAME="${tmp_ISCSI_TARGET_NAME}:$1" shift done if [ -z "$tmp_ISCSI_TARGET_IP" ] || [ -z "$tmp_ISCSI_TARGET_NAME" ] ; then echo "Warning: empty iSCSI IP / target name currently not supported for root=iscsi:, ignoring parameter" >&2 return fi OLDIFS="$IFS" IFS=":" set -- $auth IFS="$OLDIFS" tmp_ISCSI_USERNAME="" tmp_ISCSI_PASSWORD="" tmp_ISCSI_IN_USERNAME="" tmp_ISCSI_IN_PASSWORD="" if [ $# -gt 4 ] ; then echo "Warning: invalid authentication for root=iscsi:, ignoring" >&2 return fi if [ $# -gt 0 ] ; then tmp_ISCSI_USERNAME="$1" tmp_ISCSI_PASSWORD="$2" if [ $# -gt 2 ] ; then tmp_ISCSI_IN_USERNAME="$3" tmp_ISCSI_IN_PASSWORD="$4" fi fi ISCSI_TARGET_IP="$tmp_ISCSI_TARGET_IP" ISCSI_TARGET_PORT="$tmp_ISCSI_TARGET_PORT" ISCSI_TARGET_NAME="$tmp_ISCSI_TARGET_NAME" ISCSI_ROOT_LUN="$tmp_ISCSI_ROOT_LUN" if [ -n "$tmp_ISCSI_USERNAME" ] ; then ISCSI_USERNAME="$tmp_ISCSI_USERNAME" ISCSI_PASSWORD="$tmp_ISCSI_PASSWORD" fi if [ -n "$tmp_ISCSI_IN_USERNAME" ] ; then ISCSI_IN_USERNAME="$tmp_ISCSI_IN_USERNAME" ISCSI_IN_PASSWORD="$tmp_ISCSI_IN_PASSWORD" fi ISCSI_HAD_ROOT=yes } do_iscsi_login () { # Bring in the main config . /conf/initramfs.conf for conf in conf/conf.d/*; do [ -f ${conf} ] && . ${conf} done . /scripts/functions udevadm settle IBFT_DHCP_DEVICE="" if [ -n "$ISCSI_AUTO" ] ; then # try to auto-configure network interface based # on firmware values modprobe iscsi_ibft iscsistart -N # write out /run/net-$IFACE.conf based on what # was in the firmware iscsistart -f | while read k eq v; do case "${k} ${eq} ${v}" in ("# BEGIN RECORD"*) DEVICE="" PROTO="none" IPV4ADDR="" IPV4NETMASK="" IPV4GATEWAY="" IPV4DNS0="" IPV4DNS1="" UPTIME="0" DHCPLEASETIME="0" DOMAINSEARCH="" continue ;; ("# END RECORD"*) if [ -n "$DEVICE" ] ; then { echo "DEVICE='${DEVICE}'" echo "PROTO='${PROTO}'" echo "IPV4ADDR='${IPV4ADDR}'" echo "IPV4BROADCAST=''" echo "IPV4NETMASK='${IPV4NETMASK}'" echo "IPV4GATEWAY='${IPV4GATEWAY}'" echo "IPV4DNS0='${IPV4DNS0}'" echo "IPV4DNS1='${IPV4DNS1}'" echo "HOSTNAME=''" echo "DNSDOMAIN=''" echo "NISDOMAIN=''" echo "ROOTSERVER=''" echo "ROOTPATH=''" echo "UPTIME='${UPTIME}'" echo "DHCPLEASETIME='${DHCPLEASETIME}'" echo "DOMAINSEARCH=''" } > "/run/net-${DEVICE}.conf.ibft" if [ "$PROTO" != "dhcp" -a "$DHCPLEASETIME" = "0" ]; then # this is static ibft configuration. mv "/run/net-${DEVICE}.conf.ibft" "/run/net-${DEVICE}.conf" else IBFT_DHCP_DEVICE="$DEVICE" fi echo "${DEVICE}" > /run/initramfs/open-iscsi.interface # iscsistart -N doesn't set the default gateway. Therefore, # we need to add it ourselves. However, the ip command is # only available if we use busybox in the initramfs (it's # in open-iscsi's Recommends), so check for that. if [ -n "${IPV4GATEWAY}" ] && which ip >/dev/null 2>&1 ; then ip route add default via "${IPV4GATEWAY}" fi fi continue ;; esac if [ "${eq}" != "=" ] ; then continue fi case "${k}" in iface.ipaddress) IPV4ADDR="${v}" ;; iface.subnet_mask) IPV4NETMASK="${v}" ;; iface.gateway) IPV4GATEWAY="${v}" ;; iface.primary_dns) IPV4DNS0="${v}" ;; iface.secondary_dns) IPV4DNS1="${v}" ;; iface.net_ifacename) DEVICE="${v}" ;; iface.bootproto) case "${v}" in DHCP) PROTO="dhcp" ;; STATIC) PROTO="static" ;; *) PROTO="${v}" ;; esac ;; esac done fi # run configure_networking even if we have iscsi_auto, because there # could be other network interfaces that need to be configured # also, if we set up DHCP iBFT, we need ipconfig to run so it creates # a proper /run/net-${DEVICE}.conf file that includes the DNS search # domain, which we don't get in our iBFT data (see LP: #1806777) configure_networking if [ -n "$IBFT_DHCP_DEVICE" ]; then if ! [ -e "/run/net-${DEVICE}.conf" ] ; then echo "WARN: ipconfig dhcp failed, using iSCSI iBFT config - DNS search domain may be missing at runtime" >&2 # We have DHCP iBFT, but ipconfig DHCP failed; # so we should fallback to just using the iBFT config, # though that will not include the DNS search domain mv "/run/net-${DEVICE}.conf.ibft" "/run/net-${DEVICE}.conf" # need to re-run configure_networking to process conf file configure_networking fi fi # Save network device we configured via configure_networking, but only # if we didn't already get one from autoconfiguration (then we always # prefer that). if ! [ -e /run/initramfs/open-iscsi.interface ] ; then if [ -z "${DEVICE}" ] || ! [ -e "/run/net-${DEVICE}.conf" ] ; then for i in /run/net-*.conf ; do [ -e "${i}" ] && { . "${i}" ; break ; } done fi if [ -n "${DEVICE}" ] ; then echo "${DEVICE}" > /run/initramfs/open-iscsi.interface else for i in /run/net6-*.conf; do [ -e "${i}" ] && { . "${i}" ; break ; } done fi if [ -z "${DEVICE}" ] && [ -n "${DEVICE6}" ] ; then echo "${DEVICE6}" > /run/initramfs/open-iscsi.interface fi fi modprobe iscsi_tcp modprobe crc32c # If iscsiuio is present in the initramfs, start it, in case UIO # offloading is required. if [ -x /sbin/iscsiuio ] ; then start-stop-daemon --start --quiet --pidfile /run/initramfs/iscsiuio.pid \ --startas /sbin/iscsiuio --name iscsiuio \ --exec /sbin/iscsiuio -- --pid=/run/initramfs/iscsiuio.pid || : fi if [ -z $ISCSI_AUTO ]; then if [ -z $ISCSI_INITIATOR ]; then . /etc/initiatorname.iscsi ISCSI_INITIATOR=$InitiatorName fi if [ -z $ISCSI_TARGET_PORT ]; then ISCSI_TARGET_PORT=3260 fi if [ -z $ISCSI_TARGET_GROUP ]; then ISCSI_TARGET_GROUP=1 fi iscsistart -i $ISCSI_INITIATOR -t $ISCSI_TARGET_NAME \ -g $ISCSI_TARGET_GROUP -a $ISCSI_TARGET_IP \ -p $ISCSI_TARGET_PORT \ ${ISCSI_USERNAME:+-u "$ISCSI_USERNAME"} \ ${ISCSI_PASSWORD:+-w "$ISCSI_PASSWORD"} \ ${ISCSI_IN_USERNAME:+-U "$ISCSI_IN_USERNAME"}\ ${ISCSI_IN_PASSWORD:+-W "$ISCSI_IN_PASSWORD"} else modprobe iscsi_ibft iscsistart -b fi if [ -z $ISCSI_TARGET_PORT ]; then ISCSI_TARGET_PORT=3260 fi if [ -z $ISCSI_TARGET_GROUP ]; then ISCSI_TARGET_GROUP=1 fi for i in $ISCSI_TARGET_IP; do iscsistart -i $ISCSI_INITIATOR -t $ISCSI_TARGET_NAME \ -g $ISCSI_TARGET_GROUP -a $i \ -p $ISCSI_TARGET_PORT \ ${ISCSI_USERNAME:+-u "$ISCSI_USERNAME"} \ ${ISCSI_PASSWORD:+-w "$ISCSI_PASSWORD"} \ ${ISCSI_IN_USERNAME:+-U "$ISCSI_IN_USERNAME"}\ ${ISCSI_IN_PASSWORD:+-W "$ISCSI_IN_PASSWORD"} done } parse_iscsi_ops () { [ -r /etc/iscsi.initramfs ] && . /etc/iscsi.initramfs for x in $(cat /proc/cmdline); do case ${x} in iscsi_auto) ISCSI_AUTO=true ;; iscsi_initiator=*) ISCSI_INITIATOR="${x#iscsi_initiator=}" ;; iscsi_target_name=*) ISCSI_TARGET_NAME="${x#iscsi_target_name=}" ;; iscsi_target_ip=*) ISCSI_TARGET_IP="${x#iscsi_target_ip=}" ;; iscsi_target_port=*) ISCSI_TARGET_PORT="${x#iscsi_target_port=}" ;; iscsi_target_group=*) ISCSI_TARGET_GROUP="${x#iscsi_target_group=}" ;; iscsi_username=*) ISCSI_USERNAME="${x#iscsi_username=}" ;; iscsi_password=*) ISCSI_PASSWORD="${x#iscsi_password=}" ;; iscsi_in_username=*) ISCSI_IN_USERNAME="${x#iscsi_in_username=}" ;; iscsi_in_password=*) ISCSI_IN_PASSWORD="${x#iscsi_in_password=}" ;; root=iscsi:*@*) x="${x##root=iscsi:}" parse_root_param "${x#*@}" "${x%%@*}" ;; root=iscsi:*) parse_root_param "${x##root=iscsi:}" "" ;; esac done } if [ ! -x /sbin/iscsistart ]; then exit 0 fi parse_iscsi_ops if ( [ -z $ISCSI_TARGET_NAME ] || [ -z $ISCSI_TARGET_IP ] ) && [ -z $ISCSI_AUTO ]; then exit 0 fi do_iscsi_login udevadm settle # The second check is to allow us to use multiple root= parameters. That way # one may specify root=iscsi:... root=UUID=... to mount partitions on an iSCSI # disk. (The latter value will overwrite the former for purposes of the main # initramfs scripts, but our loop that scans /proc/cmdline will still detect # the former and set proper parameters. if [ -n "$ISCSI_HAD_ROOT" ] && [ x"${ROOT##iscsi:}" != x"${ROOT}" ] ; then if [ -z "$ISCSI_ROOT_LUN" ] ; then ISCSI_ROOT_LUN=0 fi found=0 # FIXME: RFC 4173 defines the LUN field to be more complicated and that # the same LUN may have multiple representations. for disk in /dev/disk/by-path/*-iscsi-*-"${ISCSI_ROOT_LUN}" ; do # Resolve device name, as the colons in the by-path name will # cause mount to think that this is a NFS share, which we don't # want. if ! disk="$(readlink -f "$disk")" ; then continue fi # Try to load file system type module (ignore errors), otherwise # this won't succeed. if fstype=$(get_fstype "$disk") ; then modprobe "$fstype" || : ROOTFSTYPE="$fstype" fi # Try to mount read-only and see if it's the right filesystem. # If so, record the device name but umount again, because we # want to be able to do an fsck on it. if mount -r -t "${ROOTFSTYPE:-auto}" ${ROOTFLAGS} "${disk}" ${rootmnt} ; then if [ -d ${rootmnt}/proc ] ; then # This will be sourced by init after this hook has run. echo "export ROOT=$disk" >> /conf/param.conf if [ -n "$ROOTFSTYPE" ] && [ x"$ROOTFSTYPE" != x"auto" ] ; then echo "export ROOTFSTYPE=$ROOTFSTYPE" >> /conf/param.conf fi found=1 fi umount ${rootmnt} if [ $found -eq 1 ] ; then break fi fi done fi exit 0 PK �P�Z*}j�� � cryptopenscnu ȯ�� #!/bin/sh set -e PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac # Hook for starting smartcard reading software if [ ! -x /usr/sbin/pcscd ]; then exit 0 fi . /scripts/functions # Start pcscd daemon normally: # start-stop-daemon --start --quiet \ # --pidfile /run/pcscd.pid \ # --exec /usr/sbin/pcscd # Alternatively, start pcscd daemon in foreground so that it's pretty colored # output may be seen on the console, useful for watching error messages since # pcscd uses syslog which is not available (use --error or --critical to filter # out debug message clutter): # /usr/sbin/pcscd --error --foreground & /usr/sbin/pcscd --foreground & echo $! >/run/pcscd.pid PK �P�Z%�4� � lvm2nu ȯ�� PK �P�Z���V�! �! � cryptrootnu ȯ�� PK �P�ZO�9( 9( �% iscsinu ȯ�� PK �P�Z*}j�� � LN cryptopenscnu ȯ�� PK |Q
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings