summaryrefslogtreecommitdiffstats
path: root/dracut/updates-genrules.sh
blob: 3ed1e2c9a7a899a09af13a5989273297bae3fd01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# generate udev rules for fetching updates

updates=$anac_updates
[ -n "$updates" ] || return
case $updates in
    # updates=<url>: handled by livenet's fetch-liveupdate.sh
    http*|ftp*|nfs*)
        wait_for_updates
    ;;
    # updates=<disk>:<path>
    #   <disk> is sdb, /dev/sdb, LABEL=xxx, UUID=xxx
    #   <path> defaults to /updates.img if missing
    *)
        # accept hd:<dev>:<path> (or cdrom:<dev>:<path>)
        updates=${updates#hd:}; updates=${updates#cdrom:}
        splitsep ":" "$updates" dev path
        dev=$(disk_to_dev_path $dev)
        when_diskdev_appears $dev fetch-updates-disk \$env{DEVNAME} $path
        wait_for_updates
    ;;
esac