Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- load_sfs_file() { #Line 315 of initrd/init
- [ "$LOADMSG" ] && echo -n "$(printf "${L_LOADING_FILE}" "$ONE_BASENAME" "$LOADMSG")" > /dev/console
- if [ "$COPY2RAM" = "" ];then
- COPY2RAM="no"
- #if there's heaps of ram, copy puppy.sfs to a tmpfs...
- #v405 fast media plus more than 256MB ram then definitely worth copying to ram...
- SIZESFSK=$(du -k $ONE_FN | cut -f 1)
- SIZESFSK=$(($SIZESFSK + 1000)) #some slack.
- MINRAM2CPY=$(($SIZESFSK * 2)) #100222 technosaurus: in case of very big puppies.
- #decide whether to copy .sfs's to ram
- [ "$PNOCOPY" = "yes" ] || COPYCONTENDER='yes'
- [ "$PCOPY" = "yes" ] && COPYCONTENDER='yes'
- [ "$PRAMONLY" = "yes" ] && COPYCONTENDER='yes'
- [ "$COPYCONTENDER" = "yes" ] && [ $RAMSIZE -gt 400000 ] && [ $RAMSIZE -gt $MINRAM2CPY ] && COPY2RAM="yes"
- fi
- if [ "$COPY2RAM" = "yes" ];then
- SIZEZK=$(du -k $ONE_FN | cut -f 1)
- TFREEK=$(df | grep -m1 ' /mnt/tmpfs' | tr -s ' ' | cut -f 4 -d ' ')
- if [ $TFREEK -gt $SIZEZK ];then
- if [ "$ONE_MP" = "" ];then #101101 humongous initrd.
- mv -af $ONE_FN /mnt/tmpfs/
- else
- [ "$LOADMSG" ] && [ "$COPYMSG" ] && echo -en " \\033[1;35m${COPYMSG}\\033[0;39m" > /dev/console #purple.
- TOTAL_SIZEK_SFS_RAM=$(($TOTAL_SIZEK_SFS_RAM + $SIZEZK))
- cp -af $ONE_FN /mnt/tmpfs/
- fi
- sync
- setup_loop_sfs /mnt/tmpfs/$ONE_BASENAME
- else
- setup_loop_sfs $ONE_FN
- [ "$ONE_PART" != "rootfs" ] && KEEPMOUNTED="${KEEPMOUNTED}${ONE_PART} "
- fi
- else
- setup_loop_sfs $ONE_FN
- [ "$ONE_PART" != "rootfs" ] && KEEPMOUNTED="${KEEPMOUNTED}${ONE_PART} "
- fi
- SFS_MP="/pup_${ONE_SFX}"
- [ "$ONE_SFX" = "p" ] && SFS_MP="/pup_ro2"
- [ -d "$SFS_MP" ] || mkdir $SFS_MP
- mount -r -t squashfs -o noatime $ONE_LOOP $SFS_MP > /dev/console 2>&1
- STATUS=$?
- [ $STATUS -eq 0 ] && ONE_LAYER="$SFS_MP=rr"
- [ "$LOADMSG" ] && check_status $STATUS
- }
Advertisement
Add Comment
Please, Sign In to add comment