-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathcreate-debian-rootfs.sh
More file actions
executable file
·65 lines (55 loc) · 1.75 KB
/
create-debian-rootfs.sh
File metadata and controls
executable file
·65 lines (55 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
# Copyright (C) 2025 Gleb Balykov
#
# This file is part of fdtd3d.
#
# fdtd3d is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# fdtd3d is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with fdtd3d; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Create Debian rootfs
#
# ./create-debian-rootfs <arch> <version> <rootfs_dir>
# or
# ./create-debian-rootfs <arch> <version>
set -e
# Architecture of rootfs
ARCH=$1; shift
if [ "$ARCH" != "arm64" ] && [ "$ARCH" != "armhf" ] && [ "$ARCH" != "ppc64el" ] && [ "$ARCH" != "riscv64" ] && [ "$ARCH" != "loongarch64" ]; then
echo "Only next architectures are supported: arm64, armhf, ppc64el, riscv64, loongarch64 (loong64)."
exit 1
fi
if [ "$ARCH" == "loongarch64" ]; then
ARCH="loong64"
fi
# Version
VERSION=$1; shift
if [ "$VERSION" != "sid" ]; then
echo "Only next debian versions are supported: sid."
exit 1
fi
# Rootfs directory (can be empty)
ROOTFS=$1;
if [ "$ROOTFS" == "" ]; then
if [ "$ARCH" == "loong64" ]; then
ROOTFS=`pwd`/rootfs/loongarch64
else
ROOTFS=`pwd`/rootfs/$ARCH
fi
mkdir -p $ROOTFS
fi
PACKAGES=""
URL=http://ftp.debian.org/debian/
qemu-debootstrap --foreign --arch $ARCH --components main,universe $VERSION $ROOTFS $URL
#chroot $ROOTFS symlinks -cr /usr