From 0cbaa4b386c922dc4b85918cc2081e2a00e44f69ec3af44588c771e75d711988 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 24 Nov 2014 16:56:06 +0000 Subject: [PATCH 01/11] - Use fixed /etc/hosts and ibft_hostname to reduce build-compare noise OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=325 --- libguestfs.changes | 5 +++ libguestfs.mkinitrd.1110.patch | 74 ++++++++++++++++++++++++++++++++- libguestfs.mkinitrd.1210.patch | 74 ++++++++++++++++++++++++++++++++- libguestfs.mkinitrd.1220.patch | 74 ++++++++++++++++++++++++++++++++- libguestfs.mkinitrd.1310.patch | 75 ++++++++++++++++++++++++++++++++++ libguestfs.spec | 2 + 6 files changed, 301 insertions(+), 3 deletions(-) create mode 100644 libguestfs.mkinitrd.1310.patch diff --git a/libguestfs.changes b/libguestfs.changes index 23f4b62..d46cb62 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 24 16:52:12 UTC 2014 - ohering@suse.de + +- Use fixed /etc/hosts and ibft_hostname to reduce build-compare noise + ------------------------------------------------------------------- Thu Oct 16 13:26:13 CEST 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.1110.patch b/libguestfs.mkinitrd.1110.patch index 0a77b89..831f4e9 100644 --- a/libguestfs.mkinitrd.1110.patch +++ b/libguestfs.mkinitrd.1110.patch @@ -1,9 +1,81 @@ --- + mkinitrd/scripts/setup-ibft.sh | 2 + mkinitrd/scripts/setup-network.sh | 11 +++- mkinitrd/scripts/setup-prepare.sh | 94 ++++++++++++++++++++++++++++------- mkinitrd/scripts/setup-progs.sh | 4 - mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++++++--------- - 3 files changed, 114 insertions(+), 44 deletions(-) + 5 files changed, 125 insertions(+), 46 deletions(-) +Index: 1110/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1110.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1110/mkinitrd/scripts/setup-ibft.sh +@@ -21,22 +21,22 @@ ibft_set_iface() { + interface=$iface + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + fi + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1110/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1110.orig/mkinitrd/scripts/setup-network.sh ++++ 1110/mkinitrd/scripts/setup-network.sh +@@ -291,27 +291,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" + done + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi Index: 1110/mkinitrd/scripts/setup-prepare.sh =================================================================== --- 1110.orig/mkinitrd/scripts/setup-prepare.sh diff --git a/libguestfs.mkinitrd.1210.patch b/libguestfs.mkinitrd.1210.patch index 657ace1..073f34a 100644 --- a/libguestfs.mkinitrd.1210.patch +++ b/libguestfs.mkinitrd.1210.patch @@ -1,9 +1,81 @@ --- + mkinitrd/scripts/setup-ibft.sh | 2 + mkinitrd/scripts/setup-network.sh | 11 +++- mkinitrd/scripts/setup-prepare.sh | 94 ++++++++++++++++++++++++++++------- mkinitrd/scripts/setup-progs.sh | 17 +----- mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++++++--------- - 3 files changed, 115 insertions(+), 56 deletions(-) + 5 files changed, 126 insertions(+), 58 deletions(-) +Index: 1210/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1210.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1210/mkinitrd/scripts/setup-ibft.sh +@@ -9,22 +9,22 @@ ibft_set_iface() { + interface=$if + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + } + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1210/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1210.orig/mkinitrd/scripts/setup-network.sh ++++ 1210/mkinitrd/scripts/setup-network.sh +@@ -277,27 +277,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" + done + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi Index: 1210/mkinitrd/scripts/setup-prepare.sh =================================================================== --- 1210.orig/mkinitrd/scripts/setup-prepare.sh diff --git a/libguestfs.mkinitrd.1220.patch b/libguestfs.mkinitrd.1220.patch index a22ff10..d124131 100644 --- a/libguestfs.mkinitrd.1220.patch +++ b/libguestfs.mkinitrd.1220.patch @@ -1,9 +1,81 @@ --- + mkinitrd/scripts/setup-ibft.sh | 2 + mkinitrd/scripts/setup-network.sh | 11 ++- mkinitrd/scripts/setup-prepare.sh | 126 +++++++++++++++++++++-------------- mkinitrd/scripts/setup-progs.sh | 17 ---- mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++------- - 3 files changed, 114 insertions(+), 89 deletions(-) + 5 files changed, 125 insertions(+), 91 deletions(-) +Index: 1220/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1220.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1220/mkinitrd/scripts/setup-ibft.sh +@@ -21,22 +21,22 @@ ibft_set_iface() { + interface=$iface + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + fi + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1220/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1220.orig/mkinitrd/scripts/setup-network.sh ++++ 1220/mkinitrd/scripts/setup-network.sh +@@ -278,27 +278,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" + done + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi Index: 1220/mkinitrd/scripts/setup-prepare.sh =================================================================== --- 1220.orig/mkinitrd/scripts/setup-prepare.sh diff --git a/libguestfs.mkinitrd.1310.patch b/libguestfs.mkinitrd.1310.patch new file mode 100644 index 0000000..1b6fff8 --- /dev/null +++ b/libguestfs.mkinitrd.1310.patch @@ -0,0 +1,75 @@ +--- + mkinitrd/scripts/setup-ibft.sh | 2 +- + mkinitrd/scripts/setup-network.sh | 11 ++++++++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +Index: 1310/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1310.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1310/mkinitrd/scripts/setup-ibft.sh +@@ -21,22 +21,22 @@ ibft_set_iface() { + interface=$iface + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + fi + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1310/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1310.orig/mkinitrd/scripts/setup-network.sh ++++ 1310/mkinitrd/scripts/setup-network.sh +@@ -278,27 +278,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" + done + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi diff --git a/libguestfs.spec b/libguestfs.spec index a888e0e..e9ff481 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -194,6 +194,7 @@ Source19: libguestfs.mkinitrd.setup-nfs.sh Source20: libguestfs.mkinitrd.boot-btrfs.sh Source21: libguestfs.mkinitrd.setup-btrfs.sh # +Source1310: libguestfs.mkinitrd.1310.patch Source1220: libguestfs.mkinitrd.1220.patch Source1210: libguestfs.mkinitrd.1210.patch Source1110: libguestfs.mkinitrd.1110.patch @@ -730,6 +731,7 @@ diff -u mkinitrd/scripts/boot-guestfs.sh~ mkinitrd/scripts/boot-guestfs.sh || : %if %suse_version < 1230 patched= for p in \ + %{S:1310} \ %{S:1220} \ %{S:1210} \ %{S:1110} \ From 494a843b43ddab9af71e74747324e3be5dd8b4f0709406c1efb7a26b1f72f76d Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 24 Nov 2014 17:03:21 +0000 Subject: [PATCH 02/11] - Add isofs and other fs drivers (bnc#906692) OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=326 --- libguestfs.changes | 5 +++++ libguestfs.mkinitrd.boot.sh | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libguestfs.changes b/libguestfs.changes index d46cb62..3dfb004 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 24 17:02:33 UTC 2014 - ohering@suse.de + +- Add isofs and other fs drivers (bnc#906692) + ------------------------------------------------------------------- Mon Nov 24 16:52:12 UTC 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.boot.sh b/libguestfs.mkinitrd.boot.sh index 3efac4a..32accda 100644 --- a/libguestfs.mkinitrd.boot.sh +++ b/libguestfs.mkinitrd.boot.sh @@ -17,6 +17,7 @@ #%udevmodules: 9p #%udevmodules: btrfs #%udevmodules: cramfs +#%udevmodules: cuse #%udevmodules: ext2 #%udevmodules: ext3 #%udevmodules: ext4 @@ -24,6 +25,7 @@ #%udevmodules: fuse #%udevmodules: hfs #%udevmodules: hfsplus +#%udevmodules: isofs #%udevmodules: jfs #%udevmodules: minix #%udevmodules: nfs @@ -35,6 +37,17 @@ #%udevmodules: ufs #%udevmodules: xfs #%udevmodules: +#%udevmodules: mac-celtic +#%udevmodules: mac-centeuro +#%udevmodules: mac-croatian +#%udevmodules: mac-cyrillic +#%udevmodules: mac-gaelic +#%udevmodules: mac-greek +#%udevmodules: mac-iceland +#%udevmodules: mac-inuit +#%udevmodules: mac-roman +#%udevmodules: mac-romanian +#%udevmodules: mac-turkish #%udevmodules: nls_ascii #%udevmodules: nls_cp1250 #%udevmodules: nls_cp1251 @@ -74,6 +87,7 @@ #%udevmodules: nls_koi8-r #%udevmodules: nls_koi8-ru #%udevmodules: nls_koi8ru +#%udevmodules: nls_koi8-u #%udevmodules: nls_utf8 #%udevmodules: #%udevmodules: af_packet From 1d001e9d55fbbc8d4139562cb094cf6254e749971a01c846df0cdd56b1b30469 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 24 Nov 2014 17:17:26 +0000 Subject: [PATCH 03/11] patch mkinitrd unconditional OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=327 --- libguestfs.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/libguestfs.spec b/libguestfs.spec index e9ff481..ac9167e 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -728,7 +728,6 @@ a \ ' mkinitrd/scripts/boot-guestfs.sh diff -u mkinitrd/scripts/boot-guestfs.sh~ mkinitrd/scripts/boot-guestfs.sh || : # -%if %suse_version < 1230 patched= for p in \ %{S:1310} \ @@ -749,7 +748,6 @@ do fi done test -n "$patched" -%endif ./mkinitrd_setup.sh \ -s $PWD/mkinitrd/scripts \ From 88d5860b72d2212a18ca38bb85ee75603719cbce6f6c23062a86af0abf34537a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 25 Nov 2014 07:32:20 +0000 Subject: [PATCH 04/11] - Use fixed /etc/hosts, scsi_dh_modules and ibft_hostname to reduce build-compare noise OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=328 --- libguestfs.changes | 3 ++- libguestfs.mkinitrd.1110.patch | 22 +++++++++++++++++++++- libguestfs.mkinitrd.1220.patch | 22 +++++++++++++++++++++- libguestfs.mkinitrd.1310.patch | 26 +++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/libguestfs.changes b/libguestfs.changes index 3dfb004..ac0d97e 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -6,7 +6,8 @@ Mon Nov 24 17:02:33 UTC 2014 - ohering@suse.de ------------------------------------------------------------------- Mon Nov 24 16:52:12 UTC 2014 - ohering@suse.de -- Use fixed /etc/hosts and ibft_hostname to reduce build-compare noise +- Use fixed /etc/hosts, scsi_dh_modules and ibft_hostname to + reduce build-compare noise ------------------------------------------------------------------- Thu Oct 16 13:26:13 CEST 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.1110.patch b/libguestfs.mkinitrd.1110.patch index 831f4e9..5a812e7 100644 --- a/libguestfs.mkinitrd.1110.patch +++ b/libguestfs.mkinitrd.1110.patch @@ -3,8 +3,9 @@ mkinitrd/scripts/setup-network.sh | 11 +++- mkinitrd/scripts/setup-prepare.sh | 94 ++++++++++++++++++++++++++++------- mkinitrd/scripts/setup-progs.sh | 4 - + mkinitrd/scripts/setup-scsi_dh.sh | 2 mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++++++--------- - 5 files changed, 125 insertions(+), 46 deletions(-) + 6 files changed, 126 insertions(+), 47 deletions(-) Index: 1110/mkinitrd/scripts/setup-ibft.sh =================================================================== @@ -265,6 +266,25 @@ Index: 1110/mkinitrd/scripts/setup-progs.sh [ -e "bin/sh" ] || ln -s /bin/bash bin/sh +Index: 1110/mkinitrd/scripts/setup-scsi_dh.sh +=================================================================== +--- 1110.orig/mkinitrd/scripts/setup-scsi_dh.sh ++++ 1110/mkinitrd/scripts/setup-scsi_dh.sh +@@ -1,13 +1,13 @@ + #!/bin/bash + # + #%stage: device + # + # Include all scsi_dh_* modules and load them on boot (bnc#727428 et al) + + scsi_dh_modules= +-for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"); do ++for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko" | sort); do + i=${i%.ko} + scsi_dh_modules="$scsi_dh_modules ${i##*/}" + done + + save_var scsi_dh_modules Index: 1110/mkinitrd/scripts/setup-sharedlibs.sh =================================================================== --- 1110.orig/mkinitrd/scripts/setup-sharedlibs.sh diff --git a/libguestfs.mkinitrd.1220.patch b/libguestfs.mkinitrd.1220.patch index d124131..03464f0 100644 --- a/libguestfs.mkinitrd.1220.patch +++ b/libguestfs.mkinitrd.1220.patch @@ -3,8 +3,9 @@ mkinitrd/scripts/setup-network.sh | 11 ++- mkinitrd/scripts/setup-prepare.sh | 126 +++++++++++++++++++++-------------- mkinitrd/scripts/setup-progs.sh | 17 ---- + mkinitrd/scripts/setup-scsi_dh.sh | 2 mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++------- - 5 files changed, 125 insertions(+), 91 deletions(-) + 6 files changed, 126 insertions(+), 92 deletions(-) Index: 1220/mkinitrd/scripts/setup-ibft.sh =================================================================== @@ -290,6 +291,25 @@ Index: 1220/mkinitrd/scripts/setup-progs.sh [ -e "bin/sh" ] || ln -s /bin/bash bin/sh +Index: 1220/mkinitrd/scripts/setup-scsi_dh.sh +=================================================================== +--- 1220.orig/mkinitrd/scripts/setup-scsi_dh.sh ++++ 1220/mkinitrd/scripts/setup-scsi_dh.sh +@@ -1,13 +1,13 @@ + #!/bin/bash + # + #%stage: device + # + # Include all scsi_dh_* modules and load them on boot (bnc#727428 et al) + + scsi_dh_modules= +-for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"); do ++for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"| sort); do + i=${i%.ko} + scsi_dh_modules="$scsi_dh_modules ${i##*/}" + done + + save_var scsi_dh_modules Index: 1220/mkinitrd/scripts/setup-sharedlibs.sh =================================================================== --- 1220.orig/mkinitrd/scripts/setup-sharedlibs.sh diff --git a/libguestfs.mkinitrd.1310.patch b/libguestfs.mkinitrd.1310.patch index 1b6fff8..6295c97 100644 --- a/libguestfs.mkinitrd.1310.patch +++ b/libguestfs.mkinitrd.1310.patch @@ -1,7 +1,8 @@ --- mkinitrd/scripts/setup-ibft.sh | 2 +- mkinitrd/scripts/setup-network.sh | 11 ++++++++++- - 2 files changed, 11 insertions(+), 2 deletions(-) + mkinitrd/scripts/setup-scsi_dh.sh | 2 +- + 3 files changed, 12 insertions(+), 3 deletions(-) Index: 1310/mkinitrd/scripts/setup-ibft.sh =================================================================== @@ -73,3 +74,26 @@ Index: 1310/mkinitrd/scripts/setup-network.sh if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d fi +Index: 1310/mkinitrd/scripts/setup-scsi_dh.sh +=================================================================== +--- 1310.orig/mkinitrd/scripts/setup-scsi_dh.sh ++++ 1310/mkinitrd/scripts/setup-scsi_dh.sh +@@ -1,17 +1,17 @@ + #!/bin/bash + # + #%stage: device + # + # Include all scsi_dh_* modules and load them on boot (bnc#727428 et al) + + scsi_dh_modules= + if test -d $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler + then +- for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko") ++ for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko" | sort) + do + i=${i%.ko} + scsi_dh_modules="$scsi_dh_modules ${i##*/}" + done + fi + + save_var scsi_dh_modules From 1808da3728d905a22eed2ac8c182c23619250be8cb6dc71cdea49605f2c946cc Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 26 Nov 2014 12:33:58 +0000 Subject: [PATCH 05/11] - Handle more dist versions when patching mkinitrd OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=329 --- libguestfs.changes | 5 + libguestfs.mkinitrd.1115.patch | 356 ++++++++++++++++++++++++++++++ libguestfs.mkinitrd.1140.patch | 388 +++++++++++++++++++++++++++++++++ libguestfs.mkinitrd.1230.patch | 95 ++++++++ libguestfs.spec | 6 + 5 files changed, 850 insertions(+) create mode 100644 libguestfs.mkinitrd.1115.patch create mode 100644 libguestfs.mkinitrd.1140.patch create mode 100644 libguestfs.mkinitrd.1230.patch diff --git a/libguestfs.changes b/libguestfs.changes index ac0d97e..74a5fea 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Nov 26 11:02:59 UTC 2014 - ohering@suse.de + +- Handle more dist versions when patching mkinitrd + ------------------------------------------------------------------- Mon Nov 24 17:02:33 UTC 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.1115.patch b/libguestfs.mkinitrd.1115.patch new file mode 100644 index 0000000..d3bb399 --- /dev/null +++ b/libguestfs.mkinitrd.1115.patch @@ -0,0 +1,356 @@ +--- + mkinitrd/scripts/setup-ibft.sh | 2 + mkinitrd/scripts/setup-network.sh | 11 +++- + mkinitrd/scripts/setup-prepare.sh | 90 +++++++++++++++++++++++++++++------ + mkinitrd/scripts/setup-progs.sh | 4 - + mkinitrd/scripts/setup-scsi_dh.sh | 2 + mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++++++---------- + 6 files changed, 124 insertions(+), 45 deletions(-) + +Index: 1115/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1115/mkinitrd/scripts/setup-ibft.sh +@@ -22,23 +22,23 @@ ibft_set_iface() { + drvlink="$drvlink $(get_network_module $interface)" + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + fi + } + + ibft_nic=/sys/firmware/ibft/ethernet0 + ibft_nic2=/sys/firmware/ibft/ethernet1 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic + save_var ibft_nic2 +Index: 1115/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-network.sh ++++ 1115/mkinitrd/scripts/setup-network.sh +@@ -287,27 +287,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi + # XXX: This belongs to the if [ "$nettype" = "ifup" ] branch above, but we + # are being bug-compatible with previous versions of mkinitrd, which + # included these files unconditionally (bnc#891573). + if [ -f /etc/udev/rules.d/77-network.rules ] ; then + cp /etc/udev/rules.d/77-network.rules $tmp_mnt/etc/udev/rules.d +Index: 1115/mkinitrd/scripts/setup-prepare.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-prepare.sh ++++ 1115/mkinitrd/scripts/setup-prepare.sh +@@ -13,43 +13,103 @@ + #%param_v: "Verbose mode." + #%param_L: "Disable logging." + #%param_h: "This help screen." + # + ###### Additional options + ## + ## Script inclusion may be overriden by + ## 1) creating a monster-initrd + ## 2) including the wanted module in the configuration option ADDITIONAL_FEATURES in /etc/sysconfig/initrd + ## 3) definition using the -f command line switch + ## + + # Install a binary file ++# cp_bin file target_filename ++# cp_bin file target_directory ++# cp_bin file file target_directory ++# file is either a regular file or a symlink. symlinks and all paths they point to will be copied ++# the "root" of target is $tmp_mnt, which is required to copy symlinks properly + cp_bin() { +- cp -a "$@" \ +- || exit_code=1 ++ local -a files ++ local target ++ local target_dirname ++ local file + +- # Remember the binaries installed. We need the list for checking +- # for dynamic libraries. +- while [ $# -gt 1 ]; do +- initrd_bins[${#initrd_bins[@]}]=$1 +- shift +- done +- # file may print '^setuid ELF ...' +- # suid mount will fail if mkinitrd was called as user +- if [ -L "$1" ]; then +- : do nothing with symlinks +- elif [ -d "$1" -o -f "$1" ]; then +- find "$1" -type f -print0 | xargs -0 chmod 0755 +- fi ++ # need at least two parameters, source and destination ++ if test $# -lt 2 ++ then ++ return 0 ++ fi ++ # store source filenames ++ until test $# -eq 1 ++ do ++ files=( ${files[@]} $1 ) ++ shift ++ done ++ # store target, either file or directory ++ target=$1 ++ # if more than two parameters, last entry must be a directory ++ if test ${#files[@]} -gt 1 ++ then ++ if ! test -d ${target} ++ then ++ return 0 ++ fi ++ target_dirname=${target} ++ else ++ # simplify symlink resolving for sinlge filename ++ target_dirname=${target%/*} ++ fi ++ ++ for file in ${files[@]} ++ do ++ local src dst ++ src=${file} ++ dst=${target} ++ # copy requested soure file as is to requested destination ++ cp -a -v --remove-destination ${src} ${dst} ++ # copy symlinks recursivly ++ while [ 1 ] ++ do ++ local tmp_src ++ if test -L ${src} ++ then ++ tmp_src=$(readlink ${src}) ++ if test "${tmp_src:0:1}" = "/" ++ then ++ src=${tmp_src} ++ else ++ # relative symlink ++ src=${src%/*}/${tmp_src} ++ fi ++ cp -a -v --remove-destination --parents ${src} $tmp_mnt ++ # if link target exists, proceed to next symlink target ++ if test -e "${src}" ++ then ++ continue ++ fi ++ fi ++ # exit loop in case of dead symlink or if target of symlink was reached ++ break ++ done ++ # if source file exists, add it to list of binaries ++ if test -e "${src}" ++ then ++ # file may print '^setuid ELF ...' ++ # suid mount will fail if mkinitrd was called as user ++ chmod -v 0755 $tmp_mnt/${src} ++ initrd_bins[${#initrd_bins[@]}]=${src} ++ fi ++ done + } + + # check if we should use script or feature $1 + use_script() { + local condition feature script file + + # always use when creating monster initrd + [ "$create_monster_initrd" ] && return 0 + + # Normalize to feature name + feature="${1##*/}" + feature="${feature#*-}" + feature="${feature%.sh}" +Index: 1115/mkinitrd/scripts/setup-progs.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-progs.sh ++++ 1115/mkinitrd/scripts/setup-progs.sh +@@ -28,29 +28,29 @@ for script in $INITRD_PATH/boot/*.sh; do + echo "[ \"\$debug\" ] && echo running $file + source boot/$file + [ \"\$modules\" ] && load_modules" >> run_all.sh + [ "$condition" ] && echo "fi" >> run_all.sh + # and all programs it needs + for files in $(cat $script | grep '%programs: ' | sed 's/^#%programs: \(.*\)$/\1/'); do + for file in $(eval echo $files); do + if [ "${file:0:17}" = "/lib/mkinitrd/bin" ]; then + SOURCE=$file + DEST="./bin/" + elif [ "${file:0:1}" = "/" ]; then # absolute path files have to stay alive + SOURCE=$file + [ ! -e $file -a -e /usr$file ] && SOURCE="/usr$file" +- DEST=".$file" ++ DEST=".$SOURCE" + else + SOURCE=$(which "$file") +- DEST="./bin/" ++ DEST=".$SOURCE" + fi + cp_bin "$SOURCE" "$DEST" + done + done + fi + done + + echo -ne "Features: " + echo $features + + [ -e "bin/sh" ] || ln -s /bin/bash bin/sh + +Index: 1115/mkinitrd/scripts/setup-scsi_dh.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-scsi_dh.sh ++++ 1115/mkinitrd/scripts/setup-scsi_dh.sh +@@ -1,13 +1,13 @@ + #!/bin/bash + # + #%stage: device + # + # Include all scsi_dh_* modules and load them on boot (bnc#727428 et al) + + scsi_dh_modules= +-for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"); do ++for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko" | sort); do + i=${i%.ko} + scsi_dh_modules="$scsi_dh_modules ${i##*/}" + done + + save_var scsi_dh_modules +Index: 1115/mkinitrd/scripts/setup-sharedlibs.sh +=================================================================== +--- 1115.orig/mkinitrd/scripts/setup-sharedlibs.sh ++++ 1115/mkinitrd/scripts/setup-sharedlibs.sh +@@ -54,58 +54,68 @@ shared_object_files() { + while [ -L "/$lib" ]; do + echo $lib + link="$(readlink "/$lib")" + if [ x"${link:0:1}" == x"/" ]; then + lib=${link#/} + else + lib="${lib%/*}/$link" + fi + done + echo $lib + done + } + +-verbose -ne "Shared libs:\t" +-# Copy all required shared libraries and the symlinks that +-# refer to them. +-lib_files=$(shared_object_files "${initrd_bins[@]}") +-[ $? -eq 0 ] || return 1 +-if [ -n "$lib_files" ]; then +- for lib in $lib_files; do +- [ -L $root_dir/$lib ] || verbose -n "$lib " +- ( cd ${root_dir:-/} ; cp -dp --parents $lib $tmp_mnt ) +- done +- lib_files= ++copy_shared_libs() { ++ local bins=( "$@" ) ++ local extra_lib_files lib_files lib i ++ ++ # First see what nss and other libs are required. This can be 64bit or 32bit, ++ # depending on the host and the already copied binaries. + case "$(uname -m)" in + alpha|ia64) ++ # this is a known location + mkdir -p $tmp_mnt/lib +- lib_files="$lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/lib{gcc_s,unwind}.so*`" ++ extra_lib_files="`echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/lib{gcc_s,unwind}.so*`" + ;; + *) +- # no symlinks, most point into the running system +- for i in `LANG=C LC_ALL=C file -b $tmp_mnt/{,usr/}{lib*/udev/,{,s}bin}/* | sed -n 's/^ELF \([0-9][0-9]-bit\) .*/\1/p' | sort -u` ++ # Skip symlinks, they may point into the running system instead of $tmp_mnt ++ for i in `LANG=C LC_ALL=C file -b $tmp_mnt/{,usr/}{lib*/udev,{,s}bin}/* | sed -n 's/^ELF \([0-9][0-9]-bit\) .*/\1/p' | sort -u` + do + case "$i" in + 32-bit) + mkdir -p $tmp_mnt/lib +- lib_files="$lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/libgcc_s.so*`" ++ extra_lib_files="$extra_lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/libgcc_s.so*`" + ;; + 64-bit) + mkdir -p $tmp_mnt/lib64 +- lib_files="$lib_files `echo $root_dir/lib64/libnss_{dns,files}* $root_dir/lib64/libgcc_s.so*`" ++ extra_lib_files="$extra_lib_files `echo $root_dir/lib64/libnss_{dns,files}* $root_dir/lib64/libgcc_s.so*`" + ;; + esac + done + ;; + esac + +- for lib in $lib_files ; do +- if [ -f $lib ] ; then +- verbose -n "${lib##$root_dir/} " +- cp -dp --parents $lib $tmp_mnt ++ verbose -ne "Shared libs:\t" ++ ++ # Now collect a list of libraries on which the binaries and extra libs depend on ++ lib_files=$( shared_object_files ${bins[@]} $extra_lib_files ) ++ if [ $? -eq 0 ] ++ then ++ if [ -n "$lib_files" ] ++ then ++ # Finally copy dependencies and extra libs ++ for lib in $lib_files $extra_lib_files ++ do ++ [ -L $root_dir/$lib ] || verbose -n "$lib " ++ ( cd ${root_dir:-/} ; cp -dp --parents $lib $tmp_mnt ) ++ done ++ verbose ++ else ++ verbose "none" + fi +- done +- verbose +-else +- verbose "none" +-fi ++ else ++ return 1 ++ fi ++} + ++# Copy all required shared libraries and the symlinks that refer to them. ++copy_shared_libs "${initrd_bins[@]}" diff --git a/libguestfs.mkinitrd.1140.patch b/libguestfs.mkinitrd.1140.patch new file mode 100644 index 0000000..81f03d4 --- /dev/null +++ b/libguestfs.mkinitrd.1140.patch @@ -0,0 +1,388 @@ +--- + mkinitrd/scripts/setup-ibft.sh | 2 + mkinitrd/scripts/setup-network.sh | 14 ++++- + mkinitrd/scripts/setup-prepare.sh | 94 ++++++++++++++++++++++++++++------- + mkinitrd/scripts/setup-progs.sh | 17 +----- + mkinitrd/scripts/setup-sharedlibs.sh | 60 +++++++++++++--------- + 5 files changed, 127 insertions(+), 60 deletions(-) + +Index: 1140/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1140.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1140/mkinitrd/scripts/setup-ibft.sh +@@ -9,22 +9,22 @@ ibft_set_iface() { + interface=$if + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + } + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1140/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1140.orig/mkinitrd/scripts/setup-network.sh ++++ 1140/mkinitrd/scripts/setup-network.sh +@@ -231,29 +231,37 @@ if [ "$nettype" = "ifup" ] ; then + drvlink="$drvlink $mod" + verbose "[NETWORK]\t$interface ($nettype)" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if [ "$interface" -a "$nettype" = "static" -a -f /etc/resolv.conf ] ; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + +-# Copy /etc/hosts in any case to be able to resolve static host names in the +-# initrd (bnc #468090) +-cp /etc/hosts $tmp_mnt/etc ++# Copy netcfg files (bnc#468090, bnc#714945) ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + if [ "$interface" -a "$nettype" = "static" ] ; then + ip=$(get_ip_config $interface) + fi + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig.sh $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi +Index: 1140/mkinitrd/scripts/setup-prepare.sh +=================================================================== +--- 1140.orig/mkinitrd/scripts/setup-prepare.sh ++++ 1140/mkinitrd/scripts/setup-prepare.sh +@@ -13,43 +13,103 @@ + #%param_R: "Print release (version)." + #%param_L: "Disable logging." + #%param_h: "This help screen." + # + ###### Additional options + ## + ## Script inclusion may be overriden by + ## 1) creating a monster-initrd + ## 2) including the wanted module in the configuration option ADDITIONAL_FEATURES in /etc/sysconfig/initrd + ## 3) definition using the -f command line switch + ## + + # Install a binary file ++# cp_bin file target_filename ++# cp_bin file target_directory ++# cp_bin file file target_directory ++# file is either a regular file or a symlink. symlinks and all paths they point to will be copied ++# the "root" of target is $tmp_mnt, which is required to copy symlinks properly + cp_bin() { +- cp -a "$@" \ +- || exit_code=1 +- +- # Remember the binaries installed. We need the list for checking +- # for dynamic libraries. +- while [ $# -gt 1 ]; do +- initrd_bins[${#initrd_bins[@]}]=$1 +- shift +- done +- # file may print '^setuid ELF ...' +- # suid mount will fail if mkinitrd was called as user +- if [ -L "$1" ]; then +- : do nothing with symlinks +- elif [ -d "$1" -o -f "$1" ]; then +- find "$1" -type f -print0 | xargs -0 chmod 0755 +- fi ++ local -a files ++ local target ++ local target_dirname ++ local file ++ ++ # need at least two parameters, source and destination ++ if test $# -lt 2 ++ then ++ return 0 ++ fi ++ # store source filenames ++ until test $# -eq 1 ++ do ++ files=( ${files[@]} $1 ) ++ shift ++ done ++ # store target, either file or directory ++ target=$1 ++ # if more than two parameters, last entry must be a directory ++ if test ${#files[@]} -gt 1 ++ then ++ if ! test -d ${target} ++ then ++ return 0 ++ fi ++ target_dirname=${target} ++ else ++ # simplify symlink resolving for sinlge filename ++ target_dirname=${target%/*} ++ fi ++ ++ for file in ${files[@]} ++ do ++ local src dst ++ src=${file} ++ dst=${target} ++ # copy requested soure file as is to requested destination ++ cp -a -v --remove-destination ${src} ${dst} ++ # copy symlinks recursivly ++ while [ 1 ] ++ do ++ local tmp_src ++ if test -L ${src} ++ then ++ tmp_src=$(readlink ${src}) ++ if test "${tmp_src:0:1}" = "/" ++ then ++ src=${tmp_src} ++ else ++ # relative symlink ++ src=${src%/*}/${tmp_src} ++ fi ++ cp -a -v --remove-destination --parents ${src} $tmp_mnt ++ # if link target exists, proceed to next symlink target ++ if test -e "${src}" ++ then ++ continue ++ fi ++ fi ++ # exit loop in case of dead symlink or if target of symlink was reached ++ break ++ done ++ # if source file exists, add it to list of binaries ++ if test -e "${src}" ++ then ++ # file may print '^setuid ELF ...' ++ # suid mount will fail if mkinitrd was called as user ++ chmod -v 0755 $tmp_mnt/${src} ++ initrd_bins[${#initrd_bins[@]}]=${src} ++ fi ++ done + } + + # check if we should use script or feature $1 + use_script() { + local condition feature script file + + # always use when creating monster initrd + [ "$create_monster_initrd" ] && return 0 + + # Normalize to feature name + feature="${1##*/}" + feature="${feature#*-}" + feature="${feature%.sh}" +@@ -143,27 +203,27 @@ fi + for feature in $ADDITIONAL_FEATURES ; do + feature_exists "$feature" || echo "[WARNING] Feature \"$feature\" not found. A typo?" + done + + # create an empty initrd + if ! mkdir $tmp_mnt ; then + error 1 "could not create temporary directory" + fi + + # fill the initrd + cp $INITRD_PATH/bin/linuxrc $linuxrc + mkdir "$tmp_mnt/boot" + +-mkdir -p $tmp_mnt/{sbin,bin,etc,dev,proc,sys,root,config} ++mkdir -p $tmp_mnt/{sbin,bin,etc,dev,proc,sys,root,config,usr/bin,usr/sbin} + + mkdir -p -m 4777 $tmp_mnt/tmp + + # Create a dummy /etc/mtab for mount/umount + echo -n > $tmp_mnt/etc/mtab + + # Add modprobe, modprobe.conf*, and a version of /bin/true: modprobe.conf + # might use it. + for mod in $root_dir/etc/modprobe.conf $root_dir/etc/modprobe.conf.local \ + $root_dir/etc/modprobe.d ; do + test -e $mod && cp -r $mod $tmp_mnt/etc + done + cat > $tmp_mnt/bin/true <<-EOF +Index: 1140/mkinitrd/scripts/setup-progs.sh +=================================================================== +--- 1140.orig/mkinitrd/scripts/setup-progs.sh ++++ 1140/mkinitrd/scripts/setup-progs.sh +@@ -24,48 +24,37 @@ for script in $INITRD_PATH/boot/*.sh; do + condition="$(sed -rn 's/^#[[:blank:]]*%if:[[:blank:]]*(.*)$/if [ \1 ]; then/p' < "$script")" + echo "$condition" >> run_all.sh + # -- remember dependent modules + sed -rn 's/^#[[:blank:]]*%modules:[[:blank:]]*(.*)$/modules="\1"/p' < $script >> run_all.sh + echo "[ \"\$debug\" ] && echo running $file + source boot/$file + [ \"\$modules\" ] && load_modules" >> run_all.sh + [ "$condition" ] && echo "fi" >> run_all.sh + # and all programs it needs + for files in $(sed -rn 's/^#[[:blank:]]*%programs:[[:blank:]]*(.*)$/\1/p' < "$script"); do + for file in $(eval echo $files); do + if [ "${file:0:17}" = "/lib/mkinitrd/bin" ]; then + SOURCE=$file +- DEST="./bin/" ++ DEST="${tmp_mnt}/bin/" + elif [ "${file:0:1}" = "/" ]; then # absolute path files have to stay alive + SOURCE=$file + [ ! -e $file -a -e /usr$file ] && SOURCE="/usr$file" +- DEST=".$file" ++ DEST="${tmp_mnt}$SOURCE" + else + case "$(type -t "$file")" in + builtin) continue + esac + SOURCE=$(type -p "$file") +- DEST="./bin/" ++ DEST="${tmp_mnt}$SOURCE" + fi + + cp_bin "$SOURCE" "$DEST" +- +- # if we're given a symlink, always copy the linked file too +- if [ -L "$SOURCE" ]; then +- LINK=$(readlink -e "$SOURCE") +- if [ -e "$LINK" ]; then +- mkdir -p .$(dirname "$LINK") +- cp_bin "$LINK" ."$LINK" +- else +- echo 2>&1 "WARNING: $LINK is a dangling symlink" +- fi +- fi + done + done + fi + done + + echo -ne "Features: " + echo $features + + [ -e "bin/sh" ] || ln -s /bin/bash bin/sh + +Index: 1140/mkinitrd/scripts/setup-sharedlibs.sh +=================================================================== +--- 1140.orig/mkinitrd/scripts/setup-sharedlibs.sh ++++ 1140/mkinitrd/scripts/setup-sharedlibs.sh +@@ -54,58 +54,68 @@ shared_object_files() { + while [ -L "/$lib" ]; do + echo $lib + link="$(readlink "/$lib")" + if [ x"${link:0:1}" == x"/" ]; then + lib=${link#/} + else + lib="${lib%/*}/$link" + fi + done + echo $lib + done + } + +-verbose -ne "Shared libs:\t" +-# Copy all required shared libraries and the symlinks that +-# refer to them. +-lib_files=$(shared_object_files "${initrd_bins[@]}") +-[ $? -eq 0 ] || return 1 +-if [ -n "$lib_files" ]; then +- for lib in $lib_files; do +- [ -L $root_dir/$lib ] || verbose -n "$lib " +- ( cd ${root_dir:-/} ; cp -dp --parents $lib $tmp_mnt ) +- done +- lib_files= ++copy_shared_libs() { ++ local bins=( "$@" ) ++ local extra_lib_files lib_files lib i ++ ++ # First see what nss and other libs are required. This can be 64bit or 32bit, ++ # depending on the host and the already copied binaries. + case "$(uname -m)" in + ia64) ++ # this is a known location + mkdir -p $tmp_mnt/lib +- lib_files="$lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/lib{gcc_s,unwind}.so*`" ++ extra_lib_files="`echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/lib{gcc_s,unwind}.so*`" + ;; + *) +- # no symlinks, most point into the running system +- for i in `LANG=C LC_ALL=C file -b $tmp_mnt/{,usr/}{lib*/udev/,{,s}bin}/* | sed -n 's/^ELF \([0-9][0-9]-bit\) .*/\1/p' | sort -u` ++ # Skip symlinks, they may point into the running system instead of $tmp_mnt ++ for i in `LANG=C LC_ALL=C file -b $tmp_mnt/{,usr/}{lib*/udev,{,s}bin}/* | sed -n 's/^ELF \([0-9][0-9]-bit\) .*/\1/p' | sort -u` + do + case "$i" in + 32-bit) + mkdir -p $tmp_mnt/lib +- lib_files="$lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/libgcc_s.so*`" ++ extra_lib_files="$extra_lib_files `echo $root_dir/lib/libnss_{dns,files}* $root_dir/lib/libgcc_s.so*`" + ;; + 64-bit) + mkdir -p $tmp_mnt/lib64 +- lib_files="$lib_files `echo $root_dir/lib64/libnss_{dns,files}* $root_dir/lib64/libgcc_s.so*`" ++ extra_lib_files="$extra_lib_files `echo $root_dir/lib64/libnss_{dns,files}* $root_dir/lib64/libgcc_s.so*`" + ;; + esac + done + ;; + esac + +- for lib in $lib_files ; do +- if [ -f $lib ] ; then +- verbose -n "${lib##$root_dir/} " +- cp -dp --parents $lib $tmp_mnt ++ verbose -ne "Shared libs:\t" ++ ++ # Now collect a list of libraries on which the binaries and extra libs depend on ++ lib_files=$( shared_object_files ${bins[@]} $extra_lib_files ) ++ if [ $? -eq 0 ] ++ then ++ if [ -n "$lib_files" ] ++ then ++ # Finally copy dependencies and extra libs ++ for lib in $lib_files $extra_lib_files ++ do ++ [ -L $root_dir/$lib ] || verbose -n "$lib " ++ ( cd ${root_dir:-/} ; cp -dp --parents $lib $tmp_mnt ) ++ done ++ verbose ++ else ++ verbose "none" + fi +- done +- verbose +-else +- verbose "none" +-fi ++ else ++ return 1 ++ fi ++} + ++# Copy all required shared libraries and the symlinks that refer to them. ++copy_shared_libs "${initrd_bins[@]}" diff --git a/libguestfs.mkinitrd.1230.patch b/libguestfs.mkinitrd.1230.patch new file mode 100644 index 0000000..cb12a7b --- /dev/null +++ b/libguestfs.mkinitrd.1230.patch @@ -0,0 +1,95 @@ +--- + mkinitrd/scripts/setup-ibft.sh | 2 +- + mkinitrd/scripts/setup-network.sh | 11 ++++++++++- + mkinitrd/scripts/setup-scsi_dh.sh | 2 +- + 3 files changed, 12 insertions(+), 3 deletions(-) + +Index: 1230/mkinitrd/scripts/setup-ibft.sh +=================================================================== +--- 1230.orig/mkinitrd/scripts/setup-ibft.sh ++++ 1230/mkinitrd/scripts/setup-ibft.sh +@@ -21,22 +21,22 @@ ibft_set_iface() { + interface=$iface + drvlink=$(get_network_module $interface) + if [ ! "$nettype" -a -e $ibft_nic/dhcp ]; then + nettype=dhcp + read ibft_dhcp < $ibft_nic/dhcp + [ "$ibft_dhcp" = "0.0.0.0" ] && nettype=static + else + nettype=static + fi + fi + } + + ibft_nic=/sys/firmware/ibft/ethernet0 +-ibft_hostname=$(hostname) ++ibft_hostname=localhost + + if [ "$root_iscsi" = 1 -a -d $ibft_nic ]; then + ibft_available=1 + ibft_set_iface + fi + save_var ibft_available + save_var ibft_hostname + save_var ibft_nic +Index: 1230/mkinitrd/scripts/setup-network.sh +=================================================================== +--- 1230.orig/mkinitrd/scripts/setup-network.sh ++++ 1230/mkinitrd/scripts/setup-network.sh +@@ -278,27 +278,36 @@ if [ "$nettype" = "ifup" ] ; then + verbose "[NETWORK]\tifup: $interface" + fi + done + interface= + fi + + # Copy the /etc/resolv.conf when the IP is static + if test -n "$static_interfaces"; then + verbose "[NETWORK]\tUsing /etc/resolv.conf from the system in the initrd" + cp /etc/resolv.conf $tmp_mnt/etc + fi + + # Copy netcfg files (bnc#468090, bnc#714945) +-cp /etc/{hosts,protocols,services,netconfig} $tmp_mnt/etc ++cp /etc/{protocols,services,netconfig} $tmp_mnt/etc ++cat > $tmp_mnt/etc/hosts <<_EOH_ ++127.0.0.1 localhost ++::1 localhost ipv6-localhost ipv6-loopback ++fe00::0 ipv6-localnet ++ff00::0 ipv6-mcastprefix ++ff02::1 ipv6-allnodes ++ff02::2 ipv6-allrouters ++ff02::3 ipv6-allhosts ++_EOH_ + + # Get static IP configuration if requested + for iface in $static_interfaces; do + static_ips="$static_ips $(get_ip_config $iface)" + done + + mkdir -p $tmp_mnt/var/lib/dhcpcd + mkdir -p $tmp_mnt/var/run + + cp_bin /lib/mkinitrd/bin/ipconfig $tmp_mnt/bin/ipconfig + if [ -f /etc/udev/rules.d/70-persistent-net.rules ] ; then + cp /etc/udev/rules.d/70-persistent-net.rules $tmp_mnt/etc/udev/rules.d + fi +Index: 1230/mkinitrd/scripts/setup-scsi_dh.sh +=================================================================== +--- 1230.orig/mkinitrd/scripts/setup-scsi_dh.sh ++++ 1230/mkinitrd/scripts/setup-scsi_dh.sh +@@ -1,13 +1,13 @@ + #!/bin/bash + # + #%stage: device + # + # Include all scsi_dh_* modules and load them on boot (bnc#727428 et al) + + scsi_dh_modules= +-for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"); do ++for i in $(find $root_dir/lib/modules/$kernel_version/kernel/drivers/scsi/device_handler -name "scsi[-_]dh[_-]*.ko"| sort); do + i=${i%.ko} + scsi_dh_modules="$scsi_dh_modules ${i##*/}" + done + + save_var scsi_dh_modules diff --git a/libguestfs.spec b/libguestfs.spec index ac9167e..50b263d 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -195,8 +195,11 @@ Source20: libguestfs.mkinitrd.boot-btrfs.sh Source21: libguestfs.mkinitrd.setup-btrfs.sh # Source1310: libguestfs.mkinitrd.1310.patch +Source1230: libguestfs.mkinitrd.1230.patch Source1220: libguestfs.mkinitrd.1220.patch Source1210: libguestfs.mkinitrd.1210.patch +Source1140: libguestfs.mkinitrd.1140.patch +Source1115: libguestfs.mkinitrd.1115.patch Source1110: libguestfs.mkinitrd.1110.patch # Source10001: libguestfs.test.simple.run-libugestfs-test-tool.sh @@ -731,8 +734,11 @@ diff -u mkinitrd/scripts/boot-guestfs.sh~ mkinitrd/scripts/boot-guestfs.sh || : patched= for p in \ %{S:1310} \ + %{S:1230} \ %{S:1220} \ %{S:1210} \ + %{S:1140} \ + %{S:1115} \ %{S:1110} \ ; do From ed4c3170e20fca50045a08b380f7c70917e16461bd6464588101a891b0d79f82 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 9 Dec 2014 15:46:21 +0000 Subject: [PATCH 06/11] - Package guestfs_lvm_conf.aug (bnc#908632) OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=330 --- libguestfs.changes | 5 +++++ libguestfs.mkinitrd.setup.sh | 11 +++++++++++ libguestfs.spec | 1 + 3 files changed, 17 insertions(+) diff --git a/libguestfs.changes b/libguestfs.changes index 74a5fea..d3f200f 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 9 15:44:39 UTC 2014 - ohering@suse.de + +- Package guestfs_lvm_conf.aug (bnc#908632) + ------------------------------------------------------------------- Wed Nov 26 11:02:59 UTC 2014 - ohering@suse.de diff --git a/libguestfs.mkinitrd.setup.sh b/libguestfs.mkinitrd.setup.sh index dfac67a..ba04c46 100644 --- a/libguestfs.mkinitrd.setup.sh +++ b/libguestfs.mkinitrd.setup.sh @@ -57,6 +57,17 @@ do fi done +mkdir -p $tmp_mnt/usr/share/guestfs +if test -n "$LIBGUESTFS_SRC_APPLIANCE_DIR" +then + for f in $LIBGUESTFS_SRC_APPLIANCE_DIR/*.aug + do + if test -e $f + then + cp -Lavt $tmp_mnt/usr/share/guestfs $f + fi + done +fi for d in /usr/lib*/gconv do if test -e $d diff --git a/libguestfs.spec b/libguestfs.spec index 50b263d..8de44a9 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -780,6 +780,7 @@ chmod -v 755 mkinitrd/bin_tmp/* additional_modules=" " env PATH=${RPM_BUILD_ROOT}/usr/bin:${RPM_BUILD_ROOT}/usr/sbin:${PATH} \ +LIBGUESTFS_SRC_APPLIANCE_DIR=`cd $PWD/appliance ; pwd -P` \ bash -x \ ./mkinitrd.sh \ -l $PWD/mkinitrd \ From b2e0d44130f860af3bc3e7b33a186504f400f4bce331b4d940255abf06378c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Fri, 6 Feb 2015 14:52:49 +0000 Subject: [PATCH 07/11] Accepting request 284494 from home:cbosdonnat:branches:Virtualization - Make zypper called with -n parameter when installing packages. 5f663c20-zypper-non-interactive.patch (bsc#916567) OBS-URL: https://build.opensuse.org/request/show/284494 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=331 --- 5f663c20-zypper-non-interactive.patch | 23 +++++++++++++++++++++++ libguestfs.changes | 6 ++++++ libguestfs.spec | 5 ++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 5f663c20-zypper-non-interactive.patch diff --git a/5f663c20-zypper-non-interactive.patch b/5f663c20-zypper-non-interactive.patch new file mode 100644 index 0000000..1676452 --- /dev/null +++ b/5f663c20-zypper-non-interactive.patch @@ -0,0 +1,23 @@ +From 5f663c2082446f2b9722c3cb0fcac6c5778978e8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= +Date: Tue, 3 Feb 2015 14:38:02 +0000 +Subject: [PATCH] customize: Invoke zypper correctly. + +--- + customize/customize_run.ml | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +Index: libguestfs-1.26.9/customize/customize_run.ml +=================================================================== +--- libguestfs-1.26.9.orig/customize/customize_run.ml ++++ libguestfs-1.26.9/customize/customize_run.ml +@@ -105,8 +105,7 @@ exec >>%s 2>&1 + | "yum" -> + sprintf "yum -y install %s" quoted_args + | "zypper" -> +- (* XXX Should we use -n option? *) +- sprintf "zypper in %s" quoted_args ++ sprintf "zypper -n in %s" quoted_args + | "unknown" -> + eprintf (f_"%s: --install is not supported for this guest operating system\n") + prog; diff --git a/libguestfs.changes b/libguestfs.changes index d3f200f..587cf38 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 6 13:45:22 UTC 2015 - cbosdonnat@suse.com + +- Make zypper called with -n parameter when installing packages. + 5f663c20-zypper-non-interactive.patch (bsc#916567) + ------------------------------------------------------------------- Tue Dec 9 15:44:39 UTC 2014 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 8de44a9..150de27 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -1,7 +1,7 @@ # # spec file for package libguestfs # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2011 Michal Hrusecky # # All modifications and additions to the file contributed by third parties @@ -176,6 +176,8 @@ Summary: Compatibility package for guestfs-tools License: GPL-2.0 Group: System/Filesystems Patch0: 0000-hotfix.patch +# Upstream patch +Patch1: 5f663c20-zypper-non-interactive.patch Patch1000: 1000-force-virtio_blk-in-old-guest-kernel.patch Source0: %{name}-%{version}.tar.xz Source42: libguestfs.mkinitrd.tar.bz2 @@ -512,6 +514,7 @@ virtual machines. : _ignore_exclusive_arch '%{?_ignore_exclusive_arch}' %setup -q -a 789653 -a 42 %patch0 -p1 +%patch1 -p1 %patch1000 -p1 %build From ae6bbcfcef18192c74a19cf48c4244824397c4ca55b4e86837bfe787e6388ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Fri, 6 Feb 2015 15:27:36 +0000 Subject: [PATCH 08/11] Accepting request 284504 from home:cbosdonnat:branches:Virtualization Merging with hostfix patch OBS-URL: https://build.opensuse.org/request/show/284504 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=332 --- 0000-hotfix.patch | 14 ++++++++++++++ 5f663c20-zypper-non-interactive.patch | 23 ----------------------- libguestfs.changes | 2 +- libguestfs.spec | 3 --- 4 files changed, 15 insertions(+), 27 deletions(-) delete mode 100644 5f663c20-zypper-non-interactive.patch diff --git a/0000-hotfix.patch b/0000-hotfix.patch index fe556db..2710ab6 100644 --- a/0000-hotfix.patch +++ b/0000-hotfix.patch @@ -28,3 +28,17 @@ index 7a4d43d..ceea593 100644 ADD_ARG (argv, i, fs_buf); ADD_ARG (argv, i, NULL); +Index: libguestfs-1.26.9/customize/customize_run.ml +=================================================================== +--- libguestfs-1.26.9.orig/customize/customize_run.ml ++++ libguestfs-1.26.9/customize/customize_run.ml +@@ -105,8 +105,7 @@ exec >>%s 2>&1 + | "yum" -> + sprintf "yum -y install %s" quoted_args + | "zypper" -> +- (* XXX Should we use -n option? *) +- sprintf "zypper in %s" quoted_args ++ sprintf "zypper -n in %s" quoted_args + | "unknown" -> + eprintf (f_"%s: --install is not supported for this guest operating system\n") + prog; diff --git a/5f663c20-zypper-non-interactive.patch b/5f663c20-zypper-non-interactive.patch deleted file mode 100644 index 1676452..0000000 --- a/5f663c20-zypper-non-interactive.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 5f663c2082446f2b9722c3cb0fcac6c5778978e8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= -Date: Tue, 3 Feb 2015 14:38:02 +0000 -Subject: [PATCH] customize: Invoke zypper correctly. - ---- - customize/customize_run.ml | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -Index: libguestfs-1.26.9/customize/customize_run.ml -=================================================================== ---- libguestfs-1.26.9.orig/customize/customize_run.ml -+++ libguestfs-1.26.9/customize/customize_run.ml -@@ -105,8 +105,7 @@ exec >>%s 2>&1 - | "yum" -> - sprintf "yum -y install %s" quoted_args - | "zypper" -> -- (* XXX Should we use -n option? *) -- sprintf "zypper in %s" quoted_args -+ sprintf "zypper -n in %s" quoted_args - | "unknown" -> - eprintf (f_"%s: --install is not supported for this guest operating system\n") - prog; diff --git a/libguestfs.changes b/libguestfs.changes index 587cf38..69115a0 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -2,7 +2,7 @@ Fri Feb 6 13:45:22 UTC 2015 - cbosdonnat@suse.com - Make zypper called with -n parameter when installing packages. - 5f663c20-zypper-non-interactive.patch (bsc#916567) + (bsc#916567) ------------------------------------------------------------------- Tue Dec 9 15:44:39 UTC 2014 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 150de27..4cc375f 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -176,8 +176,6 @@ Summary: Compatibility package for guestfs-tools License: GPL-2.0 Group: System/Filesystems Patch0: 0000-hotfix.patch -# Upstream patch -Patch1: 5f663c20-zypper-non-interactive.patch Patch1000: 1000-force-virtio_blk-in-old-guest-kernel.patch Source0: %{name}-%{version}.tar.xz Source42: libguestfs.mkinitrd.tar.bz2 @@ -514,7 +512,6 @@ virtual machines. : _ignore_exclusive_arch '%{?_ignore_exclusive_arch}' %setup -q -a 789653 -a 42 %patch0 -p1 -%patch1 -p1 %patch1000 -p1 %build From 995f04f76d6c6a684ad25046b70fa3f82cec7f43e736f1c0f228b04a41f9b48c Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 24 Feb 2015 10:08:29 +0000 Subject: [PATCH 09/11] - Update to version 1.26.10 * gcc5: test-tool: Initialize local variable. * lua: Define luaL_checkint which was deprecated in lua 5.3. * tools: fix free -m invocation OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=333 --- libguestfs-1.26.10.tar.xz | 3 +++ libguestfs-1.26.9.tar.xz | 3 --- libguestfs.changes | 8 ++++++++ libguestfs.spec | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 libguestfs-1.26.10.tar.xz delete mode 100644 libguestfs-1.26.9.tar.xz diff --git a/libguestfs-1.26.10.tar.xz b/libguestfs-1.26.10.tar.xz new file mode 100644 index 0000000..0ccdf26 --- /dev/null +++ b/libguestfs-1.26.10.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d9950647f8316ef0c397c2b82652dc268a8a82baa43046af393239800a05620 +size 5015800 diff --git a/libguestfs-1.26.9.tar.xz b/libguestfs-1.26.9.tar.xz deleted file mode 100644 index f8bf2b3..0000000 --- a/libguestfs-1.26.9.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1e469866bf3de195a8f9be1e48447b238d728ad38a052856d1523173de7b34cb -size 5016064 diff --git a/libguestfs.changes b/libguestfs.changes index 69115a0..af9b0ae 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Feb 24 09:43:58 UTC 2015 - ohering@suse.de + +- Update to version 1.26.10 + * gcc5: test-tool: Initialize local variable. + * lua: Define luaL_checkint which was deprecated in lua 5.3. + * tools: fix free -m invocation + ------------------------------------------------------------------- Fri Feb 6 13:45:22 UTC 2015 - cbosdonnat@suse.com diff --git a/libguestfs.spec b/libguestfs.spec index 4cc375f..0a728cc 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -1,7 +1,7 @@ # # spec file for package libguestfs # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2011 Michal Hrusecky # # All modifications and additions to the file contributed by third parties @@ -17,7 +17,7 @@ # -Version: 1.26.9 +Version: 1.26.10 Release: 0 %define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) From dad1f5daa715f962a21e940845ed3eb3d89e60334fdd2053095807595ab2924a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 9 Mar 2015 13:59:16 +0000 Subject: [PATCH 10/11] - Workaround bug in patch(1) which does not follow symlinks anymore OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=334 --- libguestfs.changes | 5 +++++ libguestfs.spec | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libguestfs.changes b/libguestfs.changes index af9b0ae..5ab0c17 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 9 13:58:47 UTC 2015 - ohering@suse.de + +- Workaround bug in patch(1) which does not follow symlinks anymore + ------------------------------------------------------------------- Tue Feb 24 09:43:58 UTC 2015 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 0a728cc..3fc09c3 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -731,6 +731,7 @@ a \ ' mkinitrd/scripts/boot-guestfs.sh diff -u mkinitrd/scripts/boot-guestfs.sh~ mkinitrd/scripts/boot-guestfs.sh || : # +pushd mkinitrd patched= for p in \ %{S:1310} \ @@ -742,17 +743,18 @@ for p in \ %{S:1110} \ ; do - if patch --dry-run -p1 < $p + if patch --dry-run -p2 < $p then - patch -p1 < $p + patch -p2 < $p patched=$p break - elif patch --dry-run -R -p1 < $p + elif patch --dry-run -R -p2 < $p then patched=$p break fi done +popd test -n "$patched" ./mkinitrd_setup.sh \ From c5331f9a1a7303462de328151631e6ab975bfc73feda217c7df3777e614d795e Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 9 Mar 2015 14:15:20 +0000 Subject: [PATCH 11/11] - Force feature usb into initrd to avoid build-compare noise OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=335 --- libguestfs.changes | 5 +++++ libguestfs.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libguestfs.changes b/libguestfs.changes index 5ab0c17..e05a27c 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 9 14:14:52 UTC 2015 - ohering@suse.de + +- Force feature usb into initrd to avoid build-compare noise + ------------------------------------------------------------------- Mon Mar 9 13:58:47 UTC 2015 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 3fc09c3..6f48347 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -790,7 +790,7 @@ bash -x \ -i initramfs.${arch}.img \ -b $PWD/mkinitrd/boot_tmp \ -m "$additional_modules" \ - -f "lvm2 dm md network nfs btrfs" \ + -f "lvm2 dm md network nfs btrfs usb" \ -B # mkdir -vp $RPM_BUILD_ROOT%{_libdir}/guestfs