mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
udev: fix vol_id ext4 detection if it has no journal.
This commit is contained in:
31
lfs/udev
31
lfs/udev
@@ -1,7 +1,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2005-2010 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
@@ -77,33 +77,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-netif_rename.patch
|
||||
ifeq "$(LFS_PASS)" "install"
|
||||
cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev
|
||||
cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev install
|
||||
rm -f /install/initrd/sbin/udev* /install/initrd/usr/sbin/udev* /install/initrd/usr/bin/udev*
|
||||
cd $(DIR_APP) && install udevadm udevd /install/initrd/sbin
|
||||
cd $(DIR_APP) && make $(MAKETUNING) EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
|
||||
extras/firmware extras/floppy extras/path_id \
|
||||
extras/scsi_id extras/usb_id extras/volume_id"
|
||||
cd $(DIR_APP) && make DESTDIR=/install/initrd EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \
|
||||
extras/firmware extras/floppy extras/path_id \
|
||||
extras/scsi_id extras/usb_id extras/volume_id" install
|
||||
cd /install/initrd/usr/share && rm -rf man
|
||||
-mkdir -pv /install/initrd/dev
|
||||
cd /install/initrd/dev && rm -f console
|
||||
cd /install/initrd/dev && mknod -m 0600 console c 5 1
|
||||
cd /install/initrd/dev && rm -f null
|
||||
cd /install/initrd/dev && mknod -m 0777 null c 1 3
|
||||
cd /install/initrd/dev && rm -f tty*
|
||||
cd /install/initrd/dev && mknod -m 0600 tty1 c 4 1
|
||||
cd /install/initrd/dev && mknod -m 0600 tty2 c 4 2
|
||||
cd /install/initrd/dev && mknod -m 0600 tty3 c 4 3
|
||||
cd /install/initrd/dev && mknod -m 0600 tty4 c 4 4
|
||||
cd /install/initrd/dev && mknod -m 0600 tty5 c 4 5
|
||||
cd /install/initrd/dev && mknod -m 0600 tty6 c 4 6
|
||||
cp -f /etc/udev/rules.d/55-scsi-cdrom.rules /install/initrd/etc/udev/rules.d/55-scsi-cdrom.rules
|
||||
|
||||
else
|
||||
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-125-ext4_wo_journal.patch
|
||||
rm -rf /lib/udev/devices
|
||||
cd $(DIR_APP) && tar jxf $(DIR_DL)/udev-config-6.2.tar.bz2
|
||||
cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/udev-config-6.2_persistent-storage-fix.patch
|
||||
@@ -131,6 +105,5 @@ else
|
||||
chmod 755 /etc/udev/dvb.sh
|
||||
touch /etc/udev/rules.d/30-persistent-network.rules
|
||||
cp -vf $(DIR_SRC)/config/udev/blacklist /etc/modprobe.d/blacklist
|
||||
endif
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
|
||||
50
src/patches/udev-125-ext4_wo_journal.patch
Normal file
50
src/patches/udev-125-ext4_wo_journal.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
diff -Naur udev-125.org/extras/volume_id/lib/ext.c udev-125/extras/volume_id/lib/ext.c
|
||||
--- udev-125.org/extras/volume_id/lib/ext.c 2008-07-18 16:26:55.000000000 +0200
|
||||
+++ udev-125/extras/volume_id/lib/ext.c 2012-06-25 00:52:40.976563010 +0200
|
||||
@@ -160,32 +160,31 @@
|
||||
goto found;
|
||||
}
|
||||
|
||||
- /* has journal */
|
||||
- if ((feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) {
|
||||
- /* "use on development code" is ext4dev */
|
||||
- if ((flags & EXT2_FLAGS_TEST_FILESYS) != 0) {
|
||||
- id->type = "ext4dev";
|
||||
- goto found;
|
||||
- }
|
||||
+ /* "use on development code" is ext4dev */
|
||||
+ if ((flags & EXT2_FLAGS_TEST_FILESYS) != 0) {
|
||||
+ id->type = "ext4dev";
|
||||
+ goto found;
|
||||
+ }
|
||||
|
||||
- /* incompatible ext3 features is ext4 */
|
||||
- if ((feature_ro_compat & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) != 0 ||
|
||||
- (feature_incompat & EXT3_FEATURE_INCOMPAT_UNSUPPORTED) != 0) {
|
||||
- id->type = "ext4";
|
||||
- goto found;
|
||||
- }
|
||||
+ /* incompatible ext3 features is ext4 */
|
||||
+ if ((feature_ro_compat & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) != 0 ||
|
||||
+ (feature_incompat & EXT3_FEATURE_INCOMPAT_UNSUPPORTED) != 0) {
|
||||
+ id->type = "ext4";
|
||||
+ goto found;
|
||||
+ }
|
||||
|
||||
+ /* has journal */
|
||||
+ if ((feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) {
|
||||
id->type = "ext3";
|
||||
goto found;
|
||||
} else {
|
||||
- /* no incompatible ext2 feature is ext2 */
|
||||
+ /* no incompatible ext2 feature is ext2 */
|
||||
if ((feature_ro_compat & EXT2_FEATURE_RO_COMPAT_UNSUPPORTED) == 0 &&
|
||||
(feature_incompat & EXT2_FEATURE_INCOMPAT_UNSUPPORTED) == 0) {
|
||||
id->type = "ext2";
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
-
|
||||
return -1;
|
||||
|
||||
found:
|
||||
Reference in New Issue
Block a user