]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: fallback to fstatat if entry->d_type is DT_UNKNOWN
authorEvgeny Vereshchagin <evvers@ya.ru>
Mon, 4 Apr 2016 11:07:56 +0000 (14:07 +0300)
committerLennart Poettering <lennart@poettering.net>
Mon, 4 Apr 2016 11:07:56 +0000 (13:07 +0200)
* tests-functions: improve FSTYPE-support

make clean setup FSTYPE=reiserfs is working fine now :)

* basic: fallback to fstatat if entry->d_type is DT_UNKNOWN

Fixes localectl on reiserfs:

-bash-4.3# mkdir -p /usr/lib/locale
-bash-4.3# stat -f /usr/lib/locale/
  File: "/usr/lib/locale/"
    ID: bdb0322715b5366e Namelen: 255     Type: reiserfs
Block size: 4096
Blocks: Total: 99835      Free: 60262      Available: 60262
Inodes: Total: 0          Free: 0
-bash-4.3# mkdir /usr/lib/locale/HeyHo
-bash-4.3# localectl list-locales --no-pager

-bash-4.3# mount -t tmpfs tmpfs /usr/lib/locale
-bash-4.3# mkdir /usr/lib/locale/HeyHo
-bash-4.3# localectl list-locales --no-pager
HeyHo

src/basic/locale-util.c
test/test-functions

index cda6b2895d6497dc237aba91001c8e74f88458d4..eaad25e65bf92c143b332cb11d048480e8804e69 100644 (file)
@@ -153,6 +153,8 @@ static int add_locales_from_libdir (Set *locales) {
         FOREACH_DIRENT(entry, dir, return -errno) {
                 char *z;
 
+                dirent_ensure_type(dir, entry);
+
                 if (entry->d_type != DT_DIR)
                         continue;
 
index 29f647ece46a90c2848184e9c6401cf59cfff310..8bbcddab590cf6dc9b4c216723fc81c24b362d68 100644 (file)
@@ -213,6 +213,9 @@ EOF
 install_fsck() {
     dracut_install /sbin/fsck*
     dracut_install -o /bin/fsck*
+
+    # fskc.reiserfs calls reiserfsck. so, install it
+    dracut_install -o reiserfsck
 }
 
 install_dmevent() {
@@ -257,7 +260,13 @@ create_empty_image() {
 ,
 EOF
 
-    mkfs -t "$FSTYPE" -L systemd "${LOOPDEV}p1"
+    local _label="-L systemd"
+    # mkfs.reiserfs doesn't know -L. so, use --label instead
+    [[ "$FSTYPE" == "reiserfs" ]] && _label="--label systemd"
+    if ! mkfs -t "${FSTYPE}" ${_label} "${LOOPDEV}p1" -q; then
+        dfatal "Failed to mkfs -t ${FSTYPE}"
+        exit 1
+    fi
 }
 
 check_result_nspawn() {
@@ -351,7 +360,7 @@ install_config_files() {
     echo systemd-testsuite > $initdir/etc/hostname
     # fstab
     cat >$initdir/etc/fstab <<EOF
-LABEL=systemd           /       ext3    rw 0 1
+LABEL=systemd           /       ${FSTYPE}    rw 0 1
 EOF
 }