New structure of project and work flow
This commit is contained in:
211
NOTES/Chroot_Distro_Build.txt
Normal file
211
NOTES/Chroot_Distro_Build.txt
Normal file
@@ -0,0 +1,211 @@
|
||||
############################
|
||||
#### SETUP & INFO ####
|
||||
############################
|
||||
|
||||
## WEBSITES
|
||||
Window Managers :
|
||||
http://xwinman.org/
|
||||
Source List Generator :
|
||||
https://repogen.simplylinux.ch/index.php
|
||||
Themes :
|
||||
http://gnome-look.org/
|
||||
Debootstrap Versions:
|
||||
http://packages.ubuntu.com/search?keywords=debootstrap&searchon=names&suite=all§ion=all
|
||||
Ubuntu-Mini-Remix :
|
||||
http://www.ubuntu-mini-remix.org/
|
||||
SYSLINUX (Booting Live systems or install state)
|
||||
http://www.syslinux.org/wiki/index.php?title=HowTos#New_users (THIS COVERS BOOT METHODS FOR USB, CD, EFI, ETC)
|
||||
http://www.syslinux.org/wiki/index.php?title=ISOLINUX (THIS CREATES THE BOOT STRUCTURE FOR THE ISO!!!)
|
||||
SYSLINUX Archive (Needed for isolinux.bin && ldlinux.c32 to follow instructions in above link!!)
|
||||
https://www.kernel.org/pub/linux/utils/boot/syslinux/
|
||||
NON SYSLINUX ARCHIVE METHOD (Try and get files from here)
|
||||
/usr/lib/syslinux/
|
||||
|
||||
Good Reference :
|
||||
http://willhaley.com/blog/create-a-custom-debian-stretch-live-environment-ubuntu-17-zesty/
|
||||
Other :
|
||||
https://wiki.ubuntu.com/Releases
|
||||
http://archive.ubuntu.com/ubuntu/
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/
|
||||
|
||||
--- SIDE NOTE ---
|
||||
Ubuntu Mini Remix contains:
|
||||
- ubuntu-minimal (this is a metapackage, details at https://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=ubuntu-minimal&searchon=names&subword=1&version=all&release=all)
|
||||
- ubuntu-standard (this is a metapackage, details at https://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=ubuntu-standard&searchon=names&subword=1&version=all&release=all)
|
||||
- casper
|
||||
- lupin-casper
|
||||
|
||||
## SETUP DIR STRUCTURE
|
||||
*** buildDir is where you are maintaining the squashfs and iso bits
|
||||
|
||||
mkdir -p buildDir/iso/{casper,isolinux,install}
|
||||
## holds where squshfs goes after modding.
|
||||
## HAS ALL UNCOMPRESSED ISO BITS EXCLUDING SQUASHFS
|
||||
## OR CONTAINS DEBOOTSTRAP GENERATED DIR STRUCTURE
|
||||
mkdir buildDir/squashfs-root/
|
||||
## this is where we can extract a squashfs
|
||||
## from an iso OR generate our own from debootstrap.
|
||||
** EXTRACTING A SQUASHFS CREATES THIS
|
||||
** ONLY DO WHEN DEBOOTSTRAPING
|
||||
|
||||
## PACKAGES NEEDED PRIOR TO DOING ANYTHING
|
||||
sudo apt-get install xnest xserver-xephyr syslinux squashfs-tools genisoimage debootstrap
|
||||
## debootstrap needs to be the version you're building
|
||||
## ie, building vivid then need vivid's debootstrap
|
||||
## link above has versions to dl
|
||||
|
||||
## FOR GUI CHROOT LIKE ENVIRONMENT
|
||||
**** In a seperate terminal from build terminal
|
||||
Xnest -ac :10 -geometry 1920x1080 ## Monitor resolution
|
||||
OR
|
||||
Xephyr -resizeable -screen 1920x1080 :10
|
||||
|
||||
############################
|
||||
#### BUILD METHODS ####
|
||||
############################
|
||||
|
||||
## BUILDING FROM AN Ubuntu-Mini-Remix
|
||||
-- DL Ubuntu-Mini-Remix [link above] and mount it
|
||||
-- copy out its contents to the iso/ dir
|
||||
GET THE HIDDEN .disk/ dir! ISO WILL FAIL OTHERWISE!!
|
||||
-- from that, copy the iso/casper/filesystem.squashfs to the same dir
|
||||
as iso/ dir
|
||||
-- unsquashfs filesystem.squashfs
|
||||
|
||||
|
||||
## BUILDING FROM AN DEBOOTSTRAP
|
||||
## same location as iso/
|
||||
sudo debootstrap --variant=buildd <code name such as vivid> <chroot path> http://archive.ubuntu.com/ubuntu/
|
||||
OR
|
||||
sudo debootstrap --arch=amd64 vivid squashfs-root/ ## For 32bit use --arch=i386
|
||||
|
||||
|
||||
############################
|
||||
#### BUILD PROCESS ####
|
||||
############################
|
||||
|
||||
cd squashfs-root/
|
||||
sudo mount -t proc proc proc/
|
||||
sudo mount -t sysfs sys sys/
|
||||
sudo mount -o bind /dev dev/
|
||||
sudo cp /etc/resolv.conf etc/
|
||||
sudo cp /etc/hosts etc/hosts ## do this one if in debootstrap
|
||||
|
||||
sudo chroot . bash
|
||||
export HOME=/root
|
||||
export LC_ALL=C
|
||||
export DISPLAY=:10
|
||||
|
||||
## GET sourcelist from source list generator [link above]
|
||||
nano it to /etc/apt/sources.list
|
||||
apt-get upgrade
|
||||
|
||||
## INSTALL AND MOD STUFF
|
||||
apt-get update
|
||||
apt-get install --yes dbus
|
||||
apt-get install -y ubuntu-standard casper lupin-casper
|
||||
apt-get install -y laptop-detect os-prober
|
||||
apt-get install -y linux-generic
|
||||
|
||||
## tasksel lets you ionstall various setups
|
||||
apt-get install -y xserver-xorg xorg xinit ubiquity-frontend-gtk tasksel synaptic aptitude apt-xapian-index
|
||||
|
||||
## just a ref
|
||||
apt-get install mate-core sddm
|
||||
|
||||
## change live cd user
|
||||
nano etc/casper.conf
|
||||
|
||||
|
||||
############################
|
||||
#### CLEAN PROCESS ####
|
||||
############################
|
||||
|
||||
##Clean the older non-used kernels to save space:
|
||||
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
|
||||
|
||||
## CLEAN SYSTEM
|
||||
apt-get autoremove --purge
|
||||
apt-get autoclean
|
||||
rm -rf tmp/*
|
||||
rm /etc/resolv.conf
|
||||
rm /var/lib/dbus/machine-id
|
||||
rm /sbin/initctl
|
||||
dpkg-divert --rename --remove /sbin/initctl
|
||||
|
||||
## in chroot or outer
|
||||
umount -lf dev/
|
||||
umount -lf proc/
|
||||
umount -lf sys/
|
||||
exit
|
||||
|
||||
EDIT to change names of Ubuntu
|
||||
iso/isolinux/txt.cfg
|
||||
|
||||
|
||||
################################
|
||||
#### Recreate manifest ####
|
||||
################################
|
||||
|
||||
sudo chroot squashfs-root/ dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee iso/casper/filesystem.manifest
|
||||
sudo cp -v iso/casper/filesystem.manifest iso/casper/filesystem.manifest-desktop
|
||||
|
||||
PUT IN SCRIPT >>>
|
||||
|
||||
REMOVE='ubiquity ubiquity-frontend-gtk ubiquity-frontend-kde casper lupin-casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4'
|
||||
for i in $REMOVE
|
||||
do
|
||||
sudo sed -i "/${i}/d" iso/casper/filesystem.manifest-desktop
|
||||
done
|
||||
|
||||
############################
|
||||
#### MAKE SQUASHFS ####
|
||||
############################
|
||||
|
||||
If this Customised Remix is to potentially be installed on some systems then
|
||||
the /boot folder will be needed. To allow the Customised Cd to be an
|
||||
installer Cd, compress the entire chroot folder with this command:
|
||||
|
||||
## avg compression
|
||||
sudo mksquashfs squashfs-root/ iso/casper/filesystem.squashfs
|
||||
|
||||
## best compression
|
||||
sudo mksquashfs squashfs-root/ iso/casper/filesystem.squashfs -comp xz -e squashfs-root/boot
|
||||
|
||||
|
||||
Then write the filesystem.size file, which is needed by the installer:
|
||||
|
||||
sudo chmod 644 iso/casper/filesystem.size
|
||||
printf $(sudo du -sx --block-size=1 squashfs-root/ | cut -f1) > iso/casper/filesystem.size
|
||||
sudo chmod 444 iso/casper/filesystem.size
|
||||
|
||||
############################
|
||||
#### Calculate MD5 ####
|
||||
############################
|
||||
|
||||
This calculates the md5sum of everything in the image folder,
|
||||
except the file named md5sum.txt.
|
||||
|
||||
sudo -s
|
||||
(cd iso && find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > SHA256SUMS)
|
||||
exit
|
||||
|
||||
###############################
|
||||
#### Create ISO Image ####
|
||||
###############################
|
||||
|
||||
Create iso from the image directory using the command-line
|
||||
|
||||
cd iso/
|
||||
|
||||
OPTION 1::
|
||||
## Works for me....
|
||||
sudo mkisofs -D -r -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../Sol-OSv3.iso .
|
||||
|
||||
OR
|
||||
|
||||
sudo mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../Sol-OSv3.iso ./
|
||||
|
||||
OPTION 2::
|
||||
## Hasn't worked for me....
|
||||
sudo mkisofs -r -no-emul-boot -boot-load-size 4 -o ../ubu-mini.iso -b isolinux/isolinux.bin -c isolinux/boot.cat ./
|
65
NOTES/EXAMPLE-ISOLINUX-CFG
Normal file
65
NOTES/EXAMPLE-ISOLINUX-CFG
Normal file
@@ -0,0 +1,65 @@
|
||||
# Comboot modules:
|
||||
# * menu.c32 - provides a text menu
|
||||
# * vesamenu.c32 - provides a graphical menu
|
||||
# * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
|
||||
# * hdt.c32 - hardware detection tool
|
||||
# * reboot.c32 - reboots the system
|
||||
#
|
||||
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
|
||||
# If /usr and /boot are on the same file system, symlink the files instead
|
||||
# of copying them.
|
||||
#
|
||||
# If you do not use a menu, a 'boot:' prompt will be shown and the system
|
||||
# will boot automatically after 5 seconds.
|
||||
#
|
||||
# Note: A ^ in a label before a character means one can use that to quickly select it.
|
||||
#
|
||||
# HELPFUL SOURCES
|
||||
# http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project
|
||||
# https://wiki.archlinux.org/index.php/Syslinux
|
||||
# The wikis provides further configuration examples
|
||||
|
||||
# search path for the c32 support libraries (libcom32, libutil etc.)
|
||||
PATH
|
||||
|
||||
# Need this for images as backgrounds
|
||||
DEFAULT vesamenu.c32
|
||||
# If 1 it'd present the boot prompt
|
||||
PROMPT 0
|
||||
# wait 15 seconds
|
||||
TIMEOUT 150
|
||||
MENU RESOLUTION 1024 768
|
||||
MENU BACKGROUND splash.png
|
||||
MENU TITLE Sol-OS
|
||||
|
||||
## Theming
|
||||
MENU COLOR border 30;44 #40ffffff #a0000000 std
|
||||
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
|
||||
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
|
||||
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
|
||||
MENU COLOR help 37;40 #c0ffffff #a0000000 std
|
||||
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
|
||||
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
|
||||
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
|
||||
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
|
||||
|
||||
## Menu Options
|
||||
LABEL solosLive
|
||||
MENU label ^Try Sol-OS
|
||||
# kernel /casper/vmlinuz.efi
|
||||
# append file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash ---
|
||||
|
||||
LABEL solosInstall
|
||||
MENU label ^Install Sol-OS
|
||||
# kernel /casper/vmlinuz.efi
|
||||
# append file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash ---
|
||||
|
||||
MENU SEPARATOR
|
||||
|
||||
LABEL hd
|
||||
menu label ^Boot from first hard disk
|
||||
localboot 0x80
|
||||
|
||||
LABEL reboot
|
||||
MENU LABEL ^Reboot
|
||||
COM32 reboot.c32
|
103
NOTES/Example_Bashrc.txt
Normal file
103
NOTES/Example_Bashrc.txt
Normal file
@@ -0,0 +1,103 @@
|
||||
# Enable Tab auto complete -- must have bash-completion package too
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
|
||||
# Simpler color in terminal scripts
|
||||
bold=`echo -en "\e[1m"`
|
||||
underline=`echo -en "\e[4m"`
|
||||
dim=`echo -en "\e[2m"`
|
||||
strickthrough=`echo -en "\e[9m"`
|
||||
blink=`echo -en "\e[5m"`
|
||||
reverse=`echo -en "\e[7m"`
|
||||
hidden=`echo -en "\e[8m"`
|
||||
normal=`echo -en "\e[0m"`
|
||||
black=`echo -en "\e[30m"`
|
||||
red=`echo -en "\e[31m"`
|
||||
green=`echo -en "\e[32m"`
|
||||
orange=`echo -en "\e[33m"`
|
||||
blue=`echo -en "\e[34m"`
|
||||
purple=`echo -en "\e[35m"`
|
||||
aqua=`echo -en "\e[36m"`
|
||||
gray=`echo -en "\e[37m"`
|
||||
darkgray=`echo -en "\e[90m"`
|
||||
lightred=`echo -en "\e[91m"`
|
||||
lightgreen=`echo -en "\e[92m"`
|
||||
lightyellow=`echo -en "\e[93m"`
|
||||
lightblue=`echo -en "\e[94m"`
|
||||
lightpurple=`echo -en "\e[95m"`
|
||||
lightaqua=`echo -en "\e[96m"`
|
||||
white=`echo -en "\e[97m"`
|
||||
default=`echo -en "\e[39m"`
|
||||
BLACK=`echo -en "\e[40m"`
|
||||
RED=`echo -en "\e[41m"`
|
||||
GREEN=`echo -en "\e[42m"`
|
||||
ORANGE=`echo -en "\e[43m"`
|
||||
BLUE=`echo -en "\e[44m"`
|
||||
PURPLE=`echo -en "\e[45m"`
|
||||
AQUA=`echo -en "\e[46m"`
|
||||
GRAY=`echo -en "\e[47m"`
|
||||
DARKGRAY=`echo -en "\e[100m"`
|
||||
LIGHTRED=`echo -en "\e[101m"`
|
||||
LIGHTGREEN=`echo -en "\e[102m"`
|
||||
LIGHTYELLOW=`echo -en "\e[103m"`
|
||||
LIGHTBLUE=`echo -en "\e[104m"`
|
||||
LIGHTPURPLE=`echo -en "\e[105m"`
|
||||
LIGHTAQUA=`echo -en "\e[106m"`
|
||||
WHITE=`echo -en "\e[107m"`
|
||||
DEFAULT=`echo -en "\e[49m"`
|
||||
export LESS_TERMCAP_so=${white}${BLACK} # begin standout-mode - info box
|
||||
export LESS_TERMCAP_mb=${lightred} # begin blinking
|
||||
export LESS_TERMCAP_md=${lightyellow} # begin bold
|
||||
export LESS_TERMCAP_us=${lightgreen} # begin underline
|
||||
export LESS_TERMCAP_me=${default}${DEFAULT} # end mode
|
||||
export LESS_TERMCAP_se=${default}${DEFAULT} # end standout-mode
|
||||
export LESS_TERMCAP_ue=${default}${DEFAULT} # end underline
|
||||
|
||||
# Functions
|
||||
w3mimg () {
|
||||
w3m -o imgdisplay=/usr/lib/w3m/w3mimgdisplay $1
|
||||
}
|
||||
|
||||
phpServer () {
|
||||
php -S 127.0.0.1:"$1"
|
||||
}
|
||||
|
||||
|
||||
# Aliases
|
||||
|
||||
# frameebuffer MPLAYER
|
||||
alias mplayerfb="mplayer -vo fbdev2 -zoom -x 800 -y 600"
|
||||
|
||||
# Python Server && PHP Server
|
||||
alias pySimpleServer='python -m SimpleHTTPServer'
|
||||
alias pyCgiServer='python -m CGIHTTPServer'
|
||||
|
||||
#clear like Windows
|
||||
alias cls='clear'
|
||||
|
||||
# reboot / halt / poweroff / etc
|
||||
alias reboot='sudo /sbin/reboot'
|
||||
alias poweroff='sudo /sbin/poweroff'
|
||||
alias halt='sudo /sbin/halt'
|
||||
alias shutdown='sudo /sbin/shutdown'
|
||||
|
||||
#gdb no copyright start and use better gui look
|
||||
alias gdb='gdb -tui -q'
|
||||
|
||||
# Gui select files wih Ctrl+G and python
|
||||
select_files() {
|
||||
local files="$(python -c 'import Tkinter, tkFileDialog; Tkinter.Tk().withdraw(); print(" ".join(map(lambda x: "'"'"'"+x+"'"'"'", tkFileDialog.askopenfilename(multiple=1))))')"
|
||||
READLINE_LINE="${READLINE_LINE:0:READLINE_POINT}$files${READLINE_LINE:READLINE_POINT}"
|
||||
READLINE_POINT=$((READLINE_POINT + ${#files}))
|
||||
}
|
||||
bind -x '"\C-g":select_files'
|
||||
|
||||
# Terminal look and feel with logo and then custom prompt line
|
||||
# Week Day/Month/Day : Time -- user@group -- current dir path
|
||||
export PS1="${lightyellow} _ _ _ _ _ _
|
||||
/ \ / \ / \ / \ / \ / \
|
||||
( S ( o ( l ( - ( O ( S )
|
||||
\_/ \_/ \_/ \_/ \_/ \_/ ${default}
|
||||
${lightred}Welcome to the dark side of the moon, $USER!${default}
|
||||
\[\e[32m\]\d\[\e[m\]: \[\e[36m\]\@\[\e[m\] -- \[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\] -- \[\e[35m\]\w\[\e[m\] \\$ "
|
36
NOTES/Useful_Commands.txt
Normal file
36
NOTES/Useful_Commands.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
## Removes all packages but the ones specified and its dependencies
|
||||
# !~nubuntu-minimal
|
||||
aptitude markauto '~i !~nlinux-image-generic !~nubuntu-minimal !~nubuntu-standard !~ncasper !~nlupin-casper !~naptitude !~napt-get !~napt'
|
||||
OR
|
||||
// NOT EXACT!!!! LOOOK UP
|
||||
apt-mark auto '!~nlinux-image-generic !~nubuntu-minimal !~nubuntu-standard !~ncasper !~nlupin-casper !~aptitude'
|
||||
|
||||
## Get installed pkgs and insert to txt file
|
||||
apt list --installed | awk '{print $1}' | cut -f1 -d"/" > installed-list.txt
|
||||
|
||||
## Remove pkgs in the made txt file
|
||||
apt-get remove --purge `cat installed-list.txt`
|
||||
|
||||
## Clean un-needed pkgs
|
||||
apt-get autoremove --purge
|
||||
|
||||
## Remove old install pkgs
|
||||
apt-get autoclean
|
||||
|
||||
## Update pkg apt lists
|
||||
apt-get update
|
||||
|
||||
## Updates pkgs
|
||||
apt-get upgrade
|
||||
|
||||
|
||||
apt-get remove --purge shotwell* rhythmbox* thunderbird* totem* remmina* seahorse* libreoffice* gedit* gnome-* \
|
||||
vino* whoopsie* cheese* evince* firefox* eog* aisleriot* unity* yelp* totem* transmission-gtk* gparted* ubuntu-docs ubuntu-software* \
|
||||
zeitgeist-core zeitgeist-datahub onboard nautilus* simple-scan libqt4* qt4* adwaita-icon-theme* apport-gtk* bamfdaemon* \
|
||||
baobab* checkbox-converged* checkbox-gui* deja-dup* fcitx-config-common* fcitx-config-gtk* fcitx-frontend-gtk3* \
|
||||
file-roller* gcr* gir1.2-appindicator3-0.1* gir1.2-gtk-3.0* gir1.2-gtksource-3.0* gir1.2-peas-1.0* gir1.2-rb-3.0* \
|
||||
gir1.2-timezonemap-1.0* gir1.2-vte-2.91* gir1.2-webkit2-4.0* gir1.2-wnck-3.0* gkbd-capplet* gstreamer1.0-clutter-3.0* \
|
||||
gucharmap* gvfs-backends* humanity-icon-theme* indicator-application* indicator-appmenu* indicator-printers* \
|
||||
language-selector-gnome* samba* cups* libunity* alsa* pulseaudio* ubuntu-drivers-common* ubuntu-keyring* ubuntu-minimal* \
|
||||
ubuntu-mobile-icons* ubuntu-release-upgrader-core* ubuntu-settings* ubuntu-sounds* ubuntu-system-service* \
|
||||
ubuntu-touch-sounds* ubuntu-ui-toolkit-theme* ubuntu-wallpapers* ubuntu-wallpapers-xenial*
|
13
NOTES/listInstalledPKGs.sh
Normal file
13
NOTES/listInstalledPKGs.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
function main() {
|
||||
apt list --installed > temp.txt
|
||||
echo "aptitude" >> temp.txt ## Apend aptitude to list
|
||||
lineCount=$(wc -l temp.txt | awk '{printf $1}') ## Get line count minus one to remove first line
|
||||
tail -n$((lineCount - 1)) temp.txt > cleanedList.sh ## Get all lines but the first
|
||||
echo "aptitude markauto ~i \\ " > temp.txt
|
||||
awk '{ FS = "/"} NF{printf " !~" $1}' cleanedList.sh >> temp.txt
|
||||
rm cleanedList.sh
|
||||
mv temp.txt cleanedList.sh
|
||||
}
|
||||
main;
|
Reference in New Issue
Block a user