<?xml version="1.0" ?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/"><id>tag:blogger.com,1999:blog-3437301763614556691.post-970953254412448499</id><link href="https://blog.achernya.com/feeds/970953254412448499/comments/default" rel="replies" title="Post Comments" type="application/atom+xml"/><link href="https://blog.achernya.com/2014/11/enterprise-linux-emergency.html#comment-form" rel="replies" title="0 Comments" type="text/html"/><link href="https://www.blogger.com/feeds/3437301763614556691/posts/default/970953254412448499" rel="edit" type="application/atom+xml"/><link href="https://www.blogger.com/feeds/3437301763614556691/posts/default/970953254412448499" rel="self" type="application/atom+xml"/><link href="https://blog.achernya.com/2014/11/enterprise-linux-emergency.html" rel="alternate" title="Enterprise Linux Emergency Modernization Kit" type="text/html"/><title>Enterprise Linux Emergency Modernization Kit</title><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Last week, I found myself trying to update the software on a server that was still running Red Hat Enterprise Linux 5. My goal was to run an <a href="http://clang.llvm.org/docs/AddressSanitizer.html">ASAN build</a> of zephyrd, the <a href="https://github.com/zephyr-im/zephyr">Zephyr</a> server to catch a heap corruption bug. ASAN is a feature of the <a href="http://clang.llvm.org/">clang</a> compiler, which unfortunately wasn't available.<br/>
<br/>
RHEL5, as well as the free derivative distributions that offer compatibility, was first released in 2007 with kernel 2.6.18; gcc 4.1.2; and glibc 2.5. Although RHEL5 is still &quot;in support&quot;, receiving bug and security updates, it's not receiving new versions of the software it shipped it with.<br/>
<br/>
clang provides binary downloads---getting a new version of clang onto this system should be easy! The first problem strikes: glibc is too old to support the binary clang, it depends on features from the newer version. Let's try compiling clang from source. Off goes .<span style="font-family: Courier New, Courier, monospace;">/configure</span>...gcc 4.7 or newer required?! Oh no. Building clang would require going through building gcc just to get a new enough compiler. That's not worth the time.<br/>
<br/>
At this point, I stepped back to re-evaluate my options. Although I had root access to the server, it wasn't a machine that I had full control over; the operations team owned it. On one hand, I could ask the team to reinstall it with something a bit more modern, but it would probably not happen until fleet-wide upgrades start. On the other, I could try to press onward with a larger hammer: install a chroot with a newer Enterprise Linux myself. Since the chroot was the more timely option, I decided to go try that first:
<br/>
<br/>
<span style="font-family: Courier New, Courier, monospace;">mkdir -p /srv/chroot/centos7-x86_64/</span><br/>
<span style="font-family: Courier New, Courier, monospace;">rpm --root=/srv/chroot/centos7-x86_64/ --rebuilddb</span><br/>
<span style="font-family: Courier New, Courier, monospace;">rpm --root=/srv/chroot/centos7-x86_64/ -ivh centos-release-7.x86_64.rpm</span><br/>
<br/>
which promptly fails because the version of <span style="font-family: Courier New, Courier, monospace;">rpm</span> in EL5 is too old. This can easily be fixed by using another host to build the chroot, as well as running <span style="font-family: Courier New, Courier, monospace;">yum install yum</span> to get a minimal base image. Copying the base image over and running <span style="font-family: Courier New, Courier, monospace;">chroot .</span> results in the dreaded <span style="font-family: Courier New, Courier, monospace;">FATAL: kernel too old</span><span style="font-family: inherit;"> message. No chroot tricks are going to work now; the version of glibc in EL7 assumes that the kernel is going to be much newer than the 2.6.18 that's installed.</span><br/>
<span style="font-family: inherit;"><br/></span>
<span style="font-family: inherit;">There's just one last thing to do before giving up and reinstalling the whole server: recompiling glibc for the older kernel. The glibc spec file around line 400 sets the minimum kernel version it supports:</span><br/>
<span style="font-family: Courier New, Courier, monospace;"><br/></span>
<span style="font-family: Courier New, Courier, monospace;">%define enablekernel 2.6.32</span><br/>
<span style="font-family: inherit;">by changing that to </span><br/>
<span style="font-family: Courier New, Courier, monospace;">%define enablekernel 2.6.18</span><br/>
<span style="font-family: inherit;"><br/></span>
<span style="font-family: inherit;">we can build an EL7 glibc package that will make a base system suitable for building chroots that work on EL5 systems! The resulting base system with this glibc is the &quot;Enterprise Linux Emergency Modernization Kit&quot; because it makes it easy to get new software on ancient EL5 hosts. You can easily build your own by following these instructions, or you could </span><a href="https://drive.google.com/file/d/0B05LmNFJeLGVMGlDTFZrWXlkSDg/view?usp=sharing">download a CentOS7-based one now!</a><br/>
<br/></div></content><updated planet:format="November 05, 2014 06:04 PM">2014-11-05T18:04:00Z</updated><published planet:format="November 05, 2014 06:04 PM">2014-11-05T18:04:00Z</published><author><name>Alex Chernyakhovsky</name><email>noreply@blogger.com</email><uri>http://www.blogger.com/profile/11975049716533800589</uri></author><source><id>tag:blogger.com,1999:blog-3437301763614556691</id><author><name>Alex Chernyakhovsky</name><email>noreply@blogger.com</email><uri>http://www.blogger.com/profile/11975049716533800589</uri></author><link href="https://blog.achernya.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/><link href="https://www.blogger.com/feeds/3437301763614556691/posts/default" rel="self" type="application/atom+xml"/><link href="https://blog.achernya.com/" rel="alternate" type="text/html"/><link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/><title>Alex Chernyakhovsky</title><updated planet:format="October 24, 2024 03:12 PM">2024-10-24T15:12:40Z</updated><planet:format>atom10</planet:format><planet:http_etag>W/&quot;b9560f01078294003119e3f65e1a161abcb19a55264a5e7f77bec04138bc5da6&quot;</planet:http_etag><planet:days_per_page>0</planet:days_per_page><planet:http_last_modified>Thu, 24 Oct 2024 15:12:40 GMT</planet:http_last_modified><planet:bozo>false</planet:bozo><planet:encoding>utf-8</planet:encoding><planet:items_per_page>60</planet:items_per_page><planet:css-id>alex-chernyakhovsky</planet:css-id><planet:name>Alex Chernyakhovsky</planet:name><planet:http_location>https://blog.achernya.com/feeds/posts/default</planet:http_location><planet:http_status>301</planet:http_status></source></entry>