Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- /mnt/home/clean2/initrd-expanded/init 2017-02-16 05:03:46.000000000 +0800
- +++ ./initrd-expanded/init 2018-01-28 00:59:20.000000000 +0800
- @@ -91,7 +91,27 @@
- #=============================================================
- # FUNCTIONS
- #=============================================================
- -
- +function wait_for_usb_part(){
- + echo "entering wait_for_usb_part() " #s243a remove
- + xIFS=$IFS
- + IFS=' ' #This should be the default but just to be double certain
- + [ -e /tmp/flag-usb-ready ] || wait_for_usb #Call wait_for_usb if it hasn't been called yet.
- + for i in $(seq 1 $USB_TRIES); do
- + echo "i=$1 < $USB_TRIES" #s243a remove
- + BLKIDOUT='' #not sure if this is necessary but it will force blkid to be called again.
- + decode_id $1 #Convert uuid's to partition name
- + part_name="$ONE_PART" #this is the result (i.e. the partiation name) returned from decode_id.
- + echo "part_name=$part_name"
- + if [ $part_name ]; then
- + for p in cat /tmp/flag-usb-ready; do #flag-usb-ready conatins the name of all the partitions which are ready for use
- + [ $p != $part_name ] || break 2
- + done;
- + fi
- + rm /tmp/flag-usb-ready #we got to clear this flag or wait_for_usb won't do anything.
- + wait_for_usb
- + done
- + IFS=$xIFS
- +}
- fsck_func() {
- # "$1" - partition device - ex: /dev/sdb2
- # "$2" - fstype - ex: ext2
- @@ -858,6 +878,13 @@
- PDEBUG=1
- TOTAL_SIZEK_SFS_RAM=0
- +#Specifies how long to wait for the USB drive
- +[ $waitdev ] && WAITDEV=$waitdev #added by s243a
- + export WAITDEV="${WAITDEV:-3}"
- +#Specifies how how many times to try finding all USB drives
- +[ $USBTRIES ] && USBTRIES=$usb_tries
- +USBTRIES="${USBTRIES:-3}"
- +
- # show menu with pupsaves
- [ $psavemenu ] && PSAVEMENU=$psavemenu
- @@ -927,13 +954,14 @@
- #establish PDRV
- P_PART=""; LOOK_PUP=""; LOOK_SAVE=""
- if [ "$P_BP_ID" ];then #specified as parameter
- - decode_id "$P_BP_ID"
- + wait_for_usb_part "$P_BP_ID"
- + #decode_id "$P_BP_ID"
- [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
- if [ "$P_PART" = "" ];then
- - wait_for_usb
- - decode_id "$P_BP_ID"
- + wait_for_usb_part "$P_BP_ID"
- [ "$ONE_PART" ] && { P_PART="$ONE_PART"; P_BP_ID=""; }
- fi
- + #wait_for_usb_part "$P_BP_ID"
- find_onepupdrv "$P_PART" "$P_BP_FN" "$P_DEF_FN" "p"
- [ "$ONE_FN" ] && { PDRV="$ONE_PART,$ONE_FS,$ONE_FN"; P_MP="$ONE_MP"; }
- [ "$PDEBUG" ] && echo "2: ONE_PART=$ONE_PART ONE_FN=$ONE_FN ONE_MP=$ONE_MP"
Add Comment
Please, Sign In to add comment