mirror of
https://github.com/fspc/gbootroot.git
synced 2025-02-23 09:03:23 -05:00
A little experiment with reiserfs which didn't work on a loop device, ofcourse,
but is set-up if it ever does. More verbosity when dd runs.
This commit is contained in:
parent
7b8d0e99db
commit
e017fcaa55
@ -1159,16 +1159,19 @@ sub create_filesystem {
|
|||||||
# Allow smaller than 8192 if exclusive.
|
# Allow smaller than 8192 if exclusive.
|
||||||
if ( $uml_exclusively == 1 ) {
|
if ( $uml_exclusively == 1 ) {
|
||||||
sync();
|
sync();
|
||||||
|
info(1,"dd if=/dev/zero of=$device bs=1k count=$fs_size\n");
|
||||||
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
||||||
sync();
|
sync();
|
||||||
}
|
}
|
||||||
elsif ( $> != 0 && $fs_size > 8192 && $fs_type eq "genext2fs" ) {
|
elsif ( $> != 0 && $fs_size > 8192 && $fs_type eq "genext2fs" ) {
|
||||||
sync();
|
sync();
|
||||||
|
info(1,"dd if=/dev/zero of=$device bs=1k count=$fs_size\n");
|
||||||
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
||||||
sync();
|
sync();
|
||||||
}
|
}
|
||||||
elsif ( $fs_type ne "genext2fs" ) {
|
elsif ( $fs_type ne "genext2fs" ) {
|
||||||
sync();
|
sync();
|
||||||
|
info(1,"dd if=/dev/zero of=$device bs=1k count=$fs_size\n");
|
||||||
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
sys("dd if=/dev/zero of=$device bs=1k count=$fs_size");
|
||||||
sync();
|
sync();
|
||||||
}
|
}
|
||||||
@ -1180,22 +1183,46 @@ sub create_filesystem {
|
|||||||
$uml_exclusively == 0 ) {
|
$uml_exclusively == 0 ) {
|
||||||
|
|
||||||
if (-f $device) {
|
if (-f $device) {
|
||||||
|
|
||||||
##### If device is a plain file, it means we're using some
|
##### If device is a plain file, it means we're using some
|
||||||
##### loopback device. Use -F switch in mke2fs so it
|
##### loopback device. Use -F switch in mke2fs so it
|
||||||
##### won't complain.
|
##### won't complain.
|
||||||
## Options here can be changed.
|
## Options here can be changed.
|
||||||
## Originally, this was -b 1024 switched with the inode approach.
|
## Originally, this was -b 1024 switched with the inode approach.
|
||||||
if (sys("$main::makefs $device $fs_size") !~
|
# Basically this won't work because mkreiserfs demands a
|
||||||
/^0$/ ) {
|
# special block device, but maybe this will change, that is
|
||||||
$error = error("Cannot $fs_type filesystem.\n");
|
# where root_fs_helper steps in to the rescue.
|
||||||
return "ERROR" if $error && $error eq "ERROR";
|
if ( $fs_type eq "mkreiserfs" ) {
|
||||||
|
if (sys("$main::makefs $device") !~
|
||||||
|
/^0$/ ) {
|
||||||
|
$error = error("Cannot $fs_type filesystem.\n");
|
||||||
|
return "ERROR" if $error && $error eq "ERROR";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
if (sys("$main::makefs $device $fs_size") !~
|
||||||
|
/^0$/ ) {
|
||||||
|
$error = error("Cannot $fs_type filesystem.\n");
|
||||||
|
return "ERROR" if $error && $error eq "ERROR";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (sys("$main::makefs $device $fs_size") !~
|
if ( $fs_type eq "mkreiserfs" ) {
|
||||||
/^0$/ ) {
|
if (sys("$main::makefs $device") !~
|
||||||
$error = error("Cannot $fs_type filesystem.\n");
|
/^0$/ ) {
|
||||||
return "ERROR" if $error && $error eq "ERROR";
|
$error = error("Cannot $fs_type filesystem.\n");
|
||||||
|
return "ERROR" if $error && $error eq "ERROR";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (sys("$main::makefs $device $fs_size") !~
|
||||||
|
/^0$/ ) {
|
||||||
|
$error = error("Cannot $fs_type filesystem.\n");
|
||||||
|
return "ERROR" if $error && $error eq "ERROR";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user