I'm struggling to use livemedia-creator to create a bootable system image with updates and custom software (my own kernel RPM etc) installed. My main questions are: Can I define my own updates (and possibly custom) RPM repos in addition to a base or "os" URL? Or do I have to handle all updates and custom RPMs in %post? Do you have a recommendation for virt versus no-virt? Finally, is --make-disk a working option? I see no "opts.make_disk" in livemedia-creator or any documentation on this.
So far I can create a Live CD (--make-iso) running CentOS 7 using --no-virt. I started with lorax/docs/fedora-minimal.ks and changed the urlhttp://fedoraproject.org/wiki/Anaconda/Kickstart#url line to: url --url=file:///home/myself/local_centos_mirror/7/os/x86_64/
I've also had success running a minimal http server and a URL like: url --url="http://172.20.81.245:8000/7/os/x86_64/" Official mirrors work also, but I didn't want to tax them while I thrashed around with this.
My command-line invocation is "sudo livemedia-creator --make-iso --no-virt --ks=./my-centos7-minimal.ks"
But as soon as I add any repohttp://fedoraproject.org/wiki/Anaconda/Kickstart#repo sections to the kickstart file, I get errors. Here is what seems most natural to me: repo --name=updates --baseurl="http://172.20.81.245:8000/7/updates/x86_64/"
This gives me (in anaconda/packaging.log): ERR packaging: error populating transaction after 10 retries: failure: Packages/tar-1.26-29.el7.x86_64.rpm from anaconda: [Errno 256] No more mirrors to try. DEBUG packaging: http://172.20.81.245:8000/7/os/x86_64/Packages/tar-1.26-29.el7.x86_64.rpm: [Errno 14] curl#63 - "Callback aborted" --- but ... That's the right URL! You had it right there! curl on the command line works. Gah!
I don't understand the interplay between the repo and url options. I see that livemedia-creator parses the kickstart file, pulls out the url option, and passes this as a command-line argument to anaconda, but I still don't understand what's happening inside anaconda.
I've also been completely unsuccessful with virtualized installs. For example: sudo livemedia-creator --make-iso --vnc vnc --ks=./my-centos7-minimal.ks --iso=CentOS-7.0-1406-x86_64-NetInstall.iso
In the VM, anaconda finds the package lists from my http mirror, but then fails to download any RPMs. The errors seem similar to the above even when I remove all repo options. I wonder what I'm doing wrong? I can switch to a VT in the virtual machine and, like on the host, use curl to download the .rpm files. So I think virtual networking is being set up correctly.
Finally, while building an ISO is a workable option, I'd really like to be able to create a disk image and partition it with loopbacks etc, and install directly to that including grub in the boot sector. My target machine runs off a compact flash card (mounts as /dev/sda), and I'd like to be able to create a card image directly if possible. On the surface, it sounds like livemedia-creator is built with that kind of functionality in mind. But I don't see any specific documentation or even code relating to the --make-disk option. I believe I need to manually partition the disk image, but I don't know what to pass to livemedia-creator. I also haven't been able to get --make-fsimage to succeed with any kickstart file, virt or not.
I've tried both the latest lorax package in CentOS, 19.6.28-1, and also the current master branch of the git repository. I like that this is written in Python -- makes it very easy to read the code -- but the interaction with anaconda is still very complex and seemingly delicate.
Any suggestions? Am I even using the right tool? Sorry for the barrage of questions and long email. There's probably something simple that I'm missing, but I don't know what else to try.
Thanks, Topher Cawlfield
Well, this is a little embarrassing. I've answered some of my previous questions already. Two issues were misleading me:
One, when using --no-virt, I need to be careful to remove any files left over in /tmp/ and /var/tmp/. I seem to pick up stale repo information when I don't do this and livemedia-creator fails. This doesn't seem completely rational, but cleaning up helps give me reproduceable results. I'm doing: sudo rm -rf /tmp/yum.cache /tmp/yum.repos.d /tmp/yum.root /tmp/anaconda-yum.conf sudo rm -rf /var/tmp/yum.*
Another issue was that I was using an HTTP server for my mirror that yum did not like: Python's SimpleHTTPServer. After switching to Nginx, this started working again. I don't know why this is necessary, but I'll grab more wireshark captures tomorrow to compare. I have a feeling that the issue *might* be HTTP 1.1 vs 1.0, or maybe MIME types? Anyway I'll work that out soon.
Next I will revisit my "updates" repo, which I see now needs to be named almost anything except updates.
I'm still very curious if anyone has examples of using the --make-disk option.
Thanks, Topher Cawlfield ________________________________ From: anaconda-devel-list-bounces@redhat.com [anaconda-devel-list-bounces@redhat.com] on behalf of Christopher Cawlfield Sent: Tuesday, December 16, 2014 12:08 PM To: anaconda-devel-list@redhat.com Subject: Installing CentOS 7 with livemedia-creator
I'm struggling to use livemedia-creator to create a bootable system ... <foolishness snipped>
Thanks, Topher Cawlfield
On Wed, Dec 17, 2014 at 06:26:36PM -0500, Christopher Cawlfield wrote:
Well, this is a little embarrassing. I've answered some of my previous questions already. Two issues were misleading me:
One, when using --no-virt, I need to be careful to remove any files left over in /tmp/ and /var/tmp/. I seem to pick up stale repo information when I don't do this and livemedia-creator fails. This doesn't seem completely rational, but cleaning up helps give me reproduceable results. I'm doing: sudo rm -rf /tmp/yum.cache /tmp/yum.repos.d /tmp/yum.root /tmp/anaconda-yum.conf sudo rm -rf /var/tmp/yum.*
This is fixed in lorax-19.6.30-1, for centos you should be using the rhel7-branch instead of master.
Another issue was that I was using an HTTP server for my mirror that yum did not like: Python's SimpleHTTPServer. After switching to Nginx, this started working again. I don't know why this is necessary, but I'll grab more wireshark captures tomorrow to compare. I have a feeling that the issue *might* be HTTP 1.1 vs 1.0, or maybe MIME types? Anyway I'll work that out soon.
yum uses partial file requests so you need a full-featured server like lighttpd or nginx.
Next I will revisit my "updates" repo, which I see now needs to be named almost anything except updates.
You shouldn't name a repo updates unless you just want to enable the default updates repo (which will be wrong for your use case), it conflicts with the internal name, use something like updates-foo
https://fedoraproject.org/wiki/Anaconda/Kickstart#repo
I'm still very curious if anyone has examples of using the --make-disk option.
--make-disk is actually the default code path, that's why you don't see any opts.make_disk references. It should work just like --make-iso
The kickstart restriction is that /boot and / need to be the same partition so that it can find the kernel and initrd after the installation is complete.
On Monday, January 5, 2015, 2:23:56 PM, Brian C. Lane wrote:
The kickstart restriction is that /boot and / need to be the same partition so that it can find the kernel and initrd after the installation is complete.
Brian,
Don't you mean that /boot and / need to be on the same volume?
My understanding is that they could be in the same partition (with /boot simply a directory within the / partition - provided the boot loader supports the filesystem), or separate partitions on the same volume. In either case, symbolic links connect some resources in /etc (such as the grub2 configuration file) to the actual boot resources in /boot.
Al
On Mon, Jan 05, 2015 at 03:16:09PM -0500, Al Dunsmuir wrote:
On Monday, January 5, 2015, 2:23:56 PM, Brian C. Lane wrote:
The kickstart restriction is that /boot and / need to be the same partition so that it can find the kernel and initrd after the installation is complete.
Brian,
Don't you mean that /boot and / need to be on the same volume?
My understanding is that they could be in the same partition (with /boot simply a directory within the / partition - provided the boot loader supports the filesystem), or separate partitions on the same volume. In either case, symbolic links connect some resources in /etc (such as the grub2 configuration file) to the actual boot resources in /boot.
We're talking about a lmc restriction, not an installed system.
I would like to have similar capability for Fedora 22. It has been sometime that I have been looking for a method of creating a fully "up to date DVD iso". From that iso I would create a few DVDs and Flash drives for non-network based installations. I would present the DVDs with Fedora 22 meetings (meetups).
At a meetup, people want a start and complete an installation in a two hour window. and I can use an up-to-date DVD, that does not need the web access for updates. I can do that in a meeting room with limited wifi supporting a large number of concurrent installations. With a livemedia creator tool, all can be done. without choking a download server, or overloading local wifi network bandwidth. Our one-night-stand is a Linux meetup. I normally give away the DVDs as swag. They are not fancy, just off-the-shelf DVDs that I buy by the 100s and burn a few for give-away.
I give those DVDs away at "Linux meetups to former Ubuntu or to other distribution converts and to new users of Fedora Linux.
Please generalize the live-media creator so it can be used with RH, Centos7, and Fedoraxx
Regards Leslie Mr. Leslie Satenstein Montréal Québec, Canada
From: Brian C. Lane bcl@redhat.com To: anaconda-devel-list@redhat.com Sent: Monday, January 5, 2015 7:49 PM Subject: Re: Installing CentOS 7 with livemedia-creator
On Mon, Jan 05, 2015 at 03:16:09PM -0500, Al Dunsmuir wrote:
On Monday, January 5, 2015, 2:23:56 PM, Brian C. Lane wrote:
The kickstart restriction is that /boot and / need to be the same partition so that it can find the kernel and initrd after the installation is complete.
Brian,
Don't you mean that /boot and / need to be on the same volume?
My understanding is that they could be in the same partition (with /boot simply a directory within the / partition - provided the boot loader supports the filesystem), or separate partitions on the same volume. In either case, symbolic links connect some resources in /etc (such as the grub2 configuration file) to the actual boot resources in /boot.
We're talking about a lmc restriction, not an installed system.
Here's an update. The short version is that Brian's response answers all my initial questions. Many thanks!
On Monday, January 5, 2015 12:23 PM, Brian C. Lane wrote:
On Wed, Dec 17, 2014 at 06:26:36PM -0500, Christopher Cawlfield wrote:
Well, this is a little embarrassing. I've answered some of my previous questions already. Two issues were misleading me:
One, when using --no-virt, I need to be careful to remove any files left over in /tmp/ and /var/tmp/. I seem to pick up stale repo information when I don't do this and livemedia-creator fails. This doesn't seem completely rational, but cleaning up helps give me reproduceable results. I'm doing: sudo rm -rf /tmp/yum.cache /tmp/yum.repos.d /tmp/yum.root /tmp/anaconda-yum.conf sudo rm -rf /var/tmp/yum.*
This is fixed in lorax-19.6.30-1, for centos you should be using the rhel7-branch instead of master.
I had tried using the master branch, ran into different problems, and then went back to the Centos 7 lorax package, which probably corresponds to the lorax-19.6.28-1 tag. I'll try the rhel7-branch going forward.
Another issue was that I was using an HTTP server for my mirror that yum did not like: Python's SimpleHTTPServer. After switching to Nginx, this started working again. I don't know why this is necessary, but I'll grab more wireshark captures tomorrow to compare. I have a feeling that the issue *might* be HTTP 1.1 vs 1.0, or maybe MIME types? Anyway I'll work that out soon.
yum uses partial file requests so you need a full-featured server like lighttpd or nginx.
Okay, this makes sense. I struggled a bit to isolate the problem with various Python SimpleHTTPRequestHandler options and analyzing packet captures, but wasn't getting anywhere.
Next I will revisit my "updates" repo, which I see now needs to be named almost anything except updates.
You shouldn't name a repo updates unless you just want to enable the default updates repo (which will be wrong for your use case), it conflicts with the internal name, use something like updates-foo
I found that for installing updates from a CentOS updates mirror, the name did not ultimately matter. I was confused by the fact that, according to the Kickstart documentation (your link above), I can use the name "updates" specifically to re-enable the updates repo that is disabled by default. But README.livemedia-creator says: "You can also add an update repo, but don't name it updates." The following worked for me in my kickstart file, but "--name=myupdates" appeared to work just as well as "--name=updates":
repo --name=myupdates --baseurl="http://localhost/7/updates/x86_64/"
This gave me an installation with updated packages. Hooray! In this case I was using --no-virt, and localhost was hosting a local CentOS mirror. This gets a little more complicated using a virt install, and I haven't yet worked out the host IP for libvirt guests. Instead I just set up another mirror on my LAN.
I was also able to create my own RPM, a custom kernel, following instructions at http://wiki.centos.org/HowTos/Custom_Kernel. I needed to use createrepo in order to get the repodata subdirectory for my packages, but that's not too surprising. This became another "repo" in my kickstart file, and I specified the custom kernel version in my %packages section. I have yet to determine whether or not I can use the CentOS kernel and simply provide extra modules. That goes beyond the scope of this discussion.
I'm still very curious if anyone has examples of using the --make-disk option.
--make-disk is actually the default code path, that's why you don't see any opts.make_disk references. It should work just like --make-iso
The kickstart restriction is that /boot and / need to be the same partition so that it can find the kernel and initrd after the installation is complete.
Ahh, okay. Yes, once I finally just tried this option it worked perfectly! I just copied the resulting image to a (CompactFlash) disk with dd and it booted.
I haven't gotten to the point of worrying about a separate boot partition yet. I will probably want this in the future, so I'll have to keep this restriction in mind. Maybe I can work around this with symlinks or an overlay when the time comes.
Thanks again, Topher
anaconda-devel@lists.fedoraproject.org