LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 12.1 and linux live scripts problems (https://www.linuxquestions.org/questions/slackware-14/slackware-12-1-and-linux-live-scripts-problems-652414/)

buaku 06-29-2008 10:54 AM

Slackware 12.1 and linux live scripts problems
 
I thought it'd be fun to try and make my own live cd, so I installed Slackware 12.1 and the linux live scripts.

I made my aufs and squashfs w/LZMA modules and followed the instructions and did some patching.

The aufs and squash modules load just fine on my running system, so that was encouraging.

I ran the build scripts and generated an iso, but when I boot the iso I keep getting errors not matter what stuff I try.

Here's the 2 errors I'm getting:
Code:

Mounting fuse control filesystem failed!
and then the really bad one...
Code:

Checking root filesystem:
fsck 1.4.8 (13-Mar-2008)
Remounting root device with read-write enabled.
/etc/mtab: Permission denied

then it spews out a bunch of info telling me this failure is going to cause serious problems.

I've looked at the initrd image and the running system and the perms look fine for /etc/mtab, so I have no clue what's going on.

Anyone have any idea what could be causing this?

onebuck 06-30-2008 10:32 PM

Hi,

You should look at 'Cooking Up Some Slack. (CUSS)'.

This link and others are available from 'Slackware-Links'. More than just SlackwareŽ links!

buaku 07-01-2008 10:14 PM

Cool, I'll check em out!

Well I tried a lot of other things after this post and eventually got another error saying mount.aufs was crapping out. So I compared some of my system files to the ones that are a part of Slax and Slax didn't have a mount.aufs. So I took the file out and it started to work!

Now I'm trying the whole thing from scratch to see if I can get it right w/out running into any errors.

Camarade_Tux 07-02-2008 01:59 AM

I've just finished a bunch of scripts which automate the whole process of making a livecd from these scripts (adds some apps, compiles and installs a shiny new kernel, gets rid of unuseful files that take space, and so on). They're not published yet as they need some polishing but they're almost bug free (set -o pipefail; set -o nounset; set -o errexit are great !) and certainly cause less bugs than humans. ;)

If such scripts were available, would you use them ?
I'm just wondering whether there will be some people using these scripts, nothing more. ;)

buaku 07-02-2008 05:10 PM

I'd probably use them or at least use them as a starting point to understand what's going on.
If nothing else it's always nice to have an example of something done right, even if you're trying to do it manually.

What's currently getting me with the live scripts is using his Makefile to build the squashfs and lzma parts.
It always fails trying to compile in like squashfs3.3/kernel-patches/<kernelver>/fs/squashfs.

Nothing in the instructions ever seemed to mention having source files in that directory and it doesn't look like any of the scripts put files in there. So I just end up copying the files over from /usr/src/<kernelver>/fs/squashfs. It's odd because the script somehow makes the kernel-patches/<kernelver>/fs/squashfs, but doesn't put anything in there.

onebuck 07-02-2008 06:37 PM

Hi,
Quote:

Originally Posted by Camarade_Tux (Post 3201102)
I've just finished a bunch of scripts which automate the whole process of making a livecd from these scripts (adds some apps, compiles and installs a shiny new kernel, gets rid of unuseful files that take space, and so on). They're not published yet as they need some polishing but they're almost bug free (set -o pipefail; set -o nounset; set -o errexit are great !) and certainly cause less bugs than humans. ;)

If such scripts were available, would you use them ?
I'm just wondering whether there will be some people using these scripts, nothing more. ;)

I'm game! Post a link to let us see them.

Camarade_Tux 07-03-2008 08:22 AM

Quote:

Originally Posted by buaku (Post 3202111)
I'd probably use them or at least use them as a starting point to understand what's going on.
If nothing else it's always nice to have an example of something done right, even if you're trying to do it manually.

What's currently getting me with the live scripts is using his Makefile to build the squashfs and lzma parts.
It always fails trying to compile in like squashfs3.3/kernel-patches/<kernelver>/fs/squashfs.

Nothing in the instructions ever seemed to mention having source files in that directory and it doesn't look like any of the scripts put files in there. So I just end up copying the files over from /usr/src/<kernelver>/fs/squashfs. It's odd because the script somehow makes the kernel-patches/<kernelver>/fs/squashfs, but doesn't put anything in there.

I've had the same problem and this has been one of my motives. What I've basically done with the kernel part, was to rewrite what was already provided. However my script is much much more robust and you shouldn't have troubles.
I've tarred a part of it and you can grab it there : http://pers.yaxm.org/temp/llama-0.1-part.tar.gz

Let's call ROOT_DIR the tarball root.

You should edit $ROOT_DIR/config/make-llama-config first.
SLACK_SRC is the location of a (local) slackware source. It is used to get the kernel source (the kernel source must be a slackware package !). You can also
Code:

mkdir -p $ROOT_DIR/srcs/kernel
( cd $ROOT_DIR/srcs/kernel && wget http://ftp.lip6.fr/pub/linux/distributions/slackware/slackware-current/slackware/k/kernel-source-2.6.24.5_smp-noarch-2.tgz )

(other sources are automatically downloaded)

You may also change the TMP variable. A tmpfs does not necessarily speed the compilation but it certainly speeds the kernel decompression so it is a good idea to use one. Note that you will need 550MB available.

You can change MAKE_CMD to "make -S" or simply "make" if you want the compilation to be a bit less quiet.
TUNE_FLAGS and OPTIMIZE_4_SIZE are used for src2pkg which is not used in this releas so don't care about them. Same applies for OCAML_PREFIX.

Last, there is my own kernel configuration at config/kernel.config. It's not perfect so you may want to check it (it should build ext2/3, xfs, reiserfs,jfs support in the kernel though). I made it because linux-live gives support for things such as token rings...
The kernel will be automatically installed at the end of the compilation. To disable this, change the last two lines at the end of $ROOT_DIR/creation-scripts/linux-live/build-lama-kernel.sh.


Now, issue $ROOT_DIR/creation-scripts/make-llama.sh.
You will be asked something about the kernel configuration and squashfs, answer N (it's the default anyway). I perfectly know the root of the problem but had no clean and sexy solution until now.


[1] in fact I also wrote a script which creates a 300MB slackware iso to get an even lighter slackware so I can expect the slackware source to be available ;)




Quote:

Originally Posted by onebuck (Post 3202183)
Hi,


I'm game! Post a link to let us see them.

Just give me a few days to have something really releasable. Probably this week-end. ;)

buaku 07-04-2008 12:00 AM

Quote:

Originally Posted by Camarade_Tux (Post 3202899)
I've had the same problem and this has been one of my motives. What I've basically done with the kernel part, was to rewrite what was already provided. However my script is much much more robust and you shouldn't have troubles.
I've tarred a part of it and you can grab it there : http://pers.yaxm.org/temp/llama-0.1-part.tar.gz

Those are a pretty impressive set of scripts there!

I found in your build-lama-kernel.sh where you change the provided linux-live Makefile. That appears to be just what I needed to build squashfs without getting an error the first build attempt! Thanks!!
Now that the paths were shorter I noticed I was getting some warnings during the "MODPOST 1 modules" portion of the build right after it says "Building Modules, stage 2"..
It's saying sqlzma_fin, sqlzma_un, and sqlzma_init are undefined in squashfs.ko, but the kernel module loads anyway after the build is complete.

Did you encounter that issue at all?

I don't really understand the module building process at all, so I'm not sure what's going on during that part of the build process.

I investigated further and it turns out if I don't have sqlzma.ko and unlzma.ko available and I try to insert squashfs, I get an error saying sqlzma_fin, sqlzma_un, and sqlzma_init are unknown symbols when I check out 'dmesg'. I'm guessing when squashfs.ko is being built those other modules don't exist yet and they can't provide those symbols to the squashfs module, so it gives that warning to me.


Do you deal with fsck.aufs in your scripts at all? My latest try at a live CD says it can't fsck the drive because it can't find fsck.aufs.
I did see where you copy the man page over though.

The first time I tried building my Live CD I did the recommended install command the aufs docs talk about.
Code:

# install -m 500 -p mount.aufs umount.aufs auplink aulchown /sbin (recommended)
Unfortunately I think this was the root cause of my problems on my first Live CD. After clearing up my mtab error I was getting mount.aufs errors. Once I took that file out of my Live CD, it booted just fine. The Slax CD doesn't have that mount.aufs file either, so that's why I tried removing it from my Live CD.

I figure an fsck isn't all that important since nothing can be saved back to the CD. It's like a brand new filesystem each time you run it!


Oh one more thing I wanted to mention is an issue I encountered getting networking to work on the Live CD. Whenever I would boot my CD it would say eth0 was renamed to eth1 by udev. I investigated this and I think this is because I built my Live CD from my current install. What happens is udev creates a rule for the network interface and binds it to the MAC address of the network card and saves it to a rule. This way if you have multiple NICs in a machine they'll always get the same device assigned to them, so as not to mess up anything dependent on their device name. So now when I boot the Live CD on another machine the network card's MAC address doesn't match the existing rule, so it makes a new rule and finds a new ethX to use. This would cause issues because eth1 isn't configured on bootup, so I wouldn't get an internet connection. My solution was to add "/etc/udev/rules.d/70-persistent-net.rules" to the list of excluded files in the linux-live scripts .config file. The way I understand it 75-persistent-net-generator.rules will generate that file or update it on each run.
Now since 70-persistent-net.rules isn't included on the CD it will be like a brand new install and whatever network card is in there will be like the first card it's ever seen, so it will get eth0! I guess the only downside is if you use the Live CD on a machine with multiple network cards their order may not be guaranteed from reboot to reboot.
From my searching it seems there are other ways to assign the device names, like using PCI Bus ID or something, but I guess even that could have issues when going between wildly different hardware.

Hope this post is understandable...I'm tired, but I wanted to get everything written down before I forgot :P

Camarade_Tux 07-04-2008 03:32 PM

Quote:

Originally Posted by buaku (Post 3203550)
Those are a pretty impressive set of scripts there!

I found in your build-lama-kernel.sh where you change the provided linux-live Makefile. That appears to be just what I needed to build squashfs without getting an error the first build attempt! Thanks!!
Now that the paths were shorter I noticed I was getting some warnings during the "MODPOST 1 modules" portion of the build right after it says "Building Modules, stage 2"..
It's saying sqlzma_fin, sqlzma_un, and sqlzma_init are undefined in squashfs.ko, but the kernel module loads anyway after the build is complete.

Did you encounter that issue at all?

It's absolutely not a problem. This happens if the lzma module is not loaded during compilation. There would be a problem if the lzma module were unavailable during boot but modprobe takes care of this and the linux-live's ./build would fail if it couldn't copy the corresponding module.


Quote:

I don't really understand the module building process at all, so I'm not sure what's going on during that part of the build process.

I investigated further and it turns out if I don't have sqlzma.ko and unlzma.ko available and I try to insert squashfs, I get an error saying sqlzma_fin, sqlzma_un, and sqlzma_init are unknown symbols when I check out 'dmesg'. I'm guessing when squashfs.ko is being built those other modules don't exist yet and they can't provide those symbols to the squashfs module, so it gives that warning to me.
I have to say I'm a bit surprised because it seems to be possible to build a module kernel without its having built its dependancies first. I guess that if it's the case, it's specific to the kernel.
Don't forget that modprobe will always try to load the lzma modules before loading the squashfs one.


Quote:

Do you deal with fsck.aufs in your scripts at all? My latest try at a live CD says it can't fsck the drive because it can't find fsck.aufs.
I did see where you copy the man page over though.
Well, I wasn't even aware such a file existed and in fact it surprises me. I don't really understand what could be checked in an union because the filesystem does not exist when it's not mounted ! I don't know if I have such a file so I'll check it (I can't right now);

Quote:

The first time I tried building my Live CD I did the recommended install command the aufs docs talk about.
Code:

# install -m 500 -p mount.aufs umount.aufs auplink aulchown /sbin (recommended)
Unfortunately I think this was the root cause of my problems on my first Live CD. After clearing up my mtab error I was getting mount.aufs errors. Once I took that file out of my Live CD, it booted just fine. The Slax CD doesn't have that mount.aufs file either, so that's why I tried removing it from my Live CD.
I had several problems but don't think I ever had that one. Maybe you had several mount.aufs which were conflicting but that's just an hypothesis.

Quote:

I figure an fsck isn't all that important since nothing can be saved back to the CD. It's like a brand new filesystem each time you run it!
And you can run as root all the time. :)
(except that some apps display that pestering superuser warning...)


Quote:

Oh one more thing I wanted to mention is an issue I encountered getting networking to work on the Live CD. Whenever I would boot my CD it would say eth0 was renamed to eth1 by udev. I investigated this and I think this is because I built my Live CD from my current install. What happens is udev creates a rule for the network interface and binds it to the MAC address of the network card and saves it to a rule. This way if you have multiple NICs in a machine they'll always get the same device assigned to them, so as not to mess up anything dependent on their device name. So now when I boot the Live CD on another machine the network card's MAC address doesn't match the existing rule, so it makes a new rule and finds a new ethX to use. This would cause issues because eth1 isn't configured on bootup, so I wouldn't get an internet connection. My solution was to add "/etc/udev/rules.d/70-persistent-net.rules" to the list of excluded files in the linux-live scripts .config file. The way I understand it 75-persistent-net-generator.rules will generate that file or update it on each run.
Now since 70-persistent-net.rules isn't included on the CD it will be like a brand new install and whatever network card is in there will be like the first card it's ever seen, so it will get eth0! I guess the only downside is if you use the Live CD on a machine with multiple network cards their order may not be guaranteed from reboot to reboot.
From my searching it seems there are other ways to assign the device names, like using PCI Bus ID or something, but I guess even that could have issues when going between wildly different hardware.
I never had the time to learn more about udev. In fact, since it is hard to get wireless working under linux, I started something around ndiswrapper which create an alias to wlanX (and since there's almost no computer with several wireless cards, wlan0 is your wireless card). There's a great windows project called driverpacks which gathers all drivers. I wrote a program which can find the proper driver and install it through ndiswrapper, I just need to remember where I've put it. :P
Anyway, I'll try that udev thing soon. Thanks for the tip.

buaku 07-04-2008 11:25 PM

Quote:

Originally Posted by Camarade_Tux (Post 3204282)
It's absolutely not a problem. This happens if the lzma module is not loaded during compilation. There would be a problem if the lzma module were unavailable during boot but modprobe takes care of this and the linux-live's ./build would fail if it couldn't copy the corresponding module.

I have to say I'm a bit surprised because it seems to be possible to build a module kernel without its having built its dependancies first. I guess that if it's the case, it's specific to the kernel.
Don't forget that modprobe will always try to load the lzma modules before loading the squashfs one.

That's good to know. I had a hunch that was the reason, but I like to have confirmation.


Quote:

Well, I wasn't even aware such a file existed and in fact it surprises me. I don't really understand what could be checked in an union because the filesystem does not exist when it's not mounted ! I don't know if I have such a file so I'll check it (I can't right now);
The Slax distro had it, so that's why I included it in mine. Without it I get a warning when the system is booting saying it can't find that file in order to fsck the drive. When you get a chance take a look as your Live CD is booting.
It happens for me a little after the triggering udev events part, like right after the linux-live scripts end and it starts up the distro.


Quote:

I had several problems but don't think I ever had that one. Maybe you had several mount.aufs which were conflicting but that's just an hypothesis.
Yeah I have no idea. There's lots of other mount.* files, but as long as I don't have mount.aufs all is well.
I just did a little searching and it turns out someone else had this issue. This thread talks about it and has the exact same issues I had:
http://www.mail-archive.com/aufs-use.../msg00061.html
According to that last post I guess it's not needed, and I think that dude may be the author of aufs. It's always nice to know why things happen!


Quote:

I never had the time to learn more about udev. In fact, since it is hard to get wireless working under linux, I started something around ndiswrapper which create an alias to wlanX (and since there's almost no computer with several wireless cards, wlan0 is your wireless card). There's a great windows project called driverpacks which gathers all drivers. I wrote a program which can find the proper driver and install it through ndiswrapper, I just need to remember where I've put it. :P
Anyway, I'll try that udev thing soon. Thanks for the tip.
I still don't know much about udev, just what little I read trying to solve my network issue. Now that's one thing I've never messed with is wireless cards in Linux. I still prefer to keep things wired because it's easier, lol.

One more thing I notice on boot is message saying "Mounting fuse control filesystem failed!" This seems to go away if I don't let rc.fuse execute on the Live CD. Not sure if this is important or not.
The fuse module appears to load either way when I check it with lsmod.
I know the Slax distro doesn't have an rc.fuse in it's /etc/rc.d dir, yet the fuse module get's loaded just fine anyway.

Even with these warning and issues on bootup the Live CD seems to run! I figure it's a lot of trial and error and just seeing what works and what doesn't. It's fun stuff and a great learning experience.
Hopefully this thread will help others out. I know its been great having someone to bounce ideas off of, so thanks for that!

fotoguy 07-06-2008 09:03 AM

Sorry I did see this post a lot sooner, I build a few live distro projects myself built from slackware 12. If you still have trouble I can spend some time and create a compress the built directory which already has a precompiled kernel ( 2.6.24-rc3 )and all the scripts to build a live cd from the prebuilt packages from the slackware 12 DvD. I have used this for over 3 years now and it works perfectly.

buaku 07-06-2008 12:26 PM

Quote:

Originally Posted by fotoguy (Post 3205551)
Sorry I did see this post a lot sooner, I build a few live distro projects myself built from slackware 12. If you still have trouble I can spend some time and create a compress the built directory which already has a precompiled kernel ( 2.6.24-rc3 )and all the scripts to build a live cd from the prebuilt packages from the slackware 12 DvD. I have used this for over 3 years now and it works perfectly.

Not a problem and thanks for the offer! I think I've got my issues worked out. The CD boots and I can log in and do things, so I think it's working pretty well. Now I'm just tweaking things here and there like preventing the thing from automounting my NTFS partitions.

I'm going to tweak the isolinux.cfg file and give me a few more menu options. At least one to automount and one to not automount.


All times are GMT -5. The time now is 04:01 PM.