Net Install
-Contents-
Step1..Netinstall CD
Step2....editors
Step3..media players
Step4....web browsers
lxde fast install
Live-Build
Bootstrapping
upgrading debian
go devuan
Configure
-Contents-
XFCE
LXDE/Openbox
Plain openbox
Bash config
Xterm - Xpdf
Rxvt-unicode
Ranger
Thunar
Firewall
XnView MP
Geany text editor
APT proxy
My Tutorials
-Contents-
Dual pane browsers
Media browsers
Image processing
XnView Tips
Video editors review
Kdenlive
Blender VSE
Cinelerra
Losslesscut
Dvd authoring
Cdrtools
CD copy
Uzbl browser
GPS/GIS
Useful apps
Libre writer
Lucky backup
Cloud syncing
Config migrate
System backup
Remote update
Partition copy
FOG partition imaging
Networking with nfs
Php local
Github pages
Virtual Box
CLI
-Contents-
Basic terminal
Unix commands
Vim
Bash renaming
FFmpeg
My scripts
Helps
-Contents-
Usb installer
Grub
Chrooting
User host name
Set locale time
Screen brightness
Screen res
Trackpad
Bluetooth reconnect
Printers
Undelete
Format usb stick
Problems
Bootstrapping no.2
My scripts
>
The script runs commands while chrooted into the system that was newly installed by debootstrap (using my bootstrap 1 script).
See my
bootstrapping
page for more info.
#!/bin/bash #run as root: sh /tmp/bootstrap_chroot.sh #already copied to the target install at /tmp #----------------------------------------------------------------------------------------- #confirm that the right device is mounted dev1=$(findmnt -fn -o SOURCE /) devmnt=$(findmnt -fn -o TARGET /) printf "\n\nDevice $dev1 mounted on $devmnt is now root.\n Is all OK? If the device given is your working box mounted at / then chroot did not work!\n (Enter to continue or type Q to abort)\n\n" read ans case ans in [Qq]*) exit 0 ;; esac #----------------------------------------------------------------------------------------- #updarte pkg lists apt update #----------------------------------------------------------------------------------------- #configure locale printf "\n\n.................................Installing locale and rsync...." apt install tzdata locales localepurge rsync keyboard-configuration yad dpkg-reconfigure locales dpkg-reconfigure keyboard-configuration #----------------------------------------------------------------------------------------- #write root fs to fstab file uuidroot=$(findmnt -fn -o UUID /) printf "UUID=$uuidroot\t/\text4\tdefaults\t0\t1" > /etc/fstab cat /etc/fstab blkid printf "\n\nBasic file system table written to /etc/fstab Is all OK? Hit Enter to continue or type E and enter to open nano editor\n\n" read ans case $ans in [Ee]*) nano /etc/fstab ;; esac #----------------------------------------------------------------------------------------- #install boot-loader apt install grub2 #----------------------------------------------------------------------------------------- #separate /home partition makeHome () { PS3="Select a partition - Warning it will be formatted! (type C to cancel): " options=($(ls /sys/class/block | grep -E '^(sd|hd|vd|nvme)[a-z][0-9]+|[0-9]p[0-9]+')) select opt in "${options[@]}"; do if [[ "$REPLY" == [cC] ]]; then echo "Cancelled" && return 1 elif [[ -n "$opt" ]]; then home=/dev/$opt mkfs.ext4 $home && mount $home /home && return 0 else printf "Invalid option" fi done } #write /home to fstab file writeHome () { uuidhome=$(findmnt -fn -o UUID $home) printf "UUID=$uuidhome\t/home\text4\tdefaults\t0\t2" >> /etc/fstab cat /etc/fstab printf "\n\nHome partition written to /etc/fstab ! Is all OK? Hit Enter to continue or type E and enter to open nano editor\n\n" read ans case ans in [Ee]*) nano /etc/fstab ;; esac } printf "\n\nDo you intend to use a separate /home partition?\n (Enter Y or N): \n\n" read ans case $ans in [nN]*) ;; [yY]*) makeHome && writeHome ;; esac #----------------------------------------------------------------------------------------- #root passwd printf "\n\nCreate a password for root" passwd #add user printf "\n\nCreate a new user for login...\nEnter the user name and press Enter\n\n" read user adduser $user #add groups printf "\n\n.................................Adding groups and user $user to groups" for g in dialout plugdev lpadmin admin clamav fuse audio ;do groupadd -f $g; done for g in netdev dialout plugdev lpadmin admin clamav fuse audio sudo ;do adduser $user $g; done #----------------------------------------------------------------------------------------- printf "\n Use a swap file? \n\tEnter Y or N\n" read swap case $swap in [Nn]*) break ;; [Yy]*) printf $"\nMaking a swap file...\n" fallocate -l 1G /swapfile mkswap /swapfile chmod 600 /swapfile printf "\nAdding swap fiile entry to fstab...\n" printf "swap\t/swapfile\tswap\tsw\t0\t0" >> /etc/fstab mkdir -p /etc/initramfs-tools/conf.d printf "RESUME=/swapfile" >> /etc/initramfs-tools/conf.d/resume ;; esac #----------------------------------------------------------------------------------------- #apt install basic pkg list apt install sudo iw rfkill lshw aptitude debootstrap linux-image-amd64 apt install xorg pm-utils util-linux hdparm cpufrequtils cpulimit alsa-utils openbox lxpanel lxtask lxpolkit network-manager-gnome tango-icon-theme obconf obmenu openbox-menu lxappearance-obconf moblin-cursor-theme rxvt-unicode htop elinks links2 gparted bash-completion xcape kbd less acpi elogind libpam-elogind xserver-xorg-legacy xserver-xorg-video-nvidia apt install firmware-amd-graphics firmware-linux firmware-linux-nonfree firmware-iwlwifi apt install ranger w3m w3m-img less xsel xvkbd atool mediainfo jhead ffmpegthumbnailer trash-cli exiftool feh imagemagick zip unzip bzip2 p7zip-full ntfs-3g blktool dosfstools mtools testdisk partclone fsarchiver zstd sshfs locate git cups gpa ntp yad rpl bluetooth blueman mtp-tools go-mtpfs adb pmount udiskie gvfs cdrdao discover rename apt-file xbacklight apt install gtk2-engines gtk2-engines-xfce gtk2-engines-murrine gtk2-engines-cleanice gtk2-engines-aurora qt5-style-plugins libgtk-3-common libgtk-4-common printf "\n\n.................................Done installing pkgs with apt!" #----------------------------------------------------------------------------------------- update-grub #----------------------------------------------------------------------------------------- #just as a reminder to avoid any problems with command not found printf "export PATH=$PATH:$HOME/scripts:/usr/sbin:/usr/local/bin" >> $user/.bashrc #----------------------------------------------------------------------------------------- printf " Exit chroot and unmount devices? press Enter if that's OK - you can then attempt to boot into the new system! Or type Q and Enter to quit the script, stay in chroot and continue work on the new install at the command line." read ans case ans in [Qq]*) exit 0 ;; esac exit