the-hurd-on-bare-metal-update.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>The Hurd on Bare Metal Update — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>The Hurd on Bare Metal Update</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — January 07, 2024</h3><div><h1>Running the Hurd on Bare Metal</h1><p>So apparently, you can run X on the Hurd, and I am currently daily
  2. driving the Hurd. It's not perfect. Once a month or so the Hurd will
  3. lock up completely, and I will have to hard shutoff the machine and
  4. deal with filesystem corruption. But it does work! You will need to
  5. read the whole <a href="https://www.debian.org/ports/hurd/hurd-install">Debian wiki</a> page. There are sections that mention how
  6. to upgrade to the unstable distribution, setting up X, and the correct
  7. upgrade procedure:</p><pre><code># apt update
  8. # apt upgrade --without-new-pkgs
  9. # apt full-upgrade</code></pre><p>Let's install some packages and set up X.</p><pre><code># apt install i3 xinit pinentry-gnome3
  10. # Tell X to let any user startx (it is better to let only console
  11. # users to start X, but that is not working for me.
  12. # apt dpkg-reconfigure x11-common xserver-xorg-legacy</code></pre><p>Create a keyboard shortcut to kill X, because X may get stuck.</p><pre><code>cat /etc/X11/xorg.conf.d/xorg-ctrl-backspace.conf
  13. Section &quot;InputDevice&quot;
  14. Identifier &quot;Generic KeyBoard&quot;
  15. Driver &quot;kbd&quot;
  16. Option &quot;XkbOptions&quot; &quot;terminate:ctrl_alt_bksp&quot;
  17. EndSection</code></pre><p>If, I am running X, then the best way to shutdown the computer, is to
  18. first kill X, then from the console execute <code>sudo halt</code>. I tried to
  19. issue <code>sudo halt</code> from an <code>xterm</code>, and that caused some filesystem
  20. corruption on my <code>/home</code> partition.</p><p>So what works?</p><ul><li><p>Emacs 29.1</p><ul><li>Gnus</li><li>magit</li><li>erc</li><li>org-mode</li></ul></li><li><p>git send-email</p></li><li><p>netsurf web browser</p><p>I &quot;ported&quot; it via hard-coding <code>PATHMAX</code>, which is not an ideal
  21. solution, but at least I have a web browser that can render simple
  22. websites like Wikipedia.</p></li><li><p>ffmpeg</p><p>I actually use <code>recordmydesktop --no-sound --fps 2</code> on the Hurd
  23. machine. This does actually work. I tried
  24. using ffmpeg on my Guix System to add audio to the file, but the
  25. audio is out of sync with the video. I'm not sure why.</p></li><li><p><a href="https://mail.gnu.org/archive/html/bug-hurd/2023-03/msg00021.html">terrible-mdns-responder</a></p><p>Sergey created this as a way to easily ssh into his hurd box from a
  26. GNU/Linux machine. I use it like so: <code>ssh joshua@pippin.local</code>,
  27. and I can ssh into my Hurd machine without having to know its IP
  28. address. It's pretty cool!</p></li><li><p>i3</p><p>i3 is probably the slickest window manager out there! Since the
  29. Hurd is currently X only, I might as well use something light-weight
  30. that I like.</p></li><li><p>pastebinit</p><p>It would be nice if netsurf would work with a pastebin, but it's
  31. not. So the <code>pastebinit</code> command works.</p></li><li><p>ikiwiki</p><p>I can update the GNU Hurd wiki entirely using the Hurd. That's
  32. awesome!</p></li></ul><h2><strong>Gotchas</strong></h2><p>There are some gotchas when running the Hurd.</p><p>If, <code>/home</code> or <code>/</code> are readonly, then X will refuse to start and will
  33. not tell you why. So, my <code>.bashrc</code> has this in it:</p><pre><code>cat .profile | grep -A 15 'tell me'
  34. # tell me if / or /home are writeable or not.
  35. echo -n '/ is '
  36. myroot=$(fsysopts / | awk '{ print $2 }')
  37. myroot=${myroot:2}
  38. echo $myroot
  39. echo -n '/home is '
  40. myhome=$(fsysopts /home | awk '{ print $2 }')
  41. myhome=${myhome:2}
  42. echo $myhome
  43. if [ $myhome == &quot;writable&quot; ]; then
  44. echo &quot;starting X&quot;;
  45. else
  46. echo &quot;NOT starting X&quot;;
  47. fi</code></pre><p>When I have filesystem corruption, I need to umount <code>/</code> and <code>/home</code>
  48. and run fsck on them. Then reboot. Most of the time the Hurd can
  49. auto run fsck for you, but sometimes it is so bad that you must do it
  50. yourself.</p><p>When you have to fsck the filesystem, here is how to do it. You have
  51. to login via <code>root</code>, then <code>umount /home &amp;&amp; umount /</code>. Then run
  52. <code>fsck.ext2 /dev/hd0s1 &amp;&amp; fsck.ext2 /dev/hd0s6</code>. Now reboot.</p><p>I also cannot shutoff the machine from a terminal inside X. I first
  53. have to kill X, and then shutoff the machine from the console.</p><p>Also, <code>apt</code> is apparently not the best tool to install various
  54. packages. It is actually better to use <code>aptitude</code>. <code># apt install elpa-magit</code> fails, but <code>#aptitude install elpa-magit</code> somehow works.
  55. I do not know why.</p><p>This is kind of new, but <code>sudo</code> is failing:</p><pre><code>$ sudo ls
  56. malloc(): invalid size (unsorted)
  57. Aborted</code></pre><p>I would love to get haunt running on the Hurd, and it does run! But
  58. it fails to build this blog. At first it was that <code>guile-commonmark</code>
  59. was not installed. Then it was that haunt could not find
  60. <code>guile-commonmark</code>. The fix was pretty easy. In the haunt source
  61. code directory:</p><pre><code>$ export GUILE_LOAD_PATH=/usr/local/share/guile/site/3.0&quot;
  62. $ ./configure</code></pre><p>So that helped me build haunt correctly and it could find
  63. guile-commonmark. But then it needed guile-reader installed as well.
  64. Now I can't build guile-reader.</p><pre><code>$ autoreconf -vif
  65. autoreconf: error: automake failed with exit status: 1</code></pre><p>And of course the <code>./configure</code> in the guile-reader directory failed
  66. too.</p></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>