Modify

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#6517 closed enhancement (fixed)

Hotplug mounts filesystems but does not turn on swap

Reported by: W. Michael Petullo <mike@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: hotplug Cc:

Description

I have a USB disk with swap and filesystem partitions. Yes, a removable swap space may be crazy, but it's all I have to work with. When this disk is connected to my device, the device mounts the filesystem at /mnt/sda2. However, the device does not turn on the swap space. I'd like to see /etc/hotplug.d/block/10-mount do something like (note the addition of swapon):

# Copyright (C) 2009 OpenWrt.org

blkdev=dirname $DEVPATH
if [ basename $blkdev != "block" ]; then

device=basename $DEVPATH
case "$ACTION" in

add)

swapon /dev/$device
( mkdir -p /mnt/$device \

&& mount /dev/$device /mnt/$device )

;;

remove)

umount /dev/$device
;;

esac

fi

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by W. Michael Petullo <mike@…>

Note that there should be a double pipe (or) between the swapon and mkdir. This was lost in translation when I submitted this bug.

comment:2 Changed 8 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Committed in r19300.

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.