注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "User:Pnoecker/Undead USB Install"

From Funtoo
Jump to navigation Jump to search
m (remove X mixin, not necessary)
(→‎change ps1: tzselect universal time setting)
 
(92 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==A linux nomadbsd alternative==
==[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KTQK6J5LMWZZ8&currency_code=USD Buy Paul, the author of this document, a coffee.]==
{{tip|uefi is in progress, see [[Talk:Undead_USB_Install]]}}
==[https://www.funtoo.org/Support_Funtoo Donate to funtoo, buy Daniel Robbins a coffee.]==
This is an install strategy to target a USB flash stick as / instead of a traditional hard drive or internal solid state drive.  this isn't a live cd, this is a persistent root funtoo install that changes will keep living on.
==Undead USB, a linux nomadbsd alternative==
This is an install strategy to target a USB flash stick as / (root) instead of a traditional hard drive or internal solid state drive.  This isn't a live cd, this is a persistent root funtoo install where changes will keep living on.  Since were treating a USB stick as a root partition, it requires much more space than a live usb like area31.  32gb minimum for gnome, 16gb are ok for xfce, lxde, lxqt, & server only type builds.  get a [https://amzn.to/3m1hJoW fast usb3 drive] even if you don't have usb3 ports as the flash memory on them is much faster than the flash memory on usb2 keys which will improve usability.  This is a speed run of the official install x86_64 no swap & add JFS but does not intend to replace the official install.  this is to make a more flexible, and robust install boot media than area31.  undead usb can be used to build undead usb also.  If you're reading this from linux, and have a blank 32gb USB drive you can mount up, and start building funtoo immediately.  This guide has traditional hard drive aliasing, however it is targeted at building USB install media, and USB development sandbox installs.  The user experience is like virtualization running on bare metal. If you run into a problem you can easily unplug permanent hard drives, and let a funtoo developer vpn into your fresh build to debug hardware directly.


In this run i will use a 64gb 100 mb/s sandisk, 32gb minimum for gnome, 16gb are ok for xfce lxde lxqt type builds. get a fast usb3 drive even if you dont have usb3 ports as the flash memory on them is much faster than the flash memory on usb2 keys which will improve usability.
*grab root:
{{console|body=
$##i## sudo su
or
$##i## su
}}
 
*identify the drive for installing:
{{console|body=
###i## lsblk -o name,size,label,partlabel
}}
*insert the usb drive, and run the above command again.
 
===the first rule of funtoo is funtoo rules===
set udev rules to make the drive you're installing to accessible at /dev/funtoo and partitions accessible at /dev/funtoo1 /dev/funtoo2 so on.
 
*ide drive 3 example:
{{console|body=
###i## echo 'KERNEL=="hdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
}}
 
*sata drive 2 example:
{{console|body=
###i## echo 'KERNEL=="sdc*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
}}
 
*nvme nvme drive 1 example:
{{console|body=
###i## echo 'KERNEL=="nvme1n1", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
###i## echo 'KERNEL=="nvme1n1p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
}}
 
*mmc drive 0 example:
{{console|body=
###i## echo 'KERNEL=="mmcblk0", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
###i## echo 'KERNEL=="mmcblk0p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
}}
 
*activate rules:
*display what /dev/funtoo is tied to:
{{console|body=
###i## udevadm control --reload-rules && udevadm trigger
###i## ls -al /dev/funtoo*
}}
 
==Partition==
{{console|body=
###i## cgdisk /dev/funtoo}}
{{note|if cgdisk doesn't work load gdisk or fdisk to wipe out bad gpt tables, and then run cfdisk or cgdisk again.}}
 
delete everything.
 
{{console|body=
Command: ##i## new ↵
First sector: ##i##↵
Last sector: ##i##+2M ↵
Hex Code: ##i##EF02 ↵
Enter name: ##i##BIOS Boot ↵
}}
 
scroll down to large chunk of free space:
{{console|body=
Command: ##i##new ↵
First sector: ##i##↵
Last sector: ##i##+128M ↵
Hex Code: ##i##EF00 ↵
Enter name: ##i##BOOT ↵
}}
 
scroll down to large chunk of free space:
{{console|body=
Command: ##i##new ↵
First sector: ##i##↵
Last sector: ##i##↵
Hex Code: ##i## 8300 ↵
Enter name: ##i##FUNTOO ↵
}}
 
{{console|body=
 
                              Disk Drive: /dev/funtoo
                            Size: 62333952, 29.7 GiB
 
Part. #    Size        Partition Type            Partition Name
----------------------------------------------------------------
            1007.0 KiB  free space
  1        1024.0 KiB  BIOS boot partition   BIOS Boot
  2        256.0 MiB  EFI System                BOOT
  3        29.5 GiB    Linux x86-64 root (/)    FUNTOO
}}
 
{{console|body=
Command: ##i##write ↵
Command: ##i##quit ↵
}}


{{tip|this section is for mbr partitioning with gparted, use uefi with bios boot partition for legacy support}}
{{console|body=
I'm using gparted on xubuntu (any running linux system with gparted should be able to follow this guide) to delete the flash key fat32 partition and create a single jfs / partition labeled as root, and mount it to /mnt/funtoo.  We're using JFS because we want as much raw speed, and power from the install possible.
###i## mkfs.vfat -F 32 /dev/funtoo2
###i## fatlabel /dev/funtoo2 "BOOT"
}}


we want our USB to be targeting generic hardware so we can have our root funtoo compatible with most modern hardware.  prefer nouveau drivers over nvidia because KMS loads intel and possibly other video card systems.
{{console|body=
###i## mkfs.jfs /dev/funtoo3
###i## jfs_tune -L "FUNTOO" /dev/funtoo3
}}


you can also pull your [[Subarches]] gnome tarball if you're installing to specific hardware.
==Mount==
{{console|body=
###i## mount /dev/funtoo3 /mnt/funtoo
###i## mkdir /mnt/funtoo/boot
###i## mount /dev/funtoo2 /mnt/funtoo/boot
}}
*if  you're doing a permanent install mount any additional drives to /mnt/funtoo/var or /mnt/funtoo/home now.
 
==Get Funtoo==
You can pull your [[Subarches]] gnome tarball if you're installing to specific hardware, not moving the disk between systems, or installing to a SSD/nvme.  Use generic 64 so your USB os can roam on strange hardware.


{{console|body=
{{console|body=
###i## cd /mnt/funtoo
###i## cd /mnt/funtoo
###i## wget https://build.funtoo.org/1.4-release-std/x86-64bit/generic_64/gnome-latest.tar.xz
###i## wget https://build.funtoo.org/1.4-release-std/x86-64bit/generic_64/gnome-latest.tar.xz
###i## tar --numeric-owner -xpf *gnome* && rm -f *gnome*
}}
}}
*or for next
{{console|body=
{{console|body=
###i## mount -t tmpfs tmpfs /run
###i## wget https://build.funtoo.org/next/x86-64bit/generic_64/stage3-latest.tar.xz
###i## tar --numeric-owner --xattrs --xattrs-include='*' -xpf *latest* && mv *latest* /mnt/funtoo/mnt && mkdir /mnt/funtoo/mnt/funtoo
}}
}}
===Load Funtoo===
*mount up:
{{console|body=
{{console|body=
###i## mount -t proc none proc
###i## cd /mnt/funtoo && mount -t proc none proc
###i## mount --rbind /sys sys
mount --rbind /sys sys
###i## mount --rbind /dev dev
mount --rbind /dev dev
###i## mount --rbind /run run
}}
}}


were using googles name server simply because its universal, and anyone can access it anywhere. 
===chroot===
*chroot in:
{{console|body=
###i## env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l
}}


===change ps1===
Mark that you're chrooted.
{{console|body=
{{console|body=
###i## cd /mnt/funtoo && env -i HOME=/root TERM=$TERM chroot . bash -l
###i## export PS1="undead $PS1"
###i## echo "nameserver 8.8.8.8" > /etc/resolv.conf && passwd
}}
###i## mv /etc/fstab /etc/fstab.backup}}


If you're using gpt partitioning run this block:
*you can auto login local terminals as root by doing this:
{{console|body=
{{console|body=
###i## echo "LABEL=BOOT /boot vfat noauto,noatime 0 0" >> /etc/fstab
###i## sed -i 's/agetty/agetty -J -a root/' /etc/inittab
}}
}}


were disabling swap because we didn't partition for it, and switching the compile directory to ram instead of on disk.  im compiling on 16gb of ram but 8 should be sufficient, possibly even 4gb or less if you avoid large packages.  Were setting the host name, and merging a handful of packages.
*Add fake root user, set the password, name, dns, tz, and clock:


{{console|body=
{{console|body=
###i## echo 'PORTAGE_TMPDIR="/run"' > /etc/portage/make.conf && rc-update del swap boot
###i## useradd -o -g 0 -u 0 funtoo
###i## passwd funtoo
###i## echo 'hostname="undead"' > /etc/conf.d/hostname
###i## echo "nameserver 1.1.1.1" > /etc/resolv.conf
###i## ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime
###i## rc-service busybox-ntpd restart
}}
}}
*Deploy your fstab:
{{console|body=
{{console|body=
###i## echo "LABEL=FUNTOO / jfs noatime 0 1" >> /etc/fstab
###i## cat > /etc/fstab << "EOF"
###i## echo "tmpfs /run tmpfs rw,nodev,nosuid 0 0" >> /etc/fstab
LABEL=BOOT /boot vfat noauto,noatime 1 2
###i## echo 'hostname="undead"' > /etc/conf.d/hostname
LABEL=FUNTOO / jfs noatime 0 1
###i## ego sync && emerge jfsutils grub haveged linux-firmware media-fonts/noto firefox-bin}}
tmpfs /var/tmp/portage tmpfs uid=portage,gid=portage,mode=775,noatime 0 0
EOF
}}


use old school mbr method of installing grub.
*compile in ram:
{{console|body=
{{console|body=
###i## grub-install --target=i386-pc --no-floppy /dev/sdc
###i## mkdir /var/tmp/portage
###i## ego boot update && rc-update add haveged}}
###i## chown portage:portage /var/tmp/portage
 
###i## mount /var/tmp/portage
final install size is around 14,500MB gnome can fit in a 16gb usb stick, but it's a tight squeeze and unix file systems degrade in performance at around 80%-90% full.  32gb keys are good, 64gb are excellent, 128gb keys can emerge the world.
}}
 
rebuild the kernel video drivers modules.


===merge===
*merge stuff:
{{console|body=
{{console|body=
###i## emerge -1 x11-drivers/nvidia-kernel-modules}}
###i## cat > /etc/portage/package.use << "EOF"
sys-kernel/linux-firmware initramfs
app-emulation/qemu static-user qemu_user_targets_aarch64 qemu_user_targets_riscv64 qemu_user_targets_arm
dev-libs/glib static-libs
dev-libs/libpcre static-libs
sys-apps/attr static-libs
EOF
###i## ego sync && emerge sys-boot/shim jfsutils grub haveged intel-microcode linux-firmware fchroot eix discord-bin firefox-bin media-fonts/noto etcher-bin logmein-hamachi fortune-mod cowsay}}


==DONE!==
you can also install [[Package:Brave]] or other browsers.


When you boot into your new system use nmtui to setup networking:
*funtoo's official chat:
{{console|body=###i## nmtui}}
https://discord.gg/BNUSpUU


to not run nvidia:
*Set your startup services:
{{console|body=
{{console|body=
###i## ego profile mix-in gfxcard-nouveau
###i## rc-update del swap boot && rc-update add haveged && rc-update add busybox-ntpd && rc-update add logmein-hamachi && rc-update add gpm
###i## ego profile mix-in -gfxcard-nvidia}}
}}


remove nomodeset from /etc/boot.conf and change timeout to 0
=== /etc/boot.conf ===
*Deploy your boot.conf:
{{console|body=
{{console|body=
###i## nano /etc/boot.conf}}
###i## cat > /etc/boot.conf << "EOF"
boot {
generate grub
default "Funtoo Linux"
timeout 0
}
"Funtoo Linux" {
kernel kernel[-v]
initrd initramfs[-v]
params += real_root=auto rootfstype=auto scandelay=10
params += quiet gfxpayload=auto loglevel=1 splash=silent
}
EOF
}}
 
=== GRUB ===
*Install grub:


{{console|body=
###i## mount -o remount,rw /sys/firmware/efi/efivars
###i## grub-install --target=i386-pc /dev/funtoo
###i## grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="BOOT" --recheck  --no-nvram /dev/funtoo
###i## cp /usr/share/shim/* /boot/EFI/BOOT/
###i## ego boot update
}}


If you're having problems with nouveau not playing sound over HDMI emerge pavucontrol:
final install size is around 15,000MB without noto.  gnome can fit in a 16gb usb stick, but it's a very tight squeeze and unix file systems degrade in performance at around 80%-90% full.  32gb keys are good, 64gb are excellent, 128gb keys can emerge the world.  We suggest several 32gb drives over few larger drives.


=== video ===
*rebuild the kernel video drivers, or switch to nouveau to make your usb more universal.
{{console|body=
{{console|body=
###i## emerge pavucontrol}}
###i## emerge -1 x11-drivers/nvidia-kernel-modules
}}


to fix the clock to eastern standard time:
*To run nouveau instead of nvidia:
{{console|body=
{{console|body=
###i## rm /etc/localtime
###i## cd /etc/modprobe.d && mkdir .backup
###i## ln -s /usr/share/zoneinfo/America/Detroit /etc/localtime}}
###i## mv /etc/modprobe.d/n* .backup
###i## ego profile mix-in gfxcard-nouveau
###i## ego profile mix-in -gfxcard-nvidia
}}


===Profile Update===
*Set your profile before emerging world:
[[Funtoo_Profiles]]


The magic words to update:
*The magic words to update everything:
{{console|body=
{{console|body=
###i## emerge -avuND @world  
###i## emerge -avuND @world  
###i## emerge -av --depclean
###i## emerge -av --depclean
###i## ego boot update}}
###i## ego boot update}}


every so often you will want to purge sources to keep the stick as low memory usage as possible
every so often you will want to purge sources to keep the stick as low memory usage as possible
Line 103: Line 269:
}}
}}


==Xfce4==
==DONE!==
to install from a minimal tarball and build up xfce4 the merge commands are
*If you would like to take this further to compress into a live cd see:  [[Undead_USB_Install/undead2live]]
 
*If you used a generic stage3 now would be a good time to merge in a DE: [[Install/Stage3_Desktop]]
 
===clean dismount===
{{console|body=
{{console|body=
###i## ego profile flavor desktop
###i## exit
###i## ego profile mix-in xfce
###i## cd .. && sync
###i## emerge alsa-utils xfce4-meta xorg-x11 networkmanager
###i## umount -lR funtoo
###i## eject /dev/funtoo
###i## udisksctl power-off -b /dev/funtoo
}}
}}


==gparted==
===uefi secure boot===
you can emerge gparted, and use funtoo undead usb instructions to install funtoo on another usb, or deploy to an actual hard drive.
*press the f1 f2 f8 f9 f10 esc or delete to load bios.
*set bios to load uefi usb devices first, disable secure boot, and enable legacy mode.  save settings and exit.
*press the f1 f2 f8 f9 f10 esc or delete to load your boot selection menu.
*load EFI from file, point to /boot/EFI/BOOT/BOOTX64.EFI
*shim will greet you with access violation warnings.
*fiddle around to get mok manager to load up.
*select add key
*point to /boot/EFI/BOOT/grubx86.efi
*press the f1 f2 f8 f9 f10 esc or delete key to load your boot selection menu.
*load EFI from file, and again point to /boot/EFI/BOOT/BOOTX64.EFI which will now load funtoo under secure boot.
 
==further securing==
i use [[Package:Sudo]], and disable root login.
 
i use [[Package:Dnsmasq]] to block advertising, and cache DNS traffic to accelerate web browsing.


{{console|body=
i use [[Package:Dnscrypt]] to encrypt all dns requests so the vast majority of the web traffic from my undead usb is encrypted.
###i## emerge gparted}}
 
==Admining==


==further securing==
use [[Package:Eix]] to browse portage to see packages you can emerge.
i use a sudo user, disable root login, & have a 1tb home partition for my home theater massive media storage.
[[Package:Sudo]]


i use dnsmasq to block advertising, and cache dns traffic to accelerate web browsing.
use [[Package:Eselect]] to set various system options.
[[Package:Dnsmasq]]


i use dnscrypt proxy to encrypt all dns requests so 100% of the web traffic from my undead stick is encrypted.
==Branding==
[[Package:Dnscrypt]]


==eix==
{{console|body=
###i## echo "www.funtoo.org" > /etc/motd
}}


use eix to browse portage to see packages you can emerge.
add fortunes piped through cowsay to the shells


[[Package:Eix]]
{{console|body=
###i## emerge fortune-mod cowsay
###i## cd && echo "fortune {{!}} cowsay" >> .bashrc
}}


==eselect==
== Tweeks ==
If you're having problems with nouveau not playing sound over HDMI restart pulse audio:


use eselect to set various system options
{{console|body=
###i## pkill pulseaudio
}}


[[Package:Eselect]]
=== Disable DPMS ===
dpms disrespects screen blanking settings, so you can't watch movies in VLC without the screen turning off.


==Browser==
{{console|body=
emerge firefox-bin or install brave
###i## xset s off -dpms
[[Package:Brave]]
}}
 
{{console|body=
###i## cat > /etc/X11/xorg.conf.d/10-monitor.conf << "EOF"
Section "Extensions"
    Option      "DPMS" "Disable"
EndSection
EOF
}}


==Branding==
==Alternate Drives==
add fortunes piped through cowsay to the shells
{{warning|avoid adding fstab entries for drives that will not be present on other computers.  JFS will mount read only if fsck fails!}}
I have a jfs home drive labeled HOME.  This is the fstab entry to have funtoo use my rotating hard drive as /home
 
{{console|body=
###i## echo "LABEL=HOME /home jfs noatime 0 2" >> /etc/fstab
}}


==Swapping by file==
Loop mounts have performance penalties, prefer using swap partitions.
*For a swap file on $HOME:
{{console|body=
{{console|body=
###i## emerge fortune-mod cowsay
###i## dd if=/dev/zero of=/home/swapfile bs=1M count=4096 status=progress
###i## echo "fortune {{!}} cowsay" >> .bashrc
chmod 600 /home/swapfile
mkswap /home/swapfile
swapon /home/swapfile
echo "/home/swapfile none swap defaults 0 0" >> /etc/fstab
rc-update add swap boot
echo 'rc_need="localmount"' >> /etc/conf.d/swap
}}
}}


For a swap file on $VAR:
{{console|body=
{{console|body=
###i## echo "www.funtoo.org" > /etc/motd
###i## dd if=/dev/zero of=/var/swapfile bs=1M count=4096 status=progress
chmod 600 /var/swapfile
mkswap /var/swapfile
swapon /var/swapfile
echo "/var/swapfile none swap defaults 0 0" >> /etc/fstab
rc-update add swap boot
echo 'rc_need="localmount"' >> /etc/conf.d/swap
}}
}}


Line 160: Line 380:
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f}}
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f}}


==Remote Help==
[[Package:Logmein-hamachi]] is a easy to setup VPN allowing friends easy access to SSH should you run into trouble.
==Install Video==
coming soon.
{{#evt:service=youtube|id=https://youtu.be/PBAl9cchQac}}


{{#evt:service=youtube|id=https://www.youtube.com/watch?v=3MbJU4dTaTc|autoresize=true|alignment=center|urlargs="modestbranding=1&version=3&rel=0&origin=https://www.funtoo.org"}}
[[Category:HOWTO]]
[[Category:Install]]
[[Category:Official Documentation]]

Latest revision as of 03:22, January 3, 2023

Buy Paul, the author of this document, a coffee.

Undead USB, a linux nomadbsd alternative

This is an install strategy to target a USB flash stick as / (root) instead of a traditional hard drive or internal solid state drive. This isn't a live cd, this is a persistent root funtoo install where changes will keep living on. Since were treating a USB stick as a root partition, it requires much more space than a live usb like area31. 32gb minimum for gnome, 16gb are ok for xfce, lxde, lxqt, & server only type builds. get a fast usb3 drive even if you don't have usb3 ports as the flash memory on them is much faster than the flash memory on usb2 keys which will improve usability. This is a speed run of the official install x86_64 no swap & add JFS but does not intend to replace the official install. this is to make a more flexible, and robust install boot media than area31. undead usb can be used to build undead usb also. If you're reading this from linux, and have a blank 32gb USB drive you can mount up, and start building funtoo immediately. This guide has traditional hard drive aliasing, however it is targeted at building USB install media, and USB development sandbox installs. The user experience is like virtualization running on bare metal. If you run into a problem you can easily unplug permanent hard drives, and let a funtoo developer vpn into your fresh build to debug hardware directly.

  • grab root:
user $ sudo su
or
user $ su
  • identify the drive for installing:
root # lsblk -o name,size,label,partlabel
  • insert the usb drive, and run the above command again.

the first rule of funtoo is funtoo rules

set udev rules to make the drive you're installing to accessible at /dev/funtoo and partitions accessible at /dev/funtoo1 /dev/funtoo2 so on.

  • ide drive 3 example:
root # echo 'KERNEL=="hdd*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
  • sata drive 2 example:
root # echo 'KERNEL=="sdc*", SYMLINK+="funtoo%n"' > /etc/udev/rules.d/01-funtoo.rules
  • nvme nvme drive 1 example:
root # echo 'KERNEL=="nvme1n1", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
root # echo 'KERNEL=="nvme1n1p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
  • mmc drive 0 example:
root # echo 'KERNEL=="mmcblk0", SYMLINK+="funtoo"' > /etc/udev/rules.d/01-funtoo.rules
root # echo 'KERNEL=="mmcblk0p*", SYMLINK+="funtoo%n"' >> /etc/udev/rules.d/01-funtoo.rules
  • activate rules:
  • display what /dev/funtoo is tied to:
root # udevadm control --reload-rules && udevadm trigger
root # ls -al /dev/funtoo*

Partition

root # cgdisk /dev/funtoo
   Note

if cgdisk doesn't work load gdisk or fdisk to wipe out bad gpt tables, and then run cfdisk or cgdisk again.

delete everything.

Command:  new ↵
First sector: 
Last sector: +2M ↵
Hex Code: EF02 ↵
Enter name: BIOS Boot ↵

scroll down to large chunk of free space:

Command: new ↵
First sector: 
Last sector: +128M ↵
Hex Code: EF00 ↵
Enter name: BOOT ↵

scroll down to large chunk of free space:

Command: new ↵
First sector: 
Last sector: 
Hex Code:  8300 ↵
Enter name: FUNTOO ↵
Disk Drive: /dev/funtoo
                            Size: 62333952, 29.7 GiB

Part. #     Size        Partition Type            Partition Name
----------------------------------------------------------------
            1007.0 KiB  free space
   1        1024.0 KiB  BIOS boot partition	  BIOS Boot
   2        256.0 MiB   EFI System                BOOT
   3        29.5 GiB    Linux x86-64 root (/)     FUNTOO
Command: write ↵
Command: quit ↵
root # mkfs.vfat -F 32 /dev/funtoo2
root # fatlabel /dev/funtoo2 "BOOT"
root # mkfs.jfs /dev/funtoo3
root # jfs_tune -L "FUNTOO" /dev/funtoo3

Mount

root # mount /dev/funtoo3 /mnt/funtoo
root # mkdir /mnt/funtoo/boot
root # mount /dev/funtoo2 /mnt/funtoo/boot
  • if you're doing a permanent install mount any additional drives to /mnt/funtoo/var or /mnt/funtoo/home now.

Get Funtoo

You can pull your Subarches gnome tarball if you're installing to specific hardware, not moving the disk between systems, or installing to a SSD/nvme. Use generic 64 so your USB os can roam on strange hardware.

root # cd /mnt/funtoo
root # wget https://build.funtoo.org/1.4-release-std/x86-64bit/generic_64/gnome-latest.tar.xz
  • or for next
root # wget https://build.funtoo.org/next/x86-64bit/generic_64/stage3-latest.tar.xz
root # tar --numeric-owner --xattrs --xattrs-include='*' -xpf *latest* && mv *latest* /mnt/funtoo/mnt && mkdir /mnt/funtoo/mnt/funtoo

Load Funtoo

  • mount up:
root # cd /mnt/funtoo && mount -t proc none proc
mount --rbind /sys sys
mount --rbind /dev dev

chroot

  • chroot in:
root # env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l

change ps1

Mark that you're chrooted.

root # export PS1="undead $PS1"
  • you can auto login local terminals as root by doing this:
root # sed -i 's/agetty/agetty -J -a root/' /etc/inittab
  • Add fake root user, set the password, name, dns, tz, and clock:
root # useradd -o -g 0 -u 0 funtoo
root # passwd funtoo
root # echo 'hostname="undead"' > /etc/conf.d/hostname
root # echo "nameserver 1.1.1.1" > /etc/resolv.conf
root # ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime
root # rc-service busybox-ntpd restart
  • Deploy your fstab:
root # cat > /etc/fstab << "EOF"
LABEL=BOOT /boot vfat noauto,noatime 1 2
LABEL=FUNTOO / jfs noatime 0 1
tmpfs /var/tmp/portage tmpfs uid=portage,gid=portage,mode=775,noatime 0 0
EOF
  • compile in ram:
root # mkdir /var/tmp/portage
root # chown portage:portage /var/tmp/portage
root # mount /var/tmp/portage

merge

  • merge stuff:
root # cat > /etc/portage/package.use << "EOF"
sys-kernel/linux-firmware initramfs
app-emulation/qemu static-user qemu_user_targets_aarch64 qemu_user_targets_riscv64 qemu_user_targets_arm
dev-libs/glib static-libs
dev-libs/libpcre static-libs
sys-apps/attr static-libs
EOF
root # ego sync && emerge sys-boot/shim jfsutils grub haveged intel-microcode linux-firmware fchroot eix discord-bin firefox-bin media-fonts/noto etcher-bin logmein-hamachi fortune-mod cowsay

you can also install Package:Brave or other browsers.

  • funtoo's official chat:

https://discord.gg/BNUSpUU

  • Set your startup services:
root # rc-update del swap boot && rc-update add haveged && rc-update add busybox-ntpd && rc-update add logmein-hamachi && rc-update add gpm

/etc/boot.conf

  • Deploy your boot.conf:
root # cat > /etc/boot.conf << "EOF"
boot {
generate grub
	default "Funtoo Linux"
	timeout 0
}
"Funtoo Linux" {
kernel kernel[-v]
initrd initramfs[-v]
params += real_root=auto rootfstype=auto scandelay=10
	params += quiet gfxpayload=auto loglevel=1 splash=silent
}
EOF

GRUB

  • Install grub:
root # mount -o remount,rw /sys/firmware/efi/efivars
root # grub-install --target=i386-pc /dev/funtoo 
root # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="BOOT" --recheck  --no-nvram /dev/funtoo
root # cp /usr/share/shim/* /boot/EFI/BOOT/
root # ego boot update

final install size is around 15,000MB without noto. gnome can fit in a 16gb usb stick, but it's a very tight squeeze and unix file systems degrade in performance at around 80%-90% full. 32gb keys are good, 64gb are excellent, 128gb keys can emerge the world. We suggest several 32gb drives over few larger drives.

video

  • rebuild the kernel video drivers, or switch to nouveau to make your usb more universal.
root # emerge -1 x11-drivers/nvidia-kernel-modules
  • To run nouveau instead of nvidia:
root # cd /etc/modprobe.d && mkdir .backup
root # mv /etc/modprobe.d/n* .backup
root # ego profile mix-in gfxcard-nouveau
root # ego profile mix-in -gfxcard-nvidia

Profile Update

  • Set your profile before emerging world:

Funtoo_Profiles

  • The magic words to update everything:
root # emerge -avuND @world 
root # emerge -av --depclean
root # ego boot update

every so often you will want to purge sources to keep the stick as low memory usage as possible

root # rm /var/cache/portage/distfiles/*.tar.bz2
root # rm /var/cache/portage/distfiles/*.tar.xz
root # rm /var/cache/portage/distfiles/*.tar.gz

DONE!

clean dismount

root # exit
root # cd .. && sync 
root # umount -lR funtoo
root # eject /dev/funtoo
root # udisksctl power-off -b /dev/funtoo

uefi secure boot

  • press the f1 f2 f8 f9 f10 esc or delete to load bios.
  • set bios to load uefi usb devices first, disable secure boot, and enable legacy mode. save settings and exit.
  • press the f1 f2 f8 f9 f10 esc or delete to load your boot selection menu.
  • load EFI from file, point to /boot/EFI/BOOT/BOOTX64.EFI
  • shim will greet you with access violation warnings.
  • fiddle around to get mok manager to load up.
  • select add key
  • point to /boot/EFI/BOOT/grubx86.efi
  • press the f1 f2 f8 f9 f10 esc or delete key to load your boot selection menu.
  • load EFI from file, and again point to /boot/EFI/BOOT/BOOTX64.EFI which will now load funtoo under secure boot.

further securing

i use Package:Sudo, and disable root login.

i use Package:Dnsmasq to block advertising, and cache DNS traffic to accelerate web browsing.

i use Package:Dnscrypt to encrypt all dns requests so the vast majority of the web traffic from my undead usb is encrypted.

Admining

use Package:Eix to browse portage to see packages you can emerge.

use Package:Eselect to set various system options.

Branding

root # echo "www.funtoo.org" > /etc/motd

add fortunes piped through cowsay to the shells

root # emerge fortune-mod cowsay
root # cd && echo "fortune | cowsay" >> .bashrc

Tweeks

If you're having problems with nouveau not playing sound over HDMI restart pulse audio:

root # pkill pulseaudio

Disable DPMS

dpms disrespects screen blanking settings, so you can't watch movies in VLC without the screen turning off.

root # xset s off -dpms
root # cat > /etc/X11/xorg.conf.d/10-monitor.conf << "EOF"
Section "Extensions"
    Option      "DPMS" "Disable"
EndSection
EOF

Alternate Drives

   Warning

avoid adding fstab entries for drives that will not be present on other computers. JFS will mount read only if fsck fails!

I have a jfs home drive labeled HOME. This is the fstab entry to have funtoo use my rotating hard drive as /home

root # echo "LABEL=HOME /home jfs noatime 0 2" >> /etc/fstab

Swapping by file

Loop mounts have performance penalties, prefer using swap partitions.

  • For a swap file on $HOME:
root # dd if=/dev/zero of=/home/swapfile bs=1M count=4096 status=progress
chmod 600 /home/swapfile
mkswap /home/swapfile
swapon /home/swapfile
echo "/home/swapfile none swap defaults 0 0" >> /etc/fstab
rc-update add swap boot
echo 'rc_need="localmount"' >> /etc/conf.d/swap

For a swap file on $VAR:

root # dd if=/dev/zero of=/var/swapfile bs=1M count=4096 status=progress
chmod 600 /var/swapfile
mkswap /var/swapfile
swapon /var/swapfile
echo "/var/swapfile none swap defaults 0 0" >> /etc/fstab
rc-update add swap boot
echo 'rc_need="localmount"' >> /etc/conf.d/swap

windows 10 utc

if you're running ntp on undead usb you will want to set any dual booting windows clocks to be universal. in an administrator run command prompt run this:

reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f

Remote Help

Package:Logmein-hamachi is a easy to setup VPN allowing friends easy access to SSH should you run into trouble.

Install Video

coming soon.