Do not use global variables for virtual filesystems
This commit is contained in:
parent
18de454e58
commit
fad173b551
1 changed files with 16 additions and 26 deletions
42
build.sh
42
build.sh
|
@ -19,16 +19,6 @@ export QUILT_NO_DIFF_INDEX=1
|
|||
export QUILT_NO_DIFF_TIMESTAMPS=1
|
||||
export QUILT_REFRESH_ARGS='-p ab'
|
||||
|
||||
export ROOTFS_DEV_DIR="$ROOTFS_DIR/dev"
|
||||
export ROOTFS_DEVPTS_DIR="$ROOTFS_DIR/dev/pts"
|
||||
export ROOTFS_PROC_DIR="$ROOTFS_DIR/proc"
|
||||
export ROOTFS_DEV_DIR="$ROOTFS_DIR/sys"
|
||||
|
||||
export MOUNT_DEV_DIR="$MOUNT_DIR/dev"
|
||||
export MOUNT_DEVPTS_DIR="$MOUNT_DIR/dev/pts"
|
||||
export MOUNT_PROC_DIR="$MOUNT_DIR/proc"
|
||||
export MOUNT_SYS_DIR="$MOUNT_DIR/sys"
|
||||
|
||||
# dependencies_check
|
||||
# $@ Dependnecy files to check
|
||||
#
|
||||
|
@ -161,10 +151,10 @@ if [ ! -d "$ROOTFS_DIR" ]; then
|
|||
http://mirrordirector.raspbian.org/raspbian/" || rmdir "$ROOTFS_DIR/debootstrap"
|
||||
fi
|
||||
|
||||
mount --bind /dev "$ROOTFS_DEV_DIR"
|
||||
mount --bind /dev/pts "$ROOTFS_DEVPTS_DIR"
|
||||
mount -t proc proc "$ROOTFS_PROC_DIR"
|
||||
mount --bind /sys "$ROOTFS_SYS_DIR"
|
||||
mount --bind /dev "$ROOTFS_DIR/dev"
|
||||
mount --bind /dev/pts "$ROOTFS_DIR/dev/pts"
|
||||
mount -t proc proc "$ROOTFS_DIR/proc"
|
||||
mount --bind /sys "$ROOTFS_DIR/sys"
|
||||
|
||||
install -m 644 files/sources.list "$ROOTFS_DIR/etc/apt/"
|
||||
install -m 644 files/raspi.list "$ROOTFS_DIR/etc/apt/sources.list.d/"
|
||||
|
@ -334,10 +324,10 @@ EOF
|
|||
|
||||
install -v -d "$ROOTFS_DIR/etc/systemd/system/dhcpcd.service.d"
|
||||
|
||||
umount "$ROOTFS_SYS_DIR"
|
||||
umount "$ROOTFS_PROC_DIR"
|
||||
umount "$ROOTFS_DEVPTS_DIR"
|
||||
umount "$ROOTFS_DEV_DIR"
|
||||
umount "$ROOTFS_DIR/sys"
|
||||
umount "$ROOTFS_DIR/proc"
|
||||
umount "$ROOTFS_DIR/dev/pts"
|
||||
umount "$ROOTFS_DIR/dev"
|
||||
|
||||
unmount_image "$IMG_FILE"
|
||||
|
||||
|
@ -395,10 +385,10 @@ mount -v $BOOT_DEV "$MOUNT_DIR/boot" -t vfat
|
|||
|
||||
rsync -aHAXx --exclude var/cache/apt/archives "$ROOTFS_DIR/" "$MOUNT_DIR/"
|
||||
|
||||
mount --bind /dev "$MOUNT_DEV_DIR"
|
||||
mount --bind /dev/pts "$MOUNT_DEVPTS_DIR"
|
||||
mount -t proc proc "$MOUNT_PROC_DIR"
|
||||
mount --bind /sys "$MOUNT_SYS_DIR"
|
||||
mount --bind /dev "$MOUNT_DIR/dev"
|
||||
mount --bind /dev/pts "$MOUNT_DIR/dev/pts"
|
||||
mount -t proc proc "$MOUNT_DIR/proc"
|
||||
mount --bind /sys "$MOUNT_DIR/sys"
|
||||
|
||||
if [ -e "$MOUNT_DIR/etc/ld.so.preload" ]; then
|
||||
mv "$MOUNT_DIR/etc/ld.so.preload" "$MOUNT_DIR/etc/ld.so.preload.disabled"
|
||||
|
@ -460,10 +450,10 @@ chroot_mount << EOF
|
|||
fake-hwclock save
|
||||
EOF
|
||||
|
||||
umount "$MOUNT_SYS_DIR"
|
||||
umount "$MOUNT_PROC_DIR"
|
||||
umount "$MOUNT_DEVPTS_DIR"
|
||||
umount "$MOUNT_DEV_DIR"
|
||||
umount "$MOUNT_DIR/sys"
|
||||
umount "$MOUNT_DIR/proc"
|
||||
umount "$MOUNT_DIR/dev/pts"
|
||||
umount "$MOUNT_DIR/dev"
|
||||
|
||||
ROOT_DEV=$(mount | grep "$MOUNT_DIR " | cut -f1 -d' ')
|
||||
|
||||
|
|
Reference in a new issue