mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Samba-Update von Maniac...
Reiser4! Juhuu! git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@433 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
# Begin /etc/fstab
|
||||
|
||||
#
|
||||
# file system mount-point type options dump fsck
|
||||
# order
|
||||
|
||||
DEVICE1 /boot ext2 defaults 1 2
|
||||
DEVICE2 swap swap pri=1 0 0
|
||||
DEVICE3 / reiserfs defaults 1 1
|
||||
DEVICE4 /var reiserfs defaults 1 1
|
||||
DEVICE3 / reiser4 defaults 1 1
|
||||
DEVICE4 /var reiser4 defaults 1 1
|
||||
proc /proc proc defaults 0 0
|
||||
sysfs /sys sysfs defaults 0 0
|
||||
devpts /dev/pts devpts gid=4,mode=620 0 0
|
||||
shm /dev/shm tmpfs defaults 0 0
|
||||
# End /etc/fstab
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.16
|
||||
# Thu Feb 15 06:11:38 2007
|
||||
# Sat Feb 24 18:21:11 2007
|
||||
#
|
||||
CONFIG_X86_32=y
|
||||
CONFIG_SEMAPHORE_SLEEPERS=y
|
||||
@@ -1367,7 +1367,6 @@ CONFIG_MISDN_AVM_FRITZ=y
|
||||
CONFIG_MISDN_NETJET=y
|
||||
CONFIG_MISDN_HFCPCI=y
|
||||
# CONFIG_MISDN_HFCMULTI is not set
|
||||
# CONFIG_HFCMULTI_PCIMEM is not set
|
||||
CONFIG_MISDN_HFCUSB=y
|
||||
CONFIG_MISDN_HFCMINI=y
|
||||
CONFIG_MISDN_XHFC=y
|
||||
@@ -1846,6 +1845,8 @@ CONFIG_EXT3_FS_SECURITY=y
|
||||
CONFIG_JBD=y
|
||||
# CONFIG_JBD_DEBUG is not set
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_REISER4_FS=y
|
||||
# CONFIG_REISER4_DEBUG is not set
|
||||
CONFIG_REISERFS_FS=y
|
||||
# CONFIG_REISERFS_CHECK is not set
|
||||
CONFIG_REISERFS_PROC_INFO=y
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.16
|
||||
# Thu Feb 15 06:11:51 2007
|
||||
# Sat Feb 24 18:21:44 2007
|
||||
#
|
||||
CONFIG_X86_32=y
|
||||
CONFIG_SEMAPHORE_SLEEPERS=y
|
||||
@@ -1367,7 +1367,6 @@ CONFIG_MISDN_AVM_FRITZ=y
|
||||
CONFIG_MISDN_NETJET=y
|
||||
CONFIG_MISDN_HFCPCI=y
|
||||
# CONFIG_MISDN_HFCMULTI is not set
|
||||
# CONFIG_HFCMULTI_PCIMEM is not set
|
||||
CONFIG_MISDN_HFCUSB=y
|
||||
CONFIG_MISDN_HFCMINI=y
|
||||
CONFIG_MISDN_XHFC=y
|
||||
@@ -1841,6 +1840,8 @@ CONFIG_EXT3_FS_SECURITY=y
|
||||
CONFIG_JBD=y
|
||||
# CONFIG_JBD_DEBUG is not set
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_REISER4_FS=y
|
||||
# CONFIG_REISER4_DEBUG is not set
|
||||
CONFIG_REISERFS_FS=y
|
||||
# CONFIG_REISERFS_CHECK is not set
|
||||
CONFIG_REISERFS_PROC_INFO=y
|
||||
|
||||
@@ -56,7 +56,7 @@ usr/bin/paste
|
||||
#usr/bin/pinky
|
||||
#usr/bin/pr
|
||||
#usr/bin/printenv
|
||||
#usr/bin/printf
|
||||
usr/bin/printf
|
||||
#usr/bin/ptx
|
||||
#usr/bin/readlink
|
||||
usr/bin/seq
|
||||
|
||||
@@ -19,6 +19,7 @@ usr/lib/grub
|
||||
#usr/lib/grub/i386-pc/jfs_stage1_5
|
||||
#usr/lib/grub/i386-pc/minix_stage1_5
|
||||
#usr/lib/grub/i386-pc/reiserfs_stage1_5
|
||||
#usr/lib/grub/i386-pc/reiser4_stage1_5
|
||||
#usr/lib/grub/i386-pc/stage1
|
||||
#usr/lib/grub/i386-pc/stage2
|
||||
#usr/lib/grub/i386-pc/stage2_eltorito
|
||||
|
||||
@@ -123,6 +123,8 @@
|
||||
* lame-3.96.1
|
||||
* lcms-1.15
|
||||
* less-394
|
||||
* libaal-1.0.5
|
||||
* libaal-1.0.5-minimal
|
||||
* libart_lgpl-2.3.17
|
||||
* libcap-1.10
|
||||
* libmad-0.15.1b
|
||||
@@ -200,6 +202,7 @@
|
||||
* psmisc-22.2
|
||||
* razor-agents-2.81
|
||||
* readline-5.1
|
||||
* reiser4progs-1.0.5
|
||||
* reiserfsprogs-3.6.19
|
||||
* rp-pppoe-3.8
|
||||
* rrdtool-1.2.15
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
# This code is distributed under the terms of the GPL
|
||||
#
|
||||
# (c) The IPFire Team
|
||||
#
|
||||
|
||||
use strict;
|
||||
# enable only the following on debugging purpose
|
||||
@@ -17,15 +16,12 @@ require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
|
||||
my %sambasettings = ();
|
||||
my %cgisettings = ();
|
||||
my %checked = ();
|
||||
my %netsettings = ();
|
||||
my %ovpnsettings = ();
|
||||
my $message = "";
|
||||
my $errormessage = "";
|
||||
my $shareconfigentry = "";
|
||||
my @sharesconfig = ();
|
||||
my @shareconfigline = ();
|
||||
my $shareoption = '';
|
||||
my $defaultoption= "[Share]\npath = /shares/share1\ncomment = Share - Public Access\nbrowseable = yes\nwriteable = yes\ncreate mask = 0777\ndirectory mask = 0777\nguest ok = yes\npublic = yes\nforce user = samba";
|
||||
my $userentry = "";
|
||||
my @user = ();
|
||||
@@ -54,6 +50,9 @@ my %servicenames =
|
||||
my @Zeilen= ();
|
||||
my @Shares= ();
|
||||
my $shareentry = "";
|
||||
my $shareconfigentry = "";
|
||||
my @shareconfigline = ();
|
||||
my $shareoption = '';
|
||||
my @shares = ();
|
||||
my @shareline = ();
|
||||
my $sharefile = "/var/ipfire/samba/shares";
|
||||
@@ -86,7 +85,7 @@ $sambasettings{'GUESTACCOUNT'} = 'samba';
|
||||
$sambasettings{'MAPTOGUEST'} = 'Never';
|
||||
$sambasettings{'BINDINTERFACESONLY'} = 'True';
|
||||
### Values that have to be initialized
|
||||
$sambasettings{'ACTION'} = '';
|
||||
$cgisettings{'ACTION'} = '';
|
||||
|
||||
&General::readhash("${General::swroot}/samba/settings", \%sambasettings);
|
||||
&Header::getcgihash(\%sambasettings);
|
||||
@@ -97,15 +96,36 @@ $sambasettings{'ACTION'} = '';
|
||||
############################################################################################################################
|
||||
############################################# Samba Rootskript aufrufe f<>r SU-Actions ######################################
|
||||
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system('/usr/local/bin/sambactrl smbuserdisable $sambasettings{"NAME"}');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserenable'){system('/usr/local/bin/sambactrl smbuserenable $sambasettings{"NAME"}');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserdelete'){system('/usr/local/bin/sambactrl smbuserdelete $sambasettings{"NAME"}');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuseradd'){system('/usr/local/bin/sambactrl smbuseradd $username $password');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbchangepw'){system('/usr/local/bin/sambactrl smbchangepw $username $password');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbrestart'){system('/usr/local/bin/sambactrl smbrestart');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbstart'){system('/usr/local/bin/sambactrl smbstart');}
|
||||
if ($sambasettings{'ACTION'} eq 'smbstop'){system('/usr/local/bin/sambactrl smbstop');}
|
||||
# smbsharechange is directly called by the if clause
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system("/usr/local/bin/sambactrl smbuserdisable $sambasettings{'NAME'}");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserenable'){system("/usr/local/bin/sambactrl smbuserenable $sambasettings{'NAME'}");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuserdelete'){system("/usr/local/bin/sambactrl smbuserdelete $sambasettings{'NAME'}");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbuseradd'){system("/usr/local/bin/sambactrl smbuseradd $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'}");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbchangepw'){system("/usr/local/bin/sambactrl smbchangepw $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'}");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/usr/local/bin/sambactrl smbrestart");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl smbstart");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");}
|
||||
if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl smbstop");}
|
||||
if ($sambasettings{'ACTION'} eq 'globalreset'){system("/usr/local/bin/sambactrl smbglobalreset");}
|
||||
|
||||
# smbsafeconf is directly called by the if clause
|
||||
|
||||
if ($sambasettings{'ACTION'} eq 'sharesreset')
|
||||
{
|
||||
system('/usr/local/bin/sambactrl smbsharesreset');
|
||||
@Zeilen = ();
|
||||
@Shares = ();
|
||||
$shareentry = "";
|
||||
@shares = ();
|
||||
@shareline = ();
|
||||
$EOF = qx(cat $sharefile | wc -l);
|
||||
|
||||
@shares = `grep -n '^\\[' $sharefile`;
|
||||
foreach $shareentry (@shares)
|
||||
{
|
||||
@shareline = split( /\:/, $shareentry );
|
||||
push(@Zeilen,$shareline[0]);push(@Shares,$shareline[1]);
|
||||
}
|
||||
}
|
||||
|
||||
############################################################################################################################
|
||||
############################################## Samba Share neu anlegen #####################################################
|
||||
@@ -122,10 +142,15 @@ $emptyline
|
||||
END
|
||||
;
|
||||
close FILE;
|
||||
system('/usr/local/bin/sambactrl smbsharechange');
|
||||
system("/usr/local/bin/sambactrl smbsafeconf");
|
||||
|
||||
@Zeilen = ();
|
||||
@Shares = ();
|
||||
$shareentry = "";
|
||||
@shares = ();
|
||||
@shareline = ();
|
||||
$EOF = qx(cat $sharefile | wc -l);
|
||||
|
||||
@shares = `grep -n '^\\[' $sharefile`;
|
||||
foreach $shareentry (@shares)
|
||||
{
|
||||
@@ -181,12 +206,17 @@ $sharetext
|
||||
END
|
||||
;
|
||||
close FILE;
|
||||
system('/usr/local/bin/sambactrl smbsharechange');
|
||||
system("/usr/local/bin/sambactrl smbsafeconf");
|
||||
|
||||
@Zeilen = ();
|
||||
@Shares = ();
|
||||
@shares = `grep -n '^\\[' $sharefile`;
|
||||
foreach $shareentry (@shares)
|
||||
@Zeilen = ();
|
||||
@Shares = ();
|
||||
$shareentry = "";
|
||||
@shares = ();
|
||||
@shareline = ();
|
||||
$EOF = qx(cat $sharefile | wc -l);
|
||||
|
||||
@shares = `grep -n '^\\[' $sharefile`;
|
||||
foreach $shareentry (@shares)
|
||||
{
|
||||
@shareline = split( /\:/, $shareentry );
|
||||
push(@Zeilen,$shareline[0]);push(@Shares,$shareline[1]);
|
||||
@@ -201,7 +231,6 @@ my $sharebody = '';
|
||||
my $sharehead = '';
|
||||
my $sharename = "$sambasettings{'NAME'}";
|
||||
my $sharetext = '';
|
||||
chomp $sharename;
|
||||
$sharename=~s/\s//g;
|
||||
|
||||
for(my $i = 0; $i <= $#Shares; $i++)
|
||||
@@ -240,7 +269,7 @@ $sambasettings{'SHAREOPTION'}
|
||||
END
|
||||
;
|
||||
close FILE;
|
||||
system('/usr/local/bin/sambactrl smbsharechange');
|
||||
system("/usr/local/bin/sambactrl smbsafeconf");
|
||||
|
||||
@Zeilen = ();
|
||||
@Shares = ();
|
||||
@@ -258,11 +287,11 @@ system('/usr/local/bin/sambactrl smbsharechange');
|
||||
if ($sambasettings{'ACTION'} eq $Lang::tr{'save'})
|
||||
{
|
||||
$sambasettings{'INTERFACES'} = '';
|
||||
if ($checked{'GREEN'}){ $sambasettings{'INTERFACES'} = "$sambasettings{'INTERFACES'} $netsettings{'GREEN_DEV'}";}
|
||||
if ($checked{'BLUE'}){ $sambasettings{'INTERFACES'} = "$sambasettings{'INTERFACES'} $netsettings{'BLUE_DEV'}";}
|
||||
if ($checked{'ORANGE'}){ $sambasettings{'INTERFACES'} = "$sambasettings{'INTERFACES'} $netsettings{'ORANGE_DEV'}";}
|
||||
if ($checked{'VPN'}){ $sambasettings{'INTERFACES'} = "$sambasettings{'INTERFACES'} $ovpnsettings{'DDEVICE'}";}
|
||||
if ($sambasettings{'OTHERINTERFACES'} ne ''){ $sambasettings{'INTERFACES'} = "$sambasettings{'INTERFACES'} $sambasettings{'OTHERINTERFACES'}";}
|
||||
if ($sambasettings{'GREEN'} eq 'on'){ $sambasettings{'INTERFACES'} .= " $netsettings{'GREEN_DEV'}";}
|
||||
if ($sambasettings{'BLUE'} eq 'on'){ $sambasettings{'INTERFACES'} .= " $netsettings{'BLUE_DEV'}";}
|
||||
if ($sambasettings{'ORANGE'} eq 'on'){ $sambasettings{'INTERFACES'} .= " $netsettings{'ORANGE_DEV'}";}
|
||||
if ($sambasettings{'VPN'} eq 'on'){ $sambasettings{'INTERFACES'} .= " $ovpnsettings{'DDEVICE'}";}
|
||||
if ($sambasettings{'OTHERINTERFACES'} ne ''){ $sambasettings{'INTERFACES'} .= " $sambasettings{'OTHERINTERFACES'}";}
|
||||
|
||||
############################################################################################################################
|
||||
############################################# Schreiben der Samba globals ##################################################
|
||||
@@ -314,6 +343,7 @@ print FILE <<END
|
||||
END
|
||||
;
|
||||
close FILE;
|
||||
system('/usr/local/bin/sambactrl smbsharechange');
|
||||
}
|
||||
&General::readhash("${General::swroot}/samba/settings", \%sambasettings);
|
||||
|
||||
@@ -327,11 +357,21 @@ if ($errormessage) {
|
||||
############################################################################################################################
|
||||
########################################## Aktivieren von Checkboxen und Dropdowns #########################################
|
||||
|
||||
$checked{'WINSSUPPORT'}{$sambasettings{'WINSSUPPORT'}} = "checked='checked' ";
|
||||
$checked{'GREEN'}{$sambasettings{'GREEN'}} = "checked='checked' ";
|
||||
$checked{'BLUE'}{$sambasettings{'BLUE'}} = "checked='checked' ";
|
||||
$checked{'ORANGE'}{$sambasettings{'ORANGE'}} = "checked='checked' ";
|
||||
$checked{'VPN'}{$sambasettings{'VPN'}} = "checked='checked' ";
|
||||
$checked{'WINSSUPPORT'}{'off'} = '';
|
||||
$checked{'WINSSUPPORT'}{'on'} = '';
|
||||
$checked{'WINSSUPPORT'}{$sambasettings{'WINSSUPPORT'}} = "checked='checked'";
|
||||
$checked{'GREEN'}{'off'} = '';
|
||||
$checked{'GREEN'}{'on'} = '';
|
||||
$checked{'GREEN'}{$sambasettings{'GREEN'}} = "checked='checked'";
|
||||
$checked{'BLUE'}{'off'} = '';
|
||||
$checked{'BLUE'}{'on'} = '';
|
||||
$checked{'BLUE'}{$sambasettings{'BLUE'}} = "checked='checked'";
|
||||
$checked{'ORANGE'}{'off'} = '';
|
||||
$checked{'ORANGE'}{'on'} = '';
|
||||
$checked{'ORANGE'}{$sambasettings{'ORANGE'}} = "checked='checked'";
|
||||
$checked{'VPN'}{'off'} = '';
|
||||
$checked{'VPN'}{'on'} = '';
|
||||
$checked{'VPN'}{$sambasettings{'VPN'}} = "checked='checked'";
|
||||
|
||||
$selected{'MAPTOGUEST'}{$sambasettings{'MAPTOGUEST'}} = "selected='selected'";
|
||||
$selected{'SECURITY'}{$sambasettings{'SECURITY'}} = "selected='selected'";
|
||||
@@ -383,19 +423,28 @@ END
|
||||
<tr><td align='left'>Workgroup:</td><td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}' size="30"></td></tr>
|
||||
<tr><td align='left'>NetBIOS-Name:</td><td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}' size="30"></td></tr>
|
||||
<tr><td align='left'>Server-String:</td><td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}' size="30"></td></tr>
|
||||
<tr><td align='left'>Interfaces:</td><td><input type='checkbox' name='VPN' $checked{'VPN'}{'on'}><font size='2' color='$Header::colourovpn'><b> OpenVpn - $ovpnsettings{'DDEVICE'}</td></tr>
|
||||
<tr><td align='left'></td><td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'}><font size='2' color='$Header::colourgreen'><b> $Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</td></tr>
|
||||
<tr><td align='left'>Interfaces:
|
||||
</td><td>on <input type='radio' name='VPN' value='on' $checked{'VPN'}{'on'}>/
|
||||
<input type='radio' name='VPN' value='off' $checked{'VPN'}{'off'}> off |
|
||||
<font size='2' color='$Header::colourovpn'><b> OpenVpn - $ovpnsettings{'DDEVICE'}</td></tr>
|
||||
<tr><td align='left'></td><td>on <input type='radio' name='GREEN' value='on' $checked{'GREEN'}{'on'}>/
|
||||
<input type='radio' name='GREEN' value='off' $checked{'GREEN'}{'off'}> off |
|
||||
<font size='2' color='$Header::colourgreen'><b> $Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</td></tr>
|
||||
END
|
||||
;
|
||||
if (&Header::blue_used()){
|
||||
print <<END
|
||||
<tr><td align='left'></td><td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'}><font size='2' color='$Header::colourblue'><b> $Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</td></tr>
|
||||
<tr><td align='left'></td><td>on <input type='radio' name='BLUE' value='on' $checked{'BLUE'}{'on'}>/
|
||||
<input type='radio' name='BLUE' value='off' $checked{'BLUE'}{'off'}> off |
|
||||
<font size='2' color='$Header::colourblue'><b> $Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</td></tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
if (&Header::orange_used()){
|
||||
print <<END
|
||||
<tr><td align='left'></td><td><input type='checkbox' name='ORANGE' $checked{'ORANGE'}{'on'}><font size='2' color='$Header::colourorange'><b> $Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}</td></tr>
|
||||
<tr><td align='left'></td><td>on <input type='radio' name='ORANGE' value='on' $checked{'ORANGE'}{'on'}>/
|
||||
<input type='radio' name='ORANGE' value='off' $checked{'ORANGE'}{'off'}> off |
|
||||
<font size='2' color='$Header::colourorange'><b> $Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}</td></tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
@@ -423,12 +472,31 @@ END
|
||||
<tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>WINS-Optionen</b></td></tr>
|
||||
<tr><td align='left'>WINS-Server:</td><td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}' size="30"></td></tr>
|
||||
<tr><td align='left'>WINS-Support:</td><td>on <input type='radio' name='WINSSUPPORT' value='on' $checked{'WINSSUPPORT'}{'on'}>/
|
||||
<input type='radio' name='WINSSUPPORT' value='off' $checked{'WINSSUPPORT'}{'off'}> off</td></tr>
|
||||
<tr><td colspan='2' align='center'><input type='submit' name='ACTION' value=$Lang::tr{'save'}></td></tr>
|
||||
<input type='radio' name='WINSSUPPORT' value='off' $checked{'WINSSUPPORT'}{'off'}> off</td></tr>
|
||||
</table>
|
||||
<table width='50px' cellspacing='0'><br>
|
||||
<tr><td align='center'><input type='hidden' name='ACTION' value=$Lang::tr{'save'}>
|
||||
<input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif'></td></form>
|
||||
<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='ACTION' value='globalreset'>
|
||||
<input type='image' alt='Reset' src='/images/reload.gif'></td></form>
|
||||
<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='ACTION' value='globalcaption'>
|
||||
<input type='image' alt='Legende' src='/images/info.gif'></td></tr></form>
|
||||
</table>
|
||||
</form>
|
||||
END
|
||||
;
|
||||
if ($sambasettings{'ACTION'} eq 'globalcaption')
|
||||
{
|
||||
print <<END
|
||||
<table width='500px' cellspacing='0'><br>
|
||||
<tr><td><b>Legende:</b></td></tr>
|
||||
<tr><td><img src='/images/floppy.gif'>Einstellungen speichern</td></tr>
|
||||
<tr><td><img src='/images/reload.gif'>Auf default zurueck setzen</td></tr>
|
||||
</table>
|
||||
END
|
||||
;
|
||||
}
|
||||
&Header::closebox();
|
||||
|
||||
############################################################################################################################
|
||||
@@ -449,7 +517,6 @@ END
|
||||
|
||||
system('/usr/local/bin/sambactrl readsmbpasswd');
|
||||
open(FILE, "</var/ipfire/samba/private/smbpasswd") or die "Can't read user file: $!";
|
||||
flock (FILE, 2);
|
||||
@user = <FILE>;
|
||||
close(FILE);
|
||||
system('/usr/local/bin/sambactrl locksmbpasswd');
|
||||
@@ -460,7 +527,7 @@ END
|
||||
<tr><td align='left'>$userline[0]</td><td>
|
||||
END
|
||||
;
|
||||
if ($userline[2] =~ m/N/){
|
||||
if ($userline[4] =~ /N/){
|
||||
print <<END
|
||||
nicht gesetzt</td><td>
|
||||
END
|
||||
@@ -471,23 +538,23 @@ END
|
||||
END
|
||||
;
|
||||
}
|
||||
if ($userline[2] =~ m/D/){
|
||||
if ($userline[4] =~ /D/){
|
||||
print <<END
|
||||
aktiv</td>
|
||||
inaktiv</td>
|
||||
<td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='NAME' value='$userline[0]'>
|
||||
<input type='hidden' name='ACTION' value='userdisable'>
|
||||
<input type='image' alt='Deaktivieren' src='/images/off.gif'>
|
||||
<input type='hidden' name='ACTION' value='smbuserenable'>
|
||||
<input type='image' alt='Aktivieren' src='/images/on.gif'>
|
||||
</form></td>
|
||||
END
|
||||
;
|
||||
}else{
|
||||
print <<END
|
||||
inaktiv</td>
|
||||
aktiv</td>
|
||||
<td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='NAME' value='$userline[0]'>
|
||||
<input type='hidden' name='ACTION' value='userenable'>
|
||||
<input type='image' alt='Aktivieren' src='/images/on.gif'>
|
||||
<input type='hidden' name='ACTION' value='smbuserdisable'>
|
||||
<input type='image' alt='Deaktivieren' src='/images/off.gif'>
|
||||
</form></td>
|
||||
END
|
||||
;
|
||||
@@ -500,7 +567,7 @@ END
|
||||
</form></td>
|
||||
<td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='NAME' value='$userline[0]'>
|
||||
<input type='hidden' name='ACTION' value='userdelete'>
|
||||
<input type='hidden' name='ACTION' value='smbuserdelete'>
|
||||
<input type='image' alt='Loeschen' src='/images/delete.gif'>
|
||||
</form></td>
|
||||
</td></tr>
|
||||
@@ -528,6 +595,7 @@ if ($sambasettings{'ACTION'} eq 'usercaption')
|
||||
<tr><td><img src='/images/add.gif'>Benutzer neu anlegen</td></tr>
|
||||
<tr><td><img src='/images/on.gif'>Benutzer aktivieren</td></tr>
|
||||
<tr><td><img src='/images/off.gif'>Benutzer deaktivieren</td></tr>
|
||||
<tr><td><img src='/images/floppy.gif'>Einstellungen speichern</td></tr>
|
||||
<tr><td><img src='/images/edit.gif'>Passwort wechseln</td></tr>
|
||||
<tr><td><img src='/images/delete.gif'>Benutzer loeschen</td></tr>
|
||||
</table>
|
||||
@@ -546,15 +614,21 @@ if ($sambasettings{'ACTION'} eq 'userchangepw')
|
||||
<tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Passwort wechseln</b></td></tr>
|
||||
<tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size="30"></td></tr>
|
||||
<tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size="30"></td></tr>
|
||||
<tr><td colspan='2' align='center'><input type='submit' name='ACTION' value='smbchangepw'></td></tr></form>
|
||||
<tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value='smbchangepw'>
|
||||
<input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif'></td></tr></form>
|
||||
|
||||
</table>
|
||||
END
|
||||
;
|
||||
}
|
||||
if ($sambasettings{'ACTION'} eq 'useradd')
|
||||
{
|
||||
my $username = "User";
|
||||
my $password = 'samba';
|
||||
my $username = "user";
|
||||
my $password = "samba";
|
||||
chomp $username;
|
||||
$username=~s/\s//g;
|
||||
chomp $password;
|
||||
$password=~s/\s//g;
|
||||
print <<END
|
||||
<hr>
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
@@ -562,7 +636,8 @@ if ($sambasettings{'ACTION'} eq 'useradd')
|
||||
<tr bgcolor='${Header::table1colour}'><td colspan='2' align='left'><b>Benutzer neu anlegen</b></td></tr>
|
||||
<tr><td align='left'>Benutzername</td><td><input type='text' name='USERNAME' value='$username' size="30"></td></tr>
|
||||
<tr><td align='left'>Passwort</td><td><input type='password' name='PASSWORD' value='$password' size="30"></td></tr>
|
||||
<tr><td colspan='2' align='center'><input type='submit' name='ACTION' value='smbuseradd'></td></tr></form>
|
||||
<tr><td colspan='2' align='center'><input type='hidden' name='ACTION' value='smbuseradd'>
|
||||
<input type='image' alt=$Lang::tr{'save'} src='/images/floppy.gif'></td></tr></form>
|
||||
</table>
|
||||
END
|
||||
;
|
||||
@@ -609,6 +684,9 @@ END
|
||||
<tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='ACTION' value='shareadd'>
|
||||
<input type='image' alt='neuen Share anlegen' src='/images/add.gif'></form></td>
|
||||
<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='ACTION' value='sharesreset'>
|
||||
<input type='image' alt='Reset' src='/images/reload.gif'></td></form>
|
||||
<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<input type='hidden' name='ACTION' value='sharecaption'>
|
||||
<input type='image' alt='Legende' src='/images/info.gif'></form>
|
||||
@@ -623,6 +701,8 @@ if ($sambasettings{'ACTION'} eq 'sharecaption')
|
||||
<tr><td><b>Legende:</b></td></tr>
|
||||
<tr><td><img src='/images/add.gif'>Share neu anlegen</td></tr>
|
||||
<tr><td><img src='/images/edit.gif'>Share bearbeiten</td></tr>
|
||||
<tr><td><img src='/images/floppy.gif'>Einstellungen speichern</td></tr>
|
||||
<tr><td><img src='/images/reload.gif'>Shares zurueck setzen</td></tr>
|
||||
<tr><td><img src='/images/delete.gif'>Share loeschen</td></tr>
|
||||
</table>
|
||||
END
|
||||
@@ -643,7 +723,8 @@ if ($sambasettings{'ACTION'} eq 'shareadd' || $sambasettings{'ACTION'} eq 'optio
|
||||
<tr><td colspan='2' align='center'><textarea name="SHAREOPTION" cols="50" rows="15" Wrap="off">$defaultoption</textarea></td></tr>
|
||||
</table>
|
||||
<table width='50px' cellspacing='0'><br>
|
||||
<tr><td align='center'><input type='submit' name='ACTION' value='smbshareadd'></td></tr></form>
|
||||
<tr><td align='center'><input type='hidden' name='ACTION' value='smbshareadd'>
|
||||
<input type='image' alt='Share hinzufuegen' src='/images/floppy.gif'></td></tr></form>
|
||||
</table>
|
||||
END
|
||||
;
|
||||
@@ -682,7 +763,7 @@ if ($sambasettings{'ACTION'} eq 'sharechange' || $sambasettings{'ACTION'} eq 'op
|
||||
</table>
|
||||
<table width='50px' cellspacing='0'><br>
|
||||
<tr><td align='center'>
|
||||
<input type='hidden' name='NAME' value='$sharename'>
|
||||
<input type='hidden' name='NAME' value='$sambasettings{'NAME'}'>
|
||||
<input type='submit' name='ACTION' value='smbsharechange'></td></tr></form>
|
||||
</table>
|
||||
END
|
||||
|
||||
16
lfs/grub
16
lfs/grub
@@ -74,7 +74,13 @@ $(subst %,%_MD5,$(objects)) :
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97-disk_geometry-1.patch
|
||||
|
||||
# Reiser4
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97-reiser4-20050808.diff
|
||||
|
||||
# This fails, but doesn't matter
|
||||
-cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97-disk_geometry-1.patch
|
||||
|
||||
### WHICH ONE OF THESE PATCHES DO WE REALLY NEED? CAN WE DELETE ANY?
|
||||
#cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97/grub-0.97-path-patch
|
||||
#cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/grub-0.97/use_ferror.diff
|
||||
@@ -90,12 +96,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
#cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/grub-0.97/grub-path-cfg.diff
|
||||
|
||||
cd $(DIR_APP) && perl -pi -e 's,/usr/lib/grub/i386-pc,/usr/share/grub/i386-pc,' docs/grub.texi
|
||||
cd $(DIR_APP) && sed -i 's/AM_INIT_AUTOMAKE/&\nAM_PROG_AS/' configure.ac
|
||||
|
||||
cd $(DIR_APP) && autoreconf --install --force
|
||||
cd $(DIR_APP) && ./configure --prefix=/usr
|
||||
# Temporary commented.
|
||||
# CFLAGS="-0s -fno-stack-protector" \
|
||||
# STAGE2_CFLAGS="-0s -fno-stack-protector" \
|
||||
cd $(DIR_APP) && CFLAGS="-Os -s -fno-strict-aliasing" ./configure --prefix=/usr
|
||||
|
||||
cd $(DIR_APP) && make $(MAKETUNING)
|
||||
cd $(DIR_APP) && make install
|
||||
@@ -108,7 +112,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
done
|
||||
|
||||
install -m 0755 $(DIR_SRC)/src/install+setup/install/grubbatch /boot/grub
|
||||
/usr/sbin/grub-set-default 0
|
||||
/usr/sbin/grub-set-default 1
|
||||
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
|
||||
89
lfs/libaal
Normal file
89
lfs/libaal
Normal file
@@ -0,0 +1,89 @@
|
||||
###############################################################################
|
||||
# This file is part of the IPCop Firewall. #
|
||||
# #
|
||||
# IPCop is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPCop is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPCop; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Makefiles are based on LFSMake, which is #
|
||||
# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Definitions
|
||||
###############################################################################
|
||||
|
||||
include Config
|
||||
|
||||
VER = 1.0.5
|
||||
|
||||
THISAPP = libaal-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
ifeq "$(LFS_PASS)" "install"
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)-install
|
||||
else
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = 6c55201acd2a2c0a1f46addf248da6a2
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
ifeq "$(LFS_PASS)" "install"
|
||||
cd $(DIR_APP) && ./configure --prefix=/opt/$(MACHINE)-uClibc
|
||||
cd $(DIR_APP) && make $(MAKETUNING)
|
||||
cd $(DIR_APP) && make install
|
||||
else
|
||||
cd $(DIR_APP) && ./configure --prefix=/usr
|
||||
cd $(DIR_APP) && make $(MAKETUNING)
|
||||
cd $(DIR_APP) && make install
|
||||
endif
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
@@ -141,6 +141,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.0.tar.gz
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.0/linux-2.6.15/squashfs3.0-patch
|
||||
|
||||
# Reiser4
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch
|
||||
|
||||
# Patch-o-matic
|
||||
cd $(DIR_SRC) && rm -rf iptables-*
|
||||
cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2
|
||||
|
||||
93
lfs/reiser4progs
Normal file
93
lfs/reiser4progs
Normal file
@@ -0,0 +1,93 @@
|
||||
###############################################################################
|
||||
# This file is part of the IPCop Firewall. #
|
||||
# #
|
||||
# IPCop is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# IPCop is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with IPCop; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
# Makefiles are based on LFSMake, which is #
|
||||
# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Definitions
|
||||
###############################################################################
|
||||
|
||||
include Config
|
||||
|
||||
VER = 1.0.5
|
||||
|
||||
THISAPP = reiser4progs-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
ifeq "$(LFS_PASS)" "install"
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)-install
|
||||
else
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = b0756831e16b2395d5f443526d640792
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
ifeq "$(LFS_PASS)" "install"
|
||||
cd $(DIR_APP) && ./configure --prefix=/opt/$(MACHINE)-uClibc \
|
||||
--with-libaal=/opt/$(MACHINE)-uClibc \
|
||||
--without-readline --disable-shared \
|
||||
--sbindir=/install/initrd/sbin \
|
||||
--libdir=/install/initrd/lib
|
||||
cd $(DIR_APP) && make $(MAKETUNING)
|
||||
cd $(DIR_APP) && make install
|
||||
else
|
||||
cd $(DIR_APP) && ./configure --prefix=/usr --sbindir=/sbin
|
||||
cd $(DIR_APP) && make $(MAKETUNING)
|
||||
cd $(DIR_APP) && make install
|
||||
endif
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
9
make.sh
9
make.sh
@@ -284,7 +284,6 @@ buildbase() {
|
||||
lfsmake2 file
|
||||
lfsmake2 findutils
|
||||
lfsmake2 flex
|
||||
lfsmake2 grub
|
||||
lfsmake2 gawk
|
||||
lfsmake2 gettext
|
||||
lfsmake2 grep
|
||||
@@ -294,6 +293,7 @@ buildbase() {
|
||||
lfsmake2 iproute2
|
||||
lfsmake2 kbd
|
||||
lfsmake2 less
|
||||
lfsmake2 libaal
|
||||
lfsmake2 make
|
||||
lfsmake2 man
|
||||
lfsmake2 mktemp
|
||||
@@ -301,6 +301,7 @@ buildbase() {
|
||||
lfsmake2 net-tools
|
||||
lfsmake2 patch
|
||||
lfsmake2 psmisc
|
||||
lfsmake2 reiser4progs
|
||||
lfsmake2 shadow
|
||||
lfsmake2 sysklogd
|
||||
lfsmake2 sysvinit
|
||||
@@ -309,6 +310,7 @@ buildbase() {
|
||||
lfsmake2 udev
|
||||
lfsmake2 util-linux
|
||||
lfsmake2 vim
|
||||
lfsmake2 grub
|
||||
}
|
||||
|
||||
buildipfire() {
|
||||
@@ -381,6 +383,7 @@ buildipfire() {
|
||||
ipfiremake capi4k-utils
|
||||
ipfiremake cdrtools
|
||||
ipfiremake dnsmasq
|
||||
ipfiremake libaal
|
||||
ipfiremake dosfstools
|
||||
ipfiremake reiserfsprogs
|
||||
ipfiremake squashfstools
|
||||
@@ -521,7 +524,6 @@ buildipfire() {
|
||||
ipfiremake tftp-hpa
|
||||
ipfiremake iptraf
|
||||
ipfiremake nagios
|
||||
ipfiremake yasuc
|
||||
}
|
||||
|
||||
buildinstaller() {
|
||||
@@ -547,7 +549,8 @@ buildinstaller() {
|
||||
installmake sysvinit
|
||||
installmake misc-progs
|
||||
installmake e2fsprogs
|
||||
installmake reiserfsprogs
|
||||
installmake libaal
|
||||
installmake reiser4progs
|
||||
installmake sysfsutils
|
||||
installmake util-linux
|
||||
installmake pciutils
|
||||
|
||||
@@ -557,9 +557,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (raid_disk)
|
||||
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %sp3", hdparams.devnode);
|
||||
snprintf(commandstring, STRING_SIZE, "/sbin/mkfs.reiser4 -f %sp3", hdparams.devnode);
|
||||
else
|
||||
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %s3", hdparams.devnode);
|
||||
snprintf(commandstring, STRING_SIZE, "/sbin/mkfs.reiser4 -f %s3", hdparams.devnode);
|
||||
|
||||
if (runcommandwithstatus(commandstring, ctr[TR_MAKING_ROOT_FILESYSTEM]))
|
||||
{
|
||||
@@ -568,9 +568,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (raid_disk)
|
||||
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %sp4", hdparams.devnode);
|
||||
snprintf(commandstring, STRING_SIZE, "/sbin/mkfs.reiser4 -f %sp4", hdparams.devnode);
|
||||
else
|
||||
snprintf(commandstring, STRING_SIZE, "/bin/mkreiserfs -f %s4", hdparams.devnode);
|
||||
snprintf(commandstring, STRING_SIZE, "/sbin/mkfs.reiser4 -f %s4", hdparams.devnode);
|
||||
|
||||
if (runcommandwithstatus(commandstring, ctr[TR_MAKING_LOG_FILESYSTEM]))
|
||||
{
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include "setuid.h"
|
||||
|
||||
int main(int argc, char**argv)
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
char command[BUFFER_SIZE];
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char commandstring[256];
|
||||
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
@@ -17,77 +23,88 @@ int main(int argc, char**argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbuserdisable")==0)
|
||||
if (strcmp(argv[1], "smbuserdisable")==0)
|
||||
{
|
||||
snprintf(commandstring,STRING_SIZE-1,"/usr/bin/smbpasswd -d %s",argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -d %s", argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbuserenable")==0)
|
||||
if (strcmp(argv[1], "smbuserenable")==0)
|
||||
{
|
||||
snprintf(commandstring,STRING_SIZE-1,"/usr/bin/smbpasswd -e %s",argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -e %s", argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbuserdelete")==0)
|
||||
if (strcmp(argv[1], "smbuserdelete")==0)
|
||||
{
|
||||
snprintf(commandstring,STRING_SIZE-1,"/usr/bin/smbpasswd -x %s",argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/bin/smbpasswd -x %s", argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/sbin/userdel %s", argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbsafeconf")==0)
|
||||
if (strcmp(argv[1], "smbsafeconf")==0)
|
||||
{
|
||||
safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbglobalreset")==0)
|
||||
if (strcmp(argv[1], "smbglobalreset")==0)
|
||||
{
|
||||
safe_system("/bin/cat /var/ipfire/samba/global.default /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf");
|
||||
safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf");
|
||||
safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/samba/settings");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbsharesreset")==0)
|
||||
if (strcmp(argv[1], "smbsharesreset")==0)
|
||||
{
|
||||
safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares.default > /var/ipfire/samba/smb.conf");
|
||||
safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/default.shares > /var/ipfire/samba/smb.conf");
|
||||
safe_system("/bin/cat /var/ipfire/samba/default.shares > /var/ipfire/samba/shares");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbrestart")==0)
|
||||
if (strcmp(argv[1], "smbrestart")==0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbstop")==0)
|
||||
if (strcmp(argv[1], "smbstop")==0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbstart")==0)
|
||||
if (strcmp(argv[1], "smbstart")==0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbuseradd")==0)
|
||||
if (strcmp(argv[1], "smbuseradd")==0)
|
||||
{
|
||||
snprintf(commandstring,STRING_SIZE-1,"/usr/sbin/useradd -c 'Samba User' -d /opt/samba -g 2110 -p %s -s /bin/false %s",argv[3],argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(commandstring,STRING_SIZE-1,"/bin/printf '%s\n%s\n' | /usr/local/bin/smbpasswd -as %s",argv[3],argv[3],argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/sbin/useradd -c 'Samba User' -d /opt/samba -g 2110 -p %s -s /bin/false %s", argv[3], argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/bin/printf '%s\n%s\n' | /usr/bin/smbpasswd -as %s", argv[3], argv[3], argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "smbchangepw")==0)
|
||||
if (strcmp(argv[1], "smbchangepw")==0)
|
||||
{
|
||||
snprintf(commandstring,STRING_SIZE-1,"/bin/printf '%s\n%s\n' | /usr/local/bin/smbpasswd -as %s",argv[3],argv[3],argv[2]);
|
||||
safe_system(commandstring);
|
||||
snprintf(command, BUFFER_SIZE-1, "/usr/bin/printf '%s\n%s\n' | /usr/bin/smbpasswd -as %s", argv[3], argv[3], argv[2]);
|
||||
safe_system(command);
|
||||
printf(command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "readsmbpasswd")==0)
|
||||
if (strcmp(argv[1], "readsmbpasswd")==0)
|
||||
{
|
||||
safe_system("/bin/chown root:nobody /var/ipfire/samba/private");
|
||||
safe_system("/bin/chown root:nobody /var/ipfire/samba/private/smbpasswd");
|
||||
@@ -96,7 +113,7 @@ int main(int argc, char**argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc==2 && strcmp(argv[1], "locksmbpasswd")==0)
|
||||
if (strcmp(argv[1], "locksmbpasswd")==0)
|
||||
{
|
||||
safe_system("/bin/chown root:root /var/ipfire/samba/private");
|
||||
safe_system("/bin/chown root:root /var/ipfire/samba/private/smbpasswd");
|
||||
@@ -104,4 +121,12 @@ int main(int argc, char**argv)
|
||||
safe_system("/bin/chmod 600 /var/ipfire/samba/private");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "smbechotest")==0)
|
||||
{
|
||||
sprintf(command, BUFFER_SIZE-1, "/usr/bin/printf %s %s", argv[2], argv[3]);
|
||||
printf(command);
|
||||
safe_system(command);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
604
src/patches/grub-0.97-reiser4-20050808.diff
Normal file
604
src/patches/grub-0.97-reiser4-20050808.diff
Normal file
@@ -0,0 +1,604 @@
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/config.h.in grub-0.97-1/config.h.in
|
||||
--- grub-0.97/config.h.in 2005-05-08 06:48:19.000000000 +0400
|
||||
+++ grub-0.97-1/config.h.in 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -27,9 +27,16 @@
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
+/* Define to 1 if you have the `aal-minimal' library (-laal-minimal). */
|
||||
+#undef HAVE_LIBAAL_MINIMAL
|
||||
+
|
||||
/* Define if you have a curses library */
|
||||
#undef HAVE_LIBCURSES
|
||||
|
||||
+/* Define to 1 if you have the `reiser4-minimal' library (-lreiser4-minimal).
|
||||
+ */
|
||||
+#undef HAVE_LIBREISER4_MINIMAL
|
||||
+
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/configure.ac grub-0.97-1/configure.ac
|
||||
--- grub-0.97/configure.ac 2005-05-08 06:36:03.000000000 +0400
|
||||
+++ grub-0.97-1/configure.ac 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -263,6 +263,77 @@ if test x"$enable_reiserfs" != xno; then
|
||||
FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
|
||||
fi
|
||||
|
||||
+dnl Checking for reiser4
|
||||
+REISER4_LIBS=""
|
||||
+REISER4_CFLAGS=""
|
||||
+
|
||||
+OLD_LIBS=$LIBS
|
||||
+OLD_CFLAGS=$CFLAGS
|
||||
+LIBS=""
|
||||
+CFLAGS=""
|
||||
+
|
||||
+AC_ARG_ENABLE(reiser4,
|
||||
+ [ --disable-reiser4 disable Reiser4 support in Stage 2])
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ AC_CHECK_LIB(aal-minimal, aal_mem_init, ,
|
||||
+ AC_MSG_WARN(
|
||||
+Reiser4 support is disabled due to inability find libaal-minimal with
|
||||
+memory manager support turned on.)
|
||||
+ enable_reiser4=no
|
||||
+ )
|
||||
+fi
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ AC_CHECK_HEADER(aal/libaal.h, ,
|
||||
+ AC_MSG_WARN(
|
||||
+Libaal header files are not found. Reiser4 support is disabled
|
||||
+ )
|
||||
+ enable_reiser4=no)
|
||||
+fi
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ AC_CHECK_LIB(reiser4-minimal, reiser4_fs_open, ,
|
||||
+ AC_MSG_WARN(
|
||||
+Reiser4 support is disabled due to inability find valid libreiser4-minimal.)
|
||||
+ enable_reiser4=no,
|
||||
+ -laal-minimal
|
||||
+ )
|
||||
+fi
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ AC_CHECK_HEADER(reiser4/libreiser4.h, ,
|
||||
+ AC_MSG_WARN(
|
||||
+Reiser4 header files are not found. Reiser4 support is disabled.
|
||||
+ )
|
||||
+ enable_reiser4=no)
|
||||
+fi
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ REISER4_CFLAGS="$REISER4_CFLAGS -DFSYS_REISER4=1"
|
||||
+ REISER4_LIBS=$LIBS
|
||||
+fi
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ AC_CHECK_LIB(reiser4-minimal, __sym40_plug_init,
|
||||
+ REISER4_CFLAGS="$REISER4_CFLAGS -DENABLE_SYMLINKS=1",
|
||||
+AC_MSG_WARN(Reiser4 symlinks support is disabled.),
|
||||
+ -laal-minimal
|
||||
+ )
|
||||
+fi
|
||||
+
|
||||
+LIBS=$OLD_LIBS
|
||||
+CFLAGS=$OLD_CFLAGS
|
||||
+
|
||||
+if test x"$enable_reiser4" != xno; then
|
||||
+ enable_reiser4_support=yes
|
||||
+ FSYS_CFLAGS="$FSYS_CFLAGS $REISER4_CFLAGS"
|
||||
+fi
|
||||
+
|
||||
+AC_SUBST(REISER4_LIBS)
|
||||
+AC_SUBST(REISER4_CFLAGS)
|
||||
+AM_CONDITIONAL(ENABLE_REISER4_SUPPORT, test x"$enable_reiser4" != xno)
|
||||
+
|
||||
AC_ARG_ENABLE(vstafs,
|
||||
[ --disable-vstafs disable VSTa FS support in Stage 2])
|
||||
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/docs/grub.texi grub-0.97-1/docs/grub.texi
|
||||
--- grub-0.97/docs/grub.texi 2005-05-08 06:59:59.000000000 +0400
|
||||
+++ grub-0.97-1/docs/grub.texi 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -283,7 +283,7 @@ devices, partitions, and files in a dire
|
||||
Support multiple filesystem types transparently, plus a useful explicit
|
||||
blocklist notation. The currently supported filesystem types are
|
||||
@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux
|
||||
-ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
|
||||
+ext2fs}, @dfn{ReiserFS}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa
|
||||
fs}. @xref{Filesystem}, for more information.
|
||||
|
||||
@item Support automatic decompression
|
||||
@@ -1776,6 +1776,7 @@ itself. Usually, this is put in a filesy
|
||||
@itemx jfs_stage1_5
|
||||
@itemx minix_stage1_5
|
||||
@itemx reiserfs_stage1_5
|
||||
+@itemx reiser4_stage1_5
|
||||
@itemx vstafs_stage1_5
|
||||
@itemx xfs_stage1_5
|
||||
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/grub/Makefile.am grub-0.97-1/grub/Makefile.am
|
||||
--- grub-0.97/grub/Makefile.am 2005-02-02 23:38:19.000000000 +0300
|
||||
+++ grub-0.97-1/grub/Makefile.am 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -16,4 +16,4 @@ AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2F
|
||||
AM_CFLAGS = $(GRUB_CFLAGS)
|
||||
|
||||
grub_SOURCES = main.c asmstub.c
|
||||
-grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS)
|
||||
+grub_LDADD = ../stage2/libgrub.a ../lib/libcommon.a $(GRUB_LIBS) $(REISER4_LIBS)
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/INSTALL grub-0.97-1/INSTALL
|
||||
--- grub-0.97/INSTALL 2005-05-08 06:43:15.000000000 +0400
|
||||
+++ grub-0.97-1/INSTALL 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -207,6 +207,9 @@ operates.
|
||||
`--disable-reiserfs'
|
||||
Omit the ReiserFS support in Stage 2.
|
||||
|
||||
+`--disable-reiser4'
|
||||
+ Omit the Reiser4 support in Stage 2.
|
||||
+
|
||||
`--disable-vstafs'
|
||||
Omit the VSTa filesystem support in Stage 2.
|
||||
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/builtins.c grub-0.97-1/stage2/builtins.c
|
||||
--- grub-0.97/stage2/builtins.c 2005-02-16 00:58:23.000000000 +0300
|
||||
+++ grub-0.97-1/stage2/builtins.c 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -3880,6 +3880,7 @@ setup_func (char *arg, int flags)
|
||||
{"jfs", "/jfs_stage1_5"},
|
||||
{"minix", "/minix_stage1_5"},
|
||||
{"reiserfs", "/reiserfs_stage1_5"},
|
||||
+ {"reiser4", "/reiser4_stage1_5"},
|
||||
{"vstafs", "/vstafs_stage1_5"},
|
||||
{"xfs", "/xfs_stage1_5"}
|
||||
};
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/disk_io.c grub-0.97-1/stage2/disk_io.c
|
||||
--- grub-0.97/stage2/disk_io.c 2004-05-23 20:35:24.000000000 +0400
|
||||
+++ grub-0.97-1/stage2/disk_io.c 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -63,6 +63,9 @@ struct fsys_entry fsys_table[NUM_FSYS +
|
||||
# ifdef FSYS_REISERFS
|
||||
{"reiserfs", reiserfs_mount, reiserfs_read, reiserfs_dir, 0, reiserfs_embed},
|
||||
# endif
|
||||
+# ifdef FSYS_REISER4
|
||||
+ {"reiser4", reiser4_mount, reiser4_read, reiser4_dir, 0, reiser4_embed},
|
||||
+# endif
|
||||
# ifdef FSYS_VSTAFS
|
||||
{"vstafs", vstafs_mount, vstafs_read, vstafs_dir, 0, 0},
|
||||
# endif
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/filesys.h grub-0.97-1/stage2/filesys.h
|
||||
--- grub-0.97/stage2/filesys.h 2004-05-14 23:36:43.000000000 +0400
|
||||
+++ grub-0.97-1/stage2/filesys.h 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -77,6 +77,16 @@ int reiserfs_embed (int *start_sector, i
|
||||
#define FSYS_REISERFS_NUM 0
|
||||
#endif
|
||||
|
||||
+#ifdef FSYS_REISER4
|
||||
+#define FSYS_REISER4_NUM 1
|
||||
+int reiser4_mount (void);
|
||||
+int reiser4_read (char *buf, int len);
|
||||
+int reiser4_dir (char *dirname);
|
||||
+int reiser4_embed (int *start_sector, int needed_sectors);
|
||||
+#else
|
||||
+#define FSYS_REISER4_NUM 0
|
||||
+#endif
|
||||
+
|
||||
#ifdef FSYS_VSTAFS
|
||||
#define FSYS_VSTAFS_NUM 1
|
||||
int vstafs_mount (void);
|
||||
@@ -127,8 +137,8 @@ int iso9660_dir (char *dirname);
|
||||
#ifndef NUM_FSYS
|
||||
#define NUM_FSYS \
|
||||
(FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM \
|
||||
- + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM \
|
||||
- + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
|
||||
+ + FSYS_REISERFS_NUM + FSYS_REISER4_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
|
||||
+ + FSYS_XFS_NUM + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
|
||||
#endif
|
||||
|
||||
/* defines for the block filesystem info area */
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/fsys_reiser4.c grub-0.97-1/stage2/fsys_reiser4.c
|
||||
--- grub-0.97/stage2/fsys_reiser4.c 1970-01-01 03:00:00.000000000 +0300
|
||||
+++ grub-0.97-1/stage2/fsys_reiser4.c 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -0,0 +1,260 @@
|
||||
+/*
|
||||
+ * fsys_reiser4.c -- reiser4 filesystem support.
|
||||
+ * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
+ *
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ *
|
||||
+ * 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
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+*/
|
||||
+
|
||||
+#ifdef FSYS_REISER4
|
||||
+#include "shared.h"
|
||||
+#include "filesys.h"
|
||||
+
|
||||
+#define ENABLE_MINIMAL
|
||||
+#include <reiser4/libreiser4.h>
|
||||
+
|
||||
+static reiser4_fs_t *fs = NULL;
|
||||
+static aal_device_t *dev = NULL;
|
||||
+static reiser4_object_t *object = NULL;
|
||||
+
|
||||
+/* Read callback of grub specific device. It uses devread() for reading passed
|
||||
+ @count of device blocks starting from @blk to passed @buff. */
|
||||
+static errno_t grub_dev_read(aal_device_t *device,
|
||||
+ void *buff, blk_t blk,
|
||||
+ count_t count)
|
||||
+{
|
||||
+ unsigned int size;
|
||||
+ unsigned int factor;
|
||||
+ unsigned int sector;
|
||||
+
|
||||
+ /* Calculating actual sector and size in bytes to be read from
|
||||
+ device. */
|
||||
+ factor = device->blksize / SECTOR_SIZE;
|
||||
+ sector = (unsigned int)blk << aal_log2(factor);
|
||||
+ size = (unsigned int)count * (SECTOR_SIZE * factor);
|
||||
+
|
||||
+ /* Reading from the current device */
|
||||
+ if (!devread(sector, 0, size, buff))
|
||||
+ return -EIO;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Length callback of grub device */
|
||||
+static count_t grub_dev_len(aal_device_t *device) {
|
||||
+ unsigned int factor;
|
||||
+
|
||||
+ /* Getting partition length in device blocks */
|
||||
+ factor = device->blksize / SECTOR_SIZE;
|
||||
+ return (part_length >> aal_log2(factor));
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ Initializing grub device abstraction instance. It will use devread and friends
|
||||
+ for providing needed functionality.
|
||||
+*/
|
||||
+struct aal_device_ops grub_dev_ops = {
|
||||
+ .read = grub_dev_read,
|
||||
+ .len = grub_dev_len
|
||||
+};
|
||||
+
|
||||
+/* Initializes reiser4 */
|
||||
+static int reiser4_init(void) {
|
||||
+ extern aal_hash_table_t *plugins;
|
||||
+
|
||||
+ plugins = NULL;
|
||||
+
|
||||
+ /* Initializing memory manager */
|
||||
+ aal_mem_init((void *)FSYS_BUF, FSYS_BUFLEN);
|
||||
+
|
||||
+ /* Initializing device abstraction on current device GRUB uses. */
|
||||
+ if (!(dev = aal_device_open(&grub_dev_ops, NULL,
|
||||
+ SECTOR_SIZE, 0)))
|
||||
+ {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Initializing libreiser4 (plugins, etc) */
|
||||
+ return !libreiser4_init();
|
||||
+}
|
||||
+
|
||||
+#define MEMORY_WATERMARK 8192
|
||||
+
|
||||
+/* Memory pressure detect function. */
|
||||
+static int mpressure_detect(reiser4_tree_t *tree) {
|
||||
+ return (aal_mem_free() <= MEMORY_WATERMARK);
|
||||
+}
|
||||
+
|
||||
+/* Reiser4 mount() routine */
|
||||
+int reiser4_mount(void) {
|
||||
+
|
||||
+ /* Initialize all reiser4 related stuff first */
|
||||
+ if (!reiser4_init())
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Open filesystem on @dev. */
|
||||
+ if (!(fs = reiser4_fs_open(dev)))
|
||||
+ return 0;
|
||||
+
|
||||
+ fs->tree->mpc_func = mpressure_detect;
|
||||
+
|
||||
+ object = NULL;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+/* Reiser4 read() handler */
|
||||
+int reiser4_read(char *buf, int len) {
|
||||
+ int64_t read;
|
||||
+
|
||||
+ if (object == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Seet at current position denoted by @filepos */
|
||||
+ if (objplug(object)->o.object_ops->seek) {
|
||||
+ plug_call(objplug(object)->o.object_ops,
|
||||
+ seek, object->ent, filepos);
|
||||
+ }
|
||||
+
|
||||
+ /* Reading current file data starting from @filepos */
|
||||
+ disk_read_func = disk_read_hook;
|
||||
+ read = objplug(object)->o.object_ops->read ?
|
||||
+ plug_call(objplug(object)->o.object_ops, read,
|
||||
+ object->ent, buf, len) : -EINVAL;
|
||||
+ disk_read_func = NULL;
|
||||
+
|
||||
+ if (read < 0) {
|
||||
+ errnum = ERR_FSYS_CORRUPT;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ filepos += read;
|
||||
+ return read;
|
||||
+}
|
||||
+
|
||||
+/* Reiser4 file open() routine */
|
||||
+int reiser4_dir(char *dirname) {
|
||||
+ char *ch;
|
||||
+
|
||||
+ if (fs == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (object != NULL) {
|
||||
+ plug_call(objplug(object)->o.object_ops,
|
||||
+ close, object->ent);
|
||||
+ aal_free(object);
|
||||
+ object = NULL;
|
||||
+ }
|
||||
+
|
||||
+ /* Cutting out string after first space character */
|
||||
+ if ((ch = aal_strchr(dirname, ' ')))
|
||||
+ *ch = '\0';
|
||||
+
|
||||
+ /* This function is also called for getting directory list for
|
||||
+ maintaining the bash-like completion. */
|
||||
+#ifndef STAGE1_5
|
||||
+ if (print_possibilities) {
|
||||
+ char entry[256];
|
||||
+ entry_hint_t entry_hint;
|
||||
+
|
||||
+ /* Getting last part of name (jsut after last '/') */
|
||||
+ if (*(dirname + aal_strlen(dirname) - 1) != '/') {
|
||||
+
|
||||
+ if (!(ch = aal_strrchr(dirname, '/'))) {
|
||||
+ errnum = ERR_BAD_FILETYPE;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ aal_strncpy(entry, ch + 1, sizeof(entry));
|
||||
+ *(ch + 1) = '\0';
|
||||
+ } else {
|
||||
+ aal_memset(entry, 0, sizeof(entry));
|
||||
+ }
|
||||
+
|
||||
+ /* Open obejct by @dirname */
|
||||
+ if (!(object = reiser4_semantic_open(fs->tree, dirname,
|
||||
+ NULL, 1)))
|
||||
+ {
|
||||
+ errnum = ERR_FILE_NOT_FOUND;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Checking if it is a directory object */
|
||||
+ if (object->ent->opset.plug[OPSET_OBJ]->id.group != DIR_OBJECT)
|
||||
+ {
|
||||
+ /* If not, cutting out last '/' character */
|
||||
+ if ((ch = aal_strrchr(dirname, '/')))
|
||||
+ *ch = '\0';
|
||||
+
|
||||
+ /* Close current object */
|
||||
+ plug_call(objplug(object)->o.object_ops,
|
||||
+ close, object->ent);
|
||||
+ aal_free(object);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Reading the opened directory to build the completion list. */
|
||||
+ if (objplug(object)->o.object_ops->readdir) {
|
||||
+ while (plug_call(objplug(object)->o.object_ops, readdir,
|
||||
+ object->ent, &entry_hint) > 0)
|
||||
+ {
|
||||
+ if (substring(entry, entry_hint.name) <= 0) {
|
||||
+ if (print_possibilities > 0)
|
||||
+ print_possibilities =
|
||||
+ -print_possibilities;
|
||||
+
|
||||
+ print_a_completion(entry_hint.name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif
|
||||
+ /* This is the case when resier4_dir() is called for open the
|
||||
+ file @dirname, not for building completion list. */
|
||||
+ if (!(object = reiser4_semantic_open(fs->tree, dirname,
|
||||
+ NULL, 1)))
|
||||
+ {
|
||||
+ errnum = ERR_FILE_NOT_FOUND;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (object->ent->opset.plug[OPSET_OBJ]->id.group != REG_OBJECT)
|
||||
+ {
|
||||
+ errnum = ERR_BAD_FILETYPE;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Initializing GRUB global variables @filepos and @filemax. */
|
||||
+ filepos = 0;
|
||||
+ filemax = reiser4_object_size(object);
|
||||
+
|
||||
+ return 1;
|
||||
+#ifndef STAGE1_5
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+#endif
|
||||
+
|
||||
+ errnum = ERR_FILE_NOT_FOUND;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Returns how many sectors may be used for embeding reiser4_stage1_5 in teh
|
||||
+ case of installing GRUB to partition instead of MBR. */
|
||||
+int reiser4_embed (int *start_sector, int needed_sectors) {
|
||||
+ *start_sector = 1;
|
||||
+ return needed_sectors <= ((REISER4_MASTER_OFFSET >> SECTOR_BITS) - 1);
|
||||
+}
|
||||
+#endif /* FSYS_REISER4 */
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/Makefile.am grub-0.97-1/stage2/Makefile.am
|
||||
--- grub-0.97/stage2/Makefile.am 2005-02-02 23:37:35.000000000 +0300
|
||||
+++ grub-0.97-1/stage2/Makefile.am 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -13,17 +13,25 @@ EXTRA_DIST = setjmp.S apm.S $(noinst_SCR
|
||||
# For <stage1.h>.
|
||||
INCLUDES = -I$(top_srcdir)/stage1
|
||||
|
||||
+if ENABLE_REISER4_SUPPORT
|
||||
+REISER4_STAGE1_5 = reiser4_stage1_5
|
||||
+REISER4_STAGE1_5_EXEC = reiser4_stage1_5.exec
|
||||
+else
|
||||
+REISER4_STAGE1_5 =
|
||||
+REISER4_STAGE1_5_EXEC =
|
||||
+endif
|
||||
+
|
||||
# The library for /sbin/grub.
|
||||
noinst_LIBRARIES = libgrub.a
|
||||
libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
|
||||
disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
|
||||
- fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
|
||||
+ fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c \
|
||||
fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
|
||||
terminfo.c tparm.c
|
||||
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
|
||||
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
|
||||
-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
|
||||
- -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
|
||||
+ $(REISER4_CFLAGS) -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
|
||||
-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
|
||||
|
||||
# Stage 2 and Stage 1.5's.
|
||||
@@ -34,24 +42,26 @@ EXTRA_PROGRAMS = nbloader.exec pxeloader
|
||||
if DISKLESS_SUPPORT
|
||||
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
|
||||
ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
|
||||
- reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
|
||||
- nbgrub pxegrub
|
||||
+ reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
|
||||
+ vstafs_stage1_5 xfs_stage1_5 nbgrub pxegrub
|
||||
noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
|
||||
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
|
||||
e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
|
||||
iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
|
||||
- reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
|
||||
- xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
|
||||
+ reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
|
||||
+ vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec pxeloader.exec \
|
||||
+ diskless.exec
|
||||
else
|
||||
pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
|
||||
ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
|
||||
- reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
|
||||
+ reiserfs_stage1_5 $(REISER4_STAGE1_5) ufs2_stage1_5 \
|
||||
+ vstafs_stage1_5 xfs_stage1_5
|
||||
noinst_DATA = pre_stage2 start start_eltorito
|
||||
noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
|
||||
e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
|
||||
iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
|
||||
- reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
|
||||
- xfs_stage1_5.exec
|
||||
+ reiserfs_stage1_5.exec $(REISER4_STAGE1_5_EXEC) ufs2_stage1_5.exec \
|
||||
+ vstafs_stage1_5.exec xfs_stage1_5.exec
|
||||
endif
|
||||
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
|
||||
|
||||
@@ -79,7 +89,7 @@ else
|
||||
HERCULES_FLAGS =
|
||||
endif
|
||||
|
||||
-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
|
||||
+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin \
|
||||
$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
|
||||
|
||||
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
|
||||
@@ -89,14 +99,17 @@ STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DN
|
||||
pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
|
||||
cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
|
||||
fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
|
||||
- fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
|
||||
- hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
|
||||
+ fsys_reiserfs.c fsys_reiser4.c fsys_ufs2.c fsys_vstafs.c \
|
||||
+ fsys_xfs.c gunzip.c hercules.c md5.c serial.c smp-imps.c \
|
||||
+ stage2.c terminfo.c tparm.c
|
||||
pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
|
||||
pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
|
||||
pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
|
||||
|
||||
if NETBOOT_SUPPORT
|
||||
-pre_stage2_exec_LDADD = ../netboot/libdrivers.a
|
||||
+pre_stage2_exec_LDADD = ../netboot/libdrivers.a $(REISER4_LIBS)
|
||||
+else
|
||||
+pre_stage2_exec_LDADD = $(REISER4_LIBS)
|
||||
endif
|
||||
|
||||
if DISKLESS_SUPPORT
|
||||
@@ -190,6 +203,16 @@ reiserfs_stage1_5_exec_CCASFLAGS = $(STA
|
||||
-DNO_BLOCK_FILES=1
|
||||
reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
|
||||
|
||||
+# For reiser4_stage1_5 target.
|
||||
+reiser4_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
|
||||
+ disk_io.c stage1_5.c fsys_reiser4.c bios.c
|
||||
+reiser4_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
|
||||
+ -DNO_BLOCK_FILES=1
|
||||
+reiser4_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) $(REISER4_CFLAGS) \
|
||||
+ -DNO_BLOCK_FILES=1
|
||||
+reiser4_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
|
||||
+reiser4_stage1_5_exec_LDADD = $(REISER4_LIBS)
|
||||
+
|
||||
# For vstafs_stage1_5 target.
|
||||
vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
|
||||
disk_io.c stage1_5.c fsys_vstafs.c bios.c
|
||||
diff -upNr --exclude=Makefile.in --exclude='*.info' --exclude='*.m4' --exclude='*cache' --exclude=configure --exclude=.deps grub-0.97/stage2/shared.h grub-0.97-1/stage2/shared.h
|
||||
--- grub-0.97/stage2/shared.h 2004-06-19 20:40:09.000000000 +0400
|
||||
+++ grub-0.97-1/stage2/shared.h 2005-08-05 22:48:24.000000000 +0400
|
||||
@@ -207,11 +207,12 @@ extern char *grub_scratch_mem;
|
||||
#define STAGE2_ID_FAT_STAGE1_5 3
|
||||
#define STAGE2_ID_MINIX_STAGE1_5 4
|
||||
#define STAGE2_ID_REISERFS_STAGE1_5 5
|
||||
-#define STAGE2_ID_VSTAFS_STAGE1_5 6
|
||||
-#define STAGE2_ID_JFS_STAGE1_5 7
|
||||
-#define STAGE2_ID_XFS_STAGE1_5 8
|
||||
-#define STAGE2_ID_ISO9660_STAGE1_5 9
|
||||
-#define STAGE2_ID_UFS2_STAGE1_5 10
|
||||
+#define STAGE2_ID_REISER4_STAGE1_5 6
|
||||
+#define STAGE2_ID_VSTAFS_STAGE1_5 7
|
||||
+#define STAGE2_ID_JFS_STAGE1_5 8
|
||||
+#define STAGE2_ID_XFS_STAGE1_5 9
|
||||
+#define STAGE2_ID_ISO9660_STAGE1_5 10
|
||||
+#define STAGE2_ID_UFS2_STAGE1_5 11
|
||||
|
||||
#ifndef STAGE1_5
|
||||
# define STAGE2_ID STAGE2_ID_STAGE2
|
||||
@@ -226,6 +227,8 @@ extern char *grub_scratch_mem;
|
||||
# define STAGE2_ID STAGE2_ID_MINIX_STAGE1_5
|
||||
# elif defined(FSYS_REISERFS)
|
||||
# define STAGE2_ID STAGE2_ID_REISERFS_STAGE1_5
|
||||
+# elif defined(FSYS_REISER4)
|
||||
+# define STAGE2_ID STAGE2_ID_REISER4_STAGE1_5
|
||||
# elif defined(FSYS_VSTAFS)
|
||||
# define STAGE2_ID STAGE2_ID_VSTAFS_STAGE1_5
|
||||
# elif defined(FSYS_JFS)
|
||||
80701
src/patches/reiser4-for-2.6.16-5.patch
Normal file
80701
src/patches/reiser4-for-2.6.16-5.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user