View previous topic :: View next topic |
Author |
Message |
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Mar 24, 2017 9:34 pm Post subject: |
|
|
Tony0945,
USE=static isn't set anywhere by default. It leads to update nightmares and bloated binaries, as all required libraries are built into the binaries.
Its a terrible idea to set it globally.
In its place, (like the initrd) and for a rescue shell, USE=static is useful. I have
Code: | [ebuild R ] sys-apps/busybox-1.26.2::gentoo USE="ipv6 static -debug -livecd -make-symlinks -math -mdev -pam -savedconfig (-selinux) -sep-usr -syslog -systemd" |
busybox goes into my initrd and init=/bin/busybox still works after --depclean has ripped out glibc.
That was a long time ago but you never forget fixing that.
Here, USE=static is only set on the packages that go into the initrd. It saves adding the dynamic linker and the libs. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Fri Mar 24, 2017 10:12 pm Post subject: |
|
|
NeddySeagoon,
I understand what the flag does and the danger of setting it globally. i just don't understand why portage is putting the flag on busybox because I don't have it in make.conf and I don't have it in package.use (probably should) and it isn't marked with a + in IUSE.
BTW, I don't use an intrd and have firmware in the kernel. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Mar 24, 2017 10:35 pm Post subject: |
|
|
Tony0945,
My setup is a hybrid. The kernel can boot alone, if it wasn't for the fact that root is on LVM inside a raid5.
The initrd contains mdadm, lvm and busybox, all build statically, oh, and an init script.
There are no kernel modules. Its like a piece of firmware, once it works, it never changes.
Like grub, there is no need to update it, since its not a potential attack surface unless the attacker has physical access.
Then I have a lot more to worry about than my PC. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
fcl Tux's lil' helper
Joined: 31 Dec 2016 Posts: 77
|
Posted: Fri Mar 24, 2017 10:40 pm Post subject: |
|
|
Tony0945, it's enabled by the linux profile
Code: | $ grep -r busybox /usr/portage/profiles/default/
/usr/portage/profiles/default/linux/packages:*sys-apps/busybox
/usr/portage/profiles/default/linux/package.use:# We want busybox statically linked by default as it is the system rescue shell.
/usr/portage/profiles/default/linux/package.use:sys-apps/busybox -pam static |
|
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Mar 25, 2017 12:03 am Post subject: |
|
|
Ah! I see. I forgot the profile sets flags too. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Mar 25, 2017 8:32 am Post subject: |
|
|
NeddySeagoon wrote: | USE=static isn't set anywhere by default. It leads to update nightmares and bloated binaries, as all required libraries are built into the binaries. Its a terrible idea to set it globally. |
Neddy ... the bloat comes from glibc, compare the following:
glibc: | % ls -lh /bin/busybox
-rwxr-xr-x 1 root root 1.8M 2016-12-15 14:01 /bin/busybox |
musl: | % ls -lh /bin/busybox
-rwxr-xr-x 1 root root 962K 2016-12-28 01:26 /bin/busybox |
uClibc: | % ls -lh /usr/src/initramfs/sourceroot/bin/busybox
-rwxr-xr-x 1 root root 801K 2017-03-25 05:47 /usr/src/initramfs/sourceroot/bin/busybox |
The first two (glibc and musl) are from sys-apps/busybox (with the same savedconfig), the third has a trimed config and so the smaller size can probably be attributed to that (when I get around to using musl for the initramfs I expect it will be smaller still than that linked against uClibc).
BTW, the buildroot (Aboriginal Linux) used to create the initramfs (so, with uClibc, gcc/toolchain, busybox) is 72M, and the initramfs (with cryptsetup, lvm, etc) is 2.2M (uncompressed).
best ... khay |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|