Magellan Linux

Annotation of /trunk/dracut/patches/dracut-045-busybox-losetup.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2908 - (hide annotations) (download)
Fri Apr 7 12:44:37 2017 UTC (7 years, 5 months ago) by niro
File size: 4523 byte(s)
-fixed busybox unfriendly losetup argvs
1 niro 2908 diff -Naur dracut-045/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh dracut-045-busybox-losetup/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
2     --- dracut-045/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh 2017-04-03 10:26:25.000000000 +0200
3     +++ dracut-045-busybox-losetup/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh 2017-04-07 14:38:41.708878555 +0200
4     @@ -2,7 +2,7 @@
5    
6     if [ "${root%%:*}" = "liveiso" ]; then
7     {
8     - printf 'KERNEL=="loop-control", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
9     + printf 'KERNEL=="loop-control", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f %s`"\n' \
10     ${root#liveiso:}
11     } >> /etc/udev/rules.d/99-liveiso-mount.rules
12     fi
13     diff -Naur dracut-045/modules.d/90dmsquash-live/dmsquash-live-root.sh dracut-045-busybox-losetup/modules.d/90dmsquash-live/dmsquash-live-root.sh
14     --- dracut-045/modules.d/90dmsquash-live/dmsquash-live-root.sh 2017-04-03 10:26:25.000000000 +0200
15     +++ dracut-045-busybox-losetup/modules.d/90dmsquash-live/dmsquash-live-root.sh 2017-04-07 14:39:31.513407425 +0200
16     @@ -113,7 +113,7 @@
17     [ -n "$readonly_overlay" ] && opt=-r
18     mount -n -t auto $devspec /run/initramfs/overlayfs || :
19     if [ -f /run/initramfs/overlayfs$pathspec -a -w /run/initramfs/overlayfs$pathspec ]; then
20     - OVERLAY_LOOPDEV=$(losetup -f --show $opt /run/initramfs/overlayfs$pathspec)
21     + OVERLAY_LOOPDEV=$(losetup -f $opt /run/initramfs/overlayfs$pathspec)
22     over=$OVERLAY_LOOPDEV
23     umount -l /run/initramfs/overlayfs || :
24     oltype=$(det_img_fs $OVERLAY_LOOPDEV)
25     @@ -196,10 +196,10 @@
26     else
27     dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
28     if [ -n "$setup" -a -n "$readonly_overlay" ]; then
29     - RO_OVERLAY_LOOPDEV=$(losetup -f --show /overlay)
30     + RO_OVERLAY_LOOPDEV=$(losetup -f /overlay)
31     over=$RO_OVERLAY_LOOPDEV
32     else
33     - OVERLAY_LOOPDEV=$(losetup -f --show /overlay)
34     + OVERLAY_LOOPDEV=$(losetup -f /overlay)
35     over=$OVERLAY_LOOPDEV
36     fi
37     fi
38     @@ -228,8 +228,8 @@
39     dd if=/dev/null of=/run/initramfs/thin-overlay/meta bs=1b count=1 seek=$((thin_meta_sz)) 2> /dev/null
40     dd if=/dev/null of=/run/initramfs/thin-overlay/data bs=1b count=1 seek=$((thin_data_sz)) 2> /dev/null
41    
42     - THIN_META_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/meta )
43     - THIN_DATA_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/data )
44     + THIN_META_LOOPDEV=$( losetup -f /run/initramfs/thin-overlay/meta )
45     + THIN_DATA_LOOPDEV=$( losetup -f /run/initramfs/thin-overlay/data )
46    
47     echo 0 $thin_data_sz thin-pool $THIN_META_LOOPDEV $THIN_DATA_LOOPDEV 1024 1024 | dmsetup create live-overlay-pool
48     dmsetup message /dev/mapper/live-overlay-pool 0 "create_thin 0"
49     @@ -321,7 +321,7 @@
50     setup=yes
51     fi
52     fi
53     - BASE_LOOPDEV=$(losetup -f --show $opt $FSIMG)
54     + BASE_LOOPDEV=$(losetup -f $opt $FSIMG)
55     sz=$(blockdev --getsz $BASE_LOOPDEV)
56     if [ "$setup" == rw ]; then
57     echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create live-rw
58     diff -Naur dracut-045/modules.d/91crypt-loop/crypt-loop-lib.sh dracut-045-busybox-losetup/modules.d/91crypt-loop/crypt-loop-lib.sh
59     --- dracut-045/modules.d/91crypt-loop/crypt-loop-lib.sh 2017-04-03 10:26:25.000000000 +0200
60     +++ dracut-045-busybox-losetup/modules.d/91crypt-loop/crypt-loop-lib.sh 2017-04-07 14:41:35.855216384 +0200
61     @@ -19,7 +19,7 @@
62     local key="/dev/mapper/${mntp##*/}"
63    
64     if [ ! -b $key ]; then
65     - local loopdev=$(losetup -f "${mntp}/${keypath}" --show)
66     + local loopdev=$(losetup -f "${mntp}/${keypath}")
67     local opts="-d - luksOpen $loopdev ${key##*/}"
68    
69     ask_for_password \
70     diff -Naur dracut-045/modules.d/99img-lib/img-lib.sh dracut-045-busybox-losetup/modules.d/99img-lib/img-lib.sh
71     --- dracut-045/modules.d/99img-lib/img-lib.sh 2017-04-03 10:26:25.000000000 +0200
72     +++ dracut-045-busybox-losetup/modules.d/99img-lib/img-lib.sh 2017-04-07 14:41:01.855543969 +0200
73     @@ -21,7 +21,7 @@
74    
75     # determine filesystem type for a filesystem image
76     det_fs_img() {
77     - local dev=$(losetup --find --show "$1") rv=""
78     + local dev=$(losetup -f "$1") rv=""
79     det_fs $dev; rv=$?
80     losetup -d $dev
81     return $rv