Well, as you can see, I have made a patch for adding LFS support to
System-tools-backends, and I'm willing for anyone to add this to the
book, and test it (so that I feel safe committing this to upstream).
At first, I've tried to get Wayne to test it out for me, but he never
responded back, and I don't see the patch in the book. So, I'm willing
to let someone at LFS test it out for me and add it to the book, just
so that I can merge this patch upstream.
Anyone willing to do the honors for me? The patch is attached, in case
you want to test it. I think it can be backported to 2.9.4, but I
can't test it right now, as I'm just starting my most recent LFS
build.
--
William Immendorf
The ultimate in free computing.
Messages in plain text, please, no HTML.
GPG key ID: 1697BE98
If it's not signed, it's not from me.
--------------
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
diff -Naur system-tools-backends-2.10.0.old/Init/ServicesList.pm system-tools-backends-2.10.0/Init/ServicesList.pm
--- system-tools-backends-2.10.0.old/Init/ServicesList.pm 2010-01-30 08:20:27.000000000 -0600
+++ system-tools-backends-2.10.0/Init/ServicesList.pm 2010-08-11 12:52:40.875746548 -0500
@@ -177,6 +177,22 @@
"ureadahead",
"wpa-ifupdown",
"x11-common",
+ # And these are from LFS/CLFS systems (found in /etc/rc.d/rcsysinit.d, and /etc/rc.d/init.d/rc)
+ "rc",
+ "mountkernfs",
+ "consolelog",
+ "modules",
+ "udev",
+ "swap",
+ "checkfs",
+ "mountfs",
+ "cleanfs",
+ "udev_retry",
+ "console",
+ "localnet",
+ "sysctl",
+ "sysklogd",
+ "network",
];
foreach $i (@$service_forbidden_list)
diff -Naur system-tools-backends-2.10.0.old/Init/Services.pm system-tools-backends-2.10.0/Init/Services.pm
--- system-tools-backends-2.10.0.old/Init/Services.pm 2010-03-29 09:56:20.000000000 -0500
+++ system-tools-backends-2.10.0/Init/Services.pm 2010-08-11 12:52:40.880572713 -0500
@@ -50,6 +50,7 @@
"suse-9.0" => "redhat-6.2",
"pld-1.0" => "redhat-6.2",
"vine-3.0" => "redhat-6.2",
+ "linuxfromscratch" => "redhat-6.2",
"slackware-9.1.0" => "freebsd-5",
"gentoo" => "gentoo",
"archlinux" => "freebsd-5",
@@ -333,6 +334,7 @@
"vine-3.0" => ["$gst_prefix/etc/rc.d", "$gst_prefix/etc/rc.d/init.d", "../init.d"],
"ark" => ["$gst_prefix/etc/rc.d", "$gst_prefix/etc/rc.d/init.d", "../init.d"],
"solaris-2.11" => ["$gst_prefix/etc", "$gst_prefix/etc/init.d", "../init.d"],
+ "linuxfromscratch" => ["$gst_prefix/etc/rc.d", "$gst_prefix/etc/rc.d/init.d", "../init.d"]
);
my $res;
diff -Naur system-tools-backends-2.10.0.old/Network/Hosts.pm system-tools-backends-2.10.0/Network/Hosts.pm
--- system-tools-backends-2.10.0.old/Network/Hosts.pm 2009-09-28 04:49:10.000000000 -0500
+++ system-tools-backends-2.10.0/Network/Hosts.pm 2010-08-11 12:52:40.880572713 -0500
@@ -45,6 +45,7 @@
"mandrake-9.0" => "redhat-6.2",
"yoper-2.2" => "redhat-6.2",
"conectiva-9" => "redhat-6.2",
+ "linuxfromscratch"=> "redhat-6.2",
"suse-9.0" => "suse-9.0",
"pld-1.0" => "redhat-6.2",
"vine-3.0" => "redhat-6.2",
diff -Naur system-tools-backends-2.10.0.old/Network/Ifaces.pm system-tools-backends-2.10.0/Network/Ifaces.pm
--- system-tools-backends-2.10.0.old/Network/Ifaces.pm 2009-09-28 04:49:10.000000000 -0500
+++ system-tools-backends-2.10.0/Network/Ifaces.pm 2010-08-11 14:45:26.224590412 -0500
@@ -579,6 +579,11 @@
return @{&sysconfig_dir_get_existing_ifaces ("/etc/sysconfig/interfaces")};
}
+sub get_existing_lfs_ifaces
+{
+ return @{&sysconfig_dir_get_existing_ifaces ("/etc/sysconfig/network-devices")};
+}
+
sub get_pap_passwd
{
my ($file, $login) = @_;
@@ -1597,6 +1602,23 @@
&Utils::File::remove ("/etc/sysconfig/network-scripts/ifcfg-$dev");
}
+sub delete_lfs_interface
+{
+ my ($old_hash) = @_;
+ my ($dev, $login);
+
+ $dev = $$old_hash{"file"};
+ $login = $old_hash{"login"};
+ &activate_interface_by_dev ($dev, 0);
+
+ if ($login)
+ {
+ &remove_pap_entry ("/etc/ppp/pap-secrets", $login;
+ }
+
+ $Utils::File::remove ("/etc/sysconfig/network-devices/ifconfig-$dev");
+}
+
sub delete_rh72_interface
{
my ($old_hash) = @_;
@@ -2000,6 +2022,7 @@
"gentoo" => "gentoo",
"freebsd-5" => "freebsd-5",
"solaris-2.11" => "solaris-2.11",
+ "linuxfromscratch" => "linuxfromscratch",
);
return $dist_map{$Utils::Backend::tool{"platform"}};
@@ -2741,6 +2764,48 @@
[ "apn", \&check_type, [TYPE, "gprs", \&Utils::Parse::get_from_chatfile, CHAT, "cgdcont.*\"([^\"]+)\"" ]],
]
},
+ "linuxfromscratch" =>
+ {
+ ifaces_get => \&get_existing_lfs_ifaces,
+ fn =>
+ {
+ IFCFG => "/etc/sysconfig/network-devices/ifconfig-#iface#",
+ CHAT => "/etc/ppp/%ppp_type%.chat",
+ IFACE => "#iface#",
+ IFACE_TYPE => "#type#",
+ TYPE => "%ppp_type%",
+ PAP => "/etc/ppp/pap-secrets",
+ CHAP => "/etc/ppp/chap-secrets",
+ },
+ table =>
+ [
+ [ "auto", \&Utils::Parse::get_sh_bool, IFCFG, ONBOOT ],
+ [ "dev", \&Utils::Parse::get_sh, IFCFG, DEVICE ],
+ [ "address", \&Utils::Parse::get_sh, IFCFG, IPADDR ],
+ [ "netmask", \&Utils::Parse::get_sh, IFCFG, NETMASK ],
+ [ "broadcast", \&Utils::Parse::get_sh, IFCFG, BROADCAST ],
+ [ "network", \&Utils::Parse::get_sh, IFCFG, NETWORK ],
+ [ "gateway", \&Utils::Parse::get_sh, IFCFG, GATEWAY ],
+ [ "remote_address", \&Utils::Parse::get_sh, IFCFG, REMIP ],
+ [ "ppp_type", \&check_type, [IFACE_TYPE, "modem", \&Utils::Parse::get_trivial, "modem" ]],
+ [ "section", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, WVDIALSECT ]],
+ [ "update_dns", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh_bool, IFCFG, PEERDNS ]],
+ [ "mtu", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, MTU ]],
+ [ "mru", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, MRU ]],
+ [ "login", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, PAPNAME ]],
+ [ "password", \&check_type, [TYPE, "modem", \&get_pap_passwd, PAP, "%login%" ]],
+ [ "password", \&check_type, [TYPE, "modem", \&get_pap_passwd, CHAP, "%login%" ]],
+ [ "serial_port", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, MODEMPORT ]],
+ [ "serial_speed", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh, IFCFG, LINESPEED ]],
+ [ "set_default_gw", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh_bool, IFCFG, DEFROUTE ]],
+ [ "persist", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh_bool, IFCFG, PERSIST ]],
+ [ "serial_escapechars", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh_bool, IFCFG, ESCAPECHARS ]],
+ [ "serial_hwctl", \&check_type, [TYPE, "modem", \&Utils::Parse::get_sh_bool, IFCFG, HARDFLOWCTL ]],
+ [ "phone_number", \&check_type, [TYPE, "modem", \&Utils::Parse::get_from_chatfile, CHAT, "^atd[^0-9]*([#\*0-9, \-]+)" ]],
+# [ "update_dns", \&gst_network_pump_get_nodns, PUMP, "%dev%", "%bootproto%" ],
+# [ "dns1", \&Utils::Parse::get_sh, IFCFG, DNS1 ],
+# [ "dns2", \&Utils::Parse::get_sh, IFCFG, DNS2 ],
+# [ "ppp_options", \&Utils::Parse::get_sh, IFCFG, PPPOPTIONS ],
);
my $dist = &get_interface_dist ();
@@ -3458,6 +3523,50 @@
[ "apn", \&check_type, [TYPE, "gprs", \&Utils::Replace::set_chat, CHAT, "cgdcont.*\"([^\"]+)\"" ]],
]
},
+ "linuxfromscratch" >=
+ {
+ iface_set => \&activate_interface,
+ iface_delete => \&delete_lfs_interface,
+ fn =>
+ {
+ IFCFG => "/etc/sysconfig/network-devices/ifconfig-#iface#",
+ CHAT => "/etc/ppp/%ppp_type%.chat",
+ IFACE => "#iface#",
+ IFACE_TYPE => "#type#",
+ TYPE => "%ppp_type%",
+ },
+ table =>
+ [
+ [ "bootproto", \&set_rh_bootproto, IFCFG, BOOTPROTO ],
+ [ "auto", \&Utils::Replace::set_sh_bool, IFCFG, ONBOOT ],
+ [ "dev", \&Utils::Replace::set_sh, IFCFG, NAME ],
+ [ "dev", \&Utils::Replace::set_sh, IFCFG, DEVICE ],
+ [ "address", \&Utils::Replace::set_sh, IFCFG, IPADDR ],
+ [ "netmask", \&Utils::Replace::set_sh, IFCFG, NETMASK ],
+ [ "broadcast", \&Utils::Replace::set_sh, IFCFG, BROADCAST ],
+ [ "network", \&Utils::Replace::set_sh, IFCFG, NETWORK ],
+ [ "gateway", \&Utils::Replace::set_sh, IFCFG, GATEWAY ],
+ [ "update_dns", \&Utils::Replace::set_sh_bool, IFCFG, PEERDNS ],
+ [ "remote_address", \&Utils::Replace::set_sh, IFCFG, REMIP ],
+ [ "login", \&Utils::Replace::set_sh, IFCFG, PAPNAME ],
+ [ "serial_port", \&Utils::Replace::set_sh, IFCFG, MODEMPORT ],
+ [ "serial_speed", \&Utils::Replace::set_sh, IFCFG, LINESPEED ],
+ [ "ppp_options", \&Utils::Replace::set_sh, IFCFG, PPPOPTIONS ],
+ [ "section", \&Utils::Replace::set_sh, IFCFG, WVDIALSECT ],
+ [ "set_default_gw", \&Utils::Replace::set_sh_bool, IFCFG, DEFROUTE ],
+ [ "persist", \&Utils::Replace::set_sh_bool, IFCFG, PERSIST ],
+ [ "phone_number", \&Utils::Replace::set_chat, CHAT, "^atd[^0-9]*([#\*0-9, \-]+)" ],
+# [ "update_dns", \&gst_network_pump_set_nodns, PUMP, "%dev%", "%bootproto%" ],
+# [ "dns1", \&Utils::Replace::set_sh, IFCFG, DNS1 ],
+# [ "dns2", \&Utils::Replace::set_sh, IFCFG, DNS2 ],
+# [ "mtu", \&Utils::Replace::set_sh, IFCFG, MTU ],
+# [ "mru", \&Utils::Replace::set_sh, IFCFG, MRU ],
+# [ "debug", \&Utils::Replace::set_sh_bool, IFCFG, DEBUG ],
+# [ "serial_escapechars", \&Utils::Replace::set_sh_bool, IFCFG, ESCAPECHARS ],
+# [ "serial_hwctl", \&Utils::Replace::set_sh_bool, IFCFG, HARDFLOWCTL ],
+ ]
+ },
+
);
my $dist = &get_interface_dist ();
diff -Naur system-tools-backends-2.10.0.old/Shares/SMB.pm system-tools-backends-2.10.0/Shares/SMB.pm
--- system-tools-backends-2.10.0.old/Shares/SMB.pm 2009-09-28 04:49:10.000000000 -0500
+++ system-tools-backends-2.10.0/Shares/SMB.pm 2010-08-11 12:52:40.880572713 -0500
@@ -141,6 +141,7 @@
"slackware-9.1.0" => "debian",
"gentoo" => "debian",
"archlinux" => "debian",
+ "linuxfromscratch" => "debian",
"pld-1.0" => "pld-1.0",
"vine-3.0" => "debian",
"freebsd-5" => "freebsd-5",
diff -Naur system-tools-backends-2.10.0.old/Time/NTP.pm system-tools-backends-2.10.0/Time/NTP.pm
--- system-tools-backends-2.10.0.old/Time/NTP.pm 2009-09-28 04:49:10.000000000 -0500
+++ system-tools-backends-2.10.0/Time/NTP.pm 2010-08-11 12:52:40.880572713 -0500
@@ -42,6 +42,7 @@
"vine-3.0" => "redhat-6.2",
"freebsd-5" => "redhat-6.2",
"archlinux" => "redhat-6.2",
+ "linuxfromscratch" => "redhat-6.2",
"solaris-2.11" => "solaris-2.11",
);
diff -Naur system-tools-backends-2.10.0.old/Time/TimeDate.pm system-tools-backends-2.10.0/Time/TimeDate.pm
--- system-tools-backends-2.10.0.old/Time/TimeDate.pm 2009-11-05 15:20:11.000000000 -0600
+++ system-tools-backends-2.10.0/Time/TimeDate.pm 2010-08-11 12:52:40.880572713 -0500
@@ -173,6 +173,7 @@
"pld-1.0" => "redhat-6.2",
"vine-3.0" => "redhat-6.2",
"freebsd-5" => "redhat-6.2",
+ "linuxfromscratch" => "redhat-6.2",
"solaris-2.11" => "solaris-2.11",
);
diff -Naur system-tools-backends-2.10.0.old/Users/Users.pm system-tools-backends-2.10.0/Users/Users.pm
--- system-tools-backends-2.10.0.old/Users/Users.pm 2010-03-20 05:43:56.000000000 -0500
+++ system-tools-backends-2.10.0/Users/Users.pm 2010-08-11 12:52:40.883575232 -0500
@@ -248,6 +248,7 @@
'fedora-1' => $rh_logindefs_defaults,
'debian' => $rh_logindefs_defaults,
'vine-3.0' => $rh_logindefs_defaults,
+ 'linuxfromscratch' => $rh_logindefs_defaults,
'gentoo' => $gentoo_logindefs_defaults,
'archlinux' => $gentoo_logindefs_defaults,
'slackware-9.1.0' => $gentoo_logindefs_defaults,
@@ -608,7 +609,8 @@
$Utils::Backend::tool{"platform"} !~ /^slackware/ &&
$Utils::Backend::tool{"platform"} !~ /^archlinux/ &&
$Utils::Backend::tool{"platform"} !~ /^redhat/ &&
- $Utils::Backend::tool{"platform"} !~ /^gentoo/)
+ $Utils::Backend::tool{"platform"} !~ /^gentoo/ &&
+ $Utils::Backend::tool{"platform"} !~ /^linuxfromscratch/)
{
# use adduser if available and valid (slackware one is b0rk)
# set empty gecos fields and password, they will be filled out later
diff -Naur system-tools-backends-2.10.0.old/Utils/Platform.pm system-tools-backends-2.10.0/Utils/Platform.pm
--- system-tools-backends-2.10.0.old/Utils/Platform.pm 2010-03-25 04:51:55.000000000 -0500
+++ system-tools-backends-2.10.0/Utils/Platform.pm 2010-08-11 15:06:04.831589681 -0500
@@ -92,6 +92,8 @@
"nexenta-1.0" => [ "Nexenta GNU/Solaris", "1.0", "Ellate" ],
"yellowdog-4.1" => [ "Yellow Dog Linux", "4.1", "Sagitta" ],
"guadalinex-v4" => [ "Guadalinex", "v4", "Toro" ],
+ "linuxfromscratch" => [ "Linux From Scratch (LFS)" ],
+ "cross-lfs" => [ "Cross Linux From Scratch (CLFS)" ],
};
sub get_platform_info
@@ -143,6 +145,7 @@
"vine-3.1" => "vine-3.0",
"vlos-1.2" => "gentoo",
"nexenta-1.0" => "solaris-2.11",
+ "cross-lfs" => "linuxfromscratch",
);
return $metamap{$distro} if ($metamap{$distro});
@@ -375,6 +378,8 @@
[ \&check_ark ],
[ \&check_yoper ],
[ \&check_distro_file, "/etc/yellowdog-release", "yellowdog", "^Yellow Dog Linux release (\\S+)" ],
+ [ \&check_distro_file, "/etc/lfs-release", "linuxfromscratch" ],
+ [ \&check_distro_file, "/etc/clfs-release", "cross-lfs" ],
],
"FreeBSD" => [[ \&check_freebsd ]],
"SunOS" => [[ \&check_solaris ]]
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page