Re: Busybox in Debian
On Wed, Aug 23, 2017 at 2:43 AM, Ben Hutchingswrote: >> > > > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote: >> > > > > > > run-init >> > > > > >> > > > > This tool is doing this: >> > > > >> > > > [...] >> > > > > There is the "switch_root" tool in util-linux which does the >> > > > > crucial part of this functionality - deleting / remounting / >> > > > > chrooting. >> > > > > It is in bbox too. >> > > > >> > > > initramfs-tools used to use switch_root if possible, but it >> > > > didn't >> > > > support the -d (drop capabilities) option. Later on we needed >> > > > validation of the init filename to support symlinks (e.g. >> > > > /sbin/init -> >> > > > /lib/systemd/systemd), so I added and used the -n (dry run) >> > > > option to >> > > > run-init. busybox would need to support both of these. >> > > >> > > I added run-init to busybox just now, but I don't see -n option >> > > in >> > > klibc-2.0.4 source. Can you point me to the source code with -n? >> > >> > It's not upstream yet, but in a Debian patch: >> > https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-ini >> > t-add-dry-run-mode.patch/ >> >> Done: >> >> $ ./busybox run-init >> BusyBox v1.28.0.git (2017-08-21 18:55:09 CEST) multi-call binary. >> >> Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT >> NEW_INIT [ARGS] >> >> Free initramfs and switch to another root fs: >> chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, >> execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. >> >> -c DEVReopen stdio to DEV after switch >> -d CAPS Drop capabilities >> -nDry run > > Great. Once these changes are in the Debian package, I can update > initramfs-tools to make klibc-utils optional. busybox 1.28.0 is released, it contains the addition of run-init. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Wed, 2017-08-23 at 14:36 +0200, Denys Vlasenko wrote: [...] > I take you also will need ipconfig, as it seems to be the tool developed > to handle IP autoconfiguration thingy: > ip=:: > I'm looking at it right now. > Can you point me to scripts / other places where it is used in Debian? So far as I can see, there are no other places it is used. klibc-utils has the only implementation, and the only other package using klibc- utils is debirf - which doesn't use ipconfig. Ben. -- Ben Hutchings One of the nice things about standards is that there are so many of them. signature.asc Description: This is a digitally signed message part ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Wed, Aug 23, 2017 at 2:43 AM, Ben Hutchings <b...@decadent.org.uk> wrote: > On Tue, 2017-08-22 at 10:38 +0200, Denys Vlasenko wrote: >> > > I added run-init to busybox just now, but I don't see -n option >> > > in >> > > klibc-2.0.4 source. Can you point me to the source code with -n? >> > >> > It's not upstream yet, but in a Debian patch: >> > https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-ini >> > t-add-dry-run-mode.patch/ >> >> Done: >> >> $ ./busybox run-init >> BusyBox v1.28.0.git (2017-08-21 18:55:09 CEST) multi-call binary. >> >> Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT >> NEW_INIT [ARGS] >> >> Free initramfs and switch to another root fs: >> chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, >> execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. >> >> -c DEVReopen stdio to DEV after switch >> -d CAPS Drop capabilities >> -nDry run > > Great. Once these changes are in the Debian package, I can update > initramfs-tools to make klibc-utils optional. I take you also will need ipconfig, as it seems to be the tool developed to handle IP autoconfiguration thingy: ip=:: I'm looking at it right now. Can you point me to scripts / other places where it is used in Debian? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Tue, 2017-08-22 at 10:38 +0200, Denys Vlasenko wrote: > On Mon, Aug 21, 2017 at 8:38 PM, Ben Hutchings> wrote: > > On Mon, 2017-08-21 at 19:40 +0200, Denys Vlasenko wrote: > > > > On Mon, Aug 14, 2017 at 5:12 PM, Ben Hutchings > > > g.uk> wrote: > > > > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote: > > > > > > > run-init > > > > > > > > > > This tool is doing this: > > > > > > > > [...] > > > > > There is the "switch_root" tool in util-linux which does the > > > > > crucial part of this functionality - deleting / remounting / > > > > > chrooting. > > > > > It is in bbox too. > > > > > > > > initramfs-tools used to use switch_root if possible, but it > > > > didn't > > > > support the -d (drop capabilities) option. Later on we needed > > > > validation of the init filename to support symlinks (e.g. > > > > /sbin/init -> > > > > /lib/systemd/systemd), so I added and used the -n (dry run) > > > > option to > > > > run-init. busybox would need to support both of these. > > > > > > I added run-init to busybox just now, but I don't see -n option > > > in > > > klibc-2.0.4 source. Can you point me to the source code with -n? > > > > It's not upstream yet, but in a Debian patch: > > https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-ini > > t-add-dry-run-mode.patch/ > > Done: > > $ ./busybox run-init > BusyBox v1.28.0.git (2017-08-21 18:55:09 CEST) multi-call binary. > > Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT > NEW_INIT [ARGS] > > Free initramfs and switch to another root fs: > chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, > execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. > > -c DEVReopen stdio to DEV after switch > -d CAPS Drop capabilities > -nDry run Great. Once these changes are in the Debian package, I can update initramfs-tools to make klibc-utils optional. Ben. -- Ben Hutchings Make three consecutive correct guesses and you will be considered an expert. signature.asc Description: This is a digitally signed message part ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Mon, Aug 21, 2017 at 8:38 PM, Ben Hutchingswrote: > On Mon, 2017-08-21 at 19:40 +0200, Denys Vlasenko wrote: >> > On Mon, Aug 14, 2017 at 5:12 PM, Ben Hutchings >> > wrote: >> > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote: >> > > > > run-init >> > > >> > > This tool is doing this: >> > >> > [...] >> > > There is the "switch_root" tool in util-linux which does the >> > > crucial part of this functionality - deleting / remounting / chrooting. >> > > It is in bbox too. >> > >> > initramfs-tools used to use switch_root if possible, but it didn't >> > support the -d (drop capabilities) option. Later on we needed >> > validation of the init filename to support symlinks (e.g. /sbin/init -> >> > /lib/systemd/systemd), so I added and used the -n (dry run) option to >> > run-init. busybox would need to support both of these. >> >> I added run-init to busybox just now, but I don't see -n option in >> klibc-2.0.4 source. Can you point me to the source code with -n? > > It's not upstream yet, but in a Debian patch: > https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-init-add-dry-run-mode.patch/ Done: $ ./busybox run-init BusyBox v1.28.0.git (2017-08-21 18:55:09 CEST) multi-call binary. Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS] Free initramfs and switch to another root fs: chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. -c DEVReopen stdio to DEV after switch -d CAPS Drop capabilities -nDry run ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Mon, 2017-08-21 at 19:40 +0200, Denys Vlasenko wrote: > > On Mon, Aug 14, 2017 at 5:12 PM, Ben Hutchingswrote: > > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote: > > > > > run-init > > > > > > This tool is doing this: > > > > [...] > > > There is the "switch_root" tool in util-linux which does the > > > crucial part of this functionality - deleting / remounting / chrooting. > > > It is in bbox too. > > > > initramfs-tools used to use switch_root if possible, but it didn't > > support the -d (drop capabilities) option. Later on we needed > > validation of the init filename to support symlinks (e.g. /sbin/init -> > > /lib/systemd/systemd), so I added and used the -n (dry run) option to > > run-init. busybox would need to support both of these. > > I added run-init to busybox just now, but I don't see -n option in > klibc-2.0.4 source. Can you point me to the source code with -n? It's not upstream yet, but in a Debian patch: https://sources.debian.net/src/klibc/2.0.4-9/debian/patches/run-init-add-dry-run-mode.patch/ Ben. -- Ben Hutchings Make three consecutive correct guesses and you will be considered an expert. signature.asc Description: This is a digitally signed message part ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Mon, Aug 14, 2017 at 5:12 PM, Ben Hutchingswrote: > On Mon, 2017-08-14 at 16:42 +0200, Denys Vlasenko wrote: >> > > run-init >> >> This tool is doing this: > [...] >> There is the "switch_root" tool in util-linux which does the >> crucial part of this functionality - deleting / remounting / chrooting. >> It is in bbox too. > > initramfs-tools used to use switch_root if possible, but it didn't > support the -d (drop capabilities) option. Later on we needed > validation of the init filename to support symlinks (e.g. /sbin/init -> > /lib/systemd/systemd), so I added and used the -n (dry run) option to > run-init. busybox would need to support both of these. I added run-init to busybox just now, but I don't see -n option in klibc-2.0.4 source. Can you point me to the source code with -n? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Mon, Aug 14, 2017 at 5:12 PM, Ben Hutchingswrote: >> If you want "resume" and "ipconfig" in bbox, I can do that. > > Go for it. Added resume, nuke, minips so far. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
Am 14.08.2017 um 16:42 schrieb Denys Vlasenko: If you want "resume" and "ipconfig" in bbox, I can do that. The weird thing with Debian is that any package can add scripts to the initramfs and call an initramfs update after installation. This perfectly makes sense for tools that manage RAIDs or special filesystems. Thus I guess properly updating busybox in Debian and testing it with a "normal" hard drive installed system and the installer won't be such a big deal. But afterwards packages have to be identified that rely on certain commands in the initramfs and those have to be checked or adjusted as well. Regards, Mattias -- Mattias Schlenker - Freier IT-Fachredakteur und -autor redakt...@mattiasschlenker.de Mattias Schlenker - IT-Consulting, Softwareentwicklung consult...@mattiasschlenker.de August-Bebel-Str. 74 - D-04275 LEIPZIG - GERMANY Phone: +49 341 39290767 - Fax: +49 341 25365955 Mobile (primary): +49 163 6953657 Mobile (secondary): +49 163 1848610 VATIN DE240998538 https://github.com/mschlenker http://www.mattiasschlenker.de/ http://www.arduino-hausautomation.de/ ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
>> ipconfig Looks like it is used to run DHCP / BOOTP / RARP on several interfaces, including a possibility to run it on _all_ existing interfaces (excluding loopback and point-to-point). I see how this can be useful during boot. >> minips It's just mini-ps. Proliferation of reinvented tools with slightly different names. >> nuke This is "rm -rf -- FILE". Should not be necessary. >> resume Writes "maj:min:offset" to /sys/power/resume. Looks like this is support for resume from disk? >> run-init This tool is doing this: Usage: exec run-init [-d caps] [-c consoledev] /real-root /sbin/init [args] /* * run_init(realroot, consoledev, drop_caps, init, initargs) * * This function should be called as the last thing in kinit, * from initramfs, it does the following: * * - Delete all files in the initramfs; * - Remounts /real-root onto the root filesystem; * - Chroots; * - Drops comma-separated list of capabilities; * - Opens /dev/console; * - Spawns the specified init program (with arguments.) * * On failure, returns a human-readable error message. */ There is the "switch_root" tool in util-linux which does the crucial part of this functionality - deleting / remounting / chrooting. It is in bbox too. If you want "resume" and "ipconfig" in bbox, I can do that. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Mon, Aug 14, 2017 at 3:05 PM, Ben Hutchingswrote: > On Mon, 2017-08-14 at 14:55 +0200, Denys Vlasenko wrote: >> On Sat, Aug 12, 2017 at 4:15 PM, Ben Hutchings >> wrote: >> > On Fri, 2017-08-11 at 14:54 -0400, Chris Boot wrote: >> > [...] >> > > - The default initramfs assembly system, initramfs-tools, incorporates >> > > busybox into the initramfs and it's used until the root filesystem (and >> > > /usr if separate) is mounted and can be pivot_rooted into. We also use >> > > parts of klibc in the initramfs, and I'm not yet entirely clear what >> > > tools in the initramfs are klibc tools, busybox applets or executables >> > > copied from the running system. >> > >> > [...] >> > >> > If initramfs-tools is configured to use busybox, busybox installs all >> > its commands and then klibc-utils installs any commands that are not >> > already there. So for any command that they both implement, the >> > busybox implementation is used. >> >> Do you have a list of tools klibc-utils installs? > > If busybox is used, then klibc-utils provides these: > > chroot > losetup > pivot_root There are such applets in busybox too. If they are buggy or incompatible (e.g. a missing option), please let me know. > halt > poweroff > reboot These applets are in busybox too, but they may do bbox-specific actions depending on configuration. If FEATURE_CALL_TELINIT=y, they run "telinit N", expecting it to know how to signal init. Otherwise they assume the bbox init is on the system, and they simply signal it: SIGUSR1 = halt, SIGUSR2 = poweroff, SIGTERM = reboot. /* talk to init */ if (!ENABLE_FEATURE_CALL_TELINIT) { /* bbox init assumed */ rc = kill(1, signals[which]); } else { /* SysV style init assumed */ /* runlevels: * 0 == shutdown * 6 == reboot */ execlp(CONFIG_TELINIT_PATH, CONFIG_TELINIT_PATH, which == 2 ? "6" : "0", (char *)NULL ); bb_perror_msg_and_die("can't execute '%s'", CONFIG_TELINIT_PATH); } > fstype What does this do? > nfsmount And this one? If ordinary mount can't mount NFS for some reason, it's interesting to look into that reason. Sometime ago, kernel grew the ability to mount NFS without funky binary API in mount syscall, so it's even easier now - mount tool only has to resolve DNS name to an IP address. If you are going to play with it, not that you probaly do _not_ need FEATURE_MOUNT_NFS=y: it is "Support mounting NFS file systems on Linux < 2.6.23" option, not "You need this, or else NFS mounts will not work". > ipconfig > minips > nuke > resume > run-init These look like klibc-utils inventions? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
Am 14.08.2017 um 14:55 schrieb Denys Vlasenko: On Sat, Aug 12, 2017 at 4:15 PM, Ben Hutchingswrote: On Fri, 2017-08-11 at 14:54 -0400, Chris Boot wrote: [...] - The default initramfs assembly system, initramfs-tools, incorporates busybox into the initramfs and it's used until the root filesystem (and /usr if separate) is mounted and can be pivot_rooted into. We also use parts of klibc in the initramfs, and I'm not yet entirely clear what tools in the initramfs are klibc tools, busybox applets or executables copied from the running system. [...] If initramfs-tools is configured to use busybox, busybox installs all its commands and then klibc-utils installs any commands that are not already there. So for any command that they both implement, the busybox implementation is used. Do you have a list of tools klibc-utils installs? https://packages.debian.org/sid/i386/klibc-utils/filelis Regards, Mattias -- Mattias Schlenker - Freier IT-Fachredakteur und -autor redakt...@mattiasschlenker.de Mattias Schlenker - IT-Consulting, Softwareentwicklung consult...@mattiasschlenker.de August-Bebel-Str. 74 - D-04275 LEIPZIG - GERMANY Phone: +49 341 39290767 - Fax: +49 341 25365955 Mobile (primary): +49 163 6953657 Mobile (secondary): +49 163 1848610 VATIN DE240998538 https://github.com/mschlenker http://www.mattiasschlenker.de/ http://www.arduino-hausautomation.de/ ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Sat, Aug 12, 2017 at 4:15 PM, Ben Hutchingswrote: > On Fri, 2017-08-11 at 14:54 -0400, Chris Boot wrote: > [...] >> - The default initramfs assembly system, initramfs-tools, incorporates >> busybox into the initramfs and it's used until the root filesystem (and >> /usr if separate) is mounted and can be pivot_rooted into. We also use >> parts of klibc in the initramfs, and I'm not yet entirely clear what >> tools in the initramfs are klibc tools, busybox applets or executables >> copied from the running system. > [...] > > If initramfs-tools is configured to use busybox, busybox installs all > its commands and then klibc-utils installs any commands that are not > already there. So for any command that they both implement, the > busybox implementation is used. Do you have a list of tools klibc-utils installs? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On 11/08/17 14:13, Denys Vlasenko wrote: >> In the mean time, please let us know if you have any questions. > What is Debian using bbox for? Hi Denys, It's used principally in two places: - It's bundled in the Debian Installer ramdisk and used as the shell, bootstrap for D-I and its applets provide most functionality in the installer environment. - The default initramfs assembly system, initramfs-tools, incorporates busybox into the initramfs and it's used until the root filesystem (and /usr if separate) is mounted and can be pivot_rooted into. We also use parts of klibc in the initramfs, and I'm not yet entirely clear what tools in the initramfs are klibc tools, busybox applets or executables copied from the running system. There is also a statically linked package that may be useful for rescuing a damaged system, but its use doesn't appear to be widespread. As you can see it's actually a critical piece of the puzzle in Debian, so we're keen to make sure someone is actively taking care of it now rather than the Debian Installer and/or kernel teams chipping in now and again to fix the worst of the bugs. Cheers, Chris -- Chris Boot bo...@debian.org GPG: 8467 53CB 1921 3142 C56D C918 F5C8 3C05 D9CE ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: Busybox in Debian
On Fri, Aug 11, 2017 at 7:01 PM, Chris Boot <bo...@debian.org> wrote: > Hi all, > > This is a short note to say that Christoph (CCed) and I are taking over > packaging of Busybox in Debian. I'm hoping that we will both be fairly > active in here (the busybox mailing list) from now on. > > We've got a lot of work to do to update Busybox in Debian to a more > modern version, triage bugs, tidy things up and basically make the > Debian package look alive again. Great to hear. > In the mean time, please let us know if you have any questions. What is Debian using bbox for? ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Busybox in Debian
Hi all, This is a short note to say that Christoph (CCed) and I are taking over packaging of Busybox in Debian. I'm hoping that we will both be fairly active in here (the busybox mailing list) from now on. We've got a lot of work to do to update Busybox in Debian to a more modern version, triage bugs, tidy things up and basically make the Debian package look alive again. Please bear with us, this won't be a quick process. In the mean time, please let us know if you have any questions. Cheers, Chris -- Chris Boot bo...@debian.org GPG: 8467 53CB 1921 3142 C56D C918 F5C8 3C05 D9CE signature.asc Description: OpenPGP digital signature ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Help installing libc and busybox as debian packages...
Hello All, I'm wanting to install libc and busybox as Debian packages onto my embedded target system as sort of a bootstrap installation process. My target system thankfully has a IDE DOM drive which can be removed and attached to my separate development system and mounted there as a non-root filesystem for installation purposes. Could anyone please guide me on how to install these packages onto my DOM drive filesystem? I am assuming that I can use the 'dpkg -i' command on my development system to do this, but not sure how to install it on my DOM drive only and not have it listed with all the other packages on my development system. Maybe there is a better way? Thanks in advance, Dallas Clement ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox
Re: Help installing libc and busybox as debian packages...
On Tuesday 12 June 2007 15:12, Dallas Clement wrote: I'm wanting to install libc and busybox as Debian packages onto my embedded target system as sort of a bootstrap installation process. My target system thankfully has a IDE DOM drive which can be removed and attached to my separate development system and mounted there as a non-root filesystem for installation purposes. Could anyone please guide me on how to install these packages onto my DOM drive filesystem? I am assuming that I can use the 'dpkg -i' command on my development system to do this, but not sure how to install it on my DOM drive only and not have it listed with all the other packages on my development system. Maybe there is a better way? I use shell scripts which basically use cp and ln. -- vda ___ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox