[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Debootstrap on GNU/Hurd Status



[CCing aj as debootstrap maintainer and/or release manager]

Hi,

during the last couple of days, I tried to get debootstrap going. I'm
happy to say that I've finally seen

I: Base system installed successfully.

but it's been a hacky way debootstrapping for a couple of dozen times.

I've started off from the patches James Morrison sent to #149345 a while
ago. Besides those patches, I did not touch anything else than the
sid-script[1]. As debootstrap is able to use an alternative script, I
believe this will make it easier to slowly get all the kinks out,
because we would not have to wait for uploads or NMU debootstrap.

Anyway, here is the log, I've put the complete one up at[2]

--8<--
I: Retrieving http://ftp.de.debian.org/debian/dists/sid/Release
I: Validating /local/chroot/unstable/unstable/var/lib/apt/lists/debootstrap.invalid_dists_sid_Release
I: Retrieving http://ftp.de.debian.org/debian/dists/sid/main/binary-hurd-i386/Packages.bz2
I: Validating /local/chroot/unstable/unstable/var/lib/apt/lists/debootstrap.invalid_dists_sid_main_binary-hurd-i386_Packages.bz2
I: Downloading packages...
--8<--

Here's the first difference already. Because quite some important
packages are only available as experimental packages on alpha.gnu.org, I
just made a list[3] with the urls and fed it to wget. This means I don't
validate the packages for the time being, but debootstrap is not able to
handle more than one mirror so I don't see another solution ATM.

@@ -88,9 +131,14 @@
       all_debs="$(without_package "$x" "$all_debs")"
     done

+    all_debs=""
 }

 install_debs () {
+    info "Downloading packages..."
+    mkdir -p $TARGET/var/cache/apt/archives
+    (cd $TARGET && wget -q -c -i ../urls)
+    mv $TARGET/*.deb $TARGET/var/cache/apt/archives
     extract $required

     mkdir -p "$TARGET/var/lib/dpkg"


all_debs="" makes debootstrap not download anything by itself. 

--8<--
I: Extracting /var/cache/apt/archives/base-files_3.0.8_hurd-i386.deb...
I: Extracting /var/cache/apt/archives/base-passwd_3.4.2_hurd-i386.deb...
I: Extracting /var/cache/apt/archives/bash_2.05b-5_hurd-i386.deb...
[...]
--8<--

At this point (after extracting), I've sometimes had the problem that
debootstrap hangs forever(?) apparently running sync. Probably a problem
with my Hurd installation.

--8<--
settrans -cg fd
chown root fd
chmod 666 fd
[...]
--8<--

This is James' setup_hurd_devices():

setup_hurd_devices () {
  if [ -e $TARGET/servers/socket/inet ]; then 
    return 0
  fi

  mkdir -p $TARGET/servers/socket
  /bin/settrans -c $TARGET/servers/socket/1 /hurd/pflocal
  /bin/settrans -c $TARGET/servers/socket/2 /hurd/pfinet
  /bin/settrans -ck $TARGET/servers/exec /hurd/exec
  /bin/settrans -c $TARGET/servers/crash-suspend /hurd/crash --suspend
  /bin/settrans -c $TARGET/servers/crash-kill /hurd/crash --kill
  /bin/settrans -c $TARGET/servers/password /hurd/password

  # Not functional yet:
  /bin/settrans -c $TARGET/servers/crash-dump-core /hurd/crash --dump-core
  if [ ! -e $TARGET/servers/crash ] ; then
    /bin/ln -s crash-suspend $TARGET/servers/crash
  fi
  if [ ! -e $TARGET/servers/socket/local ] ; then
    /bin/ln -s 1 $TARGET/servers/socket/local
  fi
  if [ ! -e $TARGET/servers/socket/inet ] ; then
    /bin/ln -s 2 $TARGET/servers/socket/inet
  fi

  # Setup crucial devices
  cd $TARGET/dev
  /bin/sh ./MAKEDEV -v fd std ptyp ptyq
}

For the final log I've redirect MAKEDEV's output to /dev/null. Anyway,
debootstrap normally just extracts devices.tar.gz, it would be nice if
there was something like this for us, too. But what about the
translators?

--8<--
I: Installing core packages...
dpkg - warning, overriding problem because --force enabled:
 package architecture (hurd-i386) does not match system (i686-gnu0.3)
Selecting previously deselected package base-files.
--8<--

Well, that's #187509. I had to turn on --force-architecture for all
dpkg-calls:

@@ -132,7 +180,7 @@
     }

     x_core_install () {
-       smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+       smallyes '' | in_target dpkg --force-depends --force-architecture --install $(debfor "$@")
     }

     x_feign_install dpkg

--8<--
Unpacking base-files (from .../base-files_3.0.8_hurd-i386.deb) ...

[snip some dependency problems which are normal for debootstrap at this point]

Unpacking base-passwd (from .../base-passwd_3.4.2_hurd-i386.deb) ...
[...]
Setting up base-passwd (3.4.2) ...
[...]
Setting up base-files (3.0.8) ...
[...]
Preparing to replace dpkg 1.10.9 (using .../dpkg_1.10.9_hurd-i386.deb) ...
Unpacking replacement dpkg ...
[...]
Setting up dpkg (1.10.9) ...
[...]
Unpacking libc0.3 (from .../libc0.3_2.3.1-5_hurd-i386.deb) ...
--8<--

Here we are. I had to do this:

@@ -175,6 +204,8 @@
         ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
     fi
 
+    for i in S 0 1 2 3 4 5 6; do mkdir -p $TARGET/etc/rc$i.d; done    
+

because glibc sets up update-rc-like stuff in /etc/rc?.d. The hurd
package provides update-rc, but apparently not these directories. Either
the hurd package should ship these directories, or some other package.

I'll file a bug against hurd for this issue soon if nobody objects.

Everything else seems to work fine

--8<--
I: Unpacking required packages...
[...]
I: Configuring required packages...
[...]
I: Installing base packages...
[...]
--8<--

 up to:

--8<--
Setting up man-db (2.4.1-6) ...
Building database of manual pages ...
sh: line 1: /usr/bin/gzip: No such file or directory
mandb: command '' failed with exit status 32512
mandb: warning: /usr/man/man1/rcp.1.gz: bad symlink or ROFF `.so' request
[...]
--8<--

Quite strange that one, I did not look into it yet as it's just a
warning and there are the info-manuals anyway :)

well, and that's it:

--8<--
sh: line 1: /usr/bin/gzip: No such file or directory
mandb: command '`=^/bin/gzip -dc /usr/share/man/man4/null.4.gz >
/tmp/zmanJolh5S' failed with exit status 32512
mandb: warning: /usr/share/man/man4/zero.4.gz: bad symlink or ROFF `.so'
request

Setting up at (3.1.8-11) ...
Starting deferred execution scheduler: atd
Warning: Fake start-stop-daemon called, doing nothing
.

I: Base system installed successfully.
--8<--

Now for the hard part. I had to take quite a lot of not-yet ported or
unneeded packages out of $required and $base in order to be able to run
debootstrap:

@@ -75,6 +75,50 @@
            required="$required libgcc1"
            required="$(without_package "libstdc++2.10-glibc2.2"
"$required")"
            ;;
+       hurd*)
+           required="$required libc0.3 hurd libncursesw5 adduser"
+#          required="$(without_package "bsdutils" "$required")"
+           required="$(without_package "login" "$required")"
+           required="$(without_package "libc6" "$required")"
+           required="$(without_package "libcap1" "$required")"
+           required="$(without_package "libnewt0" "$required")"
+#          required="$(without_package "libperl5.8" "$required")"
+            required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
+           required="$(without_package "makedev" "$required")"
+            required="$(without_package "modutils" "$required")"
+            required="$(without_package "mount" "$required")"
+            required="$(without_package "procps" "$required")"
+            required="$(without_package "sysvinit" "$required")"
+#          required="$(without_package "util-linux" "$required")"
+           required="$(without_package "whiptail" "$required")"
+           base="$base grub parted libparted1.6-0 inetutils zlib1g"
+            base="$(without_package "console-tools-libs" "$base")"
+            base="$(without_package "console-tools" "$base")"
+#          base="$(without_package "console-data" "$base")"
+            base="$(without_package "console-common" "$base")"
+            base="$(without_package "dhcp-client" "$base")"
+            base="$(without_package "fdutils" "$base")"
+            base="$(without_package "ifupdown" "$base")"
+           base="$(without_package "klogd" "$base")"
+#          base="$(without_package "libldap2" "$base")"
+#          base="$(without_package "liblockfile1" "$base")"
+#          base="$(without_package "libsasl7" "$base")"
+           base="$(without_package "netkit-inet" "$base")"
+           base="$(without_package "netkit-ping" "$base")"
+           base="$(without_package "netbase" "$base")"
+#          base="$(without_package "mailx" "$base")"
+           base="$(without_package "modconf" "$base")"
+            base="$(without_package "net-tools" "$base")"            
+            base="$(without_package "netkit-inetd" "$base")"
+#           base="$(without_package "nvi" "$base")"
+            base="$(without_package "ppp" "$base")"
+            base="$(without_package "pppconfig" "$base")"
+            base="$(without_package "pppoe" "$base")"
+            base="$(without_package "pppoeconf" "$base")"
+            base="$(without_package "sysklogd" "$base")"
+           LIBC="libc0.3"
+           IPFWTOOL=
+           ;;
         *)
             # who knows?
             ;;

the commented out entries are packages which are present on alpha.gnu.org,
except console-data, which James had exluded but is needed as a dependency for
something. I had to build a newer util-linux/bsdutils though, as base-config
has a versioned Depends: on it. I put those packages up at

http://people.debian.org/~mbanck/debs/unstable/hurd-i386/bsdutils_2.11z-1.1_hurd-i386.deb
http://people.debian.org/~mbanck/debs/unstable/hurd-i386/util-linux_2.11z-1.1_hurd-i386.deb

forward-porting the patches from #153410.


Could somebody with more in-depth knowledge than me go through the above
list and find out which packages we do not need and which package still
need porting?

Other points about the above list:

 - The adduser package had to be put explicitely into $required, because
   hurd's postinst would fail otherwise:

/var/lib/dpkg/info/hurd.postinst: line 29: adduser: command not found
dpkg: error processing hurd (--configure):
 subprocess post-installation script returned error exit status 127

   I'll file a bug about this, too.

 - Then, I've just noticed that there's libblkid1, on which latest
   e2fsprogs depend on now.  I've just exluded it from $required for the
   moment

 - Could we include dialog instead of whiptail as a debconf-frontend?

 - aj: Would it make sense to split $required into $required and
   $required_linux, for stuff like modutils, sysklogd?


Well, this is the TODO-list I guess:

 - fix the hurd packege WRT adduser and /etc/rc?.d
 - get those packages from alpha.gnu.org in the main archive
 - port/build missing packages
 - dpkg needs to be fixed (#187509)
 - devices/translators have to be setup in a nice way
 - anything else?

So, I hope there will be a bit of discussion and then I will mail an
updated patch to #149345. I've attached the diff of the sid script. The
full script can be found at [4].


Michael

-- 
[1] some older debootstrap debs are available at
http://people.debian.org/~mbanck/debs/debootstrap_0.1.17.19_hurd-i386.deb
[2] http://people.debian.org/~mbanck/hurd/debootstrap.log
[3] http://people.debian.org/~mbanck/hurd/urls
[4] http://people.debian.org/~mbanck/hurd/sid
--- /usr/lib/debootstrap/scripts/sid	2003-04-07 20:02:54.000000000 +0200
+++ sid.final	2003-04-11 12:52:11.000000000 +0200
@@ -75,6 +75,50 @@
 	    required="$required libgcc1"
 	    required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
 	    ;;
+	hurd*)
+	    required="$required libc0.3 hurd libncursesw5 adduser"
+#	    required="$(without_package "bsdutils" "$required")"
+	    required="$(without_package "login" "$required")"
+	    required="$(without_package "libblkid1" "$required")"
+	    required="$(without_package "libc6" "$required")"
+	    required="$(without_package "libcap1" "$required")"
+	    required="$(without_package "libnewt0" "$required")"
+#	    required="$(without_package "libperl5.8" "$required")"
+            required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
+	    required="$(without_package "makedev" "$required")"
+            required="$(without_package "modutils" "$required")"
+            required="$(without_package "mount" "$required")"
+            required="$(without_package "procps" "$required")"
+            required="$(without_package "sysvinit" "$required")"
+#	    required="$(without_package "util-linux" "$required")"
+	    required="$(without_package "whiptail" "$required")"
+	    base="$base grub parted libparted1.6-0 inetutils zlib1g"
+            base="$(without_package "console-tools-libs" "$base")"
+            base="$(without_package "console-tools" "$base")"
+#	    base="$(without_package "console-data" "$base")"
+            base="$(without_package "console-common" "$base")"
+            base="$(without_package "dhcp-client" "$base")"
+            base="$(without_package "fdutils" "$base")"
+            base="$(without_package "ifupdown" "$base")"
+	    base="$(without_package "klogd" "$base")"
+#	    base="$(without_package "libldap2" "$base")"
+#	    base="$(without_package "liblockfile1" "$base")"
+#	    base="$(without_package "libsasl7" "$base")"
+	    base="$(without_package "netkit-inet" "$base")"
+	    base="$(without_package "netkit-ping" "$base")"
+	    base="$(without_package "netbase" "$base")"
+#	    base="$(without_package "mailx" "$base")"
+	    base="$(without_package "modconf" "$base")"
+            base="$(without_package "net-tools" "$base")"            
+            base="$(without_package "netkit-inetd" "$base")"
+            base="$(without_package "ppp" "$base")"
+            base="$(without_package "pppconfig" "$base")"
+            base="$(without_package "pppoe" "$base")"
+            base="$(without_package "pppoeconf" "$base")"
+            base="$(without_package "sysklogd" "$base")"
+	    LIBC6="libc0.3"
+	    IPFWTOOL=
+	    ;;
         *)
             # who knows?
             ;;
@@ -88,9 +132,14 @@
       all_debs="$(without_package "$x" "$all_debs")"
     done
     
+    all_debs=""
 }
 
 install_debs () {
+    info "Downloading packages..."
+    mkdir -p $TARGET/var/cache/apt/archives
+    (cd $TARGET && wget -q -c -i ../urls)
+    mv $TARGET/*.deb $TARGET/var/cache/apt/archives
     extract $required
 
     mkdir -p "$TARGET/var/lib/dpkg"
@@ -132,7 +181,7 @@
     }
 
     x_core_install () {
-	smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
+	smallyes '' | in_target dpkg --force-depends --force-architecture --install $(debfor "$@")
     }
 
     x_feign_install dpkg
@@ -147,7 +196,7 @@
     info "Installing core packages..."
 
     p; progress $baseprog $bases #2
-    ln -s mawk $TARGET/usr/bin/awk
+    ln -sf mawk $TARGET/usr/bin/awk
     x_core_install base-files base-passwd
     p; progress $baseprog $bases #3
     x_core_install dpkg
@@ -156,6 +205,8 @@
         ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
     fi
 
+    for i in S 0 1 2 3 4 5 6; do mkdir -p $TARGET/etc/rc$i.d; done    
+
     p; progress $baseprog $bases #4
     x_core_install $LIBC6
 
@@ -170,7 +221,7 @@
     info "Unpacking required packages..."
 
     p; progress $baseprog $bases #8
-    smallyes '' | repeat 5 in_target_failmsg "Failure while unpacking required packages.  This will be attempted up to five times." dpkg --force-depends --unpack $(debfor $required)
+    smallyes '' | repeat 5 in_target_failmsg "Failure while unpacking required packages.  This will be attempted up to five times." dpkg --force-depends --force-architecture --unpack $(debfor $required)
     p 10; progress $baseprog $bases #18
 
     info "Configuring required packages..."
@@ -186,7 +237,7 @@
     on_exit "in_target_nofail umount /dev/pts"
 
     p; progress $baseprog $bases #19
-    smallyes '' | in_target_failmsg "Failure while configuring required packages." dpkg --configure --pending --force-configure-any --force-depends
+    smallyes '' | in_target_failmsg "Failure while configuring required packages." dpkg --configure --pending --force-configure-any --force-depends --force-architecture 
     p 10; progress $baseprog $bases #29 
 
     if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
@@ -195,14 +246,13 @@
     fi
 
     info "Installing base packages..."
-
     p; progress $baseprog $bases #30
-    smallyes '' | repeat 5 in_target_failmsg "Failure while installing base packages.  This will be re-attempted up to five times." dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
+    smallyes '' | repeat 5 in_target_failmsg "Failure while installing base packages.  This will be re-attempted up to five times." dpkg --force-auto-select --force-overwrite --force-confold --force-architecture --skip-same-version --unpack $(debfor $base)
 
     rm -f "$TARGET/usr/sbin/sendmail"
     ln -s /bin/true "$TARGET/usr/sbin/sendmail"
 
-    smallyes '' | repeat 5 in_target_failmsg "Failure while configuring base packages.  This will be attempted 5 times." dpkg  --force-confold --skip-same-version  --configure -a
+    smallyes '' | repeat 5 in_target_failmsg "Failure while configuring base packages.  This will be attempted 5 times." dpkg  --force-confold --force-architecture --skip-same-version  --configure -a
 
     rm -f "$TARGET/usr/sbin/sendmail"
     ln -s exim "$TARGET/usr/sbin/sendmail"

Reply to: