Accepting request 184008 from home:olh:branches:filesystems

NOT tested with real btrfs root filesystem!


- Simplify checks in mkinitrd scripts.
  They are always true because they come from the same package
  Use relative paths to binaries
- Move udev rules to /usr.
- Adjust rules to call binary from /usr
- Simplify fsck.btrfs, its just a dummy until fixed

OBS-URL: https://build.opensuse.org/request/show/184008
OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=133
This commit is contained in:
Jeff Mahoney 2013-07-26 21:25:13 +00:00 committed by Git OBS Bridge
parent d5292b73cb
commit 679e0a0c96
5 changed files with 35 additions and 22 deletions

View File

@ -15,6 +15,6 @@ GOTO="btrfs_end"
LABEL="btrfs_do_scan"
RUN+="/sbin/modprobe btrfs"
RUN+="/sbin/btrfs device scan $env{DEVNAME}"
RUN+="/usr/sbin/btrfs device scan $env{DEVNAME}"
LABEL="btrfs_end"

View File

@ -1,12 +1,22 @@
#!/bin/bash -e
#%stage: filesystem
#%depends: dm dmraid lvm2 udev md luks
#%if: -x /usr/sbin/btrfs
#%programs: /sbin/btrfs /sbin/btrfs-zero-log /sbin/btrfs-convert /sbin/btrfs-select-super /sbin/btrfs-image /sbin/btrfstune /sbin/btrfs-find-root /sbin/btrfsck /sbin/mkfs.btrfs /sbin/btrfs-dump-super /sbin/btrfs-debug-tree
#%programs: btrfs
#%programs: btrfs-convert
#%programs: btrfs-debug-tree
#%programs: btrfs-dump-super
#%programs: btrfs-find-root
#%programs: btrfs-image
#%programs: btrfs-select-super
#%programs: btrfs-zero-log
#%programs: btrfsck
#%programs: btrfstune
# for fsck(8): listed twice so that a copy really ends up in /sbin
#%programs: /sbin/fsck.btrfs
#%programs: fsck.btrfs
#%programs: mkfs.btrfs
#%modules: btrfs
modprobe btrfs
if [ -x /usr/sbin/btrfs ]; then
/usr/sbin/btrfs dev scan >& /dev/null
fi
btrfs dev scan >& /dev/null

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jul 22 17:50:52 CEST 2013 - ohering@suse.de
- Simplify checks in mkinitrd scripts.
They are always true because they come from the same package
Use relative paths to binaries
- Move udev rules to /usr.
- Adjust rules to call binary from /usr
- Simplify fsck.btrfs, its just a dummy until fixed
-------------------------------------------------------------------
Thu Jul 4 12:30:41 CEST 2013 - dsterba@suse.cz

View File

@ -111,13 +111,8 @@ ln -s %{_sbindir}/btrfs-show-super ${RPM_BUILD_ROOT}/sbin
ln -s %{_sbindir}/mkfs.btrfs ${RPM_BUILD_ROOT}/sbin
#EndUsrMerge
# command line options are not compatible (bnc#599224)
# copy needed if /bin is different fs from /sbin
if [ -x "%{_bindir}/true" ]; then
cp %{_bindir}/true ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
else
echo -e '#!/bin/sh\nexit 0' > ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
chmod +x ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
fi
echo -e '#!/bin/sh\nexit 0' > ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
chmod +x ${RPM_BUILD_ROOT}/%{_sbindir}/fsck.btrfs
#UsrMerge
ln -s %{_sbindir}/fsck.btrfs ${RPM_BUILD_ROOT}/sbin
#EndUsrMerge
@ -125,8 +120,8 @@ install -d -m0755 ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
install -m 0755 %{S:1} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
install -m 0755 %{S:4} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/
install -d -m 0755 $RPM_BUILD_ROOT/lib/udev/rules.d
install -m 0644 %{S:3} $RPM_BUILD_ROOT/lib/udev/rules.d
install -d -m 0755 $RPM_BUILD_ROOT/usr/lib/udev/rules.d
install -m 0644 %{S:3} $RPM_BUILD_ROOT/usr/lib/udev/rules.d
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la
# don't install .a for now
rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a
@ -175,9 +170,9 @@ rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a
%_mandir/man8/mkfs.btrfs.8.gz
%_mandir/man8/btrfs.8.gz
%_mandir/man8/btrfs-convert.8.gz
%dir /lib/udev/
%dir /lib/udev/rules.d/
/lib/udev/rules.d/80-btrfs.rules
%dir /usr/lib/udev/
%dir /usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/80-btrfs.rules
%files -n libbtrfs0
%defattr(-, root, root)

View File

@ -2,7 +2,5 @@
#
#%stage: filesystem
if [ -x /sbin/btrfs ]; then
mkdir -p $tmp_mnt/lib/udev/rules.d
cp /lib/udev/rules.d/80-btrfs.rules $tmp_mnt/lib/udev/rules.d
fi
mkdir -p $tmp_mnt/etc/udev/rules.d
cp /usr/lib/udev/rules.d/80-btrfs.rules $tmp_mnt/etc/udev/rules.d