Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # LN# 713 to 740 of /initrd/init (tahrpup) - http://www.pearltrees.com/s243a/initrd-init/id19535893/item224274990
- # LN# 765 to 800 https://github.com/puppylinux-woof-CE/woof-CE/blob/c96d661c2232caef1d69c693de673fb0e54796f8/initrd-progs/0initrd/init#L765
- find_save_file() {
- # "$1" - mount point - ex: /mnt/pdrv
- # "$2" - partition name - ex: sdb2
- # "$3" - file system type - ex: ext4
- if [ "$SAVE_BP_DIR" ];then
- SAVE_DIR="$SAVE_BP_DIR"
- else
- SAVE_DIR="${PSUBDIR}/"
- fi
- SAVE_FILES="$(ls -d ${1}${SAVE_DIR}${DISTRO_FILE_PREFIX}save* 2>/dev/null)"
- for ONE_SAVE in $SAVE_FILES;do
- #validate savefiles here
- [ "$ONE_FS_IS_LINUX" != "yes" ] && [ -d "$ONE_SAVE" ] && continue
- IS_OK=""
- case $ONE_SAVE in
- *.2fs|*.3fs|*.4fs) [ -s "$ONE_SAVE" ] && IS_OK="yes" ;;
- *.BKP-*) IS_OK="$PSAVEBKP" ;; #written by /usr/sbin/pupsave-backup
- *) [ -d "$ONE_SAVE" ] && IS_OK="yes" ;;
- esac
- [ "$IS_OK" ] && PUP_SAVES="${PUP_SAVES}${2},${3},${SAVE_DIR}$(basename $ONE_SAVE)
- "
- done
- PUP_SAVES="$(echo "$PUP_SAVES")" #remove trailing newline char
- echo "MENU_MAX_PUPSAVES=${MENU_MAX_PUPSAVES}" #debug
- if [ "$MENU_MAX_PUPSAVES" ] ; then
- PUP_SAVES="$(echo "$PUP_SAVES" | head -n $MENU_MAX_PUPSAVES)"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement