APS wiki added & added verify() #5
2 changed files with 48 additions and 5 deletions
30
aps
30
aps
|
@ -12,6 +12,7 @@ die() {
|
|||
exit 2
|
||||
}
|
||||
run_package_script() { # --- $2 is the package path, and $1 is the script to run
|
||||
# --- RPS installs to root
|
||||
{
|
||||
if [ -x "${2}/${1}" ]; then
|
||||
echo ":: Running ${1}"
|
||||
|
@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run
|
|||
fi
|
||||
}
|
||||
}
|
||||
install_local_package() {
|
||||
install_local_package() { # --- Install-Local-Package install package LOCALLY!
|
||||
[ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..."
|
||||
# Extract the package
|
||||
echo "[*] Copying package ${1} into temporary location ${temp_location}..."
|
||||
|
@ -69,7 +70,7 @@ install_local_package() {
|
|||
unset pkg_config_makedepends
|
||||
unset pkg_config_depends
|
||||
}
|
||||
remove_local_package() {
|
||||
remove_local_package() { # --- Removes local packges
|
||||
pkg_path="${installed_pkg_database}/${1}"
|
||||
[ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..."
|
||||
payloadfiles_path="${pkg_path}/payloadfiles"
|
||||
|
@ -79,7 +80,7 @@ remove_local_package() {
|
|||
rm -rv "${pkg_path}"
|
||||
echo "[*] Removal complete for target ${pkg_name}"
|
||||
}
|
||||
sync_local_repo_database() {
|
||||
sync_local_repo_database() { # --- syncs to local repo databese
|
||||
echo ":: Syncing local database for repo ${1}..."
|
||||
if [ ! -d "${locpkg_database}/${1}" ]; then
|
||||
echo ":: Local database for repo ${1} does not exist, cloning..."
|
||||
|
@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${
|
|||
[ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found."
|
||||
install_local_package "${locpkg_database}/${1}/${2}"
|
||||
}
|
||||
upgrade() {
|
||||
upgrade() { # --- upgrades
|
||||
echo ":: Upgrading installed packages..."
|
||||
unset_config_values
|
||||
cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..."
|
||||
|
@ -117,7 +118,24 @@ upgrade() {
|
|||
unset pkg_config_depends
|
||||
done
|
||||
}
|
||||
main() {
|
||||
help(){
|
||||
echo 'To install locally, do:'
|
||||
echo 'aps install'
|
||||
echo
|
||||
echo 'To install from repo (synchronize), do:'
|
||||
echo 'aps sync'
|
||||
echo
|
||||
echo 'To remove local packages, do:'
|
||||
echo 'aps remove'
|
||||
echo
|
||||
echo 'To upgrade repos, do:'
|
||||
echo 'aps upgrade'
|
||||
echo
|
||||
}
|
||||
local_installed_list(){
|
||||
ls ${locpkg_database}
|
||||
}
|
||||
main() { # --- does soem stuff
|
||||
if [ -f "${lock}" ]; then
|
||||
echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}."
|
||||
exit 1
|
||||
|
@ -131,6 +149,8 @@ main() {
|
|||
[ -z "${2}" ] && die "[*] No targets specified."
|
||||
install_package_from_repo "official" "${2}" ;;
|
||||
upgrade) upgrade "official" ;;
|
||||
help) help ;;
|
||||
list) local_installed_list ;;
|
||||
*) die "[E] Invalid option ${1}, exiting..." ;;
|
||||
esac
|
||||
rm "${lock}"
|
||||
|
|
23
wiki/APS.md
Normal file
23
wiki/APS.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
### BEGGINING
|
||||
Now basic deps for aps are `make`, `gcc`, `git`. So, using aps, there are some variables, so, let's see them.
|
||||
### VARIABLES
|
||||
- `temp_location` is as says ***it's a temporary location***.
|
||||
- `install_root` is as (again) as says ***it's a install root***.
|
||||
- `installed_pkg_databese` is a ***database of installed pkgs*** for *APS*.
|
||||
- `locpkg_database` is a ***database of pkgs in the repo*** that are for *APS*
|
||||
- `lock` locks the package manager
|
||||
### FUNCTIONS
|
||||
The standard APS functions are as, follows:
|
||||
- `install` installs **but locally**
|
||||
- `sync` serves as update and install from repo
|
||||
- `remove` removes packages
|
||||
- `upgrade` upgrades installed packages
|
||||
- `help` displays help
|
||||
- `list` lists packages
|
||||
### SETUP & INSTALL
|
||||
Let's get an iso, i, personally (author, Ohio2) prefer [xubuntu](https://xubuntu.org/). You got an iso, congrats! Now flash it with some flashing software, like, [balenaEtcher](https://www.balena.io/etcher/) to your usb or something. If you boot up the iso & *you select i want to try out xubuntu*, you'll land up on xfce. Go to start > terminal. Now if you setup partitions earlier on, skip it. Now type in `sudo -i gparted`, make a msdos partition table, make two new partitions, one that's your disk size or whatever you prefer -512M and a second one... that's 512M large. Ok save and write. Mount /dev/sda1 to wherever you want, now wget aps: `wget https://git.hippoz.xyz/alnux/aps/raw/branch/master/aps`, edit aps to `install_root` variable to wherever you mounted /dev/sda1. If you want to, add make default variables like this, edit /etc/make.conf add `MAKEOPTS=-j` whatever was your processor number by x1.5 and save. Now that's done let's sync our first package, `aps sync make` and all for the packages that you want... `aps list`. Now do `mount /dev/sda2 /mnt/boot`, `aps sync grub-configmake` and run `<prefix/here>/usr/bin/grub-configmake`, it should do all the necessary things... Now you can compile linux... get it from it's source to wherever you pick, do what you need to do, configure it by `make menuconfig`, make `make`, install `make modules_install DESTDIR="<prefix/here>" && make install DESTDIR="<prefix/here>` and mount every root directory with `-o rebind` and chroot andd install grub via grub-install --root-directory=<prefix/here>, you can reboot now, and you can boot
|
||||
### TROUBLESHOOTING
|
||||
Git or Gzip need zlib:
|
||||
- `apt install zlib1g-dev`
|
||||
Linux to compile needs:
|
||||
- `apt install bison flex libssl-dev`
|
Loading…
Reference in a new issue