mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
move mnt dir
This commit is contained in:
parent
a89d0b946f
commit
603e959f99
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,12 +3,8 @@
|
||||
rr*.img
|
||||
rr*.vmdk
|
||||
*.zip
|
||||
.buildroot
|
||||
test*.sh
|
||||
cache
|
||||
*.bak
|
||||
*.o
|
||||
**.mo
|
||||
tests
|
||||
/extractor
|
||||
Changelog*
|
@ -1,19 +0,0 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
build-img:
|
||||
cmds:
|
||||
- ./img-gen.sh
|
||||
|
||||
build-docker-img:
|
||||
dir: docker
|
||||
cmds:
|
||||
- ./build.sh
|
||||
|
||||
compile-kpatch:
|
||||
dir: kpatch
|
||||
cmds:
|
||||
- make clean all
|
||||
- mv kpatch ../files/initrd/opt/rr/
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
zh_CN.UTF-8
|
67
img-gen.sh
67
img-gen.sh
@ -1,67 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
. scripts/func.sh
|
||||
|
||||
# Convert po2mo
|
||||
convertpo2mo "files/initrd/opt/rr/lang"
|
||||
|
||||
IMAGE_FILE="rr.img"
|
||||
gzip -dc "files/grub.img.gz" >"${IMAGE_FILE}"
|
||||
fdisk -l "${IMAGE_FILE}"
|
||||
|
||||
LOOPX=$(sudo losetup -f)
|
||||
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
|
||||
|
||||
echo "Mounting image file"
|
||||
sudo rm -rf "/tmp/files/p1"
|
||||
sudo rm -rf "/tmp/files/p3"
|
||||
sudo mkdir -p "/tmp/files/p1"
|
||||
sudo mkdir -p "/tmp/files/p3"
|
||||
sudo mount ${LOOPX}p1 "/tmp/files/p1"
|
||||
sudo mount ${LOOPX}p3 "/tmp/files/p3"
|
||||
|
||||
echo "Get Buildroot"
|
||||
[ ! -f "/tmp/files/p3/bzImage-rr" -o ! -f "/tmp/files/p3/initrd-rr" ] && getBuildroot "/tmp/files/p3" true
|
||||
[ ! -f "/tmp/files/p3/bzImage-rr" -o ! -f "/tmp/files/p3/initrd-rr" ] && return 1
|
||||
|
||||
read -p "Press enter to continue"
|
||||
|
||||
echo "Repack initrd"
|
||||
repackInitrd "/tmp/files/p3/initrd-rr" "files/initrd"
|
||||
|
||||
echo "Copying files"
|
||||
sudo cp -Rf "files/p1/"* "/tmp/files/p1"
|
||||
sudo cp -Rf "files/p3/"* "/tmp/files/p3"
|
||||
# Get extractor, LKM, addons and Modules
|
||||
getCKs "/tmp/files/p3/cks" true
|
||||
getLKMs "/tmp/files/p3/lkms" true
|
||||
getAddons "/tmp/files/p3/addons" true
|
||||
getModules "/tmp/files/p3/modules" true
|
||||
getExtractor "/tmp/files/p3/extractor"
|
||||
|
||||
sync
|
||||
|
||||
# update.zip
|
||||
sha256sum update-list.yml update-check.sh >sha256sum
|
||||
zip -9j update.zip update-list.yml update-check.sh
|
||||
while read F; do
|
||||
if [ -d "/tmp/${F}" ]; then
|
||||
FTGZ="$(basename "/tmp/${F}").tgz"
|
||||
tar -czf "${FTGZ}" -C "/tmp/${F}" .
|
||||
sha256sum "${FTGZ}" >>sha256sum
|
||||
zip -9j update.zip "${FTGZ}"
|
||||
sudo rm -f "${FTGZ}"
|
||||
else
|
||||
(cd $(dirname "/tmp/${F}") && sha256sum $(basename "/tmp/${F}")) >>sha256sum
|
||||
zip -9j update.zip "/tmp/${F}"
|
||||
fi
|
||||
done <<<$(yq '.replace | explode(.) | to_entries | map([.key])[] | .[]' update-list.yml)
|
||||
zip -9j update.zip sha256sum
|
||||
|
||||
echo "Unmount image file"
|
||||
sudo umount "/tmp/files/p1"
|
||||
sudo umount "/tmp/files/p3"
|
||||
|
||||
sudo losetup --detach ${LOOPX}
|
@ -1,93 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2022 Ing <https://github.com/wjz304>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# sudo apt update
|
||||
# sudo apt install -y autoconf automake autopoint gettext build-essential bison flex libtool dosfstools e2fsprogs
|
||||
#
|
||||
|
||||
GRUB=${1:-"grub-2.12"}
|
||||
BIOS=${2:-"i386-pc i386-efi x86_64-efi"}
|
||||
NAME=${3:-"RR"}
|
||||
|
||||
|
||||
# Create image
|
||||
rm -f grub.img
|
||||
dd if=/dev/zero of=grub.img bs=1M seek=1024 count=0
|
||||
echo -e "n\np\n1\n\n+50M\nn\np\n2\n\n+50M\nn\np\n3\n\n\na\n1\nw\nq\n" | fdisk grub.img
|
||||
fdisk -l grub.img
|
||||
|
||||
LOOPX=$(sudo losetup -f)
|
||||
sudo losetup -P ${LOOPX} grub.img
|
||||
sudo mkdosfs -F32 -n ${NAME}1 ${LOOPX}p1
|
||||
sudo mkfs.ext2 -F -L ${NAME}2 ${LOOPX}p2
|
||||
sudo mkfs.ext4 -F -L ${NAME}3 ${LOOPX}p3
|
||||
|
||||
rm -rf ${NAME}1
|
||||
mkdir -p ${NAME}1
|
||||
sudo mount ${LOOPX}p1 ${NAME}1
|
||||
|
||||
sudo mkdir -p ${NAME}1/EFI
|
||||
sudo mkdir -p ${NAME}1/boot/grub
|
||||
cat >device.map <<EOF
|
||||
(hd0) ${LOOPX}
|
||||
EOF
|
||||
# mv: failed to preserve ownership for 'RR1/boot/grub/device.map': Operation not permitted
|
||||
#
|
||||
# This problem can actually be ignored. The file has been moved successfully.
|
||||
#
|
||||
# This error usually occurs when you try to move a file on a file system that does not support ownership, such as FAT32 or NTFS.
|
||||
# On these file systems, the owners and groups of all files are fixed and cannot be changed.
|
||||
#
|
||||
# If you need to move files on such a file system,
|
||||
# you can use the --no-preserve=ownership option to tell the mv command not to try to preserve ownership of the files.
|
||||
#
|
||||
sudo mv device.map ${NAME}1/boot/grub/device.map
|
||||
|
||||
|
||||
# Install grub
|
||||
rm -rf grub
|
||||
git clone --depth=1 -b ${GRUB} https://git.savannah.gnu.org/git/grub.git grub
|
||||
pushd grub
|
||||
./bootstrap
|
||||
./autogen.sh
|
||||
popd
|
||||
|
||||
for B in ${BIOS}; do
|
||||
b=(${B//-/ })
|
||||
echo "Make ${B} ..."
|
||||
mkdir -p grub/${B}
|
||||
RET=0
|
||||
pushd grub/${B}
|
||||
../configure --prefix=$PWD/usr -sbindir=$PWD/sbin --sysconfdir=$PWD/etc --disable-werror --target=${b[0]} --with-platform=${b[1]}
|
||||
make -j$(nproc) && make -j$(nproc) install
|
||||
RET=$?
|
||||
popd
|
||||
[ ${RET:-0} -ne 0 ] && break
|
||||
|
||||
echo "Install ${B} ..."
|
||||
args=""
|
||||
args+=" ${LOOPX} --target=${B} --no-floppy --recheck --grub-mkdevicemap=${NAME}1/boot/grub/device.map --boot-directory=${NAME}1/boot"
|
||||
if [[ "${B}" == *"efi" ]]; then
|
||||
args+=" --efi-directory=${NAME}1 --removable --no-nvram"
|
||||
else
|
||||
args+=" --root-directory=${NAME}1"
|
||||
fi
|
||||
sudo grub/${B}/grub-install ${args}
|
||||
done
|
||||
|
||||
if [ -d ${NAME}1/boot/grub/fonts -a -f /usr/share/grub/unicode.pf2 ]; then
|
||||
sudo cp /usr/share/grub/unicode.pf2 ${NAME}1/boot/grub/fonts
|
||||
fi
|
||||
|
||||
sudo sync
|
||||
|
||||
sudo umount ${LOOPX}p1
|
||||
sudo losetup -d ${LOOPX}
|
||||
sudo rm -rf ${NAME}1
|
||||
|
||||
rm -f grub.img.gz
|
||||
gzip grub.img
|
@ -1,8 +1,8 @@
|
||||
remove:
|
||||
replace:
|
||||
"files/p1/RR_VERSION": "/mnt/p1/RR_VERSION"
|
||||
"files/p1/boot/grub/grub.cfg": "/mnt/p1/boot/grub/grub.cfg"
|
||||
"files/p1/EFI/BOOT/SynoBootLoader.conf": "/mnt/p1/EFI/BOOT/SynoBootLoader.conf"
|
||||
"files/p1/EFI/BOOT/SynoBootLoader.efi": "/mnt/p1/EFI/BOOT/SynoBootLoader.efi"
|
||||
"files/p3/bzImage-rr": "/mnt/p3/bzImage-rr"
|
||||
"files/p3/initrd-rr": "/mnt/p3/initrd-rr"
|
||||
"files/mnt/p1/RR_VERSION": "/mnt/p1/RR_VERSION"
|
||||
"files/mnt/p1/boot/grub/grub.cfg": "/mnt/p1/boot/grub/grub.cfg"
|
||||
"files/mnt/p1/EFI/BOOT/SynoBootLoader.conf": "/mnt/p1/EFI/BOOT/SynoBootLoader.conf"
|
||||
"files/mnt/p1/EFI/BOOT/SynoBootLoader.efi": "/mnt/p1/EFI/BOOT/SynoBootLoader.efi"
|
||||
"files/mnt/p3/bzImage-rr": "/mnt/p3/bzImage-rr"
|
||||
"files/mnt/p3/initrd-rr": "/mnt/p3/initrd-rr"
|
||||
|
Loading…
x
Reference in New Issue
Block a user