Compare commits
16 commits
Author | SHA1 | Date | |
---|---|---|---|
timoxa0 | 944dcede43 | ||
timoxa0 | 45494b4a19 | ||
timoxa0 | 3ea54540d3 | ||
timoxa0 | 3cc523c05a | ||
timoxa0 | ef45c9a769 | ||
timoxa0 | 6839150a68 | ||
timoxa0 | 9836fb911b | ||
timoxa0 | 22be3bc759 | ||
timoxa0 | 6c4d6008e3 | ||
timoxa0 | 6ef4d5dcbc | ||
timoxa0 | 23bd454bd4 | ||
timoxa0 | 7cb92f54a4 | ||
timoxa0 | 39ea56da5c | ||
timoxa0 | e0e352cb92 | ||
timoxa0 | acd0b15df0 | ||
timoxa0 | fb3f3a1611 |
21
README.md
21
README.md
|
@ -1,21 +0,0 @@
|
||||||
mklni - Image builder for nabu, running in alpine chroot
|
|
||||||
=======
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
1. Create a new directory
|
|
||||||
2. Download [mklni](https://git.timoxa0.su/timoxa0/mklni/src/branch/main/mklni.sh) in that directory
|
|
||||||
3. Allow executing mklin ```chmod +x mklni```
|
|
||||||
4. Install chroot ```sudo ./mklni install```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
- Setup build chroot ```sudo ./mklni install```
|
|
||||||
|
|
||||||
- Remove build chroot ```sudo ./mklni uninstall```
|
|
||||||
|
|
||||||
- Make image ```sudo ./mklni build path/to/lnibuild```. Image will be created in same directory
|
|
||||||
|
|
||||||
- Clean raw images ```sudo ./mklni -r or --cleanraw```
|
|
||||||
|
|
||||||
- Clean build chroots ```sudo ./mklni -c or --cleanup```
|
|
||||||
|
|
||||||
- Chroot into ```sudo ./mklni chroot```
|
|
12
mklni
12
mklni
|
@ -74,7 +74,7 @@ arguments() {
|
||||||
update
|
update
|
||||||
break 2 ;;
|
break 2 ;;
|
||||||
|
|
||||||
-r | -c | -w | --cleanraw | --cleanup | --cleancache)
|
-r | -c | --cleanraw | --cleanup)
|
||||||
run_makelni "$opt"
|
run_makelni "$opt"
|
||||||
break 2 ;;
|
break 2 ;;
|
||||||
|
|
||||||
|
@ -236,15 +236,15 @@ install_chroot()
|
||||||
log "Failed to update apk repos" error
|
log "Failed to update apk repos" error
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
log "Installing packages"
|
log "Installing pakages"
|
||||||
chroot "$CHROOTDIR" apk add --quiet shadow umount fish bash git zstd debootstrap pixz losetup rsync pv wget e2fsprogs e2fsprogs-extra libarchive-tools coreutils go libusb libusb-dev pkgconfig || {
|
chroot "$CHROOTDIR" apk add --quiet shadow fish bash git debootstrap pixz losetup rsync pv wget e2fsprogs e2fsprogs-extra libarchive-tools coreutils go libusb libusb-dev pkgconfig || {
|
||||||
log "Failed to install packages" error
|
log "Failed to install packages" error
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
chroot "$CHROOTDIR" chsh -s /usr/bin/fish root
|
chroot "$CHROOTDIR" chsh -s /usr/bin/fish root
|
||||||
|
|
||||||
log "Cloning makelni repo"
|
log "Cloning makelni repo"
|
||||||
chroot "$CHROOTDIR" git clone --recursive "https://git.timoxa0.su/timoxa0/makelni.git" /makelni || {
|
chroot "$CHROOTDIR" git clone --quiet "https://git.timoxa0.su/timoxa0/makelni.git" /makelni || {
|
||||||
log "Failed to clone makelni repo" error
|
log "Failed to clone makelni repo" error
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ install_chroot()
|
||||||
|
|
||||||
log "Installing lon-tool"
|
log "Installing lon-tool"
|
||||||
{
|
{
|
||||||
chroot "$CHROOTDIR" git clone --recursive https://git.timoxa0.su/timoxa0/lon-tool.git /lon-tool-src &&
|
chroot "$CHROOTDIR" git clone --quiet https://git.timoxa0.su/timoxa0/lon-tool.git /lon-tool-src &&
|
||||||
chroot "$CHROOTDIR" /bin/bash -c 'cd /lon-tool-src && rev=$(git describe --abbrev=4 --dirty --always --tags) && go get git.timoxa0.su/timoxa0/lon-tool/cmd && go build -ldflags "-X git.timoxa0.su/timoxa0/lon-tool/cmd.version=$rev" -o /bin/lon-tool main.go'
|
chroot "$CHROOTDIR" /bin/bash -c 'cd /lon-tool-src && rev=$(git describe --abbrev=4 --dirty --always --tags) && go get git.timoxa0.su/timoxa0/lon-tool/cmd && go build -ldflags "-X git.timoxa0.su/timoxa0/lon-tool/cmd.version=$rev" -o /bin/lon-tool main.go'
|
||||||
|
|
||||||
} || {
|
} || {
|
||||||
|
@ -392,7 +392,7 @@ update()
|
||||||
}
|
}
|
||||||
|
|
||||||
log "Updating makelni"
|
log "Updating makelni"
|
||||||
chroot "$CHROOTDIR" /bin/bash -c "cd /makelni && git submodule update --init && git pull --recurse-submodules --rebase"
|
chroot "$CHROOTDIR" /bin/bash -c "cd /makelni && git pull"
|
||||||
local exitcode=$?
|
local exitcode=$?
|
||||||
|
|
||||||
detach_chroot || {
|
detach_chroot || {
|
||||||
|
|
Loading…
Reference in a new issue