all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63738: [PATCH glibc] Stop checking if MiG supports retcode.
       [not found]               ` <CAKwpGPyXf0LaUH3Mgwqq1duG0O6xUcEuzYRAfQiJmsqgicS+oQ@mail.gmail.com>
@ 2023-05-26 14:21                 ` Joshua Branson via Bug reports for GNU Guix
  0 siblings, 0 replies; only message in thread
From: Joshua Branson via Bug reports for GNU Guix @ 2023-05-26 14:21 UTC (permalink / raw)
  To: janneke; +Cc: guix-devel, 63738


Hey guix people!  The Hurd developers having a 64 bit Hurd that can run
/bin/sh.  The below are some tips for how to set up such a thing if you
were so inclined.  The Debian people are providing 64-bit hurd
applications here for now:

https://people.debian.org/~sthibault/tmp/hurd-amd64

Flávio Cruz <flaviocruz@gmail.com> writes:

> Hi Sergey
>
> On Fri, May 19, 2023 at 4:02 AM Sergey Bugaev <bugaevc@gmail.com> wrote:
>
>  Hi,
>
>  On Fri, May 19, 2023 at 9:43 AM Flávio Cruz <flaviocruz@gmail.com>
>  wrote:
>  > I have made changes so that it does daily builds and I'm able to boot
>  small programs. However, I haven't had the time to boot programs built
>  against Glibc. How do you package and boot the static binaries using a
>  ramdisk? I've been reading the other threads about the Guix/rumpkernel
>  so I might be able to piece something together and try it this weekend.
>
>  You just put the entirety of the root filesystem (containing /usr,
>  /bin, /lib, /hurd, and so on) as an ext2 image into a *file* that you
>  place onto the actual drive (a CD disk in my case), and then you ask
>  GRUB to load the file from the drive into memory, tell gnumach to make
>  a ramdisk device out of it (you'll need to apply [0]), and tell ext2fs
>  to use that device. Here's the relevant piece of my grub config
>  script:
>
>  [0]:
>  https://salsa.debian.org/hurd-team/gnumach/-/blob/master/debian/patches/50_initrd.patch
>  
>
>  multiboot /boot/gnumach console=com0
>  module /boot/initrd.ext2 initrd.ext2 '$(ramdisk-create)'
>  module /sbin/ext2fs.static ext2fs
>  --multiboot-command-line='${kernel-command-line}' --readonly
>  --host-priv-port='${host-port}' --device-master-port='${device-port}'
>  --exec-server-task='${exec-task}' --kernel-task='${kernel-task}' -T
>  device rd0 '$(fs-task=task-create)' '$(prompt-task-resume)'
>  module /lib/ld.so.1 ld.so.1 /hurd/exec
>  --device-master-port='${device-port}' '$(exec-task=task-create)'
>  boot
>
>  (I should probably change it to not hardcode 'rd0', but whatever).
>  Note that /boot/gnumach, /boot/initrd.ext2, /sbin/ext2fs.static, and
>  /lib/ld.so.1 are all paths inside the CD image (those are going to be
>  loaded by GRUB), and /boot/initrd.ext2 is the ext2 filesystem image
>  containing the actual Hurd root. /hurd/exec however is already a path
>  inside the fs image -- this is where ld.so (not grub) is going to load
>  the exec server from. The only static binary here is ext2fs.static,
>  the rest are all dynamically linked.
>
>  Then in /libexec/console-run (inside the filesystem image), I have
>  written the following:
>
>  #! /bin/sh
>
>  settrans -ac /dev/mach-console /hurd/streamio console
>  exec <>/dev/mach-console >&0 2>&0
>  echo Hello from /bin/sh!
>  exec /bin/sh -i
>
>  (If you're going to do the same, don't forget to create the
>  /dev/mach-console node beforehand, since the fs is read-only.) I also
>  had to patch streamio a little to do the \r -> \n conversion like
>  glibc already does in devstream:
>
>  diff --git a/trans/streamio.c b/trans/streamio.c
>  index 272a002c..0af1aea3 100644
>  --- a/trans/streamio.c
>  +++ b/trans/streamio.c
>  @@ -500,6 +500,9 @@ trivfs_S_io_read (struct trivfs_protid *cred,
>                    cred->po->openmodes & O_NONBLOCK);
>     pthread_mutex_unlock (&global_lock);
>     *data_len = data_size;
>  +  for (size_t i = 0; i < data_size; i++)
>  +    if ((*data)[i] == '\r')
>  +      (*data)[i] = '\n';
>     return err;
>   }
>
>  (maybe I should also add echoing of input characters in the same way,
>  which is also what glibc's devstream does -- otherwise currently I
>  don't see what I'm typing on the console).
>
>  Make sure to use the very latest glibc (Samuel has already pushed all
>  of my patches upstream!) + the BRK_START hack.
>
> Thanks for the instructions. I was able to make it work and pushed my
> changes to Github.
>
> For people that might want to try out the new port using
> https://github.com/flavioc/cross-hurd,
> the following will download the packages and build a disk image with the ram
> disk:
>
> $ export CPU=x86_64
> $ bash download.sh && bash bootstrap.sh && bash compile.sh && bash
> create-initrd.sh
>
> Then, to run qemu:
>
> $ bash start-qemu-debug.sh
>
>  Sergey
>

-- 

Joshua Branson
Sent from the Hurd




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-26 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ZFspor91aoMwbh9T@jupiter.tail36e24.ts.net>
     [not found] ` <CAN9u=HfUw2-6b2Ac4sCG8OhLKBdHVD9b3OsVOQHmVKkRJdquCw@mail.gmail.com>
     [not found]   ` <CAKwpGPwkdur-cwohF9=Ww_kbs3A8-iK+=E8y3V-Gr3JnmgpF8Q@mail.gmail.com>
     [not found]     ` <CAN9u=HcwiHAZYsXDZq1qV3-GcJujZPc996CvCZLmkTtKNwazHA@mail.gmail.com>
     [not found]       ` <CAKwpGPw8ciD3kztwQ=5zgSspxbdwhwafHdsGa1Pyoj9zsQg-jw@mail.gmail.com>
     [not found]         ` <CAN9u=Hf+BmVMf+PrQp9moognbarvjcf0K6Ss2uba5UeFSBi7Og@mail.gmail.com>
     [not found]           ` <CAKwpGPyRazwJEjXwQgQj+j8gdn3WS-TuLmrBv8vAZQu5qWpPaA@mail.gmail.com>
     [not found]             ` <CAN9u=HcXtT3j+hwrhzFT-VfH8grZ50WHgDpTNahVaYuYC_OhuQ@mail.gmail.com>
     [not found]               ` <CAKwpGPyXf0LaUH3Mgwqq1duG0O6xUcEuzYRAfQiJmsqgicS+oQ@mail.gmail.com>
2023-05-26 14:21                 ` bug#63738: [PATCH glibc] Stop checking if MiG supports retcode Joshua Branson via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.